diff --git a/CHANGELOG.md b/CHANGELOG.md index b45d780..4eca851 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,4 +34,5 @@ LithoSphere's first release! #### Added - Model layer type (.dae, .gltf, .obj) +- Bearings (directional arrows) for clamped vector points - Keyboard navigation controls (wasd = pan, qe = rotate, rf = dolly, tg: zoom) diff --git a/README.md b/README.md index 4e041d8..1891769 100644 --- a/README.md +++ b/README.md @@ -38,13 +38,13 @@ Head over to the **[Documentation](https://nasa-ammos.github.io/LithoSphere/)** - Overlay (upcoming) - Tile - Tile3d - - Model (upcoming) + - Model - Adjustable planetary radii - Scripts for tiling Digital Elevation Maps (DEM) and custom projections - Various tile formats: - TMS - WMTS - - WMS (upcoming) + - WMS - Full Proj4 support to render tile sets of any projection - A suite of pluginable UI controls: - Compass diff --git a/dist/lithosphere.js b/dist/lithosphere.js index 8be5d0a..0f8d774 100644 --- a/dist/lithosphere.js +++ b/dist/lithosphere.js @@ -1,2265 +1 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define("LithoSphere", [], factory); - else if(typeof exports === 'object') - exports["LithoSphere"] = factory(); - else - root["LithoSphere"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "C:\\Users\\tsoliman\\Documents\\Projects\\LithoSphere\\dist/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./src/lithosphere.ts"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js": -/*!*******************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js ***! - \*******************************************************************/ -/*! exports provided: B3DMLoaderBase */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoaderBase\", function() { return B3DMLoaderBase; });\n/* harmony import */ var _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/FeatureTable.js */ \"./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js\");\n// B3DM File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Batched3DModel/README.md\r\n\r\n\r\n\r\nclass B3DMLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => this.parse( buffer ) );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\t// TODO: this should be able to take a uint8array with an offset and length\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 28-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'b3dm' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableJSONByteLength = dataView.getUint32( 12, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableBinaryByteLength = dataView.getUint32( 16, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableJSONByteLength = dataView.getUint32( 20, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableBinaryByteLength = dataView.getUint32( 24, true );\r\n\r\n\t\t// Feature Table\r\n\t\tconst featureTableStart = 28;\r\n\t\tconst featureTableBuffer = buffer.slice(\r\n\t\t\tfeatureTableStart,\r\n\t\t\tfeatureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst featureTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"FeatureTable\"](\r\n\t\t\tfeatureTableBuffer,\r\n\t\t\t0,\r\n\t\t\tfeatureTableJSONByteLength,\r\n\t\t\tfeatureTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\t// Batch Table\r\n\t\tconst batchTableStart = featureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength;\r\n\t\tconst batchTableBuffer = buffer.slice(\r\n\t\t\tbatchTableStart,\r\n\t\t\tbatchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst batchTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"BatchTable\"](\r\n\t\t\tbatchTableBuffer,\r\n\t\t\tfeatureTable.getData( 'BATCH_LENGTH' ),\r\n\t\t\t0,\r\n\t\t\tbatchTableJSONByteLength,\r\n\t\t\tbatchTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\tconst glbStart = batchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength;\r\n\t\tconst glbBytes = new Uint8Array( buffer, glbStart, byteLength - glbStart );\r\n\r\n\t\treturn {\r\n\t\t\tversion,\r\n\t\t\tfeatureTable,\r\n\t\t\tbatchTable,\r\n\t\t\tglbBytes,\r\n\t\t};\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js": -/*!*******************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js ***! - \*******************************************************************/ -/*! exports provided: CMPTLoaderBase */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoaderBase\", function() { return CMPTLoaderBase; });\n// CMPT File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Composite/README.md\r\n\r\nclass CMPTLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\t\tthis.workingPath = '';\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => {\r\n\r\n\t\t\t\tif ( this.workingPath === '' ) {\r\n\r\n\t\t\t\t\tconst splits = url.split( /\\\\\\//g );\r\n\t\t\t\t\tsplits.pop();\r\n\t\t\t\t\tthis.workingPath = splits.join( '/' );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.parse( buffer );\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 16-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'cmpt' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst tilesLength = dataView.getUint32( 12, true );\r\n\r\n\t\tconst tiles = [];\r\n\t\tlet offset = 16;\r\n\t\tfor ( let i = 0; i < tilesLength; i ++ ) {\r\n\r\n\t\t\tconst tileView = new DataView( buffer, offset, 12 );\r\n\t\t\tconst tileMagic =\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 0 ) ) +\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 1 ) ) +\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 2 ) ) +\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 3 ) );\r\n\t\t\tconst tileVersion = tileView.getUint32( 4, true );\r\n\t\t\tconst byteLength = tileView.getUint32( 8, true );\r\n\r\n\t\t\tconst tileBuffer = new Uint8Array( buffer, offset, byteLength );\r\n\t\t\ttiles.push( {\r\n\r\n\t\t\t\ttype: tileMagic,\r\n\t\t\t\tbuffer: tileBuffer,\r\n\t\t\t\tversion: tileVersion,\r\n\r\n\t\t\t} );\r\n\t\t\toffset += byteLength;\r\n\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tversion,\r\n\t\t\ttiles,\r\n\t\t};\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js": -/*!*******************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js ***! - \*******************************************************************/ -/*! exports provided: I3DMLoaderBase */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoaderBase\", function() { return I3DMLoaderBase; });\n/* harmony import */ var _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/FeatureTable.js */ \"./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js\");\n/* harmony import */ var _utilities_arrayToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/arrayToString.js */ \"./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js\");\n// I3DM File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Instanced3DModel/README.md\r\n\r\n\r\n\r\n\r\nclass I3DMLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\t\tthis.workingPath = '';\r\n\r\n\t}\r\n\r\n\tresolveExternalURL( url ) {\r\n\r\n\t\tif ( /^[^\\\\/]/ ) {\r\n\r\n\t\t\treturn this.workingPath + '/' + url;\r\n\r\n\t\t} else {}\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => {\r\n\r\n\t\t\t\tif ( this.workingPath === '' ) {\r\n\r\n\t\t\t\t\tconst splits = url.split( /\\\\\\//g );\r\n\t\t\t\t\tsplits.pop();\r\n\t\t\t\t\tthis.workingPath = splits.join( '/' );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.parse( buffer );\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 32-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'i3dm' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableJSONByteLength = dataView.getUint32( 12, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableBinaryByteLength = dataView.getUint32( 16, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableJSONByteLength = dataView.getUint32( 20, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableBinaryByteLength = dataView.getUint32( 24, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst gltfFormat = dataView.getUint32( 28, true );\r\n\r\n\t\t// Feature Table\r\n\t\tconst featureTableStart = 32;\r\n\t\tconst featureTableBuffer = buffer.slice(\r\n\t\t\tfeatureTableStart,\r\n\t\t\tfeatureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst featureTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"FeatureTable\"](\r\n\t\t\tfeatureTableBuffer,\r\n\t\t\t0,\r\n\t\t\tfeatureTableJSONByteLength,\r\n\t\t\tfeatureTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\t// Batch Table\r\n\t\tconst batchTableStart = featureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength;\r\n\t\tconst batchTableBuffer = buffer.slice(\r\n\t\t\tbatchTableStart,\r\n\t\t\tbatchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst batchTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"BatchTable\"](\r\n\t\t\tbatchTableBuffer,\r\n\t\t\tfeatureTable.getData( 'INSTANCES_LENGTH' ),\r\n\t\t\t0,\r\n\t\t\tbatchTableJSONByteLength,\r\n\t\t\tbatchTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\tconst glbStart = batchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength;\r\n\t\tconst bodyBytes = new Uint8Array( buffer, glbStart, byteLength - glbStart );\r\n\r\n\t\tlet glbBytes = null;\r\n\t\tlet promise = null;\r\n\t\tif ( gltfFormat ) {\r\n\r\n\t\t\tglbBytes = bodyBytes;\r\n\t\t\tpromise = Promise.resolve();\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconst externalUri = this.resolveExternalURL( Object(_utilities_arrayToString_js__WEBPACK_IMPORTED_MODULE_1__[\"arrayToString\"])( bodyBytes ) );\r\n\t\t\tpromise = fetch( externalUri, this.fetchOptions )\r\n\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\t\tthrow new Error( `I3DMLoaderBase : Failed to load file \"${ externalUri }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.then( buffer => {\r\n\r\n\t\t\t\t\tglbBytes = new Uint8Array( buffer );\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t\treturn promise.then( () => {\r\n\r\n\t\t\treturn {\r\n\t\t\t\tversion,\r\n\t\t\t\tfeatureTable,\r\n\t\t\t\tbatchTable,\r\n\t\t\t\tglbBytes,\r\n\t\t\t};\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js": -/*!*******************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js ***! - \*******************************************************************/ -/*! exports provided: PNTSLoaderBase */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoaderBase\", function() { return PNTSLoaderBase; });\n/* harmony import */ var _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/FeatureTable.js */ \"./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js\");\n// PNTS File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/PointCloud/README.md\r\n\r\n\r\n\r\nclass PNTSLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => this.parse( buffer ) );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 28-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'pnts' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableJSONByteLength = dataView.getUint32( 12, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableBinaryByteLength = dataView.getUint32( 16, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableJSONByteLength = dataView.getUint32( 20, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableBinaryByteLength = dataView.getUint32( 24, true );\r\n\r\n\t\t// Feature Table\r\n\t\tconst featureTableStart = 28;\r\n\t\tconst featureTableBuffer = buffer.slice(\r\n\t\t\tfeatureTableStart,\r\n\t\t\tfeatureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst featureTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"FeatureTable\"](\r\n\t\t\tfeatureTableBuffer,\r\n\t\t\t0,\r\n\t\t\tfeatureTableJSONByteLength,\r\n\t\t\tfeatureTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\t// Batch Table\r\n\t\tconst batchTableStart = featureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength;\r\n\t\tconst batchTableBuffer = buffer.slice(\r\n\t\t\tbatchTableStart,\r\n\t\t\tbatchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst batchTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"BatchTable\"](\r\n\t\t\tbatchTableBuffer,\r\n\t\t\tfeatureTable.getData( 'BATCH_LENGTH' ) || featureTable.getData( 'POINTS_LENGTH' ),\r\n\t\t\t0,\r\n\t\t\tbatchTableJSONByteLength,\r\n\t\t\tbatchTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\treturn {\r\n\t\t\tversion,\r\n\t\t\tfeatureTable,\r\n\t\t\tbatchTable,\r\n\t\t};\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js": -/*!**********************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js ***! - \**********************************************************************/ -/*! exports provided: TilesRendererBase */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TilesRendererBase\", function() { return TilesRendererBase; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utilities_urlJoin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/urlJoin.js */ \"./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js\");\n/* harmony import */ var _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utilities/LRUCache.js */ \"./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js\");\n/* harmony import */ var _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utilities/PriorityQueue.js */ \"./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js\");\n/* harmony import */ var _traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./traverseFunctions.js */ \"./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js\");\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/3d-tiles-renderer/src/base/constants.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n// Function for sorting the evicted LRU items. We should evict the shallowest depth first.\r\nconst priorityCallback = tile => 1 / ( tile.__depthFromRenderedParent + 1 );\r\n\r\nclass TilesRendererBase {\r\n\r\n\tget rootTileSet() {\r\n\r\n\t\tconst tileSet = this.tileSets[ this.rootURL ];\r\n\t\tif ( ! tileSet || tileSet instanceof Promise ) {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn tileSet;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tget root() {\r\n\r\n\t\tconst tileSet = this.rootTileSet;\r\n\t\treturn tileSet ? tileSet.root : null;\r\n\r\n\t}\r\n\r\n\tconstructor( url ) {\r\n\r\n\t\t// state\r\n\t\tthis.tileSets = {};\r\n\t\tthis.rootURL = url;\r\n\t\tthis.fetchOptions = {};\r\n\r\n\t\tthis.preprocessURL = null;\r\n\r\n\t\tconst lruCache = new _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_2__[\"LRUCache\"]();\r\n\t\tlruCache.unloadPriorityCallback = priorityCallback;\r\n\r\n\t\tconst downloadQueue = new _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_3__[\"PriorityQueue\"]();\r\n\t\tdownloadQueue.maxJobs = 4;\r\n\t\tdownloadQueue.priorityCallback = priorityCallback;\r\n\r\n\t\tconst parseQueue = new _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_3__[\"PriorityQueue\"]();\r\n\t\tparseQueue.maxJobs = 1;\r\n\t\tparseQueue.priorityCallback = priorityCallback;\r\n\r\n\t\tthis.lruCache = lruCache;\r\n\t\tthis.downloadQueue = downloadQueue;\r\n\t\tthis.parseQueue = parseQueue;\r\n\t\tthis.stats = {\r\n\t\t\tparsing: 0,\r\n\t\t\tdownloading: 0,\r\n\t\t\tfailed: 0,\r\n\t\t\tinFrustum: 0,\r\n\t\t\tused: 0,\r\n\t\t\tactive: 0,\r\n\t\t\tvisible: 0,\r\n\t\t};\r\n\t\tthis.frameCount = 0;\r\n\r\n\t\t// options\r\n\t\tthis.errorTarget = 6.0;\r\n\t\tthis.errorThreshold = Infinity;\r\n\t\tthis.loadSiblings = true;\r\n\t\tthis.displayActiveTiles = false;\r\n\t\tthis.maxDepth = Infinity;\r\n\t\tthis.stopAtEmptyTiles = true;\r\n\r\n\t}\r\n\r\n\ttraverse( beforecb, aftercb ) {\r\n\r\n\t\tconst tileSets = this.tileSets;\r\n\t\tconst rootTileSet = tileSets[ this.rootURL ];\r\n\t\tif ( ! rootTileSet || ! rootTileSet.root ) return;\r\n\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"traverseSet\"])( rootTileSet.root, beforecb, aftercb );\r\n\r\n\t}\r\n\r\n\t// Public API\r\n\tupdate() {\r\n\r\n\t\tconst stats = this.stats;\r\n\t\tconst lruCache = this.lruCache;\r\n\t\tconst tileSets = this.tileSets;\r\n\t\tconst rootTileSet = tileSets[ this.rootURL ];\r\n\t\tif ( ! ( this.rootURL in tileSets ) ) {\r\n\r\n\t\t\tthis.loadRootTileSet( this.rootURL );\r\n\t\t\treturn;\r\n\r\n\t\t} else if ( ! rootTileSet || ! rootTileSet.root ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\tconst root = rootTileSet.root;\r\n\r\n\t\tstats.inFrustum = 0,\r\n\t\tstats.used = 0,\r\n\t\tstats.active = 0,\r\n\t\tstats.visible = 0,\r\n\t\tthis.frameCount ++;\r\n\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"determineFrustumSet\"])( root, this );\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"markUsedSetLeaves\"])( root, this );\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"skipTraversal\"])( root, this );\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"toggleTiles\"])( root, this );\r\n\r\n\t\tlruCache.scheduleUnload();\r\n\r\n\t}\r\n\r\n\t// Overrideable\r\n\tparseTile( buffer, tile, extension ) {\r\n\r\n\t\treturn null;\r\n\r\n\t}\r\n\r\n\tdisposeTile( tile ) {\r\n\r\n\t}\r\n\r\n\tpreprocessNode( tile, parentTile, tileSetDir ) {\r\n\r\n\t\tif ( tile.content ) {\r\n\r\n\t\t\t// Fix old file formats\r\n\t\t\tif ( ! ( 'uri' in tile.content ) && 'url' in tile.content ) {\r\n\r\n\t\t\t\ttile.content.uri = tile.content.url;\r\n\t\t\t\tdelete tile.content.url;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( tile.content.uri ) {\r\n\r\n\t\t\t\ttile.content.uri = Object(_utilities_urlJoin_js__WEBPACK_IMPORTED_MODULE_1__[\"urlJoin\"])( tileSetDir, tile.content.uri );\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// NOTE: fix for some cases where tilesets provide the bounding volume\r\n\t\t\t// but volumes are not present.\r\n\t\t\tif (\r\n\t\t\t\ttile.content.boundingVolume &&\r\n\t\t\t\t! (\r\n\t\t\t\t\t'box' in tile.content.boundingVolume ||\r\n\t\t\t\t\t'sphere' in tile.content.boundingVolume ||\r\n\t\t\t\t\t'region' in tile.content.boundingVolume\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\r\n\t\t\t\tdelete tile.content.boundingVolume;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\ttile.parent = parentTile;\r\n\t\ttile.children = tile.children || [];\r\n\r\n\t\tconst uri = tile.content && tile.content.uri;\r\n\t\tif ( uri ) {\r\n\r\n\t\t\t// \"content\" should only indicate loadable meshes, not external tile sets\r\n\t\t\tconst isExternalTileSet = /\\.json$/i.test( tile.content.uri );\r\n\t\t\ttile.__externalTileSet = isExternalTileSet;\r\n\t\t\ttile.__contentEmpty = isExternalTileSet;\r\n\r\n\t\t} else {\r\n\r\n\t\t\ttile.__externalTileSet = false;\r\n\t\t\ttile.__contentEmpty = true;\r\n\r\n\t\t}\r\n\r\n\t\ttile.__error = 0.0;\r\n\t\ttile.__inFrustum = false;\r\n\t\ttile.__isLeaf = false;\r\n\r\n\t\ttile.__usedLastFrame = false;\r\n\t\ttile.__used = false;\r\n\r\n\t\ttile.__wasSetVisible = false;\r\n\t\ttile.__visible = false;\r\n\t\ttile.__childrenWereVisible = false;\r\n\t\ttile.__allChildrenLoaded = false;\r\n\r\n\t\ttile.__wasSetActive = false;\r\n\t\ttile.__active = false;\r\n\r\n\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"UNLOADED\"];\r\n\t\ttile.__loadIndex = 0;\r\n\r\n\t\ttile.__loadAbort = null;\r\n\r\n\t\ttile.__depthFromRenderedParent = - 1;\r\n\t\tif ( parentTile === null ) {\r\n\r\n\t\t\ttile.__depth = 0;\r\n\t\t\ttile.refine = tile.refine || 'REPLACE';\r\n\r\n\t\t} else {\r\n\r\n\t\t\ttile.__depth = parentTile.__depth + 1;\r\n\t\t\ttile.refine = tile.refine || parentTile.refine;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tsetTileActive( tile, state ) {\r\n\r\n\t}\r\n\r\n\tsetTileVisible( tile, state ) {\r\n\r\n\t}\r\n\r\n\tcalculateError( tile ) {\r\n\r\n\t\treturn 0;\r\n\r\n\t}\r\n\r\n\ttileInView( tile ) {\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\t// Private Functions\r\n\tfetchTileSet( url, fetchOptions, parent = null ) {\r\n\r\n\t\treturn fetch( url, fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( res.ok ) {\r\n\r\n\t\t\t\t\treturn res.json();\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tthrow new Error( `TilesRenderer: Failed to load tileset \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} )\r\n\t\t\t.then( json => {\r\n\r\n\t\t\t\tconst version = json.asset.version;\r\n\t\t\t\tconsole.assert(\r\n\t\t\t\t\tversion === '1.0' || version === '0.0',\r\n\t\t\t\t\t'asset.version is expected to be a string of \"1.0\" or \"0.0\"'\r\n\t\t\t\t);\r\n\r\n\t\t\t\tconst basePath = path__WEBPACK_IMPORTED_MODULE_0___default.a.dirname( url );\r\n\r\n\t\t\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"traverseSet\"])(\r\n\t\t\t\t\tjson.root,\r\n\t\t\t\t\t( node, parent ) => this.preprocessNode( node, parent, basePath ),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tparent,\r\n\t\t\t\t\tparent ? parent.__depth : 0,\r\n\t\t\t\t);\r\n\r\n\t\t\t\treturn json;\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tloadRootTileSet( url ) {\r\n\r\n\t\tconst tileSets = this.tileSets;\r\n\t\tif ( ! ( url in tileSets ) ) {\r\n\r\n\t\t\tconst pr = this\r\n\t\t\t\t.fetchTileSet( url, this.fetchOptions )\r\n\t\t\t\t.then( json => {\r\n\r\n\t\t\t\t\ttileSets[ url ] = json;\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\tpr.catch( err => {\r\n\r\n\t\t\t\tconsole.error( err );\r\n\t\t\t\ttileSets[ url ] = err;\r\n\r\n\t\t\t} );\r\n\r\n\t\t\ttileSets[ url ] = pr;\r\n\r\n\t\t\treturn pr;\r\n\r\n\t\t} else if ( tileSets[ url ] instanceof Error ) {\r\n\r\n\t\t\treturn Promise.reject( tileSets[ url ] );\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn Promise.resolve( tileSets[ url ] );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\trequestTileContents( tile ) {\r\n\r\n\t\t// If the tile is already being loaded then don't\r\n\t\t// start it again.\r\n\t\tif ( tile.__loadingState !== _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"UNLOADED\"] ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\tconst stats = this.stats;\r\n\t\tconst lruCache = this.lruCache;\r\n\t\tconst downloadQueue = this.downloadQueue;\r\n\t\tconst parseQueue = this.parseQueue;\r\n\t\tconst isExternalTileSet = tile.__externalTileSet;\r\n\t\tlruCache.add( tile, t => {\r\n\r\n\t\t\t// Stop the load if it's started\r\n\t\t\tif ( t.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"] ) {\r\n\r\n\t\t\t\tt.__loadAbort.abort();\r\n\t\t\t\tt.__loadAbort = null;\r\n\r\n\t\t\t} else if ( isExternalTileSet ) {\r\n\r\n\t\t\t\tt.children.length = 0;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tthis.disposeTile( t );\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Decrement stats\r\n\t\t\tif ( t.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"] ) {\r\n\r\n\t\t\t\tstats.downloading --;\r\n\r\n\t\t\t} else if ( t.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"PARSING\"] ) {\r\n\r\n\t\t\t\tstats.parsing --;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tt.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"UNLOADED\"];\r\n\t\t\tt.__loadIndex ++;\r\n\r\n\t\t\tparseQueue.remove( t );\r\n\t\t\tdownloadQueue.remove( t );\r\n\r\n\t\t} );\r\n\r\n\t\t// Track a new load index so we avoid the condition where this load is stopped and\r\n\t\t// another begins soon after so we don't parse twice.\r\n\t\ttile.__loadIndex ++;\r\n\t\tconst loadIndex = tile.__loadIndex;\r\n\t\tconst controller = new AbortController();\r\n\t\tconst signal = controller.signal;\r\n\r\n\t\tstats.downloading ++;\r\n\t\ttile.__loadAbort = controller;\r\n\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"];\r\n\r\n\t\tconst errorCallback = e => {\r\n\r\n\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\treturn;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( e.name !== 'AbortError' ) {\r\n\r\n\t\t\t\tparseQueue.remove( tile );\r\n\t\t\t\tdownloadQueue.remove( tile );\r\n\r\n\t\t\t\tif ( tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"PARSING\"] ) {\r\n\r\n\t\t\t\t\tstats.parsing --;\r\n\r\n\t\t\t\t} else if ( tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"] ) {\r\n\r\n\t\t\t\t\tstats.downloading --;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstats.failed ++;\r\n\r\n\t\t\t\tconsole.error( `TilesRenderer : Failed to load tile at url \"${ tile.content.uri }\".` );\r\n\t\t\t\tconsole.error( e );\r\n\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"FAILED\"];\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tlruCache.remove( tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t};\r\n\r\n\t\tif ( isExternalTileSet ) {\r\n\r\n\t\t\tdownloadQueue.add( tile, tile => {\r\n\r\n\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\treturn Promise.resolve();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst uri = this.preprocessURL ? this.preprocessURL( tile.content.uri ) : tile.content.uri;\r\n\t\t\t\treturn this.fetchTileSet( uri, Object.assign( { signal }, this.fetchOptions ), tile );\r\n\r\n\t\t\t} )\r\n\t\t\t\t.then( json => {\r\n\r\n\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstats.downloading --;\r\n\t\t\t\t\ttile.__loadAbort = null;\r\n\t\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADED\"];\r\n\r\n\t\t\t\t\ttile.children.push( json.root );\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.catch( errorCallback );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tdownloadQueue.add( tile, tile => {\r\n\r\n\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\treturn Promise.resolve();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst uri = this.preprocessURL ? this.preprocessURL( tile.content.uri ) : tile.content.uri;\r\n\t\t\t\treturn fetch( uri, Object.assign( { signal }, this.fetchOptions ) );\r\n\r\n\t\t\t} )\r\n\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( res.ok ) {\r\n\r\n\t\t\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tthrow new Error( `Failed to load model with error code ${res.status}` );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.then( buffer => {\r\n\r\n\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstats.downloading --;\r\n\t\t\t\t\tstats.parsing ++;\r\n\t\t\t\t\ttile.__loadAbort = null;\r\n\t\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"PARSING\"];\r\n\r\n\t\t\t\t\treturn parseQueue.add( tile, tile => {\r\n\r\n\t\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\t\treturn Promise.resolve();\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst uri = tile.content.uri;\r\n\t\t\t\t\t\tconst extension = uri.split( /\\./g ).pop();\r\n\r\n\t\t\t\t\t\treturn this.parseTile( buffer, tile, extension );\r\n\r\n\t\t\t\t\t} );\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.then( () => {\r\n\r\n\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstats.parsing --;\r\n\t\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADED\"];\r\n\r\n\t\t\t\t\tif ( tile.__wasSetVisible ) {\r\n\r\n\t\t\t\t\t\tthis.setTileVisible( tile, true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( tile.__wasSetActive ) {\r\n\r\n\t\t\t\t\t\tthis.setTileActive( tile, true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.catch( errorCallback );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tdispose() {\r\n\r\n\t\tconst lruCache = this.lruCache;\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tlruCache.remove( tile );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/base/constants.js": -/*!**************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/base/constants.js ***! - \**************************************************************/ -/*! exports provided: UNLOADED, LOADING, PARSING, LOADED, FAILED */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UNLOADED\", function() { return UNLOADED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LOADING\", function() { return LOADING; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PARSING\", function() { return PARSING; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LOADED\", function() { return LOADED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FAILED\", function() { return FAILED; });\nconst UNLOADED = 0;\nconst LOADING = 1;\nconst PARSING = 2;\nconst LOADED = 3;\nconst FAILED = 4;\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/constants.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js": -/*!**********************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js ***! - \**********************************************************************/ -/*! exports provided: traverseSet, determineFrustumSet, markUsedSetLeaves, skipTraversal, toggleTiles */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"traverseSet\", function() { return traverseSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determineFrustumSet\", function() { return determineFrustumSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"markUsedSetLeaves\", function() { return markUsedSetLeaves; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"skipTraversal\", function() { return skipTraversal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toggleTiles\", function() { return toggleTiles; });\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/3d-tiles-renderer/src/base/constants.js\");\n\r\n\r\nfunction isDownloadFinished( value ) {\r\n\r\n\treturn value === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"LOADED\"] || value === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"FAILED\"];\r\n\r\n}\r\n\r\n// Checks whether this tile was last used on the given frame.\r\nfunction isUsedThisFrame( tile, frameCount ) {\r\n\r\n\treturn tile.__lastFrameVisited === frameCount && tile.__used;\r\n\r\n}\r\n\r\n// Resets the frame frame information for the given tile\r\nfunction resetFrameState( tile, frameCount ) {\r\n\r\n\tif ( tile.__lastFrameVisited !== frameCount ) {\r\n\r\n\t\ttile.__lastFrameVisited = frameCount;\r\n\t\ttile.__used = false;\r\n\t\ttile.__inFrustum = false;\r\n\t\ttile.__isLeaf = false;\r\n\t\ttile.__visible = false;\r\n\t\ttile.__active = false;\r\n\t\ttile.__error = 0;\r\n\t\ttile.__childrenWereVisible = false;\r\n\t\ttile.__allChildrenLoaded = false;\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Recursively mark tiles used down to the next tile with content\r\nfunction recursivelyMarkUsed( tile, frameCount, lruCache ) {\r\n\r\n\tresetFrameState( tile, frameCount );\r\n\r\n\ttile.__used = true;\r\n\tlruCache.markUsed( tile );\r\n\tif ( tile.__contentEmpty ) {\r\n\r\n\t\tconst children = tile.children;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\trecursivelyMarkUsed( children[ i ], frameCount, lruCache );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\nfunction recursivelyLoadTiles( tile, depthFromRenderedParent, renderer ) {\r\n\r\n\t// Try to load any external tile set children if the external tile set has loaded.\r\n\tconst doTraverse =\r\n\t\ttile.__contentEmpty && (\r\n\t\t\t! tile.__externalTileSet ||\r\n\t\t\tisDownloadFinished( tile.__loadingState )\r\n\t\t);\r\n\tif ( doTraverse ) {\r\n\r\n\t\tconst children = tile.children;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\t// don't increment depth to rendered parent here because we should treat\r\n\t\t\t// the next layer of rendered children as just a single depth away for the\r\n\t\t\t// sake of sorting.\r\n\t\t\tconst child = children[ i ];\r\n\t\t\tchild.__depthFromRenderedParent = depthFromRenderedParent;\r\n\t\t\trecursivelyLoadTiles( child, depthFromRenderedParent, renderer );\r\n\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\trenderer.requestTileContents( tile );\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Helper function for recursively traversing a tile set. If `beforeCb` returns `true` then the\r\n// traversal will end early.\r\nfunction traverseSet( tile, beforeCb = null, afterCb = null, parent = null, depth = 0 ) {\r\n\r\n\tif ( beforeCb && beforeCb( tile, parent, depth ) ) {\r\n\r\n\t\tif ( afterCb ) {\r\n\r\n\t\t\tafterCb( tile, parent, depth );\r\n\r\n\t\t}\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst children = tile.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\ttraverseSet( children[ i ], beforeCb, afterCb, tile, depth + 1 );\r\n\r\n\t}\r\n\r\n\tif ( afterCb ) {\r\n\r\n\t\tafterCb( tile, parent, depth );\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Determine which tiles are within the camera frustum.\r\n// TODO: this is marking items as used in the lrucache, which means some data is\r\n// being kept around that isn't being used -- is that okay?\r\nfunction determineFrustumSet( tile, renderer ) {\r\n\r\n\tconst stats = renderer.stats;\r\n\tconst frameCount = renderer.frameCount;\r\n\tconst errorTarget = renderer.errorTarget;\r\n\tconst maxDepth = renderer.maxDepth;\r\n\tconst loadSiblings = renderer.loadSiblings;\r\n\tconst lruCache = renderer.lruCache;\r\n\tconst stopAtEmptyTiles = renderer.stopAtEmptyTiles;\r\n\tresetFrameState( tile, frameCount );\r\n\r\n\t// Early out if this tile is not within view.\r\n\tconst inFrustum = renderer.tileInView( tile );\r\n\tif ( inFrustum === false ) {\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\ttile.__used = true;\r\n\tlruCache.markUsed( tile );\r\n\r\n\ttile.__inFrustum = true;\r\n\tstats.inFrustum ++;\r\n\r\n\t// Early out if this tile has less error than we're targeting but don't stop\r\n\t// at an external tile set.\r\n\tif ( ( stopAtEmptyTiles || ! tile.__contentEmpty ) && ! tile.__externalTileSet ) {\r\n\r\n\t\tconst error = renderer.calculateError( tile );\r\n\t\ttile.__error = error;\r\n\t\tif ( error <= errorTarget ) {\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t\t// Early out if we've reached the maximum allowed depth.\r\n\t\tif ( renderer.maxDepth > 0 && tile.__depth + 1 >= maxDepth ) {\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// Traverse children and see if any children are in view.\r\n\tlet anyChildrenUsed = false;\r\n\tconst children = tile.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\tconst c = children[ i ];\r\n\t\tconst r = determineFrustumSet( c, renderer );\r\n\t\tanyChildrenUsed = anyChildrenUsed || r;\r\n\r\n\t}\r\n\r\n\t// If there are children within view and we are loading siblings then mark\r\n\t// all sibling tiles as used, as well.\r\n\tif ( anyChildrenUsed && loadSiblings ) {\r\n\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\trecursivelyMarkUsed( c, frameCount, lruCache );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn true;\r\n\r\n}\r\n\r\n// Traverse and mark the tiles that are at the leaf nodes of the \"used\" tree.\r\nfunction markUsedSetLeaves( tile, renderer ) {\r\n\r\n\tconst stats = renderer.stats;\r\n\tconst frameCount = renderer.frameCount;\r\n\tif ( ! isUsedThisFrame( tile, frameCount ) ) {\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tstats.used ++;\r\n\r\n\t// This tile is a leaf if none of the children had been used.\r\n\tconst children = tile.children;\r\n\tlet anyChildrenUsed = false;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\tconst c = children[ i ];\r\n\t\tanyChildrenUsed = anyChildrenUsed || isUsedThisFrame( c, frameCount );\r\n\r\n\t}\r\n\r\n\r\n\tif ( ! anyChildrenUsed ) {\r\n\r\n\t\t// TODO: This isn't necessarily right because it's possible that a parent tile is considered in the\r\n\t\t// frustum while the child tiles are not, making them unused. If all children have loaded and were properly\r\n\t\t// considered to be in the used set then we shouldn't set ourselves to a leaf here.\r\n\t\ttile.__isLeaf = true;\r\n\r\n\t} else {\r\n\r\n\t\tlet childrenWereVisible = false;\r\n\t\tlet allChildrenLoaded = true;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\tmarkUsedSetLeaves( c, renderer );\r\n\t\t\tchildrenWereVisible = childrenWereVisible || c.__wasSetVisible || c.__childrenWereVisible;\r\n\r\n\t\t\tif ( isUsedThisFrame( c, frameCount ) ) {\r\n\r\n\t\t\t\tconst childLoaded =\r\n\t\t\t\t\tc.__allChildrenLoaded ||\r\n\t\t\t\t\t( ! c.__contentEmpty && isDownloadFinished( c.__loadingState ) ) ||\r\n\t\t\t\t\t( c.__externalTileSet && c.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"FAILED\"] );\r\n\t\t\t\tallChildrenLoaded = allChildrenLoaded && childLoaded;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\ttile.__childrenWereVisible = childrenWereVisible;\r\n\t\ttile.__allChildrenLoaded = allChildrenLoaded;\r\n\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Skip past tiles we consider unrenderable because they are outside the error threshold.\r\nfunction skipTraversal( tile, renderer ) {\r\n\r\n\tconst stats = renderer.stats;\r\n\tconst frameCount = renderer.frameCount;\r\n\tif ( ! isUsedThisFrame( tile, frameCount ) ) {\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst parent = tile.parent;\r\n\tconst parentDepthToParent = parent ? parent.__depthFromRenderedParent : - 1;\r\n\ttile.__depthFromRenderedParent = parentDepthToParent;\r\n\r\n\t// Request the tile contents or mark it as visible if we've found a leaf.\r\n\tconst lruCache = renderer.lruCache;\r\n\tif ( tile.__isLeaf ) {\r\n\r\n\t\ttile.__depthFromRenderedParent ++;\r\n\r\n\t\tif ( tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"LOADED\"] ) {\r\n\r\n\t\t\tif ( tile.__inFrustum ) {\r\n\r\n\t\t\t\ttile.__visible = true;\r\n\t\t\t\tstats.visible ++;\r\n\r\n\t\t\t}\r\n\t\t\ttile.__active = true;\r\n\t\t\tstats.active ++;\r\n\r\n\t\t} else if ( ! lruCache.isFull() && ( ! tile.__contentEmpty || tile.__externalTileSet ) ) {\r\n\r\n\t\t\trenderer.requestTileContents( tile );\r\n\r\n\t\t}\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst errorRequirement = ( renderer.errorTarget + 1 ) * renderer.errorThreshold;\r\n\tconst meetsSSE = tile.__error <= errorRequirement;\r\n\tconst includeTile = meetsSSE || tile.refine === 'ADD';\r\n\tconst hasModel = ! tile.__contentEmpty;\r\n\tconst hasContent = hasModel || tile.__externalTileSet;\r\n\tconst loadedContent = isDownloadFinished( tile.__loadingState ) && hasContent;\r\n\tconst childrenWereVisible = tile.__childrenWereVisible;\r\n\tconst children = tile.children;\r\n\tlet allChildrenHaveContent = tile.__allChildrenLoaded;\r\n\r\n\t// Increment the relative depth of the node to the nearest rendered parent if it has content\r\n\t// and is being rendered.\r\n\tif ( includeTile && hasModel ) {\r\n\r\n\t\ttile.__depthFromRenderedParent ++;\r\n\r\n\t}\r\n\r\n\t// If we've met the SSE requirements and we can load content then fire a fetch.\r\n\tif ( includeTile && ! loadedContent && ! lruCache.isFull() && hasContent ) {\r\n\r\n\t\trenderer.requestTileContents( tile );\r\n\r\n\t}\r\n\r\n\t// Only mark this tile as visible if it meets the screen space error requirements, has loaded content, not\r\n\t// all children have loaded yet, and if no children were visible last frame. We want to keep children visible\r\n\t// that _were_ visible to avoid a pop in level of detail as the camera moves around and parent / sibling tiles\r\n\t// load in.\r\n\r\n\t// Skip the tile entirely if there's no content to load\r\n\tif (\r\n\t\t( meetsSSE && ! allChildrenHaveContent && ! childrenWereVisible && loadedContent )\r\n\t\t\t|| ( tile.refine === 'ADD' && loadedContent )\r\n\t) {\r\n\r\n\t\tif ( tile.__inFrustum ) {\r\n\r\n\t\t\ttile.__visible = true;\r\n\t\t\tstats.visible ++;\r\n\r\n\t\t}\r\n\t\ttile.__active = true;\r\n\t\tstats.active ++;\r\n\r\n\t}\r\n\r\n\t// If we're additive then don't stop the traversal here because it doesn't matter whether the children load in\r\n\t// at the same rate.\r\n\tif ( tile.refine !== 'ADD' && meetsSSE && ! allChildrenHaveContent && loadedContent ) {\r\n\r\n\t\t// load the child content if we've found that we've been loaded so we can move down to the next tile\r\n\t\t// layer when the data has loaded.\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\tif ( isUsedThisFrame( c, frameCount ) && ! lruCache.isFull() ) {\r\n\r\n\t\t\t\tc.__depthFromRenderedParent = tile.__depthFromRenderedParent + 1;\r\n\t\t\t\trecursivelyLoadTiles( c, c.__depthFromRenderedParent, renderer );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\tif ( isUsedThisFrame( c, frameCount ) ) {\r\n\r\n\t\t\t\tskipTraversal( c, renderer );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Final traverse to toggle tile visibility.\r\nfunction toggleTiles( tile, renderer ) {\r\n\r\n\tconst frameCount = renderer.frameCount;\r\n\tconst isUsed = isUsedThisFrame( tile, frameCount );\r\n\tif ( isUsed || tile.__usedLastFrame ) {\r\n\r\n\t\tlet setActive = false;\r\n\t\tlet setVisible = false;\r\n\t\tif ( isUsed ) {\r\n\r\n\t\t\t// enable visibility if active due to shadows\r\n\t\t\tsetActive = tile.__active;\r\n\t\t\tif ( renderer.displayActiveTiles ) {\r\n\r\n\t\t\t\tsetVisible = tile.__active || tile.__visible;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tsetVisible = tile.__visible;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// If the active or visible state changed then call the functions.\r\n\t\tif ( ! tile.__contentEmpty && tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"LOADED\"] ) {\r\n\r\n\t\t\tif ( tile.__wasSetActive !== setActive ) {\r\n\r\n\t\t\t\trenderer.setTileActive( tile, setActive );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( tile.__wasSetVisible !== setVisible ) {\r\n\r\n\t\t\t\trenderer.setTileVisible( tile, setVisible );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\ttile.__wasSetActive = setActive;\r\n\t\ttile.__wasSetVisible = setVisible;\r\n\t\ttile.__usedLastFrame = isUsed;\r\n\r\n\t\tconst children = tile.children;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\ttoggleTiles( c, renderer );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/index.js ***! - \*****************************************************/ -/*! exports provided: DebugTilesRenderer, TilesRenderer, B3DMLoader, PNTSLoader, I3DMLoader, CMPTLoader, TilesRendererBase, B3DMLoaderBase, I3DMLoaderBase, PNTSLoaderBase, CMPTLoaderBase, LRUCache, PriorityQueue, NONE, SCREEN_ERROR, GEOMETRIC_ERROR, DISTANCE, DEPTH, RELATIVE_DEPTH, IS_LEAF, RANDOM_COLOR */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./three/DebugTilesRenderer.js */ \"./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DebugTilesRenderer\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"DebugTilesRenderer\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NONE\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"NONE\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SCREEN_ERROR\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"SCREEN_ERROR\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"GEOMETRIC_ERROR\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"GEOMETRIC_ERROR\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DISTANCE\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"DISTANCE\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DEPTH\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"DEPTH\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RELATIVE_DEPTH\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"RELATIVE_DEPTH\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"IS_LEAF\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"IS_LEAF\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RANDOM_COLOR\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM_COLOR\"]; });\n\n/* harmony import */ var _three_TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./three/TilesRenderer.js */ \"./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TilesRenderer\", function() { return _three_TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__[\"TilesRenderer\"]; });\n\n/* harmony import */ var _three_B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./three/B3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoader\", function() { return _three_B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"B3DMLoader\"]; });\n\n/* harmony import */ var _three_PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./three/PNTSLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoader\", function() { return _three_PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__[\"PNTSLoader\"]; });\n\n/* harmony import */ var _three_I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./three/I3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoader\", function() { return _three_I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__[\"I3DMLoader\"]; });\n\n/* harmony import */ var _three_CMPTLoader_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./three/CMPTLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoader\", function() { return _three_CMPTLoader_js__WEBPACK_IMPORTED_MODULE_5__[\"CMPTLoader\"]; });\n\n/* harmony import */ var _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./base/TilesRendererBase.js */ \"./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TilesRendererBase\", function() { return _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_6__[\"TilesRendererBase\"]; });\n\n/* harmony import */ var _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./base/B3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoaderBase\", function() { return _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_7__[\"B3DMLoaderBase\"]; });\n\n/* harmony import */ var _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./base/I3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoaderBase\", function() { return _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_8__[\"I3DMLoaderBase\"]; });\n\n/* harmony import */ var _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./base/PNTSLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoaderBase\", function() { return _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_9__[\"PNTSLoaderBase\"]; });\n\n/* harmony import */ var _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./base/CMPTLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoaderBase\", function() { return _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_10__[\"CMPTLoaderBase\"]; });\n\n/* harmony import */ var _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utilities/LRUCache.js */ \"./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LRUCache\", function() { return _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_11__[\"LRUCache\"]; });\n\n/* harmony import */ var _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utilities/PriorityQueue.js */ \"./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PriorityQueue\", function() { return _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_12__[\"PriorityQueue\"]; });\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/index.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js": -/*!****************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js ***! - \****************************************************************/ -/*! exports provided: B3DMLoader */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoader\", function() { return B3DMLoader; });\n/* harmony import */ var _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/B3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/loaders/GLTFLoader.js */ \"./node_modules/three/examples/jsm/loaders/GLTFLoader.js\");\n\r\n\r\n\r\n\r\nclass B3DMLoader extends _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__[\"B3DMLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_1__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst b3dm = super.parse( buffer );\r\n\t\tconst gltfBuffer = b3dm.glbBytes.slice().buffer;\r\n\t\treturn new Promise( ( resolve, reject ) => {\r\n\r\n\t\t\tconst manager = this.manager;\r\n\t\t\tconst loader = manager.getHandler( 'path.gltf' ) || new three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"GLTFLoader\"]( manager );\r\n\t\t\tloader.parse( gltfBuffer, null, model => {\r\n\r\n\t\t\t\tconst { batchTable, featureTable } = b3dm;\r\n\t\t\t\tconst { scene } = model;\r\n\r\n\t\t\t\tconst rtcCenter = featureTable.getData( 'RTC_CENTER' );\r\n\t\t\t\tif ( rtcCenter ) {\r\n\r\n\t\t\t\t\tscene.position.x += rtcCenter[ 0 ];\r\n\t\t\t\t\tscene.position.y += rtcCenter[ 1 ];\r\n\t\t\t\t\tscene.position.z += rtcCenter[ 2 ];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmodel.batchTable = batchTable;\r\n\t\t\t\tmodel.featureTable = featureTable;\r\n\r\n\t\t\t\tscene.batchTable = batchTable;\r\n\t\t\t\tscene.featureTable = featureTable;\r\n\r\n\t\t\t\tresolve( model );\r\n\r\n\t\t\t}, reject );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js": -/*!****************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js ***! - \****************************************************************/ -/*! exports provided: CMPTLoader */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoader\", function() { return CMPTLoader; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/CMPTLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js\");\n/* harmony import */ var _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./B3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js\");\n/* harmony import */ var _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PNTSLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js\");\n/* harmony import */ var _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./I3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js\");\n\r\n\r\n\r\n\r\n\r\n\r\nclass CMPTLoader extends _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_1__[\"CMPTLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_0__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst result = super.parse( buffer );\r\n\t\tconst manager = this.manager;\r\n\t\tconst group = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\tconst results = [];\r\n\t\tconst promises = [];\r\n\r\n\t\tfor ( const i in result.tiles ) {\r\n\r\n\t\t\tconst { type, buffer } = result.tiles[ i ];\r\n\t\t\tswitch ( type ) {\r\n\r\n\t\t\t\tcase 'b3dm': {\r\n\r\n\t\t\t\t\tconst slicedBuffer = buffer.slice();\r\n\t\t\t\t\tconst promise = new _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"B3DMLoader\"]( manager )\r\n\t\t\t\t\t\t.parse( slicedBuffer.buffer )\r\n\t\t\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\t\t\tresults.push( res );\r\n\t\t\t\t\t\t\tgroup.add( res.scene );\r\n\r\n\t\t\t\t\t\t} );\r\n\r\n\t\t\t\t\tpromises.push( promise );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcase 'pnts': {\r\n\r\n\t\t\t\t\tconst slicedBuffer = buffer.slice();\r\n\t\t\t\t\tconst pointsResult = new _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__[\"PNTSLoader\"]( manager ).parse( slicedBuffer.buffer );\r\n\t\t\t\t\tresults.push( pointsResult );\r\n\t\t\t\t\tgroup.add( pointsResult.scene );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcase 'i3dm': {\r\n\r\n\t\t\t\t\tconst slicedBuffer = buffer.slice();\r\n\t\t\t\t\tconst loader = new _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__[\"I3DMLoader\"]( manager );\r\n\t\t\t\t\tloader.workingPath = this.workingPath;\r\n\t\t\t\t\tloader.fetchOptions = this.fetchOptions;\r\n\r\n\t\t\t\t\tconst promise = loader\r\n\t\t\t\t\t\t.parse( slicedBuffer.buffer )\r\n\t\t\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\t\t\tresults.push( res );\r\n\t\t\t\t\t\t\tgroup.add( res.scene );\r\n\r\n\t\t\t\t\t\t} );\r\n\t\t\t\t\tpromises.push( promise );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn Promise.all( promises ).then( () => {\r\n\r\n\t\t\treturn {\r\n\r\n\t\t\t\ttiles: results,\r\n\t\t\t\tscene: group,\r\n\r\n\t\t\t};\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js": -/*!************************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js ***! - \************************************************************************/ -/*! exports provided: NONE, SCREEN_ERROR, GEOMETRIC_ERROR, DISTANCE, DEPTH, RELATIVE_DEPTH, IS_LEAF, RANDOM_COLOR, DebugTilesRenderer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NONE\", function() { return NONE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SCREEN_ERROR\", function() { return SCREEN_ERROR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GEOMETRIC_ERROR\", function() { return GEOMETRIC_ERROR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DISTANCE\", function() { return DISTANCE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEPTH\", function() { return DEPTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RELATIVE_DEPTH\", function() { return RELATIVE_DEPTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IS_LEAF\", function() { return IS_LEAF; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RANDOM_COLOR\", function() { return RANDOM_COLOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DebugTilesRenderer\", function() { return DebugTilesRenderer; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TilesRenderer.js */ \"./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js\");\n/* harmony import */ var _SphereHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SphereHelper.js */ \"./node_modules/3d-tiles-renderer/src/three/SphereHelper.js\");\n\r\n\r\n\r\n\r\nconst ORIGINAL_MATERIAL = Symbol( 'ORIGINAL_MATERIAL' );\r\nconst HAS_RANDOM_COLOR = Symbol( 'HAS_RANDOM_COLOR' );\r\n\r\nfunction emptyRaycast() {}\r\n\r\nconst NONE = 0;\r\nconst SCREEN_ERROR = 1;\r\nconst GEOMETRIC_ERROR = 2;\r\nconst DISTANCE = 3;\r\nconst DEPTH = 4;\r\nconst RELATIVE_DEPTH = 5;\r\nconst IS_LEAF = 6;\r\nconst RANDOM_COLOR = 7;\r\n\r\nclass DebugTilesRenderer extends _TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__[\"TilesRenderer\"] {\r\n\r\n\tconstructor( ...args ) {\r\n\r\n\t\tsuper( ...args );\r\n\r\n\t\tconst tilesGroup = this.group;\r\n\t\tconst boxGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\ttilesGroup.add( boxGroup );\r\n\r\n\t\tconst sphereGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\ttilesGroup.add( sphereGroup );\r\n\r\n\t\tthis.displayBoxBounds = false;\r\n\t\tthis.displaySphereBounds = false;\r\n\t\tthis.colorMode = NONE;\r\n\t\tthis.boxGroup = boxGroup;\r\n\t\tthis.sphereGroup = sphereGroup;\r\n\t\tthis.maxDebugDepth = - 1;\r\n\t\tthis.maxDebugDistance = - 1;\r\n\t\tthis.maxDebugError = - 1;\r\n\r\n\t\tthis.extremeDebugDepth = - 1;\r\n\t\tthis.extremeDebugError = - 1;\r\n\r\n\t}\r\n\r\n\tinitExtremes() {\r\n\r\n\t\t// initialize the extreme values of the hierarchy\r\n\t\tlet maxDepth = - 1;\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tmaxDepth = Math.max( maxDepth, tile.__depth );\r\n\r\n\t\t} );\r\n\r\n\t\tlet maxError = - 1;\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tmaxError = Math.max( maxError, tile.geometricError );\r\n\r\n\t\t} );\r\n\r\n\t\tthis.extremeDebugDepth = maxDepth;\r\n\t\tthis.extremeDebugError = maxError;\r\n\r\n\t}\r\n\r\n\tloadTileSet( ...args ) {\r\n\r\n\t\tconst pr = super.loadTileSet( ...args );\r\n\t\tpr\r\n\t\t\t.then( () => this.initExtremes() )\r\n\t\t\t.catch( () => {\r\n\r\n\t\t\t\t// error is logged internally\r\n\r\n\t\t\t} );\r\n\r\n\t\treturn pr;\r\n\r\n\t}\r\n\r\n\tgetTileInformationFromActiveObject( object ) {\r\n\r\n\t\t// Find which tile this scene is associated with. This is slow and\r\n\t\t// intended for debug purposes only.\r\n\t\tlet targetTile = null;\r\n\t\tconst activeTiles = this.activeTiles;\r\n\t\tactiveTiles.forEach( tile => {\r\n\r\n\t\t\tif ( targetTile ) {\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst scene = tile.cached.scene;\r\n\t\t\tif ( scene ) {\r\n\r\n\t\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\t\tif ( c === object ) {\r\n\r\n\t\t\t\t\t\ttargetTile = tile;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t\tif ( targetTile ) {\r\n\r\n\t\t\treturn {\r\n\r\n\t\t\t\tdistanceToCamera: targetTile.cached.distance,\r\n\t\t\t\tgeometricError: targetTile.geometricError,\r\n\t\t\t\tscreenSpaceError: targetTile.__error,\r\n\t\t\t\tdepth: targetTile.__depth,\r\n\t\t\t\tisLeaf: targetTile.__isLeaf\r\n\r\n\t\t\t};\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tupdate() {\r\n\r\n\t\tsuper.update();\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\t// set box or sphere visibility\r\n\t\tthis.boxGroup.visible = this.displayBoxBounds;\r\n\t\tthis.sphereGroup.visible = this.displaySphereBounds;\r\n\r\n\t\t// get max values to use for materials\r\n\t\tlet maxDepth = - 1;\r\n\t\tif ( this.maxDebugDepth === - 1 ) {\r\n\r\n\t\t\tmaxDepth = this.extremeDebugDepth;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmaxDepth = this.maxDebugDepth;\r\n\r\n\t\t}\r\n\r\n\t\tlet maxError = - 1;\r\n\t\tif ( this.maxDebugError === - 1 ) {\r\n\r\n\t\t\tmaxError = this.extremeDebugError;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmaxError = this.maxDebugError;\r\n\r\n\t\t}\r\n\r\n\t\tlet maxDistance = - 1;\r\n\t\tif ( this.maxDebugDistance === - 1 ) {\r\n\r\n\t\t\tmaxDistance = this.root.cached.sphere.radius;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmaxDistance = this.maxDebugDistance;\r\n\r\n\t\t}\r\n\r\n\t\tconst errorTarget = this.errorTarget;\r\n\t\tconst colorMode = this.colorMode;\r\n\t\tconst visibleTiles = this.visibleTiles;\r\n\t\tvisibleTiles.forEach( tile => {\r\n\r\n\t\t\tconst scene = tile.cached.scene;\r\n\r\n\t\t\t// create a random color per-tile\r\n\t\t\tlet h, s, l;\r\n\t\t\tif ( colorMode === RANDOM_COLOR ) {\r\n\r\n\t\t\t\th = Math.random();\r\n\t\t\t\ts = 0.5 + Math.random() * 0.5;\r\n\t\t\t\tl = 0.375 + Math.random() * 0.25;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tconst currMaterial = c.material;\r\n\t\t\t\tif ( currMaterial ) {\r\n\r\n\t\t\t\t\t// Reset the material if needed\r\n\t\t\t\t\tconst originalMaterial = c[ ORIGINAL_MATERIAL ];\r\n\t\t\t\t\tif ( colorMode === NONE && currMaterial !== originalMaterial ) {\r\n\r\n\t\t\t\t\t\tc.material.dispose();\r\n\t\t\t\t\t\tc.material = c[ ORIGINAL_MATERIAL ];\r\n\r\n\t\t\t\t\t} else if ( colorMode !== NONE && currMaterial === originalMaterial ) {\r\n\r\n\t\t\t\t\t\tif ( c.isPoints ) {\r\n\r\n\t\t\t\t\t\t\tconst pointsMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]();\r\n\t\t\t\t\t\t\tpointsMaterial.size = originalMaterial.size;\r\n\t\t\t\t\t\t\tpointsMaterial.sizeAttenuation = originalMaterial.sizeAttenuation;\r\n\t\t\t\t\t\t\tc.material = pointsMaterial;\r\n\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\tc.material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]();\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( colorMode !== RANDOM_COLOR ) {\r\n\r\n\t\t\t\t\t\tdelete c.material[ HAS_RANDOM_COLOR ];\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Set the color on the basic material\r\n\t\t\t\t\tswitch ( colorMode ) {\r\n\r\n\t\t\t\t\t\tcase DEPTH: {\r\n\r\n\t\t\t\t\t\t\tconst val = tile.__depth / maxDepth;\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase RELATIVE_DEPTH: {\r\n\r\n\t\t\t\t\t\t\tconst val = tile.__depthFromRenderedParent / maxDepth;\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase SCREEN_ERROR: {\r\n\r\n\t\t\t\t\t\t\tconst val = tile.__error / errorTarget;\r\n\t\t\t\t\t\t\tif ( val > 1.0 ) {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.setRGB( 1.0, 0.0, 0.0 );\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase GEOMETRIC_ERROR: {\r\n\r\n\t\t\t\t\t\t\tconst val = Math.min( tile.geometricError / maxError, 1 );\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase DISTANCE: {\r\n\r\n\t\t\t\t\t\t\t// We don't update the distance if the geometric error is 0.0 so\r\n\t\t\t\t\t\t\t// it will always be black.\r\n\t\t\t\t\t\t\tconst val = Math.min( tile.cached.distance / maxDistance, 1 );\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase IS_LEAF: {\r\n\r\n\t\t\t\t\t\t\tif ( ! tile.children || tile.children.length === 0 ) {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.set( 0xffffff );\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.set( 0 );\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase RANDOM_COLOR: {\r\n\r\n\t\t\t\t\t\t\tif ( ! c.material[ HAS_RANDOM_COLOR ] ) {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.setHSL( h, s, l );\r\n\t\t\t\t\t\t\t\tc.material[ HAS_RANDOM_COLOR ] = true;\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tsetTileVisible( tile, visible ) {\r\n\r\n\t\tsuper.setTileVisible( tile, visible );\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tconst sphereGroup = this.sphereGroup;\r\n\t\tconst boxGroup = this.boxGroup;\r\n\t\tconst boxHelperGroup = cached.boxHelperGroup;\r\n\t\tconst sphereHelper = cached.sphereHelper;\r\n\r\n\t\tif ( ! visible ) {\r\n\r\n\t\t\tboxGroup.remove( boxHelperGroup );\r\n\t\t\tsphereGroup.remove( sphereHelper );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tboxGroup.add( boxHelperGroup );\r\n\t\t\tboxHelperGroup.updateMatrixWorld( true );\r\n\r\n\t\t\tsphereGroup.add( sphereHelper );\r\n\t\t\tsphereHelper.updateMatrixWorld( true );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tparseTile( buffer, tile, extension ) {\r\n\r\n\t\treturn super\r\n\t\t\t.parseTile( buffer, tile, extension )\r\n\t\t\t.then( () => {\r\n\r\n\t\t\t\tconst cached = tile.cached;\r\n\t\t\t\tconst scene = cached.scene;\r\n\t\t\t\tif ( scene ) {\r\n\r\n\t\t\t\t\tconst cachedBox = cached.box;\r\n\t\t\t\t\tconst cachedBoxMat = cached.boxTransform;\r\n\r\n\t\t\t\t\t// Create debug bounding box\r\n\t\t\t\t\tconst boxHelperGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\t\t\t\tboxHelperGroup.matrix.copy( cachedBoxMat );\r\n\t\t\t\t\tboxHelperGroup.matrix.decompose( boxHelperGroup.position, boxHelperGroup.quaternion, boxHelperGroup.scale );\r\n\r\n\t\t\t\t\tconst boxHelper = new three__WEBPACK_IMPORTED_MODULE_0__[\"Box3Helper\"]( cachedBox );\r\n\t\t\t\t\tboxHelper.raycast = emptyRaycast;\r\n\t\t\t\t\tboxHelperGroup.add( boxHelper );\r\n\r\n\t\t\t\t\tcached.boxHelperGroup = boxHelperGroup;\r\n\r\n\t\t\t\t\tif ( this.visibleTiles.has( tile ) && this.displayBoxBounds ) {\r\n\r\n\t\t\t\t\t\tthis.boxGroup.add( boxHelperGroup );\r\n\t\t\t\t\t\tboxHelperGroup.updateMatrixWorld( true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Create debugbounding sphere\r\n\t\t\t\t\tconst cachedSphere = cached.sphere;\r\n\t\t\t\t\tconst sphereHelper = new _SphereHelper_js__WEBPACK_IMPORTED_MODULE_2__[\"SphereHelper\"]( cachedSphere );\r\n\t\t\t\t\tsphereHelper.raycast = emptyRaycast;\r\n\t\t\t\t\tcached.sphereHelper = sphereHelper;\r\n\r\n\t\t\t\t\tif ( this.visibleTiles.has( tile ) && this.displaySphereBounds ) {\r\n\r\n\t\t\t\t\t\tthis.sphereGroup.add( sphereHelper );\r\n\t\t\t\t\t\tsphereHelper.updateMatrixWorld( true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Cache the original materials\r\n\t\t\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\t\t\tconst material = c.material;\r\n\t\t\t\t\t\tif ( material ) {\r\n\r\n\t\t\t\t\t\t\tc[ ORIGINAL_MATERIAL ] = material;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tdisposeTile( tile ) {\r\n\r\n\t\tsuper.disposeTile( tile );\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tif ( cached.boxHelperGroup ) {\r\n\r\n\t\t\tcached.boxHelperGroup.children[ 0 ].geometry.dispose();\r\n\t\t\tcached.sphereHelper.geometry.dispose();\r\n\r\n\t\t\tdelete cached.boxHelperGroup;\r\n\t\t\tdelete cached.sphereHelper;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js": -/*!****************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js ***! - \****************************************************************/ -/*! exports provided: I3DMLoader */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoader\", function() { return I3DMLoader; });\n/* harmony import */ var _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/I3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/loaders/GLTFLoader.js */ \"./node_modules/three/examples/jsm/loaders/GLTFLoader.js\");\n\r\n\r\n\r\n\r\nconst tempPos = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\r\nconst tempQuat = new three__WEBPACK_IMPORTED_MODULE_1__[\"Quaternion\"]();\r\nconst tempSca = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\r\nconst tempMat = new three__WEBPACK_IMPORTED_MODULE_1__[\"Matrix4\"]();\r\nclass I3DMLoader extends _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__[\"I3DMLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_1__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tresolveExternalURL( url ) {\r\n\r\n\t\treturn this.manager.resolveURL( super.resolveExternalURL( url ) );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\treturn super\r\n\t\t\t.parse( buffer )\r\n\t\t\t.then( i3dm => {\r\n\r\n\t\t\t\tconst { featureTable, batchTable } = i3dm;\r\n\t\t\t\tconst gltfBuffer = i3dm.glbBytes.slice().buffer;\r\n\t\t\t\treturn new Promise( ( resolve, reject ) => {\r\n\r\n\t\t\t\t\tconst manager = this.manager;\r\n\t\t\t\t\tconst loader = manager.getHandler( 'path.gltf' ) || new three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"GLTFLoader\"]( manager );\r\n\t\t\t\t\tloader.parse( gltfBuffer, null, model => {\r\n\r\n\t\t\t\t\t\tconst INSTANCES_LENGTH = featureTable.getData( 'INSTANCES_LENGTH' );\r\n\r\n\t\t\t\t\t\t// RTC_CENTER\r\n\t\t\t\t\t\t// QUANTIZED_VOLUME_OFFSET\r\n\t\t\t\t\t\t// QUANTIZED_VOLUME_SCALE\r\n\t\t\t\t\t\t// EAST_NORTH_UP\r\n\r\n\t\t\t\t\t\tconst POSITION = featureTable.getData( 'POSITION', INSTANCES_LENGTH, 'FLOAT', 'VEC3' );\r\n\r\n\t\t\t\t\t\t// POSITION_QUANTIZED\r\n\t\t\t\t\t\t// NORMAL_UP\r\n\t\t\t\t\t\t// NORMAL_RIGHT\r\n\t\t\t\t\t\t// NORMAL_UP_OCT32P\r\n\t\t\t\t\t\t// NORMAL_RIGHT_OCT32P\r\n\t\t\t\t\t\t// SCALE\r\n\t\t\t\t\t\t// SCALE_NON_UNIFORM\r\n\t\t\t\t\t\t// BATCH_ID\r\n\r\n\t\t\t\t\t\tconst instanceMap = new Map();\r\n\t\t\t\t\t\tconst instances = [];\r\n\t\t\t\t\t\tmodel.scene.traverse( child => {\r\n\r\n\t\t\t\t\t\t\tif ( child.isMesh ) {\r\n\r\n\t\t\t\t\t\t\t\tconst { geometry, material } = child;\r\n\t\t\t\t\t\t\t\tconst instancedMesh = new three__WEBPACK_IMPORTED_MODULE_1__[\"InstancedMesh\"]( geometry, material, INSTANCES_LENGTH );\r\n\t\t\t\t\t\t\t\tinstances.push( instancedMesh );\r\n\t\t\t\t\t\t\t\tinstanceMap.set( child, instancedMesh );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} );\r\n\r\n\t\t\t\t\t\tconst averageVector = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\r\n\t\t\t\t\t\tfor ( let i = 0; i < INSTANCES_LENGTH; i ++ ) {\r\n\r\n\t\t\t\t\t\t\t// TODO: handle quantized position\r\n\t\t\t\t\t\t\taverageVector.x += POSITION[ i * 3 + 0 ] / INSTANCES_LENGTH;\r\n\t\t\t\t\t\t\taverageVector.y += POSITION[ i * 3 + 1 ] / INSTANCES_LENGTH;\r\n\t\t\t\t\t\t\taverageVector.z += POSITION[ i * 3 + 2 ] / INSTANCES_LENGTH;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// replace the meshes with instanced meshes\r\n\t\t\t\t\t\tinstanceMap.forEach( ( instancedMesh, mesh ) => {\r\n\r\n\t\t\t\t\t\t\tconst parent = mesh.parent;\r\n\t\t\t\t\t\t\tif ( parent ) {\r\n\r\n\t\t\t\t\t\t\t\t// Mesh have no children\r\n\t\t\t\t\t\t\t\tparent.remove( mesh );\r\n\t\t\t\t\t\t\t\tparent.add( instancedMesh );\r\n\r\n\t\t\t\t\t\t\t\t// Center the instance around an average point to avoid jitter at large scales.\r\n\t\t\t\t\t\t\t\tinstancedMesh\r\n\t\t\t\t\t\t\t\t\t.position\r\n\t\t\t\t\t\t\t\t\t.copy( averageVector );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} );\r\n\r\n\t\t\t\t\t\tfor ( let i = 0; i < INSTANCES_LENGTH; i ++ ) {\r\n\r\n\t\t\t\t\t\t\t// TODO: handle quantized position\r\n\t\t\t\t\t\t\ttempPos.set(\r\n\t\t\t\t\t\t\t\tPOSITION[ i * 3 + 0 ] - averageVector.x,\r\n\t\t\t\t\t\t\t\tPOSITION[ i * 3 + 1 ] - averageVector.y,\r\n\t\t\t\t\t\t\t\tPOSITION[ i * 3 + 2 ] - averageVector.z,\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t// TODO: handle normal orientation features\r\n\t\t\t\t\t\t\ttempQuat.set( 0, 0, 0, 1 );\r\n\r\n\t\t\t\t\t\t\t// TODO: handle scale features\r\n\t\t\t\t\t\t\ttempSca.set( 1, 1, 1 );\r\n\r\n\t\t\t\t\t\t\ttempMat.compose( tempPos, tempQuat, tempSca );\r\n\r\n\t\t\t\t\t\t\tfor ( let j = 0, l = instances.length; j < l; j ++ ) {\r\n\r\n\t\t\t\t\t\t\t\tconst instance = instances[ j ];\r\n\t\t\t\t\t\t\t\tinstance.setMatrixAt( i, tempMat );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmodel.batchTable = batchTable;\r\n\t\t\t\t\t\tmodel.featureTable = featureTable;\r\n\r\n\t\t\t\t\t\tmodel.scene.batchTable = batchTable;\r\n\t\t\t\t\t\tmodel.scene.featureTable = featureTable;\r\n\r\n\t\t\t\t\t\tresolve( model );\r\n\r\n\t\t\t\t\t}, reject );\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js": -/*!****************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js ***! - \****************************************************************/ -/*! exports provided: PNTSLoader */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoader\", function() { return PNTSLoader; });\n/* harmony import */ var _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/PNTSLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\n\r\n\r\nclass PNTSLoader extends _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__[\"PNTSLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_1__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst result = super.parse( buffer );\r\n\t\tconst { featureTable } = result;\r\n\r\n\t\t// global semantics\r\n\t\tconst POINTS_LENGTH = featureTable.getData( 'POINTS_LENGTH' );\r\n\r\n\t\t// RTC_CENTER\r\n\t\t// QUANTIZED_VOLUME_OFFSET\r\n\t\t// QUANTIZED_VOLUME_SCALE\r\n\t\t// CONSTANT_RGBA\r\n\t\t// BATCH_LENGTH\r\n\r\n\t\tconst POSITION = featureTable.getData( 'POSITION', POINTS_LENGTH, 'FLOAT', 'VEC3' );\r\n\t\tconst RGB = featureTable.getData( 'RGB', POINTS_LENGTH, 'UNSIGNED_BYTE', 'VEC3' );\r\n\r\n\t\t// POSITION_QUANTIZED\r\n\t\t// RGBA\r\n\t\t// RGB565\r\n\t\t// NORMAL\r\n\t\t// NORMAL_OCT16P\r\n\t\t// BATCH_ID\r\n\r\n\t\tif ( POSITION === null ) {\r\n\r\n\t\t\tthrow new Error( 'PNTSLoader : POSITION_QUANTIZED feature type is not supported.' );\r\n\r\n\t\t}\r\n\r\n\t\tconst geometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]();\r\n\t\tgeometry.setAttribute( 'position', new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferAttribute\"]( POSITION, 3, false ) );\r\n\r\n\t\tconst material = new three__WEBPACK_IMPORTED_MODULE_1__[\"PointsMaterial\"]();\r\n\t\tmaterial.size = 2;\r\n\t\tmaterial.sizeAttenuation = false;\r\n\r\n\t\tif ( RGB !== null ) {\r\n\r\n\t\t\tgeometry.setAttribute( 'color', new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferAttribute\"]( RGB, 3, true ) );\r\n\t\t\tmaterial.vertexColors = true;\r\n\r\n\t\t}\r\n\r\n\t\tconst object = new three__WEBPACK_IMPORTED_MODULE_1__[\"Points\"]( geometry, material );\r\n\t\tresult.scene = object;\r\n\t\tresult.scene.featureTable = featureTable;\r\n\r\n\t\treturn result;\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/three/SphereHelper.js": -/*!******************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/three/SphereHelper.js ***! - \******************************************************************/ -/*! exports provided: SphereHelper */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SphereHelper\", function() { return SphereHelper; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\n\r\nconst _vector = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\nconst axes = [ 'x', 'y', 'z' ];\r\nclass SphereHelper extends three__WEBPACK_IMPORTED_MODULE_0__[\"LineSegments\"] {\r\n\r\n\tconstructor( sphere, color = 0xffff00, angleSteps = 40 ) {\r\n\r\n\t\tconst geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferGeometry\"]();\r\n\t\tconst positions = [];\r\n\t\tfor ( let i = 0; i < 3; i ++ ) {\r\n\r\n\t\t\tconst axis1 = axes[ i ];\r\n\t\t\tconst axis2 = axes[ ( i + 1 ) % 3 ];\r\n\t\t\t_vector.set( 0, 0, 0 );\r\n\r\n\t\t\tfor ( let a = 0; a < angleSteps; a ++ ) {\r\n\r\n\t\t\t\tlet angle;\r\n\t\t\t\tangle = 2 * Math.PI * a / ( angleSteps - 1 );\r\n\t\t\t\t_vector[ axis1 ] = Math.sin( angle );\r\n\t\t\t\t_vector[ axis2 ] = Math.cos( angle );\r\n\r\n\t\t\t\tpositions.push( _vector.x, _vector.y, _vector.z );\r\n\r\n\t\t\t\tangle = 2 * Math.PI * ( a + 1 ) / ( angleSteps - 1 );\r\n\t\t\t\t_vector[ axis1 ] = Math.sin( angle );\r\n\t\t\t\t_vector[ axis2 ] = Math.cos( angle );\r\n\r\n\t\t\t\tpositions.push( _vector.x, _vector.y, _vector.z );\r\n\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t\tgeometry.setAttribute( 'position', new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferAttribute\"]( new Float32Array( positions ), 3 ) );\r\n\t\tgeometry.computeBoundingSphere();\r\n\r\n\t\tsuper( geometry, new three__WEBPACK_IMPORTED_MODULE_0__[\"LineBasicMaterial\"]( { color: color, toneMapped: false } ) );\r\n\t\tthis.sphere = sphere;\r\n\t\tthis.type = 'SphereHelper';\r\n\r\n\t}\r\n\r\n\tupdateMatrixWorld( force ) {\r\n\r\n\t\tconst sphere = this.sphere;\r\n\t\tthis.position.copy( sphere.center );\r\n\t\tthis.scale.setScalar( sphere.radius );\r\n\t\tsuper.updateMatrixWorld( force );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/SphereHelper.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/three/TilesGroup.js": -/*!****************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/three/TilesGroup.js ***! - \****************************************************************/ -/*! exports provided: TilesGroup */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TilesGroup\", function() { return TilesGroup; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\n\r\n// Specialization of \"Group\" that only updates world matrices of children if\r\n// the transform has changed since the last update and ignores the \"force\"\r\n// parameter under the assumption that the children tiles will not move.\r\nconst tempMat = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\r\nclass TilesGroup extends three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"] {\r\n\r\n\tconstructor( tilesRenderer ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.tilesRenderer = tilesRenderer;\r\n\r\n\t}\r\n\r\n\traycast( raycaster, intersects ) {\r\n\r\n\t\tthis.tilesRenderer.raycast( raycaster, intersects );\r\n\r\n\t}\r\n\r\n\tupdateMatrixWorld( force ) {\r\n\r\n\t\tif ( this.matrixAutoUpdate ) {\r\n\r\n\t\t\tthis.updateMatrix();\r\n\r\n\t\t}\r\n\r\n\t\tif ( this.matrixWorldNeedsUpdate || force ) {\r\n\r\n\t\t\tif ( this.parent === null ) {\r\n\r\n\t\t\t\ttempMat.copy( this.matrix );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\ttempMat.multiplyMatrices( this.parent.matrixWorld, this.matrix );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tthis.matrixWorldNeedsUpdate = false;\r\n\r\n\t\t\t// check if the matrix changed relative to what it was.\r\n\t\t\tconst elA = tempMat.elements;\r\n\t\t\tconst elB = this.matrixWorld.elements;\r\n\t\t\tlet isDifferent = false;\r\n\t\t\tfor ( let i = 0; i < 16; i ++ ) {\r\n\r\n\t\t\t\tconst itemA = elA[ i ];\r\n\t\t\t\tconst itemB = elB[ i ];\r\n\t\t\t\tconst diff = Math.abs( itemA - itemB );\r\n\r\n\t\t\t\tif ( diff > Number.EPSILON ) {\r\n\r\n\t\t\t\t\tisDifferent = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( isDifferent ) {\r\n\r\n\t\t\t\tthis.matrixWorld.copy( tempMat );\r\n\r\n\t\t\t\t// update children\r\n\t\t\t\t// the children will not have to change unless the parent group has updated\r\n\t\t\t\tconst children = this.children;\r\n\t\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\t\t\tchildren[ i ].updateMatrixWorld();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/TilesGroup.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js": -/*!*******************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js ***! - \*******************************************************************/ -/*! exports provided: TilesRenderer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TilesRenderer\", function() { return TilesRenderer; });\n/* harmony import */ var _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/TilesRendererBase.js */ \"./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js\");\n/* harmony import */ var _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./B3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js\");\n/* harmony import */ var _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PNTSLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js\");\n/* harmony import */ var _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./I3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js\");\n/* harmony import */ var _CMPTLoader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CMPTLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js\");\n/* harmony import */ var _TilesGroup_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TilesGroup.js */ \"./node_modules/3d-tiles-renderer/src/three/TilesGroup.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _raycastTraverse_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./raycastTraverse.js */ \"./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst INITIAL_FRUSTUM_CULLED = Symbol( 'INITIAL_FRUSTUM_CULLED' );\r\nconst DEG2RAD = three__WEBPACK_IMPORTED_MODULE_6__[\"Math\"].DEG2RAD;\r\nconst tempMat = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\nconst tempMat2 = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\nconst tempVector = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\nconst vecX = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\nconst vecY = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\nconst vecZ = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\n\r\nconst X_AXIS = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]( 1, 0, 0 );\r\nconst Y_AXIS = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]( 0, 1, 0 );\r\n\r\nfunction emptyRaycast() {}\r\n\r\nfunction updateFrustumCulled( object, toInitialValue ) {\r\n\r\n\tobject.traverse( c => {\r\n\r\n\t\tc.frustumCulled = c[ INITIAL_FRUSTUM_CULLED ] && toInitialValue;\r\n\r\n\t} );\r\n\r\n}\r\n\r\nclass TilesRenderer extends _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_0__[\"TilesRendererBase\"] {\r\n\r\n\tget autoDisableRendererCulling() {\r\n\r\n\t\treturn this._autoDisableRendererCulling;\r\n\r\n\t}\r\n\r\n\tset autoDisableRendererCulling( value ) {\r\n\r\n\t\tif ( this._autoDisableRendererCulling !== value ) {\r\n\r\n\t\t\tsuper._autoDisableRendererCulling = value;\r\n\t\t\tthis.traverse( tile => {\r\n\r\n\t\t\t\tif ( tile.scene ) {\r\n\r\n\t\t\t\t\tupdateFrustumCulled( tile.scene, value );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tconstructor( ...args ) {\r\n\r\n\t\tsuper( ...args );\r\n\t\tthis.group = new _TilesGroup_js__WEBPACK_IMPORTED_MODULE_5__[\"TilesGroup\"]( this );\r\n\t\tthis.cameras = [];\r\n\t\tthis.cameraMap = new Map();\r\n\t\tthis.cameraInfo = [];\r\n\t\tthis.activeTiles = new Set();\r\n\t\tthis.visibleTiles = new Set();\r\n\t\tthis._autoDisableRendererCulling = true;\r\n\r\n\t\tthis.onLoadTileSet = null;\r\n\t\tthis.onLoadModel = null;\r\n\t\tthis.onDisposeModel = null;\r\n\r\n\t\tconst manager = new three__WEBPACK_IMPORTED_MODULE_6__[\"LoadingManager\"]();\r\n\t\tmanager.setURLModifier( url => {\r\n\r\n\t\t\tif ( this.preprocessURL ) {\r\n\r\n\t\t\t\treturn this.preprocessURL( url );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\treturn url;\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\t/* Public API */\r\n\tgetBounds( box ) {\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst cached = this.root.cached;\r\n\t\tconst boundingBox = cached.box;\r\n\t\tconst obbMat = cached.boxTransform;\r\n\r\n\t\tif ( boundingBox ) {\r\n\r\n\t\t\tbox.copy( boundingBox );\r\n\t\t\tbox.applyMatrix4( obbMat );\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tgetOrientedBounds( box, matrix ) {\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst cached = this.root.cached;\r\n\t\tconst boundingBox = cached.box;\r\n\t\tconst obbMat = cached.boxTransform;\r\n\r\n\t\tif ( box ) {\r\n\r\n\t\t\tbox.copy( boundingBox );\r\n\t\t\tmatrix.copy( obbMat );\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tforEachLoadedModel( callback ) {\r\n\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tconst scene = tile.cached.scene;\r\n\t\t\tif ( scene ) {\r\n\r\n\t\t\t\tcallback( scene, tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\traycast( raycaster, intersects ) {\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\tif ( raycaster.firstHitOnly ) {\r\n\r\n\t\t\tconst hit = Object(_raycastTraverse_js__WEBPACK_IMPORTED_MODULE_7__[\"raycastTraverseFirstHit\"])( this.root, this.group, this.activeTiles, raycaster );\r\n\t\t\tif ( hit ) {\r\n\r\n\t\t\t\tintersects.push( hit );\r\n\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t\tObject(_raycastTraverse_js__WEBPACK_IMPORTED_MODULE_7__[\"raycastTraverse\"])( this.root, this.group, this.activeTiles, raycaster, intersects );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\thasCamera( camera ) {\r\n\r\n\t\treturn this.cameraMap.has( camera );\r\n\r\n\t}\r\n\r\n\tsetCamera( camera ) {\r\n\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( ! cameraMap.has( camera ) ) {\r\n\r\n\t\t\tcameraMap.set( camera, new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector2\"]() );\r\n\t\t\tcameras.push( camera );\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\tsetResolution( camera, xOrVec, y ) {\r\n\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( ! cameraMap.has( camera ) ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tif ( xOrVec instanceof three__WEBPACK_IMPORTED_MODULE_6__[\"Vector2\"] ) {\r\n\r\n\t\t\tcameraMap.get( camera ).copy( xOrVec );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tcameraMap.get( camera ).set( xOrVec, y );\r\n\r\n\t\t}\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tsetResolutionFromRenderer( camera, renderer ) {\r\n\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( ! cameraMap.has( camera ) ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst resolution = cameraMap.get( camera );\r\n\t\trenderer.getSize( resolution );\r\n\t\tresolution.multiplyScalar( renderer.getPixelRatio() );\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tdeleteCamera( camera ) {\r\n\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( cameraMap.has( camera ) ) {\r\n\r\n\t\t\tconst index = cameras.indexOf( camera );\r\n\t\t\tcameras.splice( index, 1 );\r\n\t\t\tcameraMap.delete( camera );\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\t/* Overriden */\r\n\tfetchTileSet( url, ...rest ) {\r\n\r\n\t\tconst pr = super.fetchTileSet( url, ...rest );\r\n\t\tpr.then( json => {\r\n\r\n\t\t\tif ( this.onLoadTileSet ) {\r\n\r\n\t\t\t\t// Push this onto the end of the event stack to ensure this runs\r\n\t\t\t\t// after the base renderer has placed the provided json where it\r\n\t\t\t\t// needs to be placed and is ready for an update.\r\n\t\t\t\tPromise.resolve().then( () => {\r\n\r\n\t\t\t\t\tthis.onLoadTileSet( json, url );\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\t\treturn pr;\r\n\r\n\t}\r\n\r\n\tupdate() {\r\n\r\n\t\tconst group = this.group;\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tconst cameraInfo = this.cameraInfo;\r\n\r\n\t\tif ( cameras.length === 0 ) {\r\n\r\n\t\t\tconsole.warn( 'TilesRenderer: no cameras defined. Cannot update 3d tiles.' );\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\t// automatically scale the array of cameraInfo to match the cameras\r\n\t\twhile ( cameraInfo.length > cameras.length ) {\r\n\r\n\t\t\tcameraInfo.pop();\r\n\r\n\t\t}\r\n\r\n\t\twhile ( cameraInfo.length < cameras.length ) {\r\n\r\n\t\t\tcameraInfo.push( {\r\n\r\n\t\t\t\tfrustum: new three__WEBPACK_IMPORTED_MODULE_6__[\"Frustum\"](),\r\n\t\t\t\tsseDenominator: - 1,\r\n\t\t\t\tposition: new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"](),\r\n\t\t\t\tinvScale: - 1,\r\n\t\t\t\tpixelSize: 0,\r\n\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t\t// extract scale of group container\r\n\t\ttempMat2.copy( group.matrixWorld ).invert();\r\n\r\n\t\tlet invScale;\r\n\t\ttempVector.setFromMatrixScale( tempMat2 );\r\n\t\tinvScale = tempVector.x;\r\n\r\n\t\tif ( Math.abs( Math.max( tempVector.x - tempVector.y, tempVector.x - tempVector.z ) ) > 1e-6 ) {\r\n\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.' );\r\n\r\n\t\t}\r\n\r\n\t\t// store the camera cameraInfo in the 3d tiles root frame\r\n\t\tfor ( let i = 0, l = cameraInfo.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst camera = cameras[ i ];\r\n\t\t\tconst info = cameraInfo[ i ];\r\n\t\t\tconst frustum = info.frustum;\r\n\t\t\tconst position = info.position;\r\n\t\t\tconst resolution = cameraMap.get( camera );\r\n\r\n\t\t\tif ( resolution.width === 0 || resolution.height === 0 ) {\r\n\r\n\t\t\t\tconsole.warn( 'TilesRenderer: resolution for camera error calculation is not set.' );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( camera.isPerspectiveCamera ) {\r\n\r\n\t\t\t\tinfo.sseDenominator = 2 * Math.tan( 0.5 * camera.fov * DEG2RAD ) / resolution.height;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( camera.isOrthographicCamera ) {\r\n\r\n\t\t\t\tconst w = camera.right - camera.left;\r\n\t\t\t\tconst h = camera.top - camera.bottom;\r\n\t\t\t\tinfo.pixelSize = Math.max( h / resolution.height, w / resolution.width );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tinfo.invScale = invScale;\r\n\r\n\t\t\t// get frustum in group root frame\r\n\t\t\ttempMat.copy( group.matrixWorld );\r\n\t\t\ttempMat.premultiply( camera.matrixWorldInverse );\r\n\t\t\ttempMat.premultiply( camera.projectionMatrix );\r\n\r\n\t\t\tfrustum.setFromProjectionMatrix( tempMat );\r\n\r\n\t\t\t// get transform position in group root frame\r\n\t\t\tposition.set( 0, 0, 0 );\r\n\t\t\tposition.applyMatrix4( camera.matrixWorld );\r\n\t\t\tposition.applyMatrix4( tempMat2 );\r\n\r\n\t\t}\r\n\r\n\t\tsuper.update();\r\n\r\n\t}\r\n\r\n\tpreprocessNode( tile, parentTile, tileSetDir ) {\r\n\r\n\t\tsuper.preprocessNode( tile, parentTile, tileSetDir );\r\n\r\n\t\tconst transform = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\n\t\tif ( tile.transform ) {\r\n\r\n\t\t\tconst transformArr = tile.transform;\r\n\t\t\tfor ( let i = 0; i < 16; i ++ ) {\r\n\r\n\t\t\t\ttransform.elements[ i ] = transformArr[ i ];\r\n\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t\ttransform.identity();\r\n\r\n\t\t}\r\n\r\n\t\tif ( parentTile ) {\r\n\r\n\t\t\ttransform.premultiply( parentTile.cached.transform );\r\n\r\n\t\t}\r\n\r\n\t\tlet box = null;\r\n\t\tlet boxTransform = null;\r\n\t\tlet boxTransformInverse = null;\r\n\t\tif ( 'box' in tile.boundingVolume ) {\r\n\r\n\t\t\tconst data = tile.boundingVolume.box;\r\n\t\t\tbox = new three__WEBPACK_IMPORTED_MODULE_6__[\"Box3\"]();\r\n\t\t\tboxTransform = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\n\t\t\tboxTransformInverse = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\n\r\n\t\t\t// get the extents of the bounds in each axis\r\n\t\t\tvecX.set( data[ 3 ], data[ 4 ], data[ 5 ] );\r\n\t\t\tvecY.set( data[ 6 ], data[ 7 ], data[ 8 ] );\r\n\t\t\tvecZ.set( data[ 9 ], data[ 10 ], data[ 11 ] );\r\n\r\n\t\t\tconst scaleX = vecX.length();\r\n\t\t\tconst scaleY = vecY.length();\r\n\t\t\tconst scaleZ = vecZ.length();\r\n\r\n\t\t\tvecX.normalize();\r\n\t\t\tvecY.normalize();\r\n\t\t\tvecZ.normalize();\r\n\r\n\t\t\t// create the oriented frame that the box exists in\r\n\t\t\tboxTransform.set(\r\n\t\t\t\tvecX.x, vecY.x, vecZ.x, data[ 0 ],\r\n\t\t\t\tvecX.y, vecY.y, vecZ.y, data[ 1 ],\r\n\t\t\t\tvecX.z, vecY.z, vecZ.z, data[ 2 ],\r\n\t\t\t\t0, 0, 0, 1\r\n\t\t\t);\r\n\t\t\tboxTransform.premultiply( transform );\r\n\t\t\tboxTransformInverse.copy( boxTransform ).invert();\r\n\r\n\t\t\t// scale the box by the extents\r\n\t\t\tbox.min.set( - scaleX, - scaleY, - scaleZ );\r\n\t\t\tbox.max.set( scaleX, scaleY, scaleZ );\r\n\r\n\t\t}\r\n\r\n\t\tlet sphere = null;\r\n\t\tif ( 'sphere' in tile.boundingVolume ) {\r\n\r\n\t\t\tconst data = tile.boundingVolume.sphere;\r\n\t\t\tsphere = new three__WEBPACK_IMPORTED_MODULE_6__[\"Sphere\"]();\r\n\t\t\tsphere.center.set( data[ 0 ], data[ 1 ], data[ 2 ] );\r\n\t\t\tsphere.radius = data[ 3 ];\r\n\t\t\tsphere.applyMatrix4( transform );\r\n\r\n\t\t} else if ( 'box' in tile.boundingVolume ) {\r\n\r\n\t\t\tconst data = tile.boundingVolume.box;\r\n\t\t\tsphere = new three__WEBPACK_IMPORTED_MODULE_6__[\"Sphere\"]();\r\n\t\t\tbox.getBoundingSphere( sphere );\r\n\t\t\tsphere.center.set( data[ 0 ], data[ 1 ], data[ 2 ] );\r\n\t\t\tsphere.applyMatrix4( transform );\r\n\r\n\t\t}\r\n\r\n\t\tlet region = null;\r\n\t\tif ( 'region' in tile.boundingVolume ) {\r\n\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer: region bounding volume not supported.' );\r\n\r\n\t\t}\r\n\r\n\t\ttile.cached = {\r\n\r\n\t\t\tloadIndex: 0,\r\n\t\t\ttransform,\r\n\t\t\tactive: false,\r\n\t\t\tinFrustum: [],\r\n\r\n\t\t\tbox,\r\n\t\t\tboxTransform,\r\n\t\t\tboxTransformInverse,\r\n\t\t\tsphere,\r\n\t\t\tregion,\r\n\r\n\t\t\tscene: null,\r\n\t\t\tgeometry: null,\r\n\t\t\tmaterial: null,\r\n\t\t\tdistance: Infinity\r\n\r\n\t\t};\r\n\r\n\t}\r\n\r\n\tparseTile( buffer, tile, extension ) {\r\n\r\n\t\ttile._loadIndex = tile._loadIndex || 0;\r\n\t\ttile._loadIndex ++;\r\n\r\n\t\tconst uri = tile.content.uri;\r\n\t\tconst uriSplits = uri.split( /[\\\\\\/]/g );\r\n\t\turiSplits.pop();\r\n\t\tconst workingPath = uriSplits.join( '/' );\r\n\t\tconst fetchOptions = this.fetchOptions;\r\n\r\n\t\tconst manager = this.manager;\r\n\t\tconst loadIndex = tile._loadIndex;\r\n\t\tlet promise = null;\r\n\r\n\t\tswitch ( extension ) {\r\n\r\n\t\t\tcase 'b3dm':\r\n\t\t\t\tpromise = new _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_1__[\"B3DMLoader\"]( manager )\r\n\t\t\t\t\t.parse( buffer )\r\n\t\t\t\t\t.then( res => res.scene );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'pnts':\r\n\t\t\t\tpromise = Promise.resolve( new _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"PNTSLoader\"]( manager ).parse( buffer ).scene );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'i3dm': {\r\n\r\n\t\t\t\tconst loader = new _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_3__[\"I3DMLoader\"]( manager );\r\n\t\t\t\tloader.workingPath = workingPath;\r\n\t\t\t\tloader.fetchOptions = fetchOptions;\r\n\t\t\t\tpromise = loader\r\n\t\t\t\t\t.parse( buffer )\r\n\t\t\t\t\t.then( res => res.scene );\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tcase 'cmpt': {\r\n\r\n\t\t\t\tconst loader = new _CMPTLoader_js__WEBPACK_IMPORTED_MODULE_4__[\"CMPTLoader\"]( manager );\r\n\t\t\t\tloader.workingPath = workingPath;\r\n\t\t\t\tloader.fetchOptions = fetchOptions;\r\n\t\t\t\tpromise = loader\r\n\t\t\t\t\t.parse( buffer )\r\n\t\t\t\t\t.then( res => res.scene\t);\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.warn( `TilesRenderer: Content type \"${ extension }\" not supported.` );\r\n\t\t\t\tpromise = Promise.resolve( null );\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\r\n\t\treturn promise.then( scene => {\r\n\r\n\t\t\tif ( tile._loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\treturn;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst upAxis = this.rootTileSet.asset && this.rootTileSet.asset.gltfUpAxis || 'y';\r\n\t\t\tconst cached = tile.cached;\r\n\t\t\tconst cachedTransform = cached.transform;\r\n\r\n\t\t\tswitch ( upAxis.toLowerCase() ) {\r\n\r\n\t\t\t\tcase 'x':\r\n\t\t\t\t\tscene.matrix.makeRotationAxis( Y_AXIS, - Math.PI / 2 );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'y':\r\n\t\t\t\t\tscene.matrix.makeRotationAxis( X_AXIS, Math.PI / 2 );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'z':\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tscene.matrix.premultiply( cachedTransform );\r\n\t\t\tscene.matrix.decompose( scene.position, scene.quaternion, scene.scale );\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tc[ INITIAL_FRUSTUM_CULLED ] = c.frustumCulled;\r\n\r\n\t\t\t} );\r\n\t\t\tupdateFrustumCulled( scene, this.autoDisableRendererCulling );\r\n\r\n\t\t\tcached.scene = scene;\r\n\r\n\t\t\t// We handle raycasting in a custom way so remove it from here\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tc.raycast = emptyRaycast;\r\n\r\n\t\t\t} );\r\n\r\n\t\t\tconst materials = [];\r\n\t\t\tconst geometry = [];\r\n\t\t\tconst textures = [];\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tif ( c.geometry ) {\r\n\r\n\t\t\t\t\tgeometry.push( c.geometry );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( c.material ) {\r\n\r\n\t\t\t\t\tconst material = c.material;\r\n\t\t\t\t\tmaterials.push( c.material );\r\n\r\n\t\t\t\t\tfor ( const key in material ) {\r\n\r\n\t\t\t\t\t\tconst value = material[ key ];\r\n\t\t\t\t\t\tif ( value && value.isTexture ) {\r\n\r\n\t\t\t\t\t\t\ttextures.push( value );\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t\tcached.materials = materials;\r\n\t\t\tcached.geometry = geometry;\r\n\t\t\tcached.textures = textures;\r\n\r\n\t\t\tif ( this.onLoadModel ) {\r\n\r\n\t\t\t\tthis.onLoadModel( scene, tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tdisposeTile( tile ) {\r\n\r\n\t\t// This could get called before the tile has finished downloading\r\n\t\tconst cached = tile.cached;\r\n\t\tif ( cached.scene ) {\r\n\r\n\t\t\tconst materials = cached.materials;\r\n\t\t\tconst geometry = cached.geometry;\r\n\t\t\tconst textures = cached.textures;\r\n\r\n\t\t\tfor ( let i = 0, l = geometry.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tgeometry[ i ].dispose();\r\n\r\n\t\t\t}\r\n\r\n\t\t\tfor ( let i = 0, l = materials.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tmaterials[ i ].dispose();\r\n\r\n\t\t\t}\r\n\r\n\t\t\tfor ( let i = 0, l = textures.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tconst texture = textures[ i ];\r\n\t\t\t\ttexture.dispose();\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( this.onDisposeModel ) {\r\n\r\n\t\t\t\tthis.onDisposeModel( cached.scene, tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tcached.scene = null;\r\n\t\t\tcached.materials = null;\r\n\t\t\tcached.textures = null;\r\n\t\t\tcached.geometry = null;\r\n\r\n\t\t}\r\n\r\n\t\ttile._loadIndex ++;\r\n\r\n\t}\r\n\r\n\tsetTileVisible( tile, visible ) {\r\n\r\n\t\tconst scene = tile.cached.scene;\r\n\t\tconst visibleTiles = this.visibleTiles;\r\n\t\tconst group = this.group;\r\n\t\tif ( visible ) {\r\n\r\n\t\t\tgroup.add( scene );\r\n\t\t\tvisibleTiles.add( tile );\r\n\t\t\tscene.updateMatrixWorld( true );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tgroup.remove( scene );\r\n\t\t\tvisibleTiles.delete( tile );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tsetTileActive( tile, active ) {\r\n\r\n\t\tconst activeTiles = this.activeTiles;\r\n\t\tif ( active ) {\r\n\r\n\t\t\tactiveTiles.add( tile );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tactiveTiles.delete( tile );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tcalculateError( tile ) {\r\n\r\n\t\tif ( tile.geometricError === 0.0 ) {\r\n\r\n\t\t\treturn 0.0;\r\n\r\n\t\t}\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tconst inFrustum = cached.inFrustum;\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraInfo = this.cameraInfo;\r\n\r\n\t\t// TODO: Use the content bounding volume here?\r\n\t\tconst boundingVolume = tile.boundingVolume;\r\n\t\tif ( 'box' in boundingVolume ) {\r\n\r\n\t\t\tconst boundingBox = cached.box;\r\n\t\t\tconst boxTransformInverse = cached.boxTransformInverse;\r\n\r\n\t\t\tlet maxError = - Infinity;\r\n\t\t\tlet minDistance = Infinity;\r\n\t\t\tfor ( let i = 0, l = cameras.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tif ( ! inFrustum[ i ] ) {\r\n\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// transform camera position into local frame of the tile bounding box\r\n\t\t\t\tconst camera = cameras[ i ];\r\n\t\t\t\tconst info = cameraInfo[ i ];\r\n\t\t\t\tconst invScale = info.invScale;\r\n\t\t\t\ttempVector.copy( info.position );\r\n\t\t\t\ttempVector.applyMatrix4( boxTransformInverse );\r\n\r\n\t\t\t\tlet error;\r\n\t\t\t\tif ( camera.isOrthographicCamera ) {\r\n\r\n\t\t\t\t\tconst pixelSize = info.pixelSize;\r\n\t\t\t\t\terror = tile.geometricError / ( pixelSize * invScale );\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tconst distance = boundingBox.distanceToPoint( tempVector );\r\n\t\t\t\t\tconst scaledDistance = distance * invScale;\r\n\t\t\t\t\tconst sseDenominator = info.sseDenominator;\r\n\t\t\t\t\terror = tile.geometricError / ( scaledDistance * sseDenominator );\r\n\r\n\t\t\t\t\tminDistance = Math.min( minDistance, scaledDistance );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmaxError = Math.max( maxError, error );\r\n\r\n\t\t\t}\r\n\r\n\t\t\ttile.cached.distance = minDistance;\r\n\r\n\t\t\treturn maxError;\r\n\r\n\t\t} else if ( 'sphere' in boundingVolume ) {\r\n\r\n\t\t\t// const sphere = cached.sphere;\r\n\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer : Sphere bounds not supported.' );\r\n\r\n\t\t} else if ( 'region' in boundingVolume ) {\r\n\r\n\t\t\t// unsupported\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer : Region bounds not supported.' );\r\n\r\n\t\t}\r\n\r\n\t\treturn Infinity;\r\n\r\n\t}\r\n\r\n\ttileInView( tile ) {\r\n\r\n\t\t// TODO: we should use the more precise bounding volumes here if possible\r\n\t\t// cache the root-space planes\r\n\t\t// Use separating axis theorem for frustum and obb\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tconst sphere = cached.sphere;\r\n\t\tconst inFrustum = cached.inFrustum;\r\n\t\tif ( sphere ) {\r\n\r\n\t\t\tconst cameraInfo = this.cameraInfo;\r\n\t\t\tlet inView = false;\r\n\t\t\tfor ( let i = 0, l = cameraInfo.length; i < l; i ++ ) {\r\n\r\n\t\t\t\t// Track which camera frustums this tile is in so we can use it\r\n\t\t\t\t// to ignore the error calculations for cameras that can't see it\r\n\t\t\t\tconst frustum = cameraInfo[ i ].frustum;\r\n\t\t\t\tif ( frustum.intersectsSphere( sphere ) ) {\r\n\r\n\t\t\t\t\tinView = true;\r\n\t\t\t\t\tinFrustum[ i ] = true;\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tinFrustum[ i ] = false;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn inView;\r\n\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js": -/*!*********************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js ***! - \*********************************************************************/ -/*! exports provided: raycastTraverseFirstHit, raycastTraverse */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"raycastTraverseFirstHit\", function() { return raycastTraverseFirstHit; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"raycastTraverse\", function() { return raycastTraverse; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\nconst _sphere = new three__WEBPACK_IMPORTED_MODULE_0__[\"Sphere\"]();\r\nconst _mat = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\r\nconst _vec = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\nconst _vec2 = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\nconst _ray = new three__WEBPACK_IMPORTED_MODULE_0__[\"Ray\"]();\r\n\r\nconst _hitArray = [];\r\n\r\nfunction distanceSort( a, b ) {\r\n\r\n\treturn a.distance - b.distance;\r\n\r\n}\r\n\r\nfunction intersectTileScene( scene, raycaster, intersects ) {\r\n\r\n\t// Don't intersect the box3 helpers because those are used for debugging\r\n\tscene.traverse( c => {\r\n\r\n\t\t// We set the default raycast function to empty so three.js doesn't automatically cast against it\r\n\t\tObject.getPrototypeOf( c ).raycast.call( c, raycaster, intersects );\r\n\r\n\t} );\r\n\r\n}\r\n\r\n// Returns the closest hit when traversing the tree\r\nfunction raycastTraverseFirstHit( root, group, activeTiles, raycaster ) {\r\n\r\n\t// If the root is active make sure we've checked it\r\n\tif ( activeTiles.has( root ) ) {\r\n\r\n\t\tintersectTileScene( root.cached.scene, raycaster, _hitArray );\r\n\r\n\t\tif ( _hitArray.length > 0 ) {\r\n\r\n\t\t\tif ( _hitArray.length > 1 ) {\r\n\r\n\t\t\t\t_hitArray.sort( distanceSort );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst res = _hitArray[ 0 ];\r\n\t\t\t_hitArray.length = 0;\r\n\t\t\treturn res;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// TODO: can we avoid creating a new array here every time to save on memory?\r\n\tconst array = [];\r\n\tconst children = root.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\tconst tile = children[ i ];\r\n\t\tconst cached = tile.cached;\r\n\t\tconst groupMatrixWorld = group.matrixWorld;\r\n\r\n\t\t_mat.copy( groupMatrixWorld );\r\n\r\n\t\t// if we don't hit the sphere then early out\r\n\t\tconst sphere = cached.sphere;\r\n\t\tif ( sphere ) {\r\n\r\n\t\t\t_sphere.copy( sphere );\r\n\t\t\t_sphere.applyMatrix4( _mat );\r\n\t\t\tif ( ! raycaster.ray.intersectsSphere( _sphere ) ) {\r\n\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// TODO: check region?\r\n\r\n\t\tconst boundingBox = cached.box;\r\n\t\tconst obbMat = cached.boxTransform;\r\n\t\tif ( boundingBox ) {\r\n\r\n\t\t\t_mat.multiply( obbMat ).invert();\r\n\t\t\t_ray.copy( raycaster.ray );\r\n\t\t\t_ray.applyMatrix4( _mat );\r\n\t\t\tif ( _ray.intersectBox( boundingBox, _vec ) ) {\r\n\r\n\t\t\t\t// account for tile scale\r\n\t\t\t\tlet invScale;\r\n\t\t\t\t_vec2.setFromMatrixScale( _mat );\r\n\t\t\t\tinvScale = _vec2.x;\r\n\r\n\t\t\t\tif ( Math.abs( Math.max( _vec2.x - _vec2.y, _vec2.x - _vec2.z ) ) > 1e-6 ) {\r\n\r\n\t\t\t\t\tconsole.warn( 'ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when raycasting.' );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// if we intersect the box save the distance to the tile bounds\r\n\t\t\t\tlet data = {\r\n\t\t\t\t\tdistance: Infinity,\r\n\t\t\t\t\ttile: null\r\n\t\t\t\t};\r\n\t\t\t\tarray.push( data );\r\n\r\n\t\t\t\tdata.distance = _vec.distanceToSquared( _ray.origin ) * invScale * invScale;\r\n\t\t\t\tdata.tile = tile;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// sort them by ascending distance\r\n\tarray.sort( distanceSort );\r\n\r\n\t// traverse until we find the best hit and early out if a tile bounds\r\n\t// couldn't possible include a best hit\r\n\tlet bestDistanceSquared = Infinity;\r\n\tlet bestHit = null;\r\n\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\r\n\r\n\t\tconst data = array[ i ];\r\n\t\tconst distanceSquared = data.distance;\r\n\t\tif ( distanceSquared > bestDistanceSquared ) {\r\n\r\n\t\t\tbreak;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconst tile = data.tile;\r\n\t\t\tconst scene = tile.cached.scene;\r\n\r\n\t\t\tlet hit = null;\r\n\t\t\tif ( activeTiles.has( tile ) ) {\r\n\r\n\t\t\t\t// save the hit if it's closer\r\n\t\t\t\tintersectTileScene( scene, raycaster, _hitArray );\r\n\t\t\t\tif ( _hitArray.length > 0 ) {\r\n\r\n\t\t\t\t\tif ( _hitArray.length > 1 ) {\r\n\r\n\t\t\t\t\t\t_hitArray.sort( distanceSort );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\thit = _hitArray[ 0 ];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\thit = raycastTraverseFirstHit( tile, group, activeTiles, raycaster );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( hit ) {\r\n\r\n\t\t\t\tconst hitDistanceSquared = hit.distance * hit.distance;\r\n\t\t\t\tif ( hitDistanceSquared < bestDistanceSquared ) {\r\n\r\n\t\t\t\t\tbestDistanceSquared = hitDistanceSquared;\r\n\t\t\t\t\tbestHit = hit;\r\n\r\n\t\t\t\t}\r\n\t\t\t\t_hitArray.length = 0;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn bestHit;\r\n\r\n}\r\n\r\nfunction raycastTraverse( tile, group, activeTiles, raycaster, intersects ) {\r\n\r\n\tconst cached = tile.cached;\r\n\tconst groupMatrixWorld = group.matrixWorld;\r\n\r\n\t_mat.copy( groupMatrixWorld );\r\n\r\n\t// Early out if we don't hit this tile sphere\r\n\tconst sphere = cached.sphere;\r\n\tif ( sphere ) {\r\n\r\n\t\t_sphere.copy( sphere );\r\n\t\t_sphere.applyMatrix4( _mat );\r\n\t\tif ( ! raycaster.ray.intersectsSphere( _sphere ) ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// Early out if we don't this this tile box\r\n\tconst boundingBox = cached.box;\r\n\tconst obbMat = cached.boxTransform;\r\n\tif ( boundingBox ) {\r\n\r\n\t\t_mat.multiply( obbMat ).invert();\r\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _mat );\r\n\t\tif ( ! _ray.intersectsBox( boundingBox ) ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// TODO: check region\r\n\r\n\tconst scene = cached.scene;\r\n\tif ( activeTiles.has( tile ) ) {\r\n\r\n\t\tintersectTileScene( scene, raycaster, intersects );\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst children = tile.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\traycastTraverse( children[ i ], group, activeTiles, raycaster, intersects );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js": -/*!**********************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js ***! - \**********************************************************************/ -/*! exports provided: FeatureTable, BatchTable */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FeatureTable\", function() { return FeatureTable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BatchTable\", function() { return BatchTable; });\n/* harmony import */ var _arrayToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayToString.js */ \"./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js\");\n\r\n\r\nclass FeatureTable {\r\n\r\n\tconstructor( buffer, start, headerLength, binLength ) {\r\n\r\n\t\tthis.buffer = buffer;\r\n\t\tthis.binOffset = start + headerLength;\r\n\t\tthis.binLength = binLength;\r\n\r\n\t\tlet header = null;\r\n\t\tif ( headerLength !== 0 ) {\r\n\r\n\t\t\tconst headerData = new Uint8Array( buffer, start, headerLength );\r\n\t\t\theader = JSON.parse( Object(_arrayToString_js__WEBPACK_IMPORTED_MODULE_0__[\"arrayToString\"])( headerData ) );\r\n\r\n\t\t} else {\r\n\r\n\t\t\theader = {};\r\n\r\n\t\t}\r\n\t\tthis.header = header;\r\n\r\n\t}\r\n\r\n\tgetKeys() {\r\n\r\n\t\treturn Object.keys( this.header );\r\n\r\n\t}\r\n\r\n\tgetData( key, count, defaultComponentType = null, defaultType = null ) {\r\n\r\n\t\tconst header = this.header;\r\n\r\n\t\tif ( ! ( key in header ) ) {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\r\n\t\tconst feature = header[ key ];\r\n\t\tif ( ! ( feature instanceof Object ) ) {\r\n\r\n\t\t\treturn feature;\r\n\r\n\t\t} else if ( Array.isArray( feature ) ) {\r\n\r\n\t\t\treturn feature;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconst { buffer, binOffset, binLength } = this;\r\n\t\t\tconst byteOffset = feature.byteOffset || 0;\r\n\t\t\tconst featureType = feature.type || defaultType;\r\n\t\t\tconst featureComponentType = feature.componentType || defaultComponentType;\r\n\r\n\t\t\tif ( 'type' in feature && defaultType && feature.type !== defaultType ) {\r\n\r\n\t\t\t\tthrow new Error( 'FeatureTable: Specified type does not match expected type.' );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tlet stride;\r\n\t\t\tswitch ( featureType ) {\r\n\r\n\t\t\t\tcase 'SCALAR':\r\n\t\t\t\t\tstride = 1;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'VEC2':\r\n\t\t\t\t\tstride = 2;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'VEC3':\r\n\t\t\t\t\tstride = 3;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'VEC4':\r\n\t\t\t\t\tstride = 4;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error( `FeatureTable : Feature type not provided for \"${ key }\".` );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tlet data;\r\n\t\t\tconst arrayStart = binOffset + byteOffset;\r\n\t\t\tconst arrayLength = count * stride;\r\n\r\n\t\t\tswitch ( featureComponentType ) {\r\n\r\n\t\t\t\tcase 'BYTE':\r\n\t\t\t\t\tdata = new Int8Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'UNSIGNED_BYTE':\r\n\t\t\t\t\tdata = new Uint8Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'SHORT':\r\n\t\t\t\t\tdata = new Int16Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'UNSIGNED_SHORT':\r\n\t\t\t\t\tdata = new Uint16Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'INT':\r\n\t\t\t\t\tdata = new Int32Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'UNSIGNED_INT':\r\n\t\t\t\t\tdata = new Uint32Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'FLOAT':\r\n\t\t\t\t\tdata = new Float32Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'DOUBLE':\r\n\t\t\t\t\tdata = new Float64Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error( `FeatureTable : Feature component type not provided for \"${ key }\".` );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst dataEnd = arrayStart + arrayLength * data.BYTES_PER_ELEMENT;\r\n\t\t\tif ( dataEnd > binOffset + binLength ) {\r\n\r\n\t\t\t\tthrow new Error( 'FeatureTable: Feature data read outside binary body length.' );\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\nclass BatchTable extends FeatureTable {\r\n\r\n\tconstructor( buffer, batchSize, start, headerLength, binLength ) {\r\n\r\n\t\tsuper( buffer, start, headerLength, binLength );\r\n\t\tthis.batchSize = batchSize;\r\n\r\n\t}\r\n\r\n\tgetData( key, componentType = null, type = null ) {\r\n\r\n\t\treturn super.getData( key, this.batchSize, type, componentType );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js": -/*!******************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js ***! - \******************************************************************/ -/*! exports provided: LRUCache */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LRUCache\", function() { return LRUCache; });\n// Fires at the end of the frame and before the next one\r\nfunction enqueueMicrotask( callback ) {\r\n\r\n\tPromise.resolve().then( callback );\r\n\r\n}\r\n\r\nclass LRUCache {\r\n\r\n\tconstructor() {\r\n\r\n\t\t// options\r\n\t\tthis.maxSize = 800;\r\n\t\tthis.minSize = 600;\r\n\t\tthis.unloadPercent = 0.05;\r\n\r\n\t\t// \"itemSet\" doubles as both the list of the full set of items currently\r\n\t\t// stored in the cache (keys) as well as a map to the time the item was last\r\n\t\t// used so it can be sorted appropriately.\r\n\t\tthis.itemSet = new Map();\r\n\t\tthis.itemList = [];\r\n\t\tthis.usedSet = new Set();\r\n\t\tthis.callbacks = new Map();\r\n\r\n\t\tthis.unloadPriorityCallback = null;\r\n\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tthis.defaultPriorityCallback = item => itemSet.get( item );\r\n\r\n\t}\r\n\r\n\t// Returns whether or not the cache has reached the maximum size\r\n\tisFull() {\r\n\r\n\t\treturn this.itemSet.size >= this.maxSize;\r\n\r\n\t}\r\n\r\n\tadd( item, removeCb ) {\r\n\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tif ( itemSet.has( item ) ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tif ( this.isFull() ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tconst itemList = this.itemList;\r\n\t\tconst callbacks = this.callbacks;\r\n\t\titemList.push( item );\r\n\t\tusedSet.add( item );\r\n\t\titemSet.set( item, Date.now() );\r\n\t\tcallbacks.set( item, removeCb );\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tremove( item ) {\r\n\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tconst itemList = this.itemList;\r\n\t\tconst callbacks = this.callbacks;\r\n\r\n\t\tif ( itemSet.has( item ) ) {\r\n\r\n\t\t\tcallbacks.get( item )( item );\r\n\r\n\t\t\tconst index = itemList.indexOf( item );\r\n\t\t\titemList.splice( index, 1 );\r\n\t\t\tusedSet.delete( item );\r\n\t\t\titemSet.delete( item );\r\n\t\t\tcallbacks.delete( item );\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\tmarkUsed( item ) {\r\n\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tif ( itemSet.has( item ) && ! usedSet.has( item ) ) {\r\n\r\n\t\t\titemSet.set( item, Date.now() );\r\n\t\t\tusedSet.add( item );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tmarkAllUnused() {\r\n\r\n\t\tthis.usedSet.clear();\r\n\r\n\t}\r\n\r\n\t// TODO: this should be renamed because it's not necessarily unloading all unused content\r\n\t// Maybe call it \"cleanup\" or \"unloadToMinSize\"\r\n\tunloadUnusedContent() {\r\n\r\n\t\tconst unloadPercent = this.unloadPercent;\r\n\t\tconst targetSize = this.minSize;\r\n\t\tconst itemList = this.itemList;\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tconst callbacks = this.callbacks;\r\n\t\tconst unused = itemList.length - usedSet.size;\r\n\t\tconst excess = itemList.length - targetSize;\r\n\t\tconst unloadPriorityCallback = this.unloadPriorityCallback || this.defaultPriorityCallback;\r\n\r\n\t\tif ( excess > 0 && unused > 0 ) {\r\n\r\n\t\t\t// used items should be at the end of the array\r\n\t\t\titemList.sort( ( a, b ) => {\r\n\r\n\t\t\t\tconst usedA = usedSet.has( a );\r\n\t\t\t\tconst usedB = usedSet.has( b );\r\n\t\t\t\tif ( usedA && usedB ) {\r\n\r\n\t\t\t\t\t// If they're both used then don't bother moving them\r\n\t\t\t\t\treturn 0;\r\n\r\n\t\t\t\t} else if ( ! usedA && ! usedB ) {\r\n\r\n\t\t\t\t\t// Use the sort function otherwise\r\n\t\t\t\t\t// higher priority should be further to the left\r\n\t\t\t\t\treturn unloadPriorityCallback( b ) - unloadPriorityCallback( a );\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t// If one is used and the other is not move the used one towards the end of the array\r\n\t\t\t\t\treturn usedA ? 1 : - 1;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t\t// address corner cases where the minSize might be zero or smaller than maxSize - minSize,\r\n\t\t\t// which would result in a very small or no items being unloaded.\r\n\t\t\tconst unusedExcess = Math.min( excess, unused );\r\n\t\t\tconst maxUnload = Math.max( targetSize * unloadPercent, unusedExcess * unloadPercent );\r\n\t\t\tlet nodesToUnload = Math.min( maxUnload, unused );\r\n\t\t\tnodesToUnload = Math.ceil( nodesToUnload );\r\n\r\n\t\t\tconst removedItems = itemList.splice( 0, nodesToUnload );\r\n\t\t\tfor ( let i = 0, l = removedItems.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tconst item = removedItems[ i ];\r\n\t\t\t\tcallbacks.get( item )( item );\r\n\t\t\t\titemSet.delete( item );\r\n\t\t\t\tcallbacks.delete( item );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tscheduleUnload( markAllUnused = true ) {\r\n\r\n\t\tif ( ! this.scheduled ) {\r\n\r\n\t\t\tthis.scheduled = true;\r\n\t\t\tenqueueMicrotask( () => {\r\n\r\n\t\t\t\tthis.scheduled = false;\r\n\t\t\t\tthis.unloadUnusedContent();\r\n\t\t\t\tif ( markAllUnused ) {\r\n\r\n\t\t\t\t\tthis.markAllUnused();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js": -/*!***********************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js ***! - \***********************************************************************/ -/*! exports provided: PriorityQueue */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PriorityQueue\", function() { return PriorityQueue; });\nclass PriorityQueue {\r\n\r\n\tconstructor() {\r\n\r\n\t\t// options\r\n\t\tthis.maxJobs = 6;\r\n\r\n\t\tthis.items = [];\r\n\t\tthis.callbacks = new Map();\r\n\t\tthis.currJobs = 0;\r\n\t\tthis.scheduled = false;\r\n\t\tthis.autoUpdate = true;\r\n\r\n\t\tthis.priorityCallback = () => {\r\n\r\n\t\t\tthrow new Error( 'PriorityQueue: PriorityCallback function not defined.' );\r\n\r\n\t\t};\r\n\r\n\t}\r\n\r\n\tsort() {\r\n\r\n\t\tconst priorityCallback = this.priorityCallback;\r\n\t\tconst items = this.items;\r\n\t\titems.sort( ( a, b ) => {\r\n\r\n\t\t\treturn priorityCallback( a ) - priorityCallback( b );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tadd( item, callback ) {\r\n\r\n\t\treturn new Promise( ( resolve, reject ) => {\r\n\r\n\t\t\tconst prCallback = ( ...args ) => callback( ...args ).then( resolve ).catch( reject );\r\n\t\t\tconst items = this.items;\r\n\t\t\tconst callbacks = this.callbacks;\r\n\r\n\t\t\titems.push( item );\r\n\t\t\tcallbacks.set( item, prCallback );\r\n\r\n\t\t\tif ( this.autoUpdate ) {\r\n\r\n\t\t\t\tthis.scheduleJobRun();\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tremove( item ) {\r\n\r\n\t\tconst items = this.items;\r\n\t\tconst callbacks = this.callbacks;\r\n\r\n\t\tconst index = items.indexOf( item );\r\n\t\tif ( index !== - 1 ) {\r\n\r\n\t\t\titems.splice( index, 1 );\r\n\t\t\tcallbacks.delete( item );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\ttryRunJobs() {\r\n\r\n\t\tthis.sort();\r\n\r\n\t\tconst items = this.items;\r\n\t\tconst callbacks = this.callbacks;\r\n\t\tconst maxJobs = this.maxJobs;\r\n\t\tlet currJobs = this.currJobs;\r\n\t\twhile ( maxJobs > currJobs && items.length > 0 ) {\r\n\r\n\t\t\tcurrJobs ++;\r\n\t\t\tconst item = items.pop();\r\n\t\t\tconst callback = callbacks.get( item );\r\n\t\t\tcallbacks.delete( item );\r\n\t\t\tcallback( item )\r\n\t\t\t\t.then( () => {\r\n\r\n\t\t\t\t\tthis.currJobs --;\r\n\r\n\t\t\t\t\tif ( this.autoUpdate ) {\r\n\r\n\t\t\t\t\t\tthis.scheduleJobRun();\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.catch( () => {\r\n\r\n\t\t\t\t\tthis.currJobs --;\r\n\r\n\t\t\t\t\tif ( this.autoUpdate ) {\r\n\r\n\t\t\t\t\t\tthis.scheduleJobRun();\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t}\r\n\t\tthis.currJobs = currJobs;\r\n\r\n\t}\r\n\r\n\tscheduleJobRun() {\r\n\r\n\t\tif ( ! this.scheduled ) {\r\n\r\n\t\t\trequestAnimationFrame( () => {\r\n\r\n\t\t\t\tthis.tryRunJobs();\r\n\t\t\t\tthis.scheduled = false;\r\n\r\n\t\t\t} );\r\n\t\t\tthis.scheduled = true;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js": -/*!***********************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js ***! - \***********************************************************************/ -/*! exports provided: arrayToString */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayToString\", function() { return arrayToString; });\nfunction arrayToString( array ) {\r\n\r\n\tlet str = '';\r\n\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\r\n\r\n\t\tstr += String.fromCharCode( array[ i ] );\r\n\r\n\t}\r\n\r\n\treturn str;\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js?"); - -/***/ }), - -/***/ "./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js": -/*!*****************************************************************!*\ - !*** ./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js ***! - \*****************************************************************/ -/*! exports provided: urlJoin */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"urlJoin\", function() { return urlJoin; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n\r\n\r\n// Function that properly handles path resolution for parts that have\r\n// a protocol component like \"http://\".\r\nfunction urlJoin( ...args ) {\r\n\r\n\tconst protocolRegex = /^[a-zA-Z]+:\\/\\//;\r\n\tlet lastRoot = - 1;\r\n\tfor ( let i = 0, l = args.length; i < l; i ++ ) {\r\n\r\n\t\tif ( protocolRegex.test( args[ i ] ) ) {\r\n\r\n\t\t\tlastRoot = i;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tif ( lastRoot === - 1 ) {\r\n\r\n\t\treturn path__WEBPACK_IMPORTED_MODULE_0___default.a.join( ...args ).replace( /\\\\/g, '/' );\r\n\r\n\t} else {\r\n\r\n\t\tconst parts = lastRoot <= 0 ? args : args.slice( lastRoot );\r\n\t\tconst protocol = parts[ 0 ].match( protocolRegex )[ 0 ];\r\n\t\tparts[ 0 ] = parts[ 0 ].substring( protocol.length );\r\n\r\n\t\treturn ( protocol + path__WEBPACK_IMPORTED_MODULE_0___default.a.join( ...parts ) ).replace( /\\\\/g, '/' );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/bbox/dist/es/index.js": -/*!**************************************************!*\ - !*** ./node_modules/@turf/bbox/dist/es/index.js ***! - \**************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n\n/**\n * Takes a set of features, calculates the bbox of all input features, and returns a bounding box.\n *\n * @name bbox\n * @param {GeoJSON} geojson any GeoJSON object\n * @returns {BBox} bbox extent in [minX, minY, maxX, maxY] order\n * @example\n * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]);\n * var bbox = turf.bbox(line);\n * var bboxPolygon = turf.bboxPolygon(bbox);\n *\n * //addToMap\n * var addToMap = [line, bboxPolygon]\n */\nfunction bbox(geojson) {\n var result = [Infinity, Infinity, -Infinity, -Infinity];\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_0__[\"coordEach\"])(geojson, function (coord) {\n if (result[0] > coord[0]) {\n result[0] = coord[0];\n }\n if (result[1] > coord[1]) {\n result[1] = coord[1];\n }\n if (result[2] < coord[0]) {\n result[2] = coord[0];\n }\n if (result[3] < coord[1]) {\n result[3] = coord[1];\n }\n });\n return result;\n}\nbbox[\"default\"] = bbox;\n/* harmony default export */ __webpack_exports__[\"default\"] = (bbox);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/bbox/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/boolean-disjoint/dist/es/index.js": -/*!**************************************************************!*\ - !*** ./node_modules/@turf/boolean-disjoint/dist/es/index.js ***! - \**************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/boolean-point-in-polygon */ \"./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js\");\n/* harmony import */ var _turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/line-intersect */ \"./node_modules/@turf/line-intersect/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n/* harmony import */ var _turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @turf/polygon-to-line */ \"./node_modules/@turf/polygon-to-line/dist/es/index.js\");\n\n\n\n\n/**\n * Boolean-disjoint returns (TRUE) if the intersection of the two geometries is an empty set.\n *\n * @name booleanDisjoint\n * @param {Geometry|Feature} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var point = turf.point([2, 2]);\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n *\n * turf.booleanDisjoint(line, point);\n * //=true\n */\nfunction booleanDisjoint(feature1, feature2) {\n var bool = true;\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_2__[\"flattenEach\"])(feature1, function (flatten1) {\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_2__[\"flattenEach\"])(feature2, function (flatten2) {\n if (bool === false) {\n return false;\n }\n bool = disjoint(flatten1.geometry, flatten2.geometry);\n });\n });\n return bool;\n}\n/**\n * Disjoint operation for simple Geometries (Point/LineString/Polygon)\n *\n * @private\n * @param {Geometry} geom1 GeoJSON Geometry\n * @param {Geometry} geom2 GeoJSON Geometry\n * @returns {boolean} true/false\n */\nfunction disjoint(geom1, geom2) {\n switch (geom1.type) {\n case \"Point\":\n switch (geom2.type) {\n case \"Point\":\n return !compareCoords(geom1.coordinates, geom2.coordinates);\n case \"LineString\":\n return !isPointOnLine(geom2, geom1);\n case \"Polygon\":\n return !Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(geom1, geom2);\n }\n /* istanbul ignore next */\n break;\n case \"LineString\":\n switch (geom2.type) {\n case \"Point\":\n return !isPointOnLine(geom1, geom2);\n case \"LineString\":\n return !isLineOnLine(geom1, geom2);\n case \"Polygon\":\n return !isLineInPoly(geom2, geom1);\n }\n /* istanbul ignore next */\n break;\n case \"Polygon\":\n switch (geom2.type) {\n case \"Point\":\n return !Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(geom2, geom1);\n case \"LineString\":\n return !isLineInPoly(geom1, geom2);\n case \"Polygon\":\n return !isPolyInPoly(geom2, geom1);\n }\n }\n return false;\n}\n// http://stackoverflow.com/a/11908158/1979085\nfunction isPointOnLine(lineString, pt) {\n for (var i = 0; i < lineString.coordinates.length - 1; i++) {\n if (isPointOnLineSegment(lineString.coordinates[i], lineString.coordinates[i + 1], pt.coordinates)) {\n return true;\n }\n }\n return false;\n}\nfunction isLineOnLine(lineString1, lineString2) {\n var doLinesIntersect = Object(_turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lineString1, lineString2);\n if (doLinesIntersect.features.length > 0) {\n return true;\n }\n return false;\n}\nfunction isLineInPoly(polygon, lineString) {\n for (var _i = 0, _a = lineString.coordinates; _i < _a.length; _i++) {\n var coord = _a[_i];\n if (Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(coord, polygon)) {\n return true;\n }\n }\n var doLinesIntersect = Object(_turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lineString, Object(_turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(polygon));\n if (doLinesIntersect.features.length > 0) {\n return true;\n }\n return false;\n}\n/**\n * Is Polygon (geom1) in Polygon (geom2)\n * Only takes into account outer rings\n * See http://stackoverflow.com/a/4833823/1979085\n *\n * @private\n * @param {Geometry|Feature} feature1 Polygon1\n * @param {Geometry|Feature} feature2 Polygon2\n * @returns {boolean} true/false\n */\nfunction isPolyInPoly(feature1, feature2) {\n for (var _i = 0, _a = feature1.coordinates[0]; _i < _a.length; _i++) {\n var coord1 = _a[_i];\n if (Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(coord1, feature2)) {\n return true;\n }\n }\n for (var _b = 0, _c = feature2.coordinates[0]; _b < _c.length; _b++) {\n var coord2 = _c[_b];\n if (Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(coord2, feature1)) {\n return true;\n }\n }\n var doLinesIntersect = Object(_turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Object(_turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(feature1), Object(_turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(feature2));\n if (doLinesIntersect.features.length > 0) {\n return true;\n }\n return false;\n}\nfunction isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt) {\n var dxc = pt[0] - lineSegmentStart[0];\n var dyc = pt[1] - lineSegmentStart[1];\n var dxl = lineSegmentEnd[0] - lineSegmentStart[0];\n var dyl = lineSegmentEnd[1] - lineSegmentStart[1];\n var cross = dxc * dyl - dyc * dxl;\n if (cross !== 0) {\n return false;\n }\n if (Math.abs(dxl) >= Math.abs(dyl)) {\n if (dxl > 0) {\n return lineSegmentStart[0] <= pt[0] && pt[0] <= lineSegmentEnd[0];\n }\n else {\n return lineSegmentEnd[0] <= pt[0] && pt[0] <= lineSegmentStart[0];\n }\n }\n else if (dyl > 0) {\n return lineSegmentStart[1] <= pt[1] && pt[1] <= lineSegmentEnd[1];\n }\n else {\n return lineSegmentEnd[1] <= pt[1] && pt[1] <= lineSegmentStart[1];\n }\n}\n/**\n * compareCoords\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {boolean} true/false if coord pairs match\n */\nfunction compareCoords(pair1, pair2) {\n return pair1[0] === pair2[0] && pair1[1] === pair2[1];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (booleanDisjoint);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/boolean-disjoint/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/boolean-intersects/dist/es/index.js": -/*!****************************************************************!*\ - !*** ./node_modules/@turf/boolean-intersects/dist/es/index.js ***! - \****************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return booleanIntersects; });\n/* harmony import */ var _turf_boolean_disjoint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/boolean-disjoint */ \"./node_modules/@turf/boolean-disjoint/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n\n\n/**\n * Boolean-intersects returns (TRUE) two geometries intersect.\n *\n * @name booleanIntersects\n * @param {Geometry|Feature} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var point = turf.point([2, 2]);\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n *\n * turf.booleanIntersects(line, point);\n * //=true\n */\nfunction booleanIntersects(feature1, feature2) {\n var bool = false;\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_1__[\"flattenEach\"])(feature1, function (flatten1) {\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_1__[\"flattenEach\"])(feature2, function (flatten2) {\n if (bool === true) {\n return true;\n }\n bool = !Object(_turf_boolean_disjoint__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(flatten1.geometry, flatten2.geometry);\n });\n });\n return bool;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/boolean-intersects/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js ***! - \**********************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return booleanPointInPolygon; });\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n\n// http://en.wikipedia.org/wiki/Even%E2%80%93odd_rule\n// modified from: https://github.com/substack/point-in-polygon/blob/master/index.js\n// which was modified from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html\n/**\n * Takes a {@link Point} and a {@link Polygon} or {@link MultiPolygon} and determines if the point\n * resides inside the polygon. The polygon can be convex or concave. The function accounts for holes.\n *\n * @name booleanPointInPolygon\n * @param {Coord} point input point\n * @param {Feature} polygon input polygon or multipolygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.ignoreBoundary=false] True if polygon boundary should be ignored when determining if\n * the point is inside the polygon otherwise false.\n * @returns {boolean} `true` if the Point is inside the Polygon; `false` if the Point is not inside the Polygon\n * @example\n * var pt = turf.point([-77, 44]);\n * var poly = turf.polygon([[\n * [-81, 41],\n * [-81, 47],\n * [-72, 47],\n * [-72, 41],\n * [-81, 41]\n * ]]);\n *\n * turf.booleanPointInPolygon(pt, poly);\n * //= true\n */\nfunction booleanPointInPolygon(point, polygon, options) {\n if (options === void 0) { options = {}; }\n // validation\n if (!point) {\n throw new Error(\"point is required\");\n }\n if (!polygon) {\n throw new Error(\"polygon is required\");\n }\n var pt = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_0__[\"getCoord\"])(point);\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_0__[\"getGeom\"])(polygon);\n var type = geom.type;\n var bbox = polygon.bbox;\n var polys = geom.coordinates;\n // Quick elimination if point is not inside bbox\n if (bbox && inBBox(pt, bbox) === false) {\n return false;\n }\n // normalize to multipolygon\n if (type === \"Polygon\") {\n polys = [polys];\n }\n var insidePoly = false;\n for (var i = 0; i < polys.length && !insidePoly; i++) {\n // check if it is in the outer ring first\n if (inRing(pt, polys[i][0], options.ignoreBoundary)) {\n var inHole = false;\n var k = 1;\n // check for the point in any of the holes\n while (k < polys[i].length && !inHole) {\n if (inRing(pt, polys[i][k], !options.ignoreBoundary)) {\n inHole = true;\n }\n k++;\n }\n if (!inHole) {\n insidePoly = true;\n }\n }\n }\n return insidePoly;\n}\n/**\n * inRing\n *\n * @private\n * @param {Array} pt [x,y]\n * @param {Array>} ring [[x,y], [x,y],..]\n * @param {boolean} ignoreBoundary ignoreBoundary\n * @returns {boolean} inRing\n */\nfunction inRing(pt, ring, ignoreBoundary) {\n var isInside = false;\n if (ring[0][0] === ring[ring.length - 1][0] &&\n ring[0][1] === ring[ring.length - 1][1]) {\n ring = ring.slice(0, ring.length - 1);\n }\n for (var i = 0, j = ring.length - 1; i < ring.length; j = i++) {\n var xi = ring[i][0];\n var yi = ring[i][1];\n var xj = ring[j][0];\n var yj = ring[j][1];\n var onBoundary = pt[1] * (xi - xj) + yi * (xj - pt[0]) + yj * (pt[0] - xi) === 0 &&\n (xi - pt[0]) * (xj - pt[0]) <= 0 &&\n (yi - pt[1]) * (yj - pt[1]) <= 0;\n if (onBoundary) {\n return !ignoreBoundary;\n }\n var intersect = yi > pt[1] !== yj > pt[1] &&\n pt[0] < ((xj - xi) * (pt[1] - yi)) / (yj - yi) + xi;\n if (intersect) {\n isInside = !isInside;\n }\n }\n return isInside;\n}\n/**\n * inBBox\n *\n * @private\n * @param {Position} pt point [x,y]\n * @param {BBox} bbox BBox [west, south, east, north]\n * @returns {boolean} true/false if point is inside BBox\n */\nfunction inBBox(pt, bbox) {\n return (bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1]);\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/circle/dist/es/index.js": -/*!****************************************************!*\ - !*** ./node_modules/@turf/circle/dist/es/index.js ***! - \****************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_destination__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/destination */ \"./node_modules/@turf/destination/dist/es/index.js\");\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n\n\n/**\n * Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.\n *\n * @name circle\n * @param {Feature|number[]} center center point\n * @param {number} radius radius of the circle\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.steps=64] number of steps\n * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians\n * @param {Object} [options.properties={}] properties\n * @returns {Feature} circle polygon\n * @example\n * var center = [-75.343, 39.984];\n * var radius = 5;\n * var options = {steps: 10, units: 'kilometers', properties: {foo: 'bar'}};\n * var circle = turf.circle(center, radius, options);\n *\n * //addToMap\n * var addToMap = [turf.point(center), circle]\n */\nfunction circle(center, radius, options) {\n if (options === void 0) { options = {}; }\n // default params\n var steps = options.steps || 64;\n var properties = options.properties\n ? options.properties\n : !Array.isArray(center) && center.type === \"Feature\" && center.properties\n ? center.properties\n : {};\n // main\n var coordinates = [];\n for (var i = 0; i < steps; i++) {\n coordinates.push(Object(_turf_destination__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(center, radius, (i * -360) / steps, options).geometry\n .coordinates);\n }\n coordinates.push(coordinates[0]);\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_1__[\"polygon\"])([coordinates], properties);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (circle);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/circle/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/destination/dist/es/index.js": -/*!*********************************************************!*\ - !*** ./node_modules/@turf/destination/dist/es/index.js ***! - \*********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return destination; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n// http://en.wikipedia.org/wiki/Haversine_formula\n// http://www.movable-type.co.uk/scripts/latlong.html\n\n\n/**\n * Takes a {@link Point} and calculates the location of a destination point given a distance in\n * degrees, radians, miles, or kilometers; and bearing in degrees.\n * This uses the [Haversine formula](http://en.wikipedia.org/wiki/Haversine_formula) to account for global curvature.\n *\n * @name destination\n * @param {Coord} origin starting point\n * @param {number} distance distance from the origin point\n * @param {number} bearing ranging from -180 to 180\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians\n * @param {Object} [options.properties={}] Translate properties to Point\n * @returns {Feature} destination point\n * @example\n * var point = turf.point([-75.343, 39.984]);\n * var distance = 50;\n * var bearing = 90;\n * var options = {units: 'miles'};\n *\n * var destination = turf.destination(point, distance, bearing, options);\n *\n * //addToMap\n * var addToMap = [point, destination]\n * destination.properties['marker-color'] = '#f00';\n * point.properties['marker-color'] = '#0f0';\n */\nfunction destination(origin, distance, bearing, options) {\n if (options === void 0) { options = {}; }\n // Handle input\n var coordinates1 = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoord\"])(origin);\n var longitude1 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"degreesToRadians\"])(coordinates1[0]);\n var latitude1 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"degreesToRadians\"])(coordinates1[1]);\n var bearingRad = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"degreesToRadians\"])(bearing);\n var radians = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lengthToRadians\"])(distance, options.units);\n // Main\n var latitude2 = Math.asin(Math.sin(latitude1) * Math.cos(radians) +\n Math.cos(latitude1) * Math.sin(radians) * Math.cos(bearingRad));\n var longitude2 = longitude1 +\n Math.atan2(Math.sin(bearingRad) * Math.sin(radians) * Math.cos(latitude1), Math.cos(radians) - Math.sin(latitude1) * Math.sin(latitude2));\n var lng = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"radiansToDegrees\"])(longitude2);\n var lat = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"radiansToDegrees\"])(latitude2);\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])([lng, lat], options.properties);\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/destination/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/helpers/dist/es/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/@turf/helpers/dist/es/index.js ***! - \*****************************************************/ -/*! exports provided: earthRadius, factors, unitsFactors, areaFactors, feature, geometry, point, points, polygon, polygons, lineString, lineStrings, featureCollection, multiLineString, multiPoint, multiPolygon, geometryCollection, round, radiansToLength, lengthToRadians, lengthToDegrees, bearingToAzimuth, radiansToDegrees, degreesToRadians, convertLength, convertArea, isNumber, isObject, validateBBox, validateId */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"earthRadius\", function() { return earthRadius; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"factors\", function() { return factors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"unitsFactors\", function() { return unitsFactors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"areaFactors\", function() { return areaFactors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"feature\", function() { return feature; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geometry\", function() { return geometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"point\", function() { return point; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"points\", function() { return points; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polygon\", function() { return polygon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polygons\", function() { return polygons; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineString\", function() { return lineString; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineStrings\", function() { return lineStrings; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureCollection\", function() { return featureCollection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiLineString\", function() { return multiLineString; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiPoint\", function() { return multiPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiPolygon\", function() { return multiPolygon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geometryCollection\", function() { return geometryCollection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"radiansToLength\", function() { return radiansToLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lengthToRadians\", function() { return lengthToRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lengthToDegrees\", function() { return lengthToDegrees; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bearingToAzimuth\", function() { return bearingToAzimuth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"radiansToDegrees\", function() { return radiansToDegrees; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"degreesToRadians\", function() { return degreesToRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"convertLength\", function() { return convertLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"convertArea\", function() { return convertArea; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return isNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObject\", function() { return isObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"validateBBox\", function() { return validateBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"validateId\", function() { return validateId; });\n/**\n * @module helpers\n */\n/**\n * Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.\n *\n * @memberof helpers\n * @type {number}\n */\nvar earthRadius = 6371008.8;\n/**\n * Unit of measurement factors using a spherical (non-ellipsoid) earth radius.\n *\n * @memberof helpers\n * @type {Object}\n */\nvar factors = {\n centimeters: earthRadius * 100,\n centimetres: earthRadius * 100,\n degrees: earthRadius / 111325,\n feet: earthRadius * 3.28084,\n inches: earthRadius * 39.37,\n kilometers: earthRadius / 1000,\n kilometres: earthRadius / 1000,\n meters: earthRadius,\n metres: earthRadius,\n miles: earthRadius / 1609.344,\n millimeters: earthRadius * 1000,\n millimetres: earthRadius * 1000,\n nauticalmiles: earthRadius / 1852,\n radians: 1,\n yards: earthRadius / 1.0936,\n};\n/**\n * Units of measurement factors based on 1 meter.\n *\n * @memberof helpers\n * @type {Object}\n */\nvar unitsFactors = {\n centimeters: 100,\n centimetres: 100,\n degrees: 1 / 111325,\n feet: 3.28084,\n inches: 39.37,\n kilometers: 1 / 1000,\n kilometres: 1 / 1000,\n meters: 1,\n metres: 1,\n miles: 1 / 1609.344,\n millimeters: 1000,\n millimetres: 1000,\n nauticalmiles: 1 / 1852,\n radians: 1 / earthRadius,\n yards: 1 / 1.0936,\n};\n/**\n * Area of measurement factors based on 1 square meter.\n *\n * @memberof helpers\n * @type {Object}\n */\nvar areaFactors = {\n acres: 0.000247105,\n centimeters: 10000,\n centimetres: 10000,\n feet: 10.763910417,\n hectares: 0.0001,\n inches: 1550.003100006,\n kilometers: 0.000001,\n kilometres: 0.000001,\n meters: 1,\n metres: 1,\n miles: 3.86e-7,\n millimeters: 1000000,\n millimetres: 1000000,\n yards: 1.195990046,\n};\n/**\n * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.\n *\n * @name feature\n * @param {Geometry} geometry input geometry\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a GeoJSON Feature\n * @example\n * var geometry = {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 50]\n * };\n *\n * var feature = turf.feature(geometry);\n *\n * //=feature\n */\nfunction feature(geom, properties, options) {\n if (options === void 0) { options = {}; }\n var feat = { type: \"Feature\" };\n if (options.id === 0 || options.id) {\n feat.id = options.id;\n }\n if (options.bbox) {\n feat.bbox = options.bbox;\n }\n feat.properties = properties || {};\n feat.geometry = geom;\n return feat;\n}\n/**\n * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates.\n * For GeometryCollection type use `helpers.geometryCollection`\n *\n * @name geometry\n * @param {string} type Geometry Type\n * @param {Array} coordinates Coordinates\n * @param {Object} [options={}] Optional Parameters\n * @returns {Geometry} a GeoJSON Geometry\n * @example\n * var type = \"Point\";\n * var coordinates = [110, 50];\n * var geometry = turf.geometry(type, coordinates);\n * // => geometry\n */\nfunction geometry(type, coordinates, _options) {\n if (_options === void 0) { _options = {}; }\n switch (type) {\n case \"Point\":\n return point(coordinates).geometry;\n case \"LineString\":\n return lineString(coordinates).geometry;\n case \"Polygon\":\n return polygon(coordinates).geometry;\n case \"MultiPoint\":\n return multiPoint(coordinates).geometry;\n case \"MultiLineString\":\n return multiLineString(coordinates).geometry;\n case \"MultiPolygon\":\n return multiPolygon(coordinates).geometry;\n default:\n throw new Error(type + \" is invalid\");\n }\n}\n/**\n * Creates a {@link Point} {@link Feature} from a Position.\n *\n * @name point\n * @param {Array} coordinates longitude, latitude position (each in decimal degrees)\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a Point feature\n * @example\n * var point = turf.point([-75.343, 39.984]);\n *\n * //=point\n */\nfunction point(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n if (!coordinates) {\n throw new Error(\"coordinates is required\");\n }\n if (!Array.isArray(coordinates)) {\n throw new Error(\"coordinates must be an Array\");\n }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be at least 2 numbers long\");\n }\n if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {\n throw new Error(\"coordinates must contain numbers\");\n }\n var geom = {\n type: \"Point\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates.\n *\n * @name points\n * @param {Array>} coordinates an array of Points\n * @param {Object} [properties={}] Translate these properties to each Feature\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north]\n * associated with the FeatureCollection\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection} Point Feature\n * @example\n * var points = turf.points([\n * [-75, 39],\n * [-80, 45],\n * [-78, 50]\n * ]);\n *\n * //=points\n */\nfunction points(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return point(coords, properties);\n }), options);\n}\n/**\n * Creates a {@link Polygon} {@link Feature} from an Array of LinearRings.\n *\n * @name polygon\n * @param {Array>>} coordinates an array of LinearRings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} Polygon Feature\n * @example\n * var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' });\n *\n * //=polygon\n */\nfunction polygon(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n for (var _i = 0, coordinates_1 = coordinates; _i < coordinates_1.length; _i++) {\n var ring = coordinates_1[_i];\n if (ring.length < 4) {\n throw new Error(\"Each LinearRing of a Polygon must have 4 or more Positions.\");\n }\n for (var j = 0; j < ring[ring.length - 1].length; j++) {\n // Check if first point of Polygon contains two numbers\n if (ring[ring.length - 1][j] !== ring[0][j]) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n }\n }\n var geom = {\n type: \"Polygon\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Polygon} {@link FeatureCollection} from an Array of Polygon coordinates.\n *\n * @name polygons\n * @param {Array>>>} coordinates an array of Polygon coordinates\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection} Polygon FeatureCollection\n * @example\n * var polygons = turf.polygons([\n * [[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]],\n * [[[-15, 42], [-14, 46], [-12, 41], [-17, 44], [-15, 42]]],\n * ]);\n *\n * //=polygons\n */\nfunction polygons(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return polygon(coords, properties);\n }), options);\n}\n/**\n * Creates a {@link LineString} {@link Feature} from an Array of Positions.\n *\n * @name lineString\n * @param {Array>} coordinates an array of Positions\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} LineString Feature\n * @example\n * var linestring1 = turf.lineString([[-24, 63], [-23, 60], [-25, 65], [-20, 69]], {name: 'line 1'});\n * var linestring2 = turf.lineString([[-14, 43], [-13, 40], [-15, 45], [-10, 49]], {name: 'line 2'});\n *\n * //=linestring1\n * //=linestring2\n */\nfunction lineString(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be an array of two or more positions\");\n }\n var geom = {\n type: \"LineString\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link LineString} {@link FeatureCollection} from an Array of LineString coordinates.\n *\n * @name lineStrings\n * @param {Array>>} coordinates an array of LinearRings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north]\n * associated with the FeatureCollection\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection} LineString FeatureCollection\n * @example\n * var linestrings = turf.lineStrings([\n * [[-24, 63], [-23, 60], [-25, 65], [-20, 69]],\n * [[-14, 43], [-13, 40], [-15, 45], [-10, 49]]\n * ]);\n *\n * //=linestrings\n */\nfunction lineStrings(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return lineString(coords, properties);\n }), options);\n}\n/**\n * Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}.\n *\n * @name featureCollection\n * @param {Feature[]} features input features\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {FeatureCollection} FeatureCollection of Features\n * @example\n * var locationA = turf.point([-75.343, 39.984], {name: 'Location A'});\n * var locationB = turf.point([-75.833, 39.284], {name: 'Location B'});\n * var locationC = turf.point([-75.534, 39.123], {name: 'Location C'});\n *\n * var collection = turf.featureCollection([\n * locationA,\n * locationB,\n * locationC\n * ]);\n *\n * //=collection\n */\nfunction featureCollection(features, options) {\n if (options === void 0) { options = {}; }\n var fc = { type: \"FeatureCollection\" };\n if (options.id) {\n fc.id = options.id;\n }\n if (options.bbox) {\n fc.bbox = options.bbox;\n }\n fc.features = features;\n return fc;\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiLineString\n * @param {Array>>} coordinates an array of LineStrings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a MultiLineString feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiLine = turf.multiLineString([[[0,0],[10,10]]]);\n *\n * //=multiLine\n */\nfunction multiLineString(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiLineString\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiPoint\n * @param {Array>} coordinates an array of Positions\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a MultiPoint feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiPt = turf.multiPoint([[0,0],[10,10]]);\n *\n * //=multiPt\n */\nfunction multiPoint(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiPoint\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiPolygon\n * @param {Array>>>} coordinates an array of Polygons\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a multipolygon feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]);\n *\n * //=multiPoly\n *\n */\nfunction multiPolygon(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiPolygon\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name geometryCollection\n * @param {Array} geometries an array of GeoJSON Geometries\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a GeoJSON GeometryCollection Feature\n * @example\n * var pt = turf.geometry(\"Point\", [100, 0]);\n * var line = turf.geometry(\"LineString\", [[101, 0], [102, 1]]);\n * var collection = turf.geometryCollection([pt, line]);\n *\n * // => collection\n */\nfunction geometryCollection(geometries, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"GeometryCollection\",\n geometries: geometries,\n };\n return feature(geom, properties, options);\n}\n/**\n * Round number to precision\n *\n * @param {number} num Number\n * @param {number} [precision=0] Precision\n * @returns {number} rounded number\n * @example\n * turf.round(120.4321)\n * //=120\n *\n * turf.round(120.4321, 2)\n * //=120.43\n */\nfunction round(num, precision) {\n if (precision === void 0) { precision = 0; }\n if (precision && !(precision >= 0)) {\n throw new Error(\"precision must be a positive number\");\n }\n var multiplier = Math.pow(10, precision || 0);\n return Math.round(num * multiplier) / multiplier;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name radiansToLength\n * @param {number} radians in radians across the sphere\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} distance\n */\nfunction radiansToLength(radians, units) {\n if (units === void 0) { units = \"kilometers\"; }\n var factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return radians * factor;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name lengthToRadians\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} radians\n */\nfunction lengthToRadians(distance, units) {\n if (units === void 0) { units = \"kilometers\"; }\n var factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return distance / factor;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet\n *\n * @name lengthToDegrees\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} degrees\n */\nfunction lengthToDegrees(distance, units) {\n return radiansToDegrees(lengthToRadians(distance, units));\n}\n/**\n * Converts any bearing angle from the north line direction (positive clockwise)\n * and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line\n *\n * @name bearingToAzimuth\n * @param {number} bearing angle, between -180 and +180 degrees\n * @returns {number} angle between 0 and 360 degrees\n */\nfunction bearingToAzimuth(bearing) {\n var angle = bearing % 360;\n if (angle < 0) {\n angle += 360;\n }\n return angle;\n}\n/**\n * Converts an angle in radians to degrees\n *\n * @name radiansToDegrees\n * @param {number} radians angle in radians\n * @returns {number} degrees between 0 and 360 degrees\n */\nfunction radiansToDegrees(radians) {\n var degrees = radians % (2 * Math.PI);\n return (degrees * 180) / Math.PI;\n}\n/**\n * Converts an angle in degrees to radians\n *\n * @name degreesToRadians\n * @param {number} degrees angle between 0 and 360 degrees\n * @returns {number} angle in radians\n */\nfunction degreesToRadians(degrees) {\n var radians = degrees % 360;\n return (radians * Math.PI) / 180;\n}\n/**\n * Converts a length to the requested unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @param {number} length to be converted\n * @param {Units} [originalUnit=\"kilometers\"] of the length\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted length\n */\nfunction convertLength(length, originalUnit, finalUnit) {\n if (originalUnit === void 0) { originalUnit = \"kilometers\"; }\n if (finalUnit === void 0) { finalUnit = \"kilometers\"; }\n if (!(length >= 0)) {\n throw new Error(\"length must be a positive number\");\n }\n return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);\n}\n/**\n * Converts a area to the requested unit.\n * Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches, hectares\n * @param {number} area to be converted\n * @param {Units} [originalUnit=\"meters\"] of the distance\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted area\n */\nfunction convertArea(area, originalUnit, finalUnit) {\n if (originalUnit === void 0) { originalUnit = \"meters\"; }\n if (finalUnit === void 0) { finalUnit = \"kilometers\"; }\n if (!(area >= 0)) {\n throw new Error(\"area must be a positive number\");\n }\n var startFactor = areaFactors[originalUnit];\n if (!startFactor) {\n throw new Error(\"invalid original units\");\n }\n var finalFactor = areaFactors[finalUnit];\n if (!finalFactor) {\n throw new Error(\"invalid final units\");\n }\n return (area / startFactor) * finalFactor;\n}\n/**\n * isNumber\n *\n * @param {*} num Number to validate\n * @returns {boolean} true/false\n * @example\n * turf.isNumber(123)\n * //=true\n * turf.isNumber('foo')\n * //=false\n */\nfunction isNumber(num) {\n return !isNaN(num) && num !== null && !Array.isArray(num);\n}\n/**\n * isObject\n *\n * @param {*} input variable to validate\n * @returns {boolean} true/false\n * @example\n * turf.isObject({elevation: 10})\n * //=true\n * turf.isObject('foo')\n * //=false\n */\nfunction isObject(input) {\n return !!input && input.constructor === Object;\n}\n/**\n * Validate BBox\n *\n * @private\n * @param {Array} bbox BBox to validate\n * @returns {void}\n * @throws Error if BBox is not valid\n * @example\n * validateBBox([-180, -40, 110, 50])\n * //=OK\n * validateBBox([-180, -40])\n * //=Error\n * validateBBox('Foo')\n * //=Error\n * validateBBox(5)\n * //=Error\n * validateBBox(null)\n * //=Error\n * validateBBox(undefined)\n * //=Error\n */\nfunction validateBBox(bbox) {\n if (!bbox) {\n throw new Error(\"bbox is required\");\n }\n if (!Array.isArray(bbox)) {\n throw new Error(\"bbox must be an Array\");\n }\n if (bbox.length !== 4 && bbox.length !== 6) {\n throw new Error(\"bbox must be an Array of 4 or 6 numbers\");\n }\n bbox.forEach(function (num) {\n if (!isNumber(num)) {\n throw new Error(\"bbox must only contain numbers\");\n }\n });\n}\n/**\n * Validate Id\n *\n * @private\n * @param {string|number} id Id to validate\n * @returns {void}\n * @throws Error if Id is not valid\n * @example\n * validateId([-180, -40, 110, 50])\n * //=Error\n * validateId([-180, -40])\n * //=Error\n * validateId('Foo')\n * //=OK\n * validateId(5)\n * //=OK\n * validateId(null)\n * //=Error\n * validateId(undefined)\n * //=Error\n */\nfunction validateId(id) {\n if (!id) {\n throw new Error(\"id is required\");\n }\n if ([\"string\", \"number\"].indexOf(typeof id) === -1) {\n throw new Error(\"id must be a number or a string\");\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/helpers/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/invariant/dist/es/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/@turf/invariant/dist/es/index.js ***! - \*******************************************************/ -/*! exports provided: getCoord, getCoords, containsNumber, geojsonType, featureOf, collectionOf, getGeom, getType */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCoord\", function() { return getCoord; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCoords\", function() { return getCoords; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containsNumber\", function() { return containsNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geojsonType\", function() { return geojsonType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureOf\", function() { return featureOf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"collectionOf\", function() { return collectionOf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getGeom\", function() { return getGeom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getType\", function() { return getType; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n\n/**\n * Unwrap a coordinate from a Point Feature, Geometry or a single coordinate.\n *\n * @name getCoord\n * @param {Array|Geometry|Feature} coord GeoJSON Point or an Array of numbers\n * @returns {Array} coordinates\n * @example\n * var pt = turf.point([10, 10]);\n *\n * var coord = turf.getCoord(pt);\n * //= [10, 10]\n */\nfunction getCoord(coord) {\n if (!coord) {\n throw new Error(\"coord is required\");\n }\n if (!Array.isArray(coord)) {\n if (coord.type === \"Feature\" &&\n coord.geometry !== null &&\n coord.geometry.type === \"Point\") {\n return coord.geometry.coordinates;\n }\n if (coord.type === \"Point\") {\n return coord.coordinates;\n }\n }\n if (Array.isArray(coord) &&\n coord.length >= 2 &&\n !Array.isArray(coord[0]) &&\n !Array.isArray(coord[1])) {\n return coord;\n }\n throw new Error(\"coord must be GeoJSON Point or an Array of numbers\");\n}\n/**\n * Unwrap coordinates from a Feature, Geometry Object or an Array\n *\n * @name getCoords\n * @param {Array|Geometry|Feature} coords Feature, Geometry Object or an Array\n * @returns {Array} coordinates\n * @example\n * var poly = turf.polygon([[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]);\n *\n * var coords = turf.getCoords(poly);\n * //= [[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]\n */\nfunction getCoords(coords) {\n if (Array.isArray(coords)) {\n return coords;\n }\n // Feature\n if (coords.type === \"Feature\") {\n if (coords.geometry !== null) {\n return coords.geometry.coordinates;\n }\n }\n else {\n // Geometry\n if (coords.coordinates) {\n return coords.coordinates;\n }\n }\n throw new Error(\"coords must be GeoJSON Feature, Geometry Object or an Array\");\n}\n/**\n * Checks if coordinates contains a number\n *\n * @name containsNumber\n * @param {Array} coordinates GeoJSON Coordinates\n * @returns {boolean} true if Array contains a number\n */\nfunction containsNumber(coordinates) {\n if (coordinates.length > 1 &&\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(coordinates[0]) &&\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(coordinates[1])) {\n return true;\n }\n if (Array.isArray(coordinates[0]) && coordinates[0].length) {\n return containsNumber(coordinates[0]);\n }\n throw new Error(\"coordinates must only contain numbers\");\n}\n/**\n * Enforce expectations about types of GeoJSON objects for Turf.\n *\n * @name geojsonType\n * @param {GeoJSON} value any GeoJSON object\n * @param {string} type expected GeoJSON type\n * @param {string} name name of calling function\n * @throws {Error} if value is not the expected type.\n */\nfunction geojsonType(value, type, name) {\n if (!type || !name) {\n throw new Error(\"type and name required\");\n }\n if (!value || value.type !== type) {\n throw new Error(\"Invalid input to \" +\n name +\n \": must be a \" +\n type +\n \", given \" +\n value.type);\n }\n}\n/**\n * Enforce expectations about types of {@link Feature} inputs for Turf.\n * Internally this uses {@link geojsonType} to judge geometry types.\n *\n * @name featureOf\n * @param {Feature} feature a feature with an expected geometry type\n * @param {string} type expected GeoJSON type\n * @param {string} name name of calling function\n * @throws {Error} error if value is not the expected type.\n */\nfunction featureOf(feature, type, name) {\n if (!feature) {\n throw new Error(\"No feature passed\");\n }\n if (!name) {\n throw new Error(\".featureOf() requires a name\");\n }\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\"Invalid input to \" + name + \", Feature with geometry required\");\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\"Invalid input to \" +\n name +\n \": must be a \" +\n type +\n \", given \" +\n feature.geometry.type);\n }\n}\n/**\n * Enforce expectations about types of {@link FeatureCollection} inputs for Turf.\n * Internally this uses {@link geojsonType} to judge geometry types.\n *\n * @name collectionOf\n * @param {FeatureCollection} featureCollection a FeatureCollection for which features will be judged\n * @param {string} type expected GeoJSON type\n * @param {string} name name of calling function\n * @throws {Error} if value is not the expected type.\n */\nfunction collectionOf(featureCollection, type, name) {\n if (!featureCollection) {\n throw new Error(\"No featureCollection passed\");\n }\n if (!name) {\n throw new Error(\".collectionOf() requires a name\");\n }\n if (!featureCollection || featureCollection.type !== \"FeatureCollection\") {\n throw new Error(\"Invalid input to \" + name + \", FeatureCollection required\");\n }\n for (var _i = 0, _a = featureCollection.features; _i < _a.length; _i++) {\n var feature = _a[_i];\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\"Invalid input to \" + name + \", Feature with geometry required\");\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\"Invalid input to \" +\n name +\n \": must be a \" +\n type +\n \", given \" +\n feature.geometry.type);\n }\n }\n}\n/**\n * Get Geometry from Feature or Geometry Object\n *\n * @param {Feature|Geometry} geojson GeoJSON Feature or Geometry Object\n * @returns {Geometry|null} GeoJSON Geometry Object\n * @throws {Error} if geojson is not a Feature or Geometry Object\n * @example\n * var point = {\n * \"type\": \"Feature\",\n * \"properties\": {},\n * \"geometry\": {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 40]\n * }\n * }\n * var geom = turf.getGeom(point)\n * //={\"type\": \"Point\", \"coordinates\": [110, 40]}\n */\nfunction getGeom(geojson) {\n if (geojson.type === \"Feature\") {\n return geojson.geometry;\n }\n return geojson;\n}\n/**\n * Get GeoJSON object's type, Geometry type is prioritize.\n *\n * @param {GeoJSON} geojson GeoJSON object\n * @param {string} [name=\"geojson\"] name of the variable to display in error message (unused)\n * @returns {string} GeoJSON type\n * @example\n * var point = {\n * \"type\": \"Feature\",\n * \"properties\": {},\n * \"geometry\": {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 40]\n * }\n * }\n * var geom = turf.getType(point)\n * //=\"Point\"\n */\nfunction getType(geojson, _name) {\n if (geojson.type === \"FeatureCollection\") {\n return \"FeatureCollection\";\n }\n if (geojson.type === \"GeometryCollection\") {\n return \"GeometryCollection\";\n }\n if (geojson.type === \"Feature\" && geojson.geometry !== null) {\n return geojson.geometry.type;\n }\n return geojson.type;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/invariant/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/line-intersect/dist/es/index.js": -/*!************************************************************!*\ - !*** ./node_modules/@turf/line-intersect/dist/es/index.js ***! - \************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n/* harmony import */ var _turf_line_segment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/line-segment */ \"./node_modules/@turf/line-segment/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n/* harmony import */ var geojson_rbush__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! geojson-rbush */ \"./node_modules/geojson-rbush/index.js\");\n/* harmony import */ var geojson_rbush__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(geojson_rbush__WEBPACK_IMPORTED_MODULE_4__);\n\n\n\n\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @name lineIntersect\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @returns {FeatureCollection} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect(line1, line2) {\n var unique = {};\n var results = [];\n // First, normalize geometries to features\n // Then, handle simple 2-vertex segments\n if (line1.type === \"LineString\") {\n line1 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(line1);\n }\n if (line2.type === \"LineString\") {\n line2 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(line2);\n }\n if (line1.type === \"Feature\" &&\n line2.type === \"Feature\" &&\n line1.geometry !== null &&\n line2.geometry !== null &&\n line1.geometry.type === \"LineString\" &&\n line2.geometry.type === \"LineString\" &&\n line1.geometry.coordinates.length === 2 &&\n line2.geometry.coordinates.length === 2) {\n var intersect = intersects(line1, line2);\n if (intersect) {\n results.push(intersect);\n }\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(results);\n }\n // Handles complex GeoJSON Geometries\n var tree = geojson_rbush__WEBPACK_IMPORTED_MODULE_4___default()();\n tree.load(Object(_turf_line_segment__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(line2));\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_3__[\"featureEach\"])(Object(_turf_line_segment__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(line1), function (segment) {\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_3__[\"featureEach\"])(tree.search(segment), function (match) {\n var intersect = intersects(segment, match);\n if (intersect) {\n // prevent duplicate points https://github.com/Turfjs/turf/issues/688\n var key = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(intersect).join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersect);\n }\n }\n });\n });\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(results);\n}\n/**\n * Find a point that intersects LineStrings with two coordinates each\n *\n * @private\n * @param {Feature} line1 GeoJSON LineString (Must only contain 2 coordinates)\n * @param {Feature} line2 GeoJSON LineString (Must only contain 2 coordinates)\n * @returns {Feature} intersecting GeoJSON Point\n */\nfunction intersects(line1, line2) {\n var coords1 = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(line1);\n var coords2 = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(line2);\n if (coords1.length !== 2) {\n throw new Error(\" line1 must only contain 2 coordinates\");\n }\n if (coords2.length !== 2) {\n throw new Error(\" line2 must only contain 2 coordinates\");\n }\n var x1 = coords1[0][0];\n var y1 = coords1[0][1];\n var x2 = coords1[1][0];\n var y2 = coords1[1][1];\n var x3 = coords2[0][0];\n var y3 = coords2[0][1];\n var x4 = coords2[1][0];\n var y4 = coords2[1][1];\n var denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n var numeA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);\n var numeB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);\n if (denom === 0) {\n if (numeA === 0 && numeB === 0) {\n return null;\n }\n return null;\n }\n var uA = numeA / denom;\n var uB = numeB / denom;\n if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {\n var x = x1 + uA * (x2 - x1);\n var y = y1 + uA * (y2 - y1);\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])([x, y]);\n }\n return null;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (lineIntersect);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/line-intersect/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/line-segment/dist/es/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@turf/line-segment/dist/es/index.js ***! - \**********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n\n\n\n/**\n * Creates a {@link FeatureCollection} of 2-vertex {@link LineString} segments from a\n * {@link LineString|(Multi)LineString} or {@link Polygon|(Multi)Polygon}.\n *\n * @name lineSegment\n * @param {GeoJSON} geojson GeoJSON Polygon or LineString\n * @returns {FeatureCollection} 2-vertex line segments\n * @example\n * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]);\n * var segments = turf.lineSegment(polygon);\n *\n * //addToMap\n * var addToMap = [polygon, segments]\n */\nfunction lineSegment(geojson) {\n if (!geojson) {\n throw new Error(\"geojson is required\");\n }\n var results = [];\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_2__[\"flattenEach\"])(geojson, function (feature) {\n lineSegmentFeature(feature, results);\n });\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(results);\n}\n/**\n * Line Segment\n *\n * @private\n * @param {Feature} geojson Line or polygon feature\n * @param {Array} results push to results\n * @returns {void}\n */\nfunction lineSegmentFeature(geojson, results) {\n var coords = [];\n var geometry = geojson.geometry;\n if (geometry !== null) {\n switch (geometry.type) {\n case \"Polygon\":\n coords = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(geometry);\n break;\n case \"LineString\":\n coords = [Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(geometry)];\n }\n coords.forEach(function (coord) {\n var segments = createSegments(coord, geojson.properties);\n segments.forEach(function (segment) {\n segment.id = results.length;\n results.push(segment);\n });\n });\n }\n}\n/**\n * Create Segments from LineString coordinates\n *\n * @private\n * @param {Array>} coords LineString coordinates\n * @param {*} properties GeoJSON properties\n * @returns {Array>} line segments\n */\nfunction createSegments(coords, properties) {\n var segments = [];\n coords.reduce(function (previousCoords, currentCoords) {\n var segment = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])([previousCoords, currentCoords], properties);\n segment.bbox = bbox(previousCoords, currentCoords);\n segments.push(segment);\n return currentCoords;\n });\n return segments;\n}\n/**\n * Create BBox between two coordinates (faster than @turf/bbox)\n *\n * @private\n * @param {Array} coords1 Point coordinate\n * @param {Array} coords2 Point coordinate\n * @returns {BBox} [west, south, east, north]\n */\nfunction bbox(coords1, coords2) {\n var x1 = coords1[0];\n var y1 = coords1[1];\n var x2 = coords2[0];\n var y2 = coords2[1];\n var west = x1 < x2 ? x1 : x2;\n var south = y1 < y2 ? y1 : y2;\n var east = x1 > x2 ? x1 : x2;\n var north = y1 > y2 ? y1 : y2;\n return [west, south, east, north];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (lineSegment);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/line-segment/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/meta/dist/es/index.js": -/*!**************************************************!*\ - !*** ./node_modules/@turf/meta/dist/es/index.js ***! - \**************************************************/ -/*! exports provided: coordEach, coordReduce, propEach, propReduce, featureEach, featureReduce, coordAll, geomEach, geomReduce, flattenEach, flattenReduce, segmentEach, segmentReduce, lineEach, lineReduce, findSegment, findPoint */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordEach\", function() { return coordEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordReduce\", function() { return coordReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"propEach\", function() { return propEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"propReduce\", function() { return propReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureEach\", function() { return featureEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureReduce\", function() { return featureReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordAll\", function() { return coordAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geomEach\", function() { return geomEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geomReduce\", function() { return geomReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flattenEach\", function() { return flattenEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flattenReduce\", function() { return flattenReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentEach\", function() { return segmentEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentReduce\", function() { return segmentReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineEach\", function() { return lineEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineReduce\", function() { return lineReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findSegment\", function() { return findSegment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findPoint\", function() { return findPoint; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n\n\n/**\n * Callback for coordEach\n *\n * @callback coordEachCallback\n * @param {Array} currentCoord The current coordinate being processed.\n * @param {number} coordIndex The current index of the coordinate being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n */\n\n/**\n * Iterate over coordinates in any GeoJSON object, similar to Array.forEach()\n *\n * @name coordEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex)\n * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration.\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {\"foo\": \"bar\"}),\n * turf.point([36, 53], {\"hello\": \"world\"})\n * ]);\n *\n * turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=currentCoord\n * //=coordIndex\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * });\n */\nfunction coordEach(geojson, callback, excludeWrapCoord) {\n // Handles null Geometry -- Skips this GeoJSON\n if (geojson === null) return;\n var j,\n k,\n l,\n geometry,\n stopG,\n coords,\n geometryMaybeCollection,\n wrapShrink = 0,\n coordIndex = 0,\n isGeometryCollection,\n type = geojson.type,\n isFeatureCollection = type === \"FeatureCollection\",\n isFeature = type === \"Feature\",\n stop = isFeatureCollection ? geojson.features.length : 1;\n\n // This logic may look a little weird. The reason why it is that way\n // is because it's trying to be fast. GeoJSON supports multiple kinds\n // of objects at its root: FeatureCollection, Features, Geometries.\n // This function has the responsibility of handling all of them, and that\n // means that some of the `for` loops you see below actually just don't apply\n // to certain inputs. For instance, if you give this just a\n // Point geometry, then both loops are short-circuited and all we do\n // is gradually rename the input until it's called 'geometry'.\n //\n // This also aims to allocate as few resources as possible: just a\n // few numbers and booleans, rather than any temporary arrays as would\n // be required with the normalization approach.\n for (var featureIndex = 0; featureIndex < stop; featureIndex++) {\n geometryMaybeCollection = isFeatureCollection\n ? geojson.features[featureIndex].geometry\n : isFeature\n ? geojson.geometry\n : geojson;\n isGeometryCollection = geometryMaybeCollection\n ? geometryMaybeCollection.type === \"GeometryCollection\"\n : false;\n stopG = isGeometryCollection\n ? geometryMaybeCollection.geometries.length\n : 1;\n\n for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {\n var multiFeatureIndex = 0;\n var geometryIndex = 0;\n geometry = isGeometryCollection\n ? geometryMaybeCollection.geometries[geomIndex]\n : geometryMaybeCollection;\n\n // Handles null Geometry -- Skips this geometry\n if (geometry === null) continue;\n coords = geometry.coordinates;\n var geomType = geometry.type;\n\n wrapShrink =\n excludeWrapCoord &&\n (geomType === \"Polygon\" || geomType === \"MultiPolygon\")\n ? 1\n : 0;\n\n switch (geomType) {\n case null:\n break;\n case \"Point\":\n if (\n callback(\n coords,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n multiFeatureIndex++;\n break;\n case \"LineString\":\n case \"MultiPoint\":\n for (j = 0; j < coords.length; j++) {\n if (\n callback(\n coords[j],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n if (geomType === \"MultiPoint\") multiFeatureIndex++;\n }\n if (geomType === \"LineString\") multiFeatureIndex++;\n break;\n case \"Polygon\":\n case \"MultiLineString\":\n for (j = 0; j < coords.length; j++) {\n for (k = 0; k < coords[j].length - wrapShrink; k++) {\n if (\n callback(\n coords[j][k],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n }\n if (geomType === \"MultiLineString\") multiFeatureIndex++;\n if (geomType === \"Polygon\") geometryIndex++;\n }\n if (geomType === \"Polygon\") multiFeatureIndex++;\n break;\n case \"MultiPolygon\":\n for (j = 0; j < coords.length; j++) {\n geometryIndex = 0;\n for (k = 0; k < coords[j].length; k++) {\n for (l = 0; l < coords[j][k].length - wrapShrink; l++) {\n if (\n callback(\n coords[j][k][l],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n }\n geometryIndex++;\n }\n multiFeatureIndex++;\n }\n break;\n case \"GeometryCollection\":\n for (j = 0; j < geometry.geometries.length; j++)\n if (\n coordEach(geometry.geometries[j], callback, excludeWrapCoord) ===\n false\n )\n return false;\n break;\n default:\n throw new Error(\"Unknown Geometry Type\");\n }\n }\n }\n}\n\n/**\n * Callback for coordReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback coordReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Array} currentCoord The current coordinate being processed.\n * @param {number} coordIndex The current index of the coordinate being processed.\n * Starts at index 0, if an initialValue is provided, and at index 1 otherwise.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n */\n\n/**\n * Reduce coordinates in any GeoJSON object, similar to Array.reduce()\n *\n * @name coordReduce\n * @param {FeatureCollection|Geometry|Feature} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentCoord, coordIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {\"foo\": \"bar\"}),\n * turf.point([36, 53], {\"hello\": \"world\"})\n * ]);\n *\n * turf.coordReduce(features, function (previousValue, currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=previousValue\n * //=currentCoord\n * //=coordIndex\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * return currentCoord;\n * });\n */\nfunction coordReduce(geojson, callback, initialValue, excludeWrapCoord) {\n var previousValue = initialValue;\n coordEach(\n geojson,\n function (\n currentCoord,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) {\n if (coordIndex === 0 && initialValue === undefined)\n previousValue = currentCoord;\n else\n previousValue = callback(\n previousValue,\n currentCoord,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n );\n },\n excludeWrapCoord\n );\n return previousValue;\n}\n\n/**\n * Callback for propEach\n *\n * @callback propEachCallback\n * @param {Object} currentProperties The current Properties being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Iterate over properties in any GeoJSON object, similar to Array.forEach()\n *\n * @name propEach\n * @param {FeatureCollection|Feature} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentProperties, featureIndex)\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.propEach(features, function (currentProperties, featureIndex) {\n * //=currentProperties\n * //=featureIndex\n * });\n */\nfunction propEach(geojson, callback) {\n var i;\n switch (geojson.type) {\n case \"FeatureCollection\":\n for (i = 0; i < geojson.features.length; i++) {\n if (callback(geojson.features[i].properties, i) === false) break;\n }\n break;\n case \"Feature\":\n callback(geojson.properties, 0);\n break;\n }\n}\n\n/**\n * Callback for propReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback propReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {*} currentProperties The current Properties being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Reduce properties in any GeoJSON object into a single value,\n * similar to how Array.reduce works. However, in this case we lazily run\n * the reduction, so an array of all properties is unnecessary.\n *\n * @name propReduce\n * @param {FeatureCollection|Feature} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentProperties, featureIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.propReduce(features, function (previousValue, currentProperties, featureIndex) {\n * //=previousValue\n * //=currentProperties\n * //=featureIndex\n * return currentProperties\n * });\n */\nfunction propReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n propEach(geojson, function (currentProperties, featureIndex) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentProperties;\n else\n previousValue = callback(previousValue, currentProperties, featureIndex);\n });\n return previousValue;\n}\n\n/**\n * Callback for featureEach\n *\n * @callback featureEachCallback\n * @param {Feature} currentFeature The current Feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Iterate over features in any GeoJSON object, similar to\n * Array.forEach.\n *\n * @name featureEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentFeature, featureIndex)\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.featureEach(features, function (currentFeature, featureIndex) {\n * //=currentFeature\n * //=featureIndex\n * });\n */\nfunction featureEach(geojson, callback) {\n if (geojson.type === \"Feature\") {\n callback(geojson, 0);\n } else if (geojson.type === \"FeatureCollection\") {\n for (var i = 0; i < geojson.features.length; i++) {\n if (callback(geojson.features[i], i) === false) break;\n }\n }\n}\n\n/**\n * Callback for featureReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback featureReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentFeature The current Feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Reduce features in any GeoJSON object, similar to Array.reduce().\n *\n * @name featureReduce\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentFeature, featureIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {\"foo\": \"bar\"}),\n * turf.point([36, 53], {\"hello\": \"world\"})\n * ]);\n *\n * turf.featureReduce(features, function (previousValue, currentFeature, featureIndex) {\n * //=previousValue\n * //=currentFeature\n * //=featureIndex\n * return currentFeature\n * });\n */\nfunction featureReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n featureEach(geojson, function (currentFeature, featureIndex) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentFeature;\n else previousValue = callback(previousValue, currentFeature, featureIndex);\n });\n return previousValue;\n}\n\n/**\n * Get all coordinates from any GeoJSON object.\n *\n * @name coordAll\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @returns {Array>} coordinate position array\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * var coords = turf.coordAll(features);\n * //= [[26, 37], [36, 53]]\n */\nfunction coordAll(geojson) {\n var coords = [];\n coordEach(geojson, function (coord) {\n coords.push(coord);\n });\n return coords;\n}\n\n/**\n * Callback for geomEach\n *\n * @callback geomEachCallback\n * @param {Geometry} currentGeometry The current Geometry being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {Object} featureProperties The current Feature Properties being processed.\n * @param {Array} featureBBox The current Feature BBox being processed.\n * @param {number|string} featureId The current Feature Id being processed.\n */\n\n/**\n * Iterate over each geometry in any GeoJSON object, similar to Array.forEach()\n *\n * @name geomEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentGeometry, featureIndex, featureProperties, featureBBox, featureId)\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.geomEach(features, function (currentGeometry, featureIndex, featureProperties, featureBBox, featureId) {\n * //=currentGeometry\n * //=featureIndex\n * //=featureProperties\n * //=featureBBox\n * //=featureId\n * });\n */\nfunction geomEach(geojson, callback) {\n var i,\n j,\n g,\n geometry,\n stopG,\n geometryMaybeCollection,\n isGeometryCollection,\n featureProperties,\n featureBBox,\n featureId,\n featureIndex = 0,\n isFeatureCollection = geojson.type === \"FeatureCollection\",\n isFeature = geojson.type === \"Feature\",\n stop = isFeatureCollection ? geojson.features.length : 1;\n\n // This logic may look a little weird. The reason why it is that way\n // is because it's trying to be fast. GeoJSON supports multiple kinds\n // of objects at its root: FeatureCollection, Features, Geometries.\n // This function has the responsibility of handling all of them, and that\n // means that some of the `for` loops you see below actually just don't apply\n // to certain inputs. For instance, if you give this just a\n // Point geometry, then both loops are short-circuited and all we do\n // is gradually rename the input until it's called 'geometry'.\n //\n // This also aims to allocate as few resources as possible: just a\n // few numbers and booleans, rather than any temporary arrays as would\n // be required with the normalization approach.\n for (i = 0; i < stop; i++) {\n geometryMaybeCollection = isFeatureCollection\n ? geojson.features[i].geometry\n : isFeature\n ? geojson.geometry\n : geojson;\n featureProperties = isFeatureCollection\n ? geojson.features[i].properties\n : isFeature\n ? geojson.properties\n : {};\n featureBBox = isFeatureCollection\n ? geojson.features[i].bbox\n : isFeature\n ? geojson.bbox\n : undefined;\n featureId = isFeatureCollection\n ? geojson.features[i].id\n : isFeature\n ? geojson.id\n : undefined;\n isGeometryCollection = geometryMaybeCollection\n ? geometryMaybeCollection.type === \"GeometryCollection\"\n : false;\n stopG = isGeometryCollection\n ? geometryMaybeCollection.geometries.length\n : 1;\n\n for (g = 0; g < stopG; g++) {\n geometry = isGeometryCollection\n ? geometryMaybeCollection.geometries[g]\n : geometryMaybeCollection;\n\n // Handle null Geometry\n if (geometry === null) {\n if (\n callback(\n null,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false\n )\n return false;\n continue;\n }\n switch (geometry.type) {\n case \"Point\":\n case \"LineString\":\n case \"MultiPoint\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\": {\n if (\n callback(\n geometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false\n )\n return false;\n break;\n }\n case \"GeometryCollection\": {\n for (j = 0; j < geometry.geometries.length; j++) {\n if (\n callback(\n geometry.geometries[j],\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false\n )\n return false;\n }\n break;\n }\n default:\n throw new Error(\"Unknown Geometry Type\");\n }\n }\n // Only increase `featureIndex` per each feature\n featureIndex++;\n }\n}\n\n/**\n * Callback for geomReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback geomReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Geometry} currentGeometry The current Geometry being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {Object} featureProperties The current Feature Properties being processed.\n * @param {Array} featureBBox The current Feature BBox being processed.\n * @param {number|string} featureId The current Feature Id being processed.\n */\n\n/**\n * Reduce geometry in any GeoJSON object, similar to Array.reduce().\n *\n * @name geomReduce\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentGeometry, featureIndex, featureProperties, featureBBox, featureId)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.geomReduce(features, function (previousValue, currentGeometry, featureIndex, featureProperties, featureBBox, featureId) {\n * //=previousValue\n * //=currentGeometry\n * //=featureIndex\n * //=featureProperties\n * //=featureBBox\n * //=featureId\n * return currentGeometry\n * });\n */\nfunction geomReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n geomEach(\n geojson,\n function (\n currentGeometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentGeometry;\n else\n previousValue = callback(\n previousValue,\n currentGeometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Callback for flattenEach\n *\n * @callback flattenEachCallback\n * @param {Feature} currentFeature The current flattened feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n */\n\n/**\n * Iterate over flattened features in any GeoJSON object, similar to\n * Array.forEach.\n *\n * @name flattenEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentFeature, featureIndex, multiFeatureIndex)\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.multiPoint([[40, 30], [36, 53]], {hello: 'world'})\n * ]);\n *\n * turf.flattenEach(features, function (currentFeature, featureIndex, multiFeatureIndex) {\n * //=currentFeature\n * //=featureIndex\n * //=multiFeatureIndex\n * });\n */\nfunction flattenEach(geojson, callback) {\n geomEach(geojson, function (geometry, featureIndex, properties, bbox, id) {\n // Callback for single geometry\n var type = geometry === null ? null : geometry.type;\n switch (type) {\n case null:\n case \"Point\":\n case \"LineString\":\n case \"Polygon\":\n if (\n callback(\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(geometry, properties, { bbox: bbox, id: id }),\n featureIndex,\n 0\n ) === false\n )\n return false;\n return;\n }\n\n var geomType;\n\n // Callback for multi-geometry\n switch (type) {\n case \"MultiPoint\":\n geomType = \"Point\";\n break;\n case \"MultiLineString\":\n geomType = \"LineString\";\n break;\n case \"MultiPolygon\":\n geomType = \"Polygon\";\n break;\n }\n\n for (\n var multiFeatureIndex = 0;\n multiFeatureIndex < geometry.coordinates.length;\n multiFeatureIndex++\n ) {\n var coordinate = geometry.coordinates[multiFeatureIndex];\n var geom = {\n type: geomType,\n coordinates: coordinate,\n };\n if (\n callback(Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(geom, properties), featureIndex, multiFeatureIndex) ===\n false\n )\n return false;\n }\n });\n}\n\n/**\n * Callback for flattenReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback flattenReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentFeature The current Feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n */\n\n/**\n * Reduce flattened features in any GeoJSON object, similar to Array.reduce().\n *\n * @name flattenReduce\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentFeature, featureIndex, multiFeatureIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.multiPoint([[40, 30], [36, 53]], {hello: 'world'})\n * ]);\n *\n * turf.flattenReduce(features, function (previousValue, currentFeature, featureIndex, multiFeatureIndex) {\n * //=previousValue\n * //=currentFeature\n * //=featureIndex\n * //=multiFeatureIndex\n * return currentFeature\n * });\n */\nfunction flattenReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n flattenEach(\n geojson,\n function (currentFeature, featureIndex, multiFeatureIndex) {\n if (\n featureIndex === 0 &&\n multiFeatureIndex === 0 &&\n initialValue === undefined\n )\n previousValue = currentFeature;\n else\n previousValue = callback(\n previousValue,\n currentFeature,\n featureIndex,\n multiFeatureIndex\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Callback for segmentEach\n *\n * @callback segmentEachCallback\n * @param {Feature} currentSegment The current Segment being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n * @param {number} segmentIndex The current index of the Segment being processed.\n * @returns {void}\n */\n\n/**\n * Iterate over 2-vertex line segment in any GeoJSON object, similar to Array.forEach()\n * (Multi)Point geometries do not contain segments therefore they are ignored during this operation.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON\n * @param {Function} callback a method that takes (currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex)\n * @returns {void}\n * @example\n * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]);\n *\n * // Iterate over GeoJSON by 2-vertex segments\n * turf.segmentEach(polygon, function (currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {\n * //=currentSegment\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * //=segmentIndex\n * });\n *\n * // Calculate the total number of segments\n * var total = 0;\n * turf.segmentEach(polygon, function () {\n * total++;\n * });\n */\nfunction segmentEach(geojson, callback) {\n flattenEach(geojson, function (feature$$1, featureIndex, multiFeatureIndex) {\n var segmentIndex = 0;\n\n // Exclude null Geometries\n if (!feature$$1.geometry) return;\n // (Multi)Point geometries do not contain segments therefore they are ignored during this operation.\n var type = feature$$1.geometry.type;\n if (type === \"Point\" || type === \"MultiPoint\") return;\n\n // Generate 2-vertex line segments\n var previousCoords;\n var previousFeatureIndex = 0;\n var previousMultiIndex = 0;\n var prevGeomIndex = 0;\n if (\n coordEach(\n feature$$1,\n function (\n currentCoord,\n coordIndex,\n featureIndexCoord,\n multiPartIndexCoord,\n geometryIndex\n ) {\n // Simulating a meta.coordReduce() since `reduce` operations cannot be stopped by returning `false`\n if (\n previousCoords === undefined ||\n featureIndex > previousFeatureIndex ||\n multiPartIndexCoord > previousMultiIndex ||\n geometryIndex > prevGeomIndex\n ) {\n previousCoords = currentCoord;\n previousFeatureIndex = featureIndex;\n previousMultiIndex = multiPartIndexCoord;\n prevGeomIndex = geometryIndex;\n segmentIndex = 0;\n return;\n }\n var currentSegment = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [previousCoords, currentCoord],\n feature$$1.properties\n );\n if (\n callback(\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n ) === false\n )\n return false;\n segmentIndex++;\n previousCoords = currentCoord;\n }\n ) === false\n )\n return false;\n });\n}\n\n/**\n * Callback for segmentReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback segmentReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentSegment The current Segment being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n * @param {number} segmentIndex The current index of the Segment being processed.\n */\n\n/**\n * Reduce 2-vertex line segment in any GeoJSON object, similar to Array.reduce()\n * (Multi)Point geometries do not contain segments therefore they are ignored during this operation.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON\n * @param {Function} callback a method that takes (previousValue, currentSegment, currentIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {void}\n * @example\n * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]);\n *\n * // Iterate over GeoJSON by 2-vertex segments\n * turf.segmentReduce(polygon, function (previousSegment, currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {\n * //= previousSegment\n * //= currentSegment\n * //= featureIndex\n * //= multiFeatureIndex\n * //= geometryIndex\n * //= segmentIndex\n * return currentSegment\n * });\n *\n * // Calculate the total number of segments\n * var initialValue = 0\n * var total = turf.segmentReduce(polygon, function (previousValue) {\n * previousValue++;\n * return previousValue;\n * }, initialValue);\n */\nfunction segmentReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n var started = false;\n segmentEach(\n geojson,\n function (\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n ) {\n if (started === false && initialValue === undefined)\n previousValue = currentSegment;\n else\n previousValue = callback(\n previousValue,\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n );\n started = true;\n }\n );\n return previousValue;\n}\n\n/**\n * Callback for lineEach\n *\n * @callback lineEachCallback\n * @param {Feature} currentLine The current LineString|LinearRing being processed\n * @param {number} featureIndex The current index of the Feature being processed\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed\n * @param {number} geometryIndex The current index of the Geometry being processed\n */\n\n/**\n * Iterate over line or ring coordinates in LineString, Polygon, MultiLineString, MultiPolygon Features or Geometries,\n * similar to Array.forEach.\n *\n * @name lineEach\n * @param {Geometry|Feature} geojson object\n * @param {Function} callback a method that takes (currentLine, featureIndex, multiFeatureIndex, geometryIndex)\n * @example\n * var multiLine = turf.multiLineString([\n * [[26, 37], [35, 45]],\n * [[36, 53], [38, 50], [41, 55]]\n * ]);\n *\n * turf.lineEach(multiLine, function (currentLine, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=currentLine\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * });\n */\nfunction lineEach(geojson, callback) {\n // validation\n if (!geojson) throw new Error(\"geojson is required\");\n\n flattenEach(geojson, function (feature$$1, featureIndex, multiFeatureIndex) {\n if (feature$$1.geometry === null) return;\n var type = feature$$1.geometry.type;\n var coords = feature$$1.geometry.coordinates;\n switch (type) {\n case \"LineString\":\n if (callback(feature$$1, featureIndex, multiFeatureIndex, 0, 0) === false)\n return false;\n break;\n case \"Polygon\":\n for (\n var geometryIndex = 0;\n geometryIndex < coords.length;\n geometryIndex++\n ) {\n if (\n callback(\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(coords[geometryIndex], feature$$1.properties),\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n }\n break;\n }\n });\n}\n\n/**\n * Callback for lineReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback lineReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentLine The current LineString|LinearRing being processed.\n * @param {number} featureIndex The current index of the Feature being processed\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed\n * @param {number} geometryIndex The current index of the Geometry being processed\n */\n\n/**\n * Reduce features in any GeoJSON object, similar to Array.reduce().\n *\n * @name lineReduce\n * @param {Geometry|Feature} geojson object\n * @param {Function} callback a method that takes (previousValue, currentLine, featureIndex, multiFeatureIndex, geometryIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var multiPoly = turf.multiPolygon([\n * turf.polygon([[[12,48],[2,41],[24,38],[12,48]], [[9,44],[13,41],[13,45],[9,44]]]),\n * turf.polygon([[[5, 5], [0, 0], [2, 2], [4, 4], [5, 5]]])\n * ]);\n *\n * turf.lineReduce(multiPoly, function (previousValue, currentLine, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=previousValue\n * //=currentLine\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * return currentLine\n * });\n */\nfunction lineReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n lineEach(\n geojson,\n function (currentLine, featureIndex, multiFeatureIndex, geometryIndex) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentLine;\n else\n previousValue = callback(\n previousValue,\n currentLine,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Finds a particular 2-vertex LineString Segment from a GeoJSON using `@turf/meta` indexes.\n *\n * Negative indexes are permitted.\n * Point & MultiPoint will always return null.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson Any GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.featureIndex=0] Feature Index\n * @param {number} [options.multiFeatureIndex=0] Multi-Feature Index\n * @param {number} [options.geometryIndex=0] Geometry Index\n * @param {number} [options.segmentIndex=0] Segment Index\n * @param {Object} [options.properties={}] Translate Properties to output LineString\n * @param {BBox} [options.bbox={}] Translate BBox to output LineString\n * @param {number|string} [options.id={}] Translate Id to output LineString\n * @returns {Feature} 2-vertex GeoJSON Feature LineString\n * @example\n * var multiLine = turf.multiLineString([\n * [[10, 10], [50, 30], [30, 40]],\n * [[-10, -10], [-50, -30], [-30, -40]]\n * ]);\n *\n * // First Segment (defaults are 0)\n * turf.findSegment(multiLine);\n * // => Feature>\n *\n * // First Segment of 2nd Multi Feature\n * turf.findSegment(multiLine, {multiFeatureIndex: 1});\n * // => Feature>\n *\n * // Last Segment of Last Multi Feature\n * turf.findSegment(multiLine, {multiFeatureIndex: -1, segmentIndex: -1});\n * // => Feature>\n */\nfunction findSegment(geojson, options) {\n // Optional Parameters\n options = options || {};\n if (!Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(options)) throw new Error(\"options is invalid\");\n var featureIndex = options.featureIndex || 0;\n var multiFeatureIndex = options.multiFeatureIndex || 0;\n var geometryIndex = options.geometryIndex || 0;\n var segmentIndex = options.segmentIndex || 0;\n\n // Find FeatureIndex\n var properties = options.properties;\n var geometry;\n\n switch (geojson.type) {\n case \"FeatureCollection\":\n if (featureIndex < 0)\n featureIndex = geojson.features.length + featureIndex;\n properties = properties || geojson.features[featureIndex].properties;\n geometry = geojson.features[featureIndex].geometry;\n break;\n case \"Feature\":\n properties = properties || geojson.properties;\n geometry = geojson.geometry;\n break;\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n geometry = geojson;\n break;\n default:\n throw new Error(\"geojson is invalid\");\n }\n\n // Find SegmentIndex\n if (geometry === null) return null;\n var coords = geometry.coordinates;\n switch (geometry.type) {\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n if (segmentIndex < 0) segmentIndex = coords.length + segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [coords[segmentIndex], coords[segmentIndex + 1]],\n properties,\n options\n );\n case \"Polygon\":\n if (geometryIndex < 0) geometryIndex = coords.length + geometryIndex;\n if (segmentIndex < 0)\n segmentIndex = coords[geometryIndex].length + segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [\n coords[geometryIndex][segmentIndex],\n coords[geometryIndex][segmentIndex + 1],\n ],\n properties,\n options\n );\n case \"MultiLineString\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (segmentIndex < 0)\n segmentIndex = coords[multiFeatureIndex].length + segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [\n coords[multiFeatureIndex][segmentIndex],\n coords[multiFeatureIndex][segmentIndex + 1],\n ],\n properties,\n options\n );\n case \"MultiPolygon\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (geometryIndex < 0)\n geometryIndex = coords[multiFeatureIndex].length + geometryIndex;\n if (segmentIndex < 0)\n segmentIndex =\n coords[multiFeatureIndex][geometryIndex].length - segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [\n coords[multiFeatureIndex][geometryIndex][segmentIndex],\n coords[multiFeatureIndex][geometryIndex][segmentIndex + 1],\n ],\n properties,\n options\n );\n }\n throw new Error(\"geojson is invalid\");\n}\n\n/**\n * Finds a particular Point from a GeoJSON using `@turf/meta` indexes.\n *\n * Negative indexes are permitted.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson Any GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.featureIndex=0] Feature Index\n * @param {number} [options.multiFeatureIndex=0] Multi-Feature Index\n * @param {number} [options.geometryIndex=0] Geometry Index\n * @param {number} [options.coordIndex=0] Coord Index\n * @param {Object} [options.properties={}] Translate Properties to output Point\n * @param {BBox} [options.bbox={}] Translate BBox to output Point\n * @param {number|string} [options.id={}] Translate Id to output Point\n * @returns {Feature} 2-vertex GeoJSON Feature Point\n * @example\n * var multiLine = turf.multiLineString([\n * [[10, 10], [50, 30], [30, 40]],\n * [[-10, -10], [-50, -30], [-30, -40]]\n * ]);\n *\n * // First Segment (defaults are 0)\n * turf.findPoint(multiLine);\n * // => Feature>\n *\n * // First Segment of the 2nd Multi-Feature\n * turf.findPoint(multiLine, {multiFeatureIndex: 1});\n * // => Feature>\n *\n * // Last Segment of last Multi-Feature\n * turf.findPoint(multiLine, {multiFeatureIndex: -1, coordIndex: -1});\n * // => Feature>\n */\nfunction findPoint(geojson, options) {\n // Optional Parameters\n options = options || {};\n if (!Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(options)) throw new Error(\"options is invalid\");\n var featureIndex = options.featureIndex || 0;\n var multiFeatureIndex = options.multiFeatureIndex || 0;\n var geometryIndex = options.geometryIndex || 0;\n var coordIndex = options.coordIndex || 0;\n\n // Find FeatureIndex\n var properties = options.properties;\n var geometry;\n\n switch (geojson.type) {\n case \"FeatureCollection\":\n if (featureIndex < 0)\n featureIndex = geojson.features.length + featureIndex;\n properties = properties || geojson.features[featureIndex].properties;\n geometry = geojson.features[featureIndex].geometry;\n break;\n case \"Feature\":\n properties = properties || geojson.properties;\n geometry = geojson.geometry;\n break;\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n geometry = geojson;\n break;\n default:\n throw new Error(\"geojson is invalid\");\n }\n\n // Find Coord Index\n if (geometry === null) return null;\n var coords = geometry.coordinates;\n switch (geometry.type) {\n case \"Point\":\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords, properties, options);\n case \"MultiPoint\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[multiFeatureIndex], properties, options);\n case \"LineString\":\n if (coordIndex < 0) coordIndex = coords.length + coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[coordIndex], properties, options);\n case \"Polygon\":\n if (geometryIndex < 0) geometryIndex = coords.length + geometryIndex;\n if (coordIndex < 0)\n coordIndex = coords[geometryIndex].length + coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[geometryIndex][coordIndex], properties, options);\n case \"MultiLineString\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (coordIndex < 0)\n coordIndex = coords[multiFeatureIndex].length + coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[multiFeatureIndex][coordIndex], properties, options);\n case \"MultiPolygon\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (geometryIndex < 0)\n geometryIndex = coords[multiFeatureIndex].length + geometryIndex;\n if (coordIndex < 0)\n coordIndex =\n coords[multiFeatureIndex][geometryIndex].length - coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(\n coords[multiFeatureIndex][geometryIndex][coordIndex],\n properties,\n options\n );\n }\n throw new Error(\"geojson is invalid\");\n}\n\n\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/meta/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/@turf/polygon-to-line/dist/es/index.js": -/*!*************************************************************!*\ - !*** ./node_modules/@turf/polygon-to-line/dist/es/index.js ***! - \*************************************************************/ -/*! exports provided: default, polygonToLine, multiPolygonToLine, coordsToLine */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polygonToLine\", function() { return polygonToLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiPolygonToLine\", function() { return multiPolygonToLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordsToLine\", function() { return coordsToLine; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n\n\n/**\n * Converts a {@link Polygon} to {@link LineString|(Multi)LineString} or {@link MultiPolygon} to a\n * {@link FeatureCollection} of {@link LineString|(Multi)LineString}.\n *\n * @name polygonToLine\n * @param {Feature} poly Feature to convert\n * @param {Object} [options={}] Optional parameters\n * @param {Object} [options.properties={}] translates GeoJSON properties to Feature\n * @returns {FeatureCollection|Feature} converted (Multi)Polygon to (Multi)LineString\n * @example\n * var poly = turf.polygon([[[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]]);\n *\n * var line = turf.polygonToLine(poly);\n *\n * //addToMap\n * var addToMap = [line];\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (poly, options) {\n if (options === void 0) { options = {}; }\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getGeom\"])(poly);\n if (!options.properties && poly.type === \"Feature\") {\n options.properties = poly.properties;\n }\n switch (geom.type) {\n case \"Polygon\":\n return polygonToLine(geom, options);\n case \"MultiPolygon\":\n return multiPolygonToLine(geom, options);\n default:\n throw new Error(\"invalid poly\");\n }\n});\n/**\n * @private\n */\nfunction polygonToLine(poly, options) {\n if (options === void 0) { options = {}; }\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getGeom\"])(poly);\n var coords = geom.coordinates;\n var properties = options.properties\n ? options.properties\n : poly.type === \"Feature\"\n ? poly.properties\n : {};\n return coordsToLine(coords, properties);\n}\n/**\n * @private\n */\nfunction multiPolygonToLine(multiPoly, options) {\n if (options === void 0) { options = {}; }\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getGeom\"])(multiPoly);\n var coords = geom.coordinates;\n var properties = options.properties\n ? options.properties\n : multiPoly.type === \"Feature\"\n ? multiPoly.properties\n : {};\n var lines = [];\n coords.forEach(function (coord) {\n lines.push(coordsToLine(coord, properties));\n });\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(lines);\n}\n/**\n * @private\n */\nfunction coordsToLine(coords, properties) {\n if (coords.length > 1) {\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"multiLineString\"])(coords, properties);\n }\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(coords[0], properties);\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/polygon-to-line/dist/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/sass-loader/dist/cjs.js!./src/secondary/loadingScreen.scss": -/*!***************************************************************************************************************************************************************************!*\ - !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/sass-loader/dist/cjs.js!./src/secondary/loadingScreen.scss ***! - \***************************************************************************************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);\n// Imports\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.i, \"._lithosphere_loadingscreen_loading {\\n position: absolute;\\n width: 100%;\\n height: 100%;\\n perspective: 160px;\\n top: 0;\\n left: 0; }\\n\\n._lithosphere_loadingscreen_loading > div {\\n width: 60px;\\n height: 60px;\\n background: rgba(255, 255, 255, 0);\\n position: absolute;\\n left: 50%;\\n margin-left: -30px;\\n top: 50%;\\n margin-top: -5px;\\n border-radius: 2px;\\n border: 2px solid rgba(255, 255, 255, 0.7); }\\n\\n@-webkit-keyframes translateIn {\\n 30% {\\n transform: rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);\\n opacity: 0.7;\\n background: rgba(255, 255, 255, 0.3); }\\n 100% {\\n transform: rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);\\n opacity: 0;\\n background: rgba(255, 255, 255, 0); } }\\n\\n@keyframes translateIn {\\n 30% {\\n transform: rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);\\n opacity: 0.7;\\n background: rgba(255, 255, 255, 0.3); }\\n 100% {\\n transform: rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);\\n opacity: 0;\\n background: rgba(255, 255, 255, 0); } }\\n\\n._lithosphere_loadingscreen_loading > div {\\n opacity: 0; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(1) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(30px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 500ms;\\n animation: translateIn 1.9s ease-in infinite 500ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(2) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(60px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 700ms;\\n animation: translateIn 1.9s ease-in infinite 700ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(3) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(85px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 800ms;\\n animation: translateIn 1.9s ease-in infinite 800ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(4) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(105px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 1000ms;\\n animation: translateIn 1.9s ease-in infinite 1000ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(5) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(120px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 1200ms;\\n animation: translateIn 1.9s ease-in infinite 1200ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(6) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(130px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 1400ms;\\n animation: translateIn 1.9s ease-in infinite 1400ms; }\\n\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/loadingScreen.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/sass-loader/dist/cjs.js"); - -/***/ }), - -/***/ "./node_modules/css-loader/dist/runtime/api.js": -/*!*****************************************************!*\ - !*** ./node_modules/css-loader/dist/runtime/api.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\n//# sourceURL=webpack://LithoSphere/./node_modules/css-loader/dist/runtime/api.js?"); - -/***/ }), - -/***/ "./node_modules/geojson-rbush/index.js": -/*!*********************************************!*\ - !*** ./node_modules/geojson-rbush/index.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var rbush = __webpack_require__(/*! rbush */ \"./node_modules/rbush/index.js\");\nvar helpers = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\nvar meta = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\nvar turfBBox = __webpack_require__(/*! @turf/bbox */ \"./node_modules/@turf/bbox/dist/es/index.js\").default;\nvar featureEach = meta.featureEach;\nvar coordEach = meta.coordEach;\nvar polygon = helpers.polygon;\nvar featureCollection = helpers.featureCollection;\n\n/**\n * GeoJSON implementation of [RBush](https://github.com/mourner/rbush#rbush) spatial index.\n *\n * @name rbush\n * @param {number} [maxEntries=9] defines the maximum number of entries in a tree node. 9 (used by default) is a\n * reasonable choice for most applications. Higher value means faster insertion and slower search, and vice versa.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var geojsonRbush = require('geojson-rbush').default;\n * var tree = geojsonRbush();\n */\nfunction geojsonRbush(maxEntries) {\n var tree = rbush(maxEntries);\n /**\n * [insert](https://github.com/mourner/rbush#data-format)\n *\n * @param {Feature} feature insert single GeoJSON Feature\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n * tree.insert(poly)\n */\n tree.insert = function (feature) {\n if (feature.type !== 'Feature') throw new Error('invalid feature');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.insert.call(this, feature);\n };\n\n /**\n * [load](https://github.com/mourner/rbush#bulk-inserting-data)\n *\n * @param {FeatureCollection|Array} features load entire GeoJSON FeatureCollection\n * @returns {RBush} GeoJSON RBush\n * @example\n * var polys = turf.polygons([\n * [[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]],\n * [[[-93, 32], [-83, 32], [-83, 39], [-93, 39], [-93, 32]]]\n * ]);\n * tree.load(polys);\n */\n tree.load = function (features) {\n var load = [];\n // Load an Array of Features\n if (Array.isArray(features)) {\n features.forEach(function (feature) {\n if (feature.type !== 'Feature') throw new Error('invalid features');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n } else {\n // Load a FeatureCollection\n featureEach(features, function (feature) {\n if (feature.type !== 'Feature') throw new Error('invalid features');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n }\n return rbush.prototype.load.call(this, load);\n };\n\n /**\n * [remove](https://github.com/mourner/rbush#removing-data)\n *\n * @param {Feature} feature remove single GeoJSON Feature\n * @param {Function} equals Pass a custom equals function to compare by value for removal.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.remove(poly);\n */\n tree.remove = function (feature, equals) {\n if (feature.type !== 'Feature') throw new Error('invalid feature');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.remove.call(this, feature, equals);\n };\n\n /**\n * [clear](https://github.com/mourner/rbush#removing-data)\n *\n * @returns {RBush} GeoJSON Rbush\n * @example\n * tree.clear()\n */\n tree.clear = function () {\n return rbush.prototype.clear.call(this);\n };\n\n /**\n * [search](https://github.com/mourner/rbush#search)\n *\n * @param {BBox|FeatureCollection|Feature} geojson search with GeoJSON\n * @returns {FeatureCollection} all features that intersects with the given GeoJSON.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.search(poly);\n */\n tree.search = function (geojson) {\n var features = rbush.prototype.search.call(this, this.toBBox(geojson));\n return featureCollection(features);\n };\n\n /**\n * [collides](https://github.com/mourner/rbush#collisions)\n *\n * @param {BBox|FeatureCollection|Feature} geojson collides with GeoJSON\n * @returns {boolean} true if there are any items intersecting the given GeoJSON, otherwise false.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.collides(poly);\n */\n tree.collides = function (geojson) {\n return rbush.prototype.collides.call(this, this.toBBox(geojson));\n };\n\n /**\n * [all](https://github.com/mourner/rbush#search)\n *\n * @returns {FeatureCollection} all the features in RBush\n * @example\n * tree.all()\n */\n tree.all = function () {\n var features = rbush.prototype.all.call(this);\n return featureCollection(features);\n };\n\n /**\n * [toJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @returns {any} export data as JSON object\n * @example\n * var exported = tree.toJSON()\n */\n tree.toJSON = function () {\n return rbush.prototype.toJSON.call(this);\n };\n\n /**\n * [fromJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @param {any} json import previously exported data\n * @returns {RBush} GeoJSON RBush\n * @example\n * var exported = {\n * \"children\": [\n * {\n * \"type\": \"Feature\",\n * \"geometry\": {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 50]\n * },\n * \"properties\": {},\n * \"bbox\": [110, 50, 110, 50]\n * }\n * ],\n * \"height\": 1,\n * \"leaf\": true,\n * \"minX\": 110,\n * \"minY\": 50,\n * \"maxX\": 110,\n * \"maxY\": 50\n * }\n * tree.fromJSON(exported)\n */\n tree.fromJSON = function (json) {\n return rbush.prototype.fromJSON.call(this, json);\n };\n\n /**\n * Converts GeoJSON to {minX, minY, maxX, maxY} schema\n *\n * @private\n * @param {BBox|FeatureCollection|Feature} geojson feature(s) to retrieve BBox from\n * @returns {Object} converted to {minX, minY, maxX, maxY}\n */\n tree.toBBox = function (geojson) {\n var bbox;\n if (geojson.bbox) bbox = geojson.bbox;\n else if (Array.isArray(geojson) && geojson.length === 4) bbox = geojson;\n else if (Array.isArray(geojson) && geojson.length === 6) bbox = [geojson[0], geojson[1], geojson[3], geojson[4]];\n else if (geojson.type === 'Feature') bbox = turfBBox(geojson);\n else if (geojson.type === 'FeatureCollection') bbox = turfBBox(geojson);\n else throw new Error('invalid geojson')\n\n return {\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3]\n };\n };\n return tree;\n}\n\nmodule.exports = geojsonRbush;\nmodule.exports.default = geojsonRbush;\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/geojson-rbush/index.js?"); - -/***/ }), - -/***/ "./node_modules/mgrs/mgrs.js": -/*!***********************************!*\ - !*** ./node_modules/mgrs/mgrs.js ***! - \***********************************/ -/*! exports provided: default, forward, inverse, toPoint */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toPoint\", function() { return toPoint; });\n\n\n\n/**\n * UTM zones are grouped, and assigned to one of a group of 6\n * sets.\n *\n * {int} @private\n */\nvar NUM_100K_SETS = 6;\n\n/**\n * The column letters (for easting) of the lower left value, per\n * set.\n *\n * {string} @private\n */\nvar SET_ORIGIN_COLUMN_LETTERS = 'AJSAJS';\n\n/**\n * The row letters (for northing) of the lower left value, per\n * set.\n *\n * {string} @private\n */\nvar SET_ORIGIN_ROW_LETTERS = 'AFAFAF';\n\nvar A = 65; // A\nvar I = 73; // I\nvar O = 79; // O\nvar V = 86; // V\nvar Z = 90; // Z\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n forward: forward,\n inverse: inverse,\n toPoint: toPoint\n});\n/**\n * Conversion of lat/lon to MGRS.\n *\n * @param {object} ll Object literal with lat and lon properties on a\n * WGS84 ellipsoid.\n * @param {int} accuracy Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for\n * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5.\n * @return {string} the MGRS string for the given location and accuracy.\n */\nfunction forward(ll, accuracy) {\n accuracy = accuracy || 5; // default accuracy 1m\n return encode(LLtoUTM({\n lat: ll[1],\n lon: ll[0]\n }), accuracy);\n};\n\n/**\n * Conversion of MGRS to lat/lon.\n *\n * @param {string} mgrs MGRS string.\n * @return {array} An array with left (longitude), bottom (latitude), right\n * (longitude) and top (latitude) values in WGS84, representing the\n * bounding box for the provided MGRS reference.\n */\nfunction inverse(mgrs) {\n var bbox = UTMtoLL(decode(mgrs.toUpperCase()));\n if (bbox.lat && bbox.lon) {\n return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];\n }\n return [bbox.left, bbox.bottom, bbox.right, bbox.top];\n};\n\nfunction toPoint(mgrs) {\n var bbox = UTMtoLL(decode(mgrs.toUpperCase()));\n if (bbox.lat && bbox.lon) {\n return [bbox.lon, bbox.lat];\n }\n return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2];\n};\n/**\n * Conversion from degrees to radians.\n *\n * @private\n * @param {number} deg the angle in degrees.\n * @return {number} the angle in radians.\n */\nfunction degToRad(deg) {\n return (deg * (Math.PI / 180.0));\n}\n\n/**\n * Conversion from radians to degrees.\n *\n * @private\n * @param {number} rad the angle in radians.\n * @return {number} the angle in degrees.\n */\nfunction radToDeg(rad) {\n return (180.0 * (rad / Math.PI));\n}\n\n/**\n * Converts a set of Longitude and Latitude co-ordinates to UTM\n * using the WGS84 ellipsoid.\n *\n * @private\n * @param {object} ll Object literal with lat and lon properties\n * representing the WGS84 coordinate to be converted.\n * @return {object} Object literal containing the UTM value with easting,\n * northing, zoneNumber and zoneLetter properties, and an optional\n * accuracy property in digits. Returns null if the conversion failed.\n */\nfunction LLtoUTM(ll) {\n var Lat = ll.lat;\n var Long = ll.lon;\n var a = 6378137.0; //ellip.radius;\n var eccSquared = 0.00669438; //ellip.eccsq;\n var k0 = 0.9996;\n var LongOrigin;\n var eccPrimeSquared;\n var N, T, C, A, M;\n var LatRad = degToRad(Lat);\n var LongRad = degToRad(Long);\n var LongOriginRad;\n var ZoneNumber;\n // (int)\n ZoneNumber = Math.floor((Long + 180) / 6) + 1;\n\n //Make sure the longitude 180.00 is in Zone 60\n if (Long === 180) {\n ZoneNumber = 60;\n }\n\n // Special zone for Norway\n if (Lat >= 56.0 && Lat < 64.0 && Long >= 3.0 && Long < 12.0) {\n ZoneNumber = 32;\n }\n\n // Special zones for Svalbard\n if (Lat >= 72.0 && Lat < 84.0) {\n if (Long >= 0.0 && Long < 9.0) {\n ZoneNumber = 31;\n }\n else if (Long >= 9.0 && Long < 21.0) {\n ZoneNumber = 33;\n }\n else if (Long >= 21.0 && Long < 33.0) {\n ZoneNumber = 35;\n }\n else if (Long >= 33.0 && Long < 42.0) {\n ZoneNumber = 37;\n }\n }\n\n LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3; //+3 puts origin\n // in middle of\n // zone\n LongOriginRad = degToRad(LongOrigin);\n\n eccPrimeSquared = (eccSquared) / (1 - eccSquared);\n\n N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad));\n T = Math.tan(LatRad) * Math.tan(LatRad);\n C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad);\n A = Math.cos(LatRad) * (LongRad - LongOriginRad);\n\n M = a * ((1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256) * LatRad - (3 * eccSquared / 8 + 3 * eccSquared * eccSquared / 32 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(2 * LatRad) + (15 * eccSquared * eccSquared / 256 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(4 * LatRad) - (35 * eccSquared * eccSquared * eccSquared / 3072) * Math.sin(6 * LatRad));\n\n var UTMEasting = (k0 * N * (A + (1 - T + C) * A * A * A / 6.0 + (5 - 18 * T + T * T + 72 * C - 58 * eccPrimeSquared) * A * A * A * A * A / 120.0) + 500000.0);\n\n var UTMNorthing = (k0 * (M + N * Math.tan(LatRad) * (A * A / 2 + (5 - T + 9 * C + 4 * C * C) * A * A * A * A / 24.0 + (61 - 58 * T + T * T + 600 * C - 330 * eccPrimeSquared) * A * A * A * A * A * A / 720.0)));\n if (Lat < 0.0) {\n UTMNorthing += 10000000.0; //10000000 meter offset for\n // southern hemisphere\n }\n\n return {\n northing: Math.round(UTMNorthing),\n easting: Math.round(UTMEasting),\n zoneNumber: ZoneNumber,\n zoneLetter: getLetterDesignator(Lat)\n };\n}\n\n/**\n * Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience\n * class where the Zone can be specified as a single string eg.\"60N\" which\n * is then broken down into the ZoneNumber and ZoneLetter.\n *\n * @private\n * @param {object} utm An object literal with northing, easting, zoneNumber\n * and zoneLetter properties. If an optional accuracy property is\n * provided (in meters), a bounding box will be returned instead of\n * latitude and longitude.\n * @return {object} An object literal containing either lat and lon values\n * (if no accuracy was provided), or top, right, bottom and left values\n * for the bounding box calculated according to the provided accuracy.\n * Returns null if the conversion failed.\n */\nfunction UTMtoLL(utm) {\n\n var UTMNorthing = utm.northing;\n var UTMEasting = utm.easting;\n var zoneLetter = utm.zoneLetter;\n var zoneNumber = utm.zoneNumber;\n // check the ZoneNummber is valid\n if (zoneNumber < 0 || zoneNumber > 60) {\n return null;\n }\n\n var k0 = 0.9996;\n var a = 6378137.0; //ellip.radius;\n var eccSquared = 0.00669438; //ellip.eccsq;\n var eccPrimeSquared;\n var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared));\n var N1, T1, C1, R1, D, M;\n var LongOrigin;\n var mu, phi1Rad;\n\n // remove 500,000 meter offset for longitude\n var x = UTMEasting - 500000.0;\n var y = UTMNorthing;\n\n // We must know somehow if we are in the Northern or Southern\n // hemisphere, this is the only time we use the letter So even\n // if the Zone letter isn't exactly correct it should indicate\n // the hemisphere correctly\n if (zoneLetter < 'N') {\n y -= 10000000.0; // remove 10,000,000 meter offset used\n // for southern hemisphere\n }\n\n // There are 60 zones with zone 1 being at West -180 to -174\n LongOrigin = (zoneNumber - 1) * 6 - 180 + 3; // +3 puts origin\n // in middle of\n // zone\n\n eccPrimeSquared = (eccSquared) / (1 - eccSquared);\n\n M = y / k0;\n mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256));\n\n phi1Rad = mu + (3 * e1 / 2 - 27 * e1 * e1 * e1 / 32) * Math.sin(2 * mu) + (21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32) * Math.sin(4 * mu) + (151 * e1 * e1 * e1 / 96) * Math.sin(6 * mu);\n // double phi1 = ProjMath.radToDeg(phi1Rad);\n\n N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad));\n T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad);\n C1 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad);\n R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5);\n D = x / (N1 * k0);\n\n var lat = phi1Rad - (N1 * Math.tan(phi1Rad) / R1) * (D * D / 2 - (5 + 3 * T1 + 10 * C1 - 4 * C1 * C1 - 9 * eccPrimeSquared) * D * D * D * D / 24 + (61 + 90 * T1 + 298 * C1 + 45 * T1 * T1 - 252 * eccPrimeSquared - 3 * C1 * C1) * D * D * D * D * D * D / 720);\n lat = radToDeg(lat);\n\n var lon = (D - (1 + 2 * T1 + C1) * D * D * D / 6 + (5 - 2 * C1 + 28 * T1 - 3 * C1 * C1 + 8 * eccPrimeSquared + 24 * T1 * T1) * D * D * D * D * D / 120) / Math.cos(phi1Rad);\n lon = LongOrigin + radToDeg(lon);\n\n var result;\n if (utm.accuracy) {\n var topRight = UTMtoLL({\n northing: utm.northing + utm.accuracy,\n easting: utm.easting + utm.accuracy,\n zoneLetter: utm.zoneLetter,\n zoneNumber: utm.zoneNumber\n });\n result = {\n top: topRight.lat,\n right: topRight.lon,\n bottom: lat,\n left: lon\n };\n }\n else {\n result = {\n lat: lat,\n lon: lon\n };\n }\n return result;\n}\n\n/**\n * Calculates the MGRS letter designator for the given latitude.\n *\n * @private\n * @param {number} lat The latitude in WGS84 to get the letter designator\n * for.\n * @return {char} The letter designator.\n */\nfunction getLetterDesignator(lat) {\n //This is here as an error flag to show that the Latitude is\n //outside MGRS limits\n var LetterDesignator = 'Z';\n\n if ((84 >= lat) && (lat >= 72)) {\n LetterDesignator = 'X';\n }\n else if ((72 > lat) && (lat >= 64)) {\n LetterDesignator = 'W';\n }\n else if ((64 > lat) && (lat >= 56)) {\n LetterDesignator = 'V';\n }\n else if ((56 > lat) && (lat >= 48)) {\n LetterDesignator = 'U';\n }\n else if ((48 > lat) && (lat >= 40)) {\n LetterDesignator = 'T';\n }\n else if ((40 > lat) && (lat >= 32)) {\n LetterDesignator = 'S';\n }\n else if ((32 > lat) && (lat >= 24)) {\n LetterDesignator = 'R';\n }\n else if ((24 > lat) && (lat >= 16)) {\n LetterDesignator = 'Q';\n }\n else if ((16 > lat) && (lat >= 8)) {\n LetterDesignator = 'P';\n }\n else if ((8 > lat) && (lat >= 0)) {\n LetterDesignator = 'N';\n }\n else if ((0 > lat) && (lat >= -8)) {\n LetterDesignator = 'M';\n }\n else if ((-8 > lat) && (lat >= -16)) {\n LetterDesignator = 'L';\n }\n else if ((-16 > lat) && (lat >= -24)) {\n LetterDesignator = 'K';\n }\n else if ((-24 > lat) && (lat >= -32)) {\n LetterDesignator = 'J';\n }\n else if ((-32 > lat) && (lat >= -40)) {\n LetterDesignator = 'H';\n }\n else if ((-40 > lat) && (lat >= -48)) {\n LetterDesignator = 'G';\n }\n else if ((-48 > lat) && (lat >= -56)) {\n LetterDesignator = 'F';\n }\n else if ((-56 > lat) && (lat >= -64)) {\n LetterDesignator = 'E';\n }\n else if ((-64 > lat) && (lat >= -72)) {\n LetterDesignator = 'D';\n }\n else if ((-72 > lat) && (lat >= -80)) {\n LetterDesignator = 'C';\n }\n return LetterDesignator;\n}\n\n/**\n * Encodes a UTM location as MGRS string.\n *\n * @private\n * @param {object} utm An object literal with easting, northing,\n * zoneLetter, zoneNumber\n * @param {number} accuracy Accuracy in digits (1-5).\n * @return {string} MGRS string for the given UTM location.\n */\nfunction encode(utm, accuracy) {\n // prepend with leading zeroes\n var seasting = \"00000\" + utm.easting,\n snorthing = \"00000\" + utm.northing;\n\n return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);\n}\n\n/**\n * Get the two letter 100k designator for a given UTM easting,\n * northing and zone number value.\n *\n * @private\n * @param {number} easting\n * @param {number} northing\n * @param {number} zoneNumber\n * @return the two letter 100k designator for the given UTM location.\n */\nfunction get100kID(easting, northing, zoneNumber) {\n var setParm = get100kSetForZone(zoneNumber);\n var setColumn = Math.floor(easting / 100000);\n var setRow = Math.floor(northing / 100000) % 20;\n return getLetter100kID(setColumn, setRow, setParm);\n}\n\n/**\n * Given a UTM zone number, figure out the MGRS 100K set it is in.\n *\n * @private\n * @param {number} i An UTM zone number.\n * @return {number} the 100k set the UTM zone is in.\n */\nfunction get100kSetForZone(i) {\n var setParm = i % NUM_100K_SETS;\n if (setParm === 0) {\n setParm = NUM_100K_SETS;\n }\n\n return setParm;\n}\n\n/**\n * Get the two-letter MGRS 100k designator given information\n * translated from the UTM northing, easting and zone number.\n *\n * @private\n * @param {number} column the column index as it relates to the MGRS\n * 100k set spreadsheet, created from the UTM easting.\n * Values are 1-8.\n * @param {number} row the row index as it relates to the MGRS 100k set\n * spreadsheet, created from the UTM northing value. Values\n * are from 0-19.\n * @param {number} parm the set block, as it relates to the MGRS 100k set\n * spreadsheet, created from the UTM zone. Values are from\n * 1-60.\n * @return two letter MGRS 100k code.\n */\nfunction getLetter100kID(column, row, parm) {\n // colOrigin and rowOrigin are the letters at the origin of the set\n var index = parm - 1;\n var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index);\n var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index);\n\n // colInt and rowInt are the letters to build to return\n var colInt = colOrigin + column - 1;\n var rowInt = rowOrigin + row;\n var rollover = false;\n\n if (colInt > Z) {\n colInt = colInt - Z + A - 1;\n rollover = true;\n }\n\n if (colInt === I || (colOrigin < I && colInt > I) || ((colInt > I || colOrigin < I) && rollover)) {\n colInt++;\n }\n\n if (colInt === O || (colOrigin < O && colInt > O) || ((colInt > O || colOrigin < O) && rollover)) {\n colInt++;\n\n if (colInt === I) {\n colInt++;\n }\n }\n\n if (colInt > Z) {\n colInt = colInt - Z + A - 1;\n }\n\n if (rowInt > V) {\n rowInt = rowInt - V + A - 1;\n rollover = true;\n }\n else {\n rollover = false;\n }\n\n if (((rowInt === I) || ((rowOrigin < I) && (rowInt > I))) || (((rowInt > I) || (rowOrigin < I)) && rollover)) {\n rowInt++;\n }\n\n if (((rowInt === O) || ((rowOrigin < O) && (rowInt > O))) || (((rowInt > O) || (rowOrigin < O)) && rollover)) {\n rowInt++;\n\n if (rowInt === I) {\n rowInt++;\n }\n }\n\n if (rowInt > V) {\n rowInt = rowInt - V + A - 1;\n }\n\n var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt);\n return twoLetter;\n}\n\n/**\n * Decode the UTM parameters from a MGRS string.\n *\n * @private\n * @param {string} mgrsString an UPPERCASE coordinate string is expected.\n * @return {object} An object literal with easting, northing, zoneLetter,\n * zoneNumber and accuracy (in meters) properties.\n */\nfunction decode(mgrsString) {\n\n if (mgrsString && mgrsString.length === 0) {\n throw (\"MGRSPoint coverting from nothing\");\n }\n\n var length = mgrsString.length;\n\n var hunK = null;\n var sb = \"\";\n var testChar;\n var i = 0;\n\n // get Zone number\n while (!(/[A-Z]/).test(testChar = mgrsString.charAt(i))) {\n if (i >= 2) {\n throw (\"MGRSPoint bad conversion from: \" + mgrsString);\n }\n sb += testChar;\n i++;\n }\n\n var zoneNumber = parseInt(sb, 10);\n\n if (i === 0 || i + 3 > length) {\n // A good MGRS string has to be 4-5 digits long,\n // ##AAA/#AAA at least.\n throw (\"MGRSPoint bad conversion from: \" + mgrsString);\n }\n\n var zoneLetter = mgrsString.charAt(i++);\n\n // Should we check the zone letter here? Why not.\n if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') {\n throw (\"MGRSPoint zone letter \" + zoneLetter + \" not handled: \" + mgrsString);\n }\n\n hunK = mgrsString.substring(i, i += 2);\n\n var set = get100kSetForZone(zoneNumber);\n\n var east100k = getEastingFromChar(hunK.charAt(0), set);\n var north100k = getNorthingFromChar(hunK.charAt(1), set);\n\n // We have a bug where the northing may be 2000000 too low.\n // How\n // do we know when to roll over?\n\n while (north100k < getMinNorthing(zoneLetter)) {\n north100k += 2000000;\n }\n\n // calculate the char index for easting/northing separator\n var remainder = length - i;\n\n if (remainder % 2 !== 0) {\n throw (\"MGRSPoint has to have an even number \\nof digits after the zone letter and two 100km letters - front \\nhalf for easting meters, second half for \\nnorthing meters\" + mgrsString);\n }\n\n var sep = remainder / 2;\n\n var sepEasting = 0.0;\n var sepNorthing = 0.0;\n var accuracyBonus, sepEastingString, sepNorthingString, easting, northing;\n if (sep > 0) {\n accuracyBonus = 100000.0 / Math.pow(10, sep);\n sepEastingString = mgrsString.substring(i, i + sep);\n sepEasting = parseFloat(sepEastingString) * accuracyBonus;\n sepNorthingString = mgrsString.substring(i + sep);\n sepNorthing = parseFloat(sepNorthingString) * accuracyBonus;\n }\n\n easting = sepEasting + east100k;\n northing = sepNorthing + north100k;\n\n return {\n easting: easting,\n northing: northing,\n zoneLetter: zoneLetter,\n zoneNumber: zoneNumber,\n accuracy: accuracyBonus\n };\n}\n\n/**\n * Given the first letter from a two-letter MGRS 100k zone, and given the\n * MGRS table set for the zone number, figure out the easting value that\n * should be added to the other, secondary easting value.\n *\n * @private\n * @param {char} e The first letter from a two-letter MGRS 100´k zone.\n * @param {number} set The MGRS table set for the zone number.\n * @return {number} The easting value for the given letter and set.\n */\nfunction getEastingFromChar(e, set) {\n // colOrigin is the letter at the origin of the set for the\n // column\n var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1);\n var eastingValue = 100000.0;\n var rewindMarker = false;\n\n while (curCol !== e.charCodeAt(0)) {\n curCol++;\n if (curCol === I) {\n curCol++;\n }\n if (curCol === O) {\n curCol++;\n }\n if (curCol > Z) {\n if (rewindMarker) {\n throw (\"Bad character: \" + e);\n }\n curCol = A;\n rewindMarker = true;\n }\n eastingValue += 100000.0;\n }\n\n return eastingValue;\n}\n\n/**\n * Given the second letter from a two-letter MGRS 100k zone, and given the\n * MGRS table set for the zone number, figure out the northing value that\n * should be added to the other, secondary northing value. You have to\n * remember that Northings are determined from the equator, and the vertical\n * cycle of letters mean a 2000000 additional northing meters. This happens\n * approx. every 18 degrees of latitude. This method does *NOT* count any\n * additional northings. You have to figure out how many 2000000 meters need\n * to be added for the zone letter of the MGRS coordinate.\n *\n * @private\n * @param {char} n Second letter of the MGRS 100k zone\n * @param {number} set The MGRS table set number, which is dependent on the\n * UTM zone number.\n * @return {number} The northing value for the given letter and set.\n */\nfunction getNorthingFromChar(n, set) {\n\n if (n > 'V') {\n throw (\"MGRSPoint given invalid Northing \" + n);\n }\n\n // rowOrigin is the letter at the origin of the set for the\n // column\n var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set - 1);\n var northingValue = 0.0;\n var rewindMarker = false;\n\n while (curRow !== n.charCodeAt(0)) {\n curRow++;\n if (curRow === I) {\n curRow++;\n }\n if (curRow === O) {\n curRow++;\n }\n // fixing a bug making whole application hang in this loop\n // when 'n' is a wrong character\n if (curRow > V) {\n if (rewindMarker) { // making sure that this loop ends\n throw (\"Bad character: \" + n);\n }\n curRow = A;\n rewindMarker = true;\n }\n northingValue += 100000.0;\n }\n\n return northingValue;\n}\n\n/**\n * The function getMinNorthing returns the minimum northing value of a MGRS\n * zone.\n *\n * Ported from Geotrans' c Lattitude_Band_Value structure table.\n *\n * @private\n * @param {char} zoneLetter The MGRS zone to get the min northing for.\n * @return {number}\n */\nfunction getMinNorthing(zoneLetter) {\n var northing;\n switch (zoneLetter) {\n case 'C':\n northing = 1100000.0;\n break;\n case 'D':\n northing = 2000000.0;\n break;\n case 'E':\n northing = 2800000.0;\n break;\n case 'F':\n northing = 3700000.0;\n break;\n case 'G':\n northing = 4600000.0;\n break;\n case 'H':\n northing = 5500000.0;\n break;\n case 'J':\n northing = 6400000.0;\n break;\n case 'K':\n northing = 7300000.0;\n break;\n case 'L':\n northing = 8200000.0;\n break;\n case 'M':\n northing = 9100000.0;\n break;\n case 'N':\n northing = 0.0;\n break;\n case 'P':\n northing = 800000.0;\n break;\n case 'Q':\n northing = 1700000.0;\n break;\n case 'R':\n northing = 2600000.0;\n break;\n case 'S':\n northing = 3500000.0;\n break;\n case 'T':\n northing = 4400000.0;\n break;\n case 'U':\n northing = 5300000.0;\n break;\n case 'V':\n northing = 6200000.0;\n break;\n case 'W':\n northing = 7000000.0;\n break;\n case 'X':\n northing = 7900000.0;\n break;\n default:\n northing = -1.0;\n }\n if (northing >= 0.0) {\n return northing;\n }\n else {\n throw (\"Invalid zone letter: \" + zoneLetter);\n }\n\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/mgrs/mgrs.js?"); - -/***/ }), - -/***/ "./node_modules/path-browserify/index.js": -/*!***********************************************!*\ - !*** ./node_modules/path-browserify/index.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n if (typeof path !== 'string') path = path + '';\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) {\n // return '//';\n // Backwards-compat fix:\n return '/';\n }\n return path.slice(0, end);\n};\n\nfunction basename(path) {\n if (typeof path !== 'string') path = path + '';\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n var f = basename(path);\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\nexports.extname = function (path) {\n if (typeof path !== 'string') path = path + '';\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://LithoSphere/./node_modules/path-browserify/index.js?"); - -/***/ }), - -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/process/browser.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/Point.js": -/*!*****************************************!*\ - !*** ./node_modules/proj4/lib/Point.js ***! - \*****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var mgrs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mgrs */ \"./node_modules/mgrs/mgrs.js\");\n\n\nfunction Point(x, y, z) {\n if (!(this instanceof Point)) {\n return new Point(x, y, z);\n }\n if (Array.isArray(x)) {\n this.x = x[0];\n this.y = x[1];\n this.z = x[2] || 0.0;\n } else if(typeof x === 'object') {\n this.x = x.x;\n this.y = x.y;\n this.z = x.z || 0.0;\n } else if (typeof x === 'string' && typeof y === 'undefined') {\n var coords = x.split(',');\n this.x = parseFloat(coords[0], 10);\n this.y = parseFloat(coords[1], 10);\n this.z = parseFloat(coords[2], 10) || 0.0;\n } else {\n this.x = x;\n this.y = y;\n this.z = z || 0.0;\n }\n console.warn('proj4.Point will be removed in version 3, use proj4.toPoint');\n}\n\nPoint.fromMGRS = function(mgrsStr) {\n return new Point(Object(mgrs__WEBPACK_IMPORTED_MODULE_0__[\"toPoint\"])(mgrsStr));\n};\nPoint.prototype.toMGRS = function(accuracy) {\n return Object(mgrs__WEBPACK_IMPORTED_MODULE_0__[\"forward\"])([this.x, this.y], accuracy);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Point);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/Point.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/Proj.js": -/*!****************************************!*\ - !*** ./node_modules/proj4/lib/Proj.js ***! - \****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parseCode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parseCode */ \"./node_modules/proj4/lib/parseCode.js\");\n/* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extend */ \"./node_modules/proj4/lib/extend.js\");\n/* harmony import */ var _projections__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./projections */ \"./node_modules/proj4/lib/projections.js\");\n/* harmony import */ var _deriveConstants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./deriveConstants */ \"./node_modules/proj4/lib/deriveConstants.js\");\n/* harmony import */ var _constants_Datum__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants/Datum */ \"./node_modules/proj4/lib/constants/Datum.js\");\n/* harmony import */ var _datum__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./datum */ \"./node_modules/proj4/lib/datum.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n/* harmony import */ var _nadgrid__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./nadgrid */ \"./node_modules/proj4/lib/nadgrid.js\");\n\n\n\n\n\n\n\n\n\nfunction Projection(srsCode,callback) {\n if (!(this instanceof Projection)) {\n return new Projection(srsCode);\n }\n callback = callback || function(error){\n if(error){\n throw error;\n }\n };\n var json = Object(_parseCode__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(srsCode);\n if(typeof json !== 'object'){\n callback(srsCode);\n return;\n }\n var ourProj = Projection.projections.get(json.projName);\n if(!ourProj){\n callback(srsCode);\n return;\n }\n if (json.datumCode && json.datumCode !== 'none') {\n var datumDef = Object(_match__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(_constants_Datum__WEBPACK_IMPORTED_MODULE_4__[\"default\"], json.datumCode);\n if (datumDef) {\n json.datum_params = datumDef.towgs84 ? datumDef.towgs84.split(',') : null;\n json.ellps = datumDef.ellipse;\n json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;\n }\n }\n json.k0 = json.k0 || 1.0;\n json.axis = json.axis || 'enu';\n json.ellps = json.ellps || 'wgs84';\n var sphere_ = Object(_deriveConstants__WEBPACK_IMPORTED_MODULE_3__[\"sphere\"])(json.a, json.b, json.rf, json.ellps, json.sphere);\n var ecc = Object(_deriveConstants__WEBPACK_IMPORTED_MODULE_3__[\"eccentricity\"])(sphere_.a, sphere_.b, sphere_.rf, json.R_A);\n var nadgrids = Object(_nadgrid__WEBPACK_IMPORTED_MODULE_7__[\"getNadgrids\"])(json.nadgrids);\n var datumObj = json.datum || Object(_datum__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2,\n nadgrids);\n\n Object(_extend__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this, json); // transfer everything over from the projection because we don't know what we'll need\n Object(_extend__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this, ourProj); // transfer all the methods from the projection\n\n // copy the 4 things over we calulated in deriveConstants.sphere\n this.a = sphere_.a;\n this.b = sphere_.b;\n this.rf = sphere_.rf;\n this.sphere = sphere_.sphere;\n\n // copy the 3 things we calculated in deriveConstants.eccentricity\n this.es = ecc.es;\n this.e = ecc.e;\n this.ep2 = ecc.ep2;\n\n // add in the datum object\n this.datum = datumObj;\n\n // init the projection\n this.init();\n\n // legecy callback from back in the day when it went to spatialreference.org\n callback(null, this);\n\n}\nProjection.projections = _projections__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\nProjection.projections.start();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Projection);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/Proj.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/adjust_axis.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/adjust_axis.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(crs, denorm, point) {\n var xin = point.x,\n yin = point.y,\n zin = point.z || 0.0;\n var v, t, i;\n var out = {};\n for (i = 0; i < 3; i++) {\n if (denorm && i === 2 && point.z === undefined) {\n continue;\n }\n if (i === 0) {\n v = xin;\n if (\"ew\".indexOf(crs.axis[i]) !== -1) {\n t = 'x';\n } else {\n t = 'y';\n }\n\n }\n else if (i === 1) {\n v = yin;\n if (\"ns\".indexOf(crs.axis[i]) !== -1) {\n t = 'y';\n } else {\n t = 'x';\n }\n }\n else {\n v = zin;\n t = 'z';\n }\n switch (crs.axis[i]) {\n case 'e':\n out[t] = v;\n break;\n case 'w':\n out[t] = -v;\n break;\n case 'n':\n out[t] = v;\n break;\n case 's':\n out[t] = -v;\n break;\n case 'u':\n if (point[t] !== undefined) {\n out.z = v;\n }\n break;\n case 'd':\n if (point[t] !== undefined) {\n out.z = -v;\n }\n break;\n default:\n //console.log(\"ERROR: unknow axis (\"+crs.axis[i]+\") - check definition of \"+crs.projName);\n return null;\n }\n }\n return out;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/adjust_axis.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/checkSanity.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/checkSanity.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (point) {\n checkCoord(point.x);\n checkCoord(point.y);\n});\nfunction checkCoord(num) {\n if (typeof Number.isFinite === 'function') {\n if (Number.isFinite(num)) {\n return;\n }\n throw new TypeError('coordinates must be finite numbers');\n }\n if (typeof num !== 'number' || num !== num || !isFinite(num)) {\n throw new TypeError('coordinates must be finite numbers');\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/checkSanity.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/adjust_lat.js": -/*!*****************************************************!*\ - !*** ./node_modules/proj4/lib/common/adjust_lat.js ***! - \*****************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _sign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sign */ \"./node_modules/proj4/lib/common/sign.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (Math.abs(x) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) ? x : (x - (Object(_sign__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(x) * Math.PI));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/adjust_lat.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/adjust_lon.js": -/*!*****************************************************!*\ - !*** ./node_modules/proj4/lib/common/adjust_lon.js ***! - \*****************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _sign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sign */ \"./node_modules/proj4/lib/common/sign.js\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (Math.abs(x) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) ? x : (x - (Object(_sign__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(x) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"]));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/adjust_lon.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/adjust_zone.js": -/*!******************************************************!*\ - !*** ./node_modules/proj4/lib/common/adjust_zone.js ***! - \******************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(zone, lon) {\n if (zone === undefined) {\n zone = Math.floor((Object(_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon) + Math.PI) * 30 / Math.PI) + 1;\n\n if (zone < 0) {\n return 0;\n } else if (zone > 60) {\n return 60;\n }\n }\n return zone;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/adjust_zone.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/asinhy.js": -/*!*************************************************!*\ - !*** ./node_modules/proj4/lib/common/asinhy.js ***! - \*************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _hypot__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hypot */ \"./node_modules/proj4/lib/common/hypot.js\");\n/* harmony import */ var _log1py__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./log1py */ \"./node_modules/proj4/lib/common/log1py.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var y = Math.abs(x);\n y = Object(_log1py__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(y * (1 + y / (Object(_hypot__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(1, y) + 1)));\n\n return x < 0 ? -y : y;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/asinhy.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/asinz.js": -/*!************************************************!*\ - !*** ./node_modules/proj4/lib/common/asinz.js ***! - \************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n if (Math.abs(x) > 1) {\n x = (x > 1) ? 1 : -1;\n }\n return Math.asin(x);\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/asinz.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/clens.js": -/*!************************************************!*\ - !*** ./node_modules/proj4/lib/common/clens.js ***! - \************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(pp, arg_r) {\n var r = 2 * Math.cos(arg_r);\n var i = pp.length - 1;\n var hr1 = pp[i];\n var hr2 = 0;\n var hr;\n\n while (--i >= 0) {\n hr = -hr2 + r * hr1 + pp[i];\n hr2 = hr1;\n hr1 = hr;\n }\n\n return Math.sin(arg_r) * hr;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/clens.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/clens_cmplx.js": -/*!******************************************************!*\ - !*** ./node_modules/proj4/lib/common/clens_cmplx.js ***! - \******************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _sinh__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sinh */ \"./node_modules/proj4/lib/common/sinh.js\");\n/* harmony import */ var _cosh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cosh */ \"./node_modules/proj4/lib/common/cosh.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(pp, arg_r, arg_i) {\n var sin_arg_r = Math.sin(arg_r);\n var cos_arg_r = Math.cos(arg_r);\n var sinh_arg_i = Object(_sinh__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arg_i);\n var cosh_arg_i = Object(_cosh__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arg_i);\n var r = 2 * cos_arg_r * cosh_arg_i;\n var i = -2 * sin_arg_r * sinh_arg_i;\n var j = pp.length - 1;\n var hr = pp[j];\n var hi1 = 0;\n var hr1 = 0;\n var hi = 0;\n var hr2;\n var hi2;\n\n while (--j >= 0) {\n hr2 = hr1;\n hi2 = hi1;\n hr1 = hr;\n hi1 = hi;\n hr = -hr2 + r * hr1 - i * hi1 + pp[j];\n hi = -hi2 + i * hr1 + r * hi1;\n }\n\n r = sin_arg_r * cosh_arg_i;\n i = cos_arg_r * sinh_arg_i;\n\n return [r * hr - i * hi, r * hi + i * hr];\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/clens_cmplx.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/cosh.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/common/cosh.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var r = Math.exp(x);\n r = (r + 1 / r) / 2;\n return r;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/cosh.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/e0fn.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/common/e0fn.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x)));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e0fn.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/e1fn.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/common/e1fn.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x)));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e1fn.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/e2fn.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/common/e2fn.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (0.05859375 * x * x * (1 + 0.75 * x));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e2fn.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/e3fn.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/common/e3fn.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (x * x * x * (35 / 3072));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e3fn.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/gN.js": -/*!*********************************************!*\ - !*** ./node_modules/proj4/lib/common/gN.js ***! - \*********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, e, sinphi) {\n var temp = e * sinphi;\n return a / Math.sqrt(1 - temp * temp);\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/gN.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/gatg.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/common/gatg.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(pp, B) {\n var cos_2B = 2 * Math.cos(2 * B);\n var i = pp.length - 1;\n var h1 = pp[i];\n var h2 = 0;\n var h;\n\n while (--i >= 0) {\n h = -h2 + cos_2B * h1 + pp[i];\n h2 = h1;\n h1 = h;\n }\n\n return (B + h * Math.sin(2 * B));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/gatg.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/hypot.js": -/*!************************************************!*\ - !*** ./node_modules/proj4/lib/common/hypot.js ***! - \************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x, y) {\n x = Math.abs(x);\n y = Math.abs(y);\n var a = Math.max(x, y);\n var b = Math.min(x, y) / (a ? a : 1);\n\n return a * Math.sqrt(1 + Math.pow(b, 2));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/hypot.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/imlfn.js": -/*!************************************************!*\ - !*** ./node_modules/proj4/lib/common/imlfn.js ***! - \************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(ml, e0, e1, e2, e3) {\n var phi;\n var dphi;\n\n phi = ml / e0;\n for (var i = 0; i < 15; i++) {\n dphi = (ml - (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi))) / (e0 - 2 * e1 * Math.cos(2 * phi) + 4 * e2 * Math.cos(4 * phi) - 6 * e3 * Math.cos(6 * phi));\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n\n //..reportError(\"IMLFN-CONV:Latitude failed to converge after 15 iterations\");\n return NaN;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/imlfn.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/iqsfnz.js": -/*!*************************************************!*\ - !*** ./node_modules/proj4/lib/common/iqsfnz.js ***! - \*************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, q) {\n var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent));\n if (Math.abs(Math.abs(q) - temp) < 1.0E-6) {\n if (q < 0) {\n return (-1 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n else {\n return _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n }\n }\n //var phi = 0.5* q/(1-eccent*eccent);\n var phi = Math.asin(0.5 * q);\n var dphi;\n var sin_phi;\n var cos_phi;\n var con;\n for (var i = 0; i < 30; i++) {\n sin_phi = Math.sin(phi);\n cos_phi = Math.cos(phi);\n con = eccent * sin_phi;\n dphi = Math.pow(1 - con * con, 2) / (2 * cos_phi) * (q / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math.log((1 - con) / (1 + con)));\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n\n //console.log(\"IQSFN-CONV:Latitude failed to converge after 30 iterations\");\n return NaN;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/iqsfnz.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/log1py.js": -/*!*************************************************!*\ - !*** ./node_modules/proj4/lib/common/log1py.js ***! - \*************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var y = 1 + x;\n var z = y - 1;\n\n return z === 0 ? x : x * Math.log(y) / z;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/log1py.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/mlfn.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/common/mlfn.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(e0, e1, e2, e3, phi) {\n return (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/mlfn.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/msfnz.js": -/*!************************************************!*\ - !*** ./node_modules/proj4/lib/common/msfnz.js ***! - \************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, sinphi, cosphi) {\n var con = eccent * sinphi;\n return cosphi / (Math.sqrt(1 - con * con));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/msfnz.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/phi2z.js": -/*!************************************************!*\ - !*** ./node_modules/proj4/lib/common/phi2z.js ***! - \************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, ts) {\n var eccnth = 0.5 * eccent;\n var con, dphi;\n var phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - 2 * Math.atan(ts);\n for (var i = 0; i <= 15; i++) {\n con = eccent * Math.sin(phi);\n dphi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - 2 * Math.atan(ts * (Math.pow(((1 - con) / (1 + con)), eccnth))) - phi;\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n //console.log(\"phi2z has NoConvergence\");\n return -9999;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/phi2z.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/pj_enfn.js": -/*!**************************************************!*\ - !*** ./node_modules/proj4/lib/common/pj_enfn.js ***! - \**************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar C00 = 1;\nvar C02 = 0.25;\nvar C04 = 0.046875;\nvar C06 = 0.01953125;\nvar C08 = 0.01068115234375;\nvar C22 = 0.75;\nvar C44 = 0.46875;\nvar C46 = 0.01302083333333333333;\nvar C48 = 0.00712076822916666666;\nvar C66 = 0.36458333333333333333;\nvar C68 = 0.00569661458333333333;\nvar C88 = 0.3076171875;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(es) {\n var en = [];\n en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));\n en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));\n var t = es * es;\n en[2] = t * (C44 - es * (C46 + es * C48));\n t *= es;\n en[3] = t * (C66 - es * C68);\n en[4] = t * es * C88;\n return en;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/pj_enfn.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/pj_inv_mlfn.js": -/*!******************************************************!*\ - !*** ./node_modules/proj4/lib/common/pj_inv_mlfn.js ***! - \******************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _pj_mlfn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pj_mlfn */ \"./node_modules/proj4/lib/common/pj_mlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\nvar MAX_ITER = 20;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(arg, es, en) {\n var k = 1 / (1 - es);\n var phi = arg;\n for (var i = MAX_ITER; i; --i) { /* rarely goes over 2 iterations */\n var s = Math.sin(phi);\n var t = 1 - es * s * s;\n //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg;\n //phi -= t * (t * Math.sqrt(t)) * k;\n t = (Object(_pj_mlfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;\n phi -= t;\n if (Math.abs(t) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n return phi;\n }\n }\n //..reportError(\"cass:pj_inv_mlfn: Convergence error\");\n return phi;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/pj_inv_mlfn.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/pj_mlfn.js": -/*!**************************************************!*\ - !*** ./node_modules/proj4/lib/common/pj_mlfn.js ***! - \**************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(phi, sphi, cphi, en) {\n cphi *= sphi;\n sphi *= sphi;\n return (en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4]))));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/pj_mlfn.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/qsfnz.js": -/*!************************************************!*\ - !*** ./node_modules/proj4/lib/common/qsfnz.js ***! - \************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, sinphi) {\n var con;\n if (eccent > 1.0e-7) {\n con = eccent * sinphi;\n return ((1 - eccent * eccent) * (sinphi / (1 - con * con) - (0.5 / eccent) * Math.log((1 - con) / (1 + con))));\n }\n else {\n return (2 * sinphi);\n }\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/qsfnz.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/sign.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/common/sign.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return x<0 ? -1 : 1;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/sign.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/sinh.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/common/sinh.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var r = Math.exp(x);\n r = (r - 1 / r) / 2;\n return r;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/sinh.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/srat.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/common/srat.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(esinp, exp) {\n return (Math.pow((1 - esinp) / (1 + esinp), exp));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/srat.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/toPoint.js": -/*!**************************************************!*\ - !*** ./node_modules/proj4/lib/common/toPoint.js ***! - \**************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (array){\n var out = {\n x: array[0],\n y: array[1]\n };\n if (array.length>2) {\n out.z = array[2];\n }\n if (array.length>3) {\n out.m = array[3];\n }\n return out;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/toPoint.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/common/tsfnz.js": -/*!************************************************!*\ - !*** ./node_modules/proj4/lib/common/tsfnz.js ***! - \************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, phi, sinphi) {\n var con = eccent * sinphi;\n var com = 0.5 * eccent;\n con = Math.pow(((1 - con) / (1 + con)), com);\n return (Math.tan(0.5 * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - phi)) / con);\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/tsfnz.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/constants/Datum.js": -/*!***************************************************!*\ - !*** ./node_modules/proj4/lib/constants/Datum.js ***! - \***************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return exports; });\nvar exports = {};\n\nexports.wgs84 = {\n towgs84: \"0,0,0\",\n ellipse: \"WGS84\",\n datumName: \"WGS84\"\n};\n\nexports.ch1903 = {\n towgs84: \"674.374,15.056,405.346\",\n ellipse: \"bessel\",\n datumName: \"swiss\"\n};\n\nexports.ggrs87 = {\n towgs84: \"-199.87,74.79,246.62\",\n ellipse: \"GRS80\",\n datumName: \"Greek_Geodetic_Reference_System_1987\"\n};\n\nexports.nad83 = {\n towgs84: \"0,0,0\",\n ellipse: \"GRS80\",\n datumName: \"North_American_Datum_1983\"\n};\n\nexports.nad27 = {\n nadgrids: \"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",\n ellipse: \"clrk66\",\n datumName: \"North_American_Datum_1927\"\n};\n\nexports.potsdam = {\n towgs84: \"606.0,23.0,413.0\",\n ellipse: \"bessel\",\n datumName: \"Potsdam Rauenberg 1950 DHDN\"\n};\n\nexports.carthage = {\n towgs84: \"-263.0,6.0,431.0\",\n ellipse: \"clark80\",\n datumName: \"Carthage 1934 Tunisia\"\n};\n\nexports.hermannskogel = {\n towgs84: \"653.0,-212.0,449.0\",\n ellipse: \"bessel\",\n datumName: \"Hermannskogel\"\n};\n\nexports.osni52 = {\n towgs84: \"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",\n ellipse: \"airy\",\n datumName: \"Irish National\"\n};\n\nexports.ire65 = {\n towgs84: \"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",\n ellipse: \"mod_airy\",\n datumName: \"Ireland 1965\"\n};\n\nexports.rassadiran = {\n towgs84: \"-133.63,-157.5,-158.62\",\n ellipse: \"intl\",\n datumName: \"Rassadiran\"\n};\n\nexports.nzgd49 = {\n towgs84: \"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",\n ellipse: \"intl\",\n datumName: \"New Zealand Geodetic Datum 1949\"\n};\n\nexports.osgb36 = {\n towgs84: \"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",\n ellipse: \"airy\",\n datumName: \"Airy 1830\"\n};\n\nexports.s_jtsk = {\n towgs84: \"589,76,480\",\n ellipse: 'bessel',\n datumName: 'S-JTSK (Ferro)'\n};\n\nexports.beduaram = {\n towgs84: '-106,-87,188',\n ellipse: 'clrk80',\n datumName: 'Beduaram'\n};\n\nexports.gunung_segara = {\n towgs84: '-403,684,41',\n ellipse: 'bessel',\n datumName: 'Gunung Segara Jakarta'\n};\n\nexports.rnb72 = {\n towgs84: \"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",\n ellipse: \"intl\",\n datumName: \"Reseau National Belge 1972\"\n};\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/Datum.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/constants/Ellipsoid.js": -/*!*******************************************************!*\ - !*** ./node_modules/proj4/lib/constants/Ellipsoid.js ***! - \*******************************************************/ -/*! exports provided: default, WGS84 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return exports; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WGS84\", function() { return WGS84; });\nvar exports = {};\n\nexports.MERIT = {\n a: 6378137.0,\n rf: 298.257,\n ellipseName: \"MERIT 1983\"\n};\n\nexports.SGS85 = {\n a: 6378136.0,\n rf: 298.257,\n ellipseName: \"Soviet Geodetic System 85\"\n};\n\nexports.GRS80 = {\n a: 6378137.0,\n rf: 298.257222101,\n ellipseName: \"GRS 1980(IUGG, 1980)\"\n};\n\nexports.IAU76 = {\n a: 6378140.0,\n rf: 298.257,\n ellipseName: \"IAU 1976\"\n};\n\nexports.airy = {\n a: 6377563.396,\n b: 6356256.910,\n ellipseName: \"Airy 1830\"\n};\n\nexports.APL4 = {\n a: 6378137,\n rf: 298.25,\n ellipseName: \"Appl. Physics. 1965\"\n};\n\nexports.NWL9D = {\n a: 6378145.0,\n rf: 298.25,\n ellipseName: \"Naval Weapons Lab., 1965\"\n};\n\nexports.mod_airy = {\n a: 6377340.189,\n b: 6356034.446,\n ellipseName: \"Modified Airy\"\n};\n\nexports.andrae = {\n a: 6377104.43,\n rf: 300.0,\n ellipseName: \"Andrae 1876 (Den., Iclnd.)\"\n};\n\nexports.aust_SA = {\n a: 6378160.0,\n rf: 298.25,\n ellipseName: \"Australian Natl & S. Amer. 1969\"\n};\n\nexports.GRS67 = {\n a: 6378160.0,\n rf: 298.2471674270,\n ellipseName: \"GRS 67(IUGG 1967)\"\n};\n\nexports.bessel = {\n a: 6377397.155,\n rf: 299.1528128,\n ellipseName: \"Bessel 1841\"\n};\n\nexports.bess_nam = {\n a: 6377483.865,\n rf: 299.1528128,\n ellipseName: \"Bessel 1841 (Namibia)\"\n};\n\nexports.clrk66 = {\n a: 6378206.4,\n b: 6356583.8,\n ellipseName: \"Clarke 1866\"\n};\n\nexports.clrk80 = {\n a: 6378249.145,\n rf: 293.4663,\n ellipseName: \"Clarke 1880 mod.\"\n};\n\nexports.clrk58 = {\n a: 6378293.645208759,\n rf: 294.2606763692654,\n ellipseName: \"Clarke 1858\"\n};\n\nexports.CPM = {\n a: 6375738.7,\n rf: 334.29,\n ellipseName: \"Comm. des Poids et Mesures 1799\"\n};\n\nexports.delmbr = {\n a: 6376428.0,\n rf: 311.5,\n ellipseName: \"Delambre 1810 (Belgium)\"\n};\n\nexports.engelis = {\n a: 6378136.05,\n rf: 298.2566,\n ellipseName: \"Engelis 1985\"\n};\n\nexports.evrst30 = {\n a: 6377276.345,\n rf: 300.8017,\n ellipseName: \"Everest 1830\"\n};\n\nexports.evrst48 = {\n a: 6377304.063,\n rf: 300.8017,\n ellipseName: \"Everest 1948\"\n};\n\nexports.evrst56 = {\n a: 6377301.243,\n rf: 300.8017,\n ellipseName: \"Everest 1956\"\n};\n\nexports.evrst69 = {\n a: 6377295.664,\n rf: 300.8017,\n ellipseName: \"Everest 1969\"\n};\n\nexports.evrstSS = {\n a: 6377298.556,\n rf: 300.8017,\n ellipseName: \"Everest (Sabah & Sarawak)\"\n};\n\nexports.fschr60 = {\n a: 6378166.0,\n rf: 298.3,\n ellipseName: \"Fischer (Mercury Datum) 1960\"\n};\n\nexports.fschr60m = {\n a: 6378155.0,\n rf: 298.3,\n ellipseName: \"Fischer 1960\"\n};\n\nexports.fschr68 = {\n a: 6378150.0,\n rf: 298.3,\n ellipseName: \"Fischer 1968\"\n};\n\nexports.helmert = {\n a: 6378200.0,\n rf: 298.3,\n ellipseName: \"Helmert 1906\"\n};\n\nexports.hough = {\n a: 6378270.0,\n rf: 297.0,\n ellipseName: \"Hough\"\n};\n\nexports.intl = {\n a: 6378388.0,\n rf: 297.0,\n ellipseName: \"International 1909 (Hayford)\"\n};\n\nexports.kaula = {\n a: 6378163.0,\n rf: 298.24,\n ellipseName: \"Kaula 1961\"\n};\n\nexports.lerch = {\n a: 6378139.0,\n rf: 298.257,\n ellipseName: \"Lerch 1979\"\n};\n\nexports.mprts = {\n a: 6397300.0,\n rf: 191.0,\n ellipseName: \"Maupertius 1738\"\n};\n\nexports.new_intl = {\n a: 6378157.5,\n b: 6356772.2,\n ellipseName: \"New International 1967\"\n};\n\nexports.plessis = {\n a: 6376523.0,\n rf: 6355863.0,\n ellipseName: \"Plessis 1817 (France)\"\n};\n\nexports.krass = {\n a: 6378245.0,\n rf: 298.3,\n ellipseName: \"Krassovsky, 1942\"\n};\n\nexports.SEasia = {\n a: 6378155.0,\n b: 6356773.3205,\n ellipseName: \"Southeast Asia\"\n};\n\nexports.walbeck = {\n a: 6376896.0,\n b: 6355834.8467,\n ellipseName: \"Walbeck\"\n};\n\nexports.WGS60 = {\n a: 6378165.0,\n rf: 298.3,\n ellipseName: \"WGS 60\"\n};\n\nexports.WGS66 = {\n a: 6378145.0,\n rf: 298.25,\n ellipseName: \"WGS 66\"\n};\n\nexports.WGS7 = {\n a: 6378135.0,\n rf: 298.26,\n ellipseName: \"WGS 72\"\n};\n\nvar WGS84 = exports.WGS84 = {\n a: 6378137.0,\n rf: 298.257223563,\n ellipseName: \"WGS 84\"\n};\n\nexports.sphere = {\n a: 6370997.0,\n b: 6370997.0,\n ellipseName: \"Normal Sphere (r=6370997)\"\n};\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/Ellipsoid.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/constants/PrimeMeridian.js": -/*!***********************************************************!*\ - !*** ./node_modules/proj4/lib/constants/PrimeMeridian.js ***! - \***********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return exports; });\nvar exports = {};\n\n\nexports.greenwich = 0.0; //\"0dE\",\nexports.lisbon = -9.131906111111; //\"9d07'54.862\\\"W\",\nexports.paris = 2.337229166667; //\"2d20'14.025\\\"E\",\nexports.bogota = -74.080916666667; //\"74d04'51.3\\\"W\",\nexports.madrid = -3.687938888889; //\"3d41'16.58\\\"W\",\nexports.rome = 12.452333333333; //\"12d27'8.4\\\"E\",\nexports.bern = 7.439583333333; //\"7d26'22.5\\\"E\",\nexports.jakarta = 106.807719444444; //\"106d48'27.79\\\"E\",\nexports.ferro = -17.666666666667; //\"17d40'W\",\nexports.brussels = 4.367975; //\"4d22'4.71\\\"E\",\nexports.stockholm = 18.058277777778; //\"18d3'29.8\\\"E\",\nexports.athens = 23.7163375; //\"23d42'58.815\\\"E\",\nexports.oslo = 10.722916666667; //\"10d43'22.5\\\"E\"\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/PrimeMeridian.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/constants/units.js": -/*!***************************************************!*\ - !*** ./node_modules/proj4/lib/constants/units.js ***! - \***************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ft: {to_meter: 0.3048},\n 'us-ft': {to_meter: 1200 / 3937}\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/units.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/constants/values.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/constants/values.js ***! - \****************************************************/ -/*! exports provided: PJD_3PARAM, PJD_7PARAM, PJD_GRIDSHIFT, PJD_WGS84, PJD_NODATUM, SRS_WGS84_SEMIMAJOR, SRS_WGS84_SEMIMINOR, SRS_WGS84_ESQUARED, SEC_TO_RAD, HALF_PI, SIXTH, RA4, RA6, EPSLN, D2R, R2D, FORTPI, TWO_PI, SPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_3PARAM\", function() { return PJD_3PARAM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_7PARAM\", function() { return PJD_7PARAM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_GRIDSHIFT\", function() { return PJD_GRIDSHIFT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_WGS84\", function() { return PJD_WGS84; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_NODATUM\", function() { return PJD_NODATUM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SRS_WGS84_SEMIMAJOR\", function() { return SRS_WGS84_SEMIMAJOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SRS_WGS84_SEMIMINOR\", function() { return SRS_WGS84_SEMIMINOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SRS_WGS84_ESQUARED\", function() { return SRS_WGS84_ESQUARED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SEC_TO_RAD\", function() { return SEC_TO_RAD; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HALF_PI\", function() { return HALF_PI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SIXTH\", function() { return SIXTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RA4\", function() { return RA4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RA6\", function() { return RA6; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EPSLN\", function() { return EPSLN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"D2R\", function() { return D2R; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"R2D\", function() { return R2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FORTPI\", function() { return FORTPI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TWO_PI\", function() { return TWO_PI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SPI\", function() { return SPI; });\nvar PJD_3PARAM = 1;\nvar PJD_7PARAM = 2;\nvar PJD_GRIDSHIFT = 3;\nvar PJD_WGS84 = 4; // WGS84 or equivalent\nvar PJD_NODATUM = 5; // WGS84 or equivalent\nvar SRS_WGS84_SEMIMAJOR = 6378137.0; // only used in grid shift transforms\nvar SRS_WGS84_SEMIMINOR = 6356752.314; // only used in grid shift transforms\nvar SRS_WGS84_ESQUARED = 0.0066943799901413165; // only used in grid shift transforms\nvar SEC_TO_RAD = 4.84813681109535993589914102357e-6;\nvar HALF_PI = Math.PI/2;\n// ellipoid pj_set_ell.c\nvar SIXTH = 0.1666666666666666667;\n/* 1/6 */\nvar RA4 = 0.04722222222222222222;\n/* 17/360 */\nvar RA6 = 0.02215608465608465608;\nvar EPSLN = 1.0e-10;\n// you'd think you could use Number.EPSILON above but that makes\n// Mollweide get into an infinate loop.\n\nvar D2R = 0.01745329251994329577;\nvar R2D = 57.29577951308232088;\nvar FORTPI = Math.PI/4;\nvar TWO_PI = Math.PI * 2;\n// SPI is slightly greater than Math.PI, so values that exceed the -180..180\n// degree range by a tiny amount don't get wrapped. This prevents points that\n// have drifted from their original location along the 180th meridian (due to\n// floating point error) from changing their sign.\nvar SPI = 3.14159265359;\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/values.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/core.js": -/*!****************************************!*\ - !*** ./node_modules/proj4/lib/core.js ***! - \****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Proj__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Proj */ \"./node_modules/proj4/lib/Proj.js\");\n/* harmony import */ var _transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transform */ \"./node_modules/proj4/lib/transform.js\");\n\n\nvar wgs84 = Object(_Proj__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('WGS84');\n\nfunction transformer(from, to, coords) {\n var transformedArray, out, keys;\n if (Array.isArray(coords)) {\n transformedArray = Object(_transform__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(from, to, coords) || {x: NaN, y: NaN};\n if (coords.length > 2) {\n if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) {\n if (typeof transformedArray.z === 'number') {\n return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3));\n } else {\n return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3));\n }\n } else {\n return [transformedArray.x, transformedArray.y].concat(coords.splice(2));\n }\n } else {\n return [transformedArray.x, transformedArray.y];\n }\n } else {\n out = Object(_transform__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(from, to, coords);\n keys = Object.keys(coords);\n if (keys.length === 2) {\n return out;\n }\n keys.forEach(function (key) {\n if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) {\n if (key === 'x' || key === 'y' || key === 'z') {\n return;\n }\n } else {\n if (key === 'x' || key === 'y') {\n return;\n }\n }\n out[key] = coords[key];\n });\n return out;\n }\n}\n\nfunction checkProj(item) {\n if (item instanceof _Proj__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n return item;\n }\n if (item.oProj) {\n return item.oProj;\n }\n return Object(_Proj__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(item);\n}\n\nfunction proj4(fromProj, toProj, coord) {\n fromProj = checkProj(fromProj);\n var single = false;\n var obj;\n if (typeof toProj === 'undefined') {\n toProj = fromProj;\n fromProj = wgs84;\n single = true;\n } else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) {\n coord = toProj;\n toProj = fromProj;\n fromProj = wgs84;\n single = true;\n }\n toProj = checkProj(toProj);\n if (coord) {\n return transformer(fromProj, toProj, coord);\n } else {\n obj = {\n forward: function (coords) {\n return transformer(fromProj, toProj, coords);\n },\n inverse: function (coords) {\n return transformer(toProj, fromProj, coords);\n }\n };\n if (single) {\n obj.oProj = toProj;\n }\n return obj;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (proj4);\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/core.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/datum.js": -/*!*****************************************!*\ - !*** ./node_modules/proj4/lib/datum.js ***! - \*****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\nfunction datum(datumCode, datum_params, a, b, es, ep2, nadgrids) {\n var out = {};\n\n if (datumCode === undefined || datumCode === 'none') {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_NODATUM\"];\n } else {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_WGS84\"];\n }\n\n if (datum_params) {\n out.datum_params = datum_params.map(parseFloat);\n if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"];\n }\n if (out.datum_params.length > 3) {\n if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"];\n out.datum_params[3] *= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"];\n out.datum_params[4] *= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"];\n out.datum_params[5] *= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"];\n out.datum_params[6] = (out.datum_params[6] / 1000000.0) + 1.0;\n }\n }\n }\n\n if (nadgrids) {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"];\n out.grids = nadgrids;\n }\n out.a = a; //datum object also uses these values\n out.b = b;\n out.es = es;\n out.ep2 = ep2;\n return out;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (datum);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/datum.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/datumUtils.js": -/*!**********************************************!*\ - !*** ./node_modules/proj4/lib/datumUtils.js ***! - \**********************************************/ -/*! exports provided: compareDatums, geodeticToGeocentric, geocentricToGeodetic, geocentricToWgs84, geocentricFromWgs84 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"compareDatums\", function() { return compareDatums; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geodeticToGeocentric\", function() { return geodeticToGeocentric; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geocentricToGeodetic\", function() { return geocentricToGeodetic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geocentricToWgs84\", function() { return geocentricToWgs84; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geocentricFromWgs84\", function() { return geocentricFromWgs84; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\nfunction compareDatums(source, dest) {\n if (source.datum_type !== dest.datum_type) {\n return false; // false, datums are not equal\n } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) {\n // the tolerance for es is to ensure that GRS80 and WGS84\n // are considered identical\n return false;\n } else if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"]) {\n return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2]);\n } else if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) {\n return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2] && source.datum_params[3] === dest.datum_params[3] && source.datum_params[4] === dest.datum_params[4] && source.datum_params[5] === dest.datum_params[5] && source.datum_params[6] === dest.datum_params[6]);\n } else {\n return true; // datums are equal\n }\n} // cs_compare_datums()\n\n/*\n * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates\n * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),\n * according to the current ellipsoid parameters.\n *\n * Latitude : Geodetic latitude in radians (input)\n * Longitude : Geodetic longitude in radians (input)\n * Height : Geodetic height, in meters (input)\n * X : Calculated Geocentric X coordinate, in meters (output)\n * Y : Calculated Geocentric Y coordinate, in meters (output)\n * Z : Calculated Geocentric Z coordinate, in meters (output)\n *\n */\nfunction geodeticToGeocentric(p, es, a) {\n var Longitude = p.x;\n var Latitude = p.y;\n var Height = p.z ? p.z : 0; //Z value not always supplied\n\n var Rn; /* Earth radius at location */\n var Sin_Lat; /* Math.sin(Latitude) */\n var Sin2_Lat; /* Square of Math.sin(Latitude) */\n var Cos_Lat; /* Math.cos(Latitude) */\n\n /*\n ** Don't blow up if Latitude is just a little out of the value\n ** range as it may just be a rounding issue. Also removed longitude\n ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.\n */\n if (Latitude < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] && Latitude > -1.001 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n Latitude = -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (Latitude > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] && Latitude < 1.001 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n Latitude = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (Latitude < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n /* Latitude out of range */\n //..reportError('geocent:lat out of range:' + Latitude);\n return { x: -Infinity, y: -Infinity, z: p.z };\n } else if (Latitude > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n /* Latitude out of range */\n return { x: Infinity, y: Infinity, z: p.z };\n }\n\n if (Longitude > Math.PI) {\n Longitude -= (2 * Math.PI);\n }\n Sin_Lat = Math.sin(Latitude);\n Cos_Lat = Math.cos(Latitude);\n Sin2_Lat = Sin_Lat * Sin_Lat;\n Rn = a / (Math.sqrt(1.0e0 - es * Sin2_Lat));\n return {\n x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),\n y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),\n z: ((Rn * (1 - es)) + Height) * Sin_Lat\n };\n} // cs_geodetic_to_geocentric()\n\nfunction geocentricToGeodetic(p, es, a, b) {\n /* local defintions and variables */\n /* end-criterium of loop, accuracy of sin(Latitude) */\n var genau = 1e-12;\n var genau2 = (genau * genau);\n var maxiter = 30;\n\n var P; /* distance between semi-minor axis and location */\n var RR; /* distance between center and location */\n var CT; /* sin of geocentric latitude */\n var ST; /* cos of geocentric latitude */\n var RX;\n var RK;\n var RN; /* Earth radius at location */\n var CPHI0; /* cos of start or old geodetic latitude in iterations */\n var SPHI0; /* sin of start or old geodetic latitude in iterations */\n var CPHI; /* cos of searched geodetic latitude */\n var SPHI; /* sin of searched geodetic latitude */\n var SDPHI; /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */\n var iter; /* # of continous iteration, max. 30 is always enough (s.a.) */\n\n var X = p.x;\n var Y = p.y;\n var Z = p.z ? p.z : 0.0; //Z value not always supplied\n var Longitude;\n var Latitude;\n var Height;\n\n P = Math.sqrt(X * X + Y * Y);\n RR = Math.sqrt(X * X + Y * Y + Z * Z);\n\n /* special cases for latitude and longitude */\n if (P / a < genau) {\n\n /* special case, if P=0. (X=0., Y=0.) */\n Longitude = 0.0;\n\n /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis\n * of ellipsoid (=center of mass), Latitude becomes PI/2 */\n if (RR / a < genau) {\n Latitude = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n Height = -b;\n return {\n x: p.x,\n y: p.y,\n z: p.z\n };\n }\n } else {\n /* ellipsoidal (geodetic) longitude\n * interval: -PI < Longitude <= +PI */\n Longitude = Math.atan2(Y, X);\n }\n\n /* --------------------------------------------------------------\n * Following iterative algorithm was developped by\n * \"Institut for Erdmessung\", University of Hannover, July 1988.\n * Internet: www.ife.uni-hannover.de\n * Iterative computation of CPHI,SPHI and Height.\n * Iteration of CPHI and SPHI to 10**-12 radian resp.\n * 2*10**-7 arcsec.\n * --------------------------------------------------------------\n */\n CT = Z / RR;\n ST = P / RR;\n RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST);\n CPHI0 = ST * (1.0 - es) * RX;\n SPHI0 = CT * RX;\n iter = 0;\n\n /* loop to find sin(Latitude) resp. Latitude\n * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */\n do {\n iter++;\n RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0);\n\n /* ellipsoidal (geodetic) height */\n Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0);\n\n RK = es * RN / (RN + Height);\n RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST);\n CPHI = ST * (1.0 - RK) * RX;\n SPHI = CT * RX;\n SDPHI = SPHI * CPHI0 - CPHI * SPHI0;\n CPHI0 = CPHI;\n SPHI0 = SPHI;\n }\n while (SDPHI * SDPHI > genau2 && iter < maxiter);\n\n /* ellipsoidal (geodetic) latitude */\n Latitude = Math.atan(SPHI / Math.abs(CPHI));\n return {\n x: Longitude,\n y: Latitude,\n z: Height\n };\n} // cs_geocentric_to_geodetic()\n\n/****************************************************************/\n// pj_geocentic_to_wgs84( p )\n// p = point to transform in geocentric coordinates (x,y,z)\n\n\n/** point object, nothing fancy, just allows values to be\n passed back and forth by reference rather than by value.\n Other point classes may be used as long as they have\n x and y properties, which will get modified in the transform method.\n*/\nfunction geocentricToWgs84(p, datum_type, datum_params) {\n\n if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"]) {\n // if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: p.x + datum_params[0],\n y: p.y + datum_params[1],\n z: p.z + datum_params[2],\n };\n } else if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) {\n var Dx_BF = datum_params[0];\n var Dy_BF = datum_params[1];\n var Dz_BF = datum_params[2];\n var Rx_BF = datum_params[3];\n var Ry_BF = datum_params[4];\n var Rz_BF = datum_params[5];\n var M_BF = datum_params[6];\n // if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF,\n y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF,\n z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF\n };\n }\n} // cs_geocentric_to_wgs84\n\n/****************************************************************/\n// pj_geocentic_from_wgs84()\n// coordinate system definition,\n// point to transform in geocentric coordinates (x,y,z)\nfunction geocentricFromWgs84(p, datum_type, datum_params) {\n\n if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"]) {\n //if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: p.x - datum_params[0],\n y: p.y - datum_params[1],\n z: p.z - datum_params[2],\n };\n\n } else if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) {\n var Dx_BF = datum_params[0];\n var Dy_BF = datum_params[1];\n var Dz_BF = datum_params[2];\n var Rx_BF = datum_params[3];\n var Ry_BF = datum_params[4];\n var Rz_BF = datum_params[5];\n var M_BF = datum_params[6];\n var x_tmp = (p.x - Dx_BF) / M_BF;\n var y_tmp = (p.y - Dy_BF) / M_BF;\n var z_tmp = (p.z - Dz_BF) / M_BF;\n //if( x[io] === HUGE_VAL )\n // continue;\n\n return {\n x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp,\n y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp,\n z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp\n };\n } //cs_geocentric_from_wgs84()\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/datumUtils.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/datum_transform.js": -/*!***************************************************!*\ - !*** ./node_modules/proj4/lib/datum_transform.js ***! - \***************************************************/ -/*! exports provided: default, applyGridShift */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyGridShift\", function() { return applyGridShift; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _datumUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./datumUtils */ \"./node_modules/proj4/lib/datumUtils.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\n\nfunction checkParams(type) {\n return (type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"] || type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(source, dest, point) {\n // Short cut if the datums are identical.\n if (Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"compareDatums\"])(source, dest)) {\n return point; // in this case, zero is sucess,\n // whereas cs_compare_datums returns 1 to indicate TRUE\n // confusing, should fix this\n }\n\n // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest\n if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_NODATUM\"] || dest.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_NODATUM\"]) {\n return point;\n }\n\n // If this datum requires grid shifts, then apply it to geodetic coordinates.\n var source_a = source.a;\n var source_es = source.es;\n if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"]) {\n var gridShiftCode = applyGridShift(source, false, point);\n if (gridShiftCode !== 0) {\n return undefined;\n }\n source_a = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_SEMIMAJOR\"];\n source_es = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_ESQUARED\"];\n }\n\n var dest_a = dest.a;\n var dest_b = dest.b;\n var dest_es = dest.es;\n if (dest.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"]) {\n dest_a = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_SEMIMAJOR\"];\n dest_b = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_SEMIMINOR\"];\n dest_es = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_ESQUARED\"];\n }\n\n // Do we need to go through geocentric coordinates?\n if (source_es === dest_es && source_a === dest_a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) {\n return point;\n }\n\n // Convert to geocentric coordinates.\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geodeticToGeocentric\"])(point, source_es, source_a);\n // Convert between datums\n if (checkParams(source.datum_type)) {\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geocentricToWgs84\"])(point, source.datum_type, source.datum_params);\n }\n if (checkParams(dest.datum_type)) {\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geocentricFromWgs84\"])(point, dest.datum_type, dest.datum_params);\n }\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geocentricToGeodetic\"])(point, dest_es, dest_a, dest_b);\n\n if (dest.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"]) {\n var destGridShiftResult = applyGridShift(dest, true, point);\n if (destGridShiftResult !== 0) {\n return undefined;\n }\n }\n\n return point;\n});\n\nfunction applyGridShift(source, inverse, point) {\n if (source.grids === null || source.grids.length === 0) {\n console.log('Grid shift grids not found');\n return -1;\n }\n var input = {x: -point.x, y: point.y};\n var output = {x: Number.NaN, y: Number.NaN};\n var onlyMandatoryGrids = false;\n var attemptedGrids = [];\n for (var i = 0; i < source.grids.length; i++) {\n var grid = source.grids[i];\n attemptedGrids.push(grid.name);\n if (grid.isNull) {\n output = input;\n break;\n }\n onlyMandatoryGrids = grid.mandatory;\n if (grid.grid === null) {\n if (grid.mandatory) {\n console.log(\"Unable to find mandatory grid '\" + grid.name + \"'\");\n return -1;\n }\n continue;\n }\n var subgrid = grid.grid.subgrids[0];\n // skip tables that don't match our point at all\n var epsilon = (Math.abs(subgrid.del[1]) + Math.abs(subgrid.del[0])) / 10000.0;\n var minX = subgrid.ll[0] - epsilon;\n var minY = subgrid.ll[1] - epsilon;\n var maxX = subgrid.ll[0] + (subgrid.lim[0] - 1) * subgrid.del[0] + epsilon;\n var maxY = subgrid.ll[1] + (subgrid.lim[1] - 1) * subgrid.del[1] + epsilon;\n if (minY > input.y || minX > input.x || maxY < input.y || maxX < input.x ) {\n continue;\n }\n output = applySubgridShift(input, inverse, subgrid);\n if (!isNaN(output.x)) {\n break;\n }\n }\n if (isNaN(output.x)) {\n console.log(\"Failed to find a grid shift table for location '\"+\n -input.x * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"] + \" \" + input.y * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"] + \" tried: '\" + attemptedGrids + \"'\");\n return -1;\n }\n point.x = -output.x;\n point.y = output.y;\n return 0;\n}\n\nfunction applySubgridShift(pin, inverse, ct) {\n var val = {x: Number.NaN, y: Number.NaN};\n if (isNaN(pin.x)) { return val; }\n var tb = {x: pin.x, y: pin.y};\n tb.x -= ct.ll[0];\n tb.y -= ct.ll[1];\n tb.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(tb.x - Math.PI) + Math.PI;\n var t = nadInterpolate(tb, ct);\n if (inverse) {\n if (isNaN(t.x)) {\n return val;\n }\n t.x = tb.x - t.x;\n t.y = tb.y - t.y;\n var i = 9, tol = 1e-12;\n var dif, del;\n do {\n del = nadInterpolate(t, ct);\n if (isNaN(del.x)) {\n console.log(\"Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.\");\n break;\n }\n dif = {x: tb.x - (del.x + t.x), y: tb.y - (del.y + t.y)};\n t.x += dif.x;\n t.y += dif.y;\n } while (i-- && Math.abs(dif.x) > tol && Math.abs(dif.y) > tol);\n if (i < 0) {\n console.log(\"Inverse grid shift iterator failed to converge.\");\n return val;\n }\n val.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(t.x + ct.ll[0]);\n val.y = t.y + ct.ll[1];\n } else {\n if (!isNaN(t.x)) {\n val.x = pin.x + t.x;\n val.y = pin.y + t.y;\n }\n }\n return val;\n}\n\nfunction nadInterpolate(pin, ct) {\n var t = {x: pin.x / ct.del[0], y: pin.y / ct.del[1]};\n var indx = {x: Math.floor(t.x), y: Math.floor(t.y)};\n var frct = {x: t.x - 1.0 * indx.x, y: t.y - 1.0 * indx.y};\n var val= {x: Number.NaN, y: Number.NaN};\n var inx;\n if (indx.x < 0 || indx.x >= ct.lim[0]) {\n return val;\n }\n if (indx.y < 0 || indx.y >= ct.lim[1]) {\n return val;\n }\n inx = (indx.y * ct.lim[0]) + indx.x;\n var f00 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx++;\n var f10= {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx += ct.lim[0];\n var f11 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx--;\n var f01 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n var m11 = frct.x * frct.y, m10 = frct.x * (1.0 - frct.y),\n m00 = (1.0 - frct.x) * (1.0 - frct.y), m01 = (1.0 - frct.x) * frct.y;\n val.x = (m00 * f00.x + m10 * f10.x + m01 * f01.x + m11 * f11.x);\n val.y = (m00 * f00.y + m10 * f10.y + m01 * f01.y + m11 * f11.y);\n return val;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/datum_transform.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/defs.js": -/*!****************************************!*\ - !*** ./node_modules/proj4/lib/defs.js ***! - \****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ \"./node_modules/proj4/lib/global.js\");\n/* harmony import */ var _projString__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./projString */ \"./node_modules/proj4/lib/projString.js\");\n/* harmony import */ var wkt_parser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! wkt-parser */ \"./node_modules/wkt-parser/index.js\");\n\n\n\n\nfunction defs(name) {\n /*global console*/\n var that = this;\n if (arguments.length === 2) {\n var def = arguments[1];\n if (typeof def === 'string') {\n if (def.charAt(0) === '+') {\n defs[name] = Object(_projString__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arguments[1]);\n }\n else {\n defs[name] = Object(wkt_parser__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(arguments[1]);\n }\n } else {\n defs[name] = def;\n }\n }\n else if (arguments.length === 1) {\n if (Array.isArray(name)) {\n return name.map(function(v) {\n if (Array.isArray(v)) {\n defs.apply(that, v);\n }\n else {\n defs(v);\n }\n });\n }\n else if (typeof name === 'string') {\n if (name in defs) {\n return defs[name];\n }\n }\n else if ('EPSG' in name) {\n defs['EPSG:' + name.EPSG] = name;\n }\n else if ('ESRI' in name) {\n defs['ESRI:' + name.ESRI] = name;\n }\n else if ('IAU2000' in name) {\n defs['IAU2000:' + name.IAU2000] = name;\n }\n else {\n console.log(name);\n }\n return;\n }\n\n\n}\nObject(_global__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(defs);\n/* harmony default export */ __webpack_exports__[\"default\"] = (defs);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/defs.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/deriveConstants.js": -/*!***************************************************!*\ - !*** ./node_modules/proj4/lib/deriveConstants.js ***! - \***************************************************/ -/*! exports provided: eccentricity, sphere */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"eccentricity\", function() { return eccentricity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sphere\", function() { return sphere; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _constants_Ellipsoid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants/Ellipsoid */ \"./node_modules/proj4/lib/constants/Ellipsoid.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n\n\n\n\nfunction eccentricity(a, b, rf, R_A) {\n var a2 = a * a; // used in geocentric\n var b2 = b * b; // used in geocentric\n var es = (a2 - b2) / a2; // e ^ 2\n var e = 0;\n if (R_A) {\n a *= 1 - es * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SIXTH\"] + es * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"RA4\"] + es * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"RA6\"]));\n a2 = a * a;\n es = 0;\n } else {\n e = Math.sqrt(es); // eccentricity\n }\n var ep2 = (a2 - b2) / b2; // used in geocentric\n return {\n es: es,\n e: e,\n ep2: ep2\n };\n}\nfunction sphere(a, b, rf, ellps, sphere) {\n if (!a) { // do we have an ellipsoid?\n var ellipse = Object(_match__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_constants_Ellipsoid__WEBPACK_IMPORTED_MODULE_1__[\"default\"], ellps);\n if (!ellipse) {\n ellipse = _constants_Ellipsoid__WEBPACK_IMPORTED_MODULE_1__[\"WGS84\"];\n }\n a = ellipse.a;\n b = ellipse.b;\n rf = ellipse.rf;\n }\n\n if (rf && !b) {\n b = (1.0 - 1.0 / rf) * a;\n }\n if (rf === 0 || Math.abs(a - b) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n sphere = true;\n b = a;\n }\n return {\n a: a,\n b: b,\n rf: rf,\n sphere: sphere\n };\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/deriveConstants.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/extend.js": -/*!******************************************!*\ - !*** ./node_modules/proj4/lib/extend.js ***! - \******************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(destination, source) {\n destination = destination || {};\n var value, property;\n if (!source) {\n return destination;\n }\n for (property in source) {\n value = source[property];\n if (value !== undefined) {\n destination[property] = value;\n }\n }\n return destination;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/extend.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/global.js": -/*!******************************************!*\ - !*** ./node_modules/proj4/lib/global.js ***! - \******************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(defs) {\n defs('EPSG:4326', \"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\");\n defs('EPSG:4269', \"+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\");\n defs('EPSG:3857', \"+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\");\n\n defs.WGS84 = defs['EPSG:4326'];\n defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857\n defs.GOOGLE = defs['EPSG:3857'];\n defs['EPSG:900913'] = defs['EPSG:3857'];\n defs['EPSG:102113'] = defs['EPSG:3857'];\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/global.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/index.js": -/*!*****************************************!*\ - !*** ./node_modules/proj4/lib/index.js ***! - \*****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core */ \"./node_modules/proj4/lib/core.js\");\n/* harmony import */ var _Proj__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Proj */ \"./node_modules/proj4/lib/Proj.js\");\n/* harmony import */ var _Point__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Point */ \"./node_modules/proj4/lib/Point.js\");\n/* harmony import */ var _common_toPoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./common/toPoint */ \"./node_modules/proj4/lib/common/toPoint.js\");\n/* harmony import */ var _defs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defs */ \"./node_modules/proj4/lib/defs.js\");\n/* harmony import */ var _nadgrid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./nadgrid */ \"./node_modules/proj4/lib/nadgrid.js\");\n/* harmony import */ var _transform__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transform */ \"./node_modules/proj4/lib/transform.js\");\n/* harmony import */ var mgrs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! mgrs */ \"./node_modules/mgrs/mgrs.js\");\n/* harmony import */ var _projs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../projs */ \"./node_modules/proj4/projs.js\");\n\n\n\n\n\n\n\n\n\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].defaultDatum = 'WGS84'; //default datum\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Proj = _Proj__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].WGS84 = new _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Proj('WGS84');\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Point = _Point__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toPoint = _common_toPoint__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].defs = _defs__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].nadgrid = _nadgrid__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].transform = _transform__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].mgrs = mgrs__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].version = '__VERSION__';\nObject(_projs__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/index.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/match.js": -/*!*****************************************!*\ - !*** ./node_modules/proj4/lib/match.js ***! - \*****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return match; });\nvar ignoredChar = /[\\s_\\-\\/\\(\\)]/g;\nfunction match(obj, key) {\n if (obj[key]) {\n return obj[key];\n }\n var keys = Object.keys(obj);\n var lkey = key.toLowerCase().replace(ignoredChar, '');\n var i = -1;\n var testkey, processedKey;\n while (++i < keys.length) {\n testkey = keys[i];\n processedKey = testkey.toLowerCase().replace(ignoredChar, '');\n if (processedKey === lkey) {\n return obj[testkey];\n }\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/match.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/nadgrid.js": -/*!*******************************************!*\ - !*** ./node_modules/proj4/lib/nadgrid.js ***! - \*******************************************/ -/*! exports provided: default, getNadgrids */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return nadgrid; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNadgrids\", function() { return getNadgrids; });\n/**\n * Resources for details of NTv2 file formats:\n * - https://web.archive.org/web/20140127204822if_/http://www.mgs.gov.on.ca:80/stdprodconsume/groups/content/@mgs/@iandit/documents/resourcelist/stel02_047447.pdf\n * - http://mimaka.com/help/gs/html/004_NTV2%20Data%20Format.htm\n */\n\nvar loadedNadgrids = {};\n\n/**\n * Load a binary NTv2 file (.gsb) to a key that can be used in a proj string like +nadgrids=. Pass the NTv2 file\n * as an ArrayBuffer.\n */\nfunction nadgrid(key, data) {\n var view = new DataView(data);\n var isLittleEndian = detectLittleEndian(view);\n var header = readHeader(view, isLittleEndian);\n if (header.nSubgrids > 1) {\n console.log('Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored');\n }\n var subgrids = readSubgrids(view, header, isLittleEndian);\n var nadgrid = {header: header, subgrids: subgrids};\n loadedNadgrids[key] = nadgrid;\n return nadgrid;\n}\n\n/**\n * Given a proj4 value for nadgrids, return an array of loaded grids\n */\nfunction getNadgrids(nadgrids) {\n // Format details: http://proj.maptools.org/gen_parms.html\n if (nadgrids === undefined) { return null; }\n var grids = nadgrids.split(',');\n return grids.map(parseNadgridString);\n}\n\nfunction parseNadgridString(value) {\n if (value.length === 0) {\n return null;\n }\n var optional = value[0] === '@';\n if (optional) {\n value = value.slice(1);\n }\n if (value === 'null') {\n return {name: 'null', mandatory: !optional, grid: null, isNull: true};\n }\n return {\n name: value,\n mandatory: !optional,\n grid: loadedNadgrids[value] || null,\n isNull: false\n };\n}\n\nfunction secondsToRadians(seconds) {\n return (seconds / 3600) * Math.PI / 180;\n}\n\nfunction detectLittleEndian(view) {\n var nFields = view.getInt32(8, false);\n if (nFields === 11) {\n return false;\n }\n nFields = view.getInt32(8, true);\n if (nFields !== 11) {\n console.warn('Failed to detect nadgrid endian-ness, defaulting to little-endian');\n }\n return true;\n}\n\nfunction readHeader(view, isLittleEndian) {\n return {\n nFields: view.getInt32(8, isLittleEndian),\n nSubgridFields: view.getInt32(24, isLittleEndian),\n nSubgrids: view.getInt32(40, isLittleEndian),\n shiftType: decodeString(view, 56, 56 + 8).trim(),\n fromSemiMajorAxis: view.getFloat64(120, isLittleEndian),\n fromSemiMinorAxis: view.getFloat64(136, isLittleEndian),\n toSemiMajorAxis: view.getFloat64(152, isLittleEndian),\n toSemiMinorAxis: view.getFloat64(168, isLittleEndian),\n };\n}\n\nfunction decodeString(view, start, end) {\n return String.fromCharCode.apply(null, new Uint8Array(view.buffer.slice(start, end)));\n}\n\nfunction readSubgrids(view, header, isLittleEndian) {\n var gridOffset = 176;\n var grids = [];\n for (var i = 0; i < header.nSubgrids; i++) {\n var subHeader = readGridHeader(view, gridOffset, isLittleEndian);\n var nodes = readGridNodes(view, gridOffset, subHeader, isLittleEndian);\n var lngColumnCount = Math.round(\n 1 + (subHeader.upperLongitude - subHeader.lowerLongitude) / subHeader.longitudeInterval);\n var latColumnCount = Math.round(\n 1 + (subHeader.upperLatitude - subHeader.lowerLatitude) / subHeader.latitudeInterval);\n // Proj4 operates on radians whereas the coordinates are in seconds in the grid\n grids.push({\n ll: [secondsToRadians(subHeader.lowerLongitude), secondsToRadians(subHeader.lowerLatitude)],\n del: [secondsToRadians(subHeader.longitudeInterval), secondsToRadians(subHeader.latitudeInterval)],\n lim: [lngColumnCount, latColumnCount],\n count: subHeader.gridNodeCount,\n cvs: mapNodes(nodes)\n });\n }\n return grids;\n}\n\nfunction mapNodes(nodes) {\n return nodes.map(function (r) {return [secondsToRadians(r.longitudeShift), secondsToRadians(r.latitudeShift)];});\n}\n\nfunction readGridHeader(view, offset, isLittleEndian) {\n return {\n name: decodeString(view, offset + 8, offset + 16).trim(),\n parent: decodeString(view, offset + 24, offset + 24 + 8).trim(),\n lowerLatitude: view.getFloat64(offset + 72, isLittleEndian),\n upperLatitude: view.getFloat64(offset + 88, isLittleEndian),\n lowerLongitude: view.getFloat64(offset + 104, isLittleEndian),\n upperLongitude: view.getFloat64(offset + 120, isLittleEndian),\n latitudeInterval: view.getFloat64(offset + 136, isLittleEndian),\n longitudeInterval: view.getFloat64(offset + 152, isLittleEndian),\n gridNodeCount: view.getInt32(offset + 168, isLittleEndian)\n };\n}\n\nfunction readGridNodes(view, offset, gridHeader, isLittleEndian) {\n var nodesOffset = offset + 176;\n var gridRecordLength = 16;\n var gridShiftRecords = [];\n for (var i = 0; i < gridHeader.gridNodeCount; i++) {\n var record = {\n latitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength, isLittleEndian),\n longitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength + 4, isLittleEndian),\n latitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 8, isLittleEndian),\n longitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 12, isLittleEndian),\n };\n gridShiftRecords.push(record);\n }\n return gridShiftRecords;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/nadgrid.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/parseCode.js": -/*!*********************************************!*\ - !*** ./node_modules/proj4/lib/parseCode.js ***! - \*********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _defs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defs */ \"./node_modules/proj4/lib/defs.js\");\n/* harmony import */ var wkt_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! wkt-parser */ \"./node_modules/wkt-parser/index.js\");\n/* harmony import */ var _projString__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./projString */ \"./node_modules/proj4/lib/projString.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n\n\n\n\nfunction testObj(code){\n return typeof code === 'string';\n}\nfunction testDef(code){\n return code in _defs__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n}\nvar codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS','GEOCCS','PROJCS','LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS'];\nfunction testWKT(code){\n return codeWords.some(function (word) {\n return code.indexOf(word) > -1;\n });\n}\nvar codes = ['3857', '900913', '3785', '102113'];\nfunction checkMercator(item) {\n var auth = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(item, 'authority');\n if (!auth) {\n return;\n }\n var code = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(auth, 'epsg');\n return code && codes.indexOf(code) > -1;\n}\nfunction checkProjStr(item) {\n var ext = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(item, 'extension');\n if (!ext) {\n return;\n }\n return Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(ext, 'proj4');\n}\nfunction testProj(code){\n return code[0] === '+';\n}\nfunction parse(code){\n if (testObj(code)) {\n //check to see if this is a WKT string\n if (testDef(code)) {\n return _defs__WEBPACK_IMPORTED_MODULE_0__[\"default\"][code];\n }\n if (testWKT(code)) {\n var out = Object(wkt_parser__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(code);\n // test of spetial case, due to this being a very common and often malformed\n if (checkMercator(out)) {\n return _defs__WEBPACK_IMPORTED_MODULE_0__[\"default\"]['EPSG:3857'];\n }\n var maybeProjStr = checkProjStr(out);\n if (maybeProjStr) {\n return Object(_projString__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(maybeProjStr);\n }\n return out;\n }\n if (testProj(code)) {\n return Object(_projString__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(code);\n }\n }else{\n return code;\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (parse);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/parseCode.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projString.js": -/*!**********************************************!*\ - !*** ./node_modules/proj4/lib/projString.js ***! - \**********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _constants_PrimeMeridian__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants/PrimeMeridian */ \"./node_modules/proj4/lib/constants/PrimeMeridian.js\");\n/* harmony import */ var _constants_units__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants/units */ \"./node_modules/proj4/lib/constants/units.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(defData) {\n var self = {};\n var paramObj = defData.split('+').map(function(v) {\n return v.trim();\n }).filter(function(a) {\n return a;\n }).reduce(function(p, a) {\n var split = a.split('=');\n split.push(true);\n p[split[0].toLowerCase()] = split[1];\n return p;\n }, {});\n var paramName, paramVal, paramOutname;\n var params = {\n proj: 'projName',\n datum: 'datumCode',\n rf: function(v) {\n self.rf = parseFloat(v);\n },\n lat_0: function(v) {\n self.lat0 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lat_1: function(v) {\n self.lat1 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lat_2: function(v) {\n self.lat2 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lat_ts: function(v) {\n self.lat_ts = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lon_0: function(v) {\n self.long0 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lon_1: function(v) {\n self.long1 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lon_2: function(v) {\n self.long2 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n alpha: function(v) {\n self.alpha = parseFloat(v) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lonc: function(v) {\n self.longc = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n x_0: function(v) {\n self.x0 = parseFloat(v);\n },\n y_0: function(v) {\n self.y0 = parseFloat(v);\n },\n k_0: function(v) {\n self.k0 = parseFloat(v);\n },\n k: function(v) {\n self.k0 = parseFloat(v);\n },\n a: function(v) {\n self.a = parseFloat(v);\n },\n b: function(v) {\n self.b = parseFloat(v);\n },\n r_a: function() {\n self.R_A = true;\n },\n zone: function(v) {\n self.zone = parseInt(v, 10);\n },\n south: function() {\n self.utmSouth = true;\n },\n towgs84: function(v) {\n self.datum_params = v.split(\",\").map(function(a) {\n return parseFloat(a);\n });\n },\n to_meter: function(v) {\n self.to_meter = parseFloat(v);\n },\n units: function(v) {\n self.units = v;\n var unit = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_constants_units__WEBPACK_IMPORTED_MODULE_2__[\"default\"], v);\n if (unit) {\n self.to_meter = unit.to_meter;\n }\n },\n from_greenwich: function(v) {\n self.from_greenwich = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n pm: function(v) {\n var pm = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_constants_PrimeMeridian__WEBPACK_IMPORTED_MODULE_1__[\"default\"], v);\n self.from_greenwich = (pm ? pm : parseFloat(v)) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n nadgrids: function(v) {\n if (v === '@null') {\n self.datumCode = 'none';\n }\n else {\n self.nadgrids = v;\n }\n },\n axis: function(v) {\n var legalAxis = \"ewnsud\";\n if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) {\n self.axis = v;\n }\n },\n approx: function() {\n self.approx = true;\n }\n };\n for (paramName in paramObj) {\n paramVal = paramObj[paramName];\n if (paramName in params) {\n paramOutname = params[paramName];\n if (typeof paramOutname === 'function') {\n paramOutname(paramVal);\n }\n else {\n self[paramOutname] = paramVal;\n }\n }\n else {\n self[paramName] = paramVal;\n }\n }\n if(typeof self.datumCode === 'string' && self.datumCode !== \"WGS84\"){\n self.datumCode = self.datumCode.toLowerCase();\n }\n return self;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projString.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections.js": -/*!***********************************************!*\ - !*** ./node_modules/proj4/lib/projections.js ***! - \***********************************************/ -/*! exports provided: add, get, start, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"start\", function() { return start; });\n/* harmony import */ var _projections_merc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./projections/merc */ \"./node_modules/proj4/lib/projections/merc.js\");\n/* harmony import */ var _projections_longlat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./projections/longlat */ \"./node_modules/proj4/lib/projections/longlat.js\");\n\n\nvar projs = [_projections_merc__WEBPACK_IMPORTED_MODULE_0__[\"default\"], _projections_longlat__WEBPACK_IMPORTED_MODULE_1__[\"default\"]];\nvar names = {};\nvar projStore = [];\n\nfunction add(proj, i) {\n var len = projStore.length;\n if (!proj.names) {\n console.log(i);\n return true;\n }\n projStore[len] = proj;\n proj.names.forEach(function(n) {\n names[n.toLowerCase()] = len;\n });\n return this;\n}\n\n\n\nfunction get(name) {\n if (!name) {\n return false;\n }\n var n = name.toLowerCase();\n if (typeof names[n] !== 'undefined' && projStore[names[n]]) {\n return projStore[names[n]];\n }\n}\n\nfunction start() {\n projs.forEach(add);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n start: start,\n add: add,\n get: get\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/aea.js": -/*!***************************************************!*\ - !*** ./node_modules/proj4/lib/projections/aea.js ***! - \***************************************************/ -/*! exports provided: init, forward, inverse, phi1z, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"phi1z\", function() { return phi1z; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_qsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/qsfnz */ \"./node_modules/proj4/lib/common/qsfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\nfunction init() {\n\n if (Math.abs(this.lat1 + this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return;\n }\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e3 = Math.sqrt(this.es);\n\n this.sin_po = Math.sin(this.lat1);\n this.cos_po = Math.cos(this.lat1);\n this.t1 = this.sin_po;\n this.con = this.sin_po;\n this.ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n this.qs1 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat2);\n this.cos_po = Math.cos(this.lat2);\n this.t2 = this.sin_po;\n this.ms2 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n this.qs2 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat0);\n this.cos_po = Math.cos(this.lat0);\n this.t3 = this.sin_po;\n this.qs0 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n\n if (Math.abs(this.lat1 - this.lat2) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);\n }\n else {\n this.ns0 = this.con;\n }\n this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;\n this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;\n}\n\n/* Albers Conical Equal Area forward equations--mapping lat,long to x,y\n -------------------------------------------------------------------*/\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n this.sin_phi = Math.sin(lat);\n this.cos_phi = Math.cos(lat);\n\n var qs = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_phi, this.cos_phi);\n var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;\n var theta = this.ns0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(lon - this.long0);\n var x = rh1 * Math.sin(theta) + this.x0;\n var y = this.rh - rh1 * Math.cos(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var rh1, qs, con, theta, lon, lat;\n\n p.x -= this.x0;\n p.y = this.rh - p.y + this.y0;\n if (this.ns0 >= 0) {\n rh1 = Math.sqrt(p.x * p.x + p.y * p.y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);\n con = -1;\n }\n theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2(con * p.x, con * p.y);\n }\n con = rh1 * this.ns0 / this.a;\n if (this.sphere) {\n lat = Math.asin((this.c - con * con) / (2 * this.ns0));\n }\n else {\n qs = (this.c - con * con) / this.ns0;\n lat = this.phi1z(this.e3, qs);\n }\n\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(theta / this.ns0 + this.long0);\n p.x = lon;\n p.y = lat;\n return p;\n}\n\n/* Function to compute phi1, the latitude for the inverse of the\n Albers Conical Equal-Area projection.\n-------------------------------------------*/\nfunction phi1z(eccent, qs) {\n var sinphi, cosphi, con, com, dphi;\n var phi = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0.5 * qs);\n if (eccent < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return phi;\n }\n\n var eccnts = eccent * eccent;\n for (var i = 1; i <= 25; i++) {\n sinphi = Math.sin(phi);\n cosphi = Math.cos(phi);\n con = eccent * sinphi;\n com = 1 - con * con;\n dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con)));\n phi = phi + dphi;\n if (Math.abs(dphi) <= 1e-7) {\n return phi;\n }\n }\n return null;\n}\n\nvar names = [\"Albers_Conic_Equal_Area\", \"Albers\", \"aea\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names,\n phi1z: phi1z\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/aea.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/aeqd.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/aeqd.js ***! - \****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_gN__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/gN */ \"./node_modules/proj4/lib/common/gN.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _common_imlfn__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/imlfn */ \"./node_modules/proj4/lib/common/imlfn.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n this.sin_p12 = Math.sin(this.lat0);\n this.cos_p12 = Math.cos(this.lat0);\n}\n\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var sinphi = Math.sin(p.y);\n var cosphi = Math.cos(p.y);\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var e0, e1, e2, e3, Mlp, Ml, tanphi, Nl1, Nl, psi, Az, G, H, GH, Hs, c, kp, cos_c, s, s2, s3, s4, s5;\n if (this.sphere) {\n if (Math.abs(this.sin_p12 - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //North Pole case\n p.x = this.x0 + this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] - lat) * Math.sin(dlon);\n p.y = this.y0 - this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] - lat) * Math.cos(dlon);\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //South Pole case\n p.x = this.x0 + this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] + lat) * Math.sin(dlon);\n p.y = this.y0 + this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] + lat) * Math.cos(dlon);\n return p;\n }\n else {\n //default case\n cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon);\n c = Math.acos(cos_c);\n kp = c ? c / Math.sin(c) : 1;\n p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon);\n p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon));\n return p;\n }\n }\n else {\n e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.es);\n e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.es);\n e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.es);\n if (Math.abs(this.sin_p12 - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //North Pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n Ml = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, lat);\n p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon);\n p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon);\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //South Pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n Ml = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, lat);\n p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon);\n p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon);\n return p;\n }\n else {\n //Default case\n tanphi = sinphi / cosphi;\n Nl1 = Object(_common_gN__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.a, this.e, this.sin_p12);\n Nl = Object(_common_gN__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.a, this.e, sinphi);\n psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi));\n Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon));\n if (Az === 0) {\n s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));\n }\n else if (Math.abs(Math.abs(Az) - Math.PI) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));\n }\n else {\n s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az));\n }\n G = this.e * this.sin_p12 / Math.sqrt(1 - this.es);\n H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es);\n GH = G * H;\n Hs = H * H;\n s2 = s * s;\n s3 = s2 * s;\n s4 = s3 * s;\n s5 = s4 * s;\n c = Nl1 * s * (1 - s2 * Hs * (1 - Hs) / 6 + s3 / 8 * GH * (1 - 2 * Hs) + s4 / 120 * (Hs * (4 - 7 * Hs) - 3 * G * G * (1 - 7 * Hs)) - s5 / 48 * GH);\n p.x = this.x0 + c * Math.sin(Az);\n p.y = this.y0 + c * Math.cos(Az);\n return p;\n }\n }\n\n\n}\n\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M, N1, psi, Az, cosAz, tmp, A, B, D, Ee, F, sinpsi;\n if (this.sphere) {\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (rh > (2 * _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] * this.a)) {\n return;\n }\n z = rh / this.a;\n\n sinz = Math.sin(z);\n cosz = Math.cos(z);\n\n lon = this.long0;\n if (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n lat = this.lat0;\n }\n else {\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(cosz * this.sin_p12 + (p.y * sinz * this.cos_p12) / rh);\n con = Math.abs(this.lat0) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"];\n if (Math.abs(con) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n if (this.lat0 >= 0) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, - p.y));\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 - Math.atan2(-p.x, p.y));\n }\n }\n else {\n /*con = cosz - this.sin_p12 * Math.sin(lat);\n if ((Math.abs(con) < EPSLN) && (Math.abs(p.x) < EPSLN)) {\n //no-op, just keep the lon value as is\n } else {\n var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));\n lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));\n }*/\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));\n }\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.es);\n e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.es);\n e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.es);\n if (Math.abs(this.sin_p12 - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //North pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n M = Mlp - rh;\n lat = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(M / this.a, e0, e1, e2, e3);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, - 1 * p.y));\n p.x = lon;\n p.y = lat;\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //South pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n M = rh - Mlp;\n\n lat = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(M / this.a, e0, e1, e2, e3);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, p.y));\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n //default case\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n Az = Math.atan2(p.x, p.y);\n N1 = Object(_common_gN__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.a, this.e, this.sin_p12);\n cosAz = Math.cos(Az);\n tmp = this.e * this.cos_p12 * cosAz;\n A = -tmp * tmp / (1 - this.es);\n B = 3 * this.es * (1 - A) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es);\n D = rh / N1;\n Ee = D - A * (1 + A) * Math.pow(D, 3) / 6 - B * (1 + 3 * A) * Math.pow(D, 4) / 24;\n F = 1 - A * Ee * Ee / 2 - D * Ee * Ee * Ee / 6;\n psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi)));\n sinpsi = Math.sin(psi);\n lat = Math.atan2((sinpsi - this.es * F * this.sin_p12) * Math.tan(psi), sinpsi * (1 - this.es));\n p.x = lon;\n p.y = lat;\n return p;\n }\n }\n\n}\n\nvar names = [\"Azimuthal_Equidistant\", \"aeqd\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/aeqd.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/cass.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/cass.js ***! - \****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_gN__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/gN */ \"./node_modules/proj4/lib/common/gN.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_imlfn__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/imlfn */ \"./node_modules/proj4/lib/common/imlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n if (!this.sphere) {\n this.e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.es);\n this.e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n this.e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n this.e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.es);\n this.ml0 = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat0);\n }\n}\n\n/* Cassini forward equations--mapping lat,long to x,y\n -----------------------------------------------------------------------*/\nfunction forward(p) {\n\n /* Forward equations\n -----------------*/\n var x, y;\n var lam = p.x;\n var phi = p.y;\n lam = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(lam - this.long0);\n\n if (this.sphere) {\n x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));\n y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0);\n }\n else {\n //ellipsoid\n var sinphi = Math.sin(phi);\n var cosphi = Math.cos(phi);\n var nl = Object(_common_gN__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.a, this.e, sinphi);\n var tl = Math.tan(phi) * Math.tan(phi);\n var al = lam * Math.cos(phi);\n var asq = al * al;\n var cl = this.es * cosphi * cosphi / (1 - this.es);\n var ml = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e0, this.e1, this.e2, this.e3, phi);\n\n x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120));\n y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24);\n\n\n }\n\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var x = p.x / this.a;\n var y = p.y / this.a;\n var phi, lam;\n\n if (this.sphere) {\n var dd = y + this.lat0;\n phi = Math.asin(Math.sin(dd) * Math.cos(x));\n lam = Math.atan2(Math.tan(x), Math.cos(dd));\n }\n else {\n /* ellipsoid */\n var ml1 = this.ml0 / this.a + y;\n var phi1 = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(ml1, this.e0, this.e1, this.e2, this.e3);\n if (Math.abs(Math.abs(phi1) - _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"HALF_PI\"];\n if (y < 0) {\n p.y *= -1;\n }\n return p;\n }\n var nl1 = Object(_common_gN__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.a, this.e, Math.sin(phi1));\n\n var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es);\n var tl1 = Math.pow(Math.tan(phi1), 2);\n var dl = x * this.a / nl1;\n var dsq = dl * dl;\n phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24);\n lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);\n\n }\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(lam + this.long0);\n p.y = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(phi);\n return p;\n\n}\n\nvar names = [\"Cassini\", \"Cassini_Soldner\", \"cass\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/cass.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/cea.js": -/*!***************************************************!*\ - !*** ./node_modules/proj4/lib/projections/cea.js ***! - \***************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_qsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/qsfnz */ \"./node_modules/proj4/lib/common/qsfnz.js\");\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_iqsfnz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/iqsfnz */ \"./node_modules/proj4/lib/common/iqsfnz.js\");\n\n\n\n\n\n/*\n reference:\n \"Cartographic Projection Procedures for the UNIX Environment-\n A User's Manual\" by Gerald I. Evenden,\n USGS Open File Report 90-284and Release 4 Interim Reports (2003)\n*/\nfunction init() {\n //no-op\n if (!this.sphere) {\n this.k0 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n}\n\n/* Cylindrical Equal Area forward equations--mapping lat,long to x,y\n ------------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y;\n /* Forward equations\n -----------------*/\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n if (this.sphere) {\n x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);\n y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);\n }\n else {\n var qs = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, Math.sin(lat));\n x = this.x0 + this.a * this.k0 * dlon;\n y = this.y0 + this.a * qs * 0.5 / this.k0;\n }\n\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Cylindrical Equal Area inverse equations--mapping x,y to lat/long\n ------------------------------------------------------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = Object(_common_iqsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, 2 * p.y * this.k0 / this.a);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"cea\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/cea.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/eqc.js": -/*!***************************************************!*\ - !*** ./node_modules/proj4/lib/projections/eqc.js ***! - \***************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n\n\n\nfunction init() {\n\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n this.lat_ts = this.lat_ts || 0;\n this.title = this.title || \"Equidistant Cylindrical (Plate Carre)\";\n\n this.rc = Math.cos(this.lat_ts);\n}\n\n// forward equations--mapping lat,long to x,y\n// -----------------------------------------------------------------\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var dlat = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat - this.lat0);\n p.x = this.x0 + (this.a * dlon * this.rc);\n p.y = this.y0 + (this.a * dlat);\n return p;\n}\n\n// inverse equations--mapping x,y to lat/long\n// -----------------------------------------------------------------\nfunction inverse(p) {\n\n var x = p.x;\n var y = p.y;\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + ((x - this.x0) / (this.a * this.rc)));\n p.y = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0 + ((y - this.y0) / (this.a)));\n return p;\n}\n\nvar names = [\"Equirectangular\", \"Equidistant_Cylindrical\", \"eqc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/eqc.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/eqdc.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/eqdc.js ***! - \****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_imlfn__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/imlfn */ \"./node_modules/proj4/lib/common/imlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"EPSLN\"]) {\n return;\n }\n this.lat2 = this.lat2 || this.lat1;\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e = Math.sqrt(this.es);\n this.e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.es);\n this.e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n this.e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n\n this.sinphi = Math.sin(this.lat1);\n this.cosphi = Math.cos(this.lat1);\n\n this.ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, this.sinphi, this.cosphi);\n this.ml1 = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat1);\n\n if (Math.abs(this.lat1 - this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"EPSLN\"]) {\n this.ns = this.sinphi;\n }\n else {\n this.sinphi = Math.sin(this.lat2);\n this.cosphi = Math.cos(this.lat2);\n this.ms2 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, this.sinphi, this.cosphi);\n this.ml2 = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat2);\n this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);\n }\n this.g = this.ml1 + this.ms1 / this.ns;\n this.ml0 = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat0);\n this.rh = this.a * (this.g - this.ml0);\n}\n\n/* Equidistant Conic forward equations--mapping lat,long to x,y\n -----------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var rh1;\n\n /* Forward equations\n -----------------*/\n if (this.sphere) {\n rh1 = this.a * (this.g - lat);\n }\n else {\n var ml = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, lat);\n rh1 = this.a * (this.g - ml);\n }\n var theta = this.ns * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(lon - this.long0);\n var x = this.x0 + rh1 * Math.sin(theta);\n var y = this.y0 + this.rh - rh1 * Math.cos(theta);\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y = this.rh - p.y + this.y0;\n var con, rh1, lat, lon;\n if (this.ns >= 0) {\n rh1 = Math.sqrt(p.x * p.x + p.y * p.y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2(con * p.x, con * p.y);\n }\n\n if (this.sphere) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.long0 + theta / this.ns);\n lat = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.g - rh1 / this.a);\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n var ml = this.g - rh1 / this.a;\n lat = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(ml, this.e0, this.e1, this.e2, this.e3);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.long0 + theta / this.ns);\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n}\n\nvar names = [\"Equidistant_Conic\", \"eqdc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/eqdc.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/etmerc.js": -/*!******************************************************!*\ - !*** ./node_modules/proj4/lib/projections/etmerc.js ***! - \******************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../projections/tmerc */ \"./node_modules/proj4/lib/projections/tmerc.js\");\n/* harmony import */ var _common_sinh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/sinh */ \"./node_modules/proj4/lib/common/sinh.js\");\n/* harmony import */ var _common_hypot__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/hypot */ \"./node_modules/proj4/lib/common/hypot.js\");\n/* harmony import */ var _common_asinhy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/asinhy */ \"./node_modules/proj4/lib/common/asinhy.js\");\n/* harmony import */ var _common_gatg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/gatg */ \"./node_modules/proj4/lib/common/gatg.js\");\n/* harmony import */ var _common_clens__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/clens */ \"./node_modules/proj4/lib/common/clens.js\");\n/* harmony import */ var _common_clens_cmplx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/clens_cmplx */ \"./node_modules/proj4/lib/common/clens_cmplx.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n// Heavily based on this etmerc projection implementation\n// https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/etmerc.js\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n if (!this.approx && (isNaN(this.es) || this.es <= 0)) {\n throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION[\"Fast_Transverse_Mercator\"] in the WKT.');\n }\n if (this.approx) {\n // When '+approx' is set, use tmerc instead\n _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].init.apply(this);\n this.forward = _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forward;\n this.inverse = _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].inverse;\n }\n\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n this.cgb = [];\n this.cbg = [];\n this.utg = [];\n this.gtu = [];\n\n var f = this.es / (1 + Math.sqrt(1 - this.es));\n var n = f / (2 - f);\n var np = n;\n\n this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 ))))));\n this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));\n\n np = np * n;\n this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));\n this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));\n\n np = np * n;\n this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));\n this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));\n\n np = np * n;\n this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));\n this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175)));\n\n np = np * n;\n this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));\n this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));\n\n np = np * n;\n this.cgb[5] = np * (601676 / 22275);\n this.cbg[5] = np * (444337 / 155925);\n\n np = Math.pow(n, 2);\n this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));\n\n this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));\n this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));\n\n this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));\n this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));\n\n np = np * n;\n this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 ))));\n this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));\n\n np = np * n;\n this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));\n this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));\n\n np = np * n;\n this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));\n this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));\n\n np = np * n;\n this.utg[5] = np * (-20648693 / 638668800);\n this.gtu[5] = np * (212378941 / 319334400);\n\n var Z = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.cbg, this.lat0);\n this.Zb = -this.Qn * (Z + Object(_common_clens__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.gtu, 2 * Z));\n}\n\nfunction forward(p) {\n var Ce = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(p.x - this.long0);\n var Cn = p.y;\n\n Cn = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.cbg, Cn);\n var sin_Cn = Math.sin(Cn);\n var cos_Cn = Math.cos(Cn);\n var sin_Ce = Math.sin(Ce);\n var cos_Ce = Math.cos(Ce);\n\n Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn);\n Ce = Math.atan2(sin_Ce * cos_Cn, Object(_common_hypot__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sin_Cn, cos_Cn * cos_Ce));\n Ce = Object(_common_asinhy__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Math.tan(Ce));\n\n var tmp = Object(_common_clens_cmplx__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.gtu, 2 * Cn, 2 * Ce);\n\n Cn = Cn + tmp[0];\n Ce = Ce + tmp[1];\n\n var x;\n var y;\n\n if (Math.abs(Ce) <= 2.623395162778) {\n x = this.a * (this.Qn * Ce) + this.x0;\n y = this.a * (this.Qn * Cn + this.Zb) + this.y0;\n }\n else {\n x = Infinity;\n y = Infinity;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n}\n\nfunction inverse(p) {\n var Ce = (p.x - this.x0) * (1 / this.a);\n var Cn = (p.y - this.y0) * (1 / this.a);\n\n Cn = (Cn - this.Zb) / this.Qn;\n Ce = Ce / this.Qn;\n\n var lon;\n var lat;\n\n if (Math.abs(Ce) <= 2.623395162778) {\n var tmp = Object(_common_clens_cmplx__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.utg, 2 * Cn, 2 * Ce);\n\n Cn = Cn + tmp[0];\n Ce = Ce + tmp[1];\n Ce = Math.atan(Object(_common_sinh__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Ce));\n\n var sin_Cn = Math.sin(Cn);\n var cos_Cn = Math.cos(Cn);\n var sin_Ce = Math.sin(Ce);\n var cos_Ce = Math.cos(Ce);\n\n Cn = Math.atan2(sin_Cn * cos_Ce, Object(_common_hypot__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sin_Ce, cos_Ce * cos_Cn));\n Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);\n\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(Ce + this.long0);\n lat = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.cgb, Cn);\n }\n else {\n lon = Infinity;\n lat = Infinity;\n }\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}\n\nvar names = [\"Extended_Transverse_Mercator\", \"Extended Transverse Mercator\", \"etmerc\", \"Transverse_Mercator\", \"Transverse Mercator\", \"tmerc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/etmerc.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/gauss.js": -/*!*****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/gauss.js ***! - \*****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_srat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/srat */ \"./node_modules/proj4/lib/common/srat.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\nvar MAX_ITER = 20;\n\n\nfunction init() {\n var sphi = Math.sin(this.lat0);\n var cphi = Math.cos(this.lat0);\n cphi *= cphi;\n this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi);\n this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es));\n this.phic0 = Math.asin(sphi / this.C);\n this.ratexp = 0.5 * this.C * this.e;\n this.K = Math.tan(0.5 * this.phic0 + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]) / (Math.pow(Math.tan(0.5 * this.lat0 + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]), this.C) * Object(_common_srat__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e * sphi, this.ratexp));\n}\n\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n\n p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]), this.C) * Object(_common_srat__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e * Math.sin(lat), this.ratexp)) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"];\n p.x = this.C * lon;\n return p;\n}\n\nfunction inverse(p) {\n var DEL_TOL = 1e-14;\n var lon = p.x / this.C;\n var lat = p.y;\n var num = Math.pow(Math.tan(0.5 * lat + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]) / this.K, 1 / this.C);\n for (var i = MAX_ITER; i > 0; --i) {\n lat = 2 * Math.atan(num * Object(_common_srat__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e * Math.sin(p.y), - 0.5 * this.e)) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"];\n if (Math.abs(lat - p.y) < DEL_TOL) {\n break;\n }\n p.y = lat;\n }\n /* convergence failed */\n if (!i) {\n return null;\n }\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"gauss\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/gauss.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/geocent.js": -/*!*******************************************************!*\ - !*** ./node_modules/proj4/lib/projections/geocent.js ***! - \*******************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _datumUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../datumUtils */ \"./node_modules/proj4/lib/datumUtils.js\");\n\n\nfunction init() {\n this.name = 'geocent';\n\n}\n\nfunction forward(p) {\n var point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_0__[\"geodeticToGeocentric\"])(p, this.es, this.a);\n return point;\n}\n\nfunction inverse(p) {\n var point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_0__[\"geocentricToGeodetic\"])(p, this.es, this.a, this.b);\n return point;\n}\n\nvar names = [\"Geocentric\", 'geocentric', \"geocent\", \"Geocent\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/geocent.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/gnom.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/gnom.js ***! - \****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n/*\n reference:\n Wolfram Mathworld \"Gnomonic Projection\"\n http://mathworld.wolfram.com/GnomonicProjection.html\n Accessed: 12th November 2009\n */\nfunction init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n // Approximation for projecting points to the horizon (infinity)\n this.infinity_dist = 1000 * this.a;\n this.rc = 1;\n}\n\n/* Gnomonic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\nfunction forward(p) {\n var sinphi, cosphi; /* sin and cos value */\n var dlon; /* delta longitude value */\n var coslon; /* cos of longitude */\n var ksp; /* scale factor */\n var g;\n var x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n\n sinphi = Math.sin(lat);\n cosphi = Math.cos(lat);\n\n coslon = Math.cos(dlon);\n g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;\n ksp = 1;\n if ((g > 0) || (Math.abs(g) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"])) {\n x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g;\n y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g;\n }\n else {\n\n // Point is in the opposing hemisphere and is unprojectable\n // We still need to return a reasonable point, so we project\n // to infinity, on a bearing\n // equivalent to the northern hemisphere equivalent\n // This is a reasonable approximation for short shapes and lines that\n // straddle the horizon.\n\n x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon);\n y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);\n\n }\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var rh; /* Rho */\n var sinc, cosc;\n var c;\n var lon, lat;\n\n /* Inverse equations\n -----------------*/\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n p.x /= this.k0;\n p.y /= this.k0;\n\n if ((rh = Math.sqrt(p.x * p.x + p.y * p.y))) {\n c = Math.atan2(rh, this.rc);\n sinc = Math.sin(c);\n cosc = Math.cos(c);\n\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(cosc * this.sin_p14 + (p.y * sinc * this.cos_p14) / rh);\n lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + lon);\n }\n else {\n lat = this.phic0;\n lon = 0;\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"gnom\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/gnom.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/krovak.js": -/*!******************************************************!*\ - !*** ./node_modules/proj4/lib/projections/krovak.js ***! - \******************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\nfunction init() {\n this.a = 6377397.155;\n this.es = 0.006674372230614;\n this.e = Math.sqrt(this.es);\n if (!this.lat0) {\n this.lat0 = 0.863937979737193;\n }\n if (!this.long0) {\n this.long0 = 0.7417649320975901 - 0.308341501185665;\n }\n /* if scale not set default to 0.9999 */\n if (!this.k0) {\n this.k0 = 0.9999;\n }\n this.s45 = 0.785398163397448; /* 45 */\n this.s90 = 2 * this.s45;\n this.fi0 = this.lat0;\n this.e2 = this.es;\n this.e = Math.sqrt(this.e2);\n this.alfa = Math.sqrt(1 + (this.e2 * Math.pow(Math.cos(this.fi0), 4)) / (1 - this.e2));\n this.uq = 1.04216856380474;\n this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);\n this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);\n this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;\n this.k1 = this.k0;\n this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));\n this.s0 = 1.37008346281555;\n this.n = Math.sin(this.s0);\n this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);\n this.ad = this.s90 - this.uq;\n}\n\n/* ellipsoid */\n/* calculate xy from lat/lon */\n/* Constants, identical to inverse transform function */\nfunction forward(p) {\n var gfi, u, deltav, s, d, eps, ro;\n var lon = p.x;\n var lat = p.y;\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n /* Transformation */\n gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2));\n u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);\n deltav = -delta_lon * this.alfa;\n s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav));\n d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s));\n eps = this.n * d;\n ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);\n p.y = ro * Math.cos(eps) / 1;\n p.x = ro * Math.sin(eps) / 1;\n\n if (!this.czech) {\n p.y *= -1;\n p.x *= -1;\n }\n return (p);\n}\n\n/* calculate lat/lon from xy */\nfunction inverse(p) {\n var u, deltav, s, d, eps, ro, fi1;\n var ok;\n\n /* Transformation */\n /* revert y, x*/\n var tmp = p.x;\n p.x = p.y;\n p.y = tmp;\n if (!this.czech) {\n p.y *= -1;\n p.x *= -1;\n }\n ro = Math.sqrt(p.x * p.x + p.y * p.y);\n eps = Math.atan2(p.y, p.x);\n d = eps / Math.sin(this.s0);\n s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45);\n u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d));\n deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u));\n p.x = this.long0 - deltav / this.alfa;\n fi1 = u;\n ok = 0;\n var iter = 0;\n do {\n p.y = 2 * (Math.atan(Math.pow(this.k, - 1 / this.alfa) * Math.pow(Math.tan(u / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(fi1)) / (1 - this.e * Math.sin(fi1)), this.e / 2)) - this.s45);\n if (Math.abs(fi1 - p.y) < 0.0000000001) {\n ok = 1;\n }\n fi1 = p.y;\n iter += 1;\n } while (ok === 0 && iter < 15);\n if (iter >= 15) {\n return null;\n }\n\n return (p);\n}\n\nvar names = [\"Krovak\", \"krovak\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/krovak.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/laea.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/laea.js ***! - \****************************************************/ -/*! exports provided: S_POLE, N_POLE, EQUIT, OBLIQ, init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"S_POLE\", function() { return S_POLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"N_POLE\", function() { return N_POLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EQUIT\", function() { return EQUIT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OBLIQ\", function() { return OBLIQ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_qsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/qsfnz */ \"./node_modules/proj4/lib/common/qsfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\n\n\n\n/*\n reference\n \"New Equal-Area Map Projections for Noncircular Regions\", John P. Snyder,\n The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.\n */\n\nvar S_POLE = 1;\n\nvar N_POLE = 2;\nvar EQUIT = 3;\nvar OBLIQ = 4;\n\n/* Initialize the Lambert Azimuthal Equal Area projection\n ------------------------------------------------------*/\nfunction init() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n}\n\n/* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y\n -----------------------------------------------------------------------*/\nfunction forward(p) {\n\n /* Forward equations\n -----------------*/\n var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;\n var lam = p.x;\n var phi = p.y;\n\n lam = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(lam - this.long0);\n if (this.sphere) {\n sinphi = Math.sin(phi);\n cosphi = Math.cos(phi);\n coslam = Math.cos(lam);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n y = (this.mode === this.EQUIT) ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;\n if (y <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n return null;\n }\n y = Math.sqrt(2 / y);\n x = y * cosphi * Math.sin(lam);\n y *= (this.mode === this.EQUIT) ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;\n }\n else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {\n if (this.mode === this.N_POLE) {\n coslam = -coslam;\n }\n if (Math.abs(phi + this.lat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n return null;\n }\n y = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] - phi * 0.5;\n y = 2 * ((this.mode === this.S_POLE) ? Math.cos(y) : Math.sin(y));\n x = y * Math.sin(lam);\n y *= coslam;\n }\n }\n else {\n sinb = 0;\n cosb = 0;\n b = 0;\n coslam = Math.cos(lam);\n sinlam = Math.sin(lam);\n sinphi = Math.sin(phi);\n q = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, sinphi);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n sinb = q / this.qp;\n cosb = Math.sqrt(1 - sinb * sinb);\n }\n switch (this.mode) {\n case this.OBLIQ:\n b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;\n break;\n case this.EQUIT:\n b = 1 + cosb * coslam;\n break;\n case this.N_POLE:\n b = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + phi;\n q = this.qp - q;\n break;\n case this.S_POLE:\n b = phi - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n q = this.qp + q;\n break;\n }\n if (Math.abs(b) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n return null;\n }\n switch (this.mode) {\n case this.OBLIQ:\n case this.EQUIT:\n b = Math.sqrt(2 / b);\n if (this.mode === this.OBLIQ) {\n y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);\n }\n else {\n y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;\n }\n x = this.xmf * b * cosb * sinlam;\n break;\n case this.N_POLE:\n case this.S_POLE:\n if (q >= 0) {\n x = (b = Math.sqrt(q)) * sinlam;\n y = coslam * ((this.mode === this.S_POLE) ? b : -b);\n }\n else {\n x = y = 0;\n }\n break;\n }\n }\n\n p.x = this.a * x + this.x0;\n p.y = this.a * y + this.y0;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var x = p.x / this.a;\n var y = p.y / this.a;\n var lam, phi, cCe, sCe, q, rho, ab;\n if (this.sphere) {\n var cosz = 0,\n rh, sinz = 0;\n\n rh = Math.sqrt(x * x + y * y);\n phi = rh * 0.5;\n if (phi > 1) {\n return null;\n }\n phi = 2 * Math.asin(phi);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n sinz = Math.sin(phi);\n cosz = Math.cos(phi);\n }\n switch (this.mode) {\n case this.EQUIT:\n phi = (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) ? 0 : Math.asin(y * sinz / rh);\n x *= sinz;\n y = cosz * rh;\n break;\n case this.OBLIQ:\n phi = (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) ? this.lat0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh);\n x *= sinz * this.cosph0;\n y = (cosz - Math.sin(phi) * this.sinph0) * rh;\n break;\n case this.N_POLE:\n y = -y;\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - phi;\n break;\n case this.S_POLE:\n phi -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n break;\n }\n lam = (y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ)) ? 0 : Math.atan2(x, y);\n }\n else {\n ab = 0;\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n x /= this.dd;\n y *= this.dd;\n rho = Math.sqrt(x * x + y * y);\n if (rho < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = this.lat0;\n return p;\n }\n sCe = 2 * Math.asin(0.5 * rho / this.rq);\n cCe = Math.cos(sCe);\n x *= (sCe = Math.sin(sCe));\n if (this.mode === this.OBLIQ) {\n ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho;\n q = this.qp * ab;\n y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe;\n }\n else {\n ab = y * sCe / rho;\n q = this.qp * ab;\n y = rho * cCe;\n }\n }\n else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {\n if (this.mode === this.N_POLE) {\n y = -y;\n }\n q = (x * x + y * y);\n if (!q) {\n p.x = this.long0;\n p.y = this.lat0;\n return p;\n }\n ab = 1 - q / this.qp;\n if (this.mode === this.S_POLE) {\n ab = -ab;\n }\n }\n lam = Math.atan2(x, y);\n phi = authlat(Math.asin(ab), this.apa);\n }\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.long0 + lam);\n p.y = phi;\n return p;\n}\n\n/* determine latitude from authalic latitude */\nvar P00 = 0.33333333333333333333;\n\nvar P01 = 0.17222222222222222222;\nvar P02 = 0.10257936507936507936;\nvar P10 = 0.06388888888888888888;\nvar P11 = 0.06640211640211640211;\nvar P20 = 0.01641501294219154443;\n\nfunction authset(es) {\n var t;\n var APA = [];\n APA[0] = es * P00;\n t = es * es;\n APA[0] += t * P01;\n APA[1] = t * P10;\n t *= es;\n APA[0] += t * P02;\n APA[1] += t * P11;\n APA[2] = t * P20;\n return APA;\n}\n\nfunction authlat(beta, APA) {\n var t = beta + beta;\n return (beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t));\n}\n\nvar names = [\"Lambert Azimuthal Equal Area\", \"Lambert_Azimuthal_Equal_Area\", \"laea\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names,\n S_POLE: S_POLE,\n N_POLE: N_POLE,\n EQUIT: EQUIT,\n OBLIQ: OBLIQ\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/laea.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/lcc.js": -/*!***************************************************!*\ - !*** ./node_modules/proj4/lib/projections/lcc.js ***! - \***************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_sign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/sign */ \"./node_modules/proj4/lib/common/sign.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\nfunction init() {\n\n // array of: r_maj,r_min,lat1,lat2,c_lon,c_lat,false_east,false_north\n //double c_lat; /* center latitude */\n //double c_lon; /* center longitude */\n //double lat1; /* first standard parallel */\n //double lat2; /* second standard parallel */\n //double r_maj; /* major axis */\n //double r_min; /* minor axis */\n //double false_east; /* x offset in meters */\n //double false_north; /* y offset in meters */\n\n if (!this.lat2) {\n this.lat2 = this.lat1;\n } //if lat2 is not defined\n if (!this.k0) {\n this.k0 = 1;\n }\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n return;\n }\n\n var temp = this.b / this.a;\n this.e = Math.sqrt(1 - temp * temp);\n\n var sin1 = Math.sin(this.lat1);\n var cos1 = Math.cos(this.lat1);\n var ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, sin1, cos1);\n var ts1 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, this.lat1, sin1);\n\n var sin2 = Math.sin(this.lat2);\n var cos2 = Math.cos(this.lat2);\n var ms2 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, sin2, cos2);\n var ts2 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, this.lat2, sin2);\n\n var ts0 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, this.lat0, Math.sin(this.lat0));\n\n if (Math.abs(this.lat1 - this.lat2) > _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);\n }\n else {\n this.ns = sin1;\n }\n if (isNaN(this.ns)) {\n this.ns = sin1;\n }\n this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));\n this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);\n if (!this.title) {\n this.title = \"Lambert Conformal Conic\";\n }\n}\n\n// Lambert Conformal conic forward equations--mapping lat,long to x,y\n// -----------------------------------------------------------------\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n // singular cases :\n if (Math.abs(2 * Math.abs(lat) - Math.PI) <= _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n lat = Object(_common_sign__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(lat) * (_constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"] - 2 * _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]);\n }\n\n var con = Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"]);\n var ts, rh1;\n if (con > _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n ts = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, lat, Math.sin(lat));\n rh1 = this.a * this.f0 * Math.pow(ts, this.ns);\n }\n else {\n con = lat * this.ns;\n if (con <= 0) {\n return null;\n }\n rh1 = 0;\n }\n var theta = this.ns * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lon - this.long0);\n p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;\n p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;\n\n return p;\n}\n\n// Lambert Conformal Conic inverse equations--mapping x,y to lat/long\n// -----------------------------------------------------------------\nfunction inverse(p) {\n\n var rh1, con, ts;\n var lat, lon;\n var x = (p.x - this.x0) / this.k0;\n var y = (this.rh - (p.y - this.y0) / this.k0);\n if (this.ns > 0) {\n rh1 = Math.sqrt(x * x + y * y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(x * x + y * y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2((con * x), (con * y));\n }\n if ((rh1 !== 0) || (this.ns > 0)) {\n con = 1 / this.ns;\n ts = Math.pow((rh1 / (this.a * this.f0)), con);\n lat = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n else {\n lat = -_constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"];\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(theta / this.ns + this.long0);\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Lambert Tangential Conformal Conic Projection\", \"Lambert_Conformal_Conic\", \"Lambert_Conformal_Conic_2SP\", \"lcc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/lcc.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/longlat.js": -/*!*******************************************************!*\ - !*** ./node_modules/proj4/lib/projections/longlat.js ***! - \*******************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\nfunction init() {\n //no-op for longlat\n}\n\nfunction identity(pt) {\n return pt;\n}\n\n\nvar names = [\"longlat\", \"identity\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: identity,\n inverse: identity,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/longlat.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/merc.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/merc.js ***! - \****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\nfunction init() {\n var con = this.b / this.a;\n this.es = 1 - con * con;\n if(!('x0' in this)){\n this.x0 = 0;\n }\n if(!('y0' in this)){\n this.y0 = 0;\n }\n this.e = Math.sqrt(this.es);\n if (this.lat_ts) {\n if (this.sphere) {\n this.k0 = Math.cos(this.lat_ts);\n }\n else {\n this.k0 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n }\n else {\n if (!this.k0) {\n if (this.k) {\n this.k0 = this.k;\n }\n else {\n this.k0 = 1;\n }\n }\n }\n}\n\n/* Mercator forward equations--mapping lat,long to x,y\n --------------------------------------------------*/\n\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n // convert to radians\n if (lat * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] > 90 && lat * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] < -90 && lon * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] > 180 && lon * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] < -180) {\n return null;\n }\n\n var x, y;\n if (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return null;\n }\n else {\n if (this.sphere) {\n x = this.x0 + this.a * this.k0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n y = this.y0 + this.a * this.k0 * Math.log(Math.tan(_constants_values__WEBPACK_IMPORTED_MODULE_4__[\"FORTPI\"] + 0.5 * lat));\n }\n else {\n var sinphi = Math.sin(lat);\n var ts = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, lat, sinphi);\n x = this.x0 + this.a * this.k0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n y = this.y0 - this.a * this.k0 * Math.log(ts);\n }\n p.x = x;\n p.y = y;\n return p;\n }\n}\n\n/* Mercator inverse equations--mapping x,y to lat/long\n --------------------------------------------------*/\nfunction inverse(p) {\n\n var x = p.x - this.x0;\n var y = p.y - this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lat = _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"] - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));\n }\n else {\n var ts = Math.exp(-y / (this.a * this.k0));\n lat = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0 + x / (this.a * this.k0));\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Mercator\", \"Popular Visualisation Pseudo Mercator\", \"Mercator_1SP\", \"Mercator_Auxiliary_Sphere\", \"merc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/merc.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/mill.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/mill.js ***! - \****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n/*\n reference\n \"New Equal-Area Map Projections for Noncircular Regions\", John P. Snyder,\n The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.\n */\n\n\n/* Initialize the Miller Cylindrical projection\n -------------------------------------------*/\nfunction init() {\n //no-op\n}\n\n/* Miller Cylindrical forward equations--mapping lat,long to x,y\n ------------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var x = this.x0 + this.a * dlon;\n var y = this.y0 + this.a * Math.log(Math.tan((Math.PI / 4) + (lat / 2.5))) * 1.25;\n\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Miller Cylindrical inverse equations--mapping x,y to lat/long\n ------------------------------------------------------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Miller_Cylindrical\", \"mill\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/mill.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/moll.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/moll.js ***! - \****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\nfunction init() {}\n\n/* Mollweide forward equations--mapping lat,long to x,y\n ----------------------------------------------------*/\nfunction forward(p) {\n\n /* Forward equations\n -----------------*/\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var theta = lat;\n var con = Math.PI * Math.sin(lat);\n\n /* Iterate using the Newton-Raphson method to find theta\n -----------------------------------------------------*/\n while (true) {\n var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));\n theta += delta_theta;\n if (Math.abs(delta_theta) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n break;\n }\n }\n theta /= 2;\n\n /* If the latitude is 90 deg, force the x coordinate to be \"0 + false easting\"\n this is done here because of precision problems with \"cos(theta)\"\n --------------------------------------------------------------------------*/\n if (Math.PI / 2 - Math.abs(lat) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n delta_lon = 0;\n }\n var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;\n var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var theta;\n var arg;\n\n /* Inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n arg = p.y / (1.4142135623731 * this.a);\n\n /* Because of division by zero problems, 'arg' can not be 1. Therefore\n a number very close to one is used instead.\n -------------------------------------------------------------------*/\n if (Math.abs(arg) > 0.999999999999) {\n arg = 0.999999999999;\n }\n theta = Math.asin(arg);\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta))));\n if (lon < (-Math.PI)) {\n lon = -Math.PI;\n }\n if (lon > Math.PI) {\n lon = Math.PI;\n }\n arg = (2 * theta + Math.sin(2 * theta)) / Math.PI;\n if (Math.abs(arg) > 1) {\n arg = 1;\n }\n var lat = Math.asin(arg);\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Mollweide\", \"moll\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/moll.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/nzmg.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/nzmg.js ***! - \****************************************************/ -/*! exports provided: iterations, init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"iterations\", function() { return iterations; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/*\n reference\n Department of Land and Survey Technical Circular 1973/32\n http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf\n OSG Technical Report 4.1\n http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf\n */\n\n/**\n * iterations: Number of iterations to refine inverse transform.\n * 0 -> km accuracy\n * 1 -> m accuracy -- suitable for most mapping applications\n * 2 -> mm accuracy\n */\nvar iterations = 1;\n\nfunction init() {\n this.A = [];\n this.A[1] = 0.6399175073;\n this.A[2] = -0.1358797613;\n this.A[3] = 0.063294409;\n this.A[4] = -0.02526853;\n this.A[5] = 0.0117879;\n this.A[6] = -0.0055161;\n this.A[7] = 0.0026906;\n this.A[8] = -0.001333;\n this.A[9] = 0.00067;\n this.A[10] = -0.00034;\n\n this.B_re = [];\n this.B_im = [];\n this.B_re[1] = 0.7557853228;\n this.B_im[1] = 0;\n this.B_re[2] = 0.249204646;\n this.B_im[2] = 0.003371507;\n this.B_re[3] = -0.001541739;\n this.B_im[3] = 0.041058560;\n this.B_re[4] = -0.10162907;\n this.B_im[4] = 0.01727609;\n this.B_re[5] = -0.26623489;\n this.B_im[5] = -0.36249218;\n this.B_re[6] = -0.6870983;\n this.B_im[6] = -1.1651967;\n\n this.C_re = [];\n this.C_im = [];\n this.C_re[1] = 1.3231270439;\n this.C_im[1] = 0;\n this.C_re[2] = -0.577245789;\n this.C_im[2] = -0.007809598;\n this.C_re[3] = 0.508307513;\n this.C_im[3] = -0.112208952;\n this.C_re[4] = -0.15094762;\n this.C_im[4] = 0.18200602;\n this.C_re[5] = 1.01418179;\n this.C_im[5] = 1.64497696;\n this.C_re[6] = 1.9660549;\n this.C_im[6] = 2.5127645;\n\n this.D = [];\n this.D[1] = 1.5627014243;\n this.D[2] = 0.5185406398;\n this.D[3] = -0.03333098;\n this.D[4] = -0.1052906;\n this.D[5] = -0.0368594;\n this.D[6] = 0.007317;\n this.D[7] = 0.01220;\n this.D[8] = 0.00394;\n this.D[9] = -0.0013;\n}\n\n/**\n New Zealand Map Grid Forward - long/lat to x/y\n long/lat in radians\n */\nfunction forward(p) {\n var n;\n var lon = p.x;\n var lat = p.y;\n\n var delta_lat = lat - this.lat0;\n var delta_lon = lon - this.long0;\n\n // 1. Calculate d_phi and d_psi ... // and d_lambda\n // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians.\n var d_phi = delta_lat / _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"] * 1E-5;\n var d_lambda = delta_lon;\n var d_phi_n = 1; // d_phi^0\n\n var d_psi = 0;\n for (n = 1; n <= 10; n++) {\n d_phi_n = d_phi_n * d_phi;\n d_psi = d_psi + this.A[n] * d_phi_n;\n }\n\n // 2. Calculate theta\n var th_re = d_psi;\n var th_im = d_lambda;\n\n // 3. Calculate z\n var th_n_re = 1;\n var th_n_im = 0; // theta^0\n var th_n_re1;\n var th_n_im1;\n\n var z_re = 0;\n var z_im = 0;\n for (n = 1; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;\n z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;\n }\n\n // 4. Calculate easting and northing\n p.x = (z_im * this.a) + this.x0;\n p.y = (z_re * this.a) + this.y0;\n\n return p;\n}\n\n/**\n New Zealand Map Grid Inverse - x/y to long/lat\n */\nfunction inverse(p) {\n var n;\n var x = p.x;\n var y = p.y;\n\n var delta_x = x - this.x0;\n var delta_y = y - this.y0;\n\n // 1. Calculate z\n var z_re = delta_y / this.a;\n var z_im = delta_x / this.a;\n\n // 2a. Calculate theta - first approximation gives km accuracy\n var z_n_re = 1;\n var z_n_im = 0; // z^0\n var z_n_re1;\n var z_n_im1;\n\n var th_re = 0;\n var th_im = 0;\n for (n = 1; n <= 6; n++) {\n z_n_re1 = z_n_re * z_re - z_n_im * z_im;\n z_n_im1 = z_n_im * z_re + z_n_re * z_im;\n z_n_re = z_n_re1;\n z_n_im = z_n_im1;\n th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;\n th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;\n }\n\n // 2b. Iterate to refine the accuracy of the calculation\n // 0 iterations gives km accuracy\n // 1 iteration gives m accuracy -- good enough for most mapping applications\n // 2 iterations bives mm accuracy\n for (var i = 0; i < this.iterations; i++) {\n var th_n_re = th_re;\n var th_n_im = th_im;\n var th_n_re1;\n var th_n_im1;\n\n var num_re = z_re;\n var num_im = z_im;\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n th_n_re = 1;\n th_n_im = 0;\n var den_re = this.B_re[1];\n var den_im = this.B_im[1];\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n // Complex division\n var den2 = den_re * den_re + den_im * den_im;\n th_re = (num_re * den_re + num_im * den_im) / den2;\n th_im = (num_im * den_re - num_re * den_im) / den2;\n }\n\n // 3. Calculate d_phi ... // and d_lambda\n var d_psi = th_re;\n var d_lambda = th_im;\n var d_psi_n = 1; // d_psi^0\n\n var d_phi = 0;\n for (n = 1; n <= 9; n++) {\n d_psi_n = d_psi_n * d_psi;\n d_phi = d_phi + this.D[n] * d_psi_n;\n }\n\n // 4. Calculate latitude and longitude\n // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.\n var lat = this.lat0 + (d_phi * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"] * 1E5);\n var lon = this.long0 + d_lambda;\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}\n\nvar names = [\"New_Zealand_Map_Grid\", \"nzmg\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/nzmg.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/omerc.js": -/*!*****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/omerc.js ***! - \*****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n/* Initialize the Oblique Mercator projection\n ------------------------------------------*/\nfunction init() {\n this.no_off = this.no_off || false;\n this.no_rot = this.no_rot || false;\n\n if (isNaN(this.k0)) {\n this.k0 = 1;\n }\n var sinlat = Math.sin(this.lat0);\n var coslat = Math.cos(this.lat0);\n var con = this.e * sinlat;\n\n this.bl = Math.sqrt(1 + this.es / (1 - this.es) * Math.pow(coslat, 4));\n this.al = this.a * this.bl * this.k0 * Math.sqrt(1 - this.es) / (1 - con * con);\n var t0 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat0, sinlat);\n var dl = this.bl / coslat * Math.sqrt((1 - this.es) / (1 - con * con));\n if (dl * dl < 1) {\n dl = 1;\n }\n var fl;\n var gl;\n if (!isNaN(this.longc)) {\n //Central point and azimuth method\n\n if (this.lat0 >= 0) {\n fl = dl + Math.sqrt(dl * dl - 1);\n }\n else {\n fl = dl - Math.sqrt(dl * dl - 1);\n }\n this.el = fl * Math.pow(t0, this.bl);\n gl = 0.5 * (fl - 1 / fl);\n this.gamma0 = Math.asin(Math.sin(this.alpha) / dl);\n this.long0 = this.longc - Math.asin(gl * Math.tan(this.gamma0)) / this.bl;\n\n }\n else {\n //2 points method\n var t1 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat1, Math.sin(this.lat1));\n var t2 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat2, Math.sin(this.lat2));\n if (this.lat0 >= 0) {\n this.el = (dl + Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n else {\n this.el = (dl - Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n var hl = Math.pow(t1, this.bl);\n var ll = Math.pow(t2, this.bl);\n fl = this.el / hl;\n gl = 0.5 * (fl - 1 / fl);\n var jl = (this.el * this.el - ll * hl) / (this.el * this.el + ll * hl);\n var pl = (ll - hl) / (ll + hl);\n var dlon12 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long1 - this.long2);\n this.long0 = 0.5 * (this.long1 + this.long2) - Math.atan(jl * Math.tan(0.5 * this.bl * (dlon12)) / pl) / this.bl;\n this.long0 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0);\n var dlon10 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long1 - this.long0);\n this.gamma0 = Math.atan(Math.sin(this.bl * (dlon10)) / gl);\n this.alpha = Math.asin(dl * Math.sin(this.gamma0));\n }\n\n if (this.no_off) {\n this.uc = 0;\n }\n else {\n if (this.lat0 >= 0) {\n this.uc = this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n else {\n this.uc = -1 * this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n }\n\n}\n\n/* Oblique Mercator forward equations--mapping lat,long to x,y\n ----------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n var us, vs;\n var con;\n if (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n if (lat > 0) {\n con = -1;\n }\n else {\n con = 1;\n }\n vs = this.al / this.bl * Math.log(Math.tan(_constants_values__WEBPACK_IMPORTED_MODULE_3__[\"FORTPI\"] + con * this.gamma0 * 0.5));\n us = -1 * con * _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"] * this.al / this.bl;\n }\n else {\n var t = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, lat, Math.sin(lat));\n var ql = this.el / Math.pow(t, this.bl);\n var sl = 0.5 * (ql - 1 / ql);\n var tl = 0.5 * (ql + 1 / ql);\n var vl = Math.sin(this.bl * (dlon));\n var ul = (sl * Math.sin(this.gamma0) - vl * Math.cos(this.gamma0)) / tl;\n if (Math.abs(Math.abs(ul) - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n vs = Number.POSITIVE_INFINITY;\n }\n else {\n vs = 0.5 * this.al * Math.log((1 - ul) / (1 + ul)) / this.bl;\n }\n if (Math.abs(Math.cos(this.bl * (dlon))) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n us = this.al * this.bl * (dlon);\n }\n else {\n us = this.al * Math.atan2(sl * Math.cos(this.gamma0) + vl * Math.sin(this.gamma0), Math.cos(this.bl * dlon)) / this.bl;\n }\n }\n\n if (this.no_rot) {\n p.x = this.x0 + us;\n p.y = this.y0 + vs;\n }\n else {\n\n us -= this.uc;\n p.x = this.x0 + vs * Math.cos(this.alpha) + us * Math.sin(this.alpha);\n p.y = this.y0 + us * Math.cos(this.alpha) - vs * Math.sin(this.alpha);\n }\n return p;\n}\n\nfunction inverse(p) {\n var us, vs;\n if (this.no_rot) {\n vs = p.y - this.y0;\n us = p.x - this.x0;\n }\n else {\n vs = (p.x - this.x0) * Math.cos(this.alpha) - (p.y - this.y0) * Math.sin(this.alpha);\n us = (p.y - this.y0) * Math.cos(this.alpha) + (p.x - this.x0) * Math.sin(this.alpha);\n us += this.uc;\n }\n var qp = Math.exp(-1 * this.bl * vs / this.al);\n var sp = 0.5 * (qp - 1 / qp);\n var tp = 0.5 * (qp + 1 / qp);\n var vp = Math.sin(this.bl * us / this.al);\n var up = (vp * Math.cos(this.gamma0) + sp * Math.sin(this.gamma0)) / tp;\n var ts = Math.pow(this.el / Math.sqrt((1 + up) / (1 - up)), 1 / this.bl);\n if (Math.abs(up - 1) < _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"];\n }\n else if (Math.abs(up + 1) < _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = -1 * _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"];\n }\n else {\n p.y = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, ts);\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0 - Math.atan2(sp * Math.cos(this.gamma0) - vp * Math.sin(this.gamma0), Math.cos(this.bl * us / this.al)) / this.bl);\n }\n return p;\n}\n\nvar names = [\"Hotine_Oblique_Mercator\", \"Hotine Oblique Mercator\", \"Hotine_Oblique_Mercator_Azimuth_Natural_Origin\", \"Hotine_Oblique_Mercator_Azimuth_Center\", \"omerc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/omerc.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/ortho.js": -/*!*****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/ortho.js ***! - \*****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\nfunction init() {\n //double temp; /* temporary variable */\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n}\n\n/* Orthographic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\nfunction forward(p) {\n var sinphi, cosphi; /* sin and cos value */\n var dlon; /* delta longitude value */\n var coslon; /* cos of longitude */\n var ksp; /* scale factor */\n var g, x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n\n sinphi = Math.sin(lat);\n cosphi = Math.cos(lat);\n\n coslon = Math.cos(dlon);\n g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;\n ksp = 1;\n if ((g > 0) || (Math.abs(g) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"])) {\n x = this.a * ksp * cosphi * Math.sin(dlon);\n y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);\n }\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var rh; /* height above ellipsoid */\n var z; /* angle */\n var sinz, cosz; /* sin of z and cos of z */\n var con;\n var lon, lat;\n /* Inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n z = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(rh / this.a);\n\n sinz = Math.sin(z);\n cosz = Math.cos(z);\n\n lon = this.long0;\n if (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"]) {\n lat = this.lat0;\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(cosz * this.sin_p14 + (p.y * sinz * this.cos_p14) / rh);\n con = Math.abs(this.lat0) - _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"HALF_PI\"];\n if (Math.abs(con) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"]) {\n if (this.lat0 >= 0) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, - p.y));\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 - Math.atan2(-p.x, p.y));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"ortho\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/ortho.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/poly.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/poly.js ***! - \****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_gN__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/gN */ \"./node_modules/proj4/lib/common/gN.js\");\n\n\n\n\n\n\n\n\n\n\nvar MAX_ITER = 20;\n\nfunction init() {\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles\n this.e = Math.sqrt(this.es);\n this.e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.es);\n this.e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n this.e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n this.ml0 = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat0); //si que des zeros le calcul ne se fait pas\n}\n\n/* Polyconic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y, el;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(lon - this.long0);\n el = dlon * Math.sin(lat);\n if (this.sphere) {\n if (Math.abs(lat) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n x = this.a * dlon;\n y = -1 * this.a * this.lat0;\n }\n else {\n x = this.a * Math.sin(el) / Math.tan(lat);\n y = this.a * (Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));\n }\n }\n else {\n if (Math.abs(lat) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n x = this.a * dlon;\n y = -1 * this.ml0;\n }\n else {\n var nl = Object(_common_gN__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.a, this.e, Math.sin(lat)) / Math.tan(lat);\n x = nl * Math.sin(el);\n y = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));\n }\n\n }\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n var lon, lat, x, y, i;\n var al, bl;\n var phi, dphi;\n x = p.x - this.x0;\n y = p.y - this.y0;\n\n if (this.sphere) {\n if (Math.abs(y + this.a * this.lat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(x / this.a + this.long0);\n lat = 0;\n }\n else {\n al = this.lat0 + y / this.a;\n bl = x * x / this.a / this.a + al * al;\n phi = al;\n var tanphi;\n for (i = MAX_ITER; i; --i) {\n tanphi = Math.tan(phi);\n dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1);\n phi += dphi;\n if (Math.abs(dphi) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lat = phi;\n break;\n }\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat));\n }\n }\n else {\n if (Math.abs(y + this.ml0) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lat = 0;\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.long0 + x / this.a);\n }\n else {\n\n al = (this.ml0 + y) / this.a;\n bl = x * x / this.a / this.a + al * al;\n phi = al;\n var cl, mln, mlnp, ma;\n var con;\n for (i = MAX_ITER; i; --i) {\n con = this.e * Math.sin(phi);\n cl = Math.sqrt(1 - con * con) * Math.tan(phi);\n mln = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.e0, this.e1, this.e2, this.e3, phi);\n mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi);\n ma = mln / this.a;\n dphi = (al * (cl * ma + 1) - ma - 0.5 * cl * (ma * ma + bl)) / (this.es * Math.sin(2 * phi) * (ma * ma + bl - 2 * al * ma) / (4 * cl) + (al - ma) * (cl * mlnp - 2 / Math.sin(2 * phi)) - mlnp);\n phi -= dphi;\n if (Math.abs(dphi) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lat = phi;\n break;\n }\n }\n\n //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);\n cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));\n }\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Polyconic\", \"poly\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/poly.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/qsc.js": -/*!***************************************************!*\ - !*** ./node_modules/proj4/lib/projections/qsc.js ***! - \***************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n// QSC projection rewritten from the original PROJ4\n// https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c\n\n\n\n/* constants */\nvar FACE_ENUM = {\n FRONT: 1,\n RIGHT: 2,\n BACK: 3,\n LEFT: 4,\n TOP: 5,\n BOTTOM: 6\n};\n\nvar AREA_ENUM = {\n AREA_0: 1,\n AREA_1: 2,\n AREA_2: 3,\n AREA_3: 4\n};\n\nfunction init() {\n\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n this.lat_ts = this.lat_ts || 0;\n this.title = this.title || \"Quadrilateralized Spherical Cube\";\n\n /* Determine the cube face from the center of projection. */\n if (this.lat0 >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] / 2.0) {\n this.face = FACE_ENUM.TOP;\n } else if (this.lat0 <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] / 2.0)) {\n this.face = FACE_ENUM.BOTTOM;\n } else if (Math.abs(this.long0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n this.face = FACE_ENUM.FRONT;\n } else if (Math.abs(this.long0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n this.face = this.long0 > 0.0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT;\n } else {\n this.face = FACE_ENUM.BACK;\n }\n\n /* Fill in useful values for the ellipsoid <-> sphere shift\n * described in [LK12]. */\n if (this.es !== 0) {\n this.one_minus_f = 1 - (this.a - this.b) / this.a;\n this.one_minus_f_squared = this.one_minus_f * this.one_minus_f;\n }\n}\n\n// QSC forward equations--mapping lat,long to x,y\n// -----------------------------------------------------------------\nfunction forward(p) {\n var xy = {x: 0, y: 0};\n var lat, lon;\n var theta, phi;\n var t, mu;\n /* nu; */\n var area = {value: 0};\n\n // move lon according to projection's lon\n p.x -= this.long0;\n\n /* Convert the geodetic latitude to a geocentric latitude.\n * This corresponds to the shift from the ellipsoid to the sphere\n * described in [LK12]. */\n if (this.es !== 0) {//if (P->es != 0) {\n lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));\n } else {\n lat = p.y;\n }\n\n /* Convert the input lat, lon into theta, phi as used by QSC.\n * This depends on the cube face and the area on it.\n * For the top and bottom face, we can compute theta and phi\n * directly from phi, lam. For the other faces, we must use\n * unit sphere cartesian coordinates as an intermediate step. */\n lon = p.x; //lon = lp.lam;\n if (this.face === FACE_ENUM.TOP) {\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - lat;\n if (lon >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (lon > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] || lon <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_1;\n theta = (lon > 0.0 ? lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (lon > -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) && lon <= -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_2;\n theta = lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = lon;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + lat;\n if (lon >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = -lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (lon < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon >= -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_1;\n theta = -lon;\n } else if (lon < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon >= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_2;\n theta = -lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = (lon > 0.0 ? -lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : -lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n }\n } else {\n var q, r, s;\n var sinlat, coslat;\n var sinlon, coslon;\n\n if (this.face === FACE_ENUM.RIGHT) {\n lon = qsc_shift_lon_origin(lon, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n } else if (this.face === FACE_ENUM.BACK) {\n lon = qsc_shift_lon_origin(lon, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (this.face === FACE_ENUM.LEFT) {\n lon = qsc_shift_lon_origin(lon, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n sinlat = Math.sin(lat);\n coslat = Math.cos(lat);\n sinlon = Math.sin(lon);\n coslon = Math.cos(lon);\n q = coslat * coslon;\n r = coslat * sinlon;\n s = sinlat;\n\n if (this.face === FACE_ENUM.FRONT) {\n phi = Math.acos(q);\n theta = qsc_fwd_equat_face_theta(phi, s, r, area);\n } else if (this.face === FACE_ENUM.RIGHT) {\n phi = Math.acos(r);\n theta = qsc_fwd_equat_face_theta(phi, s, -q, area);\n } else if (this.face === FACE_ENUM.BACK) {\n phi = Math.acos(-q);\n theta = qsc_fwd_equat_face_theta(phi, s, -r, area);\n } else if (this.face === FACE_ENUM.LEFT) {\n phi = Math.acos(-r);\n theta = qsc_fwd_equat_face_theta(phi, s, q, area);\n } else {\n /* Impossible */\n phi = theta = 0;\n area.value = AREA_ENUM.AREA_0;\n }\n }\n\n /* Compute mu and nu for the area of definition.\n * For mu, see Eq. (3-21) in [OL76], but note the typos:\n * compare with Eq. (3-14). For nu, see Eq. (3-38). */\n mu = Math.atan((12 / _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) * (theta + Math.acos(Math.sin(theta) * Math.cos(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]));\n t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));\n\n /* Apply the result to the real area. */\n if (area.value === AREA_ENUM.AREA_1) {\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_2) {\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"];\n } else if (area.value === AREA_ENUM.AREA_3) {\n mu += 1.5 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"];\n }\n\n /* Now compute x, y from mu and nu */\n xy.x = t * Math.cos(mu);\n xy.y = t * Math.sin(mu);\n xy.x = xy.x * this.a + this.x0;\n xy.y = xy.y * this.a + this.y0;\n\n p.x = xy.x;\n p.y = xy.y;\n return p;\n}\n\n// QSC inverse equations--mapping x,y to lat/long\n// -----------------------------------------------------------------\nfunction inverse(p) {\n var lp = {lam: 0, phi: 0};\n var mu, nu, cosmu, tannu;\n var tantheta, theta, cosphi, phi;\n var t;\n var area = {value: 0};\n\n /* de-offset */\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n /* Convert the input x, y to the mu and nu angles as used by QSC.\n * This depends on the area of the cube face. */\n nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y));\n mu = Math.atan2(p.y, p.x);\n if (p.x >= 0.0 && p.x >= Math.abs(p.y)) {\n area.value = AREA_ENUM.AREA_0;\n } else if (p.y >= 0.0 && p.y >= Math.abs(p.x)) {\n area.value = AREA_ENUM.AREA_1;\n mu -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (p.x < 0.0 && -p.x >= Math.abs(p.y)) {\n area.value = AREA_ENUM.AREA_2;\n mu = (mu < 0.0 ? mu + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : mu - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else {\n area.value = AREA_ENUM.AREA_3;\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n }\n\n /* Compute phi and theta for the area of definition.\n * The inverse projection is not described in the original paper, but some\n * good hints can be found here (as of 2011-12-14):\n * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302\n * (search for \"Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>\") */\n t = (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] / 12) * Math.tan(mu);\n tantheta = Math.sin(t) / (Math.cos(t) - (1 / Math.sqrt(2)));\n theta = Math.atan(tantheta);\n cosmu = Math.cos(mu);\n tannu = Math.tan(nu);\n cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta))));\n if (cosphi < -1) {\n cosphi = -1;\n } else if (cosphi > +1) {\n cosphi = +1;\n }\n\n /* Apply the result to the real area on the cube face.\n * For the top and bottom face, we can compute phi and lam directly.\n * For the other faces, we must use unit sphere cartesian coordinates\n * as an intermediate step. */\n if (this.face === FACE_ENUM.TOP) {\n phi = Math.acos(cosphi);\n lp.phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - phi;\n if (area.value === AREA_ENUM.AREA_0) {\n lp.lam = theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_1) {\n lp.lam = (theta < 0.0 ? theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (area.value === AREA_ENUM.AREA_2) {\n lp.lam = theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else /* area.value == AREA_ENUM.AREA_3 */ {\n lp.lam = theta;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = Math.acos(cosphi);\n lp.phi = phi - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n if (area.value === AREA_ENUM.AREA_0) {\n lp.lam = -theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_1) {\n lp.lam = -theta;\n } else if (area.value === AREA_ENUM.AREA_2) {\n lp.lam = -theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else /* area.value == AREA_ENUM.AREA_3 */ {\n lp.lam = (theta < 0.0 ? -theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : -theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n }\n } else {\n /* Compute phi and lam via cartesian unit sphere coordinates. */\n var q, r, s;\n q = cosphi;\n t = q * q;\n if (t >= 1) {\n s = 0;\n } else {\n s = Math.sqrt(1 - t) * Math.sin(theta);\n }\n t += s * s;\n if (t >= 1) {\n r = 0;\n } else {\n r = Math.sqrt(1 - t);\n }\n /* Rotate q,r,s into the correct area. */\n if (area.value === AREA_ENUM.AREA_1) {\n t = r;\n r = -s;\n s = t;\n } else if (area.value === AREA_ENUM.AREA_2) {\n r = -r;\n s = -s;\n } else if (area.value === AREA_ENUM.AREA_3) {\n t = r;\n r = s;\n s = -t;\n }\n /* Rotate q,r,s into the correct cube face. */\n if (this.face === FACE_ENUM.RIGHT) {\n t = q;\n q = -r;\n r = t;\n } else if (this.face === FACE_ENUM.BACK) {\n q = -q;\n r = -r;\n } else if (this.face === FACE_ENUM.LEFT) {\n t = q;\n q = r;\n r = -t;\n }\n /* Now compute phi and lam from the unit sphere coordinates. */\n lp.phi = Math.acos(-s) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n lp.lam = Math.atan2(r, q);\n if (this.face === FACE_ENUM.RIGHT) {\n lp.lam = qsc_shift_lon_origin(lp.lam, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n } else if (this.face === FACE_ENUM.BACK) {\n lp.lam = qsc_shift_lon_origin(lp.lam, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (this.face === FACE_ENUM.LEFT) {\n lp.lam = qsc_shift_lon_origin(lp.lam, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n }\n\n /* Apply the shift from the sphere to the ellipsoid as described\n * in [LK12]. */\n if (this.es !== 0) {\n var invert_sign;\n var tanphi, xa;\n invert_sign = (lp.phi < 0 ? 1 : 0);\n tanphi = Math.tan(lp.phi);\n xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared);\n lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa));\n if (invert_sign) {\n lp.phi = -lp.phi;\n }\n }\n\n lp.lam += this.long0;\n p.x = lp.lam;\n p.y = lp.phi;\n return p;\n}\n\n/* Helper function for forward projection: compute the theta angle\n * and determine the area number. */\nfunction qsc_fwd_equat_face_theta(phi, y, x, area) {\n var theta;\n if (phi < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = 0.0;\n } else {\n theta = Math.atan2(y, x);\n if (Math.abs(theta) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n } else if (theta > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && theta <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_1;\n theta -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (theta > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] || theta <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_2;\n theta = (theta >= 0.0 ? theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n }\n }\n return theta;\n}\n\n/* Helper function: shift the longitude. */\nfunction qsc_shift_lon_origin(lon, offset) {\n var slon = lon + offset;\n if (slon < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) {\n slon += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"];\n } else if (slon > +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) {\n slon -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"];\n }\n return slon;\n}\n\nvar names = [\"Quadrilateralized Spherical Cube\", \"Quadrilateralized_Spherical_Cube\", \"qsc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/qsc.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/robin.js": -/*!*****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/robin.js ***! - \*****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n// Robinson projection\n// Based on https://github.com/OSGeo/proj.4/blob/master/src/PJ_robin.c\n// Polynomial coeficients from http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039\n\n\n\n\nvar COEFS_X = [\n [1.0000, 2.2199e-17, -7.15515e-05, 3.1103e-06],\n [0.9986, -0.000482243, -2.4897e-05, -1.3309e-06],\n [0.9954, -0.00083103, -4.48605e-05, -9.86701e-07],\n [0.9900, -0.00135364, -5.9661e-05, 3.6777e-06],\n [0.9822, -0.00167442, -4.49547e-06, -5.72411e-06],\n [0.9730, -0.00214868, -9.03571e-05, 1.8736e-08],\n [0.9600, -0.00305085, -9.00761e-05, 1.64917e-06],\n [0.9427, -0.00382792, -6.53386e-05, -2.6154e-06],\n [0.9216, -0.00467746, -0.00010457, 4.81243e-06],\n [0.8962, -0.00536223, -3.23831e-05, -5.43432e-06],\n [0.8679, -0.00609363, -0.000113898, 3.32484e-06],\n [0.8350, -0.00698325, -6.40253e-05, 9.34959e-07],\n [0.7986, -0.00755338, -5.00009e-05, 9.35324e-07],\n [0.7597, -0.00798324, -3.5971e-05, -2.27626e-06],\n [0.7186, -0.00851367, -7.01149e-05, -8.6303e-06],\n [0.6732, -0.00986209, -0.000199569, 1.91974e-05],\n [0.6213, -0.010418, 8.83923e-05, 6.24051e-06],\n [0.5722, -0.00906601, 0.000182, 6.24051e-06],\n [0.5322, -0.00677797, 0.000275608, 6.24051e-06]\n];\n\nvar COEFS_Y = [\n [-5.20417e-18, 0.0124, 1.21431e-18, -8.45284e-11],\n [0.0620, 0.0124, -1.26793e-09, 4.22642e-10],\n [0.1240, 0.0124, 5.07171e-09, -1.60604e-09],\n [0.1860, 0.0123999, -1.90189e-08, 6.00152e-09],\n [0.2480, 0.0124002, 7.10039e-08, -2.24e-08],\n [0.3100, 0.0123992, -2.64997e-07, 8.35986e-08],\n [0.3720, 0.0124029, 9.88983e-07, -3.11994e-07],\n [0.4340, 0.0123893, -3.69093e-06, -4.35621e-07],\n [0.4958, 0.0123198, -1.02252e-05, -3.45523e-07],\n [0.5571, 0.0121916, -1.54081e-05, -5.82288e-07],\n [0.6176, 0.0119938, -2.41424e-05, -5.25327e-07],\n [0.6769, 0.011713, -3.20223e-05, -5.16405e-07],\n [0.7346, 0.0113541, -3.97684e-05, -6.09052e-07],\n [0.7903, 0.0109107, -4.89042e-05, -1.04739e-06],\n [0.8435, 0.0103431, -6.4615e-05, -1.40374e-09],\n [0.8936, 0.00969686, -6.4636e-05, -8.547e-06],\n [0.9394, 0.00840947, -0.000192841, -4.2106e-06],\n [0.9761, 0.00616527, -0.000256, -4.2106e-06],\n [1.0000, 0.00328947, -0.000319159, -4.2106e-06]\n];\n\nvar FXC = 0.8487;\nvar FYC = 1.3523;\nvar C1 = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"]/5; // rad to 5-degree interval\nvar RC1 = 1/C1;\nvar NODES = 18;\n\nvar poly3_val = function(coefs, x) {\n return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3]));\n};\n\nvar poly3_der = function(coefs, x) {\n return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]);\n};\n\nfunction newton_rapshon(f_df, start, max_err, iters) {\n var x = start;\n for (; iters; --iters) {\n var upd = f_df(x);\n x -= upd;\n if (Math.abs(upd) < max_err) {\n break;\n }\n }\n return x;\n}\n\nfunction init() {\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.long0 = this.long0 || 0;\n this.es = 0;\n this.title = this.title || \"Robinson\";\n}\n\nfunction forward(ll) {\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(ll.x - this.long0);\n\n var dphi = Math.abs(ll.y);\n var i = Math.floor(dphi * C1);\n if (i < 0) {\n i = 0;\n } else if (i >= NODES) {\n i = NODES - 1;\n }\n dphi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"] * (dphi - RC1 * i);\n var xy = {\n x: poly3_val(COEFS_X[i], dphi) * lon,\n y: poly3_val(COEFS_Y[i], dphi)\n };\n if (ll.y < 0) {\n xy.y = -xy.y;\n }\n\n xy.x = xy.x * this.a * FXC + this.x0;\n xy.y = xy.y * this.a * FYC + this.y0;\n return xy;\n}\n\nfunction inverse(xy) {\n var ll = {\n x: (xy.x - this.x0) / (this.a * FXC),\n y: Math.abs(xy.y - this.y0) / (this.a * FYC)\n };\n\n if (ll.y >= 1) { // pathologic case\n ll.x /= COEFS_X[NODES][0];\n ll.y = xy.y < 0 ? -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] : _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n // find table interval\n var i = Math.floor(ll.y * NODES);\n if (i < 0) {\n i = 0;\n } else if (i >= NODES) {\n i = NODES - 1;\n }\n for (;;) {\n if (COEFS_Y[i][0] > ll.y) {\n --i;\n } else if (COEFS_Y[i+1][0] <= ll.y) {\n ++i;\n } else {\n break;\n }\n }\n // linear interpolation in 5 degree interval\n var coefs = COEFS_Y[i];\n var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i+1][0] - coefs[0]);\n // find t so that poly3_val(coefs, t) = ll.y\n t = newton_rapshon(function(x) {\n return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x);\n }, t, _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"], 100);\n\n ll.x /= poly3_val(COEFS_X[i], t);\n ll.y = (5 * i + t) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n if (xy.y < 0) {\n ll.y = -ll.y;\n }\n }\n\n ll.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(ll.x + this.long0);\n return ll;\n}\n\nvar names = [\"Robinson\", \"robin\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/robin.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/sinu.js": -/*!****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/sinu.js ***! - \****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_pj_enfn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pj_enfn */ \"./node_modules/proj4/lib/common/pj_enfn.js\");\n/* harmony import */ var _common_pj_mlfn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/pj_mlfn */ \"./node_modules/proj4/lib/common/pj_mlfn.js\");\n/* harmony import */ var _common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/pj_inv_mlfn */ \"./node_modules/proj4/lib/common/pj_inv_mlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n\n\n\nvar MAX_ITER = 20;\n\n\n\n\n\n\n\nfunction init() {\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n\n\n if (!this.sphere) {\n this.en = Object(_common_pj_enfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n }\n else {\n this.n = 1;\n this.m = 0;\n this.es = 0;\n this.C_y = Math.sqrt((this.m + 1) / this.n);\n this.C_x = this.C_y / (this.m + 1);\n }\n\n}\n\n/* Sinusoidal forward equations--mapping lat,long to x,y\n -----------------------------------------------------*/\nfunction forward(p) {\n var x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n\n if (this.sphere) {\n if (!this.m) {\n lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat;\n }\n else {\n var k = this.n * Math.sin(lat);\n for (var i = MAX_ITER; i; --i) {\n var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat));\n lat -= V;\n if (Math.abs(V) < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n break;\n }\n }\n }\n x = this.a * this.C_x * lon * (this.m + Math.cos(lat));\n y = this.a * this.C_y * lat;\n\n }\n else {\n\n var s = Math.sin(lat);\n var c = Math.cos(lat);\n y = this.a * Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lat, s, c, this.en);\n x = this.a * lon * c / Math.sqrt(1 - this.es * s * s);\n }\n\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var lat, temp, lon, s;\n\n p.x -= this.x0;\n lon = p.x / this.a;\n p.y -= this.y0;\n lat = p.y / this.a;\n\n if (this.sphere) {\n lat /= this.C_y;\n lon = lon / (this.C_x * (this.m + Math.cos(lat)));\n if (this.m) {\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_6__[\"default\"])((this.m * lat + Math.sin(lat)) / this.n);\n }\n else if (this.n !== 1) {\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(Math.sin(lat) / this.n);\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon + this.long0);\n lat = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat);\n }\n else {\n lat = Object(_common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(p.y / this.a, this.es, this.en);\n s = Math.abs(lat);\n if (s < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"]) {\n s = Math.sin(lat);\n temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat));\n //temp = this.long0 + p.x / (this.a * Math.cos(lat));\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(temp);\n }\n else if ((s - _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"]) {\n lon = this.long0;\n }\n }\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Sinusoidal\", \"sinu\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/sinu.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/somerc.js": -/*!******************************************************!*\ - !*** ./node_modules/proj4/lib/projections/somerc.js ***! - \******************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/*\n references:\n Formules et constantes pour le Calcul pour la\n projection cylindrique conforme à axe oblique et pour la transformation entre\n des systèmes de référence.\n http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf\n */\n\nfunction init() {\n var phy0 = this.lat0;\n this.lambda0 = this.long0;\n var sinPhy0 = Math.sin(phy0);\n var semiMajorAxis = this.a;\n var invF = this.rf;\n var flattening = 1 / invF;\n var e2 = 2 * flattening - Math.pow(flattening, 2);\n var e = this.e = Math.sqrt(e2);\n this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2));\n this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4));\n this.b0 = Math.asin(sinPhy0 / this.alpha);\n var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2));\n var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2));\n var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0));\n this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;\n}\n\nfunction forward(p) {\n var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));\n var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));\n var S = -this.alpha * (Sa1 + Sa2) + this.K;\n\n // spheric latitude\n var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4);\n\n // spheric longitude\n var I = this.alpha * (p.x - this.lambda0);\n\n // psoeudo equatorial rotation\n var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I)));\n\n var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I));\n\n p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0;\n p.x = this.R * rotI + this.x0;\n return p;\n}\n\nfunction inverse(p) {\n var Y = p.x - this.x0;\n var X = p.y - this.y0;\n\n var rotI = Y / this.R;\n var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4);\n\n var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI));\n var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB)));\n\n var lambda = this.lambda0 + I / this.alpha;\n\n var S = 0;\n var phy = b;\n var prevPhy = -1000;\n var iteration = 0;\n while (Math.abs(phy - prevPhy) > 0.0000001) {\n if (++iteration > 20) {\n //...reportError(\"omercFwdInfinity\");\n return;\n }\n //S = Math.log(Math.tan(Math.PI / 4 + phy / 2));\n S = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + b / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(phy)) / 2));\n prevPhy = phy;\n phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2;\n }\n\n p.x = lambda;\n p.y = phy;\n return p;\n}\n\nvar names = [\"somerc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/somerc.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/stere.js": -/*!*****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/stere.js ***! - \*****************************************************/ -/*! exports provided: ssfn_, init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ssfn_\", function() { return ssfn_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_sign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/sign */ \"./node_modules/proj4/lib/common/sign.js\");\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\n\n\n\n\n\nfunction ssfn_(phit, sinphi, eccen) {\n sinphi *= eccen;\n return (Math.tan(0.5 * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen));\n}\n\nfunction init() {\n this.coslat0 = Math.cos(this.lat0);\n this.sinlat0 = Math.sin(this.lat0);\n if (this.sphere) {\n if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.k0 = 0.5 * (1 + Object(_common_sign__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0) * Math.sin(this.lat_ts));\n }\n }\n else {\n if (Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (this.lat0 > 0) {\n //North pole\n //trace('stere:north pole');\n this.con = 1;\n }\n else {\n //South pole\n //trace('stere:south pole');\n this.con = -1;\n }\n }\n this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));\n if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.k0 = 0.5 * this.cons * Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts));\n }\n this.ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, this.sinlat0, this.coslat0);\n this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n this.cosX0 = Math.cos(this.X0);\n this.sinX0 = Math.sin(this.X0);\n }\n}\n\n// Stereographic forward equations--mapping lat,long to x,y\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var sinlat = Math.sin(lat);\n var coslat = Math.cos(lat);\n var A, X, sinX, cosX, ts, rh;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(lon - this.long0);\n\n if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"] && Math.abs(lat + this.lat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n //case of the origine point\n //trace('stere:this is the origin point');\n p.x = NaN;\n p.y = NaN;\n return p;\n }\n if (this.sphere) {\n //trace('stere:sphere case');\n A = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon));\n p.x = this.a * A * coslat * Math.sin(dlon) + this.x0;\n p.y = this.a * A * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0;\n return p;\n }\n else {\n X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n cosX = Math.cos(X);\n sinX = Math.sin(X);\n if (Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n ts = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, lat * this.con, this.con * sinlat);\n rh = 2 * this.a * this.k0 * ts / this.cons;\n p.x = this.x0 + rh * Math.sin(lon - this.long0);\n p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0);\n //trace(p.toString());\n return p;\n }\n else if (Math.abs(this.sinlat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n //Eq\n //trace('stere:equateur');\n A = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon));\n p.y = A * sinX;\n }\n else {\n //other case\n //trace('stere:normal case');\n A = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon)));\n p.y = A * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0;\n }\n p.x = A * cosX * Math.sin(dlon) + this.x0;\n }\n //trace(p.toString());\n return p;\n}\n\n//* Stereographic inverse equations--mapping x,y to lat/long\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat, ts, ce, Chi;\n var rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (this.sphere) {\n var c = 2 * Math.atan(rh / (2 * this.a * this.k0));\n lon = this.long0;\n lat = this.lat0;\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);\n if (Math.abs(this.coslat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (this.lat0 > 0) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x, p.y));\n }\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n if (Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n lat = this.lat0;\n lon = this.long0;\n p.x = lon;\n p.y = lat;\n //trace(p.toString());\n return p;\n }\n p.x *= this.con;\n p.y *= this.con;\n ts = rh * this.cons / (2 * this.a * this.k0);\n lat = this.con * Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, ts);\n lon = this.con * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.con * this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));\n lon = this.long0;\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n Chi = this.X0;\n }\n else {\n Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));\n }\n lat = -1 * Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, Math.tan(0.5 * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + Chi)));\n }\n }\n p.x = lon;\n p.y = lat;\n\n //trace(p.toString());\n return p;\n\n}\n\nvar names = [\"stere\", \"Stereographic_South_Pole\", \"Polar Stereographic (variant B)\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names,\n ssfn_: ssfn_\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/stere.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/sterea.js": -/*!******************************************************!*\ - !*** ./node_modules/proj4/lib/projections/sterea.js ***! - \******************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _gauss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./gauss */ \"./node_modules/proj4/lib/projections/gauss.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\nfunction init() {\n _gauss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].init.apply(this);\n if (!this.rc) {\n return;\n }\n this.sinc0 = Math.sin(this.phic0);\n this.cosc0 = Math.cos(this.phic0);\n this.R2 = 2 * this.rc;\n if (!this.title) {\n this.title = \"Oblique Stereographic Alternative\";\n }\n}\n\nfunction forward(p) {\n var sinc, cosc, cosl, k;\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(p.x - this.long0);\n _gauss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forward.apply(this, [p]);\n sinc = Math.sin(p.y);\n cosc = Math.cos(p.y);\n cosl = Math.cos(p.x);\n k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);\n p.x = k * cosc * Math.sin(p.x);\n p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);\n p.x = this.a * p.x + this.x0;\n p.y = this.a * p.y + this.y0;\n return p;\n}\n\nfunction inverse(p) {\n var sinc, cosc, lon, lat, rho;\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n p.x /= this.k0;\n p.y /= this.k0;\n if ((rho = Math.sqrt(p.x * p.x + p.y * p.y))) {\n var c = 2 * Math.atan2(rho, this.R2);\n sinc = Math.sin(c);\n cosc = Math.cos(c);\n lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);\n lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);\n }\n else {\n lat = this.phic0;\n lon = 0;\n }\n\n p.x = lon;\n p.y = lat;\n _gauss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].inverse.apply(this, [p]);\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(p.x + this.long0);\n return p;\n}\n\nvar names = [\"Stereographic_North_Pole\", \"Oblique_Stereographic\", \"Polar_Stereographic\", \"sterea\",\"Oblique Stereographic Alternative\",\"Double_Stereographic\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/sterea.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/tmerc.js": -/*!*****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/tmerc.js ***! - \*****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_pj_enfn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/pj_enfn */ \"./node_modules/proj4/lib/common/pj_enfn.js\");\n/* harmony import */ var _common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pj_mlfn */ \"./node_modules/proj4/lib/common/pj_mlfn.js\");\n/* harmony import */ var _common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pj_inv_mlfn */ \"./node_modules/proj4/lib/common/pj_inv_mlfn.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_sign__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/sign */ \"./node_modules/proj4/lib/common/sign.js\");\n// Heavily based on this tmerc projection implementation\n// https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/tmerc.js\n\n\n\n\n\n\n\n\n\nfunction init() {\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n if (this.es) {\n this.en = Object(_common_pj_enfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.ml0 = Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);\n }\n}\n\n/**\n Transverse Mercator Forward - long/lat to x/y\n long/lat in radians\n */\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lon - this.long0);\n var con;\n var x, y;\n var sin_phi = Math.sin(lat);\n var cos_phi = Math.cos(lat);\n\n if (!this.es) {\n var b = cos_phi * Math.sin(delta_lon);\n\n if ((Math.abs(Math.abs(b) - 1)) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return (93);\n }\n else {\n x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;\n y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));\n b = Math.abs(y);\n\n if (b >= 1) {\n if ((b - 1) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return (93);\n }\n else {\n y = 0;\n }\n }\n else {\n y = Math.acos(y);\n }\n\n if (lat < 0) {\n y = -y;\n }\n\n y = this.a * this.k0 * (y - this.lat0) + this.y0;\n }\n }\n else {\n var al = cos_phi * delta_lon;\n var als = Math.pow(al, 2);\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var tq = Math.abs(cos_phi) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"] ? Math.tan(lat) : 0;\n var t = Math.pow(tq, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n al = al / Math.sqrt(con);\n var ml = Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat, sin_phi, cos_phi, this.en);\n\n x = this.a * (this.k0 * al * (1 +\n als / 6 * (1 - t + c +\n als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c +\n als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) +\n this.x0;\n\n y = this.a * (this.k0 * (ml - this.ml0 +\n sin_phi * delta_lon * al / 2 * (1 +\n als / 12 * (5 - t + 9 * c + 4 * cs +\n als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c +\n als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) +\n this.y0;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n}\n\n/**\n Transverse Mercator Inverse - x/y to long/lat\n */\nfunction inverse(p) {\n var con, phi;\n var lat, lon;\n var x = (p.x - this.x0) * (1 / this.a);\n var y = (p.y - this.y0) * (1 / this.a);\n\n if (!this.es) {\n var f = Math.exp(x / this.k0);\n var g = 0.5 * (f - 1 / f);\n var temp = this.lat0 + y / this.k0;\n var h = Math.cos(temp);\n con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2)));\n lat = Math.asin(con);\n\n if (y < 0) {\n lat = -lat;\n }\n\n if ((g === 0) && (h === 0)) {\n lon = 0;\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Math.atan2(g, h) + this.long0);\n }\n }\n else { // ellipsoidal form\n con = this.ml0 + y / this.k0;\n phi = Object(_common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(con, this.es, this.en);\n\n if (Math.abs(phi) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"]) {\n var sin_phi = Math.sin(phi);\n var cos_phi = Math.cos(phi);\n var tan_phi = Math.abs(cos_phi) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"] ? Math.tan(phi) : 0;\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var t = Math.pow(tan_phi, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n var d = x * Math.sqrt(con) / this.k0;\n var ds = Math.pow(d, 2);\n con = con * tan_phi;\n\n lat = phi - (con * ds / (1 - this.es)) * 0.5 * (1 -\n ds / 12 * (5 + 3 * t - 9 * c * t + c - 4 * cs -\n ds / 30 * (61 + 90 * t - 252 * c * t + 45 * ts + 46 * c -\n ds / 56 * (1385 + 3633 * t + 4095 * ts + 1574 * ts * t))));\n\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.long0 + (d * (1 -\n ds / 6 * (1 + 2 * t + c -\n ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c -\n ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi));\n }\n else {\n lat = _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"] * Object(_common_sign__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(y);\n lon = 0;\n }\n }\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}\n\nvar names = [\"Fast_Transverse_Mercator\", \"Fast Transverse Mercator\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/tmerc.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/tpers.js": -/*!*****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/tpers.js ***! - \*****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_hypot__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hypot */ \"./node_modules/proj4/lib/common/hypot.js\");\n\nvar mode = {\n N_POLE: 0,\n S_POLE: 1,\n EQUIT: 2,\n OBLIQ: 3\n};\n\n\n\n\nvar params = {\n h: { def: 100000, num: true }, // default is Karman line, no default in PROJ.7\n azi: { def: 0, num: true, degrees: true }, // default is North\n tilt: { def: 0, num: true, degrees: true }, // default is Nadir\n long0: { def: 0, num: true }, // default is Greenwich, conversion to rad is automatic\n lat0: { def: 0, num: true } // default is Equator, conversion to rad is automatic\n};\n\nfunction init() {\n Object.keys(params).forEach(function (p) {\n if (typeof this[p] === \"undefined\") {\n this[p] = params[p].def;\n } else if (params[p].num && isNaN(this[p])) {\n throw new Error(\"Invalid parameter value, must be numeric \" + p + \" = \" + this[p]);\n } else if (params[p].num) {\n this[p] = parseFloat(this[p]);\n }\n if (params[p].degrees) {\n this[p] = this[p] * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n }\n }.bind(this));\n\n if (Math.abs((Math.abs(this.lat0) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"])) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.lat0 < 0 ? mode.S_POLE : mode.N_POLE;\n } else if (Math.abs(this.lat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = mode.EQUIT;\n } else {\n this.mode = mode.OBLIQ;\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n\n this.pn1 = this.h / this.a; // Normalize relative to the Earth's radius\n\n if (this.pn1 <= 0 || this.pn1 > 1e10) {\n throw new Error(\"Invalid height\");\n }\n \n this.p = 1 + this.pn1;\n this.rp = 1 / this.p;\n this.h1 = 1 / this.pn1;\n this.pfact = (this.p + 1) * this.h1;\n this.es = 0;\n\n var omega = this.tilt;\n var gamma = this.azi;\n this.cg = Math.cos(gamma);\n this.sg = Math.sin(gamma);\n this.cw = Math.cos(omega);\n this.sw = Math.sin(omega);\n}\n\nfunction forward(p) {\n p.x -= this.long0;\n var sinphi = Math.sin(p.y);\n var cosphi = Math.cos(p.y);\n var coslam = Math.cos(p.x);\n var x, y;\n switch (this.mode) {\n case mode.OBLIQ:\n y = this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;\n break;\n case mode.EQUIT:\n y = cosphi * coslam;\n break;\n case mode.S_POLE:\n y = -sinphi;\n break;\n case mode.N_POLE:\n y = sinphi;\n break;\n }\n y = this.pn1 / (this.p - y);\n x = y * cosphi * Math.sin(p.x);\n\n switch (this.mode) {\n case mode.OBLIQ:\n y *= this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;\n break;\n case mode.EQUIT:\n y *= sinphi;\n break;\n case mode.N_POLE:\n y *= -(cosphi * coslam);\n break;\n case mode.S_POLE:\n y *= cosphi * coslam;\n break;\n }\n\n // Tilt \n var yt, ba;\n yt = y * this.cg + x * this.sg;\n ba = 1 / (yt * this.sw * this.h1 + this.cw);\n x = (x * this.cg - y * this.sg) * this.cw * ba;\n y = yt * ba;\n\n p.x = x * this.a;\n p.y = y * this.a;\n return p;\n}\n\nfunction inverse(p) {\n p.x /= this.a;\n p.y /= this.a;\n var r = { x: p.x, y: p.y };\n\n // Un-Tilt\n var bm, bq, yt;\n yt = 1 / (this.pn1 - p.y * this.sw);\n bm = this.pn1 * p.x * yt;\n bq = this.pn1 * p.y * this.cw * yt;\n p.x = bm * this.cg + bq * this.sg;\n p.y = bq * this.cg - bm * this.sg;\n\n var rh = Object(_common_hypot__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(p.x, p.y);\n if (Math.abs(rh) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n r.x = 0;\n r.y = p.y;\n } else {\n var cosz, sinz;\n sinz = 1 - rh * rh * this.pfact;\n sinz = (this.p - Math.sqrt(sinz)) / (this.pn1 / rh + rh / this.pn1);\n cosz = Math.sqrt(1 - sinz * sinz);\n switch (this.mode) {\n case mode.OBLIQ:\n r.y = Math.asin(cosz * this.sinph0 + p.y * sinz * this.cosph0 / rh);\n p.y = (cosz - this.sinph0 * Math.sin(r.y)) * rh;\n p.x *= sinz * this.cosph0;\n break;\n case mode.EQUIT:\n r.y = Math.asin(p.y * sinz / rh);\n p.y = cosz * rh;\n p.x *= sinz;\n break;\n case mode.N_POLE:\n r.y = Math.asin(cosz);\n p.y = -p.y;\n break;\n case mode.S_POLE:\n r.y = -Math.asin(cosz);\n break;\n }\n r.x = Math.atan2(p.x, p.y);\n }\n\n p.x = r.x + this.long0;\n p.y = r.y;\n return p;\n}\n\nvar names = [\"Tilted_Perspective\", \"tpers\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/tpers.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/utm.js": -/*!***************************************************!*\ - !*** ./node_modules/proj4/lib/projections/utm.js ***! - \***************************************************/ -/*! exports provided: dependsOn, init, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dependsOn\", function() { return dependsOn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_zone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_zone */ \"./node_modules/proj4/lib/common/adjust_zone.js\");\n/* harmony import */ var _etmerc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./etmerc */ \"./node_modules/proj4/lib/projections/etmerc.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\nvar dependsOn = 'etmerc';\n\n\n\nfunction init() {\n var zone = Object(_common_adjust_zone__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.zone, this.long0);\n if (zone === undefined) {\n throw new Error('unknown utm zone');\n }\n this.lat0 = 0;\n this.long0 = ((6 * Math.abs(zone)) - 183) * _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"D2R\"];\n this.x0 = 500000;\n this.y0 = this.utmSouth ? 10000000 : 0;\n this.k0 = 0.9996;\n\n _etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"].init.apply(this);\n this.forward = _etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"].forward;\n this.inverse = _etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"].inverse;\n}\n\nvar names = [\"Universal Transverse Mercator System\", \"utm\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n names: names,\n dependsOn: dependsOn\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/utm.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/projections/vandg.js": -/*!*****************************************************!*\ - !*** ./node_modules/proj4/lib/projections/vandg.js ***! - \*****************************************************/ -/*! exports provided: init, forward, inverse, names, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n\n\n\n\n\n\n/* Initialize the Van Der Grinten projection\n ----------------------------------------*/\nfunction init() {\n //this.R = 6370997; //Radius of earth\n this.R = this.a;\n}\n\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n /* Forward equations\n -----------------*/\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var x, y;\n\n if (Math.abs(lat) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n x = this.x0 + this.R * dlon;\n y = this.y0;\n }\n var theta = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(2 * Math.abs(lat / Math.PI));\n if ((Math.abs(dlon) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) || (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"])) {\n x = this.x0;\n if (lat >= 0) {\n y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta);\n }\n else {\n y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);\n }\n // return(OK);\n }\n var al = 0.5 * Math.abs((Math.PI / dlon) - (dlon / Math.PI));\n var asq = al * al;\n var sinth = Math.sin(theta);\n var costh = Math.cos(theta);\n\n var g = costh / (sinth + costh - 1);\n var gsq = g * g;\n var m = g * (2 / sinth - 1);\n var msq = m * m;\n var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq);\n if (dlon < 0) {\n con = -con;\n }\n x = this.x0 + con;\n //con = Math.abs(con / (Math.PI * this.R));\n var q = asq + g;\n con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq);\n if (lat >= 0) {\n //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);\n y = this.y0 + con;\n }\n else {\n //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);\n y = this.y0 - con;\n }\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Van Der Grinten inverse equations--mapping x,y to lat/long\n ---------------------------------------------------------*/\nfunction inverse(p) {\n var lon, lat;\n var xx, yy, xys, c1, c2, c3;\n var a1;\n var m1;\n var con;\n var th1;\n var d;\n\n /* inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n con = Math.PI * this.R;\n xx = p.x / con;\n yy = p.y / con;\n xys = xx * xx + yy * yy;\n c1 = -Math.abs(yy) * (1 + xys);\n c2 = c1 - 2 * yy * yy + xx * xx;\n c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;\n d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;\n a1 = (c1 - c2 * c2 / 3 / c3) / c3;\n m1 = 2 * Math.sqrt(-a1 / 3);\n con = ((3 * d) / a1) / m1;\n if (Math.abs(con) > 1) {\n if (con >= 0) {\n con = 1;\n }\n else {\n con = -1;\n }\n }\n th1 = Math.acos(con) / 3;\n if (p.y >= 0) {\n lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n else {\n lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n\n if (Math.abs(xx) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n lon = this.long0;\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Van_der_Grinten_I\", \"VanDerGrinten\", \"vandg\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/vandg.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/lib/transform.js": -/*!*********************************************!*\ - !*** ./node_modules/proj4/lib/transform.js ***! - \*********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return transform; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _datum_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./datum_transform */ \"./node_modules/proj4/lib/datum_transform.js\");\n/* harmony import */ var _adjust_axis__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./adjust_axis */ \"./node_modules/proj4/lib/adjust_axis.js\");\n/* harmony import */ var _Proj__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Proj */ \"./node_modules/proj4/lib/Proj.js\");\n/* harmony import */ var _common_toPoint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./common/toPoint */ \"./node_modules/proj4/lib/common/toPoint.js\");\n/* harmony import */ var _checkSanity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./checkSanity */ \"./node_modules/proj4/lib/checkSanity.js\");\n\n\n\n\n\n\n\nfunction checkNotWGS(source, dest) {\n return ((source.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"] || source.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) && dest.datumCode !== 'WGS84') || ((dest.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"] || dest.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) && source.datumCode !== 'WGS84');\n}\n\nfunction transform(source, dest, point) {\n var wgs84;\n if (Array.isArray(point)) {\n point = Object(_common_toPoint__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(point);\n }\n Object(_checkSanity__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(point);\n // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84\n if (source.datum && dest.datum && checkNotWGS(source, dest)) {\n wgs84 = new _Proj__WEBPACK_IMPORTED_MODULE_3__[\"default\"]('WGS84');\n point = transform(source, wgs84, point);\n source = wgs84;\n }\n // DGR, 2010/11/12\n if (source.axis !== 'enu') {\n point = Object(_adjust_axis__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(source, false, point);\n }\n // Transform source points to long/lat, if they aren't already.\n if (source.projName === 'longlat') {\n point = {\n x: point.x * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"],\n y: point.y * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"],\n z: point.z || 0\n };\n } else {\n if (source.to_meter) {\n point = {\n x: point.x * source.to_meter,\n y: point.y * source.to_meter,\n z: point.z || 0\n };\n }\n point = source.inverse(point); // Convert Cartesian to longlat\n if (!point) {\n return;\n }\n }\n // Adjust for the prime meridian if necessary\n if (source.from_greenwich) {\n point.x += source.from_greenwich;\n }\n\n // Convert datums if needed, and if possible.\n point = Object(_datum_transform__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(source.datum, dest.datum, point);\n if (!point) {\n return;\n }\n\n // Adjust for the prime meridian if necessary\n if (dest.from_greenwich) {\n point = {\n x: point.x - dest.from_greenwich,\n y: point.y,\n z: point.z || 0\n };\n }\n\n if (dest.projName === 'longlat') {\n // convert radians to decimal degrees\n point = {\n x: point.x * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"],\n y: point.y * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"],\n z: point.z || 0\n };\n } else { // else project\n point = dest.forward(point);\n if (dest.to_meter) {\n point = {\n x: point.x / dest.to_meter,\n y: point.y / dest.to_meter,\n z: point.z || 0\n };\n }\n }\n\n // DGR, 2010/11/12\n if (dest.axis !== 'enu') {\n return Object(_adjust_axis__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(dest, true, point);\n }\n\n return point;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/transform.js?"); - -/***/ }), - -/***/ "./node_modules/proj4/projs.js": -/*!*************************************!*\ - !*** ./node_modules/proj4/projs.js ***! - \*************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _lib_projections_tmerc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/projections/tmerc */ \"./node_modules/proj4/lib/projections/tmerc.js\");\n/* harmony import */ var _lib_projections_etmerc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/projections/etmerc */ \"./node_modules/proj4/lib/projections/etmerc.js\");\n/* harmony import */ var _lib_projections_utm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/projections/utm */ \"./node_modules/proj4/lib/projections/utm.js\");\n/* harmony import */ var _lib_projections_sterea__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/projections/sterea */ \"./node_modules/proj4/lib/projections/sterea.js\");\n/* harmony import */ var _lib_projections_stere__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/projections/stere */ \"./node_modules/proj4/lib/projections/stere.js\");\n/* harmony import */ var _lib_projections_somerc__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/projections/somerc */ \"./node_modules/proj4/lib/projections/somerc.js\");\n/* harmony import */ var _lib_projections_omerc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/projections/omerc */ \"./node_modules/proj4/lib/projections/omerc.js\");\n/* harmony import */ var _lib_projections_lcc__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lib/projections/lcc */ \"./node_modules/proj4/lib/projections/lcc.js\");\n/* harmony import */ var _lib_projections_krovak__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lib/projections/krovak */ \"./node_modules/proj4/lib/projections/krovak.js\");\n/* harmony import */ var _lib_projections_cass__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./lib/projections/cass */ \"./node_modules/proj4/lib/projections/cass.js\");\n/* harmony import */ var _lib_projections_laea__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./lib/projections/laea */ \"./node_modules/proj4/lib/projections/laea.js\");\n/* harmony import */ var _lib_projections_aea__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./lib/projections/aea */ \"./node_modules/proj4/lib/projections/aea.js\");\n/* harmony import */ var _lib_projections_gnom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./lib/projections/gnom */ \"./node_modules/proj4/lib/projections/gnom.js\");\n/* harmony import */ var _lib_projections_cea__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./lib/projections/cea */ \"./node_modules/proj4/lib/projections/cea.js\");\n/* harmony import */ var _lib_projections_eqc__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./lib/projections/eqc */ \"./node_modules/proj4/lib/projections/eqc.js\");\n/* harmony import */ var _lib_projections_poly__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./lib/projections/poly */ \"./node_modules/proj4/lib/projections/poly.js\");\n/* harmony import */ var _lib_projections_nzmg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./lib/projections/nzmg */ \"./node_modules/proj4/lib/projections/nzmg.js\");\n/* harmony import */ var _lib_projections_mill__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./lib/projections/mill */ \"./node_modules/proj4/lib/projections/mill.js\");\n/* harmony import */ var _lib_projections_sinu__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./lib/projections/sinu */ \"./node_modules/proj4/lib/projections/sinu.js\");\n/* harmony import */ var _lib_projections_moll__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./lib/projections/moll */ \"./node_modules/proj4/lib/projections/moll.js\");\n/* harmony import */ var _lib_projections_eqdc__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./lib/projections/eqdc */ \"./node_modules/proj4/lib/projections/eqdc.js\");\n/* harmony import */ var _lib_projections_vandg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./lib/projections/vandg */ \"./node_modules/proj4/lib/projections/vandg.js\");\n/* harmony import */ var _lib_projections_aeqd__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./lib/projections/aeqd */ \"./node_modules/proj4/lib/projections/aeqd.js\");\n/* harmony import */ var _lib_projections_ortho__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./lib/projections/ortho */ \"./node_modules/proj4/lib/projections/ortho.js\");\n/* harmony import */ var _lib_projections_qsc__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./lib/projections/qsc */ \"./node_modules/proj4/lib/projections/qsc.js\");\n/* harmony import */ var _lib_projections_robin__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./lib/projections/robin */ \"./node_modules/proj4/lib/projections/robin.js\");\n/* harmony import */ var _lib_projections_geocent__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lib/projections/geocent */ \"./node_modules/proj4/lib/projections/geocent.js\");\n/* harmony import */ var _lib_projections_tpers__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./lib/projections/tpers */ \"./node_modules/proj4/lib/projections/tpers.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(proj4){\n proj4.Proj.projections.add(_lib_projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_utm__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_sterea__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_stere__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_somerc__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_omerc__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_lcc__WEBPACK_IMPORTED_MODULE_7__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_krovak__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_cass__WEBPACK_IMPORTED_MODULE_9__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_laea__WEBPACK_IMPORTED_MODULE_10__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_aea__WEBPACK_IMPORTED_MODULE_11__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_gnom__WEBPACK_IMPORTED_MODULE_12__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_cea__WEBPACK_IMPORTED_MODULE_13__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_eqc__WEBPACK_IMPORTED_MODULE_14__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_poly__WEBPACK_IMPORTED_MODULE_15__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_nzmg__WEBPACK_IMPORTED_MODULE_16__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_mill__WEBPACK_IMPORTED_MODULE_17__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_sinu__WEBPACK_IMPORTED_MODULE_18__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_moll__WEBPACK_IMPORTED_MODULE_19__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_eqdc__WEBPACK_IMPORTED_MODULE_20__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_vandg__WEBPACK_IMPORTED_MODULE_21__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_aeqd__WEBPACK_IMPORTED_MODULE_22__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_ortho__WEBPACK_IMPORTED_MODULE_23__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_qsc__WEBPACK_IMPORTED_MODULE_24__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_robin__WEBPACK_IMPORTED_MODULE_25__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_geocent__WEBPACK_IMPORTED_MODULE_26__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_tpers__WEBPACK_IMPORTED_MODULE_27__[\"default\"]);\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/projs.js?"); - -/***/ }), - -/***/ "./node_modules/quickselect/quickselect.js": -/*!*************************************************!*\ - !*** ./node_modules/quickselect/quickselect.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("(function (global, factory) {\n\t true ? module.exports = factory() :\n\tundefined;\n}(this, (function () { 'use strict';\n\nfunction quickselect(arr, k, left, right, compare) {\n quickselectStep(arr, k, left || 0, right || (arr.length - 1), compare || defaultCompare);\n}\n\nfunction quickselectStep(arr, k, left, right, compare) {\n\n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselectStep(arr, k, newLeft, newRight, compare);\n }\n\n var t = arr[k];\n var i = left;\n var j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n\n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}\n\nfunction swap(arr, i, j) {\n var tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nreturn quickselect;\n\n})));\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/quickselect/quickselect.js?"); - -/***/ }), - -/***/ "./node_modules/rbush/index.js": -/*!*************************************!*\ - !*** ./node_modules/rbush/index.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nmodule.exports = rbush;\nmodule.exports.default = rbush;\n\nvar quickselect = __webpack_require__(/*! quickselect */ \"./node_modules/quickselect/quickselect.js\");\n\nfunction rbush(maxEntries, format) {\n if (!(this instanceof rbush)) return new rbush(maxEntries, format);\n\n // max entries in a node is 9 by default; min node fill is 40% for best performance\n this._maxEntries = Math.max(4, maxEntries || 9);\n this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n\n if (format) {\n this._initFormat(format);\n }\n\n this.clear();\n}\n\nrbush.prototype = {\n\n all: function () {\n return this._all(this.data, []);\n },\n\n search: function (bbox) {\n\n var node = this.data,\n result = [],\n toBBox = this.toBBox;\n\n if (!intersects(bbox, node)) return result;\n\n var nodesToSearch = [],\n i, len, child, childBBox;\n\n while (node) {\n for (i = 0, len = node.children.length; i < len; i++) {\n\n child = node.children[i];\n childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf) result.push(child);\n else if (contains(bbox, childBBox)) this._all(child, result);\n else nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return result;\n },\n\n collides: function (bbox) {\n\n var node = this.data,\n toBBox = this.toBBox;\n\n if (!intersects(bbox, node)) return false;\n\n var nodesToSearch = [],\n i, len, child, childBBox;\n\n while (node) {\n for (i = 0, len = node.children.length; i < len; i++) {\n\n child = node.children[i];\n childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf || contains(bbox, childBBox)) return true;\n nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return false;\n },\n\n load: function (data) {\n if (!(data && data.length)) return this;\n\n if (data.length < this._minEntries) {\n for (var i = 0, len = data.length; i < len; i++) {\n this.insert(data[i]);\n }\n return this;\n }\n\n // recursively build the tree with the given data from scratch using OMT algorithm\n var node = this._build(data.slice(), 0, data.length - 1, 0);\n\n if (!this.data.children.length) {\n // save as is if tree is empty\n this.data = node;\n\n } else if (this.data.height === node.height) {\n // split root if trees have the same height\n this._splitRoot(this.data, node);\n\n } else {\n if (this.data.height < node.height) {\n // swap trees if inserted one is bigger\n var tmpNode = this.data;\n this.data = node;\n node = tmpNode;\n }\n\n // insert the small tree into the large tree at appropriate level\n this._insert(node, this.data.height - node.height - 1, true);\n }\n\n return this;\n },\n\n insert: function (item) {\n if (item) this._insert(item, this.data.height - 1);\n return this;\n },\n\n clear: function () {\n this.data = createNode([]);\n return this;\n },\n\n remove: function (item, equalsFn) {\n if (!item) return this;\n\n var node = this.data,\n bbox = this.toBBox(item),\n path = [],\n indexes = [],\n i, parent, index, goingUp;\n\n // depth-first iterative tree traversal\n while (node || path.length) {\n\n if (!node) { // go up\n node = path.pop();\n parent = path[path.length - 1];\n i = indexes.pop();\n goingUp = true;\n }\n\n if (node.leaf) { // check current node\n index = findItem(item, node.children, equalsFn);\n\n if (index !== -1) {\n // item found, remove the item and condense tree upwards\n node.children.splice(index, 1);\n path.push(node);\n this._condense(path);\n return this;\n }\n }\n\n if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\n path.push(node);\n indexes.push(i);\n i = 0;\n parent = node;\n node = node.children[0];\n\n } else if (parent) { // go right\n i++;\n node = parent.children[i];\n goingUp = false;\n\n } else node = null; // nothing found\n }\n\n return this;\n },\n\n toBBox: function (item) { return item; },\n\n compareMinX: compareNodeMinX,\n compareMinY: compareNodeMinY,\n\n toJSON: function () { return this.data; },\n\n fromJSON: function (data) {\n this.data = data;\n return this;\n },\n\n _all: function (node, result) {\n var nodesToSearch = [];\n while (node) {\n if (node.leaf) result.push.apply(result, node.children);\n else nodesToSearch.push.apply(nodesToSearch, node.children);\n\n node = nodesToSearch.pop();\n }\n return result;\n },\n\n _build: function (items, left, right, height) {\n\n var N = right - left + 1,\n M = this._maxEntries,\n node;\n\n if (N <= M) {\n // reached leaf level; return leaf\n node = createNode(items.slice(left, right + 1));\n calcBBox(node, this.toBBox);\n return node;\n }\n\n if (!height) {\n // target height of the bulk-loaded tree\n height = Math.ceil(Math.log(N) / Math.log(M));\n\n // target number of root entries to maximize storage utilization\n M = Math.ceil(N / Math.pow(M, height - 1));\n }\n\n node = createNode([]);\n node.leaf = false;\n node.height = height;\n\n // split the items into M mostly square tiles\n\n var N2 = Math.ceil(N / M),\n N1 = N2 * Math.ceil(Math.sqrt(M)),\n i, j, right2, right3;\n\n multiSelect(items, left, right, N1, this.compareMinX);\n\n for (i = left; i <= right; i += N1) {\n\n right2 = Math.min(i + N1 - 1, right);\n\n multiSelect(items, i, right2, N2, this.compareMinY);\n\n for (j = i; j <= right2; j += N2) {\n\n right3 = Math.min(j + N2 - 1, right2);\n\n // pack each entry recursively\n node.children.push(this._build(items, j, right3, height - 1));\n }\n }\n\n calcBBox(node, this.toBBox);\n\n return node;\n },\n\n _chooseSubtree: function (bbox, node, level, path) {\n\n var i, len, child, targetNode, area, enlargement, minArea, minEnlargement;\n\n while (true) {\n path.push(node);\n\n if (node.leaf || path.length - 1 === level) break;\n\n minArea = minEnlargement = Infinity;\n\n for (i = 0, len = node.children.length; i < len; i++) {\n child = node.children[i];\n area = bboxArea(child);\n enlargement = enlargedArea(bbox, child) - area;\n\n // choose entry with the least area enlargement\n if (enlargement < minEnlargement) {\n minEnlargement = enlargement;\n minArea = area < minArea ? area : minArea;\n targetNode = child;\n\n } else if (enlargement === minEnlargement) {\n // otherwise choose one with the smallest area\n if (area < minArea) {\n minArea = area;\n targetNode = child;\n }\n }\n }\n\n node = targetNode || node.children[0];\n }\n\n return node;\n },\n\n _insert: function (item, level, isNode) {\n\n var toBBox = this.toBBox,\n bbox = isNode ? item : toBBox(item),\n insertPath = [];\n\n // find the best node for accommodating the item, saving all nodes along the path too\n var node = this._chooseSubtree(bbox, this.data, level, insertPath);\n\n // put the item into the node\n node.children.push(item);\n extend(node, bbox);\n\n // split on node overflow; propagate upwards if necessary\n while (level >= 0) {\n if (insertPath[level].children.length > this._maxEntries) {\n this._split(insertPath, level);\n level--;\n } else break;\n }\n\n // adjust bboxes along the insertion path\n this._adjustParentBBoxes(bbox, insertPath, level);\n },\n\n // split overflowed node into two\n _split: function (insertPath, level) {\n\n var node = insertPath[level],\n M = node.children.length,\n m = this._minEntries;\n\n this._chooseSplitAxis(node, m, M);\n\n var splitIndex = this._chooseSplitIndex(node, m, M);\n\n var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n newNode.height = node.height;\n newNode.leaf = node.leaf;\n\n calcBBox(node, this.toBBox);\n calcBBox(newNode, this.toBBox);\n\n if (level) insertPath[level - 1].children.push(newNode);\n else this._splitRoot(node, newNode);\n },\n\n _splitRoot: function (node, newNode) {\n // split root node\n this.data = createNode([node, newNode]);\n this.data.height = node.height + 1;\n this.data.leaf = false;\n calcBBox(this.data, this.toBBox);\n },\n\n _chooseSplitIndex: function (node, m, M) {\n\n var i, bbox1, bbox2, overlap, area, minOverlap, minArea, index;\n\n minOverlap = minArea = Infinity;\n\n for (i = m; i <= M - m; i++) {\n bbox1 = distBBox(node, 0, i, this.toBBox);\n bbox2 = distBBox(node, i, M, this.toBBox);\n\n overlap = intersectionArea(bbox1, bbox2);\n area = bboxArea(bbox1) + bboxArea(bbox2);\n\n // choose distribution with minimum overlap\n if (overlap < minOverlap) {\n minOverlap = overlap;\n index = i;\n\n minArea = area < minArea ? area : minArea;\n\n } else if (overlap === minOverlap) {\n // otherwise choose distribution with minimum area\n if (area < minArea) {\n minArea = area;\n index = i;\n }\n }\n }\n\n return index;\n },\n\n // sorts node children by the best axis for split\n _chooseSplitAxis: function (node, m, M) {\n\n var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX,\n compareMinY = node.leaf ? this.compareMinY : compareNodeMinY,\n xMargin = this._allDistMargin(node, m, M, compareMinX),\n yMargin = this._allDistMargin(node, m, M, compareMinY);\n\n // if total distributions margin value is minimal for x, sort by minX,\n // otherwise it's already sorted by minY\n if (xMargin < yMargin) node.children.sort(compareMinX);\n },\n\n // total margin of all possible split distributions where each node is at least m full\n _allDistMargin: function (node, m, M, compare) {\n\n node.children.sort(compare);\n\n var toBBox = this.toBBox,\n leftBBox = distBBox(node, 0, m, toBBox),\n rightBBox = distBBox(node, M - m, M, toBBox),\n margin = bboxMargin(leftBBox) + bboxMargin(rightBBox),\n i, child;\n\n for (i = m; i < M - m; i++) {\n child = node.children[i];\n extend(leftBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(leftBBox);\n }\n\n for (i = M - m - 1; i >= m; i--) {\n child = node.children[i];\n extend(rightBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(rightBBox);\n }\n\n return margin;\n },\n\n _adjustParentBBoxes: function (bbox, path, level) {\n // adjust bboxes along the given tree path\n for (var i = level; i >= 0; i--) {\n extend(path[i], bbox);\n }\n },\n\n _condense: function (path) {\n // go through the path, removing empty nodes and updating bboxes\n for (var i = path.length - 1, siblings; i >= 0; i--) {\n if (path[i].children.length === 0) {\n if (i > 0) {\n siblings = path[i - 1].children;\n siblings.splice(siblings.indexOf(path[i]), 1);\n\n } else this.clear();\n\n } else calcBBox(path[i], this.toBBox);\n }\n },\n\n _initFormat: function (format) {\n // data format (minX, minY, maxX, maxY accessors)\n\n // uses eval-type function compilation instead of just accepting a toBBox function\n // because the algorithms are very sensitive to sorting functions performance,\n // so they should be dead simple and without inner calls\n\n var compareArr = ['return a', ' - b', ';'];\n\n this.compareMinX = new Function('a', 'b', compareArr.join(format[0]));\n this.compareMinY = new Function('a', 'b', compareArr.join(format[1]));\n\n this.toBBox = new Function('a',\n 'return {minX: a' + format[0] +\n ', minY: a' + format[1] +\n ', maxX: a' + format[2] +\n ', maxY: a' + format[3] + '};');\n }\n};\n\nfunction findItem(item, items, equalsFn) {\n if (!equalsFn) return items.indexOf(item);\n\n for (var i = 0; i < items.length; i++) {\n if (equalsFn(item, items[i])) return i;\n }\n return -1;\n}\n\n// calculate node's bbox from bboxes of its children\nfunction calcBBox(node, toBBox) {\n distBBox(node, 0, node.children.length, toBBox, node);\n}\n\n// min bounding rectangle of node children from k to p-1\nfunction distBBox(node, k, p, toBBox, destNode) {\n if (!destNode) destNode = createNode(null);\n destNode.minX = Infinity;\n destNode.minY = Infinity;\n destNode.maxX = -Infinity;\n destNode.maxY = -Infinity;\n\n for (var i = k, child; i < p; i++) {\n child = node.children[i];\n extend(destNode, node.leaf ? toBBox(child) : child);\n }\n\n return destNode;\n}\n\nfunction extend(a, b) {\n a.minX = Math.min(a.minX, b.minX);\n a.minY = Math.min(a.minY, b.minY);\n a.maxX = Math.max(a.maxX, b.maxX);\n a.maxY = Math.max(a.maxY, b.maxY);\n return a;\n}\n\nfunction compareNodeMinX(a, b) { return a.minX - b.minX; }\nfunction compareNodeMinY(a, b) { return a.minY - b.minY; }\n\nfunction bboxArea(a) { return (a.maxX - a.minX) * (a.maxY - a.minY); }\nfunction bboxMargin(a) { return (a.maxX - a.minX) + (a.maxY - a.minY); }\n\nfunction enlargedArea(a, b) {\n return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\n (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\n}\n\nfunction intersectionArea(a, b) {\n var minX = Math.max(a.minX, b.minX),\n minY = Math.max(a.minY, b.minY),\n maxX = Math.min(a.maxX, b.maxX),\n maxY = Math.min(a.maxY, b.maxY);\n\n return Math.max(0, maxX - minX) *\n Math.max(0, maxY - minY);\n}\n\nfunction contains(a, b) {\n return a.minX <= b.minX &&\n a.minY <= b.minY &&\n b.maxX <= a.maxX &&\n b.maxY <= a.maxY;\n}\n\nfunction intersects(a, b) {\n return b.minX <= a.maxX &&\n b.minY <= a.maxY &&\n b.maxX >= a.minX &&\n b.maxY >= a.minY;\n}\n\nfunction createNode(children) {\n return {\n children: children,\n height: 1,\n leaf: true,\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity\n };\n}\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nfunction multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/rbush/index.js?"); - -/***/ }), - -/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": -/*!****************************************************************************!*\ - !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = true ? __webpack_require__.nc : undefined;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of \",r),i=[e.slice(v,r-1)],r+=8):-1==p.indexOf(t)&&(r++,i=c());else r++;return{tagName:t,attributes:n,children:i}}function y(){var t=e[r],n=++r;return r=e.indexOf(t,n),e.slice(n,r)}var v,g=null;if(void 0!==t.attrValue)for(t.attrName=t.attrName||\"id\",g=[];-1!==(void 0,v=new RegExp(\"\\\\s\"+t.attrName+\"\\\\s*=['\\\"]\"+t.attrValue+\"['\\\"]\").exec(e),r=v?v.index:-1);)-1!==(r=e.lastIndexOf(\"<\",r))&&g.push(b()),e=e.substr(r),r=0;else g=t.parseNode?b():c();return t.filter&&(g=n.filter(g,t.filter)),t.setPos&&(g.pos=r),g}n.simplify=function(e){var t={};if(!e.length)return\"\";if(1===e.length&&\"string\"==typeof e[0])return e[0];for(var r in e.forEach((function(e){if(\"object\"==typeof e){t[e.tagName]||(t[e.tagName]=[]);var r=n.simplify(e.children||[]);t[e.tagName].push(r),e.attributes&&(r._attributes=e.attributes)}})),t)1==t[r].length&&(t[r]=t[r][0]);return t},n.filter=function(e,t){var r=[];return e.forEach((function(e){if(\"object\"==typeof e&&t(e)&&r.push(e),e.children){var i=n.filter(e.children,t);r=r.concat(i)}})),r},n.stringify=function(e){var t=\"\";function r(e){if(e)for(var r=0;r\",r(e.children),t+=\"\"}return r(e),t},n.toContentString=function(e){if(Array.isArray(e)){var t=\"\";return e.forEach((function(e){t=(t+=\" \"+n.toContentString(e)).trim()})),t}return\"object\"==typeof e?n.toContentString(e.children):\" \"+e},n.getElementById=function(e,t,r){var i=n(e,{attrValue:t});return r?n.simplify(i):i[0]},n.getElementsByClassName=function(e,t,r){const i=n(e,{attrName:\"class\",attrValue:\"[a-zA-Z0-9-s ]*\"+t+\"[a-zA-Z0-9-s ]*\"});return r?n.simplify(i):i},n.parseStream=function(t,r){if(\"string\"==typeof r&&(r=r.length+2),\"string\"==typeof t){var i=e(\"fs\");t=i.createReadStream(t,{start:r}),r=0}var o=r,a=\"\";return t.on(\"data\",(function(e){a+=e;for(var r=0;;){if(!(o=a.indexOf(\"<\",o)+1))return void(o=r);if(\"/\"!==a[o+1]){var i=n(a,{pos:o-1,parseNode:!0,setPos:!0});if((o=i.pos)>a.length-1||oo.length-1||i>24)/500+a,u=a-(e[i+2]<<24>>24)/200,l=void 0,f=void 0,c=void 0;f=-.9689*(s=.95047*(s*s*s>.008856?s*s*s:(s-16/116)/7.787))+1.8758*(a=1*(a*a*a>.008856?a*a*a:(a-16/116)/7.787))+.0415*(u=1.08883*(u*u*u>.008856?u*u*u:(u-16/116)/7.787)),c=.0557*s+-.204*a+1.057*u,l=(l=3.2406*s+-1.5372*a+-.4986*u)>.0031308?1.055*Math.pow(l,1/2.4)-.055:12.92*l,f=f>.0031308?1.055*Math.pow(f,1/2.4)-.055:12.92*f,c=c>.0031308?1.055*Math.pow(c,1/2.4)-.055:12.92*c,n[o]=255*Math.max(0,Math.min(1,l)),n[o+1]=255*Math.max(0,Math.min(1,f)),n[o+2]=255*Math.max(0,Math.min(1,c))}return n}},{}],IKSA:[function(e,t,r){\"use strict\";function n(e,t){var r=e.length-t,n=0;do{for(var i=t;i>0;i--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function i(e,t,r){for(var n=0,i=e.length,o=i/r;i>t;){for(var a=t;a>0;--a)e[n+t]+=e[n],++n;i-=t}for(var s=e.slice(),u=0;u=e.byteLength);++c){var h=void 0;if(2===t){switch(a[0]){case 8:h=new Uint8Array(e,c*f*r*l,f*r*l);break;case 16:h=new Uint16Array(e,c*f*r*l,f*r*l/2);break;case 32:h=new Uint32Array(e,c*f*r*l,f*r*l/4);break;default:throw new Error(\"Predictor 2 not allowed with \".concat(a[0],\" bits per sample.\"))}n(h,f)}else 3===t&&i(h=new Uint8Array(e,c*f*r*l,f*r*l),f,l)}return e}},{}],FJDe:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"@babel/runtime/regenerator\")),i=u(e(\"@babel/runtime/helpers/asyncToGenerator\")),o=u(e(\"@babel/runtime/helpers/classCallCheck\")),a=u(e(\"@babel/runtime/helpers/createClass\")),s=e(\"../predictor\");function u(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(){(0,o.default)(this,e)}return(0,a.default)(e,[{key:\"decode\",value:function(){var e=(0,i.default)(n.default.mark((function e(t,r){var i,o,a,u,l;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decodeBlock(r);case 2:if(i=e.sent,1===(o=t.Predictor||1)){e.next=9;break}return a=!t.StripOffsets,u=a?t.TileWidth:t.ImageWidth,l=a?t.TileLength:t.RowsPerStrip||t.ImageLength,e.abrupt(\"return\",(0,s.applyPredictor)(i,o,u,l,t.BitsPerSample,t.PlanarConfiguration));case 9:return e.abrupt(\"return\",i);case 10:case\"end\":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()}]),e}();r.default=l},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"../predictor\":\"IKSA\"}],V9bQ:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"@babel/runtime/helpers/classCallCheck\")),i=u(e(\"@babel/runtime/helpers/createClass\")),o=u(e(\"@babel/runtime/helpers/inherits\")),a=u(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),s=u(e(\"@babel/runtime/helpers/getPrototypeOf\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=function(e){(0,o.default)(r,e);var t=l(r);function r(){return(0,n.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:\"decodeBlock\",value:function(e){return e}}]),r}(u(e(\"./basedecoder\")).default);r.default=f},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./basedecoder\":\"FJDe\"}],tcId:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=l(e(\"@babel/runtime/helpers/classCallCheck\")),i=l(e(\"@babel/runtime/helpers/createClass\")),o=l(e(\"@babel/runtime/helpers/inherits\")),a=l(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),s=l(e(\"@babel/runtime/helpers/getPrototypeOf\")),u=l(e(\"./basedecoder\"));function l(e){return e&&e.__esModule?e:{default:e}}function f(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}function c(e,t){for(var r=t.length-1;r>=0;r--)e.push(t[r]);return e}function h(e){for(var t=new Uint16Array(4093),r=new Uint8Array(4093),n=0;n<=257;n++)t[n]=4096,r[n]=n;var i=258,o=9,a=0;function s(){i=258,o=9}function u(e){var t=function(e,t,r){var n=t%8,i=Math.floor(t/8),o=8-n,a=t+r-8*(i+1),s=8*(i+2)-(t+r),u=8*(i+2)-t;if(s=Math.max(0,s),i>=e.length)return console.warn(\"ran off the end of the buffer before finding EOI_CODE (end on input code)\"),257;var l=e[i]&Math.pow(2,8-n)-1,f=l<<=r-o;if(i+1>>s;f+=c<<=Math.max(0,r-u)}if(a>8&&i+2>>h}return f}(e,a,o);return a+=o,t}function l(e,n){return r[i]=n,t[i]=e,++i-1}function f(e){for(var n=[],i=e;4096!==i;i=t[i])n.push(r[i]);return n}var h=[];s();for(var d,p=new Uint8Array(e),b=u(p);257!==b;){if(256===b){for(s(),b=u(p);256===b;)b=u(p);if(257===b)break;if(b>256)throw new Error(\"corrupted code at scanline \".concat(b));c(h,f(b)),d=b}else if(b=Math.pow(2,o)&&(12===o?d=void 0:o++),b=u(p)}return new Uint8Array(h)}var d=function(e){(0,o.default)(r,e);var t=f(r);function r(){return(0,n.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:\"decodeBlock\",value:function(e){return h(e).buffer}}]),r}(u.default);r.default=d},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./basedecoder\":\"FJDe\"}],J7kk:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=f(e(\"@babel/runtime/helpers/inherits\")),i=f(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),o=f(e(\"@babel/runtime/helpers/getPrototypeOf\")),a=f(e(\"@babel/runtime/helpers/classCallCheck\")),s=f(e(\"@babel/runtime/helpers/createClass\")),u=f(e(\"@babel/runtime/helpers/typeof\")),l=f(e(\"./basedecoder\"));function f(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,o.default)(e);if(t){var a=(0,o.default)(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return(0,i.default)(this,r)}}var h=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),d=4017,p=799,b=3406,y=2276,v=1567,g=3784,m=5793,w=2896;function _(e,t){for(var r=0,n=[],i=16;i>0&&!e[i-1];)--i;n.push({children:[],index:0});for(var o,a=n[0],s=0;s0;)a=n.pop();for(a.index++,n.push(a);n.length<=s;)n.push(o={children:[],index:0}),a.children[a.index]=o.children,a=o;r++}s+10)return b>>--y&1;if(255===(b=e[p++])){var t=e[p++];if(t)throw new Error(\"unexpected marker: \".concat((b<<8|t).toString(16)))}return y=7,b>>>7}function g(e){for(var t,r=e;null!==(t=v());){if(\"number\"==typeof(r=r[t]))return r;if(\"object\"!==(0,u.default)(r))throw new Error(\"invalid huffman sequence\")}return null}function m(e){for(var t=e,r=0;t>0;){var n=v();if(null===n)return;r=r<<1|n,--t}return r}function w(e){var t=m(e);return t>=1<0)k--;else for(var r=o,n=a;r<=n;){var i=g(e.huffmanTableAC),s=15&i,u=i>>4;if(0===s){if(u<15){k=m(u)+(1<>4,0===c)i<15?(k=m(i)+(1<>4;if(0===a){if(s<15)break;i+=16}else t[h[i+=s]]=w(a),i++}};var A,I,D=0;I=1===M?n[0].blocksPerLine*n[0].blocksPerColumn:f*r.mcusPerColumn;for(var L=i||I;D=65488&&A<=65495))break;p+=2}return p-d}function x(e,t){var r=[],n=t.blocksPerLine,i=t.blocksPerColumn,o=n<<3,a=new Int32Array(64),s=new Uint8Array(64);function u(e,r,n){var i,o,a,s,u,l,f,c,h,_,k=t.quantizationTable,x=n;for(_=0;_<64;_++)x[_]=e[_]*k[_];for(_=0;_<8;++_){var S=8*_;0!==x[1+S]||0!==x[2+S]||0!==x[3+S]||0!==x[4+S]||0!==x[5+S]||0!==x[6+S]||0!==x[7+S]?(i=m*x[0+S]+128>>8,o=m*x[4+S]+128>>8,a=x[2+S],s=x[6+S],u=w*(x[1+S]-x[7+S])+128>>8,c=w*(x[1+S]+x[7+S])+128>>8,l=x[3+S]<<4,f=x[5+S]<<4,h=i-o+1>>1,i=i+o+1>>1,o=h,h=a*g+s*v+128>>8,a=a*v-s*g+128>>8,s=h,h=u-f+1>>1,u=u+f+1>>1,f=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=o-a+1>>1,o=o+a+1>>1,a=h,h=u*y+c*b+2048>>12,u=u*b-c*y+2048>>12,c=h,h=l*p+f*d+2048>>12,l=l*d-f*p+2048>>12,f=h,x[0+S]=i+c,x[7+S]=i-c,x[1+S]=o+f,x[6+S]=o-f,x[2+S]=a+l,x[5+S]=a-l,x[3+S]=s+u,x[4+S]=s-u):(h=m*x[0+S]+512>>10,x[0+S]=h,x[1+S]=h,x[2+S]=h,x[3+S]=h,x[4+S]=h,x[5+S]=h,x[6+S]=h,x[7+S]=h)}for(_=0;_<8;++_){var O=_;0!==x[8+O]||0!==x[16+O]||0!==x[24+O]||0!==x[32+O]||0!==x[40+O]||0!==x[48+O]||0!==x[56+O]?(i=m*x[0+O]+2048>>12,o=m*x[32+O]+2048>>12,a=x[16+O],s=x[48+O],u=w*(x[8+O]-x[56+O])+2048>>12,c=w*(x[8+O]+x[56+O])+2048>>12,l=x[24+O],f=x[40+O],h=i-o+1>>1,i=i+o+1>>1,o=h,h=a*g+s*v+2048>>12,a=a*v-s*g+2048>>12,s=h,h=u-f+1>>1,u=u+f+1>>1,f=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=o-a+1>>1,o=o+a+1>>1,a=h,h=u*y+c*b+2048>>12,u=u*b-c*y+2048>>12,c=h,h=l*p+f*d+2048>>12,l=l*d-f*p+2048>>12,f=h,x[0+O]=i+c,x[56+O]=i-c,x[8+O]=o+f,x[48+O]=o-f,x[16+O]=a+l,x[40+O]=a-l,x[24+O]=s+u,x[32+O]=s-u):(h=m*n[_+0]+8192>>14,x[0+O]=h,x[8+O]=h,x[16+O]=h,x[24+O]=h,x[32+O]=h,x[40+O]=h,x[48+O]=h,x[56+O]=h)}for(_=0;_<64;++_){var T=128+(x[_]+8>>4);r[_]=T<0?0:T>255?255:T}}for(var l=0;l>4==0)for(var c=0;c<64;c++)f[h[c]]=e[t++];else{if(l>>4!=1)throw new Error(\"DQT: invalid table spec\");for(var d=0;d<64;d++)f[h[d]]=r()}this.quantizationTables[15&l]=f}break;case 65472:case 65473:case 65474:r();for(var p={extended:65473===a,progressive:65474===a,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},b=e[t++],y=void 0,v=0;v>4,m=15&e[t+1],w=e[t+2];p.componentsOrder.push(y),p.components[y]={h:g,v:m,quantizationIdx:w},t+=3}n(p),this.frames.push(p);break;case 65476:for(var x=r(),S=2;S>4==0?this.huffmanTablesDC[15&O]=_(T,P):this.huffmanTablesAC[15&O]=_(T,P)}break;case 65501:r(),this.resetInterval=r();break;case 65498:r();for(var R=e[t++],M=[],A=this.frames[0],I=0;I>4],D.huffmanTableAC=this.huffmanTablesAC[15&L],M.push(D)}var N=e[t++],F=e[t++],U=e[t++],B=k(e,t,A,M,this.resetInterval,N,F,U>>4,15&U);t+=B;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error(\"unknown JPEG marker \".concat(a.toString(16)))}a=r()}}},{key:\"getResult\",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error(\"no frames were decoded\");this.frames.length>1&&console.warn(\"more than one frame is not supported\");for(var t=0;t>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},{}],X4kj:[function(e,t,r){\"use strict\";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s>>8^o[255&(e^t[s])];return-1^e}},{}],LP5M:[function(e,t,r){\"use strict\";t.exports=function(e,t){var r,n,i,o,a,s,u,l,f,c,h,d,p,b,y,v,g,m,w,_,k,x,S,O,T;r=e.state,n=e.next_in,O=e.input,i=n+(e.avail_in-5),o=e.next_out,T=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=r.dmax,l=r.wsize,f=r.whave,c=r.wnext,h=r.window,d=r.hold,p=r.bits,b=r.lencode,y=r.distcode,v=(1<>>=w=m>>>24,p-=w,0==(w=m>>>16&255))T[o++]=65535&m;else{if(!(16&w)){if(0==(64&w)){m=b[(65535&m)+(d&(1<>>=w,p-=w),p<15&&(d+=O[n++]<>>=w=m>>>24,p-=w,!(16&(w=m>>>16&255))){if(0==(64&w)){m=y[(65535&m)+(d&(1<u){e.msg=\"invalid distance too far back\",r.mode=30;break e}if(d>>>=w,p-=w,k>(w=o-a)){if((w=k-w)>f&&r.sane){e.msg=\"invalid distance too far back\",r.mode=30;break e}if(x=0,S=h,0===c){if(x+=l-w,w<_){_-=w;do{T[o++]=h[x++]}while(--w);x=o-k,S=T}}else if(c2;)T[o++]=S[x++],T[o++]=S[x++],T[o++]=S[x++],_-=3;_&&(T[o++]=S[x++],_>1&&(T[o++]=S[x++]))}else{x=o-k;do{T[o++]=T[x++],T[o++]=T[x++],T[o++]=T[x++],_-=3}while(_>2);_&&(T[o++]=T[x++],_>1&&(T[o++]=T[x++]))}break}}break}}while(n>3,d&=(1<<(p-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n=1&&0===L[E];E--);if(C>E&&(C=E),0===E)return f[c++]=20971520,f[c++]=20971520,d.bits=1,0;for(T=1;T0&&(0===e||1!==E))return-1;for(N[1]=0,S=1;S852||2===e&&M>592)return 1;for(;;){w=S-j,h[O]m?(_=F[U+h[O]],k=I[D+h[O]]):(_=96,k=0),p=1<>j)+(b-=p)]=w<<24|_<<16|k|0}while(0!==b);for(p=1<>=1;if(0!==p?(A&=p-1,A+=p):A=0,O++,0==--L[S]){if(S===E)break;S=t[r+h[O]]}if(S>C&&(A&v)!==y){for(0===j&&(j=C),g+=T,R=1<<(P=S-j);P+j852||2===e&&M>592)return 1;f[y=A&v]=C<<24|P<<16|g-c|0}}return 0!==A&&(f[g+A]=S-j<<24|64<<16|0),d.bits=C,0}},{\"../utils/common\":\"tbG5\"}],GIDK:[function(e,t,r){\"use strict\";var n=e(\"../utils/common\"),i=e(\"./adler32\"),o=e(\"./crc32\"),a=e(\"./inffast\"),s=e(\"./inftrees\"),u=-2,l=12,f=30;function c(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function p(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,d(e)):u}function b(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,p(e))):u}function y(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=b(e,t))&&(e.state=null),r):u}var v,g,m=!0;function w(e){if(m){var t;for(v=new n.Buf32(512),g=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,v,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,g,0,e.work,{bits:5}),m=!1}e.lencode=v,e.lenbits=9,e.distcode=g,e.distbits=5}function _(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=o(r.check,F,2,0),g=0,m=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg=\"incorrect header check\",r.mode=f;break}if(8!=(15&g)){e.msg=\"unknown compression method\",r.mode=f;break}if(m-=4,A=8+(15&(g>>>=4)),0===r.wbits)r.wbits=A;else if(A>r.wbits){e.msg=\"invalid window size\",r.mode=f;break}r.dmax=1<>8&1),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0)),g=0,m=0,r.mode=3;case 3:for(;m<32;){if(0===y)break e;y--,g+=h[p++]<>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,r.check=o(r.check,F,4,0)),g=0,m=0,r.mode=4;case 4:for(;m<16;){if(0===y)break e;y--,g+=h[p++]<>8),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0)),g=0,m=0,r.mode=5;case 5:if(1024&r.flags){for(;m<16;){if(0===y)break e;y--,g+=h[p++]<>>8&255,r.check=o(r.check,F,2,0)),g=0,m=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((S=r.length)>y&&(S=y),S&&(r.head&&(A=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,p,S,A)),512&r.flags&&(r.check=o(r.check,h,S,p)),y-=S,p+=S,r.length-=S),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===y)break e;S=0;do{A=h[p+S++],r.head&&A&&r.length<65536&&(r.head.name+=String.fromCharCode(A))}while(A&&S>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=l;break;case 10:for(;m<32;){if(0===y)break e;y--,g+=h[p++]<>>=7&m,m-=7&m,r.mode=27;break}for(;m<3;){if(0===y)break e;y--,g+=h[p++]<>>=1)){case 0:r.mode=14;break;case 1:if(w(r),r.mode=20,6===t){g>>>=2,m-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg=\"invalid block type\",r.mode=f}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===y)break e;y--,g+=h[p++]<>>16^65535)){e.msg=\"invalid stored block lengths\",r.mode=f;break}if(r.length=65535&g,g=0,m=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(S=r.length){if(S>y&&(S=y),S>v&&(S=v),0===S)break e;n.arraySet(d,h,p,S,b),y-=S,p+=S,v-=S,b+=S,r.length-=S;break}r.mode=l;break;case 17:for(;m<14;){if(0===y)break e;y--,g+=h[p++]<>>=5,m-=5,r.ndist=1+(31&g),g>>>=5,m-=5,r.ncode=4+(15&g),g>>>=4,m-=4,r.nlen>286||r.ndist>30){e.msg=\"too many length or distance symbols\",r.mode=f;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,m-=3}for(;r.have<19;)r.lens[U[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,D={bits:r.lenbits},I=s(0,r.lens,0,19,r.lencode,0,r.work,D),r.lenbits=D.bits,I){e.msg=\"invalid code lengths set\",r.mode=f;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,P=65535&N,!((E=N>>>24)<=m);){if(0===y)break e;y--,g+=h[p++]<>>=E,m-=E,r.lens[r.have++]=P;else{if(16===P){for(L=E+2;m>>=E,m-=E,0===r.have){e.msg=\"invalid bit length repeat\",r.mode=f;break}A=r.lens[r.have-1],S=3+(3&g),g>>>=2,m-=2}else if(17===P){for(L=E+3;m>>=E)),g>>>=3,m-=3}else{for(L=E+7;m>>=E)),g>>>=7,m-=7}if(r.have+S>r.nlen+r.ndist){e.msg=\"invalid bit length repeat\",r.mode=f;break}for(;S--;)r.lens[r.have++]=A}}if(r.mode===f)break;if(0===r.lens[256]){e.msg=\"invalid code -- missing end-of-block\",r.mode=f;break}if(r.lenbits=9,D={bits:r.lenbits},I=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,D),r.lenbits=D.bits,I){e.msg=\"invalid literal/lengths set\",r.mode=f;break}if(r.distbits=6,r.distcode=r.distdyn,D={bits:r.distbits},I=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,D),r.distbits=D.bits,I){e.msg=\"invalid distances set\",r.mode=f;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(y>=6&&v>=258){e.next_out=b,e.avail_out=v,e.next_in=p,e.avail_in=y,r.hold=g,r.bits=m,a(e,x),b=e.next_out,d=e.output,v=e.avail_out,p=e.next_in,h=e.input,y=e.avail_in,g=r.hold,m=r.bits,r.mode===l&&(r.back=-1);break}for(r.back=0;C=(N=r.lencode[g&(1<>>16&255,P=65535&N,!((E=N>>>24)<=m);){if(0===y)break e;y--,g+=h[p++]<>j)])>>>16&255,P=65535&N,!(j+(E=N>>>24)<=m);){if(0===y)break e;y--,g+=h[p++]<>>=j,m-=j,r.back+=j}if(g>>>=E,m-=E,r.back+=E,r.length=P,0===C){r.mode=26;break}if(32&C){r.back=-1,r.mode=l;break}if(64&C){e.msg=\"invalid literal/length code\",r.mode=f;break}r.extra=15&C,r.mode=22;case 22:if(r.extra){for(L=r.extra;m>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;C=(N=r.distcode[g&(1<>>16&255,P=65535&N,!((E=N>>>24)<=m);){if(0===y)break e;y--,g+=h[p++]<>j)])>>>16&255,P=65535&N,!(j+(E=N>>>24)<=m);){if(0===y)break e;y--,g+=h[p++]<>>=j,m-=j,r.back+=j}if(g>>>=E,m-=E,r.back+=E,64&C){e.msg=\"invalid distance code\",r.mode=f;break}r.offset=P,r.extra=15&C,r.mode=24;case 24:if(r.extra){for(L=r.extra;m>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg=\"invalid distance too far back\",r.mode=f;break}r.mode=25;case 25:if(0===v)break e;if(S=x-v,r.offset>S){if((S=r.offset-S)>r.whave&&r.sane){e.msg=\"invalid distance too far back\",r.mode=f;break}S>r.wnext?(S-=r.wnext,O=r.wsize-S):O=r.wnext-S,S>r.length&&(S=r.length),T=r.window}else T=d,O=b-r.offset,S=r.length;S>v&&(S=v),v-=S,r.length-=S;do{d[b++]=T[O++]}while(--S);0===r.length&&(r.mode=21);break;case 26:if(0===v)break e;d[b++]=r.length,v--,r.mode=21;break;case 27:if(r.wrap){for(;m<32;){if(0===y)break e;y--,g|=h[p++]<=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r=\"\",a=0;a>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},r.buf2binstring=function(e){return u(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r4)l[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r1?l[n++]=65533:i<65536?l[n++]=i:(i-=65536,l[n++]=55296|i>>10&1023,l[n++]=56320|1023&i)}return u(l,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}},{\"./common\":\"tbG5\"}],xUUw:[function(e,t,r){\"use strict\";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],gMAY:[function(e,t,r){\"use strict\";t.exports={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"}},{}],bdtv:[function(e,t,r){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},{}],WIli:[function(e,t,r){\"use strict\";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1}},{}],faQk:[function(e,t,r){\"use strict\";var n=e(\"./zlib/inflate\"),i=e(\"./utils/common\"),o=e(\"./utils/strings\"),a=e(\"./zlib/constants\"),s=e(\"./zlib/messages\"),u=e(\"./zlib/zstream\"),l=e(\"./zlib/gzheader\"),f=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:\"\"},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);if(this.header=new l,n.inflateGetHeader(this.strm,this.header),t.dictionary&&(\"string\"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):\"[object ArrayBuffer]\"===f.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(s[r])}function h(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(e,t){var r,s,u,l,c,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,b=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,\"string\"==typeof e?h.input=o.binstring2buf(e):\"[object ArrayBuffer]\"===f.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===b&&(r=a.Z_OK,b=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||(\"string\"===this.options.to?(u=o.utf8border(h.output,h.next_out),l=h.next_out-u,c=o.buf2string(h.output,u),h.next_out=l,h.avail_out=d-l,l&&i.arraySet(h.output,h.output,u,l,0),this.onData(c)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(b=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),h.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){e===a.Z_OK&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=c,r.inflate=h,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},r.ungzip=h},{\"./zlib/inflate\":\"GIDK\",\"./utils/common\":\"tbG5\",\"./utils/strings\":\"Q3ZD\",\"./zlib/constants\":\"xUUw\",\"./zlib/messages\":\"gMAY\",\"./zlib/zstream\":\"bdtv\",\"./zlib/gzheader\":\"WIli\"}],JAiC:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=l(e(\"@babel/runtime/helpers/classCallCheck\")),i=l(e(\"@babel/runtime/helpers/createClass\")),o=l(e(\"@babel/runtime/helpers/inherits\")),a=l(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),s=l(e(\"@babel/runtime/helpers/getPrototypeOf\")),u=e(\"pako/lib/inflate\");function l(e){return e&&e.__esModule?e:{default:e}}function f(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var c=function(e){(0,o.default)(r,e);var t=f(r);function r(){return(0,n.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:\"decodeBlock\",value:function(e){return(0,u.inflate)(new Uint8Array(e)).buffer}}]),r}(l(e(\"./basedecoder\")).default);r.default=c},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"pako/lib/inflate\":\"faQk\",\"./basedecoder\":\"FJDe\"}],OcPz:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"@babel/runtime/helpers/classCallCheck\")),i=u(e(\"@babel/runtime/helpers/createClass\")),o=u(e(\"@babel/runtime/helpers/inherits\")),a=u(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),s=u(e(\"@babel/runtime/helpers/getPrototypeOf\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=function(e){(0,o.default)(r,e);var t=l(r);function r(){return(0,n.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:\"decodeBlock\",value:function(e){for(var t=new DataView(e),r=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(e).constructor)(t*r*n)}function i(e,t,r,i,o){var a=t/i,s=r/o;return e.map((function(e){for(var u=n(e,i,o),l=0;l5&&void 0!==arguments[5]?arguments[5]:\"nearest\";switch(s.toLowerCase()){case\"nearest\":return i(e,t,r,n,o);case\"bilinear\":case\"linear\":return a(e,t,r,n,o);default:throw new Error(\"Unsupported resampling method: '\".concat(s,\"'\"))}},r.resampleNearestInterleaved=s,r.resampleBilinearInterleaved=u,r.resampleInterleaved=function(e,t,r,n,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:\"nearest\";switch(a.toLowerCase()){case\"nearest\":return s(e,t,r,n,i,o);case\"bilinear\":case\"linear\":return u(e,t,r,n,i,o);default:throw new Error(\"Unsupported resampling method: '\".concat(a,\"'\"))}}},{}],eOWo:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=p(e(\"@babel/runtime/helpers/slicedToArray\")),i=p(e(\"@babel/runtime/regenerator\")),o=p(e(\"@babel/runtime/helpers/asyncToGenerator\")),a=p(e(\"@babel/runtime/helpers/classCallCheck\")),s=p(e(\"@babel/runtime/helpers/createClass\")),u=e(\"@petamoriken/float16\"),l=p(e(\"txml\")),f=e(\"./globals\"),c=e(\"./rgb\"),h=e(\"./compression\"),d=e(\"./resample\");function p(e){return e&&e.__esModule?e:{default:e}}function b(e,t,r){for(var n=0,i=t;i>8-i-_&f;else if(_+i<=16)l[m]=s.getUint16(w)>>16-i-_&f;else if(_+i<=24){var k=s.getUint16(w)<<8|s.getUint8(w+2);l[m]=k>>24-i-_&f}else l[m]=s.getUint32(w)>>32-i-_&f}}return l.buffer}var m=function(){function e(t,r,n,i,o,s){(0,a.default)(this,e),this.fileDirectory=t,this.geoKeys=r,this.dataView=n,this.littleEndian=i,this.tiles=o?{}:null,this.isTiled=!t.StripOffsets;var u=t.PlanarConfiguration;if(this.planarConfiguration=void 0===u?1:u,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error(\"Invalid planar configuration.\");this.source=s}return(0,s.default)(e,[{key:\"getFileDirectory\",value:function(){return this.fileDirectory}},{key:\"getGeoKeys\",value:function(){return this.geoKeys}},{key:\"getWidth\",value:function(){return this.fileDirectory.ImageWidth}},{key:\"getHeight\",value:function(){return this.fileDirectory.ImageLength}},{key:\"getSamplesPerPixel\",value:function(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}},{key:\"getTileWidth\",value:function(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}},{key:\"getTileHeight\",value:function(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}},{key:\"getBlockWidth\",value:function(){return this.getTileWidth()}},{key:\"getBlockHeight\",value:function(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}},{key:\"getBytesPerPixel\",value:function(){for(var e=0,t=0;t=this.fileDirectory.BitsPerSample.length)throw new RangeError(\"Sample index \".concat(e,\" is out of range.\"));return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}},{key:\"getReaderForSample\",value:function(e){var t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,r=this.fileDirectory.BitsPerSample[e];switch(t){case 1:if(r<=8)return DataView.prototype.getUint8;if(r<=16)return DataView.prototype.getUint16;if(r<=32)return DataView.prototype.getUint32;break;case 2:if(r<=8)return DataView.prototype.getInt8;if(r<=16)return DataView.prototype.getInt16;if(r<=32)return DataView.prototype.getInt32;break;case 3:switch(r){case 16:return function(e,t){return(0,u.getFloat16)(this,e,t)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error(\"Unsupported data format/bitsPerSample\")}},{key:\"getSampleFormat\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}},{key:\"getBitsPerSample\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.BitsPerSample[e]}},{key:\"getArrayForSample\",value:function(e,t){return y(this.getSampleFormat(e),this.getBitsPerSample(e),t)}},{key:\"getTileOrStrip\",value:function(){var e=(0,o.default)(i.default.mark((function e(t,r,n,a,s){var u,l,f,c,h,d,p,b,y=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=Math.ceil(this.getWidth()/this.getTileWidth()),l=Math.ceil(this.getHeight()/this.getTileHeight()),c=this.tiles,1===this.planarConfiguration?f=r*u+t:2===this.planarConfiguration&&(f=n*u*l+r*u+t),this.isTiled?(h=this.fileDirectory.TileOffsets[f],d=this.fileDirectory.TileByteCounts[f]):(h=this.fileDirectory.StripOffsets[f],d=this.fileDirectory.StripByteCounts[f]),e.next=7,this.source.fetch([{offset:h,length:d}],s);case 7:return p=e.sent[0],null!==c&&c[f]?b=c[f]:(b=(0,o.default)(i.default.mark((function e(){var t,n,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.decode(y.fileDirectory,p);case 2:return t=e.sent,n=y.getSampleFormat(),o=y.getBitsPerSample(),v(n,o)&&(t=g(t,n,y.planarConfiguration,y.getSamplesPerPixel(),o,y.getTileWidth(),y.getBlockHeight(r))),e.abrupt(\"return\",t);case 7:case\"end\":return e.stop()}}),e)})))(),null!==c&&(c[f]=b)),e.t0=t,e.t1=r,e.t2=n,e.next=14,b;case 14:return e.t3=e.sent,e.abrupt(\"return\",{x:e.t0,y:e.t1,sample:e.t2,data:e.t3});case 16:case\"end\":return e.stop()}}),e,this)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}()},{key:\"_readRaster\",value:function(){var e=(0,o.default)(i.default.mark((function e(t,r,n,o,a,s,u,l,f){var c,h,p,y,v,g,m,w,_,k,x,S,O,T,E,C,P,j,R=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(c=this.getTileWidth(),h=this.getTileHeight(),p=Math.max(Math.floor(t[0]/c),0),y=Math.min(Math.ceil(t[2]/c),Math.ceil(this.getWidth()/this.getTileWidth())),v=Math.max(Math.floor(t[1]/h),0),g=Math.min(Math.ceil(t[3]/h),Math.ceil(this.getHeight()/this.getTileHeight())),m=t[2]-t[0],w=this.getBytesPerPixel(),_=[],k=[],x=0;x0&&void 0!==j[0]?j[0]:{},r=t.window,n=t.samples,o=void 0===n?[]:n,a=t.interleave,s=t.pool,u=void 0===s?null:s,l=t.width,f=t.height,c=t.resampleMethod,d=t.fillValue,p=t.signal,!((b=r||[0,0,this.getWidth(),this.getHeight()])[0]>b[2]||b[1]>b[3])){e.next=4;break}throw new Error(\"Invalid subsets\");case 4:if(v=b[2]-b[0],g=b[3]-b[1],m=v*g,w=this.getSamplesPerPixel(),o&&o.length){e.next=12;break}for(_=0;_=w)){e.next=16;break}return e.abrupt(\"return\",Promise.reject(new RangeError(\"Invalid sample index '\".concat(o[k],\"'.\"))));case 16:++k,e.next=13;break;case 19:if(a)S=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,O=Math.max.apply(null,this.fileDirectory.BitsPerSample),x=y(S,O,m*o.length),d&&x.fill(d);else for(x=[],T=0;T0&&void 0!==S[0]?S[0]:{},r=t.window,n=t.pool,o=void 0===n?null:n,a=t.width,s=t.height,u=t.resampleMethod,l=t.enableAlpha,h=void 0!==l&&l,d=t.signal,!((p=r||[0,0,this.getWidth(),this.getHeight()])[0]>p[2]||p[1]>p[3])){e.next=4;break}throw new Error(\"Invalid subsets\");case 4:if((b=this.fileDirectory.PhotometricInterpretation)!==f.photometricInterpretations.RGB){e.next=9;break}if(y=[0,1,2],this.fileDirectory.ExtraSamples!==f.ExtraSamplesValues.Unspecified&&h)for(y=[],v=0;v0&&void 0!==arguments[0]?arguments[0]:null,t={};if(!this.fileDirectory.GDAL_METADATA)return null;var r=this.fileDirectory.GDAL_METADATA,n=(0,l.default)(r.substring(0,r.length-1));if(!n[0].tagName)throw new Error(\"Failed to parse GDAL metadata XML.\");var i=n[0];if(\"GDALMetadata\"!==i.tagName)throw new Error(\"Unexpected GDAL metadata XML tag.\");var o=i.children.filter((function(e){return\"Item\"===e.tagName}));null!==e&&(o=o.filter((function(t){return Number(t.attributes.sample)===e})));for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:null,t=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(r)return[r[0],r[5],r[10]];if(e){var i=e.getResolution(),o=(0,n.default)(i,3),a=o[0],s=o[1],u=o[2];return[a*e.getWidth()/this.getWidth(),s*e.getHeight()/this.getHeight(),u*e.getWidth()/this.getWidth()]}throw new Error(\"The image does not have an affine transformation.\")}},{key:\"pixelIsArea\",value:function(){return 1===this.geoKeys.GTRasterTypeGeoKey}},{key:\"getBoundingBox\",value:function(){var e=this.getOrigin(),t=this.getResolution(),r=e[0],n=e[1],i=r+t[0]*this.getWidth(),o=n+t[1]*this.getHeight();return[Math.min(r,i),Math.min(n,o),Math.max(r,i),Math.max(n,o)]}}]),e}();r.default=m},{\"@babel/runtime/helpers/slicedToArray\":\"HETk\",\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@petamoriken/float16\":\"Stm8\",txml:\"JO74\",\"./globals\":\"j27V\",\"./rgb\":\"fpBl\",\"./compression\":\"FGCZ\",\"./resample\":\"OQju\"}],dqpX:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"@babel/runtime/helpers/classCallCheck\")),i=a(e(\"@babel/runtime/helpers/createClass\")),o=e(\"@petamoriken/float16\");function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){(0,n.default)(this,e),this._dataView=new DataView(t)}return(0,i.default)(e,[{key:\"getUint64\",value:function(e,t){var r,n=this.getUint32(e,t),i=this.getUint32(e+4,t);if(t){if(r=n+Math.pow(2,32)*i,!Number.isSafeInteger(r))throw new Error(\"\".concat(r,\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\"));return r}if(r=Math.pow(2,32)*n+i,!Number.isSafeInteger(r))throw new Error(\"\".concat(r,\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\"));return r}},{key:\"getInt64\",value:function(e,t){for(var r=0,n=(128&this._dataView.getUint8(e+(t?7:0)))>0,i=!0,o=0;o<8;o++){var a=this._dataView.getUint8(e+(t?o:7-o));n&&(i?0!==a&&(a=255&~(a-1),i=!1):a=255&~a),r+=a*Math.pow(256,o)}return n&&(r=-r),r}},{key:\"getUint8\",value:function(e,t){return this._dataView.getUint8(e,t)}},{key:\"getInt8\",value:function(e,t){return this._dataView.getInt8(e,t)}},{key:\"getUint16\",value:function(e,t){return this._dataView.getUint16(e,t)}},{key:\"getInt16\",value:function(e,t){return this._dataView.getInt16(e,t)}},{key:\"getUint32\",value:function(e,t){return this._dataView.getUint32(e,t)}},{key:\"getInt32\",value:function(e,t){return this._dataView.getInt32(e,t)}},{key:\"getFloat16\",value:function(e,t){return(0,o.getFloat16)(this._dataView,t)}},{key:\"getFloat32\",value:function(e,t){return this._dataView.getFloat32(e,t)}},{key:\"getFloat64\",value:function(e,t){return this._dataView.getFloat64(e,t)}},{key:\"buffer\",get:function(){return this._dataView.buffer}}]),e}();r.default=s},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@petamoriken/float16\":\"Stm8\"}],dGLV:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"@babel/runtime/helpers/classCallCheck\")),i=o(e(\"@babel/runtime/helpers/createClass\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(t,r,i,o){(0,n.default)(this,e),this._dataView=new DataView(t),this._sliceOffset=r,this._littleEndian=i,this._bigTiff=o}return(0,i.default)(e,[{key:\"covers\",value:function(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}},{key:\"readUint8\",value:function(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}},{key:\"readInt8\",value:function(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}},{key:\"readUint16\",value:function(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}},{key:\"readInt16\",value:function(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}},{key:\"readUint32\",value:function(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}},{key:\"readInt32\",value:function(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}},{key:\"readFloat32\",value:function(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}},{key:\"readFloat64\",value:function(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}},{key:\"readUint64\",value:function(e){var t,r=this.readUint32(e),n=this.readUint32(e+4);if(this._littleEndian){if(t=r+Math.pow(2,32)*n,!Number.isSafeInteger(t))throw new Error(\"\".concat(t,\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\"));return t}if(t=Math.pow(2,32)*r+n,!Number.isSafeInteger(t))throw new Error(\"\".concat(t,\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\"));return t}},{key:\"readInt64\",value:function(e){for(var t=0,r=(128&this._dataView.getUint8(e+(this._littleEndian?7:0)))>0,n=!0,i=0;i<8;i++){var o=this._dataView.getUint8(e+(this._littleEndian?i:7-i));r&&(n?0!==o&&(o=255&~(o-1),n=!1):o=255&~o),t+=o*Math.pow(256,i)}return r&&(t=-t),t}},{key:\"readOffset\",value:function(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}},{key:\"sliceOffset\",get:function(){return this._sliceOffset}},{key:\"sliceTop\",get:function(){return this._sliceOffset+this.buffer.byteLength}},{key:\"littleEndian\",get:function(){return this._littleEndian}},{key:\"bigTiff\",get:function(){return this._bigTiff}},{key:\"buffer\",get:function(){return this._dataView.buffer}}]),e}();r.default=a},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\"}],z2GM:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.extendSerializer=function(e,t){const r=e.deserialize.bind(e),n=e.serialize.bind(e);return{deserialize:e=>t.deserialize(e,r),serialize:e=>t.serialize(e,n)}},r.DefaultSerializer=void 0;const n=e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),i=e=>({__error_marker:\"$$error\",message:e.message,name:e.name,stack:e.stack}),o={deserialize:e=>(e=>e&&\"object\"==typeof e&&\"__error_marker\"in e&&\"$$error\"===e.__error_marker)(e)?n(e):e,serialize:e=>e instanceof Error?i(e):e};r.DefaultSerializer=o},{}],kdjL:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.registerSerializer=function(e){i=(0,n.extendSerializer)(i,e)},r.deserialize=function(e){return i.deserialize(e)},r.serialize=function(e){return i.serialize(e)};var n=e(\"./serializers\");let i=n.DefaultSerializer},{\"./serializers\":\"z2GM\"}],LQHy:[function(e,t,r){\"use strict\";let n;function i(e){return(\"\"+e).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\\/\\/.+)?\\/[^/]+(?:\\?.*)?$/,\"$1\")+\"/\"}Object.defineProperty(r,\"__esModule\",{value:!0}),r.getBaseURL=i,r.getBundleURL=function(){return n||(n=function(){try{throw new Error}catch(e){const t=(\"\"+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\\/\\/[^)\\n]+/g);if(t)return i(t[0])}return\"/\"}()),n}},{}],XK2w:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.selectWorkerImplementation=function(){return\"undefined\"==typeof Worker?class{constructor(){throw Error(\"No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.\")}}:class extends Worker{constructor(e,t){\"string\"==typeof e&&t&&t._baseURL?e=new URL(e,t._baseURL):\"string\"==typeof e&&!o(e)&&(0,n.getBundleURL)().match(/^file:\\/\\//i)&&(e=new URL(e,(0,n.getBundleURL)().replace(/\\/[^\\/]+$/,\"/\")),e=a(`importScripts(${JSON.stringify(e)});`)),\"string\"==typeof e&&o(e)&&(e=a(`importScripts(${JSON.stringify(e)});`)),super(e,t)}}},r.defaultPoolSize=void 0;var n=e(\"./get-bundle-url.browser\");const i=\"undefined\"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;r.defaultPoolSize=i;const o=e=>/^(file|https?:)?\\/\\//i.test(e);function a(e){const t=new Blob([e],{type:\"application/javascript\"});return URL.createObjectURL(t)}},{\"./get-bundle-url.browser\":\"LQHy\"}],IAgR:[function(e,t,r){var n=1e3,i=60*n,o=60*i,a=24*o;function s(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||\"ms\").toLowerCase()){case\"years\":case\"year\":case\"yrs\":case\"yr\":case\"y\":return 315576e5*r;case\"weeks\":case\"week\":case\"w\":return 6048e5*r;case\"days\":case\"day\":case\"d\":return r*a;case\"hours\":case\"hour\":case\"hrs\":case\"hr\":case\"h\":return r*o;case\"minutes\":case\"minute\":case\"mins\":case\"min\":case\"m\":return r*i;case\"seconds\":case\"second\":case\"secs\":case\"sec\":case\"s\":return r*n;case\"milliseconds\":case\"millisecond\":case\"msecs\":case\"msec\":case\"ms\":return r;default:return}}}}function u(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+\"d\":t>=o?Math.round(e/o)+\"h\":t>=i?Math.round(e/i)+\"m\":t>=n?Math.round(e/n)+\"s\":e+\"ms\"}function l(e){var t=Math.abs(e);return t>=a?f(e,t,a,\"day\"):t>=o?f(e,t,o,\"hour\"):t>=i?f(e,t,i,\"minute\"):t>=n?f(e,t,n,\"second\"):e+\" ms\"}function f(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+\" \"+n+(i?\"s\":\"\")}t.exports=function(e,t){t=t||{};var r=typeof e;if(\"string\"===r&&e.length>0)return s(e);if(\"number\"===r&&isFinite(e))return t.long?l(e):u(e);throw new Error(\"val is not a non-empty string or a valid number. val=\"+JSON.stringify(e))}},{}],Kest:[function(e,t,r){t.exports=function(t){function r(e){let t=0;for(let r=0;r{if(\"%%\"===t)return t;s++;const o=n.formatters[i];if(\"function\"==typeof o){const n=e[s];t=o.call(r,n),e.splice(s,1),s--}return t})),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return a.namespace=e,a.enabled=n.enabled(e),a.useColors=n.useColors(),a.color=r(e),a.destroy=i,a.extend=o,\"function\"==typeof n.init&&n.init(a),n.instances.push(a),a}function i(){const e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function o(e,t){const r=n(this.namespace+(void 0===t?\":\":t)+e);return r.log=this.log,r}function a(e){return e.toString().substring(2,e.toString().length-2).replace(/\\.\\*\\?$/,\"*\")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){const e=[...n.names.map(a),...n.skips.map(a).map((e=>\"-\"+e))].join(\",\");return n.enable(\"\"),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=(\"string\"==typeof e?e:\"\").split(/[\\s,]+/),i=r.length;for(t=0;t{n[e]=t[e]})),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=r,n.enable(n.load()),n}},{ms:\"IAgR\"}],jcLW:[function(e,t,r){e(\"process\");var n=e(\"process\");r.log=function(...e){return\"object\"==typeof console&&console.log&&console.log(...e)},r.formatArgs=function(e){if(e[0]=(this.useColors?\"%c\":\"\")+this.namespace+(this.useColors?\" %c\":\" \")+e[0]+(this.useColors?\"%c \":\" \")+\"+\"+t.exports.humanize(this.diff),!this.useColors)return;const r=\"color: \"+this.color;e.splice(1,0,r,\"color: inherit\");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{\"%%\"!==e&&(n++,\"%c\"===e&&(i=n))})),e.splice(i,0,r)},r.save=function(e){try{e?r.storage.setItem(\"debug\",e):r.storage.removeItem(\"debug\")}catch(e){}},r.load=function(){let e;try{e=r.storage.getItem(\"debug\")}catch(e){}return!e&&void 0!==n&&\"env\"in n&&(e=void 0),e},r.useColors=function(){return!(\"undefined\"==typeof window||!window.process||\"renderer\"!==window.process.type&&!window.process.__nwjs)||(\"undefined\"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))&&(\"undefined\"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||\"undefined\"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/))},r.storage=function(){try{return localStorage}catch(e){}}(),r.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"],t.exports=e(\"./common\")(r);const{formatters:i}=t.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return\"[UnexpectedJSONParseError]: \"+e.message}}},{\"./common\":\"Kest\",process:\"pBGv\"}],sfrJ:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.AsyncSerialScheduler=void 0;r.AsyncSerialScheduler=class{constructor(e){this._baseObserver=e,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then((()=>this._baseObserver.complete())).catch((e=>this._baseObserver.error(e)))}error(e){this._baseObserver.error(e)}schedule(e){const t=Promise.all(this._pendingPromises),r=[],n=e=>r.push(e),i=Promise.resolve().then((()=>function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){yield t,yield e(n),this._pendingPromises.delete(i);for(const e of r)this._baseObserver.next(e)})))).catch((e=>{this._pendingPromises.delete(i),this._baseObserver.error(e)}));this._pendingPromises.add(i)}}},{}],lj3f:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.registerObservableSymbol=function(){n()&&!i(\"observable\")&&(Symbol.observable=Symbol(\"observable\"))},r.getSymbol=r.hasSymbol=r.hasSymbols=void 0;const n=()=>\"function\"==typeof Symbol;r.hasSymbols=n;const i=e=>n()&&Boolean(Symbol[e]);r.hasSymbol=i;r.getSymbol=e=>i(e)?Symbol[e]:\"@@\"+e,i(\"asyncIterator\")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for(\"Symbol.asyncIterator\"))},{}],B9l3:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=r.Observable=r.SubscriptionObserver=r.Subscription=void 0;var n=e(\"./_symbols\");const i=(0,n.getSymbol)(\"iterator\"),o=(0,n.getSymbol)(\"observable\"),a=(0,n.getSymbol)(\"species\");function s(e,t){const r=e[t];if(null!=r){if(\"function\"!=typeof r)throw new TypeError(r+\" is not a function\");return r}}function u(e){let t=e.constructor;return void 0!==t&&null===(t=t[a])&&(t=void 0),void 0!==t?t:v}function l(e){l.log?l.log(e):setTimeout((()=>{throw e}),0)}function f(e){Promise.resolve().then((()=>{try{e()}catch(e){l(e)}}))}function c(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if(\"function\"==typeof t)t();else{const e=s(t,\"unsubscribe\");e&&e.call(t)}}catch(e){l(e)}}function h(e){e._observer=void 0,e._queue=void 0,e._state=\"closed\"}function d(e,t,r){e._state=\"running\";const n=e._observer;try{const i=n?s(n,t):void 0;switch(t){case\"next\":i&&i.call(n,r);break;case\"error\":if(h(e),!i)throw r;i.call(n,r);break;case\"complete\":h(e),i&&i.call(n)}}catch(e){l(e)}\"closed\"===e._state?c(e):\"running\"===e._state&&(e._state=\"ready\")}function p(e,t,r){if(\"closed\"!==e._state)return\"buffering\"===e._state?(e._queue=e._queue||[],void e._queue.push({type:t,value:r})):\"ready\"!==e._state?(e._state=\"buffering\",e._queue=[{type:t,value:r}],void f((()=>function(e){const t=e._queue;if(t){e._queue=void 0,e._state=\"ready\";for(const r of t)if(d(e,r.type,r.value),\"closed\"===e._state)break}}(e)))):void d(e,t,r)}class b{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state=\"initializing\";const r=new y(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}\"initializing\"===this._state&&(this._state=\"ready\")}get closed(){return\"closed\"===this._state}unsubscribe(){\"closed\"!==this._state&&(h(this),c(this))}}r.Subscription=b;class y{constructor(e){this._subscription=e}get closed(){return\"closed\"===this._subscription._state}next(e){p(this._subscription,\"next\",e)}error(e){p(this._subscription,\"error\",e)}complete(){p(this._subscription,\"complete\")}}r.SubscriptionObserver=y;class v{constructor(e){if(!(this instanceof v))throw new TypeError(\"Observable cannot be called as a function\");if(\"function\"!=typeof e)throw new TypeError(\"Observable initializer must be a function\");this._subscriber=e}subscribe(e,t,r){return\"object\"==typeof e&&null!==e||(e={next:e,error:t,complete:r}),new b(e,this._subscriber)}pipe(e,...t){let r=this;for(const n of[e,...t])r=n(r);return r}tap(e,t,r){const n=\"object\"!=typeof e||null===e?{next:e,error:t,complete:r}:e;return new v((e=>this.subscribe({next(t){n.next&&n.next(t),e.next(t)},error(t){n.error&&n.error(t),e.error(t)},complete(){n.complete&&n.complete(),e.complete()},start(e){n.start&&n.start(e)}})))}forEach(e){return new Promise(((t,r)=>{if(\"function\"!=typeof e)return void r(new TypeError(e+\" is not a function\"));function n(){i.unsubscribe(),t()}const i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t})}))}map(e){if(\"function\"!=typeof e)throw new TypeError(e+\" is not a function\");return new(u(this))((t=>this.subscribe({next(r){let n=r;try{n=e(r)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}})))}filter(e){if(\"function\"!=typeof e)throw new TypeError(e+\" is not a function\");return new(u(this))((t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}})))}reduce(e,t){if(\"function\"!=typeof e)throw new TypeError(e+\" is not a function\");const r=u(this),n=arguments.length>1;let i=!1,o=t;return new r((t=>this.subscribe({next(r){const a=!i;if(i=!0,!a||n)try{o=e(o,r)}catch(e){return t.error(e)}else o=r},error(e){t.error(e)},complete(){if(!i&&!n)return t.error(new TypeError(\"Cannot reduce an empty sequence\"));t.next(o),t.complete()}})))}concat(...e){const t=u(this);return new t((r=>{let n,i=0;return function o(a){n=a.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):o(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}}))}flatMap(e){if(\"function\"!=typeof e)throw new TypeError(e+\" is not a function\");const t=u(this);return new t((r=>{const n=[],i=this.subscribe({next(i){let a;if(e)try{a=e(i)}catch(e){return r.error(e)}else a=i;const s=t.from(a).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){const e=n.indexOf(s);e>=0&&n.splice(e,1),o()}});n.push(s)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach((e=>e.unsubscribe())),i.unsubscribe()}}))}[o](){return this}static from(e){const t=\"function\"==typeof this?this:v;if(null==e)throw new TypeError(e+\" is not an object\");const r=s(e,o);if(r){const n=r.call(e);if(Object(n)!==n)throw new TypeError(n+\" is not an object\");return function(e){return e instanceof v}(n)&&n.constructor===t?n:new t((e=>n.subscribe(e)))}if((0,n.hasSymbol)(\"iterator\")){const r=s(e,i);if(r)return new t((t=>{f((()=>{if(!t.closed){for(const n of r.call(e))if(t.next(n),t.closed)return;t.complete()}}))}))}if(Array.isArray(e))return new t((t=>{f((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}));throw new TypeError(e+\" is not observable\")}static of(...e){return new(\"function\"==typeof this?this:v)((t=>{f((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}))}static get[a](){return this}}r.Observable=v,(0,n.hasSymbols)()&&Object.defineProperty(v,Symbol(\"extensions\"),{value:{symbol:o,hostReportError:l},configurable:!0});var g=v;r.default=g},{\"./_symbols\":\"lj3f\"}],QC75:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){\"function\"==typeof e?e():e&&\"function\"==typeof e.unsubscribe&&e.unsubscribe()};r.default=n},{}],apmd:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=e(\"./_scheduler\"),i=a(e(\"./observable\")),o=a(e(\"./unsubscribe\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){return t=>new i.default((r=>{const i=new n.AsyncSerialScheduler(r),a=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule((r=>function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){(yield e(t))&&r(t)}))))}});return()=>(0,o.default)(a)}))};r.default=s},{\"./_scheduler\":\"sfrJ\",\"./observable\":\"B9l3\",\"./unsubscribe\":\"QC75\"}],FgiE:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.isAsyncIterator=function(e){return e&&(0,n.hasSymbol)(\"asyncIterator\")&&e[Symbol.asyncIterator]},r.isIterator=function(e){return e&&(0,n.hasSymbol)(\"iterator\")&&e[Symbol.iterator]};var n=e(\"./_symbols\")},{\"./_symbols\":\"lj3f\"}],ltny:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=e(\"./_scheduler\"),i=e(\"./_util\"),o=s(e(\"./observable\")),a=s(e(\"./unsubscribe\"));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){return t=>new o.default((r=>{const o=new n.AsyncSerialScheduler(r),s=t.subscribe({complete(){o.complete()},error(e){o.error(e)},next(t){o.schedule((r=>function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){var n,o;const a=yield e(t);if((0,i.isIterator)(a)||(0,i.isAsyncIterator)(a))try{for(var s,u=function(e){if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=\"function\"==typeof __values?__values(e):e[Symbol.iterator](),t={},n(\"next\"),n(\"throw\"),n(\"return\"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}(a);!(s=yield u.next()).done;){const e=s.value;r(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=u.return)&&(yield o.call(u))}finally{if(n)throw n.error}}else a.map((e=>r(e)))}))))}});return()=>(0,a.default)(s)}))};r.default=u},{\"./_scheduler\":\"sfrJ\",\"./_util\":\"FgiE\",\"./observable\":\"B9l3\",\"./unsubscribe\":\"QC75\"}],jAhG:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=function(e){return new n.Observable((t=>{let r=0;const n=setInterval((()=>{t.next(r++)}),e);return()=>clearInterval(n)}))};var n=e(\"./observable\")},{\"./observable\":\"B9l3\"}],aP59:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=e(\"./_scheduler\"),i=a(e(\"./observable\")),o=a(e(\"./unsubscribe\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){return t=>new i.default((r=>{const i=new n.AsyncSerialScheduler(r),a=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule((r=>function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const n=yield e(t);r(n)}))))}});return()=>(0,o.default)(a)}))};r.default=s},{\"./_scheduler\":\"sfrJ\",\"./observable\":\"B9l3\",\"./unsubscribe\":\"QC75\"}],Rg1v:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=e(\"./observable\"),i=function(e){return e&&e.__esModule?e:{default:e}}(e(\"./unsubscribe\"));var o=function(...e){return 0===e.length?n.Observable.from([]):new n.Observable((t=>{let r=0;const n=e.map((n=>n.subscribe({error(e){t.error(e),o()},next(e){t.next(e)},complete(){++r===e.length&&(t.complete(),o())}}))),o=()=>{n.forEach((e=>(0,i.default)(e)))};return o}))};r.default=o},{\"./observable\":\"B9l3\",\"./unsubscribe\":\"QC75\"}],wtHd:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e(\"./observable\"));class i extends n.default{constructor(){super((e=>(this._observers.add(e),()=>this._observers.delete(e)))),this._observers=new Set}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){for(const e of this._observers)e.complete()}}var o=i;r.default=o},{\"./observable\":\"B9l3\"}],NgdC:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./observable\")),i=a(e(\"./subject\")),o=a(e(\"./unsubscribe\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){const t=new i.default;let r,a=0;return new n.default((n=>{r||(r=e.subscribe(t));const i=t.subscribe(n);return a++,()=>{a--,i.unsubscribe(),0===a&&((0,o.default)(r),r=void 0)}}))};r.default=s},{\"./observable\":\"B9l3\",\"./subject\":\"wtHd\",\"./unsubscribe\":\"QC75\"}],b7o0:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=e(\"./_scheduler\"),i=a(e(\"./observable\")),o=a(e(\"./unsubscribe\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){return r=>new i.default((i=>{let a,s=0;const u=new n.AsyncSerialScheduler(i),l=r.subscribe({complete(){u.complete()},error(e){u.error(e)},next(r){u.schedule((n=>function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const i=0===s?void 0===t?r:t:a;a=yield e(i,r,s++),n(a)}))))}});return()=>(0,o.default)(l)}))};r.default=s},{\"./_scheduler\":\"sfrJ\",\"./observable\":\"B9l3\",\"./unsubscribe\":\"QC75\"}],cyO3:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),Object.defineProperty(r,\"filter\",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,\"flatMap\",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,\"interval\",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,\"map\",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,\"merge\",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,\"multicast\",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,\"Observable\",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,\"scan\",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(r,\"Subject\",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,\"unsubscribe\",{enumerable:!0,get:function(){return h.default}});var n=d(e(\"./filter\")),i=d(e(\"./flatMap\")),o=d(e(\"./interval\")),a=d(e(\"./map\")),s=d(e(\"./merge\")),u=d(e(\"./multicast\")),l=d(e(\"./observable\")),f=d(e(\"./scan\")),c=d(e(\"./subject\")),h=d(e(\"./unsubscribe\"));function d(e){return e&&e.__esModule?e:{default:e}}},{\"./filter\":\"apmd\",\"./flatMap\":\"ltny\",\"./interval\":\"jAhG\",\"./map\":\"aP59\",\"./merge\":\"Rg1v\",\"./multicast\":\"NgdC\",\"./observable\":\"B9l3\",\"./scan\":\"b7o0\",\"./subject\":\"wtHd\",\"./unsubscribe\":\"QC75\"}],vpgy:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.allSettled=function(e){return Promise.all(e.map((e=>{const t=e=>({status:\"fulfilled\",value:e}),r=e=>({status:\"rejected\",reason:e}),n=Promise.resolve(e);try{return n.then(t,r)}catch(e){return Promise.reject(e)}})))}},{}],UYCO:[function(e,t,r){\"use strict\";var n;Object.defineProperty(r,\"__esModule\",{value:!0}),r.PoolEventType=void 0,r.PoolEventType=n,function(e){e.initialized=\"initialized\",e.taskCanceled=\"taskCanceled\",e.taskCompleted=\"taskCompleted\",e.taskFailed=\"taskFailed\",e.taskQueued=\"taskQueued\",e.taskQueueDrained=\"taskQueueDrained\",e.taskStart=\"taskStart\",e.terminated=\"terminated\"}(n||(r.PoolEventType=n={}))},{}],fmdM:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.$worker=r.$transferable=r.$terminate=r.$events=r.$errors=void 0;const n=Symbol(\"thread.errors\");r.$errors=n;const i=Symbol(\"thread.events\");r.$events=i;const o=Symbol(\"thread.terminate\");r.$terminate=o;const a=Symbol(\"thread.transferable\");r.$transferable=a;const s=Symbol(\"thread.worker\");r.$worker=s},{}],LBuu:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.Thread=void 0;var n=e(\"../symbols\");function i(e){throw Error(e)}const o={errors:e=>e[n.$errors]||i(\"Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.\"),events:e=>e[n.$events]||i(\"Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.\"),terminate:e=>e[n.$terminate]()};r.Thread=o},{\"../symbols\":\"fmdM\"}],EB3M:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),Object.defineProperty(r,\"PoolEventType\",{enumerable:!0,get:function(){return s.PoolEventType}}),Object.defineProperty(r,\"Thread\",{enumerable:!0,get:function(){return u.Thread}}),r.Pool=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e(\"debug\")),i=e(\"observable-fns\"),o=e(\"../ponyfills\"),a=e(\"./implementation\"),s=e(\"./pool-types\"),u=e(\"./thread\");var l=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};let f=1;class c{constructor(e,t){this.eventSubject=new i.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const r=\"number\"==typeof t?{size:t}:t||{},{size:o=a.defaultPoolSize}=r;this.debug=(0,n.default)(\"threads:pool:\"+function(e){return e.replace(/\\W/g,\" \").trim().replace(/\\s+/g,\"-\")}(r.name||String(f++))),this.options=r,this.workers=function(e,t){return function(e){const t=[];for(let r=0;r({init:e(),runningTasks:[]})))}(e,o),this.eventObservable=(0,i.multicast)(i.Observable.from(this.eventSubject)),Promise.all(this.workers.map((e=>e.init))).then((()=>this.eventSubject.next({type:s.PoolEventType.initialized,size:this.workers.length})),(e=>{this.debug(\"Error while initializing pool worker:\",e),this.eventSubject.error(e),this.initErrors.push(e)}))}findIdlingWorker(){const{concurrency:e=1}=this.options;return this.workers.find((t=>t.runningTasks.lengthl(this,void 0,void 0,(function*(){yield function(e){return new Promise((t=>setTimeout(t,e)))}(0);try{yield this.runPoolTask(e,t)}finally{e.runningTasks=e.runningTasks.filter((e=>e!==r)),this.isClosing||this.scheduleWork()}})))();e.runningTasks.push(r)}))}scheduleWork(){this.debug(\"Attempt de-queueing a task in order to run it...\");const e=this.findIdlingWorker();if(!e)return;const t=this.taskQueue.shift();if(!t)return this.debug(\"Task queue is empty\"),void this.eventSubject.next({type:s.PoolEventType.taskQueueDrained});this.run(e,t)}taskCompletion(e){return new Promise(((t,r)=>{const n=this.events().subscribe((i=>{i.type===s.PoolEventType.taskCompleted&&i.taskID===e?(n.unsubscribe(),t(i.returnValue)):i.type===s.PoolEventType.taskFailed&&i.taskID===e?(n.unsubscribe(),r(i.error)):i.type===s.PoolEventType.terminated&&(n.unsubscribe(),r(Error(\"Pool has been terminated before task was run.\")))}))}))}settled(e=!1){return l(this,void 0,void 0,(function*(){const t=()=>function(e,t){return e.reduce(((e,r)=>[...e,...t(r)]),[])}(this.workers,(e=>e.runningTasks)),r=[],n=this.eventObservable.subscribe((e=>{e.type===s.PoolEventType.taskFailed&&r.push(e.error)}));return this.initErrors.length>0?Promise.reject(this.initErrors[0]):e&&0===this.taskQueue.length?(yield(0,o.allSettled)(t()),r):(yield new Promise(((e,t)=>{const r=this.eventObservable.subscribe({next(t){t.type===s.PoolEventType.taskQueueDrained&&(r.unsubscribe(),e())},error:t})})),yield(0,o.allSettled)(t()),n.unsubscribe(),r)}))}completed(e=!1){return l(this,void 0,void 0,(function*(){const t=this.settled(e),r=new Promise(((e,r)=>{const n=this.eventObservable.subscribe({next(i){i.type===s.PoolEventType.taskQueueDrained?(n.unsubscribe(),e(t)):i.type===s.PoolEventType.taskFailed&&(n.unsubscribe(),r(i.error))},error:r})})),n=yield Promise.race([t,r]);if(n.length>0)throw n[0]}))}events(){return this.eventObservable}queue(e){const{maxQueuedJobs:t=1/0}=this.options;if(this.isClosing)throw Error(\"Cannot schedule pool tasks after terminate() has been called.\");if(this.initErrors.length>0)throw this.initErrors[0];const r=()=>this.taskCompletion(i.id);let n;const i={id:this.nextTaskID++,run:e,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter((e=>e!==i)),this.eventSubject.next({type:s.PoolEventType.taskCanceled,taskID:i.id}))},get then(){if(!n){const e=r();n=e.then.bind(e)}return n}};if(this.taskQueue.length>=t)throw Error(\"Maximum number of pool tasks queued. Refusing to queue another one.\\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.\");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:s.PoolEventType.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(e){return l(this,void 0,void 0,(function*(){this.isClosing=!0,e||(yield this.completed(!0)),this.eventSubject.next({type:s.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map((e=>l(this,void 0,void 0,(function*(){return u.Thread.terminate(yield e.init)})))))}))}}function h(e,t){return new c(e,t)}c.EventType=s.PoolEventType,h.EventType=s.PoolEventType;const d=h;r.Pool=d},{debug:\"jcLW\",\"observable-fns\":\"cyO3\",\"../ponyfills\":\"vpgy\",\"./implementation\":\"XK2w\",\"./pool-types\":\"UYCO\",\"./thread\":\"LBuu\"}],PRGP:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.createPromiseWithResolver=function(){let e,t=!1,r=n;return[new Promise((n=>{t?n(e):r=n})),n=>{t=!0,e=n,r()}]};const n=()=>{}},{}],ZLGT:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.WorkerEventType=void 0;var n;e(\"../symbols\");r.WorkerEventType=n,function(e){e.internalError=\"internalError\",e.message=\"message\",e.termination=\"termination\"}(n||(r.WorkerEventType=n={}))},{\"../symbols\":\"fmdM\"}],zXl4:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.ObservablePromise=void 0;var n=e(\"observable-fns\");const i=()=>{},o=e=>e,a=e=>Promise.resolve().then(e);function s(e){throw e}class u extends n.Observable{constructor(e){super((t=>{const r=this,n=Object.assign(Object.assign({},t),{complete(){t.complete(),r.onCompletion()},error(e){t.error(e),r.onError(e)},next(e){t.next(e),r.onNext(e)}});try{return this.initHasRun=!0,e(n)}catch(e){n.error(e)}})),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state=\"pending\"}onNext(e){this.firstValueSet||(this.firstValue=e,this.firstValueSet=!0)}onError(e){this.state=\"rejected\",this.rejection=e;for(const t of this.rejectionCallbacks)a((()=>t(e)))}onCompletion(){this.state=\"fulfilled\";for(const e of this.fulfillmentCallbacks)a((()=>e(this.firstValue)))}then(e,t){const r=e||o,n=t||s;let i=!1;return new Promise(((e,t)=>{const o=r=>{if(!i){i=!0;try{e(n(r))}catch(e){t(e)}}};return this.initHasRun||this.subscribe({error:o}),\"fulfilled\"===this.state?e(r(this.firstValue)):\"rejected\"===this.state?(i=!0,e(n(this.rejection))):(this.fulfillmentCallbacks.push((t=>{try{e(r(t))}catch(e){o(e)}})),void this.rejectionCallbacks.push(o))}))}catch(e){return this.then(void 0,e)}finally(e){const t=e||i;return this.then((e=>(t(),e)),(()=>t()))}static from(e){return function(e){return e&&\"function\"==typeof e.then}(e)?new u((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>{t.error(e)}))})):super.from(e)}}r.ObservablePromise=u},{\"observable-fns\":\"cyO3\"}],qW1u:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.isTransferDescriptor=function(e){return e&&\"object\"==typeof e&&e[n.$transferable]},r.Transfer=function(e,t){if(!t){if(!function(e){return!(!e||\"object\"!=typeof e)}(e))throw Error();t=[e]}return{[n.$transferable]:!0,send:e,transferables:t}};var n=e(\"./symbols\")},{\"./symbols\":\"fmdM\"}],fUdt:[function(e,t,r){\"use strict\";var n,i;Object.defineProperty(r,\"__esModule\",{value:!0}),r.WorkerMessageType=r.MasterMessageType=void 0,r.MasterMessageType=n,function(e){e.run=\"run\"}(n||(r.MasterMessageType=n={})),r.WorkerMessageType=i,function(e){e.error=\"error\",e.init=\"init\",e.result=\"result\",e.running=\"running\",e.uncaughtError=\"uncaughtError\"}(i||(r.WorkerMessageType=i={}))},{}],iMbm:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.createProxyFunction=v,r.createProxyModule=function(e,t){const r={};for(const n of t)r[n]=v(e,n);return r};var n=function(e){return e&&e.__esModule?e:{default:e}}(e(\"debug\")),i=e(\"observable-fns\"),o=e(\"../common\"),a=e(\"../observable-promise\"),s=e(\"../transferable\"),u=e(\"../types/messages\");const l=(0,n.default)(\"threads:master:messages\");let f=1;const c=e=>Array.from(new Set(e)),h=e=>e&&e.type===u.WorkerMessageType.error,d=e=>e&&e.type===u.WorkerMessageType.result,p=e=>e&&e.type===u.WorkerMessageType.running;function b(e,t){return new i.Observable((r=>{let n;const i=a=>{if(l(\"Message from worker:\",a.data),a.data&&a.data.uid===t)if(p(a.data))n=a.data.resultType;else if(d(a.data))\"promise\"===n?(void 0!==a.data.payload&&r.next((0,o.deserialize)(a.data.payload)),r.complete(),e.removeEventListener(\"message\",i)):(a.data.payload&&r.next((0,o.deserialize)(a.data.payload)),a.data.complete&&(r.complete(),e.removeEventListener(\"message\",i)));else if(h(a.data)){const t=(0,o.deserialize)(a.data.error);r.error(t),e.removeEventListener(\"message\",i)}};return e.addEventListener(\"message\",i),()=>e.removeEventListener(\"message\",i)}))}function y(e){if(0===e.length)return{args:[],transferables:[]};const t=[],r=[];for(const n of e)(0,s.isTransferDescriptor)(n)?(t.push((0,o.serialize)(n.send)),r.push(...n.transferables)):t.push((0,o.serialize)(n));return{args:t,transferables:0===r.length?r:c(r)}}function v(e,t){return(...r)=>{const n=f++,{args:o,transferables:s}=y(r),c={type:u.MasterMessageType.run,uid:n,method:t,args:o};l(\"Sending command to run function to worker:\",c);try{e.postMessage(c,s)}catch(e){return a.ObservablePromise.from(Promise.reject(e))}return a.ObservablePromise.from((0,i.multicast)(b(e,n)))}}},{debug:\"jcLW\",\"observable-fns\":\"cyO3\",\"../common\":\"kdjL\",\"../observable-promise\":\"zXl4\",\"../transferable\":\"qW1u\",\"../types/messages\":\"fUdt\"}],a83E:[function(e,t,r){e(\"process\"),e(\"process\");Object.defineProperty(r,\"__esModule\",{value:!0}),r.spawn=function(e,t){return f(this,void 0,void 0,(function*(){h(\"Initializing new thread\");const r=(yield function(e,t,r){return f(this,void 0,void 0,(function*(){let n;const i=new Promise(((e,i)=>{n=setTimeout((()=>i(Error(r))),t)})),o=yield Promise.race([e,i]);return clearTimeout(n),o}))}(p(e),t&&t.timeout?t.timeout:1e4,\"Timeout: Did not receive an init message from worker after 10000ms. Make sure the worker calls expose().\")).exposed,{termination:n,terminate:i}=y(e),o=b(e,n);if(\"function\"===r.type)return v((0,l.createProxyFunction)(e),e,o,i);if(\"module\"===r.type)return v((0,l.createProxyModule)(e,r.methods),e,o,i);{const e=r.type;throw Error(\"Worker init message states unexpected type of expose(): \"+e)}}))};var n=function(e){return e&&e.__esModule?e:{default:e}}(e(\"debug\")),i=e(\"observable-fns\"),o=e(\"../common\"),a=e(\"../promise\"),s=e(\"../symbols\"),u=e(\"../types/master\"),l=e(\"./invocation-proxy\");var f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const c=(0,n.default)(\"threads:master:messages\"),h=(0,n.default)(\"threads:master:spawn\"),d=(0,n.default)(\"threads:master:thread-utils\");function p(e){return new Promise(((t,r)=>{const n=i=>{c(\"Message from worker before finishing initialization:\",i.data),(e=>e&&\"init\"===e.type)(i.data)?(e.removeEventListener(\"message\",n),t(i.data)):(e=>e&&\"uncaughtError\"===e.type)(i.data)&&(e.removeEventListener(\"message\",n),r((0,o.deserialize)(i.data.error)))};e.addEventListener(\"message\",n)}))}function b(e,t){return new i.Observable((r=>{const n=e=>{const t={type:u.WorkerEventType.message,data:e.data};r.next(t)},i=e=>{d(\"Unhandled promise rejection event in thread:\",e);const t={type:u.WorkerEventType.internalError,error:Error(e.reason)};r.next(t)};e.addEventListener(\"message\",n),e.addEventListener(\"unhandledrejection\",i),t.then((()=>{const t={type:u.WorkerEventType.termination};e.removeEventListener(\"message\",n),e.removeEventListener(\"unhandledrejection\",i),r.next(t),r.complete()}))}))}function y(e){const[t,r]=(0,a.createPromiseWithResolver)();return{terminate:()=>f(this,void 0,void 0,(function*(){d(\"Terminating worker\"),yield e.terminate(),r()})),termination:t}}function v(e,t,r,n){const i=r.filter((e=>e.type===u.WorkerEventType.internalError)).map((e=>e.error));return Object.assign(e,{[s.$errors]:i,[s.$events]:r,[s.$terminate]:n,[s.$worker]:t})}},{debug:\"jcLW\",\"observable-fns\":\"cyO3\",\"../common\":\"kdjL\",\"../promise\":\"PRGP\",\"../symbols\":\"fmdM\",\"../types/master\":\"ZLGT\",\"./invocation-proxy\":\"iMbm\",process:\"pBGv\"}],HfK0:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),Object.defineProperty(r,\"Pool\",{enumerable:!0,get:function(){return i.Pool}}),Object.defineProperty(r,\"spawn\",{enumerable:!0,get:function(){return o.spawn}}),Object.defineProperty(r,\"Thread\",{enumerable:!0,get:function(){return a.Thread}}),r.Worker=void 0;var n=e(\"./implementation\"),i=e(\"./pool\"),o=e(\"./spawn\"),a=e(\"./thread\");const s=(0,n.selectWorkerImplementation)();r.Worker=s},{\"./implementation\":\"XK2w\",\"./pool\":\"EB3M\",\"./spawn\":\"a83E\",\"./thread\":\"LBuu\"}],JZ8d:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=function(e){var t,r=e.Symbol;return\"function\"==typeof r?r.observable?t=r.observable:(t=r(\"observable\"),r.observable=t):t=\"@@observable\",t}},{}],LkZ7:[function(e,t,r){var n=arguments[3];Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var i,o=a(e(\"./ponyfill.js\"));function a(e){return e&&e.__esModule?e:{default:e}}i=\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:void 0!==n?n:void 0!==t?t:Function(\"return this\")();var s=(0,o.default)(i),u=s;r.default=u},{\"./ponyfill.js\":\"JZ8d\"}],UALh:[function(e,t,r){\"use strict\";const n=e(\"symbol-observable\").default;t.exports=e=>Boolean(e&&e[n]&&e===e[n]())},{\"symbol-observable\":\"LkZ7\"}],AZa4:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n={isWorkerRuntime:function(){return!(\"undefined\"==typeof self||!self.postMessage)},postMessageToMaster:function(e,t){self.postMessage(e,t)},subscribeToMasterMessages:function(e){const t=t=>{e(t.data)};return self.addEventListener(\"message\",t),()=>{self.removeEventListener(\"message\",t)}}};r.default=n},{}],l5pR:[function(e,t,r){e(\"process\");var n=e(\"process\");Object.defineProperty(r,\"__esModule\",{value:!0}),r.expose=function(e){if(!u.default.isWorkerRuntime())throw Error(\"expose() called in the master thread.\");if(f)throw Error(\"expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.\");if(f=!0,\"function\"==typeof e)u.default.subscribeToMasterMessages((t=>{c(t)&&!t.method&&g(t.uid,e,t.args.map(o.deserialize))})),function(){const e={type:s.WorkerMessageType.init,exposed:{type:\"function\"}};u.default.postMessageToMaster(e)}();else{if(\"object\"!=typeof e||!e)throw Error(\"Invalid argument passed to expose(). Expected a function or an object, got: \"+e);u.default.subscribeToMasterMessages((t=>{c(t)&&t.method&&g(t.uid,e[t.method],t.args.map(o.deserialize))})),function(e){const t={type:s.WorkerMessageType.init,exposed:{type:\"module\",methods:e}};u.default.postMessageToMaster(t)}(Object.keys(e).filter((t=>\"function\"==typeof e[t])))}},Object.defineProperty(r,\"registerSerializer\",{enumerable:!0,get:function(){return o.registerSerializer}}),Object.defineProperty(r,\"Transfer\",{enumerable:!0,get:function(){return a.Transfer}});var i=l(e(\"is-observable\")),o=e(\"../common\"),a=e(\"../transferable\"),s=e(\"../types/messages\"),u=l(e(\"./implementation\"));function l(e){return e&&e.__esModule?e:{default:e}}let f=!1;const c=e=>e&&e.type===s.MasterMessageType.run,h=e=>(0,i.default)(e)||function(e){return e&&\"object\"==typeof e&&\"function\"==typeof e.subscribe}(e);function d(e){return(0,a.isTransferDescriptor)(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function p(e,t){const{payload:r,transferables:n}=d(t),i={type:s.WorkerMessageType.error,uid:e,error:(0,o.serialize)(r)};u.default.postMessageToMaster(i,n)}function b(e,t,r){const{payload:n,transferables:i}=d(r),o={type:s.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:n};u.default.postMessageToMaster(o,i)}function y(e,t){const r={type:s.WorkerMessageType.running,uid:e,resultType:t};u.default.postMessageToMaster(r)}function v(e){try{const t={type:s.WorkerMessageType.uncaughtError,error:(0,o.serialize)(e)};u.default.postMessageToMaster(t)}catch(t){console.error(\"Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\\nLatest error:\",t,\"\\nOriginal error:\",e)}}function g(e,t,r){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){let n;try{n=t(...r)}catch(t){return p(e,t)}const i=h(n)?\"observable\":\"promise\";if(y(e,i),h(n))n.subscribe((t=>b(e,!1,(0,o.serialize)(t))),(t=>p(e,(0,o.serialize)(t))),(()=>b(e,!0)));else try{const t=yield n;b(e,!0,(0,o.serialize)(t))}catch(t){p(e,(0,o.serialize)(t))}}))}\"undefined\"!=typeof self&&\"function\"==typeof self.addEventListener&&u.default.isWorkerRuntime()&&(self.addEventListener(\"error\",(e=>{setTimeout((()=>v(e.error||e)),250)})),self.addEventListener(\"unhandledrejection\",(e=>{const t=e.reason;t&&\"string\"==typeof t.message&&setTimeout((()=>v(t)),250)}))),void 0!==n&&\"function\"==typeof n.on&&u.default.isWorkerRuntime()&&(n.on(\"uncaughtException\",(e=>{setTimeout((()=>v(e)),250)})),n.on(\"unhandledRejection\",(e=>{e&&\"string\"==typeof e.message&&setTimeout((()=>v(e)),250)})))},{\"is-observable\":\"UALh\",\"../common\":\"kdjL\",\"../transferable\":\"qW1u\",\"../types/messages\":\"fUdt\",\"./implementation\":\"AZa4\",process:\"pBGv\"}],CqwR:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0});var n={registerSerializer:!0,expose:!0,DefaultSerializer:!0,Transfer:!0};Object.defineProperty(r,\"registerSerializer\",{enumerable:!0,get:function(){return i.registerSerializer}}),Object.defineProperty(r,\"expose\",{enumerable:!0,get:function(){return a.expose}}),Object.defineProperty(r,\"DefaultSerializer\",{enumerable:!0,get:function(){return s.DefaultSerializer}}),Object.defineProperty(r,\"Transfer\",{enumerable:!0,get:function(){return u.Transfer}});var i=e(\"./common\"),o=e(\"./master/index\");Object.keys(o).forEach((function(e){\"default\"!==e&&\"__esModule\"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))}));var a=e(\"./worker/index\"),s=e(\"./serializers\"),u=e(\"./transferable\")},{\"./common\":\"kdjL\",\"./master/index\":\"HfK0\",\"./worker/index\":\"l5pR\",\"./serializers\":\"z2GM\",\"./transferable\":\"qW1u\"}],dHPO:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"@babel/runtime/regenerator\")),i=u(e(\"@babel/runtime/helpers/asyncToGenerator\")),o=u(e(\"@babel/runtime/helpers/classCallCheck\")),a=u(e(\"@babel/runtime/helpers/createClass\")),s=e(\"threads\");function u(e){return e&&e.__esModule?e:{default:e}}var l=\"undefined\"!=typeof navigator?navigator.hardwareConcurrency:null,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new s.Worker(\"decoder.worker.1936c0d9.js\");(0,o.default)(this,e),this.pool=(0,s.Pool)((function(){return(0,s.spawn)(r)}),t)}return(0,a.default)(e,[{key:\"decode\",value:function(){var e=(0,i.default)(n.default.mark((function e(t,r){var o=this;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",new Promise((function(e,a){o.pool.queue(function(){var o=(0,i.default)(n.default.mark((function i(o){var u;return n.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,o(t,(0,s.Transfer)(r));case 3:u=n.sent,e(u),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),a(n.t0);case 10:case\"end\":return n.stop()}}),i,null,[[0,7]])})));return function(e){return o.apply(this,arguments)}}())})));case 1:case\"end\":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"destroy\",value:function(){this.pool.terminate(!0)}}]),e}();r.default=f},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",threads:\"CqwR\",\"./decoder.worker.js\":[[\"decoder.worker.1936c0d9.js\",\"LHx9\"],\"decoder.worker.1936c0d9.js.map\",\"LHx9\"]}],t2zx:[function(e,t,r){t.exports=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}},{}],U8F3:[function(e,t,r){var n=e(\"./objectWithoutPropertiesLoose\");t.exports=function(e,t){if(null==e)return{};var r,i,o=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}},{\"./objectWithoutPropertiesLoose\":\"t2zx\"}],OMTj:[function(e,t,r){t.exports=function(e){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},{}],kQhN:[function(e,t,r){var n=e(\"./arrayWithHoles\"),i=e(\"./iterableToArray\"),o=e(\"./unsupportedIterableToArray\"),a=e(\"./nonIterableRest\");t.exports=function(e){return n(e)||i(e)||o(e)||a()}},{\"./arrayWithHoles\":\"OUZ9\",\"./iterableToArray\":\"OMTj\",\"./unsupportedIterableToArray\":\"UyFj\",\"./nonIterableRest\":\"Rom6\"}],ZJpj:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.parseContentType=function(e){var t=e.split(\";\").map((function(e){return e.trim()})),r=(0,n.default)(t);return{type:r[0],params:f(r.slice(1).map((function(e){return e.split(\"=\")})))}},r.parseContentRange=h,r.parseByteRanges=function(e,t){for(var r=null,n=new TextDecoder(\"ascii\"),i=[],o=\"--\".concat(t),a=\"\".concat(o,\"--\"),s=0;s<10;++s)n.decode(new Uint8Array(e,s,o.length))===o&&(r=s);if(null===r)throw new Error(\"Could not find initial boundary\");for(;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var o,a=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}function s(e,t){if(e){if(\"string\"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return\"Object\"===r&&e.constructor&&(r=e.constructor.name),\"Map\"===r||\"Set\"===r?Array.from(e):\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==o[1]?o[1]:void 0,e.next=3,Promise.all(t.map((function(e){return i.fetchSlice(e,r)})));case 3:return e.abrupt(\"return\",e.sent);case 4:case\"end\":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:\"fetchSlice\",value:function(){var e=(0,i.default)(n.default.mark((function e(t){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error(\"fetching of slice \".concat(t,\" not possible, not implemented\"));case 1:case\"end\":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:\"close\",value:function(){var e=(0,i.default)(n.default.mark((function e(){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case\"end\":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:\"fileSize\",get:function(){return null}}]),e}();r.BaseSource=u},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\"}],eMzk:[function(e,t,r){\"use strict\";t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},{}],sfWH:[function(e,t,r){\"use strict\";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&\"function\"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=t;else{if(!this.head)throw new TypeError(\"Reduce of empty list with no initial value\");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError(\"Reduce of empty list with no initial value\");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&nthis[s])return k(this,this[b].get(e)),!1;var o=this[b].get(e).value;return this[h]&&(this[d]||this[h](e,o.value)),o.now=n,o.maxAge=r,o.value=t,this[u]+=i-o.length,o.length=i,this.get(e),_(this),!0}var a=new x(e,t,i,n,r);return a.length>this[s]?(this[h]&&this[h](e,t),!1):(this[u]+=a.length,this[p].unshift(a),this[b].set(e,this[p].head),_(this),!0)}},{key:\"has\",value:function(e){if(!this[b].has(e))return!1;var t=this[b].get(e).value;return!w(this,t)}},{key:\"get\",value:function(e){return m(this,e,!0)}},{key:\"peek\",value:function(e){return m(this,e,!1)}},{key:\"pop\",value:function(){var e=this[p].tail;return e?(k(this,e),e.value):null}},{key:\"del\",value:function(e){k(this,this[b].get(e))}},{key:\"load\",value:function(e){this.reset();for(var t=Date.now(),r=e.length-1;r>=0;r--){var n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{var o=i-t;o>0&&this.set(n.k,n.v,o)}}}},{key:\"prune\",value:function(){var e=this;this[b].forEach((function(t,r){return m(e,r,!1)}))}},{key:\"max\",set:function(e){if(\"number\"!=typeof e||e<0)throw new TypeError(\"max must be a non-negative number\");this[s]=e||1/0,_(this)},get:function(){return this[s]}},{key:\"allowStale\",set:function(e){this[f]=!!e},get:function(){return this[f]}},{key:\"maxAge\",set:function(e){if(\"number\"!=typeof e)throw new TypeError(\"maxAge must be a non-negative number\");this[c]=e,_(this)},get:function(){return this[c]}},{key:\"lengthCalculator\",set:function(e){var t=this;\"function\"!=typeof e&&(e=v),e!==this[l]&&(this[l]=e,this[u]=0,this[p].forEach((function(e){e.length=t[l](e.value,e.key),t[u]+=e.length}))),_(this)},get:function(){return this[l]}},{key:\"length\",get:function(){return this[u]}},{key:\"itemCount\",get:function(){return this[p].length}}]),e}(),m=function(e,t,r){var n=e[b].get(t);if(n){var i=n.value;if(w(e,i)){if(k(e,n),!e[f])return}else r&&(e[y]&&(n.value.now=Date.now()),e[p].unshiftNode(n));return i.value}},w=function(e,t){if(!t||!t.maxAge&&!e[c])return!1;var r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},_=function(e){if(e[u]>e[s])for(var t=e[p].tail;e[u]>e[s]&&null!==t;){var r=t.prev;k(e,t),t=r}},k=function(e,t){if(t){var r=t.value;e[h]&&e[h](r.key,r.value),e[u]-=r.length,e[b].delete(r.key),e[p].removeNode(t)}},x=function e(t,r,i,o,a){n(this,e),this.key=t,this.value=r,this.length=i,this.now=o,this.maxAge=a||0},S=function(e,t,r,n){var i=r.value;w(e,i)&&(k(e,r),e[f]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};t.exports=g},{yallist:\"sfWH\"}],FOZT:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.assign=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},r.chunk=function(e,t){for(var r=[],n=e.length,i=0;i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var o,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:null;(0,l.default)(this,e),this.offset=t,this.length=r,this.data=n}return(0,f.default)(e,[{key:\"top\",get:function(){return this.offset+this.length}}]),e}(),m=function e(t,r,n){(0,l.default)(this,e),this.offset=t,this.length=r,this.blockIds=n},w=function(e){(0,a.default)(r,e);var t=v(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.blockSize,a=void 0===o?65536:o,s=i.cacheSize,u=void 0===s?100:s;return(0,l.default)(this,r),(n=t.call(this)).source=e,n.blockSize=a,n.blockCache=new c.default({max:u}),n.blockRequests=new Map,n.blockIdsToFetch=new Set,n}return(0,f.default)(r,[{key:\"fetch\",value:function(){var e=(0,o.default)(n.default.mark((function e(t,r){var o,a,s,u,l,f,c,h,p,y,v,g,m,w,_,k,x,S,O,T,E,C,P,j,R,M,A,I,D,L,N,F,U,B,G,z,H,W;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=new Map,a=new Map,s=new Set,u=b(t);try{for(u.s();!(l=u.n()).done;)for(f=l.value,c=f.offset,h=f.length,p=c+h,null!==(y=this.fileSize)&&(p=Math.min(p,y)),v=Math.floor(c/this.blockSize)*this.blockSize,g=v;g0)){e.next=65;break}this.fetchBlocks(r),I=b(T),e.prev=44,I.s();case 46:if((D=I.n()).done){e.next=54;break}if(L=D.value,N=this.blockRequests.get(L)){e.next=51;break}throw new Error(\"Block \".concat(L,\" is not in the block requests\"));case 51:a.set(L,N);case 52:e.next=46;break;case 54:e.next=59;break;case 56:e.prev=56,e.t1=e.catch(44),I.e(e.t1);case 59:return e.prev=59,I.f(),e.finish(59);case 62:return e.next=64,Promise.allSettled(Array.from(a.values()));case 64:O=e.sent;case 65:if(!O.some((function(e){return\"rejected\"===e.status}))){e.next=69;break}if(!r||!r.aborted){e.next=68;break}throw new d.AbortError(\"Request was aborted\");case 68:throw new d.AggregateError(O.filter((function(e){return\"rejected\"===e.status})).map((function(e){return e.reason})),\"Request failed\");case 69:F=O.map((function(e){return e.value})),U=new Map((0,d.zip)(Array.from(a.keys()),F)),B=b(o);try{for(B.s();!(G=B.n()).done;)z=(0,i.default)(G.value,2),H=z[0],W=z[1],U.set(H,W)}catch(e){B.e(e)}finally{B.f()}return e.abrupt(\"return\",this.readSliceData(t,U));case 74:case\"end\":return e.stop()}}),e,this,[[9,28,31,34],[44,56,59,62]])})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"fetchBlocks\",value:function(e){var t=this;this.blockIdsToFetch.size>0&&function(){for(var r=t.groupBlocks(t.blockIdsToFetch),i=t.source.fetch(r,e),a=function(a){var s,u=b(r[a].blockIds);try{var l=function(){var r=s.value,u=(0,o.default)(n.default.mark((function o(){var s,u,l,f,c,h;return n.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i;case 3:return n.t0=a,s=n.sent[n.t0],u=r*t.blockSize,l=u-s.offset,f=Math.min(l+t.blockSize,s.data.byteLength),c=s.data.slice(l,f),h=new g(u,c.byteLength,c),t.blockCache.set(r,h),n.abrupt(\"return\",h);case 14:throw n.prev=14,n.t1=n.catch(0),\"AbortError\"===n.t1.name&&(n.t1.signal=e),n.t1;case 18:return n.prev=18,t.blockRequests.delete(r),n.finish(18);case 21:case\"end\":return n.stop()}}),o,null,[[0,14,18,21]])})))();t.blockRequests.set(r,u)};for(u.s();!(s=u.n()).done;)l()}catch(e){u.e(e)}finally{u.f()}},s=0;s0&&(d=c),l=f.top-n<0?f.length-h:n-f.offset-h;var p=new Uint8Array(f.data,h,l);s.set(p,d)}return a}))}},{key:\"fileSize\",get:function(){return this.source.fileSize}}]),r}(h.BaseSource);r.BlockedSource=w},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/slicedToArray\":\"HETk\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"lru-cache\":\"tpff\",\"./basesource\":\"LzCD\",\"../utils\":\"FOZT\"}],uL1U:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.BaseClient=r.BaseResponse=void 0;var n=s(e(\"@babel/runtime/regenerator\")),i=s(e(\"@babel/runtime/helpers/asyncToGenerator\")),o=s(e(\"@babel/runtime/helpers/classCallCheck\")),a=s(e(\"@babel/runtime/helpers/createClass\"));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){(0,o.default)(this,e)}return(0,a.default)(e,[{key:\"getHeader\",value:function(e){throw new Error(\"not implemented\")}},{key:\"getData\",value:function(){var e=(0,i.default)(n.default.mark((function e(){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error(\"not implemented\");case 1:case\"end\":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:\"ok\",get:function(){return this.status>=200&&this.status<=299}},{key:\"status\",get:function(){throw new Error(\"not implemented\")}}]),e}();r.BaseResponse=u;var l=function(){function e(t){(0,o.default)(this,e),this.url=t}return(0,a.default)(e,[{key:\"request\",value:function(){var e=(0,i.default)(n.default.mark((function e(){var t,r=arguments;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw(t=r.length>0&&void 0!==r[0]?r[0]:{}).headers,t.credentials,t.signal,new Error(\"request is not implemented\");case 2:case\"end\":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]),e}();r.BaseClient=l},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\"}],Un5s:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.FetchClient=void 0;var n=c(e(\"@babel/runtime/regenerator\")),i=c(e(\"@babel/runtime/helpers/asyncToGenerator\")),o=c(e(\"@babel/runtime/helpers/classCallCheck\")),a=c(e(\"@babel/runtime/helpers/createClass\")),s=c(e(\"@babel/runtime/helpers/inherits\")),u=c(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),l=c(e(\"@babel/runtime/helpers/getPrototypeOf\")),f=e(\"./base\");function c(e){return e&&e.__esModule?e:{default:e}}function h(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var d=function(e){(0,s.default)(r,e);var t=h(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this)).response=e,n}return(0,a.default)(r,[{key:\"getHeader\",value:function(e){return this.response.headers.get(e)}},{key:\"getData\",value:function(){var e=(0,i.default)(n.default.mark((function e(){var t;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.response.arrayBuffer){e.next=6;break}return e.next=3,this.response.arrayBuffer();case 3:e.t0=e.sent,e.next=9;break;case 6:return e.next=8,this.response.buffer();case 8:e.t0=e.sent.buffer;case 9:return t=e.t0,e.abrupt(\"return\",t);case 11:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:\"status\",get:function(){return this.response.status}}]),r}(f.BaseResponse),p=function(e){(0,s.default)(r,e);var t=h(r);function r(e,n){var i;return(0,o.default)(this,r),(i=t.call(this,e)).credentials=n,i}return(0,a.default)(r,[{key:\"request\",value:function(){var e=(0,i.default)(n.default.mark((function e(){var t,r,i,o,a,s=arguments;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.headers,i=t.credentials,o=t.signal,e.next=3,fetch(this.url,{headers:r,credentials:i,signal:o});case 3:return a=e.sent,e.abrupt(\"return\",new d(a));case 5:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),r}(f.BaseClient);r.FetchClient=p},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./base\":\"uL1U\"}],hvgd:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.XHRClient=void 0;var n=d(e(\"@babel/runtime/helpers/slicedToArray\")),i=d(e(\"@babel/runtime/regenerator\")),o=d(e(\"@babel/runtime/helpers/asyncToGenerator\")),a=d(e(\"@babel/runtime/helpers/classCallCheck\")),s=d(e(\"@babel/runtime/helpers/createClass\")),u=d(e(\"@babel/runtime/helpers/inherits\")),l=d(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),f=d(e(\"@babel/runtime/helpers/getPrototypeOf\")),c=e(\"./base\"),h=e(\"../../utils\");function d(e){return e&&e.__esModule?e:{default:e}}function p(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,f.default)(e);if(t){var i=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}var b=function(e){(0,u.default)(r,e);var t=p(r);function r(e,n){var i;return(0,a.default)(this,r),(i=t.call(this)).xhr=e,i.data=n,i}return(0,s.default)(r,[{key:\"getHeader\",value:function(e){return this.xhr.getResponseHeader(e)}},{key:\"getData\",value:function(){var e=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",this.data);case 1:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:\"status\",get:function(){return this.xhr.status}}]),r}(c.BaseResponse),y=function(e){(0,u.default)(r,e);var t=p(r);function r(){return(0,a.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:\"constructRequest\",value:function(e,t){var r=this;return new Promise((function(i,o){var a=new XMLHttpRequest;a.open(\"GET\",r.url),a.responseType=\"arraybuffer\";for(var s=0,u=Object.entries(e);s0&&void 0!==a[0]?a[0]:{},r=t.headers,n=t.signal,e.next=3,this.constructRequest(r,n);case 3:return o=e.sent,e.abrupt(\"return\",o);case 5:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),r}(c.BaseClient);r.XHRClient=y},{\"@babel/runtime/helpers/slicedToArray\":\"HETk\",\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./base\":\"uL1U\",\"../../utils\":\"FOZT\"}],p5a1:[function(e,t,r){var n,i=arguments[3];r.fetch=l(i.fetch)&&l(i.ReadableStream),r.writableStream=l(i.WritableStream),r.abortController=l(i.AbortController),r.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),r.blobConstructor=!0}catch(e){}function o(){if(void 0!==n)return n;if(i.XMLHttpRequest){n=new i.XMLHttpRequest;try{n.open(\"GET\",i.XDomainRequest?\"/\":\"https://example.com\")}catch(e){n=null}}else n=null;return n}function a(e){var t=o();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var s=void 0!==i.ArrayBuffer,u=s&&l(i.ArrayBuffer.prototype.slice);function l(e){return\"function\"==typeof e}r.arraybuffer=r.fetch||s&&a(\"arraybuffer\"),r.msstream=!r.fetch&&u&&a(\"ms-stream\"),r.mozchunkedarraybuffer=!r.fetch&&s&&a(\"moz-chunked-arraybuffer\"),r.overrideMimeType=r.fetch||!!o()&&l(o().overrideMimeType),r.vbArray=l(i.VBArray),n=null},{}],Yj0v:[function(e,t,r){e(\"process\");var n=e(\"process\");void 0===n||!n.version||0===n.version.indexOf(\"v0.\")||0===n.version.indexOf(\"v1.\")&&0!==n.version.indexOf(\"v1.8.\")?t.exports={nextTick:function(e,t,r,i){if(\"function\"!=typeof e)throw new TypeError('\"callback\" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick((function(){e.call(null,t)}));case 3:return n.nextTick((function(){e.call(null,t,r)}));case 4:return n.nextTick((function(){e.call(null,t,r,i)}));default:for(o=new Array(s-1),a=0;a0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return\"\";for(var t=this.head,r=\"\"+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)o(r.data,t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+\" \"+e})},{\"safe-buffer\":\"Nqn4\",util:\"rDCW\"}],lCUh:[function(e,t,r){\"use strict\";var n=e(\"process-nextick-args\");function i(e,t){e.emit(\"error\",t)}t.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{\"process-nextick-args\":\"Yj0v\"}],jPmE:[function(e,t,r){e(\"process\"),e(\"process\");var n=arguments[3],i=e(\"process-nextick-args\");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){L(t,e)}}t.exports=m;var a,s=i.nextTick;m.WritableState=g;var u=Object.create(e(\"core-util-is\"));u.inherits=e(\"inherits\");var l={deprecate:e(\"util-deprecate\")},f=e(\"./internal/streams/stream\"),c=e(\"safe-buffer\").Buffer,h=n.Uint8Array||function(){};function d(e){return c.from(e)}function p(e){return c.isBuffer(e)||e instanceof h}var b,y=e(\"./internal/streams/destroy\");function v(){}function g(t,r){a=a||e(\"./_stream_duplex\"),t=t||{};var n=r instanceof a;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,s=t.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){E(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function m(t){if(a=a||e(\"./_stream_duplex\"),!(b.call(m,this)||this instanceof a))return new m(t);this._writableState=new g(t,this),this.writable=!0,t&&(\"function\"==typeof t.write&&(this._write=t.write),\"function\"==typeof t.writev&&(this._writev=t.writev),\"function\"==typeof t.destroy&&(this._destroy=t.destroy),\"function\"==typeof t.final&&(this._final=t.final)),f.call(this)}function w(e,t){var r=new Error(\"write after end\");e.emit(\"error\",r),i.nextTick(t,r)}function _(e,t,r,n){var o=!0,a=!1;return null===r?a=new TypeError(\"May not write null values to stream\"):\"string\"==typeof r||void 0===r||t.objectMode||(a=new TypeError(\"Invalid non-string/buffer chunk\")),a&&(e.emit(\"error\",a),i.nextTick(n,a),o=!1),o}function k(e,t,r){return e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=c.from(t,r)),t}function x(e,t,r,n,i,o){if(!r){var a=k(t,n,i);n!==a&&(r=!0,i=\"buffer\",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length-1))throw new TypeError(\"Unknown encoding: \"+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(m.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(e,t,r){r(new Error(\"_write() is not implemented\"))},m.prototype._writev=null,m.prototype.end=function(e,t,r){var n=this._writableState;\"function\"==typeof e?(r=e,e=null,t=null):\"function\"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||D(this,n,r)},Object.defineProperty(m.prototype,\"destroyed\",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),m.prototype.destroy=y.destroy,m.prototype._undestroy=y.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)}},{\"process-nextick-args\":\"Yj0v\",\"core-util-is\":\"Q14w\",inherits:\"Bm0n\",\"util-deprecate\":\"yM1o\",\"./internal/streams/stream\":\"ExO1\",\"safe-buffer\":\"Nqn4\",\"./internal/streams/destroy\":\"lCUh\",\"./_stream_duplex\":\"Jcj8\",process:\"pBGv\"}],Jcj8:[function(e,t,r){\"use strict\";var n=e(\"process-nextick-args\"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var o=Object.create(e(\"core-util-is\"));o.inherits=e(\"inherits\");var a=e(\"./_stream_readable\"),s=e(\"./_stream_writable\");o.inherits(c,a);for(var u=i(s.prototype),l=0;l>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,\"�\";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,\"�\";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,\"�\"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString(\"utf16le\",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(\"utf16le\",t,e.length-1)}function f(e){var t=e&&e.length?this.write(e):\"\";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(\"utf16le\",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString(\"base64\",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(\"base64\",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+this.lastChar.toString(\"base64\",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):\"\"}r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return\"\";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return\"\";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString(\"utf8\",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString(\"utf8\",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{\"safe-buffer\":\"Nqn4\"}],YrHu:[function(e,t,r){e(\"process\");var n=arguments[3],i=e(\"process\"),o=e(\"process-nextick-args\");t.exports=x;var a,s=e(\"isarray\");x.ReadableState=k;e(\"events\").EventEmitter;var u=function(e,t){return e.listeners(t).length},l=e(\"./internal/streams/stream\"),f=e(\"safe-buffer\").Buffer,c=n.Uint8Array||function(){};function h(e){return f.from(e)}function d(e){return f.isBuffer(e)||e instanceof c}var p=Object.create(e(\"core-util-is\"));p.inherits=e(\"inherits\");var b=e(\"util\"),y=void 0;y=b&&b.debuglog?b.debuglog(\"stream\"):function(){};var v,g=e(\"./internal/streams/BufferList\"),m=e(\"./internal/streams/destroy\");p.inherits(x,l);var w=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function _(e,t,r){if(\"function\"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function k(t,r){t=t||{};var n=r instanceof(a=a||e(\"./_stream_duplex\"));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(v||(v=e(\"string_decoder/\").StringDecoder),this.decoder=new v(t.encoding),this.encoding=t.encoding)}function x(t){if(a=a||e(\"./_stream_duplex\"),!(this instanceof x))return new x(t);this._readableState=new k(t,this),this.readable=!0,t&&(\"function\"==typeof t.read&&(this._read=t.read),\"function\"==typeof t.destroy&&(this._destroy=t.destroy)),l.call(this)}function S(e,t,r,n,i){var o,a=e._readableState;return null===t?(a.reading=!1,R(e,a)):(i||(o=T(a,t)),o?e.emit(\"error\",o):a.objectMode||t&&t.length>0?(\"string\"==typeof t||a.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=h(t)),n?a.endEmitted?e.emit(\"error\",new Error(\"stream.unshift() after end event\")):O(e,a,t,!0):a.ended?e.emit(\"error\",new Error(\"stream.push() after EOF\")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?O(e,a,t,!1):I(e,a)):O(e,a,t,!1))):n||(a.reading=!1)),E(a)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit(\"data\",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&M(e)),I(e,t)}function T(e,t){var r;return d(t)||\"string\"==typeof t||void 0===t||e.objectMode||(r=new TypeError(\"Invalid non-string/buffer chunk\")),r}function E(e){return!e.ended&&(e.needReadable||e.length=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function j(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=P(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,M(e)}}function M(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(y(\"emitReadable\",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(A,e):A(e))}function A(e){y(\"emit readable\"),e.emit(\"readable\"),B(e)}function I(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(D,e,t))}function D(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=z(e,t.buffer,t.decoder),r);var r}function z(e,t,r){var n;return eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0==(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}function W(e,t){var r=f.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0==(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}function q(e){var t=e._readableState;if(t.length>0)throw new Error('\"endReadable()\" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(K,t,e))}function K(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"))}function V(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return y(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?q(this):M(this),null;if(0===(e=j(e,t))&&t.ended)return 0===t.length&&q(this),null;var n,i=t.needReadable;return y(\"need readable\",i),(0===t.length||t.length-e0?G(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&q(this)),null!==n&&this.emit(\"data\",n),n},x.prototype._read=function(e){this.emit(\"error\",new Error(\"_read() is not implemented\"))},x.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,y(\"pipe count=%d opts=%j\",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?v:s;function s(){y(\"onend\"),e.end()}n.endEmitted?o.nextTick(a):r.once(\"end\",a),e.on(\"unpipe\",(function t(i,o){y(\"onunpipe\"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,y(\"cleanup\"),e.removeListener(\"close\",p),e.removeListener(\"finish\",b),e.removeListener(\"drain\",l),e.removeListener(\"error\",d),e.removeListener(\"unpipe\",t),r.removeListener(\"end\",s),r.removeListener(\"end\",v),r.removeListener(\"data\",h),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=L(r);e.on(\"drain\",l);var f=!1,c=!1;function h(t){y(\"ondata\"),c=!1,!1!==e.write(t)||c||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(y(\"false write response, pause\",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function d(t){y(\"onerror\",t),v(),e.removeListener(\"error\",d),0===u(e,\"error\")&&e.emit(\"error\",t)}function p(){e.removeListener(\"finish\",b),v()}function b(){y(\"onfinish\"),e.removeListener(\"close\",p),v()}function v(){y(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",h),_(e,\"error\",d),e.once(\"close\",p),e.once(\"finish\",b),e.emit(\"pipe\",r),n.flowing||(y(\"pipe resume\"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(\"unpipe\",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;oe._pos){var n=r.substr(e._pos);if(\"x-user-defined\"===e._charset){for(var a=new i(n.length),s=0;se._pos&&(e.push(new i(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(r)}e._xhr.readyState===l.DONE&&\"ms-stream\"!==e._mode&&e.push(null)}},{\"./capability\":\"p5a1\",inherits:\"Bm0n\",\"readable-stream\":\"JaqQ\",process:\"pBGv\",buffer:\"dskh\"}],AH4k:[function(e,t,r){var n=e(\"buffer\").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if(\"function\"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(n.isBuffer(e)){for(var t=new Uint8Array(e.length),r=e.length,i=0;i= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},y=Math.floor,v=String.fromCharCode;function g(e){throw new RangeError(b[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function w(e,t){var r=e.split(\"@\"),n=\"\";return r.length>1&&(n=r[0]+\"@\",e=r[1]),n+m((e=e.replace(p,\".\")).split(\".\"),t).join(\".\")}function _(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join(\"\")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,r){var n=0;for(e=r?y(e/700):e>>1,e+=y(e/t);e>455;n+=c)e=y(e/35);return y(n+36*e/(e+38))}function O(e){var t,r,n,i,o,a,s,u,l,h,d,p=[],b=e.length,v=0,m=128,w=72;for((r=e.lastIndexOf(\"-\"))<0&&(r=0),n=0;n=128&&g(\"not-basic\"),p.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=b&&g(\"invalid-input\"),((u=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:c)>=c||u>y((f-v)/a))&&g(\"overflow\"),v+=u*a,!(u<(l=s<=w?1:s>=w+26?26:s-w));s+=c)a>y(f/(h=c-l))&&g(\"overflow\"),a*=h;w=S(v-o,t=p.length+1,0==o),y(v/t)>f-m&&g(\"overflow\"),m+=y(v/t),v%=t,p.splice(v++,0,m)}return k(p)}function T(e){var t,r,n,i,o,a,s,u,l,h,d,p,b,m,w,k=[];for(p=(e=_(e)).length,t=128,r=0,o=72,a=0;a=t&&dy((f-r)/(b=n+1))&&g(\"overflow\"),r+=(s-t)*b,t=s,a=0;af&&g(\"overflow\"),d==t){for(u=r,l=c;!(u<(h=l<=o?1:l>=o+26?26:l-o));l+=c)w=u-h,m=c-h,k.push(v(x(h+w%m,0))),u=y(w/m);k.push(v(x(u,0))),o=S(r,b,n==i),r=0,++n}++r,++t}return k.join(\"\")}if(u={version:\"1.4.1\",ucs2:{decode:_,encode:k},decode:O,encode:T,toASCII:function(e){return w(e,(function(e){return d.test(e)?\"xn--\"+T(e):e}))},toUnicode:function(e){return w(e,(function(e){return h.test(e)?O(e.slice(4).toLowerCase()):e}))}},\"function\"==typeof n&&\"object\"==typeof n.amd&&n.amd)n(\"punycode\",(function(){return u}));else if(o&&a)if(t.exports==o)a.exports=u;else for(l in u)u.hasOwnProperty(l)&&(o[l]=u[l]);else e.punycode=u}(this)},{}],YsIc:[function(e,t,r){\"use strict\";t.exports={isString:function(e){return\"string\"==typeof e},isObject:function(e){return\"object\"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],J6GP:[function(e,t,r){\"use strict\";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,o){t=t||\"&\",r=r||\"=\";var a={};if(\"string\"!=typeof e||0===e.length)return a;var s=/\\+/g;e=e.split(t);var u=1e3;o&&\"number\"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var f=0;f=0?(c=b.substr(0,y),h=b.substr(y+1)):(c=b,h=\"\"),d=decodeURIComponent(c),p=decodeURIComponent(h),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(e){return\"[object Array]\"===Object.prototype.toString.call(e)}},{}],bvhO:[function(e,t,r){\"use strict\";var n=function(e){switch(typeof e){case\"string\":return e;case\"boolean\":return e?\"true\":\"false\";case\"number\":return isFinite(e)?e:\"\";default:return\"\"}};t.exports=function(e,t,r,s){return t=t||\"&\",r=r||\"=\",null===e&&(e=void 0),\"object\"==typeof e?o(a(e),(function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[a]))})).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):\"\"};var i=Array.isArray||function(e){return\"[object Array]\"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n\",'\"',\"`\",\" \",\"\\r\",\"\\n\",\"\\t\"]),f=[\"'\"].concat(l),c=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(f),h=[\"/\",\"?\",\"#\"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,\"javascript:\":!0},y={javascript:!0,\"javascript:\":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0},g=e(\"querystring\");function m(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof e);var o=e.indexOf(\"?\"),s=-1!==o&&o127?A+=\"x\":A+=M[I];if(!A.match(d)){var L=j.slice(0,E),N=j.slice(E+1),F=M.match(p);F&&(L.push(F[1]),N.unshift(F[2])),N.length&&(m=\"/\"+N.join(\".\")+m),this.hostname=L.join(\".\");break}}}this.hostname.length>255?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=n.toASCII(this.hostname));var U=this.port?\":\"+this.port:\"\",B=this.hostname||\"\";this.host=B+U,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),\"/\"!==m[0]&&(m=\"/\"+m))}if(!b[k])for(E=0,R=f.length;E0)&&r.host.split(\"@\"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift())),r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.href=r.format(),r;if(!x.length)return r.pathname=null,r.search?r.path=\"/\"+r.search:r.path=null,r.href=r.format(),r;for(var O=x.slice(-1)[0],T=(r.host||e.host||x.length>1)&&(\".\"===O||\"..\"===O)||\"\"===O,E=0,C=x.length;C>=0;C--)\".\"===(O=x[C])?x.splice(C,1):\"..\"===O?(x.splice(C,1),E++):E&&(x.splice(C,1),E--);if(!_&&!k)for(;E--;E)x.unshift(\"..\");!_||\"\"===x[0]||x[0]&&\"/\"===x[0].charAt(0)||x.unshift(\"\"),T&&\"/\"!==x.join(\"/\").substr(-1)&&x.push(\"\");var P,j=\"\"===x[0]||x[0]&&\"/\"===x[0].charAt(0);return S&&(r.hostname=r.host=j?\"\":x.length?x.shift():\"\",(P=!!(r.host&&r.host.indexOf(\"@\")>0)&&r.host.split(\"@\"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift())),(_=_||r.host&&x.length)&&!j&&x.unshift(\"\"),x.length?r.pathname=x.join(\"/\"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(\":\"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:\"oWqx\",\"./util\":\"YsIc\",querystring:\"fk5h\"}],KKrj:[function(e,t,r){var n=arguments[3],i=e(\"./lib/request\"),o=e(\"./lib/response\"),a=e(\"xtend\"),s=e(\"builtin-status-codes\"),u=e(\"url\"),l=r;l.request=function(e,t){e=\"string\"==typeof e?u.parse(e):a(e);var r=-1===n.location.protocol.search(/^https?:$/)?\"http:\":\"\",o=e.protocol||r,s=e.hostname||e.host,l=e.port,f=e.path||\"/\";s&&-1!==s.indexOf(\":\")&&(s=\"[\"+s+\"]\"),e.url=(s?o+\"//\"+s:\"\")+(l?\":\"+l:\"\")+f,e.method=(e.method||\"GET\").toUpperCase(),e.headers=e.headers||{};var c=new i(e);return t&&c.on(\"response\",t),c},l.get=function(e,t){var r=l.request(e,t);return r.end(),r},l.ClientRequest=i,l.IncomingMessage=o.IncomingMessage,l.Agent=function(){},l.Agent.defaultMaxSockets=4,l.globalAgent=new l.Agent,l.STATUS_CODES=s,l.METHODS=[\"CHECKOUT\",\"CONNECT\",\"COPY\",\"DELETE\",\"GET\",\"HEAD\",\"LOCK\",\"M-SEARCH\",\"MERGE\",\"MKACTIVITY\",\"MKCOL\",\"MOVE\",\"NOTIFY\",\"OPTIONS\",\"PATCH\",\"POST\",\"PROPFIND\",\"PROPPATCH\",\"PURGE\",\"PUT\",\"REPORT\",\"SEARCH\",\"SUBSCRIBE\",\"TRACE\",\"UNLOCK\",\"UNSUBSCRIBE\"]},{\"./lib/request\":\"yL7F\",\"./lib/response\":\"UxIR\",xtend:\"K5Tb\",\"builtin-status-codes\":\"OpTI\",url:\"Mej7\"}],wVMl:[function(e,t,r){var n=e(\"http\"),i=e(\"url\"),o=t.exports;for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);function s(e){if(\"string\"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol=\"https:\"),\"https:\"!==e.protocol)throw new Error('Protocol \"'+e.protocol+'\" not supported. Expected \"https:\"');return e}o.request=function(e,t){return e=s(e),n.request.call(this,e,t)},o.get=function(e,t){return e=s(e),n.get.call(this,e,t)}},{http:\"KKrj\",url:\"Mej7\"}],SHlS:[function(e,t,r){e(\"buffer\").Buffer;var n=e(\"buffer\").Buffer;Object.defineProperty(r,\"__esModule\",{value:!0}),r.HttpClient=void 0;var i=v(e(\"@babel/runtime/helpers/defineProperty\")),o=v(e(\"@babel/runtime/regenerator\")),a=v(e(\"@babel/runtime/helpers/asyncToGenerator\")),s=v(e(\"@babel/runtime/helpers/classCallCheck\")),u=v(e(\"@babel/runtime/helpers/createClass\")),l=v(e(\"@babel/runtime/helpers/inherits\")),f=v(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),c=v(e(\"@babel/runtime/helpers/getPrototypeOf\")),h=v(e(\"http\")),d=v(e(\"https\")),p=v(e(\"url\")),b=e(\"./base\"),y=e(\"../../utils\");function v(e){return e&&e.__esModule?e:{default:e}}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t0&&void 0!==a[0]?a[0]:{},r=t.headers,n=t.signal,e.next=3,this.constructRequest(r,n);case 3:return i=e.sent,e.abrupt(\"return\",i);case 5:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),r}(b.BaseClient);r.HttpClient=k},{\"@babel/runtime/helpers/defineProperty\":\"IxO8\",\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",http:\"KKrj\",https:\"wVMl\",url:\"Mej7\",\"./base\":\"uL1U\",\"../../utils\":\"FOZT\",buffer:\"dskh\"}],itmA:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.makeFetchSource=S,r.makeXHRSource=O,r.makeHttpSource=T,r.makeRemoteSource=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.forceXHR,i=void 0!==r&&r,o=(0,n.default)(t,[\"forceXHR\"]);return\"function\"!=typeof fetch||i?\"undefined\"!=typeof XMLHttpRequest?O(e,o):T(e,o):S(e,o)};var n=g(e(\"@babel/runtime/helpers/objectWithoutProperties\")),i=g(e(\"@babel/runtime/helpers/defineProperty\")),o=g(e(\"@babel/runtime/regenerator\")),a=g(e(\"@babel/runtime/helpers/asyncToGenerator\")),s=g(e(\"@babel/runtime/helpers/classCallCheck\")),u=g(e(\"@babel/runtime/helpers/createClass\")),l=g(e(\"@babel/runtime/helpers/inherits\")),f=g(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),c=g(e(\"@babel/runtime/helpers/getPrototypeOf\")),h=e(\"./httputils\"),d=e(\"./basesource\"),p=e(\"./blockedsource\"),b=e(\"./client/fetch\"),y=e(\"./client/xhr\"),v=e(\"./client/http\");function g(e){return e&&e.__esModule?e:{default:e}}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t=t.length)){e.next=4;break}return e.abrupt(\"return\",this.fetchSlices(t,r));case 4:this.maxRanges>0&&t.length;case 5:return e.next=7,Promise.all(t.map((function(e){return n.fetchSlice(e,r)})));case 7:return e.abrupt(\"return\",e.sent);case 8:case\"end\":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"fetchSlices\",value:function(){var e=(0,a.default)(o.default.mark((function e(t,r){var n,i,a,s,u,l,f,c,d,p,b,y,v,g=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.request({headers:w(w({},this.headers),{},{Range:\"bytes=\".concat(t.map((function(e){var t=e.offset,r=e.length;return\"\".concat(t,\"-\").concat(t+r)})).join(\",\"))}),signal:r});case 2:if((n=e.sent).ok){e.next=7;break}throw new Error(\"Error fetching data.\");case 7:if(206!==n.status){e.next=32;break}if(i=(0,h.parseContentType)(n.getHeader(\"content-type\")),a=i.type,s=i.params,\"multipart/byteranges\"!==a){e.next=18;break}return e.t0=h.parseByteRanges,e.next=13,n.getData();case 13:return e.t1=e.sent,e.t2=s.boundary,u=(0,e.t0)(e.t1,e.t2),this._fileSize=u[0].fileSize||null,e.abrupt(\"return\",u);case 18:return e.next=20,n.getData();case 20:if(l=e.sent,f=(0,h.parseContentRange)(n.getHeader(\"content-range\")),c=f.start,d=f.end,p=f.total,this._fileSize=p||null,b=[{data:l,offset:c,length:d-c}],!(t.length>1)){e.next=29;break}return e.next=27,Promise.all(t.slice(1).map((function(e){return g.fetchSlice(e,r)})));case 27:return y=e.sent,e.abrupt(\"return\",b.concat(y));case 29:return e.abrupt(\"return\",b);case 32:if(this.allowFullFile){e.next=34;break}throw new Error(\"Server responded with full file\");case 34:return e.next=36,n.getData();case 36:return v=e.sent,this._fileSize=v.byteLength,e.abrupt(\"return\",[{data:v,offset:0,length:v.byteLength}]);case 39:case\"end\":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"fetchSlice\",value:function(){var e=(0,a.default)(o.default.mark((function e(t,r){var n,i,a,s,u,l,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.offset,i=t.length,e.next=3,this.client.request({headers:w(w({},this.headers),{},{Range:\"bytes=\".concat(n,\"-\").concat(n+i)}),signal:r});case 3:if((a=e.sent).ok){e.next=8;break}throw new Error(\"Error fetching data.\");case 8:if(206!==a.status){e.next=17;break}return e.next=11,a.getData();case 11:return s=e.sent,u=(0,h.parseContentRange)(a.getHeader(\"content-range\")),l=u.total,this._fileSize=l||null,e.abrupt(\"return\",{data:s,offset:n,length:i});case 17:if(this.allowFullFile){e.next=19;break}throw new Error(\"Server responded with full file\");case 19:return e.next=21,a.getData();case 21:return f=e.sent,this._fileSize=f.byteLength,e.abrupt(\"return\",{data:f,offset:0,length:f.byteLength});case 24:case\"end\":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"fileSize\",get:function(){return this._fileSize}}]),r}(d.BaseSource);function x(e,t){var r=t.blockSize,n=t.cacheSize;return null===r?e:new p.BlockedSource(e,r,n)}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.headers,i=void 0===r?{}:r,o=t.credentials,a=t.maxRanges,s=void 0===a?0:a,u=t.allowFullFile,l=void 0!==u&&u,f=(0,n.default)(t,[\"headers\",\"credentials\",\"maxRanges\",\"allowFullFile\"]),c=new b.FetchClient(e,o);return x(new k(c,i,s,l),f)}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.headers,i=void 0===r?{}:r,o=t.maxRanges,a=void 0===o?0:o,s=t.allowFullFile,u=void 0!==s&&s,l=(0,n.default)(t,[\"headers\",\"maxRanges\",\"allowFullFile\"]),f=new y.XHRClient(e);return x(new k(f,i,a,u),l)}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.headers,i=void 0===r?{}:r,o=t.maxRanges,a=void 0===o?0:o,s=t.allowFullFile,u=void 0!==s&&s,l=(0,n.default)(t,[\"headers\",\"maxRanges\",\"allowFullFile\"]),f=new v.HttpClient(e);return x(new k(f,i,a,u),l)}},{\"@babel/runtime/helpers/objectWithoutProperties\":\"U8F3\",\"@babel/runtime/helpers/defineProperty\":\"IxO8\",\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./httputils\":\"ZJpj\",\"./basesource\":\"LzCD\",\"./blockedsource\":\"xD7g\",\"./client/fetch\":\"Un5s\",\"./client/xhr\":\"hvgd\",\"./client/http\":\"SHlS\"}],wM9h:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.makeBufferSource=function(e){return new h(e)};var n=f(e(\"@babel/runtime/helpers/classCallCheck\")),i=f(e(\"@babel/runtime/helpers/createClass\")),o=f(e(\"@babel/runtime/helpers/inherits\")),a=f(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),s=f(e(\"@babel/runtime/helpers/getPrototypeOf\")),u=e(\"./basesource\"),l=e(\"../utils\");function f(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var h=function(e){(0,o.default)(r,e);var t=c(r);function r(e){var i;return(0,n.default)(this,r),(i=t.call(this)).arrayBuffer=e,i}return(0,i.default)(r,[{key:\"fetchSlice\",value:function(e,t){if(t&&t.aborted)throw new l.AbortError(\"Request aborted\");return this.arrayBuffer.slice(e.offset,e.offset+e.length)}}]),r}(u.BaseSource)},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./basesource\":\"LzCD\",\"../utils\":\"FOZT\"}],GiEG:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.makeFileReaderSource=function(e){return new h(e)};var n=f(e(\"@babel/runtime/regenerator\")),i=f(e(\"@babel/runtime/helpers/asyncToGenerator\")),o=f(e(\"@babel/runtime/helpers/classCallCheck\")),a=f(e(\"@babel/runtime/helpers/createClass\")),s=f(e(\"@babel/runtime/helpers/inherits\")),u=f(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),l=f(e(\"@babel/runtime/helpers/getPrototypeOf\"));function f(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var h=function(e){(0,s.default)(r,e);var t=c(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this)).file=e,n}return(0,a.default)(r,[{key:\"fetchSlice\",value:function(){var e=(0,i.default)(n.default.mark((function e(t,r){var i=this;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",new Promise((function(e,n){var o=i.file.slice(t.offset,t.offset+t.length),a=new FileReader;a.onload=function(t){return e(t.target.result)},a.onerror=n,a.onabort=n,a.readAsArrayBuffer(o),r&&r.addEventListener(\"abort\",(function(){return a.abort()}))})));case 1:case\"end\":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()}]),r}(e(\"./basesource\").BaseSource)},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"./basesource\":\"LzCD\"}],G7Cz:[function(e,t,r){e(\"buffer\").Buffer;var n=e(\"buffer\").Buffer;Object.defineProperty(r,\"__esModule\",{value:!0}),r.makeFileSource=function(e){return new v(e)};var i=h(e(\"@babel/runtime/regenerator\")),o=h(e(\"@babel/runtime/helpers/asyncToGenerator\")),a=h(e(\"@babel/runtime/helpers/classCallCheck\")),s=h(e(\"@babel/runtime/helpers/createClass\")),u=h(e(\"@babel/runtime/helpers/inherits\")),l=h(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),f=h(e(\"@babel/runtime/helpers/getPrototypeOf\")),c=e(\"fs\");function h(e){return e&&e.__esModule?e:{default:e}}function d(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,f.default)(e);if(t){var i=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}function p(e){return new Promise((function(t,r){(0,c.close)(e,(function(e){e?r(e):t()}))}))}function b(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return new Promise((function(n,i){(0,c.open)(e,t,r,(function(e,t){e?i(e):n(t)}))}))}function y(){for(var e=arguments.length,t=new Array(e),r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var o,s=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function a(e,t){if(e){if(\"string\"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return\"Object\"===r&&e.constructor&&(r=e.constructor.name),\"Map\"===r||\"Set\"===r?Array.from(e):\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>8&255,e[t+1]=255&r},writeUint:function(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=r>>0&255},writeASCII:function(e,t,r){(0,i.times)(r.length,(function(n){e[t+n]=r.charCodeAt(n)}))},ui8:new Uint8Array(8)};d.fl64=new Float64Array(d.ui8.buffer),d.writeDouble=function(e,t,r){d.fl64[0]=r,(0,i.times)(8,(function(r){e[t+r]=d.ui8[7-r]}))};var p=function(e,t,r,a){var s=r,u=Object.keys(a).filter((function(e){return null!=e&&\"undefined\"!==e}));e.writeUshort(t,s,u.length);var l,f=(s+=2)+12*u.length+4,h=o(u);try{var d=function(){var r=l.value,o=null;\"number\"==typeof r?o=r:\"string\"==typeof r&&(o=parseInt(r,10));var u=n.fieldTagTypes[o],h=c[u];if(null==u||void 0===u||void 0===u)throw new Error(\"unknown type of tag: \".concat(o));var d=a[r];if(void 0===d)throw new Error(\"failed to get value for key \".concat(r));\"ASCII\"===u&&\"string\"==typeof d&&!1===(0,i.endsWith)(d,\"\\0\")&&(d+=\"\\0\");var p=d.length;e.writeUshort(t,s,o),s+=2,e.writeUshort(t,s,h),s+=2,e.writeUint(t,s,p);var b=[-1,1,1,2,4,8,0,0,0,0,0,0,8][h]*p,y=s+=4;b>4&&(e.writeUint(t,s,f),y=f),\"ASCII\"===u?e.writeASCII(t,y,d):\"SHORT\"===u?(0,i.times)(p,(function(r){e.writeUshort(t,y+2*r,d[r])})):\"LONG\"===u?(0,i.times)(p,(function(r){e.writeUint(t,y+4*r,d[r])})):\"RATIONAL\"===u?(0,i.times)(p,(function(r){e.writeUint(t,y+8*r,Math.round(1e4*d[r])),e.writeUint(t,y+8*r+4,1e4)})):\"DOUBLE\"===u&&(0,i.times)(p,(function(r){e.writeDouble(t,y+8*r,d[r])})),b>4&&(f+=b+=1&b),s+=4};for(h.s();!(l=h.n()).done;)d()}catch(e){h.e(e)}finally{h.f()}return[s,f]},b=function(e){var t=new Uint8Array(h),r=4,n=d;t[0]=77,t[1]=77,t[3]=42;var i=8;if(n.writeUint(t,r,i),r+=4,e.forEach((function(r,o){var a=p(n,t,i,r);i=a[1],o0&&void 0!==arguments[0]?arguments[0]:new a;s=e},r.debug=function(){var e;return(e=s).debug.apply(e,arguments)},r.log=function(){var e;return(e=s).log.apply(e,arguments)},r.info=function(){var e;return(e=s).info.apply(e,arguments)},r.warn=function(){var e;return(e=s).warn.apply(e,arguments)},r.error=function(){var e;return(e=s).error.apply(e,arguments)},r.time=function(){var e;return(e=s).time.apply(e,arguments)},r.timeEnd=function(){var e;return(e=s).timeEnd.apply(e,arguments)};var n=o(e(\"@babel/runtime/helpers/classCallCheck\")),i=o(e(\"@babel/runtime/helpers/createClass\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(){(0,n.default)(this,e)}return(0,i.default)(e,[{key:\"log\",value:function(){}},{key:\"debug\",value:function(){}},{key:\"info\",value:function(){}},{key:\"warn\",value:function(){}},{key:\"error\",value:function(){}},{key:\"time\",value:function(){}},{key:\"timeEnd\",value:function(){}}]),e}(),s=new a},{\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"@babel/runtime/helpers/createClass\":\"P8NW\"}],bsJs:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.fromUrl=function(e){return G.apply(this,arguments)},r.fromArrayBuffer=function(e,t){return z.apply(this,arguments)},r.fromFile=function(e,t){return H.apply(this,arguments)},r.fromBlob=function(e,t){return W.apply(this,arguments)},r.fromUrls=function(e){return q.apply(this,arguments)},r.writeArrayBuffer=function(e,t){return K.apply(this,arguments)},Object.defineProperty(r,\"Pool\",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(r,\"getDecoder\",{enumerable:!0,get:function(){return S.getDecoder}}),Object.defineProperty(r,\"setLogger\",{enumerable:!0,get:function(){return O.setLogger}}),r.rgb=r.globals=r.MultiGeoTIFF=r.default=r.GeoTIFF=void 0;var n=C(e(\"@babel/runtime/regenerator\")),i=C(e(\"@babel/runtime/helpers/defineProperty\")),o=C(e(\"@babel/runtime/helpers/slicedToArray\")),a=C(e(\"@babel/runtime/helpers/asyncToGenerator\")),s=C(e(\"@babel/runtime/helpers/createClass\")),u=C(e(\"@babel/runtime/helpers/inherits\")),l=C(e(\"@babel/runtime/helpers/possibleConstructorReturn\")),f=C(e(\"@babel/runtime/helpers/getPrototypeOf\")),c=C(e(\"@babel/runtime/helpers/wrapNativeSuper\")),h=C(e(\"@babel/runtime/helpers/classCallCheck\")),d=C(e(\"./geotiffimage\")),p=C(e(\"./dataview64\")),b=C(e(\"./dataslice\")),y=C(e(\"./pool\")),v=e(\"./source/remote\"),g=e(\"./source/arraybuffer\"),m=e(\"./source/filereader\"),w=e(\"./source/file\"),_=E(e(\"./globals\"));r.globals=_;var k=e(\"./geotiffwriter\"),x=E(e(\"./rgb\"));r.rgb=x;var S=e(\"./compression\"),O=e(\"./logging\");function T(){if(\"function\"!=typeof WeakMap)return null;var e=new WeakMap;return T=function(){return e},e}function E(e){if(e&&e.__esModule)return e;if(null===e||\"object\"!=typeof e&&\"function\"!=typeof e)return{default:e};var t=T();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function C(e){return e&&e.__esModule?e:{default:e}}function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t0&&void 0!==H[0]?H[0]:{},r=t.window,i=t.width,a=t.height,s=t.resX,u=t.resY,l=t.bbox,e.next=5,this.getImage();case 5:return f=e.sent,c=f,e.next=9,this.getImageCount();case 9:if(h=e.sent,d=f.getBoundingBox(),!r||!l){e.next=13;break}throw new Error('Both \"bbox\" and \"window\" passed.');case 13:if(!i&&!a){e.next=24;break}if(r&&(p=f.getOrigin(),b=(0,o.default)(p,2),y=b[0],v=b[1],g=f.getResolution(),m=(0,o.default)(g,2),w=m[0],_=m[1],l=[y+r[0]*w,v+r[1]*_,y+r[2]*w,v+r[3]*_]),k=l||d,!i){e.next=20;break}if(!s){e.next=19;break}throw new Error(\"Both width and resX passed\");case 19:s=(k[2]-k[0])/i;case 20:if(!a){e.next=24;break}if(!u){e.next=23;break}throw new Error(\"Both width and resY passed\");case 23:u=(k[3]-k[1])/a;case 24:if(!s&&!u){e.next=48;break}x=[],S=0;case 27:if(!(SM||u&&u>A)){e.next=45;break}return e.abrupt(\"break\",48);case 45:++P,e.next=38;break;case 48:return I=r,l&&(D=f.getOrigin(),L=(0,o.default)(D,2),N=L[0],F=L[1],U=c.getResolution(f),B=(0,o.default)(U,2),G=B[0],z=B[1],I=[Math.round((l[0]-N)/G),Math.round((l[1]-F)/z),Math.round((l[2]-N)/G),Math.round((l[3]-F)/z)],I=[Math.min(I[0],I[2]),Math.min(I[1],I[3]),Math.max(I[0],I[2]),Math.max(I[1],I[3])]),e.abrupt(\"return\",c.readRasters(j(j({},t),{},{window:I})));case 51:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),F=function(e){(0,u.default)(r,e);var t=R(r);function r(e,n,i,o){var a,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(0,h.default)(this,r),(a=t.call(this)).source=e,a.littleEndian=n,a.bigTiff=i,a.firstIFDOffset=o,a.cache=s.cache||!1,a.ifdRequests=[],a.ghostValues=null,a}return(0,s.default)(r,[{key:\"getSlice\",value:function(){var e=(0,a.default)(n.default.mark((function e(t,r){var i;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.bigTiff?4048:1024,e.t0=b.default,e.next=4,this.source.fetch([{offset:t,length:void 0!==r?r:i}]);case 4:return e.t1=e.sent[0],e.t2=t,e.t3=this.littleEndian,e.t4=this.bigTiff,e.abrupt(\"return\",new e.t0(e.t1,e.t2,e.t3,e.t4));case 9:case\"end\":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:\"parseFileDirectoryAt\",value:function(){var e=(0,a.default)(n.default.mark((function e(t){var r,i,o,a,s,u,l,f,c,h,d,p,b,y,v,g,m,w,k,x;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.bigTiff?20:12,i=this.bigTiff?8:2,e.next=4,this.getSlice(t);case 4:if(o=e.sent,a=this.bigTiff?o.readUint64(t):o.readUint16(t),s=a*r+(this.bigTiff?16:6),o.covers(t,s)){e.next=11;break}return e.next=10,this.getSlice(t,s);case 10:o=e.sent;case 11:u={},l=t+(this.bigTiff?8:2),f=0;case 14:if(!(f0&&void 0!==i[0]?i[0]:0,e.next=3,this.requestIFD(t);case 3:return r=e.sent,e.abrupt(\"return\",new d.default(r.fileDirectory,r.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source));case 5:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:\"getImageCount\",value:function(){var e=(0,a.default)(n.default.mark((function e(){var t,r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0,r=!0;case 2:if(!r){e.next=18;break}return e.prev=3,e.next=6,this.requestIFD(t);case 6:++t,e.next=16;break;case 9:if(e.prev=9,e.t0=e.catch(3),!(e.t0 instanceof L)){e.next=15;break}r=!1,e.next=16;break;case 15:throw e.t0;case 16:e.next=2;break;case 18:return e.abrupt(\"return\",t);case 19:case\"end\":return e.stop()}}),e,this,[[3,9]])})));return function(){return e.apply(this,arguments)}}()},{key:\"getGhostValues\",value:function(){var e=(0,a.default)(n.default.mark((function e(){var t,r,i,a,s,u,l,f,c=this;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.bigTiff?16:8,!this.ghostValues){e.next=3;break}return e.abrupt(\"return\",this.ghostValues);case 3:return i=(r=\"GDAL_STRUCTURAL_METADATA_SIZE=\").length+100,e.next=7,this.getSlice(t,i);case 7:if(a=e.sent,r!==I(a,_.fieldTypes.ASCII,r.length,t)){e.next=19;break}if(s=I(a,_.fieldTypes.ASCII,i,t),u=s.split(\"\\n\")[0],!((l=Number(u.split(\"=\")[1].split(\" \")[0])+u.length)>i)){e.next=16;break}return e.next=15,this.getSlice(t,l);case 15:a=e.sent;case 16:f=I(a,_.fieldTypes.ASCII,l,t),this.ghostValues={},f.split(\"\\n\").filter((function(e){return e.length>0})).map((function(e){return e.split(\"=\")})).forEach((function(e){var t=(0,o.default)(e,2),r=t[0],n=t[1];c.ghostValues[r]=n}));case 19:return e.abrupt(\"return\",this.ghostValues);case 20:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:\"close\",value:function(){return\"function\"==typeof this.source.close&&this.source.close()}}],[{key:\"fromSource\",value:function(){var e=(0,a.default)(n.default.mark((function e(t,i,o){var a,s,u,l,f,c,h;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.fetch([{offset:0,length:1024}],o);case 2:if(a=e.sent[0],s=new p.default(a),18761!==(u=s.getUint16(0,0))){e.next=9;break}l=!0,e.next=14;break;case 9:if(19789!==u){e.next=13;break}l=!1,e.next=14;break;case 13:throw new TypeError(\"Invalid byte order value.\");case 14:if(42!==(f=s.getUint16(2,l))){e.next=19;break}c=!1,e.next=27;break;case 19:if(43!==f){e.next=26;break}if(c=!0,8===s.getUint16(4,l)){e.next=24;break}throw new Error(\"Unsupported offset byte-size.\");case 24:e.next=27;break;case 26:throw new TypeError(\"Invalid magic number.\");case 27:return h=c?s.getUint64(8,l):s.getUint32(4,l),e.abrupt(\"return\",new r(t,l,c,h,i));case 29:case\"end\":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}()}]),r}(N);r.GeoTIFF=F;var U=F;r.default=U;var B=function(e){(0,u.default)(r,e);var t=R(r);function r(e,n){var i;return(0,h.default)(this,r),(i=t.call(this)).mainFile=e,i.overviewFiles=n,i.imageFiles=[e].concat(n),i.fileDirectoriesPerFile=null,i.fileDirectoriesPerFileParsing=null,i.imageCount=null,i}return(0,s.default)(r,[{key:\"parseFileDirectoriesPerFile\",value:function(){var e=(0,a.default)(n.default.mark((function e(){var t;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map((function(e){return e.parseFileDirectoryAt(e.firstIFDOffset)}))),e.next=3,Promise.all(t);case 3:return this.fileDirectoriesPerFile=e.sent,e.abrupt(\"return\",this.fileDirectoriesPerFile);case 5:case\"end\":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:\"getImage\",value:function(){var e=(0,a.default)(n.default.mark((function e(){var t,r,i,o,a,s,u,l=arguments;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:0,e.next=3,this.getImageCount();case 3:return e.next=5,this.parseFileDirectoriesPerFile();case 5:r=0,i=0,o=0;case 8:if(!(o1&&void 0!==o[1]?o[1]:{},i=o.length>2?o[2]:void 0,e.abrupt(\"return\",F.fromSource((0,v.makeRemoteSource)(t,r),i));case 3:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}function z(){return(z=(0,a.default)(n.default.mark((function e(t,r){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",F.fromSource((0,g.makeBufferSource)(t),r));case 1:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return(H=(0,a.default)(n.default.mark((function e(t,r){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",F.fromSource((0,w.makeFileSource)(t),r));case 1:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}function W(){return(W=(0,a.default)(n.default.mark((function e(t,r){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",F.fromSource((0,m.makeFileReaderSource)(t),r));case 1:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return(q=(0,a.default)(n.default.mark((function e(t){var r,i,o,a,s,u=arguments;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:[],i=u.length>2&&void 0!==u[2]?u[2]:{},o=u.length>3?u[3]:void 0,e.next=5,F.fromSource((0,v.makeRemoteSource)(t,i),o);case 5:return a=e.sent,e.next=8,Promise.all(r.map((function(e){return F.fromSource((0,v.makeRemoteSource)(e,i))})));case 8:return s=e.sent,e.abrupt(\"return\",new B(a,s));case 10:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}function K(){return(K=(0,a.default)(n.default.mark((function e(t,r){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",(0,k.writeGeotiff)(t,r));case 1:case\"end\":return e.stop()}}),e)})))).apply(this,arguments)}r.MultiGeoTIFF=B},{\"@babel/runtime/regenerator\":\"PMvg\",\"@babel/runtime/helpers/defineProperty\":\"IxO8\",\"@babel/runtime/helpers/slicedToArray\":\"HETk\",\"@babel/runtime/helpers/asyncToGenerator\":\"agGE\",\"@babel/runtime/helpers/createClass\":\"P8NW\",\"@babel/runtime/helpers/inherits\":\"d4H2\",\"@babel/runtime/helpers/possibleConstructorReturn\":\"pxk2\",\"@babel/runtime/helpers/getPrototypeOf\":\"UJE0\",\"@babel/runtime/helpers/wrapNativeSuper\":\"ozpi\",\"@babel/runtime/helpers/classCallCheck\":\"fcMS\",\"./geotiffimage\":\"eOWo\",\"./dataview64\":\"dqpX\",\"./dataslice\":\"dGLV\",\"./pool\":\"dHPO\",\"./source/remote\":\"itmA\",\"./source/arraybuffer\":\"wM9h\",\"./source/filereader\":\"GiEG\",\"./source/file\":\"G7Cz\",\"./globals\":\"j27V\",\"./geotiffwriter\":\"BGyE\",\"./rgb\":\"fpBl\",\"./compression\":\"FGCZ\",\"./logging\":\"dy4f\"}]},{},[\"bsJs\"],\"GeoTIFF\");\n//# sourceMappingURL=/sm/6b05ec3e6aee27214397dcd933f0a1a0def04511045c0ced378787b04765ef87.map\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/geotiff/geotiff.js?"); - -/***/ }), - -/***/ "./src/secondary/loadingScreen.scss": -/*!******************************************!*\ - !*** ./src/secondary/loadingScreen.scss ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var api = __webpack_require__(/*! ../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ \"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ref--5-2!../../node_modules/sass-loader/dist/cjs.js!./loadingScreen.scss */ \"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/sass-loader/dist/cjs.js!./src/secondary/loadingScreen.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.i, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/loadingScreen.scss?"); - -/***/ }), - -/***/ "./src/secondary/loadingScreen.ts": -/*!****************************************!*\ - !*** ./src/secondary/loadingScreen.ts ***! - \****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _loadingScreen_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loadingScreen.scss */ \"./src/secondary/loadingScreen.scss\");\n/* harmony import */ var _loadingScreen_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_loadingScreen_scss__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar Controls = function () {\n function Controls(parent) {\n var _this = this;\n\n this.end = function (name) {\n if (_this.p.options.loadingScreen === false) return;\n\n if (_this.loadingContainer) {\n _this.loadingContainer.style.opacity = '0';\n _this.p._.sceneContainer.style.filter = 'blur(0px) brightness(1)';\n setTimeout(function () {\n _this.loadingContainer.remove();\n\n _this.loadingContainer = null;\n _this.p._.sceneContainer.style.filter = null;\n _this.p._.sceneContainer.style.transition = null;\n }, 500);\n }\n };\n\n this.p = parent;\n if (this.p.options.loadingScreen === false) return;\n this.loadingContainer = document.createElement('div');\n this.loadingContainer.setAttribute('id', '_lithosphere_loadingscreen');\n this.loadingContainer.style.position = 'absolute';\n this.loadingContainer.style.top = '0';\n this.loadingContainer.style.left = '0';\n this.loadingContainer.style.width = '100%';\n this.loadingContainer.style.height = '100%';\n this.loadingContainer.style.background = 'black';\n this.loadingContainer.style.color = 'white';\n this.loadingContainer.style.fontFamily = 'sans-serif';\n this.loadingContainer.style.zIndex = '9001';\n this.loadingContainer.style.opacity = '1';\n this.loadingContainer.style.transition = 'opacity 0.5s ease-in';\n this.loadingContainer.innerHTML = [\"
\", \"
\", \"
\", \"
\", \"
\", \"
\", \"
\", '
'].join('\\n');\n\n this.p._.container.appendChild(this.loadingContainer);\n\n this.p._.sceneContainer.style.filter = 'blur(10px) brightness(0.5)';\n this.p._.sceneContainer.style.transition = 'filter 0.5s ease-in-out';\n }\n\n return Controls;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Controls);\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/loadingScreen.ts?"); - -/***/ }), - -/***/ "./src/secondary/sprites.ts": -/*!**********************************!*\ - !*** ./src/secondary/sprites.ts ***! - \**********************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\nvar Sprites = {\n spriteMaterials: {},\n makeMarkerSprite: function (parameters, id, forceNewMaterial) {\n var sprite = new three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"](Sprites.makeMarkerMaterial(parameters, id, forceNewMaterial));\n sprite.style = sprite.style || {};\n sprite.style.radius = parameters.hasOwnProperty('radius') ? parameters['radius'] : 32;\n return sprite;\n },\n makeMarkerMaterial: function (parameters, id, forceNewMaterial) {\n if (id && this.spriteMaterials.hasOwnProperty(id) && forceNewMaterial !== true) {\n return this.spriteMaterials[id];\n } else {\n if (parameters === undefined) parameters = {};\n var radius = parameters.hasOwnProperty('radius') ? parameters['radius'] : 64;\n radius = Math.max(radius, 64);\n var fillColor = parameters.hasOwnProperty('fillColor') ? parameters['fillColor'] : {\n r: 255,\n g: 255,\n b: 255,\n a: parameters['fillOpacity'] != null ? parameters['fillOpacity'] : 1.0\n };\n var strokeWeight = parameters.hasOwnProperty('weight') ? parameters['weight'] : 4;\n var strokeColor = parameters.hasOwnProperty('color') ? parameters['color'] : {\n r: 0,\n g: 0,\n b: 0,\n a: 1.0\n };\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n var width = radius * 2;\n var height = radius * 2;\n canvas.width = width;\n canvas.height = height;\n context.beginPath();\n context.arc(canvas.width / 2, canvas.height / 2, radius - strokeWeight * (radius / 12), 0, 2 * Math.PI, false);\n\n if (typeof fillColor === 'object') {\n context.fillStyle = 'rgba(' + fillColor.r + ',' + fillColor.g + ',' + fillColor.b + ',' + fillColor.a + ')';\n } else {\n context.fillStyle = fillColor;\n }\n\n context.fill();\n context.lineWidth = strokeWeight * (radius / 8);\n\n if (typeof strokeColor === 'object') {\n context.strokeStyle = 'rgba(' + strokeColor.r + ',' + strokeColor.g + ',' + strokeColor.b + ',' + strokeColor.a + ')';\n } else {\n context.strokeStyle = strokeColor;\n }\n\n context.stroke();\n var texture = new three__WEBPACK_IMPORTED_MODULE_0__[\"Texture\"](canvas);\n texture.needsUpdate = true;\n var spriteMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"SpriteMaterial\"]({\n map: texture,\n transparent: true,\n alphaTest: 0.01\n });\n\n if (id && forceNewMaterial !== true) {\n this.spriteMaterials[id] = spriteMaterial;\n }\n\n return spriteMaterial;\n }\n },\n makeTextSprite: function (message, parameters) {\n if (parameters === undefined) parameters = {};\n var fontface = parameters.hasOwnProperty('fontface') ? parameters['fontface'] : 'Arial';\n var fontsize = parameters.hasOwnProperty('fontsize') ? parameters['fontsize'] : 18;\n var strokeWeight = parameters.hasOwnProperty('strokeWeight') ? parameters['strokeWeight'] : 4;\n var strokeColor = parameters.hasOwnProperty('strokeColor') ? parameters['strokeColor'] : {\n r: 0,\n g: 0,\n b: 0,\n a: 1.0\n };\n var fontColor = parameters.hasOwnProperty('fontColor') ? parameters['fontColor'] : {\n r: 255,\n g: 255,\n b: 255,\n a: 1.0\n };\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n var width = 1024;\n var height = 64;\n canvas.width = width;\n canvas.height = height;\n context.font = 'Bold ' + fontsize + 'px ' + fontface;\n context.strokeStyle = 'rgba(' + strokeColor.r + ',' + strokeColor.g + ',' + strokeColor.b + ',' + strokeColor.a + ')';\n context.lineWidth = strokeWeight;\n context.fillStyle = 'rgba(' + fontColor.r + ',' + fontColor.g + ',' + fontColor.b + ',' + fontColor.a + ')';\n context.textAlign = 'left';\n context.strokeText(message, width / 2 + fontsize, height - fontsize / 1.8);\n context.fillText(message, width / 2 + fontsize, height - fontsize / 1.8);\n var texture = new three__WEBPACK_IMPORTED_MODULE_0__[\"Texture\"](canvas);\n texture.needsUpdate = true;\n var spriteMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"SpriteMaterial\"]({\n map: texture\n });\n var sprite = new three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"](spriteMaterial);\n sprite.scale.set(64, 4, 1);\n return sprite;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Sprites);\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/sprites.ts?"); - -/***/ }), - -/***/ "./src/utils/index.ts": -/*!****************************!*\ - !*** ./src/utils/index.ts ***! - \****************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\nvar Utils = {\n getIn: function (obj, keyArray, notSetValue) {\n if (obj == null) return notSetValue != null ? notSetValue : null;\n if (typeof keyArray === 'string') keyArray = keyArray.split('.');\n if (keyArray == null) return notSetValue != null ? notSetValue : null;\n var object = Object.assign({}, obj);\n\n for (var i = 0; i < keyArray.length; i++) {\n if (object.hasOwnProperty(keyArray[i])) object = object[keyArray[i]];else return notSetValue != null ? notSetValue : null;\n }\n\n return object;\n },\n mod: function (n, m) {\n var remain = n % m;\n return Math.floor(remain >= 0 ? remain : remain + m);\n },\n findHighestMaxZoom: function (tileLayers) {\n var highest = 0;\n\n for (var l in tileLayers) {\n if (tileLayers[l].name != 'Vectors As Tiles') if (tileLayers[l].maxZoom > highest) {\n highest = tileLayers[l].maxZoom;\n }\n }\n\n return highest;\n },\n findLowestMinZoom: function (tileLayers) {\n var lowest = Infinity;\n\n for (var l in tileLayers) {\n if (tileLayers[l].path !== '_vectorsastile_') {\n if (tileLayers[l].minZoom < lowest) {\n lowest = tileLayers[l].minZoom;\n }\n }\n }\n\n return lowest;\n },\n isInExtent: function (xyz, bb, projection) {\n var inExtent = true;\n\n if (bb) {\n var tx_ext = xyz.x + 0;\n var ty_ext = xyz.y + 0;\n var projectedLL = projection.tileXYZ2LatLng(tx_ext, ty_ext, xyz.z);\n var tlat_ext = projectedLL.lat;\n var tlon_ext = projectedLL.lng;\n inExtent = tlat_ext < bb[3] && tlat_ext > bb[1] && tlon_ext < bb[2] && tlon_ext > bb[0];\n tx_ext = xyz.x + 1;\n ty_ext = xyz.y + 0;\n projectedLL = projection.tileXYZ2LatLng(tx_ext, ty_ext, xyz.z);\n tlat_ext = projectedLL.lat;\n tlon_ext = projectedLL.lng;\n inExtent = inExtent || tlat_ext < bb[3] && tlat_ext > bb[1] && tlon_ext < bb[2] && tlon_ext > bb[0];\n tx_ext = xyz.x + 1;\n ty_ext = xyz.y + 1;\n projectedLL = projection.tileXYZ2LatLng(tx_ext, ty_ext, xyz.z);\n tlat_ext = projectedLL.lat;\n tlon_ext = projectedLL.lng;\n inExtent = inExtent || tlat_ext < bb[3] && tlat_ext > bb[1] && tlon_ext < bb[2] && tlon_ext > bb[0];\n tx_ext = xyz.x + 0;\n ty_ext = xyz.y + 1;\n projectedLL = projection.tileXYZ2LatLng(tx_ext, ty_ext, xyz.z);\n tlat_ext = projectedLL.lat;\n tlon_ext = projectedLL.lng;\n inExtent = inExtent || tlat_ext < bb[3] && tlat_ext > bb[1] && tlon_ext < bb[2] && tlon_ext > bb[0];\n }\n\n return inExtent;\n },\n clone: function (obj) {\n var copy;\n if (null == obj || 'object' != typeof obj) return obj;\n\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n if (obj instanceof Array) {\n copy = [];\n\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = Utils.clone(obj[i]);\n }\n\n return copy;\n }\n\n if (obj instanceof Object) {\n copy = {};\n\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = Utils.clone(obj[attr]);\n }\n\n return copy;\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n },\n capitalizeFirstLetter: function (string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n },\n getExtension: function (string) {\n return /(?:\\.([^.]+))?$/.exec(string)[1] || '';\n },\n getRadiansPerPixel: function (zoom) {\n return 360 / Math.pow(2, zoom) * (Math.PI / 180) / 256;\n },\n lastTileContains: [],\n tileContains: function (xyz, z, useLast) {\n if (useLast) {\n for (var i = 0; i < Utils.lastTileContains.length; i++) {\n var lastxyz = Utils.lastTileContains[i].call.xyz;\n\n if (lastxyz[0] == xyz[0] && lastxyz[1] == xyz[1] && lastxyz[2] == xyz[2] && Utils.lastTileContains[i].call.z == z) {\n return Utils.lastTileContains[i].result;\n }\n }\n }\n\n var contained = [];\n var zoomRatio = Math.pow(2, z) / Math.pow(2, xyz[2]);\n var max = [(xyz[0] + 1) * zoomRatio - 1, (xyz[1] + 1) * zoomRatio - 1];\n var min = [max[0] - zoomRatio + 1, max[1] - zoomRatio + 1];\n\n for (var x = min[0]; x <= max[0]; x++) {\n for (var y = min[1]; y <= max[1]; y++) {\n contained.push([x, y, z]);\n }\n }\n\n Utils.lastTileContains.unshift({\n call: {\n xyz: xyz,\n z: z\n },\n result: contained\n });\n if (Utils.lastTileContains.length > 3) Utils.lastTileContains.pop();\n return contained;\n },\n tileIsContained: function (xyzContainer, xyzContained, useLast) {\n var contains = this.tileContains(xyzContainer, xyzContained[2], useLast);\n\n for (var i = 0; i < contains.length; i++) {\n if (contains[i][0] == xyzContained[0] && contains[i][1] == xyzContained[1]) return true;\n }\n\n return false;\n },\n arrayAverage: function (array, key) {\n var total = 0;\n\n for (var i = 0; i < array.length; i++) {\n if (key != null) total += array[i][key];else total += array[i];\n }\n\n return total / array.length;\n },\n hexToRGB: function (hex) {\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\n return r + r + g + g + b + b;\n });\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n },\n rotatePoint: function (pt, center, angle) {\n var cosAngle = Math.cos(angle);\n var sinAngle = Math.sin(angle);\n var dx = pt.x - center[0];\n var dy = pt.y - center[1];\n return {\n x: center[0] + dx * cosAngle - dy * sinAngle,\n y: center[1] + dx * sinAngle + dy * cosAngle\n };\n },\n rotateAroundArbAxis: function (object, axis, radians, noPremultiply) {\n object.updateWorldMatrix(true);\n var invWorldRot = object.getWorldQuaternion(new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]()).invert();\n axis.applyQuaternion(invWorldRot);\n var deltaLocalRot = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\n deltaLocalRot.setFromAxisAngle(axis, radians);\n object.quaternion.multiply(deltaLocalRot);\n },\n getParamString: function (params, baseUrl, isUppercase) {\n var str = [];\n var urlParams = new URLSearchParams(baseUrl.toUpperCase());\n\n for (var o in params) {\n if (!urlParams.has(o.toUpperCase())) str.push(encodeURIComponent(isUppercase ? o.toUpperCase() : o) + '=' + encodeURIComponent(params[o]));\n }\n\n return (baseUrl && baseUrl.indexOf('?') !== -1 ? '&' : '?') + str.join('&');\n },\n isArray: function (object) {\n return Object.prototype.toString.call(object) === '[object Array]';\n },\n setChildrenMaterialOpacity: function (model, opacity, recurse) {\n model.children.forEach(function (mesh) {\n if (mesh.material) {\n mesh.material.transparent = true;\n mesh.material.opacity = opacity;\n }\n\n if (typeof recurse === 'function' && mesh.children && mesh.children.length > 0) {\n recurse(mesh);\n }\n });\n },\n setAllMaterialOpacity: function (model, opacity) {\n if (model.material) {\n model.material.transparent = true;\n model.material.opacity = opacity;\n }\n\n Utils.setChildrenMaterialOpacity(model, opacity, function (mesh) {\n Utils.setAllMaterialOpacity(mesh, opacity);\n });\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Utils);\n\n//# sourceURL=webpack://LithoSphere/./src/utils/index.ts?"); - -/***/ }), - -/***/ "./src/utils/paths.ts": -/*!****************************!*\ - !*** ./src/utils/paths.ts ***! - \****************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ */ \"./src/utils/index.ts\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\nvar Paths = {\n buildPath: function (format, basePath, tD, projection, tileResolution, trueTileResolution, options, asObject) {\n format = format || 'tms';\n var path;\n var xyz = {\n x: tD.x,\n y: tD.y,\n z: tD.z\n };\n\n switch (format) {\n case 'wmts':\n path = basePath;\n path = path.replace('{z}', xyz.z);\n path = path.replace('{x}', xyz.x);\n path = path.replace('{y}', xyz.y);\n break;\n\n case 'wms':\n path = Paths.wmsExtension.buildPath(basePath, xyz, projection, tileResolution, trueTileResolution, options);\n break;\n\n default:\n path = basePath;\n path = path.replace('{z}', xyz.z);\n path = path.replace('{x}', xyz.x);\n xyz.y = projection.invertY(xyz.y, xyz.z);\n path = path.replace('{y}', xyz.y);\n }\n\n if (asObject) return {\n path: path,\n xyz: xyz\n };\n return path;\n },\n wmsExtension: {\n defaultWmsParams: {\n SERVICE: 'WMS',\n REQUEST: 'GetMap',\n FORMAT: 'image/png',\n TRANSPARENT: true,\n VERSION: '1.1.1',\n WIDTH: null,\n HEIGHT: null\n },\n extensionOptions: {\n crsCode: 'EPSG:4326',\n uppercase: true\n },\n buildPath: function (basePath, xyz, projection, tileResolution, trueTileResolution, options) {\n var wmsParams = __assign({}, Paths.wmsExtension.defaultWmsParams);\n\n options = options || {};\n if (options.wmsParams) for (var i in options.wmsParams) {\n if (!(i in Paths.wmsExtension.extensionOptions)) {\n wmsParams[i] = options.wmsParams[i];\n }\n }\n wmsParams.VERSION = options.wmsVersion || wmsParams.VERSION;\n\n if (options.correctSeams === true) {\n tileResolution--;\n wmsParams.WIDTH = wmsParams.HEIGHT = tileResolution + 2;\n } else wmsParams.WIDTH = wmsParams.HEIGHT = tileResolution;\n\n var crsCode = projection.tileMapResource.crsCode || Paths.wmsExtension.extensionOptions.crsCode;\n wmsParams[parseFloat(wmsParams.VERSION) >= 1.3 ? 'CRS' : 'SRS'] = crsCode;\n var bounds = projection.tileXYZ2NwSe(xyz, trueTileResolution, true, options.correctSeams === true ? (tileResolution + 1) / tileResolution : null);\n var bbox = (parseFloat(wmsParams.VERSION) >= 1.3 && crsCode === 'EPSG:4326' ? [bounds.min.y, bounds.min.x, bounds.max.y, bounds.max.x] : [bounds.min.x, bounds.min.y, bounds.max.x, bounds.max.y]).join(',');\n return basePath + ___WEBPACK_IMPORTED_MODULE_0__[\"default\"].getParamString(wmsParams, basePath, Paths.wmsExtension.extensionOptions.uppercase) + (Paths.wmsExtension.extensionOptions.uppercase ? '&BBOX=' : '&bbox=') + bbox;\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Paths);\n\n//# sourceURL=webpack://LithoSphere/./src/utils/paths.ts?"); - -/***/ }) - -/******/ }); -}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("LithoSphere",[],t):"object"==typeof exports?exports.LithoSphere=t():e.LithoSphere=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="C:\\Users\\tsoliman\\Documents\\Projects\\LithoSphere\\dist/",n(n.s=14)}([function(e,t,n){"use strict";n.r(t),n.d(t,"earthRadius",(function(){return r})),n.d(t,"factors",(function(){return i})),n.d(t,"unitsFactors",(function(){return a})),n.d(t,"areaFactors",(function(){return o})),n.d(t,"feature",(function(){return s})),n.d(t,"geometry",(function(){return l})),n.d(t,"point",(function(){return c})),n.d(t,"points",(function(){return u})),n.d(t,"polygon",(function(){return h})),n.d(t,"polygons",(function(){return d})),n.d(t,"lineString",(function(){return f})),n.d(t,"lineStrings",(function(){return p})),n.d(t,"featureCollection",(function(){return m})),n.d(t,"multiLineString",(function(){return g})),n.d(t,"multiPoint",(function(){return v})),n.d(t,"multiPolygon",(function(){return y})),n.d(t,"geometryCollection",(function(){return b})),n.d(t,"round",(function(){return _})),n.d(t,"radiansToLength",(function(){return x})),n.d(t,"lengthToRadians",(function(){return w})),n.d(t,"lengthToDegrees",(function(){return M})),n.d(t,"bearingToAzimuth",(function(){return S})),n.d(t,"radiansToDegrees",(function(){return T})),n.d(t,"degreesToRadians",(function(){return E})),n.d(t,"convertLength",(function(){return C})),n.d(t,"convertArea",(function(){return A})),n.d(t,"isNumber",(function(){return P})),n.d(t,"isObject",(function(){return L})),n.d(t,"validateBBox",(function(){return R})),n.d(t,"validateId",(function(){return O}));var r=6371008.8,i={centimeters:100*r,centimetres:100*r,degrees:r/111325,feet:3.28084*r,inches:39.37*r,kilometers:r/1e3,kilometres:r/1e3,meters:r,metres:r,miles:r/1609.344,millimeters:1e3*r,millimetres:1e3*r,nauticalmiles:r/1852,radians:1,yards:r/1.0936},a={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r,yards:1/1.0936},o={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function s(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function l(e,t,n){switch(void 0===n&&(n={}),e){case"Point":return c(t).geometry;case"LineString":return f(t).geometry;case"Polygon":return h(t).geometry;case"MultiPoint":return v(t).geometry;case"MultiLineString":return g(t).geometry;case"MultiPolygon":return y(t).geometry;default:throw new Error(e+" is invalid")}}function c(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(e[0])||!P(e[1]))throw new Error("coordinates must contain numbers");return s({type:"Point",coordinates:e},t,n)}function u(e,t,n){return void 0===n&&(n={}),m(e.map((function(e){return c(e,t)})),n)}function h(e,t,n){void 0===n&&(n={});for(var r=0,i=e;r=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n}function x(e,t){void 0===t&&(t="kilometers");var n=i[t];if(!n)throw new Error(t+" units is invalid");return e*n}function w(e,t){void 0===t&&(t="kilometers");var n=i[t];if(!n)throw new Error(t+" units is invalid");return e/n}function M(e,t){return T(w(e,t))}function S(e){var t=e%360;return t<0&&(t+=360),t}function T(e){return 180*(e%(2*Math.PI))/Math.PI}function E(e){return e%360*Math.PI/180}function C(e,t,n){if(void 0===t&&(t="kilometers"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return x(w(e,t),n)}function A(e,t,n){if(void 0===t&&(t="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var r=o[t];if(!r)throw new Error("invalid original units");var i=o[n];if(!i)throw new Error("invalid final units");return e/r*i}function P(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function L(e){return!!e&&e.constructor===Object}function R(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!P(e))throw new Error("bbox must only contain numbers")}))}function O(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},function(e,t,n){"use strict";n.r(t),n.d(t,"coordEach",(function(){return i})),n.d(t,"coordReduce",(function(){return a})),n.d(t,"propEach",(function(){return o})),n.d(t,"propReduce",(function(){return s})),n.d(t,"featureEach",(function(){return l})),n.d(t,"featureReduce",(function(){return c})),n.d(t,"coordAll",(function(){return u})),n.d(t,"geomEach",(function(){return h})),n.d(t,"geomReduce",(function(){return d})),n.d(t,"flattenEach",(function(){return f})),n.d(t,"flattenReduce",(function(){return p})),n.d(t,"segmentEach",(function(){return m})),n.d(t,"segmentReduce",(function(){return g})),n.d(t,"lineEach",(function(){return v})),n.d(t,"lineReduce",(function(){return y})),n.d(t,"findSegment",(function(){return b})),n.d(t,"findPoint",(function(){return _}));var r=n(0);function i(e,t,n){if(null!==e)for(var r,a,o,s,l,c,u,h,d=0,f=0,p=e.type,m="FeatureCollection"===p,g="Feature"===p,v=m?e.features.length:1,y=0;yc||f>u||p>h)return l=i,c=n,u=f,h=p,void(o=0);var m=Object(r.lineString)([l,i],e.properties);if(!1===t(m,n,a,p,o))return!1;o++,l=i}))&&void 0}}}))}function g(e,t,n){var r=n,i=!1;return m(e,(function(e,a,o,s,l){r=!1===i&&void 0===n?e:t(r,e,a,o,s,l),i=!0})),r}function v(e,t){if(!e)throw new Error("geojson is required");f(e,(function(e,n,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,n,i,0,0))return!1;break;case"Polygon":for(var s=0;s=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!i;a--){var o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,i="/"===o.charAt(0))}return(i?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!i).join("/"))||"."},t.normalize=function(e){var a=t.isAbsolute(e),o="/"===i(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!a).join("/"))||a||(e="."),e&&o&&(e+="/"),(a?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),a=r(n.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,a=0,o=e.length-1;o>=0;--o){var s=e.charCodeAt(o);if(47!==s)-1===r&&(i=!1,r=o+1),46===s?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){n=o+1;break}}return-1===t||-1===r||0===a||1===a&&t===r-1&&t===n+1?"":e.slice(t,r)};var i="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(10))},function(e,t,n){parcelRequire=function(t,r,i,a){var o,s="function"==typeof parcelRequire&&parcelRequire;function l(e,i){if(!r[e]){if(!t[e]){var a="function"==typeof parcelRequire&&parcelRequire;if(!i&&a)return a(e,!0);if(s)return s(e,!0);if("string"==typeof e)return n(6)(e);var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}u.resolve=function(n){return t[e][1][n]||n},u.cache={};var c=r[e]=new l.Module(e);t[e][0].call(c.exports,u,c,c.exports,this)}return r[e].exports;function u(e){return l(u.resolve(e))}}l.isParcelRequire=!0,l.Module=function(e){this.id=e,this.bundle=l,this.exports={}},l.modules=t,l.cache=r,l.parent=s,l.register=function(e,n){t[e]=[function(e,t){t.exports=n},{}]};for(var c=0;c=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),p}},e}("object"==typeof t?t.exports:{});try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},{}],PMvg:[function(e,t,n){t.exports=e("regenerator-runtime")},{"regenerator-runtime":"QVnC"}],IxO8:[function(e,t,n){t.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{}],OUZ9:[function(e,t,n){t.exports=function(e){if(Array.isArray(e))return e}},{}],vKPt:[function(e,t,n){t.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}}},{}],NVR6:[function(e,t,n){t.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n>23&511;return o[n]+((8388607&t)>>s[n])},n.convertToNumber=function(e){const t=e>>10;return a[0]=l[u[t]+(1023&e)]+c[t],i[0]};const r=new ArrayBuffer(4),i=new Float32Array(r),a=new Uint32Array(r),o=new Uint32Array(512),s=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(o[0|e]=0,o[256|e]=32768,s[0|e]=24,s[256|e]=24):t<-14?(o[0|e]=1024>>-t-14,o[256|e]=1024>>-t-14|32768,s[0|e]=-t-1,s[256|e]=-t-1):t<=15?(o[0|e]=t+15<<10,o[256|e]=t+15<<10|32768,s[0|e]=13,s[256|e]=13):t<128?(o[0|e]=31744,o[256|e]=64512,s[0|e]=24,s[256|e]=24):(o[0|e]=31744,o[256|e]=64512,s[0|e]=13,s[256|e]=13)}const l=new Uint32Array(2048),c=new Uint32Array(64),u=new Uint32Array(64);l[0]=0;for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;0==(8388608&t);)n-=8388608,t<<=1;t&=-8388609,n+=947912704,l[e]=t|n}for(let e=1024;e<2048;++e)l[e]=939524096+(e-1024<<13);c[0]=0;for(let e=1;e<31;++e)c[e]=e<<23;c[31]=1199570944,c[32]=2147483648;for(let e=33;e<63;++e)c[e]=2147483648+(e-32<<23);c[63]=3347054592,u[0]=0;for(let e=1;e<64;++e)u[e]=32===e?0:1024},{}],G4sf:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){if(e=Number(e),!Number.isFinite(e)||0===e)return e;const t=(0,r.roundToFloat16Bits)(e);return(0,r.convertToNumber)(t)};var r=e("./lib")},{"./lib":"GG94"}],xQUP:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ToInteger=function(e){return"number"!=typeof e&&(e=Number(e)),Number.isNaN(e)&&(e=0),Math.trunc(e)},n.defaultCompareFunction=function(e,t){const[n,r]=[Number.isNaN(e),Number.isNaN(t)];if(n&&r)return 0;if(n)return 1;if(r)return-1;if(et)return 1;if(0===e&&0===t){const[n,r]=[Object.is(e,0),Object.is(t,0)];if(!n&&r)return-1;if(n&&!r)return 1}return 0}},{}],iJ7y:[function(e,t,n){var r=arguments[3];Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i="object"==typeof r&&r&&r.Object===Object&&r,a=i;n.default=a},{}],ygki:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_freeGlobal.js")),i="object"==typeof self&&self&&self.Object===Object&&self,a=r.default||i||Function("return this")();n.default=a},{"./_freeGlobal.js":"iJ7y"}],Oi8n:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_root.js")).default.Symbol;n.default=r},{"./_root.js":"ygki"}],InRc:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_Symbol.js")),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=r.default?r.default.toStringTag:void 0;n.default=function(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=o.call(e);return r&&(t?e[s]=n:delete e[s]),i}},{"./_Symbol.js":"Oi8n"}],iwg4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=Object.prototype.toString;n.default=function(e){return r.call(e)}},{}],svpX:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./_Symbol.js")),i=o(e("./_getRawTag.js")),a=o(e("./_objectToString.js"));function o(e){return e&&e.__esModule?e:{default:e}}var s=r.default?r.default.toStringTag:void 0;n.default=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?(0,i.default)(e):(0,a.default)(e)}},{"./_Symbol.js":"Oi8n","./_getRawTag.js":"InRc","./_objectToString.js":"iwg4"}],UKR9:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(e){return null!=e&&"object"==typeof e}},{}],MYZg:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(e("./_baseGetTag.js")),i=a(e("./isObjectLike.js"));function a(e){return e&&e.__esModule?e:{default:e}}n.default=function(e){return(0,i.default)(e)&&"[object ArrayBuffer]"==(0,r.default)(e)}},{"./_baseGetTag.js":"svpX","./isObjectLike.js":"UKR9"}],pmj6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(e){return function(t){return e(t)}}},{}],oPFz:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_freeGlobal.js")),i="object"==typeof n&&n&&!n.nodeType&&n,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i&&r.default.process,s=function(){try{return a&&a.require&&a.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();n.default=s},{"./_freeGlobal.js":"iJ7y"}],rXXV:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./_baseIsArrayBuffer.js")),i=o(e("./_baseUnary.js")),a=o(e("./_nodeUtil.js"));function o(e){return e&&e.__esModule?e:{default:e}}var s=a.default&&a.default.isArrayBuffer,l=s?(0,i.default)(s):r.default;n.default=l},{"./_baseIsArrayBuffer.js":"MYZg","./_baseUnary.js":"pmj6","./_nodeUtil.js":"oPFz"}],XYHx:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isDataView=function(e){return e instanceof DataView},n.isStringNumberKey=function(e){return"string"==typeof e&&e===(0,r.ToInteger)(e)+""},Object.defineProperty(n,"isArrayBuffer",{enumerable:!0,get:function(){return i.default}});var r=e("./spec"),i=function(e){return e&&e.__esModule?e:{default:e}}(e("lodash-es/isArrayBuffer"))},{"./spec":"xQUP","lodash-es/isArrayBuffer":"rXXV"}],EEXG:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createPrivateStorage=function(){const e=new WeakMap;return t=>{let n=e.get(t);return n||(n=Object.create(null),e.set(t,n),n)}}},{}],DTZk:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},{}],tWvT:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(e("./_baseGetTag.js")),i=a(e("./isObject.js"));function a(e){return e&&e.__esModule?e:{default:e}}n.default=function(e){if(!(0,i.default)(e))return!1;var t=(0,r.default)(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag.js":"svpX","./isObject.js":"DTZk"}],xFkS:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_root.js")).default["__core-js_shared__"];n.default=r},{"./_root.js":"ygki"}],pULC:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_coreJsData.js")),i=function(){var e=/[^.]+$/.exec(r.default&&r.default.keys&&r.default.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();n.default=function(e){return!!i&&i in e}},{"./_coreJsData.js":"xFkS"}],UKJK:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=Function.prototype.toString;n.default=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},{}],Zczf:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=s(e("./isFunction.js")),i=s(e("./_isMasked.js")),a=s(e("./isObject.js")),o=s(e("./_toSource.js"));function s(e){return e&&e.__esModule?e:{default:e}}var l=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,h=c.toString,d=u.hasOwnProperty,f=RegExp("^"+h.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");n.default=function(e){return!(!(0,a.default)(e)||(0,i.default)(e))&&((0,r.default)(e)?f:l).test((0,o.default)(e))}},{"./isFunction.js":"tWvT","./_isMasked.js":"pULC","./isObject.js":"DTZk","./_toSource.js":"UKJK"}],ZVQn:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(e,t){return null==e?void 0:e[t]}},{}],tx41:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(e("./_baseIsNative.js")),i=a(e("./_getValue.js"));function a(e){return e&&e.__esModule?e:{default:e}}n.default=function(e,t){var n=(0,i.default)(e,t);return(0,r.default)(n)?n:void 0}},{"./_baseIsNative.js":"Zczf","./_getValue.js":"ZVQn"}],YsDH:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=(0,function(e){return e&&e.__esModule?e:{default:e}}(e("./_getNative.js")).default)(Object,"create");n.default=r},{"./_getNative.js":"tx41"}],sJnX:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_nativeCreate.js"));n.default=function(){this.__data__=r.default?(0,r.default)(null):{},this.size=0}},{"./_nativeCreate.js":"YsDH"}],c9sB:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},{}],zYTU:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_nativeCreate.js")),i=Object.prototype.hasOwnProperty;n.default=function(e){var t=this.__data__;if(r.default){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},{"./_nativeCreate.js":"YsDH"}],ZFwF:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_nativeCreate.js")),i=Object.prototype.hasOwnProperty;n.default=function(e){var t=this.__data__;return r.default?void 0!==t[e]:i.call(t,e)}},{"./_nativeCreate.js":"YsDH"}],i3LK:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_nativeCreate.js"));n.default=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r.default&&void 0===t?"__lodash_hash_undefined__":t,this}},{"./_nativeCreate.js":"YsDH"}],tE4I:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(e("./_hashClear.js")),i=l(e("./_hashDelete.js")),a=l(e("./_hashGet.js")),o=l(e("./_hashHas.js")),s=l(e("./_hashSet.js"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1}},{"./_assocIndexOf.js":"Hp84"}],GGNI:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./_assocIndexOf.js"));n.default=function(e,t){var n=this.__data__,i=(0,r.default)(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},{"./_assocIndexOf.js":"Hp84"}],UlXa:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(e("./_listCacheClear.js")),i=l(e("./_listCacheDelete.js")),a=l(e("./_listCacheGet.js")),o=l(e("./_listCacheHas.js")),s=l(e("./_listCacheSet.js"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tu(t)&&function(e){return"function"==typeof e&&v.has(e)}(e)?Reflect.apply(e,c(t).target,n):Reflect.apply(e,t,n)},p={get(e,t){let n=null;if(l.isTypedArrayIndexedPropertyWritable||(e=c(n=e).target),(0,i.isStringNumberKey)(t))return Reflect.has(e,t)?(0,s.convertToNumber)(Reflect.get(e,t)):void 0;{const r=null!==n&&Reflect.has(n,t)?Reflect.get(n,t):Reflect.get(e,t);if("function"!=typeof r)return r;let i=c(r).proxy;return void 0===i&&(i=c(r).proxy=new Proxy(r,f)),i}},set(e,t,n){let r=null;return l.isTypedArrayIndexedPropertyWritable||(e=c(r=e).target),(0,i.isStringNumberKey)(t)?Reflect.set(e,t,(0,s.roundToFloat16Bits)(n)):null===r||Reflect.has(e,t)&&!Object.isFrozen(r)?Reflect.set(e,t,n):Reflect.set(r,t,n)}};l.isTypedArrayIndexedPropertyWritable||(p.getPrototypeOf=e=>Reflect.getPrototypeOf(c(e).target),p.setPrototypeOf=(e,t)=>Reflect.setPrototypeOf(c(e).target,t),p.defineProperty=(e,t,n)=>{const r=c(e).target;return!Reflect.has(r,t)||Object.isFrozen(e)?Reflect.defineProperty(e,t,n):Reflect.defineProperty(r,t,n)},p.deleteProperty=(e,t)=>{const n=c(e).target;return Reflect.has(e,t)?Reflect.deleteProperty(e,t):Reflect.deleteProperty(n,t)},p.has=(e,t)=>Reflect.has(e,t)||Reflect.has(c(e).target,t),p.isExtensible=e=>Reflect.isExtensible(e),p.preventExtensions=e=>Reflect.preventExtensions(e),p.getOwnPropertyDescriptor=(e,t)=>Reflect.getOwnPropertyDescriptor(e,t),p.ownKeys=e=>Reflect.ownKeys(e));class m extends Uint16Array{constructor(e,t,n){if(u(e))super(c(e).target);else if(null===e||"object"!=typeof e||(0,i.isArrayBuffer)(e))switch(arguments.length){case 0:super();break;case 1:super(e);break;case 2:super(e,t);break;case 3:super(e,t,n);break;default:super(...arguments)}else{const t=Reflect.has(e,"length")||void 0===e[Symbol.iterator]?e:[...e],n=t.length;super(n);for(let e=0;et(n(e),n(r))),c(this).proxy}slice(...e){let t;h(this);try{t=super.slice(...e)}catch(n){if(!(n instanceof TypeError))throw n;t=new Uint16Array(this.buffer,this.byteOffset,this.length).slice(...e)}return new m(t.buffer)}subarray(...e){let t;h(this);try{t=super.subarray(...e)}catch(n){if(!(n instanceof TypeError))throw n;t=new Uint16Array(this.buffer,this.byteOffset,this.length).subarray(...e)}return new m(t.buffer,t.byteOffset,t.length)}indexOf(e,...t){h(this);const n=this.length;let i=(0,r.ToInteger)(t[0]);i<0&&(i+=n)<0&&(i=0);for(let t=i,r=n;t=0?i=i0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)a(l,this,t);else{var c=l.length,u=g(l,c);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},{}],ExO1:[function(e,t,n){t.exports=e("events").EventEmitter},{events:"FRpO"}],yh9p:[function(e,t,n){"use strict";n.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},n.toByteArray=function(e){var t,n,r=c(e),o=r[0],s=r[1],l=new a(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),u=0,h=s>0?o-4:o;for(n=0;n>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,l[u++]=255&t),1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;os?s:o+16383));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function h(e,t,n){for(var r,i=[],a=t;a>1,u=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,a=f&(1<<-u)-1,f>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=d,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=256*o+e[t+h],h+=d,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),a-=c}return(f?-1:1)*o*Math.pow(2,a-r)},n.write=function(e,t,n,r,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(o=o<0;e[n+f]=255&o,f+=p,o/=256,c-=8);e[n+f-p]|=128*m}},{}],REa7:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],dskh:[function(e,t,n){var r=arguments[3],i=e("base64-js"),a=e("ieee754"),o=e("isarray");function s(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function l(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(e,t){if(l()=l())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l().toString(16)+" bytes");return 0|e}function _(e){return+e!=e&&(e=0),u.alloc(+e)}function x(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return ee(e).length;default:if(r)return K(e).length;t=(""+t).toLowerCase(),r=!0}}function w(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return D(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return O(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function M(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function S(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:T(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function T(e,t,n,r,i){var a,o=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=n;as&&(n=s-l),a=n;a>=0;a--){for(var h=!0,d=0;di&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(a=e[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=h}return N(r)}n.Buffer=u,n.SlowBuffer=_,n.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==r.TYPED_ARRAY_SUPPORT?r.TYPED_ARRAY_SUPPORT:s(),n.kMaxLength=l(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return h(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return f(null,e,t,n)},u.allocUnsafe=function(e){return p(null,e)},u.allocUnsafeSlow=function(e){return p(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(r,i),c=e.slice(t,n),h=0;hi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return C(this,e,t,n);case"ascii":return A(this,e,t,n);case"latin1":case"binary":return P(this,e,t,n);case"base64":return L(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function N(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function H(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function G(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function W(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(e,t,n,r,i){return i||W(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function q(e,t,n,r,i){return i||W(e,0,n,8),a.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||B(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||B(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),a.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||U(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):G(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):G(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);U(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);U(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):G(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):G(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return V(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return V(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Q(e){for(var t=[],n=0;n>8,i=n%256,a.push(i),a.push(r);return a}function ee(e){return i.toByteArray(Y(e))}function te(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function ne(e){return e!=e}},{"base64-js":"yh9p",ieee754:"JgNJ",isarray:"REa7",buffer:"dskh"}],VCcH:[function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t=o.allocUnsafe(e>>>0),n=this.head,r=0;n;)c(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(a===i.length?r+=i:r+=i.slice(0,e),0==(e-=a)){a===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0==(e-=a)){a===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(a));break}++r}return this.length-=r,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t1)for(var n=1;n2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(e,t,n){var i,a;if("string"==typeof t&&function(e,t,n){return e.substr(0,t.length)===t}(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(o(t,"type"));else{var s=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";a='The "'.concat(e,'" ').concat(s," ").concat(i," ").concat(o(t,"type"))}return a+". Received type ".concat(r(n))}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},{}],TWVJ:[function(e,t,n){"use strict";var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var a=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},{"../../../errors":"Yj9o"}],Bm0n:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],yM1o:[function(e,t,n){var r=arguments[3];function i(e,t){if(a("noDeprecation"))return e;var n=!1;return function(){if(!n){if(a("throwDeprecation"))throw new Error(t);a("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}function a(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=i},{}],WSyY:[function(e,t,n){e("process");var r,i=arguments[3],a=e("process");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){q(t,e)}}t.exports=P,P.WritableState=A;var s={deprecate:e("util-deprecate")},l=e("./internal/streams/stream"),c=e("buffer").Buffer,u=i.Uint8Array||function(){};function h(e){return c.from(e)}function d(e){return c.isBuffer(e)||e instanceof u}var f,p=e("./internal/streams/destroy"),m=e("./internal/streams/state"),g=m.getHighWaterMark,v=e("../errors").codes,y=v.ERR_INVALID_ARG_TYPE,b=v.ERR_METHOD_NOT_IMPLEMENTED,_=v.ERR_MULTIPLE_CALLBACK,x=v.ERR_STREAM_CANNOT_PIPE,w=v.ERR_STREAM_DESTROYED,M=v.ERR_STREAM_NULL_VALUES,S=v.ERR_STREAM_WRITE_AFTER_END,T=v.ERR_UNKNOWN_ENCODING,E=p.errorOrDestroy;function C(){}function A(t,n,i){r=r||e("./_stream_duplex"),t=t||{},"boolean"!=typeof i&&(i=n instanceof r),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=g(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){j(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function P(t){var n=this instanceof(r=r||e("./_stream_duplex"));if(!n&&!f.call(P,this))return new P(t);this._writableState=new A(t,this,n),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function L(e,t){var n=new S;E(e,n),a.nextTick(t,n)}function R(e,t,n,r){var i;return null===n?i=new M:"string"==typeof n||t.objectMode||(i=new y("chunk",["string","Buffer"],n)),!i||(E(e,i),a.nextTick(r,i),!1)}function O(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n)),t}function k(e,t,n,r,i,a){if(!n){var o=O(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var l=t.length-1))throw new T(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(P.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(P.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),P.prototype._write=function(e,t,n){n(new b("_write()"))},P.prototype._writev=null,P.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||V(this,r,n),this},Object.defineProperty(P.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),P.prototype.destroy=p.destroy,P.prototype._undestroy=p.undestroy,P.prototype._destroy=function(e,t){t(e)}},{"util-deprecate":"yM1o","./internal/streams/stream":"ExO1",buffer:"dskh","./internal/streams/destroy":"GRUB","./internal/streams/state":"TWVJ","../errors":"Yj9o",inherits:"Bm0n","./_stream_duplex":"Hba0",process:"pBGv"}],Hba0:[function(e,t,n){e("process");var r=e("process"),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=u;var a=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(u,a);for(var s=i(o.prototype),l=0;l>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function u(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}n.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":"Wugr"}],mrEY:[function(e,t,n){"use strict";var r=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,n,a){if("function"==typeof n)return e(t,null,n);n||(n={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=u(t)),r)o.endEmitted?E(e,new T):O(e,o,t,!0);else if(o.ended)E(e,new M);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?O(e,o,t,!1):B(e,o)):O(e,o,t,!1)}else r||(o.reading=!1,B(e,o));return!o.ended&&(o.length=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function D(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=N(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function j(e,t){if(d("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?F(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,z(e)))}}function F(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,a.nextTick(z,e))}function z(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,X(e)}function B(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(U,e,t))}function U(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function W(e){d("readable nexttick read 0"),e.read(0)}function V(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(q,e,t))}function q(e,t){d("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),X(e),t.flowing&&!t.reading&&e.read(0)}function X(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function Y(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function Z(e){var t=e._readableState;d("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,a.nextTick(J,t,e))}function J(e,t){if(d("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function K(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Z(this):F(this),null;if(0===(e=D(e,t))&&t.ended)return 0===t.length&&Z(this),null;var r,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?Y(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&Z(this)),null!==r&&this.emit("data",r),r},L.prototype._read=function(e){E(this,new S("_read()"))},L.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,d("pipe count=%d opts=%j",r.pipesCount,t);var i=t&&!1===t.end||e===a.stdout||e===a.stderr?m:s;function s(){d("onend"),e.end()}r.endEmitted?a.nextTick(i):n.once("end",i),e.on("unpipe",(function t(i,a){d("onunpipe"),i===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,d("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",m),n.removeListener("data",u),c=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=H(n);e.on("drain",l);var c=!1;function u(t){d("ondata");var i=e.write(t);d("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==K(r.pipes,e))&&!c&&(d("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function h(t){d("onerror",t),m(),e.removeListener("error",h),0===o(e,"error")&&E(e,t)}function f(){e.removeListener("finish",p),m()}function p(){d("onfinish"),e.removeListener("close",f),m()}function m(){d("unpipe"),n.unpipe(e)}return n.on("data",u),A(e,"error",h),e.once("close",f),e.once("finish",p),e.emit("pipe",n),r.flowing||(d("pipe resume"),n.resume()),e},L.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,d("on readable",r.length,r.reading),r.length?F(this):r.reading||a.nextTick(W,this))),n},L.prototype.addListener=L.prototype.on,L.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&a.nextTick(G,this),n},L.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||a.nextTick(G,this),t},L.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!e.readableListening,V(this,e)),e.paused=!1,this},L.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},L.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(d("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){d("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a0,(function(e){r||(r=e),e&&o.forEach(c),a||(o.forEach(c),i(r))}))}));return t.reduce(u)}},{"../../../errors":"Yj9o","./end-of-stream":"mrEY"}],tzeh:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_readable.js":"DHrQ","./lib/_stream_writable.js":"WSyY","./lib/_stream_duplex.js":"Hba0","./lib/_stream_transform.js":"tlBz","./lib/_stream_passthrough.js":"nwyA","./lib/internal/streams/end-of-stream.js":"mrEY","./lib/internal/streams/pipeline.js":"AJFC"}],vexR:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],tcrG:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],gfUn:[function(e,t,n){e("process");var r=e("process"),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),s=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(t)?r.showHidden=t:t&&n._extend(r,t),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),h(r,e,r.depth)}function c(e,t){var n=l.styles[t];return n?"["+l.colors[n][0]+"m"+e+"["+l.colors[n][1]+"m":e}function u(e,t){return e}function h(e,t,r){if(e.customInspect&&t&&T(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return b(i)||(i=h(e,i,r)),i}var a=d(e,t);if(a)return a;var o=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),S(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(t);if(0===o.length){if(T(t)){var l=t.name?": "+t.name:"";return e.stylize("[Function"+l+"]","special")}if(x(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(M(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return f(t)}var c,u="",g=!1,v=["{","}"];return m(t)&&(g=!0,v=["[","]"]),T(t)&&(u=" [Function"+(t.name?": "+t.name:"")+"]"),x(t)&&(u=" "+RegExp.prototype.toString.call(t)),M(t)&&(u=" "+Date.prototype.toUTCString.call(t)),S(t)&&(u=" "+f(t)),0!==o.length||g&&0!=t.length?r<0?x(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=g?function(e,t,n,r,i){for(var a=[],o=0,s=t.length;o60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(c,u,v)):v[0]+u+v[1]}function d(e,t){if(_(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return y(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),L(r,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=v(n)?h(e,l.value,null):h(e,l.value,n-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function m(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function v(e){return null===e}function y(e){return"number"==typeof e}function b(e){return"string"==typeof e}function _(e){return void 0===e}function x(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function M(e){return w(e)&&"[object Date]"===E(e)}function S(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function T(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function C(e){return e<10?"0"+e.toString(10):e.toString(10)}n.debuglog=function(e){if(_(o)&&(o=""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var t=r.pid;s[e]=function(){var r=n.format.apply(n,arguments);console.error("%s %d: %s",e,t,r)}}else s[e]=function(){};return s[e]},n.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=m,n.isBoolean=g,n.isNull=v,n.isNullOrUndefined=function(e){return null==e},n.isNumber=y,n.isString=b,n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=_,n.isRegExp=x,n.isObject=w,n.isDate=M,n.isError=S,n.isFunction=T,n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var e=new Date,t=[C(e.getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n.log=function(){console.log("%s - %s",P(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}n.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),i=[],a=0;a".charCodeAt(0),o="-".charCodeAt(0),s="/".charCodeAt(0),l="!".charCodeAt(0),c="'".charCodeAt(0),u='"'.charCodeAt(0);function h(){for(var t=[];e[n];)if(e.charCodeAt(n)==i){if(e.charCodeAt(n+1)===s)return(n=e.indexOf(">",n))+1&&(n+=1),t;if(e.charCodeAt(n+1)===l){if(e.charCodeAt(n+2)==o){for(;-1!==n&&(e.charCodeAt(n)!==a||e.charCodeAt(n-1)!=o||e.charCodeAt(n-2)!=o||-1==n);)n=e.indexOf(">",n+1);-1===n&&(n=e.length)}else for(n+=2;e.charCodeAt(n)!==a&&e[n];)n++;n++;continue}var r=m();t.push(r)}else{var c=d();c.trim().length>0&&t.push(c),n++}return t}function d(){var t=n;return-2==(n=e.indexOf("<",n)-1)&&(n=e.length),e.slice(t,n+1)}function f(){for(var t=n;-1==="\n\t>/= ".indexOf(e[n])&&e[n];)n++;return e.slice(t,n)}var p=t.noChildNodes||["img","br","input","meta","link"];function m(){n++;const t=f(),r={};let i=[];for(;e.charCodeAt(n)!==a&&e[n];){var o=e.charCodeAt(n);if(o>64&&o<91||o>96&&o<123){for(var l=f(),d=e.charCodeAt(n);d&&d!==c&&d!==u&&!(d>64&&d<91||d>96&&d<123)&&d!==a;)n++,d=e.charCodeAt(n);if(d===c||d===u){var m=g();if(-1===n)return{tagName:t,attributes:r,children:i}}else m=null,n--;r[l]=m}n++}if(e.charCodeAt(n-1)!==s)if("script"==t){var v=n+1;n=e.indexOf("<\/script>",n),i=[e.slice(v,n-1)],n+=9}else"style"==t?(v=n+1,n=e.indexOf("",n),i=[e.slice(v,n-1)],n+=8):-1==p.indexOf(t)&&(n++,i=h());else n++;return{tagName:t,attributes:r,children:i}}function g(){var t=e[n],r=++n;return n=e.indexOf(t,r),e.slice(r,n)}var v,y=null;if(void 0!==t.attrValue)for(t.attrName=t.attrName||"id",y=[];-1!==(v=new RegExp("\\s"+t.attrName+"\\s*=['\"]"+t.attrValue+"['\"]").exec(e),n=v?v.index:-1);)-1!==(n=e.lastIndexOf("<",n))&&y.push(m()),e=e.substr(n),n=0;else y=t.parseNode?m():h();return t.filter&&(y=r.filter(y,t.filter)),t.setPos&&(y.pos=n),y}r.simplify=function(e){var t={};if(!e.length)return"";if(1===e.length&&"string"==typeof e[0])return e[0];for(var n in e.forEach((function(e){if("object"==typeof e){t[e.tagName]||(t[e.tagName]=[]);var n=r.simplify(e.children||[]);t[e.tagName].push(n),e.attributes&&(n._attributes=e.attributes)}})),t)1==t[n].length&&(t[n]=t[n][0]);return t},r.filter=function(e,t){var n=[];return e.forEach((function(e){if("object"==typeof e&&t(e)&&n.push(e),e.children){var i=r.filter(e.children,t);n=n.concat(i)}})),n},r.stringify=function(e){var t="";function n(e){if(e)for(var n=0;n"}return n(e),t},r.toContentString=function(e){if(Array.isArray(e)){var t="";return e.forEach((function(e){t=(t+=" "+r.toContentString(e)).trim()})),t}return"object"==typeof e?r.toContentString(e.children):" "+e},r.getElementById=function(e,t,n){var i=r(e,{attrValue:t});return n?r.simplify(i):i[0]},r.getElementsByClassName=function(e,t,n){const i=r(e,{attrName:"class",attrValue:"[a-zA-Z0-9-s ]*"+t+"[a-zA-Z0-9-s ]*"});return n?r.simplify(i):i},r.parseStream=function(t,n){if("string"==typeof n&&(n=n.length+2),"string"==typeof t){var i=e("fs");t=i.createReadStream(t,{start:n}),n=0}var a=n,o="";return t.on("data",(function(e){o+=e;for(var n=0;;){if(!(a=o.indexOf("<",a)+1))return void(a=n);if("/"!==o[a+1]){var i=r(o,{pos:a-1,parseNode:!0,setPos:!0});if((a=i.pos)>o.length-1||aa.length-1||i>24)/500+o,l=o-(e[i+2]<<24>>24)/200,c=void 0,u=void 0,h=void 0;u=-.9689*(s=.95047*(s*s*s>.008856?s*s*s:(s-16/116)/7.787))+1.8758*(o=1*(o*o*o>.008856?o*o*o:(o-16/116)/7.787))+.0415*(l=1.08883*(l*l*l>.008856?l*l*l:(l-16/116)/7.787)),h=.0557*s+-.204*o+1.057*l,c=(c=3.2406*s+-1.5372*o+-.4986*l)>.0031308?1.055*Math.pow(c,1/2.4)-.055:12.92*c,u=u>.0031308?1.055*Math.pow(u,1/2.4)-.055:12.92*u,h=h>.0031308?1.055*Math.pow(h,1/2.4)-.055:12.92*h,r[a]=255*Math.max(0,Math.min(1,c)),r[a+1]=255*Math.max(0,Math.min(1,u)),r[a+2]=255*Math.max(0,Math.min(1,h))}return r}},{}],IKSA:[function(e,t,n){"use strict";function r(e,t){var n=e.length-t,r=0;do{for(var i=t;i>0;i--)e[r+t]+=e[r],r++;n-=t}while(n>0)}function i(e,t,n){for(var r=0,i=e.length,a=i/n;i>t;){for(var o=t;o>0;--o)e[r+t]+=e[r],++r;i-=t}for(var s=e.slice(),l=0;l=e.byteLength);++h){var d=void 0;if(2===t){switch(o[0]){case 8:d=new Uint8Array(e,h*u*n*c,u*n*c);break;case 16:d=new Uint16Array(e,h*u*n*c,u*n*c/2);break;case 32:d=new Uint32Array(e,h*u*n*c,u*n*c/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(o[0]," bits per sample."))}r(d,u)}else 3===t&&i(d=new Uint8Array(e,h*u*n*c,u*n*c),u,c)}return e}},{}],FJDe:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(e("@babel/runtime/regenerator")),i=l(e("@babel/runtime/helpers/asyncToGenerator")),a=l(e("@babel/runtime/helpers/classCallCheck")),o=l(e("@babel/runtime/helpers/createClass")),s=e("../predictor");function l(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,[{key:"decode",value:function(){var e=(0,i.default)(r.default.mark((function e(t,n){var i,a,o,l,c;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decodeBlock(n);case 2:if(i=e.sent,1===(a=t.Predictor||1)){e.next=9;break}return o=!t.StripOffsets,l=o?t.TileWidth:t.ImageWidth,c=o?t.TileLength:t.RowsPerStrip||t.ImageLength,e.abrupt("return",(0,s.applyPredictor)(i,a,l,c,t.BitsPerSample,t.PlanarConfiguration));case 9:return e.abrupt("return",i);case 10:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()}]),e}();n.default=c},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","../predictor":"IKSA"}],V9bQ:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(e("@babel/runtime/helpers/classCallCheck")),i=l(e("@babel/runtime/helpers/createClass")),a=l(e("@babel/runtime/helpers/inherits")),o=l(e("@babel/runtime/helpers/possibleConstructorReturn")),s=l(e("@babel/runtime/helpers/getPrototypeOf"));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){(0,a.default)(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}(n);function n(){return(0,r.default)(this,n),t.apply(this,arguments)}return(0,i.default)(n,[{key:"decodeBlock",value:function(e){return e}}]),n}(l(e("./basedecoder")).default);n.default=c},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./basedecoder":"FJDe"}],tcId:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(e("@babel/runtime/helpers/classCallCheck")),i=l(e("@babel/runtime/helpers/createClass")),a=l(e("@babel/runtime/helpers/inherits")),o=l(e("@babel/runtime/helpers/possibleConstructorReturn")),s=l(e("@babel/runtime/helpers/getPrototypeOf"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){for(var n=t.length-1;n>=0;n--)e.push(t[n]);return e}var u=function(e){(0,a.default)(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}(n);function n(){return(0,r.default)(this,n),t.apply(this,arguments)}return(0,i.default)(n,[{key:"decodeBlock",value:function(e){return function(e){for(var t=new Uint16Array(4093),n=new Uint8Array(4093),r=0;r<=257;r++)t[r]=4096,n[r]=r;var i=258,a=9,o=0;function s(){i=258,a=9}function l(e){var t=function(e,t,n){var r=t%8,i=Math.floor(t/8),a=8-r,o=t+n-8*(i+1),s=8*(i+2)-(t+n),l=8*(i+2)-t;if(s=Math.max(0,s),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var c=e[i]&Math.pow(2,8-r)-1,u=c<<=n-a;if(i+1>>s;u+=h<<=Math.max(0,n-l)}if(o>8&&i+2>>d}return u}(e,o,a);return o+=a,t}function u(e,r){return n[i]=r,t[i]=e,++i-1}function h(e){for(var r=[],i=e;4096!==i;i=t[i])r.push(n[i]);return r}var d=[];s();for(var f,p=new Uint8Array(e),m=l(p);257!==m;){if(256===m){for(s(),m=l(p);256===m;)m=l(p);if(257===m)break;if(m>256)throw new Error("corrupted code at scanline ".concat(m));c(d,h(m)),f=m}else if(m=Math.pow(2,a)&&(12===a?f=void 0:a++),m=l(p)}return new Uint8Array(d)}(e).buffer}}]),n}(l(e("./basedecoder")).default);n.default=u},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./basedecoder":"FJDe"}],J7kk:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=u(e("@babel/runtime/helpers/inherits")),i=u(e("@babel/runtime/helpers/possibleConstructorReturn")),a=u(e("@babel/runtime/helpers/getPrototypeOf")),o=u(e("@babel/runtime/helpers/classCallCheck")),s=u(e("@babel/runtime/helpers/createClass")),l=u(e("@babel/runtime/helpers/typeof")),c=u(e("./basedecoder"));function u(e){return e&&e.__esModule?e:{default:e}}var h=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),d=4017,f=799,p=3406,m=2276,g=1567,v=3784,y=5793,b=2896;function _(e,t){for(var n=0,r=[],i=16;i>0&&!e[i-1];)--i;r.push({children:[],index:0});for(var a,o=r[0],s=0;s0;)o=r.pop();for(o.index++,r.push(o);r.length<=s;)r.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a;n++}s+10)return m>>--g&1;if(255===(m=e[p++])){var t=e[p++];if(t)throw new Error("unexpected marker: ".concat((m<<8|t).toString(16)))}return g=7,m>>>7}function y(e){for(var t,n=e;null!==(t=v());){if("number"==typeof(n=n[t]))return n;if("object"!==(0,l.default)(n))throw new Error("invalid huffman sequence")}return null}function b(e){for(var t=e,n=0;t>0;){var r=v();if(null===r)return;n=n<<1|r,--t}return n}function _(e){var t=b(e);return t>=1<0)w--;else for(var n=a,r=o;n<=r;){var i=y(e.huffmanTableAC),s=15&i,l=i>>4;if(0===s){if(l<15){w=b(l)+(1<>4,0===d)i<15?(w=b(i)+(1<>4;if(0===o){if(s<15)break;i+=16}else t[h[i+=s]]=_(o),i++}};var k,I,N=0;I=1===O?r[0].blocksPerLine*r[0].blocksPerColumn:u*n.mcusPerColumn;for(var D=i||I;N=65488&&k<=65495))break;p+=2}return p-f}function w(e,t){var n=[],r=t.blocksPerLine,i=t.blocksPerColumn,a=r<<3,o=new Int32Array(64),s=new Uint8Array(64);function l(e,n,r){var i,a,o,s,l,c,u,h,_,x,w=t.quantizationTable,M=r;for(x=0;x<64;x++)M[x]=e[x]*w[x];for(x=0;x<8;++x){var S=8*x;0!==M[1+S]||0!==M[2+S]||0!==M[3+S]||0!==M[4+S]||0!==M[5+S]||0!==M[6+S]||0!==M[7+S]?(i=y*M[0+S]+128>>8,a=y*M[4+S]+128>>8,o=M[2+S],s=M[6+S],l=b*(M[1+S]-M[7+S])+128>>8,h=b*(M[1+S]+M[7+S])+128>>8,c=M[3+S]<<4,u=M[5+S]<<4,_=i-a+1>>1,i=i+a+1>>1,a=_,_=o*v+s*g+128>>8,o=o*g-s*v+128>>8,s=_,_=l-u+1>>1,l=l+u+1>>1,u=_,_=h+c+1>>1,c=h-c+1>>1,h=_,_=i-s+1>>1,i=i+s+1>>1,s=_,_=a-o+1>>1,a=a+o+1>>1,o=_,_=l*m+h*p+2048>>12,l=l*p-h*m+2048>>12,h=_,_=c*f+u*d+2048>>12,c=c*d-u*f+2048>>12,u=_,M[0+S]=i+h,M[7+S]=i-h,M[1+S]=a+u,M[6+S]=a-u,M[2+S]=o+c,M[5+S]=o-c,M[3+S]=s+l,M[4+S]=s-l):(_=y*M[0+S]+512>>10,M[0+S]=_,M[1+S]=_,M[2+S]=_,M[3+S]=_,M[4+S]=_,M[5+S]=_,M[6+S]=_,M[7+S]=_)}for(x=0;x<8;++x){var T=x;0!==M[8+T]||0!==M[16+T]||0!==M[24+T]||0!==M[32+T]||0!==M[40+T]||0!==M[48+T]||0!==M[56+T]?(i=y*M[0+T]+2048>>12,a=y*M[32+T]+2048>>12,o=M[16+T],s=M[48+T],l=b*(M[8+T]-M[56+T])+2048>>12,h=b*(M[8+T]+M[56+T])+2048>>12,c=M[24+T],u=M[40+T],_=i-a+1>>1,i=i+a+1>>1,a=_,_=o*v+s*g+2048>>12,o=o*g-s*v+2048>>12,s=_,_=l-u+1>>1,l=l+u+1>>1,u=_,_=h+c+1>>1,c=h-c+1>>1,h=_,_=i-s+1>>1,i=i+s+1>>1,s=_,_=a-o+1>>1,a=a+o+1>>1,o=_,_=l*m+h*p+2048>>12,l=l*p-h*m+2048>>12,h=_,_=c*f+u*d+2048>>12,c=c*d-u*f+2048>>12,u=_,M[0+T]=i+h,M[56+T]=i-h,M[8+T]=a+u,M[48+T]=a-u,M[16+T]=o+c,M[40+T]=o-c,M[24+T]=s+l,M[32+T]=s-l):(_=y*r[x+0]+8192>>14,M[0+T]=_,M[8+T]=_,M[16+T]=_,M[24+T]=_,M[32+T]=_,M[40+T]=_,M[48+T]=_,M[56+T]=_)}for(x=0;x<64;++x){var E=128+(M[x]+8>>4);n[x]=E<0?0:E>255?255:E}}for(var c=0;c>4==0)for(var d=0;d<64;d++)u[h[d]]=e[t++];else{if(c>>4!=1)throw new Error("DQT: invalid table spec");for(var f=0;f<64;f++)u[h[f]]=n()}this.quantizationTables[15&c]=u}break;case 65472:case 65473:case 65474:n();for(var p={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:n(),samplesPerLine:n(),components:{},componentsOrder:[]},m=e[t++],g=void 0,v=0;v>4,b=15&e[t+1],w=e[t+2];p.componentsOrder.push(g),p.components[g]={h:y,v:b,quantizationIdx:w},t+=3}r(p),this.frames.push(p);break;case 65476:for(var M=n(),S=2;S>4==0?this.huffmanTablesDC[15&T]=_(E,P):this.huffmanTablesAC[15&T]=_(E,P)}break;case 65501:n(),this.resetInterval=n();break;case 65498:n();for(var R=e[t++],O=[],k=this.frames[0],I=0;I>4],N.huffmanTableAC=this.huffmanTablesAC[15&D],O.push(N)}var j=e[t++],F=e[t++],z=e[t++],B=x(e,t,k,O,this.resetInterval,j,F,z>>4,15&z);t+=B;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker ".concat(o.toString(16)))}o=n()}}},{key:"getResult",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var t=0;t>>16&65535|0,o=0;0!==n;){n-=o=n>2e3?2e3:n;do{a=a+(i=i+t[r++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}},{}],X4kj:[function(e,t,n){"use strict";var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},{}],LP5M:[function(e,t,n){"use strict";t.exports=function(e,t){var n,r,i,a,o,s,l,c,u,h,d,f,p,m,g,v,y,b,_,x,w,M,S,T,E;n=e.state,r=e.next_in,T=e.input,i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),l=n.dmax,c=n.wsize,u=n.whave,h=n.wnext,d=n.window,f=n.hold,p=n.bits,m=n.lencode,g=n.distcode,v=(1<>>=_=b>>>24,p-=_,0==(_=b>>>16&255))E[a++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=m[(65535&b)+(f&(1<<_)-1)];continue t}if(32&_){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}x=65535&b,(_&=15)&&(p<_&&(f+=T[r++]<>>=_,p-=_),p<15&&(f+=T[r++]<>>=_=b>>>24,p-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=g[(65535&b)+(f&(1<<_)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(w=65535&b,p<(_&=15)&&(f+=T[r++]<l){e.msg="invalid distance too far back",n.mode=30;break e}if(f>>>=_,p-=_,w>(_=a-o)){if((_=w-_)>u&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(M=0,S=d,0===h){if(M+=c-_,_2;)E[a++]=S[M++],E[a++]=S[M++],E[a++]=S[M++],x-=3;x&&(E[a++]=S[M++],x>1&&(E[a++]=S[M++]))}else{M=a-w;do{E[a++]=E[M++],E[a++]=E[M++],E[a++]=E[M++],x-=3}while(x>2);x&&(E[a++]=E[M++],x>1&&(E[a++]=E[M++]))}break}}break}}while(r>3,f&=(1<<(p-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r=1&&0===N[E];E--);if(C>E&&(C=E),0===E)return c[u++]=20971520,c[u++]=20971520,d.bits=1,0;for(T=1;T0&&(0===e||1!==E))return-1;for(D[1]=0,M=1;M<15;M++)D[M+1]=D[M]+N[M];for(S=0;S852||2===e&&R>592)return 1;for(;;){b=M-P,h[S]y?(_=j[F+h[S]],x=k[I+h[S]]):(_=96,x=0),f=1<>P)+(p-=f)]=b<<24|_<<16|x|0}while(0!==p);for(f=1<>=1;if(0!==f?(O&=f-1,O+=f):O=0,S++,0==--N[M]){if(M===E)break;M=t[n+h[S]]}if(M>C&&(O&g)!==m){for(0===P&&(P=C),v+=T,L=1<<(A=M-P);A+P852||2===e&&R>592)return 1;c[m=O&g]=C<<24|A<<16|v-u|0}}return 0!==O&&(c[v+O]=M-P<<24|64<<16|0),d.bits=C,0}},{"../utils/common":"tbG5"}],GIDK:[function(e,t,n){"use strict";var r=e("../utils/common"),i=e("./adler32"),a=e("./crc32"),o=e("./inffast"),s=e("./inftrees"),l=-2,c=12,u=30;function h(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function d(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):l}function p(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,f(e)):l}function m(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?l:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,p(e))):l}function g(e,t){var n,r;return e?(r=new d,e.state=r,r.window=null,0!==(n=m(e,t))&&(e.state=null),n):l}var v,y,b=!0;function _(e){if(b){var t;for(v=new r.Buf32(512),y=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,v,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,y,0,e.work,{bits:5}),b=!1}e.lencode=v,e.lenbits=9,e.distcode=y,e.distbits=5}function x(e,t,n,i){var a,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,F,2,0),y=0,b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&y)<<8)+(y>>8))%31){e.msg="incorrect header check",n.mode=u;break}if(8!=(15&y)){e.msg="unknown compression method",n.mode=u;break}if(b-=4,k=8+(15&(y>>>=4)),0===n.wbits)n.wbits=k;else if(k>n.wbits){e.msg="invalid window size",n.mode=u;break}n.dmax=1<>8&1),512&n.flags&&(F[0]=255&y,F[1]=y>>>8&255,n.check=a(n.check,F,2,0)),y=0,b=0,n.mode=3;case 3:for(;b<32;){if(0===g)break e;g--,y+=d[p++]<>>8&255,F[2]=y>>>16&255,F[3]=y>>>24&255,n.check=a(n.check,F,4,0)),y=0,b=0,n.mode=4;case 4:for(;b<16;){if(0===g)break e;g--,y+=d[p++]<>8),512&n.flags&&(F[0]=255&y,F[1]=y>>>8&255,n.check=a(n.check,F,2,0)),y=0,b=0,n.mode=5;case 5:if(1024&n.flags){for(;b<16;){if(0===g)break e;g--,y+=d[p++]<>>8&255,n.check=a(n.check,F,2,0)),y=0,b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((S=n.length)>g&&(S=g),S&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,d,p,S,k)),512&n.flags&&(n.check=a(n.check,d,S,p)),g-=S,p+=S,n.length-=S),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===g)break e;S=0;do{k=d[p+S++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k))}while(k&&S>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=c;break;case 10:for(;b<32;){if(0===g)break e;g--,y+=d[p++]<>>=7&b,b-=7&b,n.mode=27;break}for(;b<3;){if(0===g)break e;g--,y+=d[p++]<>>=1)){case 0:n.mode=14;break;case 1:if(_(n),n.mode=20,6===t){y>>>=2,b-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=u}y>>>=2,b-=2;break;case 14:for(y>>>=7&b,b-=7&b;b<32;){if(0===g)break e;g--,y+=d[p++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=u;break}if(n.length=65535&y,y=0,b=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(S=n.length){if(S>g&&(S=g),S>v&&(S=v),0===S)break e;r.arraySet(f,d,p,S,m),g-=S,p+=S,v-=S,m+=S,n.length-=S;break}n.mode=c;break;case 17:for(;b<14;){if(0===g)break e;g--,y+=d[p++]<>>=5,b-=5,n.ndist=1+(31&y),y>>>=5,b-=5,n.ncode=4+(15&y),y>>>=4,b-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=u;break}n.have=0,n.mode=18;case 18:for(;n.have>>=3,b-=3}for(;n.have<19;)n.lens[z[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,N={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,N),n.lenbits=N.bits,I){e.msg="invalid code lengths set",n.mode=u;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,P=65535&j,!((C=j>>>24)<=b);){if(0===g)break e;g--,y+=d[p++]<>>=C,b-=C,n.lens[n.have++]=P;else{if(16===P){for(D=C+2;b>>=C,b-=C,0===n.have){e.msg="invalid bit length repeat",n.mode=u;break}k=n.lens[n.have-1],S=3+(3&y),y>>>=2,b-=2}else if(17===P){for(D=C+3;b>>=C)),y>>>=3,b-=3}else{for(D=C+7;b>>=C)),y>>>=7,b-=7}if(n.have+S>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=u;break}for(;S--;)n.lens[n.have++]=k}}if(n.mode===u)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=u;break}if(n.lenbits=9,N={bits:n.lenbits},I=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,N),n.lenbits=N.bits,I){e.msg="invalid literal/lengths set",n.mode=u;break}if(n.distbits=6,n.distcode=n.distdyn,N={bits:n.distbits},I=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,N),n.distbits=N.bits,I){e.msg="invalid distances set",n.mode=u;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(g>=6&&v>=258){e.next_out=m,e.avail_out=v,e.next_in=p,e.avail_in=g,n.hold=y,n.bits=b,o(e,M),m=e.next_out,f=e.output,v=e.avail_out,p=e.next_in,d=e.input,g=e.avail_in,y=n.hold,b=n.bits,n.mode===c&&(n.back=-1);break}for(n.back=0;A=(j=n.lencode[y&(1<>>16&255,P=65535&j,!((C=j>>>24)<=b);){if(0===g)break e;g--,y+=d[p++]<>L)])>>>16&255,P=65535&j,!(L+(C=j>>>24)<=b);){if(0===g)break e;g--,y+=d[p++]<>>=L,b-=L,n.back+=L}if(y>>>=C,b-=C,n.back+=C,n.length=P,0===A){n.mode=26;break}if(32&A){n.back=-1,n.mode=c;break}if(64&A){e.msg="invalid literal/length code",n.mode=u;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(D=n.extra;b>>=n.extra,b-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(j=n.distcode[y&(1<>>16&255,P=65535&j,!((C=j>>>24)<=b);){if(0===g)break e;g--,y+=d[p++]<>L)])>>>16&255,P=65535&j,!(L+(C=j>>>24)<=b);){if(0===g)break e;g--,y+=d[p++]<>>=L,b-=L,n.back+=L}if(y>>>=C,b-=C,n.back+=C,64&A){e.msg="invalid distance code",n.mode=u;break}n.offset=P,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(D=n.extra;b>>=n.extra,b-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=u;break}n.mode=25;case 25:if(0===v)break e;if(S=M-v,n.offset>S){if((S=n.offset-S)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=u;break}S>n.wnext?(S-=n.wnext,T=n.wsize-S):T=n.wnext-S,S>n.length&&(S=n.length),E=n.window}else E=f,T=m-n.offset,S=n.length;S>v&&(S=v),v-=S,n.length-=S;do{f[m++]=E[T++]}while(--S);0===n.length&&(n.mode=21);break;case 26:if(0===v)break e;f[m++]=n.length,v--,n.mode=21;break;case 27:if(n.wrap){for(;b<32;){if(0===g)break e;g--,y|=d[p++]<=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",o=0;o>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n4)c[r++]=65533,n+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&n1?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return l(c,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+o[e[n]]>t?n:t}},{"./common":"tbG5"}],xUUw:[function(e,t,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],gMAY:[function(e,t,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],bdtv:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],WIli:[function(e,t,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],faQk:[function(e,t,n){"use strict";var r=e("./zlib/inflate"),i=e("./utils/common"),a=e("./utils/strings"),o=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),u=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==o.Z_OK)throw new Error(s[n]);if(this.header=new c,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[n])}function d(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}h.prototype.push=function(e,t){var n,s,l,c,h,d=this.strm,f=this.options.chunkSize,p=this.options.dictionary,m=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?d.input=a.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(f),d.next_out=0,d.avail_out=f),(n=r.inflate(d,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(n=r.inflateSetDictionary(this.strm,p)),n===o.Z_BUF_ERROR&&!0===m&&(n=o.Z_OK,m=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&n!==o.Z_STREAM_END&&(0!==d.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=a.utf8border(d.output,d.next_out),c=d.next_out-l,h=a.buf2string(d.output,l),d.next_out=c,d.avail_out=f-c,c&&i.arraySet(d.output,d.output,l,c,0),this.onData(h)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),d.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=h,n.inflate=d,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},n.ungzip=d},{"./zlib/inflate":"GIDK","./utils/common":"tbG5","./utils/strings":"Q3ZD","./zlib/constants":"xUUw","./zlib/messages":"gMAY","./zlib/zstream":"bdtv","./zlib/gzheader":"WIli"}],JAiC:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=c(e("@babel/runtime/helpers/classCallCheck")),i=c(e("@babel/runtime/helpers/createClass")),a=c(e("@babel/runtime/helpers/inherits")),o=c(e("@babel/runtime/helpers/possibleConstructorReturn")),s=c(e("@babel/runtime/helpers/getPrototypeOf")),l=e("pako/lib/inflate");function c(e){return e&&e.__esModule?e:{default:e}}var u=function(e){(0,a.default)(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}(n);function n(){return(0,r.default)(this,n),t.apply(this,arguments)}return(0,i.default)(n,[{key:"decodeBlock",value:function(e){return(0,l.inflate)(new Uint8Array(e)).buffer}}]),n}(c(e("./basedecoder")).default);n.default=u},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","pako/lib/inflate":"faQk","./basedecoder":"FJDe"}],OcPz:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(e("@babel/runtime/helpers/classCallCheck")),i=l(e("@babel/runtime/helpers/createClass")),a=l(e("@babel/runtime/helpers/inherits")),o=l(e("@babel/runtime/helpers/possibleConstructorReturn")),s=l(e("@babel/runtime/helpers/getPrototypeOf"));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){(0,a.default)(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}(n);function n(){return(0,r.default)(this,n),t.apply(this,arguments)}return(0,i.default)(n,[{key:"decodeBlock",value:function(e){for(var t=new DataView(e),n=[],r=0;r3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(e).constructor)(t*n*r)}function i(e,t,n,i,a){var o=t/i,s=n/a;return e.map((function(e){for(var l=r(e,i,a),c=0;c5&&void 0!==arguments[5]?arguments[5]:"nearest";switch(s.toLowerCase()){case"nearest":return i(e,t,n,r,a);case"bilinear":case"linear":return o(e,t,n,r,a);default:throw new Error("Unsupported resampling method: '".concat(s,"'"))}},n.resampleNearestInterleaved=s,n.resampleBilinearInterleaved=l,n.resampleInterleaved=function(e,t,n,r,i,a){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"nearest";switch(o.toLowerCase()){case"nearest":return s(e,t,n,r,i,a);case"bilinear":case"linear":return l(e,t,n,r,i,a);default:throw new Error("Unsupported resampling method: '".concat(o,"'"))}}},{}],eOWo:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=p(e("@babel/runtime/helpers/slicedToArray")),i=p(e("@babel/runtime/regenerator")),a=p(e("@babel/runtime/helpers/asyncToGenerator")),o=p(e("@babel/runtime/helpers/classCallCheck")),s=p(e("@babel/runtime/helpers/createClass")),l=e("@petamoriken/float16"),c=p(e("txml")),u=e("./globals"),h=e("./rgb"),d=e("./compression"),f=e("./resample");function p(e){return e&&e.__esModule?e:{default:e}}function m(e,t,n){for(var r=0,i=t;i>8-i-x&u;else if(x+i<=16)c[b]=s.getUint16(_)>>16-i-x&u;else if(x+i<=24){var w=s.getUint16(_)<<8|s.getUint8(_+2);c[b]=w>>24-i-x&u}else c[b]=s.getUint32(_)>>32-i-x&u}}return c.buffer}var b=function(){function e(t,n,r,i,a,s){(0,o.default)(this,e),this.fileDirectory=t,this.geoKeys=n,this.dataView=r,this.littleEndian=i,this.tiles=a?{}:null,this.isTiled=!t.StripOffsets;var l=t.PlanarConfiguration;if(this.planarConfiguration=void 0===l?1:l,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=s}return(0,s.default)(e,[{key:"getFileDirectory",value:function(){return this.fileDirectory}},{key:"getGeoKeys",value:function(){return this.geoKeys}},{key:"getWidth",value:function(){return this.fileDirectory.ImageWidth}},{key:"getHeight",value:function(){return this.fileDirectory.ImageLength}},{key:"getSamplesPerPixel",value:function(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}},{key:"getTileWidth",value:function(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}},{key:"getTileHeight",value:function(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}},{key:"getBlockWidth",value:function(){return this.getTileWidth()}},{key:"getBlockHeight",value:function(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}},{key:"getBytesPerPixel",value:function(){for(var e=0,t=0;t=this.fileDirectory.BitsPerSample.length)throw new RangeError("Sample index ".concat(e," is out of range."));return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}},{key:"getReaderForSample",value:function(e){var t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,n=this.fileDirectory.BitsPerSample[e];switch(t){case 1:if(n<=8)return DataView.prototype.getUint8;if(n<=16)return DataView.prototype.getUint16;if(n<=32)return DataView.prototype.getUint32;break;case 2:if(n<=8)return DataView.prototype.getInt8;if(n<=16)return DataView.prototype.getInt16;if(n<=32)return DataView.prototype.getInt32;break;case 3:switch(n){case 16:return function(e,t){return(0,l.getFloat16)(this,e,t)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}},{key:"getSampleFormat",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}},{key:"getBitsPerSample",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.BitsPerSample[e]}},{key:"getArrayForSample",value:function(e,t){return g(this.getSampleFormat(e),this.getBitsPerSample(e),t)}},{key:"getTileOrStrip",value:function(){var e=(0,a.default)(i.default.mark((function e(t,n,r,o,s){var l,c,u,h,d,f,p,m,g=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=Math.ceil(this.getWidth()/this.getTileWidth()),c=Math.ceil(this.getHeight()/this.getTileHeight()),h=this.tiles,1===this.planarConfiguration?u=n*l+t:2===this.planarConfiguration&&(u=r*l*c+n*l+t),this.isTiled?(d=this.fileDirectory.TileOffsets[u],f=this.fileDirectory.TileByteCounts[u]):(d=this.fileDirectory.StripOffsets[u],f=this.fileDirectory.StripByteCounts[u]),e.next=7,this.source.fetch([{offset:d,length:f}],s);case 7:return p=e.sent[0],null!==h&&h[u]?m=h[u]:(m=(0,a.default)(i.default.mark((function e(){var t,r,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.decode(g.fileDirectory,p);case 2:return t=e.sent,r=g.getSampleFormat(),a=g.getBitsPerSample(),v(r,a)&&(t=y(t,r,g.planarConfiguration,g.getSamplesPerPixel(),a,g.getTileWidth(),g.getBlockHeight(n))),e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})))(),null!==h&&(h[u]=m)),e.t0=t,e.t1=n,e.t2=r,e.next=14,m;case 14:return e.t3=e.sent,e.abrupt("return",{x:e.t0,y:e.t1,sample:e.t2,data:e.t3});case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,a){return e.apply(this,arguments)}}()},{key:"_readRaster",value:function(){var e=(0,a.default)(i.default.mark((function e(t,n,r,a,o,s,l,c,u){var h,d,p,g,v,y,b,_,x,w,M,S,T,E,C,A,P,L,R=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(h=this.getTileWidth(),d=this.getTileHeight(),p=Math.max(Math.floor(t[0]/h),0),g=Math.min(Math.ceil(t[2]/h),Math.ceil(this.getWidth()/this.getTileWidth())),v=Math.max(Math.floor(t[1]/d),0),y=Math.min(Math.ceil(t[3]/d),Math.ceil(this.getHeight()/this.getTileHeight())),b=t[2]-t[0],_=this.getBytesPerPixel(),x=[],w=[],M=0;M0&&void 0!==L[0]?L[0]:{},n=t.window,r=t.samples,a=void 0===r?[]:r,o=t.interleave,s=t.pool,l=void 0===s?null:s,c=t.width,u=t.height,h=t.resampleMethod,f=t.fillValue,p=t.signal,!((m=n||[0,0,this.getWidth(),this.getHeight()])[0]>m[2]||m[1]>m[3])){e.next=4;break}throw new Error("Invalid subsets");case 4:if(v=m[2]-m[0],y=m[3]-m[1],b=v*y,_=this.getSamplesPerPixel(),a&&a.length){e.next=12;break}for(x=0;x<_;++x)a.push(x);e.next=19;break;case 12:w=0;case 13:if(!(w=_)){e.next=16;break}return e.abrupt("return",Promise.reject(new RangeError("Invalid sample index '".concat(a[w],"'."))));case 16:++w,e.next=13;break;case 19:if(o)S=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,T=Math.max.apply(null,this.fileDirectory.BitsPerSample),M=g(S,T,b*a.length),f&&M.fill(f);else for(M=[],E=0;E0&&void 0!==S[0]?S[0]:{},n=t.window,r=t.pool,a=void 0===r?null:r,o=t.width,s=t.height,l=t.resampleMethod,c=t.enableAlpha,d=void 0!==c&&c,f=t.signal,!((p=n||[0,0,this.getWidth(),this.getHeight()])[0]>p[2]||p[1]>p[3])){e.next=4;break}throw new Error("Invalid subsets");case 4:if((m=this.fileDirectory.PhotometricInterpretation)!==u.photometricInterpretations.RGB){e.next=9;break}if(g=[0,1,2],this.fileDirectory.ExtraSamples!==u.ExtraSamplesValues.Unspecified&&d)for(g=[],v=0;v0&&void 0!==arguments[0]?arguments[0]:null,t={};if(!this.fileDirectory.GDAL_METADATA)return null;var n=this.fileDirectory.GDAL_METADATA,r=(0,c.default)(n.substring(0,n.length-1));if(!r[0].tagName)throw new Error("Failed to parse GDAL metadata XML.");var i=r[0];if("GDALMetadata"!==i.tagName)throw new Error("Unexpected GDAL metadata XML tag.");var a=i.children.filter((function(e){return"Item"===e.tagName}));null!==e&&(a=a.filter((function(t){return Number(t.attributes.sample)===e})));for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:null,t=this.fileDirectory.ModelPixelScale,n=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(n)return[n[0],n[5],n[10]];if(e){var i=e.getResolution(),a=(0,r.default)(i,3),o=a[0],s=a[1],l=a[2];return[o*e.getWidth()/this.getWidth(),s*e.getHeight()/this.getHeight(),l*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}},{key:"pixelIsArea",value:function(){return 1===this.geoKeys.GTRasterTypeGeoKey}},{key:"getBoundingBox",value:function(){var e=this.getOrigin(),t=this.getResolution(),n=e[0],r=e[1],i=n+t[0]*this.getWidth(),a=r+t[1]*this.getHeight();return[Math.min(n,i),Math.min(r,a),Math.max(n,i),Math.max(r,a)]}}]),e}();n.default=b},{"@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@petamoriken/float16":"Stm8",txml:"JO74","./globals":"j27V","./rgb":"fpBl","./compression":"FGCZ","./resample":"OQju"}],dqpX:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("@babel/runtime/helpers/classCallCheck")),i=o(e("@babel/runtime/helpers/createClass")),a=e("@petamoriken/float16");function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){(0,r.default)(this,e),this._dataView=new DataView(t)}return(0,i.default)(e,[{key:"getUint64",value:function(e,t){var n,r=this.getUint32(e,t),i=this.getUint32(e+4,t);if(t){if(n=r+Math.pow(2,32)*i,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return n}if(n=Math.pow(2,32)*r+i,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return n}},{key:"getInt64",value:function(e,t){for(var n=0,r=(128&this._dataView.getUint8(e+(t?7:0)))>0,i=!0,a=0;a<8;a++){var o=this._dataView.getUint8(e+(t?a:7-a));r&&(i?0!==o&&(o=255&~(o-1),i=!1):o=255&~o),n+=o*Math.pow(256,a)}return r&&(n=-n),n}},{key:"getUint8",value:function(e,t){return this._dataView.getUint8(e,t)}},{key:"getInt8",value:function(e,t){return this._dataView.getInt8(e,t)}},{key:"getUint16",value:function(e,t){return this._dataView.getUint16(e,t)}},{key:"getInt16",value:function(e,t){return this._dataView.getInt16(e,t)}},{key:"getUint32",value:function(e,t){return this._dataView.getUint32(e,t)}},{key:"getInt32",value:function(e,t){return this._dataView.getInt32(e,t)}},{key:"getFloat16",value:function(e,t){return(0,a.getFloat16)(this._dataView,t)}},{key:"getFloat32",value:function(e,t){return this._dataView.getFloat32(e,t)}},{key:"getFloat64",value:function(e,t){return this._dataView.getFloat64(e,t)}},{key:"buffer",get:function(){return this._dataView.buffer}}]),e}();n.default=s},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@petamoriken/float16":"Stm8"}],dGLV:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(e("@babel/runtime/helpers/classCallCheck")),i=a(e("@babel/runtime/helpers/createClass"));function a(e){return e&&e.__esModule?e:{default:e}}var o=function(){function e(t,n,i,a){(0,r.default)(this,e),this._dataView=new DataView(t),this._sliceOffset=n,this._littleEndian=i,this._bigTiff=a}return(0,i.default)(e,[{key:"covers",value:function(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}},{key:"readUint8",value:function(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}},{key:"readInt8",value:function(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}},{key:"readUint16",value:function(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}},{key:"readInt16",value:function(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}},{key:"readUint32",value:function(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}},{key:"readInt32",value:function(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}},{key:"readFloat32",value:function(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}},{key:"readFloat64",value:function(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}},{key:"readUint64",value:function(e){var t,n=this.readUint32(e),r=this.readUint32(e+4);if(this._littleEndian){if(t=n+Math.pow(2,32)*r,!Number.isSafeInteger(t))throw new Error("".concat(t," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return t}if(t=Math.pow(2,32)*n+r,!Number.isSafeInteger(t))throw new Error("".concat(t," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return t}},{key:"readInt64",value:function(e){for(var t=0,n=(128&this._dataView.getUint8(e+(this._littleEndian?7:0)))>0,r=!0,i=0;i<8;i++){var a=this._dataView.getUint8(e+(this._littleEndian?i:7-i));n&&(r?0!==a&&(a=255&~(a-1),r=!1):a=255&~a),t+=a*Math.pow(256,i)}return n&&(t=-t),t}},{key:"readOffset",value:function(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}},{key:"sliceOffset",get:function(){return this._sliceOffset}},{key:"sliceTop",get:function(){return this._sliceOffset+this.buffer.byteLength}},{key:"littleEndian",get:function(){return this._littleEndian}},{key:"bigTiff",get:function(){return this._bigTiff}},{key:"buffer",get:function(){return this._dataView.buffer}}]),e}();n.default=o},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW"}],z2GM:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.extendSerializer=function(e,t){const n=e.deserialize.bind(e),r=e.serialize.bind(e);return{deserialize:e=>t.deserialize(e,n),serialize:e=>t.serialize(e,r)}},n.DefaultSerializer=void 0;const r={deserialize:e=>(e=>e&&"object"==typeof e&&"__error_marker"in e&&"$$error"===e.__error_marker)(e)?(e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}))(e):e,serialize:e=>e instanceof Error?(e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack}))(e):e};n.DefaultSerializer=r},{}],kdjL:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.registerSerializer=function(e){i=(0,r.extendSerializer)(i,e)},n.deserialize=function(e){return i.deserialize(e)},n.serialize=function(e){return i.serialize(e)};var r=e("./serializers");let i=r.DefaultSerializer},{"./serializers":"z2GM"}],LQHy:[function(e,t,n){"use strict";let r;function i(e){return(""+e).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}Object.defineProperty(n,"__esModule",{value:!0}),n.getBaseURL=i,n.getBundleURL=function(){return r||(r=function(){try{throw new Error}catch(e){const t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return i(t[0])}return"/"}()),r}},{}],XK2w:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.selectWorkerImplementation=function(){return"undefined"==typeof Worker?class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}}:class extends Worker{constructor(e,t){"string"==typeof e&&t&&t._baseURL?e=new URL(e,t._baseURL):"string"==typeof e&&!a(e)&&(0,r.getBundleURL)().match(/^file:\/\//i)&&(e=new URL(e,(0,r.getBundleURL)().replace(/\/[^\/]+$/,"/")),e=o(`importScripts(${JSON.stringify(e)});`)),"string"==typeof e&&a(e)&&(e=o(`importScripts(${JSON.stringify(e)});`)),super(e,t)}}},n.defaultPoolSize=void 0;var r=e("./get-bundle-url.browser");const i="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;n.defaultPoolSize=i;const a=e=>/^(file|https?:)?\/\//i.test(e);function o(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}},{"./get-bundle-url.browser":"LQHy"}],IAgR:[function(e,t,n){var r=1e3,i=6e4,a=60*i,o=24*a;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}t.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return 6048e5*n;case"days":case"day":case"d":return n*o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*a;case"minutes":case"minute":case"mins":case"min":case"m":return n*i;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=o?s(e,t,o,"day"):t>=a?s(e,t,a,"hour"):t>=i?s(e,t,i,"minute"):t>=r?s(e,t,r,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=o?Math.round(e/o)+"d":t>=a?Math.round(e/a)+"h":t>=i?Math.round(e/i)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],Kest:[function(e,t,n){t.exports=function(t){function n(e){let t=0;for(let n=0;n{if("%%"===t)return t;s++;const a=r.formatters[i];if("function"==typeof a){const r=e[s];t=a.call(n,r),e.splice(s,1),s--}return t}),r.formatArgs.call(n,e),(n.log||r.log).apply(n,e)}return o.namespace=e,o.enabled=r.enabled(e),o.useColors=r.useColors(),o.color=n(e),o.destroy=i,o.extend=a,"function"==typeof r.init&&r.init(o),r.instances.push(o),o}function i(){const e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function a(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(o),...r.skips.map(o).map(e=>"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){let t;r.save(e),r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(t=0;t{r[e]=t[e]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=n,r.enable(r.load()),r}},{ms:"IAgR"}],jcLW:[function(e,t,n){e("process");var r=e("process");n.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},n.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))}),e.splice(i,0,n)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=void 0),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=e("./common")(n);const{formatters:i}=t.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},{"./common":"Kest",process:"pBGv"}],sfrJ:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.AsyncSerialScheduler=void 0,n.AsyncSerialScheduler=class{constructor(e){this._baseObserver=e,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then(()=>this._baseObserver.complete()).catch(e=>this._baseObserver.error(e))}error(e){this._baseObserver.error(e)}schedule(e){const t=Promise.all(this._pendingPromises),n=[],r=e=>n.push(e),i=Promise.resolve().then(()=>function(e,t,n,r){return new(n||(n=Promise))((function(t,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function o(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?t(e.value):new n((function(t){t(e.value)})).then(a,o)}s((r=r.apply(e,[])).next())}))}(this,0,void 0,(function*(){yield t,yield e(r),this._pendingPromises.delete(i);for(const e of n)this._baseObserver.next(e)}))).catch(e=>{this._pendingPromises.delete(i),this._baseObserver.error(e)});this._pendingPromises.add(i)}}},{}],lj3f:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.registerObservableSymbol=function(){r()&&!i("observable")&&(Symbol.observable=Symbol("observable"))},n.getSymbol=n.hasSymbol=n.hasSymbols=void 0;const r=()=>"function"==typeof Symbol;n.hasSymbols=r;const i=e=>r()&&Boolean(Symbol[e]);n.hasSymbol=i,n.getSymbol=e=>i(e)?Symbol[e]:"@@"+e,i("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"))},{}],B9l3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Observable=n.SubscriptionObserver=n.Subscription=void 0;var r=e("./_symbols");const i=(0,r.getSymbol)("iterator"),a=(0,r.getSymbol)("observable"),o=(0,r.getSymbol)("species");function s(e,t){const n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function l(e){let t=e.constructor;return void 0!==t&&null===(t=t[o])&&(t=void 0),void 0!==t?t:v}function c(e){c.log?c.log(e):setTimeout(()=>{throw e},0)}function u(e){Promise.resolve().then(()=>{try{e()}catch(e){c(e)}})}function h(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{const e=s(t,"unsubscribe");e&&e.call(t)}}catch(e){c(e)}}function d(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function f(e,t,n){e._state="running";const r=e._observer;try{const i=r?s(r,t):void 0;switch(t){case"next":i&&i.call(r,n);break;case"error":if(d(e),!i)throw n;i.call(r,n);break;case"complete":d(e),i&&i.call(r)}}catch(e){c(e)}"closed"===e._state?h(e):"running"===e._state&&(e._state="ready")}function p(e,t,n){if("closed"!==e._state)return"buffering"===e._state?(e._queue=e._queue||[],void e._queue.push({type:t,value:n})):"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void u(()=>function(e){const t=e._queue;if(t){e._queue=void 0,e._state="ready";for(const n of t)if(f(e,n.type,n.value),"closed"===e._state)break}}(e))):void f(e,t,n)}class m{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const n=new g(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(d(this),h(this))}}n.Subscription=m;class g{constructor(e){this._subscription=e}get closed(){return"closed"===this._subscription._state}next(e){p(this._subscription,"next",e)}error(e){p(this._subscription,"error",e)}complete(){p(this._subscription,"complete")}}n.SubscriptionObserver=g;class v{constructor(e){if(!(this instanceof v))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e,t,n){return"object"==typeof e&&null!==e||(e={next:e,error:t,complete:n}),new m(e,this._subscriber)}pipe(e,...t){let n=this;for(const r of[e,...t])n=r(n);return n}tap(e,t,n){const r="object"!=typeof e||null===e?{next:e,error:t,complete:n}:e;return new v(e=>this.subscribe({next(t){r.next&&r.next(t),e.next(t)},error(t){r.error&&r.error(t),e.error(t)},complete(){r.complete&&r.complete(),e.complete()},start(e){r.start&&r.start(e)}}))}forEach(e){return new Promise((t,n)=>{if("function"!=typeof e)return void n(new TypeError(e+" is not a function"));function r(){i.unsubscribe(),t()}const i=this.subscribe({next(t){try{e(t,r)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(n){let r=n;try{r=e(n)}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(n){try{if(!e(n))return}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e,t){if("function"!=typeof e)throw new TypeError(e+" is not a function");const n=l(this),r=arguments.length>1;let i=!1,a=t;return new n(t=>this.subscribe({next(n){const o=!i;if(i=!0,!o||r)try{a=e(a,n)}catch(e){return t.error(e)}else a=n},error(e){t.error(e)},complete(){if(!i&&!r)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(a),t.complete()}}))}concat(...e){const t=l(this);return new t(n=>{let r,i=0;return function a(o){r=o.subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){i===e.length?(r=void 0,n.complete()):a(t.from(e[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");const t=l(this);return new t(n=>{const r=[],i=this.subscribe({next(i){let o;if(e)try{o=e(i)}catch(e){return n.error(e)}else o=i;const s=t.from(o).subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){const e=r.indexOf(s);e>=0&&r.splice(e,1),a()}});r.push(s)},error(e){n.error(e)},complete(){a()}});function a(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[a](){return this}static from(e){const t="function"==typeof this?this:v;if(null==e)throw new TypeError(e+" is not an object");const n=s(e,a);if(n){const r=n.call(e);if(Object(r)!==r)throw new TypeError(r+" is not an object");return function(e){return e instanceof v}(r)&&r.constructor===t?r:new t(e=>r.subscribe(e))}if((0,r.hasSymbol)("iterator")){const n=s(e,i);if(n)return new t(t=>{u(()=>{if(!t.closed){for(const r of n.call(e))if(t.next(r),t.closed)return;t.complete()}})})}if(Array.isArray(e))return new t(t=>{u(()=>{if(!t.closed){for(const n of e)if(t.next(n),t.closed)return;t.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:v)(t=>{u(()=>{if(!t.closed){for(const n of e)if(t.next(n),t.closed)return;t.complete()}})})}static get[o](){return this}}n.Observable=v,(0,r.hasSymbols)()&&Object.defineProperty(v,Symbol("extensions"),{value:{symbol:a,hostReportError:c},configurable:!0});var y=v;n.default=y},{"./_symbols":"lj3f"}],QC75:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(e){"function"==typeof e?e():e&&"function"==typeof e.unsubscribe&&e.unsubscribe()}},{}],apmd:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./_scheduler"),i=o(e("./observable")),a=o(e("./unsubscribe"));function o(e){return e&&e.__esModule?e:{default:e}}n.default=function(e){return t=>new i.default(n=>{const i=new r.AsyncSerialScheduler(n),o=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule(n=>function(e,t,n,r){return new(n||(n=Promise))((function(t,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function o(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?t(e.value):new n((function(t){t(e.value)})).then(a,o)}s((r=r.apply(e,[])).next())}))}(this,0,void 0,(function*(){(yield e(t))&&n(t)})))}});return()=>(0,a.default)(o)})}},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],FgiE:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isAsyncIterator=function(e){return e&&(0,r.hasSymbol)("asyncIterator")&&e[Symbol.asyncIterator]},n.isIterator=function(e){return e&&(0,r.hasSymbol)("iterator")&&e[Symbol.iterator]};var r=e("./_symbols")},{"./_symbols":"lj3f"}],ltny:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./_scheduler"),i=e("./_util"),a=s(e("./observable")),o=s(e("./unsubscribe"));function s(e){return e&&e.__esModule?e:{default:e}}n.default=function(e){return t=>new a.default(n=>{const a=new r.AsyncSerialScheduler(n),s=t.subscribe({complete(){a.complete()},error(e){a.error(e)},next(t){a.schedule(n=>function(e,t,n,r){return new(n||(n=Promise))((function(t,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function o(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?t(e.value):new n((function(t){t(e.value)})).then(a,o)}s((r=r.apply(e,[])).next())}))}(this,0,void 0,(function*(){var r,a;const o=yield e(t);if((0,i.isIterator)(o)||(0,i.isAsyncIterator)(o))try{for(var s,l=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}}(o);!(s=yield l.next()).done;){const e=s.value;n(e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(a=l.return)&&(yield a.call(l))}finally{if(r)throw r.error}}else o.map(e=>n(e))})))}});return()=>(0,o.default)(s)})}},{"./_scheduler":"sfrJ","./_util":"FgiE","./observable":"B9l3","./unsubscribe":"QC75"}],jAhG:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){return new r.Observable(t=>{let n=0;const r=setInterval(()=>{t.next(n++)},e);return()=>clearInterval(r)})};var r=e("./observable")},{"./observable":"B9l3"}],aP59:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./_scheduler"),i=o(e("./observable")),a=o(e("./unsubscribe"));function o(e){return e&&e.__esModule?e:{default:e}}n.default=function(e){return t=>new i.default(n=>{const i=new r.AsyncSerialScheduler(n),o=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule(n=>function(e,t,n,r){return new(n||(n=Promise))((function(t,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function o(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?t(e.value):new n((function(t){t(e.value)})).then(a,o)}s((r=r.apply(e,[])).next())}))}(this,0,void 0,(function*(){const r=yield e(t);n(r)})))}});return()=>(0,a.default)(o)})}},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],Rg1v:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./observable"),i=function(e){return e&&e.__esModule?e:{default:e}}(e("./unsubscribe"));n.default=function(...e){return 0===e.length?r.Observable.from([]):new r.Observable(t=>{let n=0;const r=e.map(r=>r.subscribe({error(e){t.error(e),a()},next(e){t.next(e)},complete(){++n===e.length&&(t.complete(),a())}})),a=()=>{r.forEach(e=>(0,i.default)(e))};return a})}},{"./observable":"B9l3","./unsubscribe":"QC75"}],wtHd:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("./observable"));class i extends r.default{constructor(){super(e=>(this._observers.add(e),()=>this._observers.delete(e))),this._observers=new Set}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){for(const e of this._observers)e.complete()}}var a=i;n.default=a},{"./observable":"B9l3"}],NgdC:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./observable")),i=o(e("./subject")),a=o(e("./unsubscribe"));function o(e){return e&&e.__esModule?e:{default:e}}n.default=function(e){const t=new i.default;let n,o=0;return new r.default(r=>{n||(n=e.subscribe(t));const i=t.subscribe(r);return o++,()=>{o--,i.unsubscribe(),0===o&&((0,a.default)(n),n=void 0)}})}},{"./observable":"B9l3","./subject":"wtHd","./unsubscribe":"QC75"}],b7o0:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./_scheduler"),i=o(e("./observable")),a=o(e("./unsubscribe"));function o(e){return e&&e.__esModule?e:{default:e}}n.default=function(e,t){return n=>new i.default(i=>{let o,s=0;const l=new r.AsyncSerialScheduler(i),c=n.subscribe({complete(){l.complete()},error(e){l.error(e)},next(n){l.schedule(r=>function(e,t,n,r){return new(n||(n=Promise))((function(t,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function o(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?t(e.value):new n((function(t){t(e.value)})).then(a,o)}s((r=r.apply(e,[])).next())}))}(this,0,void 0,(function*(){const i=0===s?void 0===t?n:t:o;o=yield e(i,n,s++),r(o)})))}});return()=>(0,a.default)(c)})}},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],cyO3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"filter",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"flatMap",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"interval",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"map",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"merge",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"multicast",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"Observable",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(n,"scan",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"Subject",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(n,"unsubscribe",{enumerable:!0,get:function(){return d.default}});var r=f(e("./filter")),i=f(e("./flatMap")),a=f(e("./interval")),o=f(e("./map")),s=f(e("./merge")),l=f(e("./multicast")),c=f(e("./observable")),u=f(e("./scan")),h=f(e("./subject")),d=f(e("./unsubscribe"));function f(e){return e&&e.__esModule?e:{default:e}}},{"./filter":"apmd","./flatMap":"ltny","./interval":"jAhG","./map":"aP59","./merge":"Rg1v","./multicast":"NgdC","./observable":"B9l3","./scan":"b7o0","./subject":"wtHd","./unsubscribe":"QC75"}],vpgy:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.allSettled=function(e){return Promise.all(e.map(e=>{const t=e=>({status:"fulfilled",value:e}),n=e=>({status:"rejected",reason:e}),r=Promise.resolve(e);try{return r.then(t,n)}catch(e){return Promise.reject(e)}}))}},{}],UYCO:[function(e,t,n){"use strict";var r;Object.defineProperty(n,"__esModule",{value:!0}),n.PoolEventType=void 0,n.PoolEventType=r,function(e){e.initialized="initialized",e.taskCanceled="taskCanceled",e.taskCompleted="taskCompleted",e.taskFailed="taskFailed",e.taskQueued="taskQueued",e.taskQueueDrained="taskQueueDrained",e.taskStart="taskStart",e.terminated="terminated"}(r||(n.PoolEventType=r={}))},{}],fmdM:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.$worker=n.$transferable=n.$terminate=n.$events=n.$errors=void 0;const r=Symbol("thread.errors");n.$errors=r;const i=Symbol("thread.events");n.$events=i;const a=Symbol("thread.terminate");n.$terminate=a;const o=Symbol("thread.transferable");n.$transferable=o;const s=Symbol("thread.worker");n.$worker=s},{}],LBuu:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Thread=void 0;var r=e("../symbols");function i(e){throw Error(e)}const a={errors:e=>e[r.$errors]||i("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:e=>e[r.$events]||i("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:e=>e[r.$terminate]()};n.Thread=a},{"../symbols":"fmdM"}],EB3M:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PoolEventType",{enumerable:!0,get:function(){return s.PoolEventType}}),Object.defineProperty(n,"Thread",{enumerable:!0,get:function(){return l.Thread}}),n.Pool=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("debug")),i=e("observable-fns"),a=e("../ponyfills"),o=e("./implementation"),s=e("./pool-types"),l=e("./thread"),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};let u=1;class h{constructor(e,t){this.eventSubject=new i.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const n="number"==typeof t?{size:t}:t||{},{size:a=o.defaultPoolSize}=n;this.debug=(0,r.default)("threads:pool:"+function(e){return e.replace(/\W/g," ").trim().replace(/\s+/g,"-")}(n.name||String(u++))),this.options=n,this.workers=function(e,t){return function(e){const t=[];for(let n=0;n({init:e(),runningTasks:[]}))}(e,a),this.eventObservable=(0,i.multicast)(i.Observable.from(this.eventSubject)),Promise.all(this.workers.map(e=>e.init)).then(()=>this.eventSubject.next({type:s.PoolEventType.initialized,size:this.workers.length}),e=>{this.debug("Error while initializing pool worker:",e),this.eventSubject.error(e),this.initErrors.push(e)})}findIdlingWorker(){const{concurrency:e=1}=this.options;return this.workers.find(t=>t.runningTasks.lengthc(this,void 0,void 0,(function*(){yield new Promise(e=>setTimeout(e,0));try{yield this.runPoolTask(e,t)}finally{e.runningTasks=e.runningTasks.filter(e=>e!==n),this.isClosing||this.scheduleWork()}})))();e.runningTasks.push(n)}))}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const e=this.findIdlingWorker();if(!e)return;const t=this.taskQueue.shift();if(!t)return this.debug("Task queue is empty"),void this.eventSubject.next({type:s.PoolEventType.taskQueueDrained});this.run(e,t)}taskCompletion(e){return new Promise((t,n)=>{const r=this.events().subscribe(i=>{i.type===s.PoolEventType.taskCompleted&&i.taskID===e?(r.unsubscribe(),t(i.returnValue)):i.type===s.PoolEventType.taskFailed&&i.taskID===e?(r.unsubscribe(),n(i.error)):i.type===s.PoolEventType.terminated&&(r.unsubscribe(),n(Error("Pool has been terminated before task was run.")))})})}settled(e=!1){return c(this,void 0,void 0,(function*(){const t=()=>function(e,t){return e.reduce((e,n)=>[...e,...t(n)],[])}(this.workers,e=>e.runningTasks),n=[],r=this.eventObservable.subscribe(e=>{e.type===s.PoolEventType.taskFailed&&n.push(e.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):e&&0===this.taskQueue.length?(yield(0,a.allSettled)(t()),n):(yield new Promise((e,t)=>{const n=this.eventObservable.subscribe({next(t){t.type===s.PoolEventType.taskQueueDrained&&(n.unsubscribe(),e())},error:t})}),yield(0,a.allSettled)(t()),r.unsubscribe(),n)}))}completed(e=!1){return c(this,void 0,void 0,(function*(){const t=this.settled(e),n=new Promise((e,n)=>{const r=this.eventObservable.subscribe({next(i){i.type===s.PoolEventType.taskQueueDrained?(r.unsubscribe(),e(t)):i.type===s.PoolEventType.taskFailed&&(r.unsubscribe(),n(i.error))},error:n})}),r=yield Promise.race([t,n]);if(r.length>0)throw r[0]}))}events(){return this.eventObservable}queue(e){const{maxQueuedJobs:t=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const n=()=>this.taskCompletion(i.id);let r;const i={id:this.nextTaskID++,run:e,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter(e=>e!==i),this.eventSubject.next({type:s.PoolEventType.taskCanceled,taskID:i.id}))},get then(){if(!r){const e=n();r=e.then.bind(e)}return r}};if(this.taskQueue.length>=t)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:s.PoolEventType.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(e){return c(this,void 0,void 0,(function*(){this.isClosing=!0,e||(yield this.completed(!0)),this.eventSubject.next({type:s.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(e=>c(this,void 0,void 0,(function*(){return l.Thread.terminate(yield e.init)}))))}))}}function d(e,t){return new h(e,t)}h.EventType=s.PoolEventType,d.EventType=s.PoolEventType;const f=d;n.Pool=f},{debug:"jcLW","observable-fns":"cyO3","../ponyfills":"vpgy","./implementation":"XK2w","./pool-types":"UYCO","./thread":"LBuu"}],PRGP:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createPromiseWithResolver=function(){let e,t=!1,n=r;return[new Promise(r=>{t?r(e):n=r}),r=>{t=!0,e=r,n()}]};const r=()=>{}},{}],ZLGT:[function(e,t,n){"use strict";var r;Object.defineProperty(n,"__esModule",{value:!0}),n.WorkerEventType=void 0,e("../symbols"),n.WorkerEventType=r,function(e){e.internalError="internalError",e.message="message",e.termination="termination"}(r||(n.WorkerEventType=r={}))},{"../symbols":"fmdM"}],zXl4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ObservablePromise=void 0;var r=e("observable-fns");const i=()=>{},a=e=>e,o=e=>Promise.resolve().then(e);function s(e){throw e}class l extends r.Observable{constructor(e){super(t=>{const n=this,r=Object.assign(Object.assign({},t),{complete(){t.complete(),n.onCompletion()},error(e){t.error(e),n.onError(e)},next(e){t.next(e),n.onNext(e)}});try{return this.initHasRun=!0,e(r)}catch(e){r.error(e)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(e){this.firstValueSet||(this.firstValue=e,this.firstValueSet=!0)}onError(e){this.state="rejected",this.rejection=e;for(const t of this.rejectionCallbacks)o(()=>t(e))}onCompletion(){this.state="fulfilled";for(const e of this.fulfillmentCallbacks)o(()=>e(this.firstValue))}then(e,t){const n=e||a,r=t||s;let i=!1;return new Promise((e,t)=>{const a=n=>{if(!i){i=!0;try{e(r(n))}catch(e){t(e)}}};return this.initHasRun||this.subscribe({error:a}),"fulfilled"===this.state?e(n(this.firstValue)):"rejected"===this.state?(i=!0,e(r(this.rejection))):(this.fulfillmentCallbacks.push(t=>{try{e(n(t))}catch(e){a(e)}}),void this.rejectionCallbacks.push(a))})}catch(e){return this.then(void 0,e)}finally(e){const t=e||i;return this.then(e=>(t(),e),()=>t())}static from(e){return function(e){return e&&"function"==typeof e.then}(e)?new l(t=>{e.then(e=>{t.next(e),t.complete()},e=>{t.error(e)})}):super.from(e)}}n.ObservablePromise=l},{"observable-fns":"cyO3"}],qW1u:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isTransferDescriptor=function(e){return e&&"object"==typeof e&&e[r.$transferable]},n.Transfer=function(e,t){if(!t){if(!function(e){return!(!e||"object"!=typeof e)}(e))throw Error();t=[e]}return{[r.$transferable]:!0,send:e,transferables:t}};var r=e("./symbols")},{"./symbols":"fmdM"}],fUdt:[function(e,t,n){"use strict";var r,i;Object.defineProperty(n,"__esModule",{value:!0}),n.WorkerMessageType=n.MasterMessageType=void 0,n.MasterMessageType=r,function(e){e.run="run"}(r||(n.MasterMessageType=r={})),n.WorkerMessageType=i,function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(i||(n.WorkerMessageType=i={}))},{}],iMbm:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createProxyFunction=p,n.createProxyModule=function(e,t){const n={};for(const r of t)n[r]=p(e,r);return n};var r=function(e){return e&&e.__esModule?e:{default:e}}(e("debug")),i=e("observable-fns"),a=e("../common"),o=e("../observable-promise"),s=e("../transferable"),l=e("../types/messages");const c=(0,r.default)("threads:master:messages");let u=1;const h=e=>Array.from(new Set(e));function d(e,t){return new i.Observable(n=>{let r;const i=o=>{if(c("Message from worker:",o.data),o.data&&o.data.uid===t)if((e=>e&&e.type===l.WorkerMessageType.running)(o.data))r=o.data.resultType;else if((e=>e&&e.type===l.WorkerMessageType.result)(o.data))"promise"===r?(void 0!==o.data.payload&&n.next((0,a.deserialize)(o.data.payload)),n.complete(),e.removeEventListener("message",i)):(o.data.payload&&n.next((0,a.deserialize)(o.data.payload)),o.data.complete&&(n.complete(),e.removeEventListener("message",i)));else if((e=>e&&e.type===l.WorkerMessageType.error)(o.data)){const t=(0,a.deserialize)(o.data.error);n.error(t),e.removeEventListener("message",i)}};return e.addEventListener("message",i),()=>e.removeEventListener("message",i)})}function f(e){if(0===e.length)return{args:[],transferables:[]};const t=[],n=[];for(const r of e)(0,s.isTransferDescriptor)(r)?(t.push((0,a.serialize)(r.send)),n.push(...r.transferables)):t.push((0,a.serialize)(r));return{args:t,transferables:0===n.length?n:h(n)}}function p(e,t){return(...n)=>{const r=u++,{args:a,transferables:s}=f(n),h={type:l.MasterMessageType.run,uid:r,method:t,args:a};c("Sending command to run function to worker:",h);try{e.postMessage(h,s)}catch(e){return o.ObservablePromise.from(Promise.reject(e))}return o.ObservablePromise.from((0,i.multicast)(d(e,r)))}}},{debug:"jcLW","observable-fns":"cyO3","../common":"kdjL","../observable-promise":"zXl4","../transferable":"qW1u","../types/messages":"fUdt"}],a83E:[function(e,t,n){e("process"),e("process"),Object.defineProperty(n,"__esModule",{value:!0}),n.spawn=function(e,t){return u(this,void 0,void 0,(function*(){d("Initializing new thread");const n=(yield function(e,t,n){return u(this,void 0,void 0,(function*(){let n;const r=new Promise((e,r)=>{n=setTimeout(()=>r(Error("Timeout: Did not receive an init message from worker after 10000ms. Make sure the worker calls expose().")),t)}),i=yield Promise.race([e,r]);return clearTimeout(n),i}))}(p(e),t&&t.timeout?t.timeout:1e4)).exposed,{termination:r,terminate:i}=function(e){const[t,n]=(0,o.createPromiseWithResolver)();return{terminate:()=>u(this,void 0,void 0,(function*(){f("Terminating worker"),yield e.terminate(),n()})),termination:t}}(e),a=m(e,r);if("function"===n.type)return g((0,c.createProxyFunction)(e),e,a,i);if("module"===n.type)return g((0,c.createProxyModule)(e,n.methods),e,a,i);{const e=n.type;throw Error("Worker init message states unexpected type of expose(): "+e)}}))};var r=function(e){return e&&e.__esModule?e:{default:e}}(e("debug")),i=e("observable-fns"),a=e("../common"),o=e("../promise"),s=e("../symbols"),l=e("../types/master"),c=e("./invocation-proxy"),u=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const h=(0,r.default)("threads:master:messages"),d=(0,r.default)("threads:master:spawn"),f=(0,r.default)("threads:master:thread-utils");function p(e){return new Promise((t,n)=>{const r=i=>{h("Message from worker before finishing initialization:",i.data),(e=>e&&"init"===e.type)(i.data)?(e.removeEventListener("message",r),t(i.data)):(e=>e&&"uncaughtError"===e.type)(i.data)&&(e.removeEventListener("message",r),n((0,a.deserialize)(i.data.error)))};e.addEventListener("message",r)})}function m(e,t){return new i.Observable(n=>{const r=e=>{const t={type:l.WorkerEventType.message,data:e.data};n.next(t)},i=e=>{f("Unhandled promise rejection event in thread:",e);const t={type:l.WorkerEventType.internalError,error:Error(e.reason)};n.next(t)};e.addEventListener("message",r),e.addEventListener("unhandledrejection",i),t.then(()=>{const t={type:l.WorkerEventType.termination};e.removeEventListener("message",r),e.removeEventListener("unhandledrejection",i),n.next(t),n.complete()})})}function g(e,t,n,r){const i=n.filter(e=>e.type===l.WorkerEventType.internalError).map(e=>e.error);return Object.assign(e,{[s.$errors]:i,[s.$events]:n,[s.$terminate]:r,[s.$worker]:t})}},{debug:"jcLW","observable-fns":"cyO3","../common":"kdjL","../promise":"PRGP","../symbols":"fmdM","../types/master":"ZLGT","./invocation-proxy":"iMbm",process:"pBGv"}],HfK0:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Pool",{enumerable:!0,get:function(){return i.Pool}}),Object.defineProperty(n,"spawn",{enumerable:!0,get:function(){return a.spawn}}),Object.defineProperty(n,"Thread",{enumerable:!0,get:function(){return o.Thread}}),n.Worker=void 0;var r=e("./implementation"),i=e("./pool"),a=e("./spawn"),o=e("./thread");const s=(0,r.selectWorkerImplementation)();n.Worker=s},{"./implementation":"XK2w","./pool":"EB3M","./spawn":"a83E","./thread":"LBuu"}],JZ8d:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}},{}],LkZ7:[function(e,t,n){var r=arguments[3];Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i,a=o(e("./ponyfill.js"));function o(e){return e&&e.__esModule?e:{default:e}}i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:void 0!==t?t:Function("return this")();var s=(0,a.default)(i),l=s;n.default=l},{"./ponyfill.js":"JZ8d"}],UALh:[function(e,t,n){"use strict";const r=e("symbol-observable").default;t.exports=e=>Boolean(e&&e[r]&&e===e[r]())},{"symbol-observable":"LkZ7"}],AZa4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r={isWorkerRuntime:function(){return!("undefined"==typeof self||!self.postMessage)},postMessageToMaster:function(e,t){self.postMessage(e,t)},subscribeToMasterMessages:function(e){const t=t=>{e(t.data)};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}};n.default=r},{}],l5pR:[function(e,t,n){e("process");var r=e("process");Object.defineProperty(n,"__esModule",{value:!0}),n.expose=function(e){if(!l.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(u)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(u=!0,"function"==typeof e)l.default.subscribeToMasterMessages(t=>{h(t)&&!t.method&&v(t.uid,e,t.args.map(a.deserialize))}),function(){const e={type:s.WorkerMessageType.init,exposed:{type:"function"}};l.default.postMessageToMaster(e)}();else{if("object"!=typeof e||!e)throw Error("Invalid argument passed to expose(). Expected a function or an object, got: "+e);l.default.subscribeToMasterMessages(t=>{h(t)&&t.method&&v(t.uid,e[t.method],t.args.map(a.deserialize))}),function(e){const t={type:s.WorkerMessageType.init,exposed:{type:"module",methods:e}};l.default.postMessageToMaster(t)}(Object.keys(e).filter(t=>"function"==typeof e[t]))}},Object.defineProperty(n,"registerSerializer",{enumerable:!0,get:function(){return a.registerSerializer}}),Object.defineProperty(n,"Transfer",{enumerable:!0,get:function(){return o.Transfer}});var i=c(e("is-observable")),a=e("../common"),o=e("../transferable"),s=e("../types/messages"),l=c(e("./implementation"));function c(e){return e&&e.__esModule?e:{default:e}}let u=!1;const h=e=>e&&e.type===s.MasterMessageType.run,d=e=>(0,i.default)(e)||function(e){return e&&"object"==typeof e&&"function"==typeof e.subscribe}(e);function f(e){return(0,o.isTransferDescriptor)(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function p(e,t){const{payload:n,transferables:r}=f(t),i={type:s.WorkerMessageType.error,uid:e,error:(0,a.serialize)(n)};l.default.postMessageToMaster(i,r)}function m(e,t,n){const{payload:r,transferables:i}=f(n),a={type:s.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:r};l.default.postMessageToMaster(a,i)}function g(e){try{const t={type:s.WorkerMessageType.uncaughtError,error:(0,a.serialize)(e)};l.default.postMessageToMaster(t)}catch(t){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\nLatest error:",t,"\nOriginal error:",e)}}function v(e,t,n){return function(e,t,n,r){return new(n||(n=Promise))((function(t,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function o(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,o)}s((r=r.apply(e,[])).next())}))}(this,0,void 0,(function*(){let r;try{r=t(...n)}catch(t){return p(e,t)}const i=d(r)?"observable":"promise";if(function(e,t){const n={type:s.WorkerMessageType.running,uid:e,resultType:t};l.default.postMessageToMaster(n)}(e,i),d(r))r.subscribe(t=>m(e,!1,(0,a.serialize)(t)),t=>p(e,(0,a.serialize)(t)),()=>m(e,!0));else try{const t=yield r;m(e,!0,(0,a.serialize)(t))}catch(t){p(e,(0,a.serialize)(t))}}))}"undefined"!=typeof self&&"function"==typeof self.addEventListener&&l.default.isWorkerRuntime()&&(self.addEventListener("error",e=>{setTimeout(()=>g(e.error||e),250)}),self.addEventListener("unhandledrejection",e=>{const t=e.reason;t&&"string"==typeof t.message&&setTimeout(()=>g(t),250)})),void 0!==r&&"function"==typeof r.on&&l.default.isWorkerRuntime()&&(r.on("uncaughtException",e=>{setTimeout(()=>g(e),250)}),r.on("unhandledRejection",e=>{e&&"string"==typeof e.message&&setTimeout(()=>g(e),250)}))},{"is-observable":"UALh","../common":"kdjL","../transferable":"qW1u","../types/messages":"fUdt","./implementation":"AZa4",process:"pBGv"}],CqwR:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={registerSerializer:!0,expose:!0,DefaultSerializer:!0,Transfer:!0};Object.defineProperty(n,"registerSerializer",{enumerable:!0,get:function(){return i.registerSerializer}}),Object.defineProperty(n,"expose",{enumerable:!0,get:function(){return o.expose}}),Object.defineProperty(n,"DefaultSerializer",{enumerable:!0,get:function(){return s.DefaultSerializer}}),Object.defineProperty(n,"Transfer",{enumerable:!0,get:function(){return l.Transfer}});var i=e("./common"),a=e("./master/index");Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(n,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=e("./worker/index"),s=e("./serializers"),l=e("./transferable")},{"./common":"kdjL","./master/index":"HfK0","./worker/index":"l5pR","./serializers":"z2GM","./transferable":"qW1u"}],dHPO:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=l(e("@babel/runtime/regenerator")),i=l(e("@babel/runtime/helpers/asyncToGenerator")),a=l(e("@babel/runtime/helpers/classCallCheck")),o=l(e("@babel/runtime/helpers/createClass")),s=e("threads");function l(e){return e&&e.__esModule?e:{default:e}}var c="undefined"!=typeof navigator?navigator.hardwareConcurrency:null,u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new s.Worker("decoder.worker.1936c0d9.js");(0,a.default)(this,e),this.pool=(0,s.Pool)((function(){return(0,s.spawn)(n)}),t)}return(0,o.default)(e,[{key:"decode",value:function(){var e=(0,i.default)(r.default.mark((function e(t,n){var a=this;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){a.pool.queue(function(){var a=(0,i.default)(r.default.mark((function i(a){var l;return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,a(t,(0,s.Transfer)(n));case 3:l=r.sent,e(l),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),o(r.t0);case 10:case"end":return r.stop()}}),i,null,[[0,7]])})));return function(e){return a.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"destroy",value:function(){this.pool.terminate(!0)}}]),e}();n.default=u},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW",threads:"CqwR","./decoder.worker.js":[["decoder.worker.1936c0d9.js","LHx9"],"decoder.worker.1936c0d9.js.map","LHx9"]}],t2zx:[function(e,t,n){t.exports=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}},{}],U8F3:[function(e,t,n){var r=e("./objectWithoutPropertiesLoose");t.exports=function(e,t){if(null==e)return{};var n,i,a=r(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},{"./objectWithoutPropertiesLoose":"t2zx"}],OMTj:[function(e,t,n){t.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},{}],kQhN:[function(e,t,n){var r=e("./arrayWithHoles"),i=e("./iterableToArray"),a=e("./unsupportedIterableToArray"),o=e("./nonIterableRest");t.exports=function(e){return r(e)||i(e)||a(e)||o()}},{"./arrayWithHoles":"OUZ9","./iterableToArray":"OMTj","./unsupportedIterableToArray":"UyFj","./nonIterableRest":"Rom6"}],ZJpj:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.parseContentType=function(e){var t=e.split(";").map((function(e){return e.trim()})),n=(0,r.default)(t);return{type:n[0],params:u(n.slice(1).map((function(e){return e.split("=")})))}},n.parseContentRange=d,n.parseByteRanges=function(e,t){for(var n=null,r=new TextDecoder("ascii"),i=[],a="--".concat(t),o="".concat(a,"--"),s=0;s<10;++s)r.decode(new Uint8Array(e,s,a.length))===a&&(n=s);if(null===n)throw new Error("Could not find initial boundary");for(;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw a}}}}function s(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==a[1]?a[1]:void 0,e.next=3,Promise.all(t.map((function(e){return i.fetchSlice(e,n)})));case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"fetchSlice",value:function(){var e=(0,i.default)(r.default.mark((function e(t){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("fetching of slice ".concat(t," not possible, not implemented"));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=(0,i.default)(r.default.mark((function e(){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"fileSize",get:function(){return null}}]),e}();n.BaseSource=l},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW"}],eMzk:[function(e,t,n){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},{}],sfWH:[function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,a=this.head;null!==a&&ithis.length&&(t=this.length);for(var i=this.length,a=this.tail;null!==a&&i>t;i--)a=a.prev;for(;null!==a&&i>e;i--,a=a.prev)n.push(a.value);return n},r.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,a=this.head;null!==a&&rthis[o])return x(this,this[p].get(e)),!1;var a=this[p].get(e).value;return this[h]&&(this[d]||this[h](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[s]+=i-a.length,a.length=i,this.get(e),_(this),!0}var c=new w(e,t,i,r,n);return c.length>this[o]?(this[h]&&this[h](e,t),!1):(this[s]+=c.length,this[f].unshift(c),this[p].set(e,this[f].head),_(this),!0)}},{key:"has",value:function(e){if(!this[p].has(e))return!1;var t=this[p].get(e).value;return!b(this,t)}},{key:"get",value:function(e){return y(this,e,!0)}},{key:"peek",value:function(e){return y(this,e,!1)}},{key:"pop",value:function(){var e=this[f].tail;return e?(x(this,e),e.value):null}},{key:"del",value:function(e){x(this,this[p].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var a=i-t;a>0&&this.set(r.k,r.v,a)}}}},{key:"prune",value:function(){var e=this;this[p].forEach((function(t,n){return y(e,n,!1)}))}},{key:"max",set:function(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[o]=e||1/0,_(this)},get:function(){return this[o]}},{key:"allowStale",set:function(e){this[c]=!!e},get:function(){return this[c]}},{key:"maxAge",set:function(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,_(this)},get:function(){return this[u]}},{key:"lengthCalculator",set:function(e){var t=this;"function"!=typeof e&&(e=g),e!==this[l]&&(this[l]=e,this[s]=0,this[f].forEach((function(e){e.length=t[l](e.value,e.key),t[s]+=e.length}))),_(this)},get:function(){return this[l]}},{key:"length",get:function(){return this[s]}},{key:"itemCount",get:function(){return this[f].length}}]),e}(),y=function(e,t,n){var r=e[p].get(t);if(r){var i=r.value;if(b(e,i)){if(x(e,r),!e[c])return}else n&&(e[m]&&(r.value.now=Date.now()),e[f].unshiftNode(r));return i.value}},b=function(e,t){if(!t||!t.maxAge&&!e[u])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[u]&&n>e[u]},_=function(e){if(e[s]>e[o])for(var t=e[f].tail;e[s]>e[o]&&null!==t;){var n=t.prev;x(e,t),t=n}},x=function(e,t){if(t){var n=t.value;e[h]&&e[h](n.key,n.value),e[s]-=n.length,e[p].delete(n.key),e[f].removeNode(t)}},w=function e(t,n,i,a,o){r(this,e),this.key=t,this.value=n,this.length=i,this.now=a,this.maxAge=o||0},M=function(e,t,n,r){var i=n.value;b(e,i)&&(x(e,n),e[c]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};t.exports=v},{yallist:"sfWH"}],FOZT:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.assign=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},n.chunk=function(e,t){for(var n=[],r=e.length,i=0;i=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:null;(0,c.default)(this,e),this.offset=t,this.length=n,this.data=r}return(0,u.default)(e,[{key:"top",get:function(){return this.offset+this.length}}]),e}(),y=function e(t,n,r){(0,c.default)(this,e),this.offset=t,this.length=n,this.blockIds=r},b=function(e){(0,o.default)(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.blockSize,o=void 0===a?65536:a,s=i.cacheSize,l=void 0===s?100:s;return(0,c.default)(this,n),(r=t.call(this)).source=e,r.blockSize=o,r.blockCache=new h.default({max:l}),r.blockRequests=new Map,r.blockIdsToFetch=new Set,r}return(0,u.default)(n,[{key:"fetch",value:function(){var e=(0,a.default)(r.default.mark((function e(t,n){var a,o,s,l,c,u,h,d,p,g,v,y,b,_,x,w,M,S,T,E,C,A,P,L,R,O,k,I,N,D,j,F,z,B,U,H,G,W;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=new Map,o=new Map,s=new Set,l=m(t);try{for(l.s();!(c=l.n()).done;)for(u=c.value,h=u.offset,d=u.length,p=h+d,null!==(g=this.fileSize)&&(p=Math.min(p,g)),v=Math.floor(h/this.blockSize)*this.blockSize,y=v;y0)){e.next=65;break}this.fetchBlocks(n),I=m(E),e.prev=44,I.s();case 46:if((N=I.n()).done){e.next=54;break}if(D=N.value,j=this.blockRequests.get(D)){e.next=51;break}throw new Error("Block ".concat(D," is not in the block requests"));case 51:o.set(D,j);case 52:e.next=46;break;case 54:e.next=59;break;case 56:e.prev=56,e.t1=e.catch(44),I.e(e.t1);case 59:return e.prev=59,I.f(),e.finish(59);case 62:return e.next=64,Promise.allSettled(Array.from(o.values()));case 64:T=e.sent;case 65:if(!T.some((function(e){return"rejected"===e.status}))){e.next=69;break}if(!n||!n.aborted){e.next=68;break}throw new f.AbortError("Request was aborted");case 68:throw new f.AggregateError(T.filter((function(e){return"rejected"===e.status})).map((function(e){return e.reason})),"Request failed");case 69:F=T.map((function(e){return e.value})),z=new Map((0,f.zip)(Array.from(o.keys()),F)),B=m(a);try{for(B.s();!(U=B.n()).done;)H=(0,i.default)(U.value,2),G=H[0],W=H[1],z.set(G,W)}catch(e){B.e(e)}finally{B.f()}return e.abrupt("return",this.readSliceData(t,z));case 74:case"end":return e.stop()}}),e,this,[[9,28,31,34],[44,56,59,62]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fetchBlocks",value:function(e){var t=this;this.blockIdsToFetch.size>0&&function(){for(var n=t.groupBlocks(t.blockIdsToFetch),i=t.source.fetch(n,e),o=function(o){var s,l=m(n[o].blockIds);try{var c=function(){var n=s.value,l=(0,a.default)(r.default.mark((function a(){var s,l,c,u,h,d;return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,i;case 3:return r.t0=o,s=r.sent[r.t0],l=n*t.blockSize,c=l-s.offset,u=Math.min(c+t.blockSize,s.data.byteLength),h=s.data.slice(c,u),d=new v(l,h.byteLength,h),t.blockCache.set(n,d),r.abrupt("return",d);case 14:throw r.prev=14,r.t1=r.catch(0),"AbortError"===r.t1.name&&(r.t1.signal=e),r.t1;case 18:return r.prev=18,t.blockRequests.delete(n),r.finish(18);case 21:case"end":return r.stop()}}),a,null,[[0,14,18,21]])})))();t.blockRequests.set(n,l)};for(l.s();!(s=l.n()).done;)c()}catch(e){l.e(e)}finally{l.f()}},s=0;s0&&(f=h),c=u.top-r<0?u.length-d:r-u.offset-d;var p=new Uint8Array(u.data,d,c);s.set(p,f)}return o}))}},{key:"fileSize",get:function(){return this.source.fileSize}}]),n}(d.BaseSource);n.BlockedSource=b},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","lru-cache":"tpff","./basesource":"LzCD","../utils":"FOZT"}],uL1U:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BaseClient=n.BaseResponse=void 0;var r=s(e("@babel/runtime/regenerator")),i=s(e("@babel/runtime/helpers/asyncToGenerator")),a=s(e("@babel/runtime/helpers/classCallCheck")),o=s(e("@babel/runtime/helpers/createClass"));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,[{key:"getHeader",value:function(e){throw new Error("not implemented")}},{key:"getData",value:function(){var e=(0,i.default)(r.default.mark((function e(){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("not implemented");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"ok",get:function(){return this.status>=200&&this.status<=299}},{key:"status",get:function(){throw new Error("not implemented")}}]),e}();n.BaseResponse=l;var c=function(){function e(t){(0,a.default)(this,e),this.url=t}return(0,o.default)(e,[{key:"request",value:function(){var e=(0,i.default)(r.default.mark((function e(){var t,n=arguments;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw(t=n.length>0&&void 0!==n[0]?n[0]:{}).headers,t.credentials,t.signal,new Error("request is not implemented");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]),e}();n.BaseClient=c},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW"}],Un5s:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.FetchClient=void 0;var r=h(e("@babel/runtime/regenerator")),i=h(e("@babel/runtime/helpers/asyncToGenerator")),a=h(e("@babel/runtime/helpers/classCallCheck")),o=h(e("@babel/runtime/helpers/createClass")),s=h(e("@babel/runtime/helpers/inherits")),l=h(e("@babel/runtime/helpers/possibleConstructorReturn")),c=h(e("@babel/runtime/helpers/getPrototypeOf")),u=e("./base");function h(e){return e&&e.__esModule?e:{default:e}}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var i=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}var f=function(e){(0,s.default)(n,e);var t=d(n);function n(e){var r;return(0,a.default)(this,n),(r=t.call(this)).response=e,r}return(0,o.default)(n,[{key:"getHeader",value:function(e){return this.response.headers.get(e)}},{key:"getData",value:function(){var e=(0,i.default)(r.default.mark((function e(){var t;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.response.arrayBuffer){e.next=6;break}return e.next=3,this.response.arrayBuffer();case 3:e.t0=e.sent,e.next=9;break;case 6:return e.next=8,this.response.buffer();case 8:e.t0=e.sent.buffer;case 9:return t=e.t0,e.abrupt("return",t);case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"status",get:function(){return this.response.status}}]),n}(u.BaseResponse),p=function(e){(0,s.default)(n,e);var t=d(n);function n(e,r){var i;return(0,a.default)(this,n),(i=t.call(this,e)).credentials=r,i}return(0,o.default)(n,[{key:"request",value:function(){var e=(0,i.default)(r.default.mark((function e(){var t,n,i,a,o,s=arguments;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},n=t.headers,i=t.credentials,a=t.signal,e.next=3,fetch(this.url,{headers:n,credentials:i,signal:a});case 3:return o=e.sent,e.abrupt("return",new f(o));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(u.BaseClient);n.FetchClient=p},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./base":"uL1U"}],hvgd:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.XHRClient=void 0;var r=f(e("@babel/runtime/helpers/slicedToArray")),i=f(e("@babel/runtime/regenerator")),a=f(e("@babel/runtime/helpers/asyncToGenerator")),o=f(e("@babel/runtime/helpers/classCallCheck")),s=f(e("@babel/runtime/helpers/createClass")),l=f(e("@babel/runtime/helpers/inherits")),c=f(e("@babel/runtime/helpers/possibleConstructorReturn")),u=f(e("@babel/runtime/helpers/getPrototypeOf")),h=e("./base"),d=e("../../utils");function f(e){return e&&e.__esModule?e:{default:e}}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var i=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var m=function(e){(0,l.default)(n,e);var t=p(n);function n(e,r){var i;return(0,o.default)(this,n),(i=t.call(this)).xhr=e,i.data=r,i}return(0,s.default)(n,[{key:"getHeader",value:function(e){return this.xhr.getResponseHeader(e)}},{key:"getData",value:function(){var e=(0,a.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.data);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"status",get:function(){return this.xhr.status}}]),n}(h.BaseResponse),g=function(e){(0,l.default)(n,e);var t=p(n);function n(){return(0,o.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"constructRequest",value:function(e,t){var n=this;return new Promise((function(i,a){var o=new XMLHttpRequest;o.open("GET",n.url),o.responseType="arraybuffer";for(var s=0,l=Object.entries(e);s0&&void 0!==o[0]?o[0]:{},n=t.headers,r=t.signal,e.next=3,this.constructRequest(n,r);case 3:return a=e.sent,e.abrupt("return",a);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(h.BaseClient);n.XHRClient=g},{"@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./base":"uL1U","../../utils":"FOZT"}],p5a1:[function(e,t,n){var r,i=arguments[3];n.fetch=c(i.fetch)&&c(i.ReadableStream),n.writableStream=c(i.WritableStream),n.abortController=c(i.AbortController),n.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),n.blobConstructor=!0}catch(e){}function a(){if(void 0!==r)return r;if(i.XMLHttpRequest){r=new i.XMLHttpRequest;try{r.open("GET",i.XDomainRequest?"/":"https://example.com")}catch(e){r=null}}else r=null;return r}function o(e){var t=a();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var s=void 0!==i.ArrayBuffer,l=s&&c(i.ArrayBuffer.prototype.slice);function c(e){return"function"==typeof e}n.arraybuffer=n.fetch||s&&o("arraybuffer"),n.msstream=!n.fetch&&l&&o("ms-stream"),n.mozchunkedarraybuffer=!n.fetch&&s&&o("moz-chunked-arraybuffer"),n.overrideMimeType=n.fetch||!!a()&&c(a().overrideMimeType),n.vbArray=c(i.VBArray),r=null},{}],Yj0v:[function(e,t,n){e("process");var r=e("process");void 0===r||!r.version||0===r.version.indexOf("v0.")||0===r.version.indexOf("v1.")&&0!==r.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return r.nextTick(e);case 2:return r.nextTick((function(){e.call(null,t)}));case 3:return r.nextTick((function(){e.call(null,t,n)}));case 4:return r.nextTick((function(){e.call(null,t,n,i)}));default:for(a=new Array(s-1),o=0;o0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t=r.allocUnsafe(e>>>0),n=this.head,i=0;n;)a(n.data,t,i),i+=n.data.length,n=n.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":"Nqn4",util:"rDCW"}],lCUh:[function(e,t,n){"use strict";var r=e("process-nextick-args");function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":"Yj0v"}],jPmE:[function(e,t,n){e("process"),e("process");var r=arguments[3],i=e("process-nextick-args");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){D(t,e)}}t.exports=b;var o,s=i.nextTick;b.WritableState=y;var l=Object.create(e("core-util-is"));l.inherits=e("inherits");var c={deprecate:e("util-deprecate")},u=e("./internal/streams/stream"),h=e("safe-buffer").Buffer,d=r.Uint8Array||function(){};function f(e){return h.from(e)}function p(e){return h.isBuffer(e)||e instanceof d}var m,g=e("./internal/streams/destroy");function v(){}function y(t,n){o=o||e("./_stream_duplex"),t=t||{};var r=n instanceof o;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,s=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(s||0===s)?s:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===t.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){C(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function b(t){if(o=o||e("./_stream_duplex"),!(m.call(b,this)||this instanceof o))return new b(t);this._writableState=new y(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function _(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}function x(e,t,n,r){var a=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(r,o),a=!1),a}function w(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,n)),t}function M(e,t,n,r,i,a){if(!n){var o=w(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||N(this,r,n)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=g.destroy,b.prototype._undestroy=g.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}},{"process-nextick-args":"Yj0v","core-util-is":"Q14w",inherits:"Bm0n","util-deprecate":"yM1o","./internal/streams/stream":"ExO1","safe-buffer":"Nqn4","./internal/streams/destroy":"lCUh","./_stream_duplex":"Jcj8",process:"pBGv"}],Jcj8:[function(e,t,n){"use strict";var r=e("process-nextick-args"),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=h;var a=Object.create(e("core-util-is"));a.inherits=e("inherits");var o=e("./_stream_readable"),s=e("./_stream_writable");a.inherits(h,o);for(var l=i(s.prototype),c=0;c>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function u(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}n.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":"Nqn4"}],YrHu:[function(e,t,n){e("process");var r=arguments[3],i=e("process"),a=e("process-nextick-args");t.exports=M;var o,s=e("isarray");M.ReadableState=w,e("events").EventEmitter;var l=function(e,t){return e.listeners(t).length},c=e("./internal/streams/stream"),u=e("safe-buffer").Buffer,h=r.Uint8Array||function(){};function d(e){return u.from(e)}function f(e){return u.isBuffer(e)||e instanceof h}var p=Object.create(e("core-util-is"));p.inherits=e("inherits");var m=e("util"),g=void 0;g=m&&m.debuglog?m.debuglog("stream"):function(){};var v,y=e("./internal/streams/BufferList"),b=e("./internal/streams/destroy");p.inherits(M,c);var _=["error","close","destroy","pause","resume"];function x(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function w(t,n){t=t||{};var r=n instanceof(o=o||e("./_stream_duplex"));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(v||(v=e("string_decoder/").StringDecoder),this.decoder=new v(t.encoding),this.encoding=t.encoding)}function M(t){if(o=o||e("./_stream_duplex"),!(this instanceof M))return new M(t);this._readableState=new w(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),c.call(this)}function S(e,t,n,r,i){var a,o=e._readableState;return null===t?(o.reading=!1,R(e,o)):(i||(a=E(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=d(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):T(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):I(e,o)):T(e,o,t,!1))):r||(o.reading=!1)),C(o)}function T(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&O(e)),I(e,t)}function E(e,t){var n;return f(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function C(e){return!e.ended&&(e.needReadable||e.length=A?e=A:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function L(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=P(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,O(e)}}function O(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?a.nextTick(k,e):k(e))}function k(e){g("emit readable"),e.emit("readable"),B(e)}function I(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(N,e,t))}function N(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=H(e,t.buffer,t.decoder),n);var n}function H(e,t,n){var r;return ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0==(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}function W(e,t){var n=u.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0==(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}function V(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(q,t,e))}function q(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function X(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return g("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?V(this):O(this),null;if(0===(e=L(e,t))&&t.ended)return 0===t.length&&V(this),null;var r,i=t.needReadable;return g("need readable",i),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&V(this)),null!==r&&this.emit("data",r),r},M.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},M.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,g("pipe count=%d opts=%j",r.pipesCount,t);var o=t&&!1===t.end||e===i.stdout||e===i.stderr?v:s;function s(){g("onend"),e.end()}r.endEmitted?a.nextTick(o):n.once("end",o),e.on("unpipe",(function t(i,a){g("onunpipe"),i===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,g("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",v),n.removeListener("data",d),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}));var c=D(n);e.on("drain",c);var u=!1,h=!1;function d(t){g("ondata"),h=!1,!1!==e.write(t)||h||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==X(r.pipes,e))&&!u&&(g("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function f(t){g("onerror",t),v(),e.removeListener("error",f),0===l(e,"error")&&e.emit("error",t)}function p(){e.removeListener("finish",m),v()}function m(){g("onfinish"),e.removeListener("close",p),v()}function v(){g("unpipe"),n.unpipe(e)}return n.on("data",d),x(e,"error",f),e.once("close",p),e.once("finish",m),e.emit("pipe",n),r.flowing||(g("pipe resume"),n.resume()),e},M.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;ae._pos){var r=n.substr(e._pos);if("x-user-defined"===e._charset){for(var o=new i(r.length),s=0;se._pos&&(e.push(new i(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){e.push(null)},l.readAsArrayBuffer(n)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}},{"./capability":"p5a1",inherits:"Bm0n","readable-stream":"JaqQ",process:"pBGv",buffer:"dskh"}],AH4k:[function(e,t,n){var r=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(r.isBuffer(e)){for(var t=new Uint8Array(e.length),n=e.length,i=0;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=Math.floor,v=String.fromCharCode;function y(e){throw new RangeError(m[e])}function b(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function _(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+b((e=e.replace(p,".")).split("."),t).join(".")}function x(e){for(var t,n,r=[],i=0,a=e.length;i=55296&&t<=56319&&i65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function M(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,n){var r=0;for(e=n?g(e/700):e>>1,e+=g(e/t);e>455;r+=h)e=g(e/35);return g(r+36*e/(e+38))}function T(e){var t,n,r,i,a,o,s,l,c,d,f,p=[],m=e.length,v=0,b=128,_=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&y("not-basic"),p.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=m&&y("invalid-input"),((l=(f=e.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:h)>=h||l>g((u-v)/o))&&y("overflow"),v+=l*o,!(l<(c=s<=_?1:s>=_+26?26:s-_));s+=h)o>g(u/(d=h-c))&&y("overflow"),o*=d;_=S(v-a,t=p.length+1,0==a),g(v/t)>u-b&&y("overflow"),b+=g(v/t),v%=t,p.splice(v++,0,b)}return w(p)}function E(e){var t,n,r,i,a,o,s,l,c,d,f,p,m,b,_,w=[];for(p=(e=x(e)).length,t=128,n=0,a=72,o=0;o=t&&fg((u-n)/(m=r+1))&&y("overflow"),n+=(s-t)*m,t=s,o=0;ou&&y("overflow"),f==t){for(l=n,c=h;!(l<(d=c<=a?1:c>=a+26?26:c-a));c+=h)_=l-d,b=h-d,w.push(v(M(d+_%b,0))),l=g(_/b);w.push(v(M(l,0))),a=S(n,m,r==i),n=0,++r}++n,++t}return w.join("")}if(l={version:"1.4.1",ucs2:{decode:x,encode:w},decode:T,encode:E,toASCII:function(e){return _(e,(function(e){return f.test(e)?"xn--"+E(e):e}))},toUnicode:function(e){return _(e,(function(e){return d.test(e)?T(e.slice(4).toLowerCase()):e}))}},"function"==typeof r&&"object"==typeof r.amd&&r.amd)r("punycode",(function(){return l}));else if(a&&o)if(t.exports==a)o.exports=l;else for(c in l)l.hasOwnProperty(c)&&(a[c]=l[c]);else e.punycode=l}(this)},{}],YsIc:[function(e,t,n){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],J6GP:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,a){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var c=e.length;l>0&&c>l&&(c=l);for(var u=0;u=0?(h=m.substr(0,g),d=m.substr(g+1)):(h=m,d=""),f=decodeURIComponent(h),p=decodeURIComponent(d),r(o,f)?i(o[f])?o[f].push(p):o[f]=[o[f],p]:o[f]=p}return o};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],bvhO:[function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?a(o(e),(function(o){var s=encodeURIComponent(r(o))+n;return i(e[o])?a(e[o],(function(e){return s+encodeURIComponent(r(e))})).join(t):s+encodeURIComponent(r(e[o]))})).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),h=["%","/","?",";","#"].concat(u),d=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=e("querystring");function b(e,t,n){if(e&&i.isObject(e)&&e instanceof a)return e;var r=new a;return r.parse(e,t,n),r}a.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),s=-1!==a&&a127?k+="x":k+=O[I];if(!k.match(f)){var D=L.slice(0,C),j=L.slice(C+1),F=O.match(p);F&&(D.push(F[1]),j.unshift(F[2])),j.length&&(b="/"+j.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=r.toASCII(this.hostname));var z=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+z,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[w])for(C=0,R=u.length;C0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift())),n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!M.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var T=M.slice(-1)[0],E=(n.host||e.host||M.length>1)&&("."===T||".."===T)||""===T,C=0,A=M.length;A>=0;A--)"."===(T=M[A])?M.splice(A,1):".."===T?(M.splice(A,1),C++):C&&(M.splice(A,1),C--);if(!x&&!w)for(;C--;C)M.unshift("..");!x||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),E&&"/"!==M.join("/").substr(-1)&&M.push("");var P,L=""===M[0]||M[0]&&"/"===M[0].charAt(0);return S&&(n.hostname=n.host=L?"":M.length?M.shift():"",(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift())),(x=x||n.host&&M.length)&&!L&&M.unshift(""),M.length?n.pathname=M.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},a.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:"oWqx","./util":"YsIc",querystring:"fk5h"}],KKrj:[function(e,t,n){var r=arguments[3],i=e("./lib/request"),a=e("./lib/response"),o=e("xtend"),s=e("builtin-status-codes"),l=e("url"),c=n;c.request=function(e,t){e="string"==typeof e?l.parse(e):o(e);var n=-1===r.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||n,s=e.hostname||e.host,c=e.port,u=e.path||"/";s&&-1!==s.indexOf(":")&&(s="["+s+"]"),e.url=(s?a+"//"+s:"")+(c?":"+c:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var h=new i(e);return t&&h.on("response",t),h},c.get=function(e,t){var n=c.request(e,t);return n.end(),n},c.ClientRequest=i,c.IncomingMessage=a.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=s,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},{"./lib/request":"yL7F","./lib/response":"UxIR",xtend:"K5Tb","builtin-status-codes":"OpTI",url:"Mej7"}],wVMl:[function(e,t,n){var r=e("http"),i=e("url"),a=t.exports;for(var o in r)r.hasOwnProperty(o)&&(a[o]=r[o]);function s(e){if("string"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}a.request=function(e,t){return e=s(e),r.request.call(this,e,t)},a.get=function(e,t){return e=s(e),r.get.call(this,e,t)}},{http:"KKrj",url:"Mej7"}],SHlS:[function(e,t,n){e("buffer").Buffer;var r=e("buffer").Buffer;Object.defineProperty(n,"__esModule",{value:!0}),n.HttpClient=void 0;var i=v(e("@babel/runtime/helpers/defineProperty")),a=v(e("@babel/runtime/regenerator")),o=v(e("@babel/runtime/helpers/asyncToGenerator")),s=v(e("@babel/runtime/helpers/classCallCheck")),l=v(e("@babel/runtime/helpers/createClass")),c=v(e("@babel/runtime/helpers/inherits")),u=v(e("@babel/runtime/helpers/possibleConstructorReturn")),h=v(e("@babel/runtime/helpers/getPrototypeOf")),d=v(e("http")),f=v(e("https")),p=v(e("url")),m=e("./base"),g=e("../../utils");function v(e){return e&&e.__esModule?e:{default:e}}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t0&&void 0!==o[0]?o[0]:{},n=t.headers,r=t.signal,e.next=3,this.constructRequest(n,r);case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(m.BaseClient);n.HttpClient=w},{"@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0",http:"KKrj",https:"wVMl",url:"Mej7","./base":"uL1U","../../utils":"FOZT",buffer:"dskh"}],itmA:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeFetchSource=M,n.makeXHRSource=S,n.makeHttpSource=T,n.makeRemoteSource=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.forceXHR,i=void 0!==n&&n,a=(0,r.default)(t,["forceXHR"]);return"function"!=typeof fetch||i?"undefined"!=typeof XMLHttpRequest?S(e,a):T(e,a):M(e,a)};var r=y(e("@babel/runtime/helpers/objectWithoutProperties")),i=y(e("@babel/runtime/helpers/defineProperty")),a=y(e("@babel/runtime/regenerator")),o=y(e("@babel/runtime/helpers/asyncToGenerator")),s=y(e("@babel/runtime/helpers/classCallCheck")),l=y(e("@babel/runtime/helpers/createClass")),c=y(e("@babel/runtime/helpers/inherits")),u=y(e("@babel/runtime/helpers/possibleConstructorReturn")),h=y(e("@babel/runtime/helpers/getPrototypeOf")),d=e("./httputils"),f=e("./basesource"),p=e("./blockedsource"),m=e("./client/fetch"),g=e("./client/xhr"),v=e("./client/http");function y(e){return e&&e.__esModule?e:{default:e}}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t=t.length)){e.next=4;break}return e.abrupt("return",this.fetchSlices(t,n));case 4:this.maxRanges>0&&t.length;case 5:return e.next=7,Promise.all(t.map((function(e){return r.fetchSlice(e,n)})));case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fetchSlices",value:function(){var e=(0,o.default)(a.default.mark((function e(t,n){var r,i,o,s,l,c,u,h,f,p,m,g,v,y=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.request({headers:_(_({},this.headers),{},{Range:"bytes=".concat(t.map((function(e){var t=e.offset,n=e.length;return"".concat(t,"-").concat(t+n)})).join(","))}),signal:n});case 2:if((r=e.sent).ok){e.next=7;break}throw new Error("Error fetching data.");case 7:if(206!==r.status){e.next=32;break}if(i=(0,d.parseContentType)(r.getHeader("content-type")),o=i.type,s=i.params,"multipart/byteranges"!==o){e.next=18;break}return e.t0=d.parseByteRanges,e.next=13,r.getData();case 13:return e.t1=e.sent,e.t2=s.boundary,l=(0,e.t0)(e.t1,e.t2),this._fileSize=l[0].fileSize||null,e.abrupt("return",l);case 18:return e.next=20,r.getData();case 20:if(c=e.sent,u=(0,d.parseContentRange)(r.getHeader("content-range")),h=u.start,f=u.end,p=u.total,this._fileSize=p||null,m=[{data:c,offset:h,length:f-h}],!(t.length>1)){e.next=29;break}return e.next=27,Promise.all(t.slice(1).map((function(e){return y.fetchSlice(e,n)})));case 27:return g=e.sent,e.abrupt("return",m.concat(g));case 29:return e.abrupt("return",m);case 32:if(this.allowFullFile){e.next=34;break}throw new Error("Server responded with full file");case 34:return e.next=36,r.getData();case 36:return v=e.sent,this._fileSize=v.byteLength,e.abrupt("return",[{data:v,offset:0,length:v.byteLength}]);case 39:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fetchSlice",value:function(){var e=(0,o.default)(a.default.mark((function e(t,n){var r,i,o,s,l,c,u;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.offset,i=t.length,e.next=3,this.client.request({headers:_(_({},this.headers),{},{Range:"bytes=".concat(r,"-").concat(r+i)}),signal:n});case 3:if((o=e.sent).ok){e.next=8;break}throw new Error("Error fetching data.");case 8:if(206!==o.status){e.next=17;break}return e.next=11,o.getData();case 11:return s=e.sent,l=(0,d.parseContentRange)(o.getHeader("content-range")),c=l.total,this._fileSize=c||null,e.abrupt("return",{data:s,offset:r,length:i});case 17:if(this.allowFullFile){e.next=19;break}throw new Error("Server responded with full file");case 19:return e.next=21,o.getData();case 21:return u=e.sent,this._fileSize=u.byteLength,e.abrupt("return",{data:u,offset:0,length:u.byteLength});case 24:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fileSize",get:function(){return this._fileSize}}]),n}(f.BaseSource);function w(e,t){var n=t.blockSize,r=t.cacheSize;return null===n?e:new p.BlockedSource(e,n,r)}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.headers,i=void 0===n?{}:n,a=t.credentials,o=t.maxRanges,s=void 0===o?0:o,l=t.allowFullFile,c=void 0!==l&&l,u=(0,r.default)(t,["headers","credentials","maxRanges","allowFullFile"]),h=new m.FetchClient(e,a);return w(new x(h,i,s,c),u)}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.headers,i=void 0===n?{}:n,a=t.maxRanges,o=void 0===a?0:a,s=t.allowFullFile,l=void 0!==s&&s,c=(0,r.default)(t,["headers","maxRanges","allowFullFile"]),u=new g.XHRClient(e);return w(new x(u,i,o,l),c)}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.headers,i=void 0===n?{}:n,a=t.maxRanges,o=void 0===a?0:a,s=t.allowFullFile,l=void 0!==s&&s,c=(0,r.default)(t,["headers","maxRanges","allowFullFile"]),u=new v.HttpClient(e);return w(new x(u,i,o,l),c)}},{"@babel/runtime/helpers/objectWithoutProperties":"U8F3","@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./httputils":"ZJpj","./basesource":"LzCD","./blockedsource":"xD7g","./client/fetch":"Un5s","./client/xhr":"hvgd","./client/http":"SHlS"}],wM9h:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeBufferSource=function(e){return new h(e)};var r=u(e("@babel/runtime/helpers/classCallCheck")),i=u(e("@babel/runtime/helpers/createClass")),a=u(e("@babel/runtime/helpers/inherits")),o=u(e("@babel/runtime/helpers/possibleConstructorReturn")),s=u(e("@babel/runtime/helpers/getPrototypeOf")),l=e("./basesource"),c=e("../utils");function u(e){return e&&e.__esModule?e:{default:e}}var h=function(e){(0,a.default)(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var i=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}(n);function n(e){var i;return(0,r.default)(this,n),(i=t.call(this)).arrayBuffer=e,i}return(0,i.default)(n,[{key:"fetchSlice",value:function(e,t){if(t&&t.aborted)throw new c.AbortError("Request aborted");return this.arrayBuffer.slice(e.offset,e.offset+e.length)}}]),n}(l.BaseSource)},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./basesource":"LzCD","../utils":"FOZT"}],GiEG:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeFileReaderSource=function(e){return new h(e)};var r=u(e("@babel/runtime/regenerator")),i=u(e("@babel/runtime/helpers/asyncToGenerator")),a=u(e("@babel/runtime/helpers/classCallCheck")),o=u(e("@babel/runtime/helpers/createClass")),s=u(e("@babel/runtime/helpers/inherits")),l=u(e("@babel/runtime/helpers/possibleConstructorReturn")),c=u(e("@babel/runtime/helpers/getPrototypeOf"));function u(e){return e&&e.__esModule?e:{default:e}}var h=function(e){(0,s.default)(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var i=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}(n);function n(e){var r;return(0,a.default)(this,n),(r=t.call(this)).file=e,r}return(0,o.default)(n,[{key:"fetchSlice",value:function(){var e=(0,i.default)(r.default.mark((function e(t,n){var i=this;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var a=i.file.slice(t.offset,t.offset+t.length),o=new FileReader;o.onload=function(t){return e(t.target.result)},o.onerror=r,o.onabort=r,o.readAsArrayBuffer(a),n&&n.addEventListener("abort",(function(){return o.abort()}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(e("./basesource").BaseSource)},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","./basesource":"LzCD"}],G7Cz:[function(e,t,n){e("buffer").Buffer;var r=e("buffer").Buffer;Object.defineProperty(n,"__esModule",{value:!0}),n.makeFileSource=function(e){return new m(e)};var i=d(e("@babel/runtime/regenerator")),a=d(e("@babel/runtime/helpers/asyncToGenerator")),o=d(e("@babel/runtime/helpers/classCallCheck")),s=d(e("@babel/runtime/helpers/createClass")),l=d(e("@babel/runtime/helpers/inherits")),c=d(e("@babel/runtime/helpers/possibleConstructorReturn")),u=d(e("@babel/runtime/helpers/getPrototypeOf")),h=e("fs");function d(e){return e&&e.__esModule?e:{default:e}}function f(e){return new Promise((function(t,n){(0,h.close)(e,(function(e){e?n(e):t()}))}))}function p(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:void 0;return new Promise((function(r,i){(0,h.open)(e,t,n,(function(e,t){e?i(e):r(t)}))}))}(e,"r"),r}return(0,s.default)(n,[{key:"fetchSlice",value:function(){var e=(0,a.default)(i.default.mark((function e(t){var n,a,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.openRequest;case 2:return n=e.sent,e.next=5,p(n,r.alloc(t.length),0,t.length,t.offset);case 5:return a=e.sent,o=a.buffer,e.abrupt("return",o.buffer);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=(0,a.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.openRequest;case 2:return t=e.sent,e.next=5,f(t);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(e("./basesource").BaseSource)},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0",fs:"rDCW","./basesource":"LzCD",buffer:"dskh"}],BGyE:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.writeGeotiff=function(e,t){var n,a,o,s;"number"==typeof e[0]?(n=t.height||t.ImageLength,o=t.width||t.ImageWidth,a=e.length/(n*o),s=e):(a=e.length,n=e[0].length,o=e[0][0].length,s=[],(0,i.times)(n,(function(t){(0,i.times)(o,(function(n){(0,i.times)(a,(function(r){s.push(e[r][t][n])}))}))}))),t.ImageLength=n,delete t.height,t.ImageWidth=o,delete t.width,t.BitsPerSample||(t.BitsPerSample=(0,i.times)(a,(function(){return 8}))),g.forEach((function(e){var n=e[0];if(!t[n]){var r=e[1];t[n]=r}})),t.PhotometricInterpretation||(t.PhotometricInterpretation=3===t.BitsPerSample.length?2:1),t.SamplesPerPixel||(t.SamplesPerPixel=[a]),t.StripByteCounts||(t.StripByteCounts=[a*n*o]),t.ModelPixelScale||(t.ModelPixelScale=[360/o,180/n,0]),t.SampleFormat||(t.SampleFormat=(0,i.times)(a,(function(){return 1})));var l=Object.keys(t).filter((function(e){return(0,i.endsWith)(e,"GeoKey")})).sort((function(e,t){return u[e]-u[t]}));if(!t.GeoKeyDirectory){var c=[1,1,0,l.length];l.forEach((function(e){var n,i,a,o=Number(u[e]);c.push(o),"SHORT"===r.fieldTagTypes[o]?(n=1,i=0,a=t[e]):"GeogCitationGeoKey"===e?(n=t.GeoAsciiParams.length,i=Number(u.GeoAsciiParams),a=0):console.log("[geotiff.js] couldn't get TIFFTagLocation for ".concat(e)),c.push(i),c.push(n),c.push(a)})),t.GeoKeyDirectory=c}for(var h in l)l.hasOwnProperty(h)&&delete t[h];["Compression","ExtraSamples","GeographicTypeGeoKey","GTModelTypeGeoKey","GTRasterTypeGeoKey","ImageLength","ImageWidth","PhotometricInterpretation","PlanarConfiguration","ResolutionUnit","SamplesPerPixel","XPosition","YPosition"].forEach((function(e){t[e]&&(t[e]=function(e){return Array.isArray(e)?e:[e]}(t[e]))}));var d=function(e){var t={};for(var n in e)"StripOffsets"!==n&&(u[n]||console.error(n,"not in name2code:",Object.keys(u)),t[u[n]]=e[n]);return t}(t);return m(s,o,n,d)};var r=e("./globals"),i=e("./utils");function a(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}function o(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n>8&255,e[t+1]=255&n},writeUint:function(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=n>>0&255},writeASCII:function(e,t,n){(0,i.times)(n.length,(function(r){e[t+r]=n.charCodeAt(r)}))},ui8:new Uint8Array(8)};f.fl64=new Float64Array(f.ui8.buffer),f.writeDouble=function(e,t,n){f.fl64[0]=n,(0,i.times)(8,(function(n){e[t+n]=f.ui8[7-n]}))};var p=function(e,t,n,o){var s=n,l=Object.keys(o).filter((function(e){return null!=e&&"undefined"!==e}));e.writeUshort(t,s,l.length);var c,u=(s+=2)+12*l.length+4,d=a(l);try{var f=function(){var n=c.value,a=null;"number"==typeof n?a=n:"string"==typeof n&&(a=parseInt(n,10));var l=r.fieldTagTypes[a],d=h[l];if(null==l||void 0===l||void 0===l)throw new Error("unknown type of tag: ".concat(a));var f=o[n];if(void 0===f)throw new Error("failed to get value for key ".concat(n));"ASCII"===l&&"string"==typeof f&&!1===(0,i.endsWith)(f,"\0")&&(f+="\0");var p=f.length;e.writeUshort(t,s,a),s+=2,e.writeUshort(t,s,d),s+=2,e.writeUint(t,s,p);var m=[-1,1,1,2,4,8,0,0,0,0,0,0,8][d]*p,g=s+=4;m>4&&(e.writeUint(t,s,u),g=u),"ASCII"===l?e.writeASCII(t,g,f):"SHORT"===l?(0,i.times)(p,(function(n){e.writeUshort(t,g+2*n,f[n])})):"LONG"===l?(0,i.times)(p,(function(n){e.writeUint(t,g+4*n,f[n])})):"RATIONAL"===l?(0,i.times)(p,(function(n){e.writeUint(t,g+8*n,Math.round(1e4*f[n])),e.writeUint(t,g+8*n+4,1e4)})):"DOUBLE"===l&&(0,i.times)(p,(function(n){e.writeDouble(t,g+8*n,f[n])})),m>4&&(u+=m+=1&m),s+=4};for(d.s();!(c=d.n()).done;)f()}catch(e){d.e(e)}finally{d.f()}return[s,u]},m=function(e,t,n,r){if(null==n)throw new Error("you passed into encodeImage a width of type ".concat(n));if(null==t)throw new Error("you passed into encodeImage a width of type ".concat(t));var a={256:[t],257:[n],273:[d],278:[n],305:"geotiff.js"};if(r)for(var o in r)r.hasOwnProperty(o)&&(a[o]=r[o]);var s=new Uint8Array(function(e){var t=new Uint8Array(d),n=4,r=f;t[0]=77,t[1]=77,t[3]=42;var i=8;if(r.writeUint(t,n,i),n+=4,e.forEach((function(n,a){var o=p(r,t,i,n);i=o[1],a0&&void 0!==arguments[0]?arguments[0]:new o;s=e},n.debug=function(){var e;return(e=s).debug.apply(e,arguments)},n.log=function(){var e;return(e=s).log.apply(e,arguments)},n.info=function(){var e;return(e=s).info.apply(e,arguments)},n.warn=function(){var e;return(e=s).warn.apply(e,arguments)},n.error=function(){var e;return(e=s).error.apply(e,arguments)},n.time=function(){var e;return(e=s).time.apply(e,arguments)},n.timeEnd=function(){var e;return(e=s).timeEnd.apply(e,arguments)};var r=a(e("@babel/runtime/helpers/classCallCheck")),i=a(e("@babel/runtime/helpers/createClass"));function a(e){return e&&e.__esModule?e:{default:e}}var o=function(){function e(){(0,r.default)(this,e)}return(0,i.default)(e,[{key:"log",value:function(){}},{key:"debug",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}},{key:"time",value:function(){}},{key:"timeEnd",value:function(){}}]),e}(),s=new o},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW"}],bsJs:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.fromUrl=function(e){return U.apply(this,arguments)},n.fromArrayBuffer=function(e,t){return H.apply(this,arguments)},n.fromFile=function(e,t){return G.apply(this,arguments)},n.fromBlob=function(e,t){return W.apply(this,arguments)},n.fromUrls=function(e){return V.apply(this,arguments)},n.writeArrayBuffer=function(e,t){return q.apply(this,arguments)},Object.defineProperty(n,"Pool",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(n,"getDecoder",{enumerable:!0,get:function(){return S.getDecoder}}),Object.defineProperty(n,"setLogger",{enumerable:!0,get:function(){return T.setLogger}}),n.rgb=n.globals=n.MultiGeoTIFF=n.default=n.GeoTIFF=void 0;var r=A(e("@babel/runtime/regenerator")),i=A(e("@babel/runtime/helpers/defineProperty")),a=A(e("@babel/runtime/helpers/slicedToArray")),o=A(e("@babel/runtime/helpers/asyncToGenerator")),s=A(e("@babel/runtime/helpers/createClass")),l=A(e("@babel/runtime/helpers/inherits")),c=A(e("@babel/runtime/helpers/possibleConstructorReturn")),u=A(e("@babel/runtime/helpers/getPrototypeOf")),h=A(e("@babel/runtime/helpers/wrapNativeSuper")),d=A(e("@babel/runtime/helpers/classCallCheck")),f=A(e("./geotiffimage")),p=A(e("./dataview64")),m=A(e("./dataslice")),g=A(e("./pool")),v=e("./source/remote"),y=e("./source/arraybuffer"),b=e("./source/filereader"),_=e("./source/file"),x=C(e("./globals"));n.globals=x;var w=e("./geotiffwriter"),M=C(e("./rgb"));n.rgb=M;var S=e("./compression"),T=e("./logging");function E(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return E=function(){return e},e}function C(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=E();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function A(e){return e&&e.__esModule?e:{default:e}}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t0&&void 0!==G[0]?G[0]:{},n=t.window,i=t.width,o=t.height,s=t.resX,l=t.resY,c=t.bbox,e.next=5,this.getImage();case 5:return u=e.sent,h=u,e.next=9,this.getImageCount();case 9:if(d=e.sent,f=u.getBoundingBox(),!n||!c){e.next=13;break}throw new Error('Both "bbox" and "window" passed.');case 13:if(!i&&!o){e.next=24;break}if(n&&(p=u.getOrigin(),m=(0,a.default)(p,2),g=m[0],v=m[1],y=u.getResolution(),b=(0,a.default)(y,2),_=b[0],x=b[1],c=[g+n[0]*_,v+n[1]*x,g+n[2]*_,v+n[3]*x]),w=c||f,!i){e.next=20;break}if(!s){e.next=19;break}throw new Error("Both width and resX passed");case 19:s=(w[2]-w[0])/i;case 20:if(!o){e.next=24;break}if(!l){e.next=23;break}throw new Error("Both width and resY passed");case 23:l=(w[3]-w[1])/o;case 24:if(!s&&!l){e.next=48;break}M=[],S=0;case 27:if(!(SO||l&&l>k)){e.next=45;break}return e.abrupt("break",48);case 45:++P,e.next=38;break;case 48:return I=n,c&&(N=u.getOrigin(),D=(0,a.default)(N,2),j=D[0],F=D[1],z=h.getResolution(u),B=(0,a.default)(z,2),U=B[0],H=B[1],I=[Math.round((c[0]-j)/U),Math.round((c[1]-F)/H),Math.round((c[2]-j)/U),Math.round((c[3]-F)/H)],I=[Math.min(I[0],I[2]),Math.min(I[1],I[3]),Math.max(I[0],I[2]),Math.max(I[1],I[3])]),e.abrupt("return",h.readRasters(L(L({},t),{},{window:I})));case 51:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),F=function(e){(0,l.default)(n,e);var t=R(n);function n(e,r,i,a){var o,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(0,d.default)(this,n),(o=t.call(this)).source=e,o.littleEndian=r,o.bigTiff=i,o.firstIFDOffset=a,o.cache=s.cache||!1,o.ifdRequests=[],o.ghostValues=null,o}return(0,s.default)(n,[{key:"getSlice",value:function(){var e=(0,o.default)(r.default.mark((function e(t,n){var i;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.bigTiff?4048:1024,e.t0=m.default,e.next=4,this.source.fetch([{offset:t,length:void 0!==n?n:i}]);case 4:return e.t1=e.sent[0],e.t2=t,e.t3=this.littleEndian,e.t4=this.bigTiff,e.abrupt("return",new e.t0(e.t1,e.t2,e.t3,e.t4));case 9:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"parseFileDirectoryAt",value:function(){var e=(0,o.default)(r.default.mark((function e(t){var n,i,a,o,s,l,c,u,h,d,f,p,m,g,v,y,b,_,w,M;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.bigTiff?20:12,i=this.bigTiff?8:2,e.next=4,this.getSlice(t);case 4:if(a=e.sent,o=this.bigTiff?a.readUint64(t):a.readUint16(t),s=o*n+(this.bigTiff?16:6),a.covers(t,s)){e.next=11;break}return e.next=10,this.getSlice(t,s);case 10:a=e.sent;case 11:l={},c=t+(this.bigTiff?8:2),u=0;case 14:if(!(u0&&void 0!==i[0]?i[0]:0,e.next=3,this.requestIFD(t);case 3:return n=e.sent,e.abrupt("return",new f.default(n.fileDirectory,n.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getImageCount",value:function(){var e=(0,o.default)(r.default.mark((function e(){var t,n;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0,n=!0;case 2:if(!n){e.next=18;break}return e.prev=3,e.next=6,this.requestIFD(t);case 6:++t,e.next=16;break;case 9:if(e.prev=9,e.t0=e.catch(3),!(e.t0 instanceof D)){e.next=15;break}n=!1,e.next=16;break;case 15:throw e.t0;case 16:e.next=2;break;case 18:return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,this,[[3,9]])})));return function(){return e.apply(this,arguments)}}()},{key:"getGhostValues",value:function(){var e=(0,o.default)(r.default.mark((function e(){var t,n,i,o,s,l,c,u,h=this;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.bigTiff?16:8,!this.ghostValues){e.next=3;break}return e.abrupt("return",this.ghostValues);case 3:return i=(n="GDAL_STRUCTURAL_METADATA_SIZE=").length+100,e.next=7,this.getSlice(t,i);case 7:if(o=e.sent,n!==I(o,x.fieldTypes.ASCII,n.length,t)){e.next=19;break}if(s=I(o,x.fieldTypes.ASCII,i,t),l=s.split("\n")[0],!((c=Number(l.split("=")[1].split(" ")[0])+l.length)>i)){e.next=16;break}return e.next=15,this.getSlice(t,c);case 15:o=e.sent;case 16:u=I(o,x.fieldTypes.ASCII,c,t),this.ghostValues={},u.split("\n").filter((function(e){return e.length>0})).map((function(e){return e.split("=")})).forEach((function(e){var t=(0,a.default)(e,2),n=t[0],r=t[1];h.ghostValues[n]=r}));case 19:return e.abrupt("return",this.ghostValues);case 20:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){return"function"==typeof this.source.close&&this.source.close()}}],[{key:"fromSource",value:function(){var e=(0,o.default)(r.default.mark((function e(t,i,a){var o,s,l,c,u,h,d;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.fetch([{offset:0,length:1024}],a);case 2:if(o=e.sent[0],s=new p.default(o),18761!==(l=s.getUint16(0,0))){e.next=9;break}c=!0,e.next=14;break;case 9:if(19789!==l){e.next=13;break}c=!1,e.next=14;break;case 13:throw new TypeError("Invalid byte order value.");case 14:if(42!==(u=s.getUint16(2,c))){e.next=19;break}h=!1,e.next=27;break;case 19:if(43!==u){e.next=26;break}if(h=!0,8===s.getUint16(4,c)){e.next=24;break}throw new Error("Unsupported offset byte-size.");case 24:e.next=27;break;case 26:throw new TypeError("Invalid magic number.");case 27:return d=h?s.getUint64(8,c):s.getUint32(4,c),e.abrupt("return",new n(t,c,h,d,i));case 29:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()}]),n}(j);n.GeoTIFF=F;var z=F;n.default=z;var B=function(e){(0,l.default)(n,e);var t=R(n);function n(e,r){var i;return(0,d.default)(this,n),(i=t.call(this)).mainFile=e,i.overviewFiles=r,i.imageFiles=[e].concat(r),i.fileDirectoriesPerFile=null,i.fileDirectoriesPerFileParsing=null,i.imageCount=null,i}return(0,s.default)(n,[{key:"parseFileDirectoriesPerFile",value:function(){var e=(0,o.default)(r.default.mark((function e(){var t;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map((function(e){return e.parseFileDirectoryAt(e.firstIFDOffset)}))),e.next=3,Promise.all(t);case 3:return this.fileDirectoriesPerFile=e.sent,e.abrupt("return",this.fileDirectoriesPerFile);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getImage",value:function(){var e=(0,o.default)(r.default.mark((function e(){var t,n,i,a,o,s,l,c=arguments;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:0,e.next=3,this.getImageCount();case 3:return e.next=5,this.parseFileDirectoriesPerFile();case 5:n=0,i=0,a=0;case 8:if(!(a1&&void 0!==a[1]?a[1]:{},i=a.length>2?a[2]:void 0,e.abrupt("return",F.fromSource((0,v.makeRemoteSource)(t,n),i));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return(H=(0,o.default)(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",F.fromSource((0,y.makeBufferSource)(t),n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(){return(G=(0,o.default)(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",F.fromSource((0,_.makeFileSource)(t),n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(){return(W=(0,o.default)(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",F.fromSource((0,b.makeFileReaderSource)(t),n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(){return(V=(0,o.default)(r.default.mark((function e(t){var n,i,a,o,s,l=arguments;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>1&&void 0!==l[1]?l[1]:[],i=l.length>2&&void 0!==l[2]?l[2]:{},a=l.length>3?l[3]:void 0,e.next=5,F.fromSource((0,v.makeRemoteSource)(t,i),a);case 5:return o=e.sent,e.next=8,Promise.all(n.map((function(e){return F.fromSource((0,v.makeRemoteSource)(e,i))})));case 8:return s=e.sent,e.abrupt("return",new B(o,s));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return(q=(0,o.default)(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,w.writeGeotiff)(t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}n.MultiGeoTIFF=B},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/helpers/wrapNativeSuper":"ozpi","@babel/runtime/helpers/classCallCheck":"fcMS","./geotiffimage":"eOWo","./dataview64":"dqpX","./dataslice":"dGLV","./pool":"dHPO","./source/remote":"itmA","./source/arraybuffer":"wM9h","./source/filereader":"GiEG","./source/file":"G7Cz","./globals":"j27V","./geotiffwriter":"BGyE","./rgb":"fpBl","./compression":"FGCZ","./logging":"dy4f"}]},{},["bsJs"])},function(e,t,n){var r=n(7),i=n(0),a=n(1),o=n(9).default,s=a.featureEach,l=(a.coordEach,i.polygon,i.featureCollection);function c(e){var t=r(e);return t.insert=function(e){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:o(e),r.prototype.insert.call(this,e)},t.load=function(e){var t=[];return Array.isArray(e)?e.forEach((function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:o(e),t.push(e)})):s(e,(function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:o(e),t.push(e)})),r.prototype.load.call(this,t)},t.remove=function(e,t){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:o(e),r.prototype.remove.call(this,e,t)},t.clear=function(){return r.prototype.clear.call(this)},t.search=function(e){var t=r.prototype.search.call(this,this.toBBox(e));return l(t)},t.collides=function(e){return r.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=r.prototype.all.call(this);return l(e)},t.toJSON=function(){return r.prototype.toJSON.call(this)},t.fromJSON=function(e){return r.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var t;if(e.bbox)t=e.bbox;else if(Array.isArray(e)&&4===e.length)t=e;else if(Array.isArray(e)&&6===e.length)t=[e[0],e[1],e[3],e[4]];else if("Feature"===e.type)t=o(e);else{if("FeatureCollection"!==e.type)throw new Error("invalid geojson");t=o(e)}return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}e.exports=c,e.exports.default=c},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var a=0;a=e.minX&&t.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,t,n,i,a){for(var o,s=[t,n];s.length;)(n=s.pop())-(t=s.pop())<=i||(o=t+Math.ceil((n-t)/i/2)*i,r(e,o,t,n,a),s.push(t,o,o,n))}i.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,n=[],r=this.toBBox;if(!p(e,t))return n;for(var i,a,o,s,l=[];t;){for(i=0,a=t.children.length;i=0&&a[t].children.length>this._maxEntries;)this._split(a,t),t--;this._adjustParentBBoxes(i,a,t)},_split:function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(e,t){this.data=m([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,n){var r,i,a,o,l,c,u,d,f,p,m,g,v,y;for(c=u=1/0,r=t;r<=n-t;r++)i=s(e,0,r,this.toBBox),a=s(e,r,n,this.toBBox),f=i,p=a,m=void 0,g=void 0,v=void 0,y=void 0,m=Math.max(f.minX,p.minX),g=Math.max(f.minY,p.minY),v=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,v-m)*Math.max(0,y-g),l=h(i)+h(a),o=t;i--)a=e.children[i],l(u,e.leaf?o(a):a),h+=d(u);return h},_adjustParentBBoxes:function(e,t,n){for(var r=n;r>=0;r--)l(t[r],e)},_condense:function(e){for(var t,n=e.length-1;n>=0;n--)0===e[n].children.length?n>0?(t=e[n-1].children).splice(t.indexOf(e[n]),1):this.clear():o(e[n],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},function(e,t,n){e.exports=function(){"use strict";function e(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function t(e,t){return et?1:0}return function(n,r,i,a,o){!function t(n,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,l=r-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1),d=Math.max(i,Math.floor(r-l*u/s+h)),f=Math.min(a,Math.floor(r+(s-l)*u/s+h));t(n,r,d,f,o)}var p=n[r],m=i,g=a;for(e(n,i,r),o(n[a],p)>0&&e(n,i,a);m0;)g--}0===o(n[i],p)?e(n,i,g):(g++,e(n,g,a)),g<=r&&(i=g+1),r<=g&&(a=g-1)}}(n,r,i||0,a||n.length-1,o||t)}}()},function(e,t,n){"use strict";n.r(t);var r=n(1);function i(e){var t=[1/0,1/0,-1/0,-1/0];return Object(r.coordEach)(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]1)for(var n=1;ndiv{width:60px;height:60px;background:rgba(255,255,255,0);position:absolute;left:50%;margin-left:-30px;top:50%;margin-top:-5px;border-radius:2px;border:2px solid rgba(255,255,255,0.7)}@-webkit-keyframes translateIn{30%{transform:rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);opacity:0.7;background:rgba(255,255,255,0.3)}100%{transform:rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);opacity:0;background:rgba(255,255,255,0)}}@keyframes translateIn{30%{transform:rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);opacity:0.7;background:rgba(255,255,255,0.3)}100%{transform:rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);opacity:0;background:rgba(255,255,255,0)}}._lithosphere_loadingscreen_loading>div{opacity:0}._lithosphere_loadingscreen_loading>div:nth-of-type(1){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(30px);-webkit-animation:translateIn 1.9s ease-in infinite 500ms;animation:translateIn 1.9s ease-in infinite 500ms}._lithosphere_loadingscreen_loading>div:nth-of-type(2){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(60px);-webkit-animation:translateIn 1.9s ease-in infinite 700ms;animation:translateIn 1.9s ease-in infinite 700ms}._lithosphere_loadingscreen_loading>div:nth-of-type(3){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(85px);-webkit-animation:translateIn 1.9s ease-in infinite 800ms;animation:translateIn 1.9s ease-in infinite 800ms}._lithosphere_loadingscreen_loading>div:nth-of-type(4){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(105px);-webkit-animation:translateIn 1.9s ease-in infinite 1000ms;animation:translateIn 1.9s ease-in infinite 1000ms}._lithosphere_loadingscreen_loading>div:nth-of-type(5){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(120px);-webkit-animation:translateIn 1.9s ease-in infinite 1200ms;animation:translateIn 1.9s ease-in infinite 1200ms}._lithosphere_loadingscreen_loading>div:nth-of-type(6){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(130px);-webkit-animation:translateIn 1.9s ease-in infinite 1400ms;animation:translateIn 1.9s ease-in infinite 1400ms}\n",""]),t.default=i},function(e,t,n){"use strict";n.r(t);const r=0,i=1,a=2;function o(){}Object.assign(o.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}},dispatchEvent:function(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t>8&255]+s[e>>16&255]+s[e>>24&255]+"-"+s[255&t]+s[t>>8&255]+"-"+s[t>>16&15|64]+s[t>>24&255]+"-"+s[63&n|128]+s[n>>8&255]+"-"+s[n>>16&255]+s[n>>24&255]+s[255&r]+s[r>>8&255]+s[r>>16&255]+s[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},damp:function(e,t,n,r){return c.lerp(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(c.euclideanModulo(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(l=e%2147483647),l=16807*l%2147483647,(l-1)/2147483646},degToRad:function(e){return e*c.DEG2RAD},radToDeg:function(e){return e*c.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){const a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),c=a((t+r)/2),u=o((t+r)/2),h=a((t-r)/2),d=o((t-r)/2),f=a((r-t)/2),p=o((r-t)/2);switch(i){case"XYX":e.set(s*u,l*h,l*d,s*c);break;case"YZY":e.set(l*d,s*u,l*h,s*c);break;case"ZXZ":e.set(l*h,l*d,s*u,s*c);break;case"XZX":e.set(s*u,l*p,l*f,s*c);break;case"YXY":e.set(l*f,s*u,l*p,s*c);break;case"ZYZ":e.set(l*p,l*f,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};class u{constructor(e=0,t=0){Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class h{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,a,o,s,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],f=n[8],p=r[0],m=r[3],g=r[6],v=r[1],y=r[4],b=r[7],_=r[2],x=r[5],w=r[8];return i[0]=a*p+o*v+s*_,i[3]=a*m+o*y+s*x,i[6]=a*g+o*b+s*w,i[1]=l*p+c*v+u*_,i[4]=l*m+c*y+u*x,i[7]=l*g+c*b+u*w,i[2]=h*p+d*v+f*_,i[5]=h*m+d*y+f*x,i[8]=h*g+d*b+f*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-n*i*c+n*o*s+r*i*l-r*a*s}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=c*a-o*l,h=o*s-c*i,d=l*i-a*s,f=t*u+n*h+r*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const p=1/f;return e[0]=u*p,e[1]=(r*l-c*n)*p,e[2]=(o*n-r*a)*p,e[3]=h*p,e[4]=(c*t-r*s)*p,e[5]=(r*i-o*t)*p,e[6]=d*p,e[7]=(n*s-l*t)*p,e[8]=(a*t-n*i)*p,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).copy(this).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){const s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],l=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*l,r[6]=t*o+n*c,r[1]=-n*i+t*s,r[4]=-n*a+t*l,r[7]=-n*o+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}}let d;const f={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===d&&(d=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),d.width=e.width,d.height=e.height;const n=d.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=d}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}};let p=0;function m(e=m.DEFAULT_IMAGE,t=m.DEFAULT_MAPPING,n=1001,r=1001,i=1006,a=1008,o=1023,s=1009,l=1,d=3e3){Object.defineProperty(this,"id",{value:p++}),this.uuid=c.generateUUID(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=s,this.offset=new u(0,0),this.repeat=new u(1,1),this.center=new u(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new h,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=d,this.version=0,this.onUpdate=null}function g(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?f.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}m.DEFAULT_IMAGE=void 0,m.DEFAULT_MAPPING=300,m.prototype=Object.assign(Object.create(o.prototype),{constructor:m,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const r=this.image;if(void 0===r.uuid&&(r.uuid=c.generateUUID()),!t&&void 0===e.images[r.uuid]){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(m.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});class v{constructor(e=0,t=0,n=0,r=1){Object.defineProperty(this,"isVector4",{value:!0}),this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const a=e.elements,o=a[0],s=a[4],l=a[8],c=a[1],u=a[5],h=a[9],d=a[2],f=a[6],p=a[10];if(Math.abs(s-c)<.01&&Math.abs(l-d)<.01&&Math.abs(h-f)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+d)<.1&&Math.abs(h+f)<.1&&Math.abs(o+u+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const e=(o+1)/2,a=(u+1)/2,m=(p+1)/2,g=(s+c)/4,v=(l+d)/4,y=(h+f)/4;return e>a&&e>m?e<.01?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=g/n,i=v/n):a>m?a<.01?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(a),n=g/r,i=y/r):m<.01?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(m),n=v/i,r=y/i),this.set(n,r,i,t),this}let m=Math.sqrt((f-h)*(f-h)+(l-d)*(l-d)+(c-s)*(c-s));return Math.abs(m)<.001&&(m=1),this.x=(f-h)/m,this.y=(l-d)/m,this.z=(c-s)/m,this.w=Math.acos((o+u+p-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}class y extends o{constructor(e,t,n){super(),Object.defineProperty(this,"isWebGLRenderTarget",{value:!0}),this.width=e,this.height=t,this.scissor=new v(0,0,e,t),this.scissorTest=!1,this.viewport=new v(0,0,e,t),n=n||{},this.texture=new m(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}setSize(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class b{constructor(e=0,t=0,n=0,r=1){Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return n.copy(e).slerp(t,r)}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3];const h=i[a+0],d=i[a+1],f=i[a+2],p=i[a+3];if(u!==p||s!==h||l!==d||c!==f){let e=1-o;const t=s*h+l*d+c*f+u*p,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,o=Math.sin(o*a)/i}const i=o*n;if(s=s*e+h*i,l=l*e+d*i,c=c*e+f*i,u=u*e+p*i,e===1-o){const e=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=e,l*=e,c*=e,u*=e}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){const o=n[r],s=n[r+1],l=n[r+2],c=n[r+3],u=i[a],h=i[a+1],d=i[a+2],f=i[a+3];return e[t]=o*f+c*u+s*d-l*h,e[t+1]=s*f+c*h+l*u-o*d,e[t+2]=l*f+c*d+o*h-s*u,e[t+3]=c*f-o*u-s*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(r/2),u=o(i/2),h=s(n/2),d=s(r/2),f=s(i/2);switch(a){case"XYZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"YXZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"ZXY":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"ZYX":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"YZX":this._x=h*c*u+l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u-h*d*f;break;case"XZY":this._x=h*c*u-l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u+h*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],l=t[2],c=t[6],u=t[10],h=n+o+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-s)*e,this._y=(i-l)*e,this._z=(a-r)*e}else if(n>o&&n>u){const e=2*Math.sqrt(1+n-o-u);this._w=(c-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+l)/e}else if(o>u){const e=2*Math.sqrt(1+o-n-u);this._w=(i-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+c)/e}else{const e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+l)/e,this._y=(s+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(c.clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+a*o+r*l-i*s,this._y=r*c+a*s+i*o-n*l,this._z=i*c+a*l+n*s-r*o,this._w=a*c-n*o-r*s-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,a=this._w;let o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;const s=1-o*o;if(s<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(s),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=a*u+this._w*h,this._x=n*u+this._x*h,this._y=r*u+this._y*h,this._z=i*u+this._z*h,this._onChangeCallback(),this}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}class _{constructor(e=0,t=0,n=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(w.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(w.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,c=s*n+o*t-i*r,u=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=l*s+h*-i+c*-o-u*-a,this.y=c*s+h*-a+u*-i-l*-o,this.z=u*s+h*-o+l*-a-c*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return x.copy(this).projectOnVector(e),this.sub(x)}reflect(e){return this.sub(x.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(c.clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const x=new _,w=new b;class M{constructor(e,t){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==e?e:new _(1/0,1/0,1/0),this.max=void 0!==t?t:new _(-1/0,-1/0,-1/0)}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0;for(let s=0,l=e.length;si&&(i=l),c>a&&(a=c),u>o&&(o=u)}return this.min.set(t,n,r),this.max.set(i,a,o),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0;for(let s=0,l=e.count;si&&(i=l),c>a&&(a=c),u>o&&(o=u)}return this.min.set(t,n,r),this.max.set(i,a,o),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new _),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,E),E.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(I),N.subVectors(this.max,I),A.subVectors(e.a,I),P.subVectors(e.b,I),L.subVectors(e.c,I),R.subVectors(P,A),O.subVectors(L,P),k.subVectors(A,L);let t=[0,-R.z,R.y,0,-O.z,O.y,0,-k.z,k.y,R.z,0,-R.x,O.z,0,-O.x,k.z,0,-k.x,-R.y,R.x,0,-O.y,O.x,0,-k.y,k.x,0];return!!S(t,A,P,L,N)&&(t=[1,0,0,0,1,0,0,0,1],!!S(t,A,P,L,N)&&(D.crossVectors(R,O),t=[D.x,D.y,D.z],S(t,A,P,L,N)))}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new _),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return E.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(E).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(T[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),T[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),T[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),T[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),T[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),T[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),T[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),T[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(T)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}function S(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){j.fromArray(e,a);const o=i.x*Math.abs(j.x)+i.y*Math.abs(j.y)+i.z*Math.abs(j.z),s=t.dot(j),l=n.dot(j),c=r.dot(j);if(Math.max(-Math.max(s,l,c),Math.min(s,l,c))>o)return!1}return!0}const T=[new _,new _,new _,new _,new _,new _,new _,new _],E=new _,C=new M,A=new _,P=new _,L=new _,R=new _,O=new _,k=new _,I=new _,N=new _,D=new _,j=new _,F=new M;class z{constructor(e,t){this.center=void 0!==e?e:new _,this.radius=void 0!==t?t:-1}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):F.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new M),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}}const B=new _,U=new _,H=new _,G=new _,W=new _,V=new _,q=new _;class X{constructor(e,t){this.origin=void 0!==e?e:new _,this.direction=void 0!==t?t:new _(0,0,-1)}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new _),t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,B)),this}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new _),t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=B.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(B.copy(this.direction).multiplyScalar(t).add(this.origin),B.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){U.copy(e).add(t).multiplyScalar(.5),H.copy(t).sub(e).normalize(),G.copy(this.origin).sub(U);const i=.5*e.distanceTo(t),a=-this.direction.dot(H),o=G.dot(this.direction),s=-G.dot(H),l=G.lengthSq(),c=Math.abs(1-a*a);let u,h,d,f;if(c>0)if(u=a*s-o,h=a*o-s,f=i*c,u>=0)if(h>=-f)if(h<=f){const e=1/c;u*=e,h*=e,d=u*(u+a*h+2*o)+h*(a*u+h+2*s)+l}else h=i,u=Math.max(0,-(a*h+o)),d=-u*u+h*(h+2*s)+l;else h=-i,u=Math.max(0,-(a*h+o)),d=-u*u+h*(h+2*s)+l;else h<=-f?(u=Math.max(0,-(-a*i+o)),h=u>0?-i:Math.min(Math.max(-i,-s),i),d=-u*u+h*(h+2*s)+l):h<=f?(u=0,h=Math.min(Math.max(-i,-s),i),d=h*(h+2*s)+l):(u=Math.max(0,-(a*i+o)),h=u>0?i:Math.min(Math.max(-i,-s),i),d=-u*u+h*(h+2*s)+l);else h=a>0?-i:i,u=Math.max(0,-(a*h+o)),d=-u*u+h*(h+2*s)+l;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(H).multiplyScalar(h).add(U),d}intersectSphere(e,t){B.subVectors(e.center,this.origin);const n=B.dot(this.direction),r=B.dot(B)-n*n,i=e.radius*e.radius;if(r>i)return null;const a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,a=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,a=(e.min.y-h.y)*c),n>a||i>r?null:((i>n||n!=n)&&(n=i),(a=0?(o=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,B)}intersectTriangle(e,t,n,r,i){W.subVectors(t,e),V.subVectors(n,e),q.crossVectors(W,V);let a,o=this.direction.dot(q);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}G.subVectors(this.origin,e);const s=a*this.direction.dot(V.crossVectors(G,V));if(s<0)return null;const l=a*this.direction.dot(W.cross(G));if(l<0)return null;if(s+l>o)return null;const c=-a*G.dot(q);return c<0?null:this.at(c/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}class Y{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,a,o,s,l,c,u,h,d,f,p,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Y).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/Z.setFromMatrixColumn(e,0).length(),i=1/Z.setFromMatrixColumn(e,1).length(),a=1/Z.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=a*c,n=a*u,r=o*c,i=o*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-o*s,t[2]=i-e*l,t[6]=r+n*l,t[10]=a*s}else if("YXZ"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if("ZXY"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*c,t[9]=i-e*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){const e=a*c,n=a*u,r=o*c,i=o*u;t[0]=s*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=s*u,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*c,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*u+r,t[10]=e-i*u}else if("XZY"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=a*c,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(K,e,Q)}lookAt(e,t,n){const r=this.elements;return te.subVectors(e,t),0===te.lengthSq()&&(te.z=1),te.normalize(),$.crossVectors(n,te),0===$.lengthSq()&&(1===Math.abs(n.z)?te.x+=1e-4:te.z+=1e-4,te.normalize(),$.crossVectors(n,te)),$.normalize(),ee.crossVectors(te,$),r[0]=$.x,r[4]=ee.x,r[8]=te.x,r[1]=$.y,r[5]=ee.y,r[9]=te.y,r[2]=$.z,r[6]=ee.z,r[10]=te.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],f=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],b=n[11],_=n[15],x=r[0],w=r[4],M=r[8],S=r[12],T=r[1],E=r[5],C=r[9],A=r[13],P=r[2],L=r[6],R=r[10],O=r[14],k=r[3],I=r[7],N=r[11],D=r[15];return i[0]=a*x+o*T+s*P+l*k,i[4]=a*w+o*E+s*L+l*I,i[8]=a*M+o*C+s*R+l*N,i[12]=a*S+o*A+s*O+l*D,i[1]=c*x+u*T+h*P+d*k,i[5]=c*w+u*E+h*L+d*I,i[9]=c*M+u*C+h*R+d*N,i[13]=c*S+u*A+h*O+d*D,i[2]=f*x+p*T+m*P+g*k,i[6]=f*w+p*E+m*L+g*I,i[10]=f*M+p*C+m*R+g*N,i[14]=f*S+p*A+m*O+g*D,i[3]=v*x+y*T+b*P+_*k,i[7]=v*w+y*E+b*L+_*I,i[11]=v*M+y*C+b*R+_*N,i[15]=v*S+y*A+b*O+_*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*s*u-r*l*u-i*o*h+n*l*h+r*o*d-n*s*d)+e[7]*(+t*s*d-t*l*h+i*a*h-r*a*d+r*l*c-i*s*c)+e[11]*(+t*l*u-t*o*d-i*a*u+n*a*d+i*o*c-n*l*c)+e[15]*(-r*o*c-t*s*u+t*o*h+r*a*u-n*a*h+n*s*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15],v=u*m*l-p*h*l+p*s*d-o*m*d-u*s*g+o*h*g,y=f*h*l-c*m*l-f*s*d+a*m*d+c*s*g-a*h*g,b=c*p*l-f*u*l+f*o*d-a*p*d-c*o*g+a*u*g,_=f*u*s-c*p*s-f*o*h+a*p*h+c*o*m-a*u*m,x=t*v+n*y+r*b+i*_;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return e[0]=v*w,e[1]=(p*h*i-u*m*i-p*r*d+n*m*d+u*r*g-n*h*g)*w,e[2]=(o*m*i-p*s*i+p*r*l-n*m*l-o*r*g+n*s*g)*w,e[3]=(u*s*i-o*h*i-u*r*l+n*h*l+o*r*d-n*s*d)*w,e[4]=y*w,e[5]=(c*m*i-f*h*i+f*r*d-t*m*d-c*r*g+t*h*g)*w,e[6]=(f*s*i-a*m*i-f*r*l+t*m*l+a*r*g-t*s*g)*w,e[7]=(a*h*i-c*s*i+c*r*l-t*h*l-a*r*d+t*s*d)*w,e[8]=b*w,e[9]=(f*u*i-c*p*i-f*n*d+t*p*d+c*n*g-t*u*g)*w,e[10]=(a*p*i-f*o*i+f*n*l-t*p*l-a*n*g+t*o*g)*w,e[11]=(c*o*i-a*u*i-c*n*l+t*u*l+a*n*d-t*o*d)*w,e[12]=_*w,e[13]=(c*p*r-f*u*r+f*n*h-t*p*h-c*n*m+t*u*m)*w,e[14]=(f*o*r-a*p*r-f*n*s+t*p*s+a*n*m-t*o*m)*w,e[15]=(a*u*r-c*o*r+c*n*s-t*u*s-a*n*h+t*o*h)*w,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,c=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,c*o+n,c*s-r*a,0,l*s-r*o,c*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,c=a+a,u=o+o,h=i*l,d=i*c,f=i*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,b=s*u,_=n.x,x=n.y,w=n.z;return r[0]=(1-(p+g))*_,r[1]=(d+b)*_,r[2]=(f-y)*_,r[3]=0,r[4]=(d-b)*x,r[5]=(1-(h+g))*x,r[6]=(m+v)*x,r[7]=0,r[8]=(f+y)*w,r[9]=(m-v)*w,r[10]=(1-(h+p))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=Z.set(r[0],r[1],r[2]).length();const a=Z.set(r[4],r[5],r[6]).length(),o=Z.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],J.copy(this);const s=1/i,l=1/a,c=1/o;return J.elements[0]*=s,J.elements[1]*=s,J.elements[2]*=s,J.elements[4]*=l,J.elements[5]*=l,J.elements[6]*=l,J.elements[8]*=c,J.elements[9]*=c,J.elements[10]*=c,t.setFromRotationMatrix(J),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,s=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),h=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,n,r,i,a){const o=this.elements,s=1/(t-e),l=1/(n-r),c=1/(a-i),u=(t+e)*s,h=(n+r)*l,d=(a+i)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Z=new _,J=new Y,K=new _(0,0,0),Q=new _(1,1,1),$=new _,ee=new _,te=new _;class ne{constructor(e=0,t=0,n=0,r=ne.DefaultOrder){Object.defineProperty(this,"isEuler",{value:!0}),this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t,n){const r=c.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],l=i[1],u=i[5],h=i[9],d=i[2],f=i[6],p=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,a),this._z=0);break;case"ZXY":this._x=Math.asin(r(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-r(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-d,a)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return re.makeRotationFromQuaternion(e),this.setFromRotationMatrix(re,t,n)}setFromVector3(e,t){return this.set(e.x,e.y,e.z,t||this._order)}reorder(e){return ie.setFromEuler(this),this.setFromQuaternion(ie,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new _(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}ne.DefaultOrder="XYZ",ne.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const re=new Y,ie=new b;class ae{constructor(){this.mask=1}set(e){this.mask=1<1){for(let e=0;e1){for(let e=0;e0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c)}return n.object=r,n;function a(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t1?void 0:t.copy(n).multiplyScalar(i).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new _),e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||we.getNormalMatrix(e),r=this.coplanarPoint(_e).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}const Se=new _,Te=new _,Ee=new _,Ce=new _,Ae=new _,Pe=new _,Le=new _,Re=new _,Oe=new _,ke=new _;class Ie{constructor(e,t,n){this.a=void 0!==e?e:new _,this.b=void 0!==t?t:new _,this.c=void 0!==n?n:new _}static getNormal(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new _),r.subVectors(n,t),Se.subVectors(e,t),r.cross(Se);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Se.subVectors(r,t),Te.subVectors(n,t),Ee.subVectors(e,t);const a=Se.dot(Se),o=Se.dot(Te),s=Se.dot(Ee),l=Te.dot(Te),c=Te.dot(Ee),u=a*l-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new _),0===u)return i.set(-2,-1,-1);const h=1/u,d=(l*s-o*c)*h,f=(a*c-o*s)*h;return i.set(1-d-f,f,d)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Ce),Ce.x>=0&&Ce.y>=0&&Ce.x+Ce.y<=1}static getUV(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Ce),s.set(0,0),s.addScaledVector(i,Ce.x),s.addScaledVector(a,Ce.y),s.addScaledVector(o,Ce.z),s}static isFrontFacing(e,t,n,r){return Se.subVectors(n,t),Te.subVectors(e,t),Se.cross(Te).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Se.subVectors(this.c,this.b),Te.subVectors(this.a,this.b),.5*Se.cross(Te).length()}getMidpoint(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new _),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ie.getNormal(this.a,this.b,this.c,e)}getPlane(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Me),e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ie.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return Ie.getUV(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Ie.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ie.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new _);const n=this.a,r=this.b,i=this.c;let a,o;Ae.subVectors(r,n),Pe.subVectors(i,n),Re.subVectors(e,n);const s=Ae.dot(Re),l=Pe.dot(Re);if(s<=0&&l<=0)return t.copy(n);Oe.subVectors(e,r);const c=Ae.dot(Oe),u=Pe.dot(Oe);if(c>=0&&u<=c)return t.copy(r);const h=s*u-c*l;if(h<=0&&s>=0&&c<=0)return a=s/(s-c),t.copy(n).addScaledVector(Ae,a);ke.subVectors(e,i);const d=Ae.dot(ke),f=Pe.dot(ke);if(f>=0&&d<=f)return t.copy(i);const p=d*l-s*f;if(p<=0&&l>=0&&f<=0)return o=l/(l-f),t.copy(n).addScaledVector(Pe,o);const m=c*f-d*u;if(m<=0&&u-c>=0&&d-f>=0)return Le.subVectors(i,r),o=(u-c)/(u-c+(d-f)),t.copy(r).addScaledVector(Le,o);const g=1/(m+p+h);return a=p*g,o=h*g,t.copy(n).addScaledVector(Ae,a).addScaledVector(Pe,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Ne={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},De={h:0,s:0,l:0},je={h:0,s:0,l:0};function Fe(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function ze(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Be(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class Ue{constructor(e,t,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=c.euclideanModulo(e,1),t=c.clamp(t,0,1),n=c.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Fe(i,r,e+1/3),this.g=Fe(i,r,e),this.b=Fe(i,r,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const r=n[1],i=n[2];switch(r){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const n=parseFloat(e[1])/360,r=parseInt(e[2],10)/100,i=parseInt(e[3],10)/100;return t(e[4]),this.setHSL(n,r,i)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=n[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=Ne[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=ze(e.r),this.g=ze(e.g),this.b=ze(e.b),this}copyLinearToSRGB(e){return this.r=Be(e.r),this.g=Be(e.g),this.b=Be(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});const t=this.r,n=this.g,r=this.b,i=Math.max(t,n,r),a=Math.min(t,n,r);let o,s;const l=(a+i)/2;if(a===i)o=0,s=0;else{const e=i-a;switch(s=l<=.5?e/(i+a):e/(2-i-a),i){case t:o=(n-r)/e+(n0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(We.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Ve.prototype=Object.create(We.prototype),Ve.prototype.constructor=Ve,Ve.prototype.isMeshBasicMaterial=!0,Ve.prototype.copy=function(e){return We.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};const qe=new _,Xe=new u;function Ye(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function Ze(e,t,n){Ye.call(this,new Int8Array(e),t,n)}function Je(e,t,n){Ye.call(this,new Uint8Array(e),t,n)}function Ke(e,t,n){Ye.call(this,new Uint8ClampedArray(e),t,n)}function Qe(e,t,n){Ye.call(this,new Int16Array(e),t,n)}function $e(e,t,n){Ye.call(this,new Uint16Array(e),t,n)}function et(e,t,n){Ye.call(this,new Int32Array(e),t,n)}function tt(e,t,n){Ye.call(this,new Uint32Array(e),t,n)}function nt(e,t,n){Ye.call(this,new Uint16Array(e),t,n)}function rt(e,t,n){Ye.call(this,new Float32Array(e),t,n)}function it(e,t,n){Ye.call(this,new Float64Array(e),t,n)}function at(e){if(0===e.length)return-1/0;let t=e[0];for(let n=1,r=e.length;nt&&(t=e[n]);return t}Object.defineProperty(Ye.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ye.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r65535?tt:$e)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},hasAttribute:function(e){return void 0!==this.attributes[e]},addGroup:function(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new h).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return ct.makeRotationX(e),this.applyMatrix4(ct),this},rotateY:function(e){return ct.makeRotationY(e),this.applyMatrix4(ct),this},rotateZ:function(e){return ct.makeRotationZ(e),this.applyMatrix4(ct),this},translate:function(e,t,n){return ct.makeTranslation(e,t,n),this.applyMatrix4(ct),this},scale:function(e,t,n){return ct.makeScale(e,t,n),this.applyMatrix4(ct),this},lookAt:function(e){return ut.lookAt(e),ut.updateMatrix(),this.applyMatrix4(ut.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ht).negate(),this.translate(ht.x,ht.y,ht.z),this},setFromPoints:function(e){const t=[];for(let n=0,r=e.length;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const r=n[t],i=r.toJSON(e.data);""!==r.name&&(i.name=r.name),e.data.attributes[t]=i}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e},clone:function(){return(new mt).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const n=[],r=i[e];for(let e=0,i=r.length;en.far?null:{distance:c,point:Ot.clone(),object:e}}(e,t,n,r,bt,_t,xt,Rt);if(p){s&&(At.fromBufferAttribute(s,c),Pt.fromBufferAttribute(s,h),Lt.fromBufferAttribute(s,d),p.uv=Ie.getUV(Rt,bt,_t,xt,At,Pt,Lt,new u)),l&&(At.fromBufferAttribute(l,c),Pt.fromBufferAttribute(l,h),Lt.fromBufferAttribute(l,d),p.uv2=Ie.getUV(Rt,bt,_t,xt,At,Pt,Lt,new u));const e=new He(c,h,d);Ie.getNormal(bt,_t,xt,e.normal),p.face=e}return p}kt.prototype=Object.assign(Object.create(be.prototype),{constructor:kt,isMesh:!0,copy:function(e){return be.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this},updateMorphTargets:function(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),yt.copy(n.boundingSphere),yt.applyMatrix4(i),!1===e.ray.intersectsSphere(yt))return;if(gt.copy(i).invert(),vt.copy(e.ray).applyMatrix4(gt),null!==n.boundingBox&&!1===vt.intersectsBox(n.boundingBox))return;let a;if(n.isBufferGeometry){const i=n.index,o=n.attributes.position,s=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,u=n.attributes.uv2,h=n.groups,d=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,f=h.length;n0?1:-1,c.push(A.x,A.y,A.z),u.push(s/m),u.push(1-a/g),E+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t},Bt.prototype=Object.assign(Object.create(be.prototype),{constructor:Bt,isCamera:!0,copy:function(e,t){return be.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new _),this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){be.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(e,t){be.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Ut.prototype=Object.assign(Object.create(Bt.prototype),{constructor:Ut,isPerspectiveCamera:!0,copy:function(e,t){return Bt.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){const t=.5*this.getFilmHeight()/e;this.fov=2*c.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){const e=Math.tan(.5*c.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*c.RAD2DEG*Math.atan(Math.tan(.5*c.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const e=this.near;let t=e*Math.tan(.5*c.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}const o=this.filmOffset;0!==o&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){const t=be.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});function Ht(e,t,n){if(be.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new Ut(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new _(1,0,0)),this.add(r);const i=new Ut(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new _(-1,0,0)),this.add(i);const a=new Ut(90,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new _(0,1,0)),this.add(a);const o=new Ut(90,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new _(0,-1,0)),this.add(o);const s=new Ut(90,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new _(0,0,1)),this.add(s);const l=new Ut(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new _(0,0,-1)),this.add(l),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();const c=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;const h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=h,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(u),e.xr.enabled=c}}function Gt(e,t,n,r,i,a,o,s,l,c){e=void 0!==e?e:[],t=void 0!==t?t:301,o=void 0!==o?o:1022,m.call(this,e,t,n,r,i,a,o,s,l,c),this.flipY=!1,this._needsFlipEnvMap=!0}Ht.prototype=Object.create(be.prototype),Ht.prototype.constructor=Ht,Gt.prototype=Object.create(m.prototype),Gt.prototype.constructor=Gt,Gt.prototype.isCubeTexture=!0,Object.defineProperty(Gt.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});class Wt extends y{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),super(e,e,t),Object.defineProperty(this,"isWebGLCubeRenderTarget",{value:!0}),t=t||{},this.texture=new Gt(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new Nt(5,5,5),i=new zt({name:"CubemapFromEquirect",uniforms:Dt(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;const a=new kt(r,i),o=t.minFilter;1008===t.minFilter&&(t.minFilter=1006);return new Ht(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}function Vt(e,t,n,r,i,a,o,s,l,c,u,h){m.call(this,null,a,o,s,l,c,r,i,u,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:1003,this.minFilter=void 0!==c?c:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Vt.prototype=Object.create(m.prototype),Vt.prototype.constructor=Vt,Vt.prototype.isDataTexture=!0;const qt=new z,Xt=new _;class Yt{constructor(e,t,n,r,i,a){this.planes=[void 0!==e?e:new Me,void 0!==t?t:new Me,void 0!==n?n:new Me,void 0!==r?r:new Me,void 0!==i?i:new Me,void 0!==a?a:new Me]}set(e,t,n,r,i,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}clone(){return(new this.constructor).copy(this)}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6],u=n[7],h=n[8],d=n[9],f=n[10],p=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-r,u-s,p-h,y-m).normalize(),t[1].setComponents(o+r,u+s,p+h,y+m).normalize(),t[2].setComponents(o+i,u+l,p+d,y+g).normalize(),t[3].setComponents(o-i,u-l,p-d,y-g).normalize(),t[4].setComponents(o-a,u-c,p-f,y-v).normalize(),t[5].setComponents(o+a,u+c,p+f,y+v).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),qt.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(qt)}intersectsSprite(e){return qt.center.set(0,0,0),qt.radius=.7071067811865476,qt.applyMatrix4(e.matrixWorld),this.intersectsSphere(qt)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,Xt.y=r.normal.y>0?e.max.y:e.min.y,Xt.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Xt)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}function Zt(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Jt(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},$t={common:{diffuse:{value:new Ue(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new h},uv2Transform:{value:new h},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new u(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ue(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ue(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new h}},sprite:{diffuse:{value:new Ue(15658734)},opacity:{value:1},center:{value:new u(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new h}}},en={basic:{uniforms:jt([$t.common,$t.specularmap,$t.envmap,$t.aomap,$t.lightmap,$t.fog]),vertexShader:Qt.meshbasic_vert,fragmentShader:Qt.meshbasic_frag},lambert:{uniforms:jt([$t.common,$t.specularmap,$t.envmap,$t.aomap,$t.lightmap,$t.emissivemap,$t.fog,$t.lights,{emissive:{value:new Ue(0)}}]),vertexShader:Qt.meshlambert_vert,fragmentShader:Qt.meshlambert_frag},phong:{uniforms:jt([$t.common,$t.specularmap,$t.envmap,$t.aomap,$t.lightmap,$t.emissivemap,$t.bumpmap,$t.normalmap,$t.displacementmap,$t.fog,$t.lights,{emissive:{value:new Ue(0)},specular:{value:new Ue(1118481)},shininess:{value:30}}]),vertexShader:Qt.meshphong_vert,fragmentShader:Qt.meshphong_frag},standard:{uniforms:jt([$t.common,$t.envmap,$t.aomap,$t.lightmap,$t.emissivemap,$t.bumpmap,$t.normalmap,$t.displacementmap,$t.roughnessmap,$t.metalnessmap,$t.fog,$t.lights,{emissive:{value:new Ue(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag},toon:{uniforms:jt([$t.common,$t.aomap,$t.lightmap,$t.emissivemap,$t.bumpmap,$t.normalmap,$t.displacementmap,$t.gradientmap,$t.fog,$t.lights,{emissive:{value:new Ue(0)}}]),vertexShader:Qt.meshtoon_vert,fragmentShader:Qt.meshtoon_frag},matcap:{uniforms:jt([$t.common,$t.bumpmap,$t.normalmap,$t.displacementmap,$t.fog,{matcap:{value:null}}]),vertexShader:Qt.meshmatcap_vert,fragmentShader:Qt.meshmatcap_frag},points:{uniforms:jt([$t.points,$t.fog]),vertexShader:Qt.points_vert,fragmentShader:Qt.points_frag},dashed:{uniforms:jt([$t.common,$t.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qt.linedashed_vert,fragmentShader:Qt.linedashed_frag},depth:{uniforms:jt([$t.common,$t.displacementmap]),vertexShader:Qt.depth_vert,fragmentShader:Qt.depth_frag},normal:{uniforms:jt([$t.common,$t.bumpmap,$t.normalmap,$t.displacementmap,{opacity:{value:1}}]),vertexShader:Qt.normal_vert,fragmentShader:Qt.normal_frag},sprite:{uniforms:jt([$t.sprite,$t.fog]),vertexShader:Qt.sprite_vert,fragmentShader:Qt.sprite_frag},background:{uniforms:{uvTransform:{value:new h},t2D:{value:null}},vertexShader:Qt.background_vert,fragmentShader:Qt.background_frag},cube:{uniforms:jt([$t.envmap,{opacity:{value:1}}]),vertexShader:Qt.cube_vert,fragmentShader:Qt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qt.equirect_vert,fragmentShader:Qt.equirect_frag},distanceRGBA:{uniforms:jt([$t.common,$t.displacementmap,{referencePosition:{value:new _},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qt.distanceRGBA_vert,fragmentShader:Qt.distanceRGBA_frag},shadow:{uniforms:jt([$t.lights,$t.fog,{color:{value:new Ue(0)},opacity:{value:1}}]),vertexShader:Qt.shadow_vert,fragmentShader:Qt.shadow_frag}};function tn(e,t,n,r,i){const a=new Ue(0);let o,s,l=0,c=null,u=0,h=null;function d(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return a},setClearColor:function(e,t=1){a.set(e),l=t,d(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,d(a,l)},render:function(n,i,f,p){let m=!0===i.isScene?i.background:null;m&&m.isTexture&&(m=t.get(m));const g=e.xr,v=g.getSession&&g.getSession();v&&"additive"===v.environmentBlendMode&&(m=null),null===m?d(a,l):m&&m.isColor&&(d(m,1),p=!0),(e.autoClear||p)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||306===m.mapping)?(void 0===s&&(s=new kt(new Nt(1,1,1),new zt({name:"BackgroundCubeMaterial",uniforms:Dt(en.cube.uniforms),vertexShader:en.cube.vertexShader,fragmentShader:en.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(s)),m.isWebGLCubeRenderTarget&&(m=m.texture),s.material.uniforms.envMap.value=m,s.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m._needsFlipEnvMap?-1:1,c===m&&u===m.version&&h===e.toneMapping||(s.material.needsUpdate=!0,c=m,u=m.version,h=e.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null)):m&&m.isTexture&&(void 0===o&&(o=new kt(new Kt(2,2),new zt({name:"BackgroundMaterial",uniforms:Dt(en.background.uniforms),vertexShader:en.background.vertexShader,fragmentShader:en.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),c===m&&u===m.version&&h===e.toneMapping||(o.material.needsUpdate=!0,c=m,u=m.version,h=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function nn(e,t,n,r){const i=e.getParameter(34921),a=r.isWebGL2?null:t.get("OES_vertex_array_object"),o=r.isWebGL2||null!==a,s={},l=d(null);let c=l;function u(t){return r.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function h(t){return r.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function d(e){const t=[],n=[],r=[];for(let e=0;e=0){const a=l[t];if(void 0!==a){const t=a.normalized,i=a.itemSize,o=n.get(a);if(void 0===o)continue;const l=o.buffer,c=o.type,u=o.bytesPerElement;if(a.isInterleavedBufferAttribute){const n=a.data,o=n.stride,h=a.offset;n&&n.isInstancedInterleavedBuffer?(m(r,n.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)):p(r),e.bindBuffer(34962,l),v(r,i,c,t,o*u,h*u)}else a.isInstancedBufferAttribute?(m(r,a.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=a.meshPerAttribute*a.count)):p(r),e.bindBuffer(34962,l),v(r,i,c,t,0,0)}else if("instanceMatrix"===t){const t=n.get(i.instanceMatrix);if(void 0===t)continue;const a=t.buffer,o=t.type;m(r+0,1),m(r+1,1),m(r+2,1),m(r+3,1),e.bindBuffer(34962,a),e.vertexAttribPointer(r+0,4,o,!1,64,0),e.vertexAttribPointer(r+1,4,o,!1,64,16),e.vertexAttribPointer(r+2,4,o,!1,64,32),e.vertexAttribPointer(r+3,4,o,!1,64,48)}else if("instanceColor"===t){const t=n.get(i.instanceColor);if(void 0===t)continue;const a=t.buffer,o=t.type;m(r,1),e.bindBuffer(34962,a),e.vertexAttribPointer(r,3,o,!1,12,0)}else if(void 0!==u){const n=u[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(r,n);break;case 3:e.vertexAttrib3fv(r,n);break;case 4:e.vertexAttrib4fv(r,n);break;default:e.vertexAttrib1fv(r,n)}}}}g()}(i,l,h,y),null!==b&&e.bindBuffer(34963,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){y();for(const e in s){const t=s[e];for(const e in t){const n=t[e];for(const e in n)h(n[e].object),delete n[e];delete t[e]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0===s[e.id])return;const t=s[e.id];for(const e in t){const n=t[e];for(const e in n)h(n[e].object),delete n[e];delete t[e]}delete s[e.id]},releaseStatesOfProgram:function(e){for(const t in s){const n=s[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)h(r[e].object),delete r[e];delete n[e.id]}},initAttributes:f,enableAttribute:p,disableUnusedAttributes:g}}function rn(e,t,n,r){const i=r.isWebGL2;let a;this.setMode=function(e){a=e},this.render=function(t,r){e.drawArrays(a,t,r),n.update(r,a,1)},this.renderInstances=function(r,o,s){if(0===s)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](a,r,o,s),n.update(o,a,s)}}function an(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let o=void 0!==n.precision?n.precision:"highp";const s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),u=e.getParameter(35660),h=e.getParameter(3379),d=e.getParameter(34076),f=e.getParameter(34921),p=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=u>0,y=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;const n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,r},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:a?e.getParameter(36183):0}}function on(e){const t=this;let n=null,r=0,i=!1,a=!1;const o=new Me,s=new h,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){const a=null!==e?e.length:0;let c=null;if(0!==a){if(c=l.value,!0!==i||null===c){const t=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===c||c.length0){const o=e.getRenderList(),s=e.getRenderTarget(),l=new Wt(a.height/2);return l.fromEquirectangularTexture(e,i),t.set(i,l),e.setRenderTarget(s),e.setRenderList(o),i.addEventListener("dispose",r),n(l.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}function ln(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function cn(e,t,n,r){const i={},a=new WeakMap;function o(e){const s=e.target;null!==s.index&&t.remove(s.index);for(const e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener("dispose",o),delete i[s.id];const l=a.get(s);l&&(t.remove(l),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){const n=[],r=e.index,i=e.attributes.position;let o=0;if(null!==r){const e=r.array;o=r.version;for(let t=0,r=e.length;t65535?tt:$e)(n,1);s.version=o;const l=a.get(e);l&&t.remove(l),a.set(e,s)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,n.memory.geometries++),t},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const r=e.morphAttributes;for(const e in r){const n=r[e];for(let e=0,r=n.length;e0)return e;const i=t*n;let a=wn[i];if(void 0===a&&(a=new Float32Array(i),wn[i]=a),0!==t){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function An(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n/gm;function Sr(e){return e.replace(Mr,Tr)}function Tr(e,t){const n=Qt[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Sr(n)}const Er=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Cr=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Ar(e){return e.replace(Cr,Lr).replace(Er,Pr)}function Pr(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Lr(e,t,n,r)}function Lr(e,t,n,r){let i="";for(let e=parseInt(t);e0?e.gammaFactor:1,f=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(_r).join("\n")}(n),p=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(a),m=i.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[p].filter(_r).join("\n"),g.length>0&&(g+="\n"),v=[f,p].filter(_r).join("\n"),v.length>0&&(v+="\n")):(g=[Rr(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(_r).join("\n"),v=[f,Rr(n),"#define SHADER_NAME "+n.shaderName,p,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Qt.tonemapping_pars_fragment:"",0!==n.toneMapping?br("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Qt.encodings_pars_fragment,n.map?vr("mapTexelToLinear",n.mapEncoding):"",n.matcap?vr("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?vr("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?vr("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?vr("lightMapTexelToLinear",n.lightMapEncoding):"",yr("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(_r).join("\n")),o=Sr(o),o=xr(o,n),o=wr(o,n),s=Sr(s),s=xr(s,n),s=wr(s,n),o=Ar(o),s=Ar(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in","300 es"===n.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v);const b=y+v+s,_=fr(i,35633,y+g+o),x=fr(i,35632,b);if(i.attachShader(m,_),i.attachShader(m,x),void 0!==n.index0AttributeName?i.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),e.debug.checkShaderErrors){const e=i.getProgramInfoLog(m).trim(),t=i.getShaderInfoLog(_).trim(),n=i.getShaderInfoLog(x).trim();let r=!0,a=!0;if(!1===i.getProgramParameter(m,35714)){r=!1;const t=gr(i,_,"vertex"),n=gr(i,x,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",e,t,n)}else""!==e?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",e):""!==t&&""!==n||(a=!1);a&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:t,prefix:g},fragmentShader:{log:n,prefix:v}})}let w,M;return i.deleteShader(_),i.deleteShader(x),this.getUniforms=function(){return void 0===w&&(w=new dr(i,m)),w},this.getAttributes=function(){return void 0===M&&(M=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i0,maxBones:w,useVertexTexture:c,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e1&&r.sort(e||Nr),i.length>1&&i.sort(t||Dr)}}}function Fr(e){let t=new WeakMap;return{get:function(n,r){const i=t.get(n);let a;return void 0===i?(a=new jr(e),t.set(n,new WeakMap),t.get(n).set(r,a)):(a=i.get(r),void 0===a&&(a=new jr(e),i.set(r,a))),a},dispose:function(){t=new WeakMap}}}function zr(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new _,color:new Ue};break;case"SpotLight":n={position:new _,direction:new _,color:new Ue,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new _,color:new Ue,distance:0,decay:0};break;case"HemisphereLight":n={direction:new _,skyColor:new Ue,groundColor:new Ue};break;case"RectAreaLight":n={color:new Ue,position:new _,halfWidth:new _,halfHeight:new _}}return e[t.id]=n,n}}}let Br=0;function Ur(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Hr(e,t){const n=new zr,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new u};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new u,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)i.probe.push(new _);const a=new _,o=new Y,s=new Y;return{setup:function(a){let o=0,s=0,l=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0;a.sort(Ur);for(let e=0,t=a.length;e0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=$t.LTC_FLOAT_1,i.rectAreaLTC2=$t.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=$t.LTC_HALF_1,i.rectAreaLTC2=$t.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=o,i.ambient[1]=s,i.ambient[2]=l;const v=i.hash;v.directionalLength===c&&v.pointLength===u&&v.spotLength===h&&v.rectAreaLength===d&&v.hemiLength===f&&v.numDirectionalShadows===p&&v.numPointShadows===m&&v.numSpotShadows===g||(i.directional.length=c,i.spot.length=h,i.rectArea.length=d,i.point.length=u,i.hemi.length=f,i.directionalShadow.length=p,i.directionalShadowMap.length=p,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=p,i.pointShadowMatrix.length=m,i.spotShadowMatrix.length=g,v.directionalLength=c,v.pointLength=u,v.spotLength=h,v.rectAreaLength=d,v.hemiLength=f,v.numDirectionalShadows=p,v.numPointShadows=m,v.numSpotShadows=g,i.version=Br++)},setupView:function(e,t){let n=0,r=0,l=0,c=0,u=0;const h=t.matrixWorldInverse;for(let t=0,d=e.length;t=n.get(r).length?(a=new Gr(e,t),n.get(r).push(a)):a=n.get(r)[i],a},dispose:function(){n=new WeakMap}}}function Vr(e){We.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function qr(e){We.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new _,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}Vr.prototype=Object.create(We.prototype),Vr.prototype.constructor=Vr,Vr.prototype.isMeshDepthMaterial=!0,Vr.prototype.copy=function(e){return We.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},qr.prototype=Object.create(We.prototype),qr.prototype.constructor=qr,qr.prototype.isMeshDistanceMaterial=!0,qr.prototype.copy=function(e){return We.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};function Xr(e,t,n){let r=new Yt;const i=new u,a=new u,o=new v,s=[],l=[],c={},h={0:1,1:0,2:2},d=new zt({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new u},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const p=new mt;p.setAttribute("position",new Ye(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new kt(p,d),g=this;function b(n,r){const i=t.update(m);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,d,m,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,f,m,null)}function _(e,t,n){const r=e<<0|t<<1|n<<2;let i=s[r];return void 0===i&&(i=new Vr({depthPacking:3201,morphTargets:e,skinning:t}),s[r]=i),i}function x(e,t,n){const r=e<<0|t<<1|n<<2;let i=l[r];return void 0===i&&(i=new qr({morphTargets:e,skinning:t}),l[r]=i),i}function w(t,n,r,i,a,o,s){let l=null,u=_,d=t.customDepthMaterial;if(!0===i.isPointLight&&(u=x,d=t.customDistanceMaterial),void 0===d){let e=!1;!0===r.morphTargets&&(e=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let i=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?i=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t));l=u(e,i,!0===t.isInstancedMesh)}else l=d;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){const e=l.uuid,t=r.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let i=n[t];void 0===i&&(i=l.clone(),n[t]=i),l=i}return l.visible=r.visible,l.wireframe=r.wireframe,l.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:h[r.side],l.clipShadows=r.clipShadows,l.clippingPlanes=r.clippingPlanes,l.clipIntersection=r.clipIntersection,l.wireframeLinewidth=r.wireframeLinewidth,l.linewidth=r.linewidth,!0===i.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(i.matrixWorld),l.nearDistance=a,l.farDistance=o),l}function M(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(Array.isArray(i)){const t=r.groups;for(let l=0,c=t.length;ln||i.y>n)&&(i.x>n&&(a.x=Math.floor(n/f.x),i.x=a.x*f.x,h.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/f.y),i.y=a.y*f.y,h.mapSize.y=a.y)),null===h.map&&!h.isPointLightShadow&&3===this.type){const e={minFilter:1006,magFilter:1006,format:1023};h.map=new y(i.x,i.y,e),h.map.texture.name=u.name+".shadowMap",h.mapPass=new y(i.x,i.y,e),h.camera.updateProjectionMatrix()}if(null===h.map){const e={minFilter:1003,magFilter:1003,format:1023};h.map=new y(i.x,i.y,e),h.map.texture.name=u.name+".shadowMap",h.camera.updateProjectionMatrix()}e.setRenderTarget(h.map),e.clear();const p=h.getViewportCount();for(let e=0;e=1):-1!==C.indexOf("OpenGL ES")&&(E=parseFloat(/^OpenGL ES (\d)/.exec(C)[1]),T=E>=2);let A=null,P={};const L=new v,R=new v;function O(t,n,r){const i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;tr||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?c.floorPowerOfTwo:Math.floor,a=r(i*e.width),o=r(i*e.height);void 0===p&&(p=g(a,o));const s=n?g(a,o):p;s.width=a,s.height=o;return s.getContext("2d").drawImage(e,0,0,a,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+o+")."),s}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function y(e){return c.isPowerOfTwo(e.width)&&c.isPowerOfTwo(e.height)}function b(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function _(t,n,i,a){e.generateMipmap(t);r.get(n).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function x(n,r,i){if(!1===s)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let a=r;return 6403===r&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===r&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===r&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||t.get("EXT_color_buffer_float"),a}function w(e){return 1003===e||1004===e||1005===e?9728:9729}function M(t){const n=t.target;n.removeEventListener("dispose",M),function(t){const n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&f.delete(n),o.memory.textures--}function S(t){const n=t.target;n.removeEventListener("dispose",S),function(t){const n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}(n),o.memory.textures--}let T=0;function E(e,t){const i=r.get(e);if(e.isVideoTexture&&function(e){const t=o.render.frame;f.get(e)!==t&&(f.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){const n=e.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void O(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function C(t,i){const o=r.get(t);t.version>0&&o.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;R(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);const o=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),l=r.image[0]&&r.image[0].isDataTexture,c=[];for(let e=0;e<6;e++)c[e]=o||l?l?r.image[e].image:r.image[e]:v(r.image[e],!1,!0,u);const h=c[0],d=y(h)||s,f=a.convert(r.format),p=a.convert(r.type),m=x(r.internalFormat,f,p);let g;if(L(34067,r,d),o){for(let e=0;e<6;e++){g=c[e].mipmaps;for(let t=0;t1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function R(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",M),t.__webglTexture=e.createTexture(),o.memory.textures++)}function O(t,r,i){let o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),R(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);const l=function(e){return!s&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(r)&&!1===y(r.image),c=v(r.image,l,!1,h),u=y(c)||s,d=a.convert(r.format);let f,p=a.convert(r.type),m=x(r.internalFormat,d,p);L(o,r,u);const g=r.mipmaps;if(r.isDepthTexture)m=6402,s?m=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===m&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,p=a.convert(r.type)),1027===r.format&&6402===m&&(m=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,p=a.convert(r.type))),n.texImage2D(3553,0,m,c.width,c.height,0,d,p,null);else if(r.isDataTexture)if(g.length>0&&u){for(let e=0,t=g.length;e0&&u){for(let e=0,t=g.length;e=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),T+=1,e},this.resetTextureUnits=function(){T=0},this.setTexture2D=E,this.setTexture2DArray=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?O(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?O(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=C,this.setupRenderTarget=function(t){const i=r.get(t),l=r.get(t.texture);t.addEventListener("dispose",S),l.__webglTexture=e.createTexture(),o.memory.textures++;const c=!0===t.isWebGLCubeRenderTarget,u=!0===t.isWebGLMultisampleRenderTarget,h=y(t)||s;if(!s||1022!==t.texture.format||1015!==t.texture.type&&1016!==t.texture.type||(t.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){i.__webglFramebuffer=[];for(let t=0;t<6;t++)i.__webglFramebuffer[t]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),u)if(s){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);const n=a.convert(t.texture.format),r=a.convert(t.texture.type),o=x(t.texture.internalFormat,n,r),s=D(t);e.renderbufferStorageMultisample(36161,s,o,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),I(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,l.__webglTexture),L(34067,t.texture,h);for(let e=0;e<6;e++)k(i.__webglFramebuffer[e],t,36064,34069+e);b(t.texture,h)&&_(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,l.__webglTexture),L(3553,t.texture,h),k(i.__webglFramebuffer,t,36064,3553),b(t.texture,h)&&_(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&N(t)},this.updateRenderTargetMipmap=function(e){const t=e.texture;if(b(t,y(e)||s)){const i=e.isWebGLCubeRenderTarget?34067:3553,a=r.get(t).__webglTexture;n.bindTexture(i,a),_(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(s){const n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);const i=t.width,a=t.height;let o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===j&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),j=!0),e=e.texture),E(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),F=!0),e=e.texture),C(e,t)}}function Jr(e,t,n){const r=n.isWebGL2;return{convert:function(e){let n;if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e)return r?5131:(n=t.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(1021===e)return 6406;if(1022===e)return 6407;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e){if(n=t.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(33776===e)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(n=t.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(35840===e)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return n=t.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===e||37496===e)&&(n=t.get("WEBGL_compressed_texture_etc"),null!==n)){if(37492===e)return n.COMPRESSED_RGB8_ETC2;if(37496===e)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?(n=t.get("WEBGL_compressed_texture_astc"),null!==n?e:null):36492===e?(n=t.get("EXT_texture_compression_bptc"),null!==n?e:null):1020===e?r?34042:(n=t.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function Kr(e=[]){Ut.call(this),this.cameras=e}function Qr(){be.call(this),this.type="Group"}function $r(){this._targetRay=null,this._grip=null,this._hand=null}function ei(e,t){const n=this;let r=null,i=1,a=null,o="local-floor",s=null;const l=[],c=new Map,u=new Ut;u.layers.enable(1),u.viewport=new v;const h=new Ut;h.layers.enable(2),h.viewport=new v;const d=[u,h],f=new Kr;f.layers.enable(1),f.layers.enable(2);let p=null,m=null;function g(e){const t=c.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function y(){c.forEach((function(e,t){e.disconnect(t)})),c.clear(),p=null,m=null,e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),T.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function b(e){const t=r.inputSources;for(let e=0;e0&&Te(a,e,t),o.length>0&&Te(o,e,t),!0===e.isScene&&e.onAfterRender(g,e,t),null!==M&&(K.updateRenderTargetMipmap(M),K.updateMultisampleRenderTarget(M)),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),m.pop(),p=m.length>0?m[m.length-1]:null,f=null},this.setFramebuffer=function(e){b!==e&&null===M&&fe.bindFramebuffer(36160,e),b=e},this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return w},this.getRenderList=function(){return f},this.setRenderList=function(e){f=e},this.getRenderTarget=function(){return M},this.setRenderTarget=function(e,t=0,n=0){M=e,x=t,w=n,e&&void 0===J.get(e).__webglFramebuffer&&K.setupRenderTarget(e);let r=b,i=!1;if(e){const n=J.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=n[t],i=!0):r=e.isWebGLMultisampleRenderTarget?J.get(e).__webglMultisampledFramebuffer:n,C.copy(e.viewport),A.copy(e.scissor),P=e.scissorTest}else C.copy(N).multiplyScalar(O).floor(),A.copy(D).multiplyScalar(O).floor(),P=j;if(S!==r&&(fe.bindFramebuffer(36160,r),S=r),X.viewport(C),X.scissor(A),X.setScissorTest(P),i){const r=J.get(e.texture);fe.framebufferTexture2D(36160,36064,34069+t,r.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=J.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){let o=!1;s!==S&&(fe.bindFramebuffer(36160,s),o=!0);try{const s=e.texture,l=s.format,c=s.type;if(1023!==l&&he.convert(l)!==fe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const u=1016===c&&(V.has("EXT_color_buffer_half_float")||q.isWebGL2&&V.has("EXT_color_buffer_float"));if(!(1009===c||he.convert(c)===fe.getParameter(35738)||1015===c&&(q.isWebGL2||V.has("OES_texture_float")||V.has("WEBGL_color_buffer_float"))||u))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===fe.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&fe.readPixels(t,n,r,i,he.convert(l),he.convert(c),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{o&&fe.bindFramebuffer(36160,S)}}},this.copyFramebufferToTexture=function(e,t,n=0){const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=he.convert(t.format);K.setTexture2D(t,0),fe.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),X.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r=0){const i=t.image.width,a=t.image.height,o=he.convert(n.format),s=he.convert(n.type);K.setTexture2D(n,0),fe.pixelStorei(37440,n.flipY),fe.pixelStorei(37441,n.premultiplyAlpha),fe.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?fe.texSubImage2D(3553,r,e.x,e.y,i,a,o,s,t.image.data):t.isCompressedTexture?fe.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):fe.texSubImage2D(3553,r,e.x,e.y,o,s,t.image),0===r&&n.generateMipmaps&&fe.generateMipmap(3553),X.unbindTexture()},this.initTexture=function(e){K.setTexture2D(e,0),X.unbindTexture()},this.resetState=function(){X.reset(),de.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function ri(e){ni.call(this,e)}Kr.prototype=Object.assign(Object.create(Ut.prototype),{constructor:Kr,isArrayCamera:!0}),Qr.prototype=Object.assign(Object.create(be.prototype),{constructor:Qr,isGroup:!0}),Object.assign($r.prototype,{constructor:$r,getHandSpace:function(){return null===this._hand&&(this._hand=new Qr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Qr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Qr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,n){let r=null,i=null,a=null;const o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(l&&e.hand){a=!0;for(const r of e.hand.values()){const e=t.getJointPose(r,n);if(void 0===l.joints[r.jointName]){const e=new Qr;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[r.jointName]=e,l.add(e)}const i=l.joints[r.jointName];null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=e.radius),i.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],o=r.position.distanceTo(i.position),s=.02,c=.005;l.inputState.pinching&&o>s+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=s-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&(r=t.getPose(e.targetRaySpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==s&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale)));return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==a),this}}),Object.assign(ei.prototype,o.prototype),ri.prototype=Object.assign(Object.create(ni.prototype),{constructor:ri,isWebGL1Renderer:!0});class ii extends be{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}function ai(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=c.generateUUID()}Object.defineProperty(ai.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(ai.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;re.far||t.push({distance:s,point:ui.clone(),uv:Ie.getUV(ui,gi,vi,yi,bi,_i,xi,new u),face:null,object:this})},copy:function(e){return be.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});const Si=new _,Ti=new _;function Ei(){be.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}Ei.prototype=Object.assign(Object.create(be.prototype),{constructor:Ei,isLOD:!0,copy:function(e){be.prototype.copy.call(this,e,!1);const t=e.levels;for(let e=0,n=t.length;e0){let n,r;for(n=1,r=t.length;n0){Si.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(Si);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){const t=this.levels;if(t.length>1){Si.setFromMatrixPosition(e.matrixWorld),Ti.setFromMatrixPosition(this.matrixWorld);const n=Si.distanceTo(Ti)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;ro)continue;u.applyMatrix4(this.matrixWorld);const d=e.ray.origin.distanceTo(u);de.far||t.push({distance:d,point:c.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else for(let n=0,r=i.count-1;no)continue;u.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(u);re.far||t.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Zi=new _,Ji=new _;function Ki(e,t){Yi.call(this,e,t),this.type="LineSegments"}function Qi(e,t){Yi.call(this,e,t),this.type="LineLoop"}function $i(e){We.call(this),this.type="PointsMaterial",this.color=new Ue(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Ki.prototype=Object.assign(Object.create(Yi.prototype),{constructor:Ki,isLineSegments:!0,computeLineDistances:function(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;ei.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:o})}}function oa(e,t,n,r,i,a,o,s,l){m.call(this,e,t,n,r,i,a,o,s,l),this.format=void 0!==o?o:1022,this.minFilter=void 0!==a?a:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function sa(e,t,n,r,i,a,o,s,l,c,u,h){m.call(this,null,a,o,s,l,c,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function la(e,t,n,r,i,a,o,s,l){m.call(this,e,t,n,r,i,a,o,s,l),this.needsUpdate=!0}function ca(e,t,n,r,i,a,o,s,l,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===c&&(n=1012),void 0===n&&1027===c&&(n=1020),m.call(this,null,r,i,a,o,s,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}ia.prototype=Object.assign(Object.create(be.prototype),{constructor:ia,isPoints:!0,copy:function(e){return be.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),na.copy(n.boundingSphere),na.applyMatrix4(r),na.radius+=i,!1===e.ray.intersectsSphere(na))return;ea.copy(r).invert(),ta.copy(e.ray).applyMatrix4(ea);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position;if(null!==i){const n=i.array;for(let i=0,s=n.length;i0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),oa.prototype=Object.assign(Object.create(m.prototype),{constructor:oa,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),sa.prototype=Object.create(m.prototype),sa.prototype.constructor=sa,sa.prototype.isCompressedTexture=!0,la.prototype=Object.create(m.prototype),la.prototype.constructor=la,la.prototype.isCanvasTexture=!0,ca.prototype=Object.create(m.prototype),ca.prototype.constructor=ca,ca.prototype.isDepthTexture=!0;new _,new _,new _,new Ie;const ua=function(e,t,n){n=n||2;const r=t&&t.length,i=r?t[0]*n:e.length;let a=ha(e,0,i,n,!0);const o=[];if(!a||a.next===a.prev)return o;let s,l,c,u,h,d,f;if(r&&(a=function(e,t,n,r){const i=[];let a,o,s,l,c;for(a=0,o=t.length;a80*n){s=c=e[0],l=u=e[1];for(let t=n;tc&&(c=h),d>u&&(u=d);f=Math.max(c-s,u-l),f=0!==f?1/f:0}return fa(a,o,n,s,l,f),o};function ha(e,t,n,r,i){let a,o;if(i===function(e,t,n,r){let i=0;for(let a=t,o=n-r;a0)for(a=t;a=t;a-=r)o=Oa(a,e[a],e[a+1],o);return o&&Ea(o,o.next)&&(ka(o),o=o.next),o}function da(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!Ea(r,r.next)&&0!==Ta(r.prev,r,r.next))r=r.next;else{if(ka(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function fa(e,t,n,r,i,a,o){if(!e)return;!o&&a&&function(e,t,n,r){let i=e;do{null===i.z&&(i.z=xa(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,a,o,s,l,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1)}(i)}(e,r,i,a);let s,l,c=e;for(;e.prev!==e.next;)if(s=e.prev,l=e.next,a?ma(e,r,i,a):pa(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),ka(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?fa(e=ga(da(e),t,n),t,n,r,i,a,2):2===o&&va(e,t,n,r,i,a):fa(da(e),t,n,r,i,a,1);break}}function pa(e){const t=e.prev,n=e,r=e.next;if(Ta(t,n,r)>=0)return!1;let i=e.next.next;for(;i!==e.prev;){if(Ma(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ta(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ma(e,t,n,r){const i=e.prev,a=e,o=e.next;if(Ta(i,a,o)>=0)return!1;const s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=xa(s,l,t,n,r),d=xa(c,u,t,n,r);let f=e.prevZ,p=e.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&Ma(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Ta(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&Ma(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ta(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&Ma(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Ta(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&Ma(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ta(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function ga(e,t,n){let r=e;do{const i=r.prev,a=r.next.next;!Ea(i,a)&&Ca(i,r,r.next,a)&&La(i,a)&&La(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),ka(r),ka(r.next),r=e=a),r=r.next}while(r!==e);return da(r)}function va(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Sa(o,e)){let s=Ra(o,e);return o=da(o,o.next),s=da(s,s.next),fa(o,t,n,r,i,a),void fa(s,t,n,r,i,a)}e=e.next}o=o.next}while(o!==e)}function ya(e,t){return e.x-t.x}function ba(e,t){if(t=function(e,t){let n=t;const r=e.x,i=e.y;let a,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>o){if(o=e,e===r){if(i===n.y)return n;if(i===n.next.y)return n.next}a=n.x=n.x&&n.x>=l&&r!==n.x&&Ma(ia.x||n.x===a.x&&_a(a,n)))&&(a=n,h=u)),n=n.next}while(n!==s);return a}(e,t)){const n=Ra(t,e);da(t,t.next),da(n,n.next)}}function _a(e,t){return Ta(e.prev,e,t.prev)<0&&Ta(t.next,e,e.next)<0}function xa(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function wa(e){let t=e,n=e;do{(t.x=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function Sa(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Ca(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(La(e,t)&&La(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Ta(e.prev,e,t.prev)||Ta(e,t.prev,t))||Ea(e,t)&&Ta(e.prev,e,e.next)>0&&Ta(t.prev,t,t.next)>0)}function Ta(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Ea(e,t){return e.x===t.x&&e.y===t.y}function Ca(e,t,n,r){const i=Pa(Ta(e,t,n)),a=Pa(Ta(e,t,r)),o=Pa(Ta(n,r,e)),s=Pa(Ta(n,r,t));return i!==a&&o!==s||(!(0!==i||!Aa(e,n,t))||(!(0!==a||!Aa(e,r,t))||(!(0!==o||!Aa(n,e,r))||!(0!==s||!Aa(n,t,r)))))}function Aa(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Pa(e){return e>0?1:e<0?-1:0}function La(e,t){return Ta(e.prev,e,e.next)<0?Ta(e,t,e.next)>=0&&Ta(e,e.prev,t)>=0:Ta(e,t,e.prev)<0||Ta(e,e.next,t)<0}function Ra(e,t){const n=new Ia(e.i,e.x,e.y),r=new Ia(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Oa(e,t,n,r){const i=new Ia(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ka(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Ia(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}const Na={area:function(e){const t=e.length;let n=0;for(let r=t-1,i=0;i2&&e[t-1].equals(e[0])&&e.pop()}function ja(e,t){for(let n=0;nNumber.EPSILON){const d=Math.sqrt(h),f=Math.sqrt(l*l+c*c),p=t.x-s/d,m=t.y+o/d,g=((n.x-c/f-p)*c-(n.y+l/f-m)*l)/(o*c-s*l);r=p+o*g-e.x,i=m+s*g-e.y;const v=r*r+i*i;if(v<=2)return new u(r,i);a=Math.sqrt(v/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(s)===Math.sign(c)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(h)):(r=o,i=s,a=Math.sqrt(h/2))}return new u(r/a,i/a)}const k=[];for(let e=0,t=A.length,n=t-1,r=e+1;e=0;e--){const t=e/p,n=h*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+f;for(let e=0,t=A.length;e=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+2*p;e=0?(e(r-s,f,u),h.subVectors(c,u)):(e(r+s,f,u),h.subVectors(u,c)),f-s>=0?(e(r,f-s,u),d.subVectors(c,u)):(e(r,f+s,u),d.subVectors(u,c)),l.crossVectors(h,d).normalize(),a.push(l.x,l.y,l.z),o.push(r,f)}}for(let e=0;e0)&&d.push(t,i,l),(e!==n-1||s=r)){l.push(t.times[e]);for(let n=0;na.tracks[e].times[0]&&(s=a.tracks[e].times[0]);for(let e=0;e=r.times[h]){const e=h*l+s,t=e+l-s;d=to.arraySlice(r.values,e,t)}else{const e=r.createInterpolant(),t=s,n=l-s;e.evaluate(a),d=to.arraySlice(e.resultBuffer,t,n)}if("quaternion"===i){(new b).fromArray(d).normalize().conjugate().toArray(d)}const f=o.times.length;for(let e=0;e=i)break e;{const o=t[1];e=i)break t}a=n,n=0}}for(;n>>1;et;)--a;if(++a,0!==i||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);const e=this.getValueSize();this.times=to.arraySlice(n,i,a),this.values=to.arraySlice(this.values,i*e,a*e)}return this},validate:function(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==i;t++){const r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==a&&a>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,a),e=!1;break}a=r}if(void 0!==r&&to.isTypedArray(r))for(let t=0,n=r.length;t!==n;++t){const n=r[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e},optimize:function(){const e=to.arraySlice(this.times),t=to.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=e.length-1;let a=1;for(let o=1;o0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a!==e.length?(this.times=to.arraySlice(e,0,a),this.values=to.arraySlice(t,0,a*n)):(this.times=e,this.values=t),this},clone:function(){const e=to.arraySlice(this.times,0),t=to.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),so.prototype=Object.assign(Object.create(oo.prototype),{constructor:so,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),lo.prototype=Object.assign(Object.create(oo.prototype),{constructor:lo,ValueTypeName:"color"}),co.prototype=Object.assign(Object.create(oo.prototype),{constructor:co,ValueTypeName:"number"}),uo.prototype=Object.assign(Object.create(no.prototype),{constructor:uo,interpolate_:function(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t);let l=e*o;for(let e=l+o;l!==e;l+=4)b.slerpFlat(i,0,a,l-o,a,l,s);return i}}),ho.prototype=Object.assign(Object.create(oo.prototype),{constructor:ho,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new uo(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),fo.prototype=Object.assign(Object.create(oo.prototype),{constructor:fo,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),po.prototype=Object.assign(Object.create(oo.prototype),{constructor:po,ValueTypeName:"vector"}),Object.assign(mo,{parse:function(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(go(n[e]).scale(r));const i=new mo(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i},toJSON:function(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(oo.toJSON(n[e]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){const i=t.length,a=[];for(let e=0;e1){const e=a[1];let t=r[e];t||(r[e]=t=[]),t.push(n)}}const a=[];for(const e in r)a.push(mo.CreateFromMorphTargetSequence(e,r[e],t,n));return a},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const a=[],o=[];to.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.fps||30,o=e.blendMode;let s=e.length||-1;const l=e.hierarchy||[];for(let e=0;e0||0===e.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}),Object.assign(Po.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){const e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){const n=this.getLengths();let r=0;const i=n.length;let a;a=t||e*n[i-1];let o,s=0,l=i-1;for(;s<=l;)if(r=Math.floor(s+(l-s)/2),o=n[r]-a,o<0)s=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(r=l,n[r]===a)return r/(i-1);const c=n[r];return(r+(a-c)/(n[r+1]-c))/(i-1)},getTangent:function(e,t){let n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);const i=this.getPoint(n),a=this.getPoint(r),o=t||(i.isVector2?new u:new _);return o.copy(a).sub(i).normalize(),o},getTangentAt:function(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){const n=new _,r=[],i=[],a=[],o=new _,s=new Y;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new _),r[t].normalize()}i[0]=new _,a[0]=new _;let l=Number.MAX_VALUE;const u=Math.abs(r[0].x),h=Math.abs(r[0].y),d=Math.abs(r[0].z);u<=l&&(l=u,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),d<=l&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(c.clamp(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(c.clamp(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Lo.prototype=Object.create(Po.prototype),Lo.prototype.constructor=Lo,Lo.prototype.isEllipseCurve=!0,Lo.prototype.getPoint=function(e,t){const n=t||new u,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?o=r[(l-1)%i]:(ko.subVectors(r[0],r[1]).add(r[0]),o=ko);const u=r[l%i],h=r[(l+1)%i];if(this.closed||l+2r.length-2?r.length-1:a+1],h=r[a>r.length-3?r.length-1:a+2];return n.set(Fo(o,s.x,l.x,c.x,h.x),Fo(o,s.y,l.y,c.y,h.y)),n},Xo.prototype.copy=function(e){Po.prototype.copy.call(this,e),this.points=[];for(let t=0,n=e.points.length;t=t){const e=n[r]-t,i=this.curves[r],a=i.getLength(),o=0===a?0:1-e/a;return i.getPointAt(o)}r++}return null},getLength:function(){const e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t},copy:function(e){Po.prototype.copy.call(this,e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(e){return Zo.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){const e=Zo.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Zo.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Ko.prototype=Object.assign(Object.create(Jo.prototype),{constructor:Ko,getPointsHoles:function(e){const t=[];for(let n=0,r=this.holes.length;n0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case"t":r.uniforms[t].value=n(i.value);break;case"c":r.uniforms[t].value=(new Ue).setHex(i.value);break;case"v2":r.uniforms[t].value=(new u).fromArray(i.value);break;case"v3":r.uniforms[t].value=(new _).fromArray(i.value);break;case"v4":r.uniforms[t].value=(new v).fromArray(i.value);break;case"m3":r.uniforms[t].value=(new h).fromArray(i.value);break;case"m4":r.uniforms[t].value=(new Y).fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)r.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new u).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new u).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),r},setTextures:function(e){return this.textures=e,this}});const fs=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,r=e.length;nNumber.EPSILON){if(l<0&&(n=t[a],s=-s,o=t[i],l=-l),e.yo.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-s*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}const i=Na.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);let o,s,l;const c=[];if(1===a.length)return s=a[0],l=new Ko,l.curves=s.curves,c.push(l),c;let u=!i(a[0].getPoints());u=e?!u:u;const h=[],d=[];let f,p,m=[],g=0;d[g]=void 0,m[g]=[];for(let t=0,n=a.length;t1){let e=!1;const t=[];for(let e=0,t=d.length;e0&&(e||(m=h))}for(let e=0,t=d.length;e0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){o.setValue(n,r);break}},saveOriginalState:function(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]},_slerp:function(e,t,n,r){b.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){const a=this._workIndex*i;b.multiplyQuaternionsFlat(e,a,e,t,e,n),b.slerpFlat(e,t,e,t,e,a,r)},_lerp:function(e,t,n,r,i){const a=1-r;for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]*a+e[n+o]*r}},_lerpAdditive:function(e,t,n,r,i){for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]+e[n+a]*r}}});const Os=new RegExp("[\\[\\]\\.:\\/]","g"),ks="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Is=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ns=/(WCOD+)?/.source.replace("WCOD",ks),Ds=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),js=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Fs=new RegExp("^"+Is+Ns+Ds+js+"$"),zs=["material","materials","bones"];function Bs(e,t,n){const r=n||Us.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Us(e,t,n){this.path=t,this.parsedPath=n||Us.parseTrackName(t),this.node=Us.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}Object.assign(Bs.prototype,{getValue:function(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(Us,{Composite:Bs,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Us.Composite(e,t,n):new Us(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Os,"")},parseTrackName:function(e){const t=Fs.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==zs.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r=i){const a=i++,c=e[a];t[c.uuid]=l,e[l]=c,t[s]=a,e[a]=o;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[a],i=t[l];t[l]=r,t[a]=i}}}this.nCachedObjects_=i},uncache:function(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,a=e.length;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o].uuid,l=t[s];if(void 0!==l)if(delete t[s],l0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(let n=c,r=s.length;n!==r;++n){const r=s[n];u[n]=new Us(r,e,t)}return u},unsubscribe_:function(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}});class Hs{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,a=i.length,o=new Array(a),s={endingStart:2400,endingEnd:2400};for(let e=0;e!==a;++e){const t=i[e].createInterpolant(null);o[e]=t,t.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,a=n/r;e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,a=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const s=o.parameterPositions,l=o.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;if(r<0||0===n)return;this._startTime=null,t=n*r}t*=this._updateTimeScale(e);const a=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case 2501:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);break;case 2500:default:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const a=2202===n;if(0===e)return-1===i?r:a&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(a&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}function Gs(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Gs.prototype=Object.assign(Object.create(o.prototype),{constructor:Gs,_bindAction:function(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName;let c=l[s];void 0===c&&(c={},l[s]=c);for(let e=0;e!==i;++e){const i=r[e],l=i.name;let u=c[l];if(void 0!==u)a[e]=u;else{if(u=a[e],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,s,l));continue}const r=t&&t._propertyBindings[e].binding.parsedPath;u=new Rs(Us.create(n,l,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,s,l),a[e]=u}o[e].resultBuffer=u.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==n;++o){t[o]._update(r,e,i,a)}const o=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)o[e].apply(a);return this},setTime:function(e){this.time=0;for(let e=0;e4?o=ol[i-8+4-1]:0==i&&(o=0),n.push(o);const s=1/(a-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,g=new Float32Array(f*d*h),v=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let e=0;e2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];g.set(r,f*d*e),v.set(u,p*d*e);const i=[e,e,e,e,e,e];y.set(i,m*d*e)}const b=new mt;b.setAttribute("position",new Ye(g,f)),b.setAttribute("uv",new Ye(v,p)),b.setAttribute("faceIndex",new Ye(y,m)),e.push(b),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function fl(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),jo.call(this,e),this.type="catmullrom"}Po.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Po.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Jo.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Object.create(jo.prototype),Object.create(jo.prototype),fl.prototype=Object.create(jo.prototype),Object.assign(fl.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),class extends Ki{constructor(e=10,t=10,n=4473924,r=8947848){n=new Ue(n),r=new Ue(r);const i=t/2,a=e/t,o=e/2,s=[],l=[];for(let e=0,c=0,u=-o;e<=t;e++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);const t=e===i?n:r;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new mt;c.setAttribute("position",new rt(s,3)),c.setAttribute("color",new rt(l,3));super(c,new Hi({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Ki{constructor(e){const t=function e(t){const n=[];t&&t.isBone&&n.push(t);for(let r=0;rthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new u),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new u),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Ks.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(M.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(z.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Yt.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},el.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(c,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),c.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),c.ceilPowerOfTwo(e)}}),Object.assign(h.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Object.assign(Y.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new _).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)},getInverse:function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Me.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Object.assign(b.prototype,{multiplyVector3:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(X.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Ie.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(Ie,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Ie.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Ie.getNormal(e,t,n,r)}}),Object.assign(Ko.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Fa(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Ua(this,e)}}),Object.assign(u.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(_.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(v.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(be.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(be.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(kt.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(kt.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Ei.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Di.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Oi.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Po.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Ut.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Qo.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Ye.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(Ye.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(mt.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Ye(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(mt.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(ms.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(Xs.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(ai.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(ai.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Fa.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(ii.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(Ws.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(We.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Ue}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(Ya.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Xa.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(e){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=e}}}),Object.defineProperties(zt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(ni.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(ni.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(Xr.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(y.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(Ls.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return(new Ts).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),class{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;nSeems like WebGL isn't supported for you.
Find out how to get it here.
",this.container.style.textAlign="center",this.container.style.fontSize="18px",console.warn("WebGL Not Supported"),this.renderer=null)},e.prototype.remove=function(){window.removeEventListener("resize",this.updateSize,!1)},e}();function ml(e,t){var n,o,s,l,c;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new _,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=.275,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:r,ZOOM:i,PAN:a},this.enableTwoFingerZoomPan=!1,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.flipPanUp=!1,this.getPolarAngle=function(){return y.phi},this.getAzimuthalAngle=function(){return y.theta},this.reset=function(){h.target.copy(h.target0),h.object.position.copy(h.position0),h.object.zoom=h.zoom0,h.object.updateProjectionMatrix(),h.dispatchEvent(d),h.update(),g=m.NONE},this.resetPosition=function(){var e=h.object.position.y;h.object.position.copy(h.position0),h.object.position.y=e,h.object.updateProjectionMatrix(),h.dispatchEvent(d),h.update(),g=m.NONE},this.update=(n=new _,o=(new b).setFromUnitVectors(e.up,new _(0,1,0)),s=o.clone().invert(),l=new _,c=new b,function(){var e=h.object.position;return n.copy(e).sub(h.target),n.applyQuaternion(o),y.setFromVector3(n),h.autoRotate&&g===m.NONE&&D(2*Math.PI/60/60*h.autoRotateSpeed),y.theta+=x.theta,y.phi+=x.phi,y.theta=Math.max(h.minAzimuthAngle,Math.min(h.maxAzimuthAngle,y.theta)),y.phi=Math.max(h.minPolarAngle,Math.min(h.maxPolarAngle,y.phi)),y.makeSafe(),y.radius*=w,y.radius=Math.max(h.minDistance,Math.min(h.maxDistance,y.radius)),h.target.add(M),n.setFromSpherical(y),n.applyQuaternion(s),e.copy(h.target).add(n),h.object.lookAt(h.target),!0===h.enableDamping?(x.theta*=1-h.dampingFactor,x.phi*=1-h.dampingFactor):x.set(0,0,0),w=1,M.set(0,0,0),!!(S||l.distanceToSquared(h.object.position)>v||8*(1-c.dot(h.object.quaternion))>v)&&(h.dispatchEvent(d),l.copy(h.object.position),c.copy(h.object.quaternion),S=!1,!0)}),this.dispose=function(){h.domElement.removeEventListener("contextmenu",te,!1),h.domElement.removeEventListener("mousedown",X,!1),h.domElement.removeEventListener("wheel",J,!1),h.domElement.removeEventListener("touchstart",Q,!1),h.domElement.removeEventListener("touchend",ee,!1),h.domElement.removeEventListener("touchmove",$,!1),document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",Z,!1),window.removeEventListener("keydown",K,!1)};var h=this,d={type:"change"},f={type:"start"},p={type:"end"},m={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5,TOUCH_DOLLY_PAN:6},g=m.NONE,v=1e-6,y=new Js,x=new Js,w=1,M=new _,S=!1,T=new u,E=new u,C=new u,A=new u,P=new u,L=new u,R=new u,O=new u,k=new u;function I(){return h.domElement===document?h.domElement.body:h.domElement}function N(e){return e=e||1,Math.pow(.95,h.zoomSpeed*e)}function D(e){x.theta-=e}function j(e){x.phi-=e}this.rotateLeft=D,this.rotateUp=j;var F,z=(F=new _,function(e,t){var n=t.elements;h.flipPanUp?F.set(n[0],0,n[2]).normalize():F.set(n[0],n[1],0).normalize(),F.multiplyScalar(-e),M.add(F)}),B=function(){var e=new _;return function(t,n){var r=n.elements;h.flipPanUp?e.set(r[4],0,r[6]).normalize():e.set(r[4],r[5],0).normalize(),e.multiplyScalar(t),M.add(e)}}(),U=function(){var e=new _;return function(t,n){var r=I();if(h.object instanceof Ut){var i=h.object.position;e.copy(i).sub(h.target);var a=e.length();a*=Math.tan(h.object.fov/2*Math.PI/180),z(2*t*a/r.clientHeight,h.object.matrix),B(2*n*a/r.clientHeight,h.object.matrix)}else h.object instanceof as?(z(t*(h.object.right-h.object.left)/h.object.zoom/r.clientWidth,h.object.matrix),B(n*(h.object.top-h.object.bottom)/h.object.zoom/r.clientHeight,h.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),h.enablePan=!1)}}();function H(e){h.object instanceof Ut?w/=e:h.object instanceof as?(h.object.zoom=Math.max(h.minZoom,Math.min(h.maxZoom,h.object.zoom*e)),h.object.updateProjectionMatrix(),S=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),h.enableZoom=!1)}function G(e){h.object instanceof Ut?w*=e:h.object instanceof as?(h.object.zoom=Math.max(h.minZoom,Math.min(h.maxZoom,h.object.zoom/e)),h.object.updateProjectionMatrix(),S=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),h.enableZoom=!1)}function W(e){e.deltaY<0?G(N()):e.deltaY>0&&H(N()),h.update()}function V(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);R.set(0,r)}function q(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);O.set(0,r),k.subVectors(O,R);var i=I(),a=Math.abs(k.y)/(.01*i.clientHeight);k.y>0?G(N(a)):k.y<0&&H(N(a)),R.copy(O),h.update()}function X(e){if(!1!==h.enabled){if(e.preventDefault(),e.button===h.mouseButtons.ORBIT){if(!1===h.enableRotate)return;!function(e){T.set(e.clientX,e.clientY)}(e),g=m.ROTATE}else if(e.button===h.mouseButtons.ZOOM){if(!1===h.enableZoom)return;!function(e){R.set(e.clientX,e.clientY)}(e),g=m.DOLLY}else if(e.button===h.mouseButtons.PAN){if(!1===h.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),g=m.PAN}g!==m.NONE&&(document.addEventListener("mousemove",Y,!1),document.addEventListener("mouseup",Z,!1),h.dispatchEvent(f))}}function Y(e){if(!1!==h.enabled)if(e.preventDefault(),g===m.ROTATE){if(!1===h.enableRotate)return;!function(e){E.set(e.clientX,e.clientY),C.subVectors(E,T);var t=I();D(2*Math.PI*C.x/t.clientWidth*h.rotateSpeed),j(2*Math.PI*C.y/t.clientHeight*h.rotateSpeed),T.copy(E),h.update()}(e)}else if(g===m.DOLLY){if(!1===h.enableZoom)return;!function(e){O.set(e.clientX,e.clientY),k.subVectors(O,R);var t=I(),n=Math.abs(k.y)/(.01*t.clientHeight);k.y>0?H(N(n)):k.y<0&&G(N(n)),R.copy(O),h.update()}(e)}else if(g===m.PAN){if(!1===h.enablePan)return;!function(e){P.set(e.clientX,e.clientY),L.subVectors(P,A),U(L.x,L.y),A.copy(P),h.update()}(e)}}function Z(e){!1!==h.enabled&&(document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",Z,!1),h.dispatchEvent(p),g=m.NONE)}function J(e){!1===h.enabled||!1===h.enableZoom||g!==m.NONE&&g!==m.ROTATE||(e.preventDefault(),W(e),h.dispatchEvent(f),h.dispatchEvent(p))}function K(e){!1!==h.enabled&&!1!==h.enableKeys&&!1!==h.enablePan&&function(e){switch(e.keyCode){case h.keys.UP:U(0,h.keyPanSpeed),h.update();break;case h.keys.BOTTOM:U(0,-h.keyPanSpeed),h.update();break;case h.keys.LEFT:U(h.keyPanSpeed,0),h.update();break;case h.keys.RIGHT:U(-h.keyPanSpeed,0),h.update()}}(e)}function Q(e){if(!1!==h.enabled){switch(e.touches.length){case 1:if(!1===h.enableRotate)return;!function(e){T.set(e.touches[0].pageX,e.touches[0].pageY)}(e),g=m.TOUCH_ROTATE;break;case 2:if(!1===h.enableZoom&&!1===h.enablePan)return;if(!0===h.enableTwoFingerZoomPan)!function(e){if(!0===h.enableZoom&&V(e),!0===h.enablePan){var t=(e.touches[0].pageX+e.touches[1].pageX)/2,n=(e.touches[0].pageY+e.touches[1].pageY)/2;A.set(t,n)}}(e),g=!0===h.enableZoom&&!0===h.enablePan?m.TOUCH_DOLLY_PAN:!0===h.enableZoom&&!1===h.eanblePan?m.TOUCH_DOLLY:m.TOUCH_PAN;else{if(!1===h.enableZoom)return;V(e),g=m.TOUCH_DOLLY}break;case 3:if(!1===h.enablePan)return;if(!0===h.enableTwoFingerZoomPan)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY)}(e),g=m.TOUCH_PAN;break;default:g=m.NONE}g!==m.NONE&&h.dispatchEvent(f)}}function $(e){if(!1!==h.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===h.enableRotate)return;if(g!==m.TOUCH_ROTATE)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),C.subVectors(E,T);var t=I();D(2*Math.PI*C.x/t.clientWidth*h.rotateSpeed),j(2*Math.PI*C.y/t.clientHeight*h.rotateSpeed),T.copy(E),h.update()}(e);break;case 2:if(!1===h.enableZoom&&!1===h.enablePan)return;if(g!==m.TOUCH_DOLLY&&g!==m.TOUCH_PAN&&g!==m.TOUCH_DOLLY_PAN)return;if(!0===h.enableTwoFingerZoomPan)!function(e){if(!0===h.enablePan){var t=(e.touches[0].pageX+e.touches[1].pageX)/2,n=(e.touches[0].pageY+e.touches[1].pageY)/2;P.set(t,n),L.subVectors(P,A),U(L.x,L.y),A.copy(P),!1===h.enableZoom&&h.update()}!0===h.enableZoom&&q(e)}(e);else{if(!1===h.enableZoom)return;q(e)}break;case 3:if(!1===h.enablePan)return;if(g!==m.TOUCH_PAN)return;!function(e){P.set(e.touches[0].pageX,e.touches[0].pageY),L.subVectors(P,A),U(L.x,L.y),A.copy(P),h.update()}(e);break;default:g=m.NONE}}function ee(e){!1!==h.enabled&&(h.dispatchEvent(p),g=m.NONE)}function te(e){e.preventDefault()}this.handleMouseWheel=W,h.domElement.addEventListener("contextmenu",te,!1),h.domElement.addEventListener("mousedown",X,!1),h.domElement.addEventListener("wheel",J,!1),h.domElement.addEventListener("touchstart",Q,!1),h.domElement.addEventListener("touchend",ee,!1),h.domElement.addEventListener("touchmove",$,!1),window.addEventListener("keydown",K,!1),this.update()}function gl(e){var t=this;e.rotation.set(0,0,0);var n=new be;n.add(e);var r=new be;r.position.y=10,r.add(n);var i,a,o=Math.PI/2,s=function(e){if(!1!==t.enabled){var i=e.movementX||e.mozMovementX||e.webkitMovementX||0,a=e.movementY||e.mozMovementY||e.webkitMovementY||0;r.rotation.y-=.002*i,n.rotation.x-=.002*a,n.rotation.x=Math.max(-o,Math.min(o,n.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",s,!1)},document.addEventListener("mousemove",s,!1),this.enabled=!1,this.getObject=function(){return r},this.getPitchObject=function(){return n},this.getDirection=(i=new _(0,0,-1),a=new ne(0,0,0,"YXZ"),function(e){return a.set(n.rotation.x,r.rotation.y,0),e.copy(i).applyEuler(a),e})}ml.prototype=Object.create(o.prototype),ml.prototype.constructor=ml,Object.defineProperties(ml.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var vl={getIn:function(e,t,n){if(null==e)return null!=n?n:null;if("string"==typeof t&&(t=t.split(".")),null==t)return null!=n?n:null;for(var r=Object.assign({},e),i=0;i=0?n:n+t)},findHighestMaxZoom:function(e){var t=0;for(var n in e)"Vectors As Tiles"!=e[n].name&&e[n].maxZoom>t&&(t=e[n].maxZoom);return t},findLowestMinZoom:function(e){var t=1/0;for(var n in e)"_vectorsastile_"!==e[n].path&&e[n].minZoomt[1]&&lt[0],i=e.x+1,a=e.y+0,s=(o=n.tileXYZ2LatLng(i,a,e.z)).lat,l=o.lng,r=r||st[1]&&lt[0],i=e.x+1,a=e.y+1,s=(o=n.tileXYZ2LatLng(i,a,e.z)).lat,l=o.lng,r=r||st[1]&&lt[0],i=e.x+0,a=e.y+1,s=(o=n.tileXYZ2LatLng(i,a,e.z)).lat,l=o.lng,r=r||st[1]&&lt[0]}return r},clone:function(e){var t;if(null==e||"object"!=typeof e)return e;if(e instanceof Date)return(t=new Date).setTime(e.getTime()),t;if(e instanceof Array){t=[];for(var n=0,r=e.length;n3&&vl.lastTileContains.pop(),a},tileIsContained:function(e,t,n){for(var r=this.tileContains(e,t[2],n),i=0;i0&&n(e)}))},setAllMaterialOpacity:function(e,t){e.material&&(e.material.transparent=!0,e.material.opacity=t),vl.setChildrenMaterialOpacity(e,t,(function(e){vl.setAllMaterialOpacity(e,t)}))}},yl=vl,bl=function(){function e(e,t,n,r){var i=this;this.onKeyDown=function(e){if(!i.firstPerson.lockControls)switch(i.isShift=e.shiftKey,e.keyCode){case 38:case 87:i.moveForward=!0;break;case 37:case 65:i.moveLeft=!0;break;case 40:case 83:i.moveBackward=!0;break;case 39:case 68:i.moveRight=!0;break;case 32:!0===i.canJump&&(i.velocity.y+=350),i.canJump=!1}},this.onKeyUp=function(e){if(!i.firstPerson.lockControls)switch(i.isShift=e.shiftKey,e.keyCode){case 38:case 87:i.moveForward=!1;break;case 37:case 65:i.moveLeft=!1;break;case 40:case 83:i.moveBackward=!1;break;case 39:case 68:i.moveRight=!1}},this.updateSize=function(){i.orbit.camera.aspect=i.sceneContainer.offsetWidth/i.sceneContainer.offsetHeight,i.orbit.camera.updateProjectionMatrix(),i.firstPerson.camera.aspect=i.sceneContainer.offsetWidth/i.sceneContainer.offsetHeight,i.firstPerson.camera.updateProjectionMatrix()},this.setNearFarPlane=function(e,t,n,r){!0===r&&(i._.keepNear=!0),!1===r&&(i._.keepNear=!1),e?i._.keepNear||(i.orbit.camera.near=1e4*i.orbit.near):(i._.keepNear||(i.orbit.camera.near=i.orbit.near),i.orbit.camera.far=i.orbit.far),null!=t&&(i.orbit.camera.near=t),null!=n&&(i.orbit.camera.far=n),i.orbit.camera.updateProjectionMatrix()},this.setFirstPersonHeight=function(e){i.firstPerson.height=e||3},this.getFirstPersonFocalLength=function(){return i.firstPerson.camera.getFocalLength()},this.setFirstPersonFocalLength=function(e){i.firstPerson.camera.setFocalLength(e)},this.getFirstPersonFOV=function(){return i.firstPerson.camera.fov},this.setFirstPersonFOV=function(e){i.firstPerson.camera.fov=e,i.firstPerson.camera.updateProjectionMatrix()},this.getFirstPersonAspect=function(){return i.firstPerson.camera.aspect},this.setFirstPersonAspect=function(e){i.firstPerson.camera.aspect=e,i.firstPerson.camera.updateProjectionMatrix()},this.setCameraAzimuthElevation=function(e,t,n){i.firstPerson.controls.getObject().rotation.y=(180-e)*(Math.PI/180),i.firstPerson.controls.getPitchObject().rotation.x=t*(Math.PI/180)},this.update=function(){if(i.isFirstPerson){var e=performance.now(),t=(e-i.prevTime)/1e3;i.prevTime=e,i.velocity.x-=10*i.velocity.x*t,i.velocity.z-=10*i.velocity.z*t,i.velocity.y-=9.8*100*t,i.moveForward&&(i.velocity.z-=400*t),i.moveBackward&&(i.velocity.z+=400*t),i.moveLeft&&(i.velocity.x-=400*t),i.moveRight&&(i.velocity.x+=400*t);var n=yl.rotatePoint({x:i.velocity.x*t,y:i.velocity.z*t},[0,0],-i.firstPerson.controls.getObject().rotation.y);return i.isShift&&(n.x*=3,n.y*=3),new u(n.x,n.y)}return null},this.container=e,this.sceneContainer=t,this.reset(),this._init(n,r)}return e.prototype.reset=function(){this.camera=null,this.controls=null,this.orbit={camera:null,controls:null,near:.1,far:15e9},this.firstPerson={camera:null,controls:null,lockControls:!1,height:3},this.isFirstPerson=!1,this._={keepNear:!1,crosshair:null},this.isShift=!1,this.moveForward=null,this.moveBackward=null,this.moveLeft=null,this.moveRight=null,this.canJump=null,this.prevTime=performance.now(),this.velocity=new _},e.prototype._init=function(e,t){this.orbit.camera=new Ut(60,this.sceneContainer.offsetWidth/this.sceneContainer.offsetHeight,this.orbit.near,this.orbit.far),this.orbit.camera.up=new _(0,-1,0),this.orbit.camera.position.set(0,-1e7/t.radiusScale,0),this.orbit.controls=new ml(this.orbit.camera,this.sceneContainer),this.orbit.controls.enabled=!0,this.orbit.controls.enableDamping=!0,this.orbit.controls.dampingFactor=.2,this.orbit.controls.target.y=1,this.orbit.controls.mouseButtons.ORBIT=a,this.orbit.controls.mouseButtons.PAN=r,this.orbit.controls.maxDistance=4*t.radii.major,this.orbit.controls.maxPolarAngle=Math.PI/2,this.orbit.controls.enablePan=!1,this.firstPerson.camera=new Ut(60,this.sceneContainer.offsetWidth/this.sceneContainer.offsetHeight,.1,15e7),this.firstPerson.controls=new gl(this.firstPerson.camera),this.firstPerson.controls.getObject().rotation.set(Math.PI,Math.PI,0),this.firstPerson.controls.getObject().position.set(0,1e7/t.radiusScale,0),e.add(this.firstPerson.controls.getObject()),this.isFirstPerson?this.requestPointerLocking():(this.camera=this.orbit.camera,this.controls=this.orbit.controls),this.updateSize(),this.setupEvents(),this.orbit.controls.update()},e.prototype.swap=function(e,t){this.isFirstPerson=!this.isFirstPerson,this.isFirstPerson?(this.firstPerson.lockControls=e||!1,t||this.requestPointerLocking(),this.inToFirstPerson()):(this.outFromFirstPerson(),this.camera=this.orbit.camera,this.controls=this.orbit.controls)},e.prototype.inToFirstPerson=function(){this.isFirstPerson=!0,this.toggleCrosshair(!0),this.camera=this.firstPerson.camera,this.firstPerson.controls.enabled=!this.firstPerson.lockControls,this.controls=this.firstPerson.controls,this.orbit.controls.resetPosition()},e.prototype.outFromFirstPerson=function(){this.isFirstPerson=!1,this.toggleCrosshair(!1),this.firstPerson.controls.enabled=!1,this.camera=this.orbit.camera,this.controls=this.orbit.controls},e.prototype.toggleCrosshair=function(e){null==this._.crosshair&&(this._.crosshair=document.createElement("div"),this._.crosshair.id="_lithosphere_crosshair",this._.crosshair.style=["position: absolute","left: calc(50% - 10px)","top: calc(50% - 10px)","width: 18px","height: 18px","border-radius: 15px","border: 3px solid lime"].join(";"),this.container.appendChild(this._.crosshair)),this._.crosshair.style.display=e?"inherit":"none"},e.prototype.requestPointerLocking=function(){var e=this;if("pointerLockElement"in document){var t=document.body,n=function(){document.pointerLockElement===t?e.inToFirstPerson():e.outFromFirstPerson()},r=function(e){alert("Pointer Lock Error")};if(document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("pointerlockerror",r,!1),document.addEventListener("mozpointerlockerror",r,!1),document.addEventListener("webkitpointerlockerror",r,!1),/Firefox/i.test(navigator.userAgent)){var i=function(){document.fullscreenElement===t&&(document.removeEventListener("fullscreenchange",i),document.removeEventListener("mozfullscreenchange",i),t.requestPointerLock())};document.addEventListener("fullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),t.requestFullscreen()}else t.requestPointerLock()}else this.isFirstPerson=!1,alert("This browser does not support Pointer Locking.")},e.prototype.setupEvents=function(){document.addEventListener("keydown",this.onKeyDown,!1),document.addEventListener("keyup",this.onKeyUp,!1),window.addEventListener("resize",this.updateSize,!1)},e}(),_l=484813681109536e-20,xl=Math.PI/2,wl=.017453292519943295,Ml=57.29577951308232,Sl=Math.PI/4,Tl=2*Math.PI,El=3.14159265359,Cl={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},Al={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},Pl=/[\s_\-\/\(\)]/g;function Ll(e,t){if(e[t])return e[t];for(var n,r=Object.keys(e),i=t.toLowerCase().replace(Pl,""),a=-1;++a=this.text.length)return;e=this.text[this.place++]}switch(this.state){case 1:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},Fl.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(Dl.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},Fl.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Fl.prototype.number=function(e){if(!jl.test(e)){if(Dl.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},Fl.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},Fl.prototype.keyword=function(e){if(Nl.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=1)}if(!Dl.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},Fl.prototype.neutral=function(e){if(Il.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(jl.test(e))return this.word=e,void(this.state=3);if(!Dl.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},Fl.prototype.output=function(){for(;this.place0?90:-90),e.lat_ts=e.lat1)}(i),i};function Gl(e){var t=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?Gl[e]=Rl(arguments[1]):Gl[e]=Hl(arguments[1]):Gl[e]=n}else if(1===arguments.length){if(Array.isArray(e))return e.map((function(e){Array.isArray(e)?Gl.apply(t,e):Gl(e)}));if("string"==typeof e){if(e in Gl)return Gl[e]}else"EPSG"in e?Gl["EPSG:"+e.EPSG]=e:"ESRI"in e?Gl["ESRI:"+e.ESRI]=e:"IAU2000"in e?Gl["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(Gl);var Wl=Gl;var Vl=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var ql=["3857","900913","3785","102113"];var Xl=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in Wl}(e))return Wl[e];if(function(e){return Vl.some((function(t){return e.indexOf(t)>-1}))}(e)){var t=Hl(e);if(function(e){var t=Ll(e,"authority");if(t){var n=Ll(t,"epsg");return n&&ql.indexOf(n)>-1}}(t))return Wl["EPSG:3857"];var n=function(e){var t=Ll(e,"extension");if(t)return Ll(t,"proj4")}(t);return n?Rl(n):t}return function(e){return"+"===e[0]}(e)?Rl(e):void 0},Yl=function(e,t){var n,r;if(e=e||{},!t)return e;for(r in t)void 0!==(n=t[r])&&(e[r]=n);return e},Zl=function(e,t,n){var r=e*t;return n/Math.sqrt(1-r*r)},Jl=function(e){return e<0?-1:1},Kl=function(e){return Math.abs(e)<=El?e:e-Jl(e)*Tl},Ql=function(e,t,n){var r=e*n,i=.5*e;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(xl-t))/r},$l=function(e,t){for(var n,r,i=.5*e,a=xl-2*Math.atan(t),o=0;o<=15;o++)if(n=e*Math.sin(a),a+=r=xl-2*Math.atan(t*Math.pow((1-n)/(1+n),i))-a,Math.abs(r)<=1e-10)return a;return-9999};function ec(e){return e}var tc=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Zl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(e){var t,n,r=e.x,i=e.y;if(i*Ml>90&&i*Ml<-90&&r*Ml>180&&r*Ml<-180)return null;if(Math.abs(Math.abs(i)-xl)<=1e-10)return null;if(this.sphere)t=this.x0+this.a*this.k0*Kl(r-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(Sl+.5*i));else{var a=Math.sin(i),o=Ql(this.e,i,a);t=this.x0+this.a*this.k0*Kl(r-this.long0),n=this.y0-this.a*this.k0*Math.log(o)}return e.x=t,e.y=n,e},inverse:function(e){var t,n,r=e.x-this.x0,i=e.y-this.y0;if(this.sphere)n=xl-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var a=Math.exp(-i/(this.a*this.k0));if(-9999===(n=$l(this.e,a)))return null}return t=Kl(this.long0+r/(this.a*this.k0)),e.x=t,e.y=n,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:ec,inverse:ec,names:["longlat","identity"]}],nc={},rc=[];function ic(e,t){var n=rc.length;return e.names?(rc[n]=e,e.names.forEach((function(e){nc[e.toLowerCase()]=n})),this):(console.log(t),!0)}var ac={start:function(){tc.forEach(ic)},add:ic,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==nc[t]&&rc[nc[t]]?rc[nc[t]]:void 0}},oc={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},sc=oc.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};oc.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var lc={};lc.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},lc.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},lc.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},lc.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},lc.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},lc.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},lc.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},lc.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},lc.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},lc.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},lc.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},lc.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},lc.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},lc.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},lc.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},lc.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},lc.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var cc=function(e,t,n,r,i,a,o){var s={};return s.datum_type=void 0===e||"none"===e?5:4,t&&(s.datum_params=t.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=1),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=2,s.datum_params[3]*=_l,s.datum_params[4]*=_l,s.datum_params[5]*=_l,s.datum_params[6]=s.datum_params[6]/1e6+1))),o&&(s.datum_type=3,s.grids=o),s.a=n,s.b=r,s.es=i,s.ep2=a,s},uc={};function hc(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:uc[e]||null,isNull:!1}}function dc(e){return e/3600*Math.PI/180}function fc(e,t,n){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,n)))}function pc(e){return e.map((function(e){return[dc(e.longitudeShift),dc(e.latitudeShift)]}))}function mc(e,t,n){return{name:fc(e,t+8,t+16).trim(),parent:fc(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,n),upperLatitude:e.getFloat64(t+88,n),lowerLongitude:e.getFloat64(t+104,n),upperLongitude:e.getFloat64(t+120,n),latitudeInterval:e.getFloat64(t+136,n),longitudeInterval:e.getFloat64(t+152,n),gridNodeCount:e.getInt32(t+168,n)}}function gc(e,t,n,r){for(var i=t+176,a=[],o=0;o-1.001*xl)l=-xl;else if(l>xl&&l<1.001*xl)l=xl;else{if(l<-xl)return{x:-1/0,y:-1/0,z:e.z};if(l>xl)return{x:1/0,y:1/0,z:e.z}}return s>Math.PI&&(s-=2*Math.PI),i=Math.sin(l),o=Math.cos(l),a=i*i,{x:((r=n/Math.sqrt(1-t*a))+c)*o*Math.cos(s),y:(r+c)*o*Math.sin(s),z:(r*(1-t)+c)*i}}function _c(e,t,n,r){var i,a,o,s,l,c,u,h,d,f,p,m,g,v,y,b=e.x,_=e.y,x=e.z?e.z:0;if(i=Math.sqrt(b*b+_*_),a=Math.sqrt(b*b+_*_+x*x),i/n<1e-12){if(v=0,a/n<1e-12)return xl,y=-r,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(_,b);o=x/a,h=(s=i/a)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*s*s)),d=o*l,g=0;do{g++,c=t*(u=n/Math.sqrt(1-t*d*d))/(u+(y=i*h+x*d-u*(1-t*d*d))),m=(p=o*(l=1/Math.sqrt(1-c*(2-c)*s*s)))*h-(f=s*(1-c)*l)*d,h=f,d=p}while(m*m>1e-24&&g<30);return{x:v,y:Math.atan(p/Math.abs(f)),z:y}}function xc(e){return 1===e||2===e}var wc=function(e,t,n){if(function(e,t){return e.datum_type===t.datum_type&&(!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(1===e.datum_type?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:2!==e.datum_type||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]))}(e,t))return n;if(5===e.datum_type||5===t.datum_type)return n;var r=e.a,i=e.es;if(3===e.datum_type){if(0!==Mc(e,!1,n))return;r=6378137,i=.0066943799901413165}var a=t.a,o=t.b,s=t.es;if(3===t.datum_type&&(a=6378137,o=6356752.314,s=.0066943799901413165),i===s&&r===a&&!xc(e.datum_type)&&!xc(t.datum_type))return n;if((n=bc(n,i,r),xc(e.datum_type)&&(n=function(e,t,n){if(1===t)return{x:e.x+n[0],y:e.y+n[1],z:e.z+n[2]};if(2===t){var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6];return{x:c*(e.x-l*e.y+s*e.z)+r,y:c*(l*e.x+e.y-o*e.z)+i,z:c*(-s*e.x+o*e.y+e.z)+a}}}(n,e.datum_type,e.datum_params)),xc(t.datum_type)&&(n=function(e,t,n){if(1===t)return{x:e.x-n[0],y:e.y-n[1],z:e.z-n[2]};if(2===t){var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6],u=(e.x-r)/c,h=(e.y-i)/c,d=(e.z-a)/c;return{x:u+l*h-s*d,y:-l*u+h+o*d,z:s*u-o*h+d}}}(n,t.datum_type,t.datum_params)),n=_c(n,s,a,o),3===t.datum_type)&&0!==Mc(t,!0,n))return;return n};function Mc(e,t,n){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-n.x,y:n.y},i={x:Number.NaN,y:Number.NaN},a=[],o=0;or.y||u>r.x||f1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=Kl(a.x+n.ll[0]),r.y=a.y+n.ll[1]}else isNaN(a.x)||(r.x=e.x+a.x,r.y=e.y+a.y);return r}function Tc(e,t){var n,r={x:e.x/t.del[0],y:e.y/t.del[1]},i=Math.floor(r.x),a=Math.floor(r.y),o=r.x-1*i,s=r.y-1*a,l={x:Number.NaN,y:Number.NaN};if(i<0||i>=t.lim[0])return l;if(a<0||a>=t.lim[1])return l;n=a*t.lim[0]+i;var c=t.cvs[n][0],u=t.cvs[n][1];n++;var h=t.cvs[n][0],d=t.cvs[n][1];n+=t.lim[0];var f=t.cvs[n][0],p=t.cvs[n][1];n--;var m=t.cvs[n][0],g=t.cvs[n][1],v=o*s,y=o*(1-s),b=(1-o)*(1-s),_=(1-o)*s;return l.x=b*c+y*h+_*m+v*f,l.y=b*u+y*d+_*g+v*p,l}var Ec=function(e,t,n){var r,i,a,o=n.x,s=n.y,l=n.z||0,c={};for(a=0;a<3;a++)if(!t||2!==a||void 0!==n.z)switch(0===a?(r=o,i=-1!=="ew".indexOf(e.axis[a])?"x":"y"):1===a?(r=s,i=-1!=="ns".indexOf(e.axis[a])?"y":"x"):(r=l,i="z"),e.axis[a]){case"e":c[i]=r;break;case"w":c[i]=-r;break;case"n":c[i]=r;break;case"s":c[i]=-r;break;case"u":void 0!==n[i]&&(c.z=r);break;case"d":void 0!==n[i]&&(c.z=-r);break;default:return null}return c},Cc=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t};function Ac(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function Pc(e,t,n){var r;if(Array.isArray(n)&&(n=Cc(n)),function(e){Ac(e.x),Ac(e.y)}(n),e.datum&&t.datum&&function(e,t){return(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode||(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode}(e,t)&&(n=Pc(e,r=new yc("WGS84"),n),e=r),"enu"!==e.axis&&(n=Ec(e,!1,n)),"longlat"===e.projName)n={x:n.x*wl,y:n.y*wl,z:n.z||0};else if(e.to_meter&&(n={x:n.x*e.to_meter,y:n.y*e.to_meter,z:n.z||0}),!(n=e.inverse(n)))return;if(e.from_greenwich&&(n.x+=e.from_greenwich),n=wc(e.datum,t.datum,n))return t.from_greenwich&&(n={x:n.x-t.from_greenwich,y:n.y,z:n.z||0}),"longlat"===t.projName?n={x:n.x*Ml,y:n.y*Ml,z:n.z||0}:(n=t.forward(n),t.to_meter&&(n={x:n.x/t.to_meter,y:n.y/t.to_meter,z:n.z||0})),"enu"!==t.axis?Ec(t,!0,n):n}var Lc=yc("WGS84");function Rc(e,t,n){var r,i,a;return Array.isArray(n)?(r=Pc(e,t,n)||{x:NaN,y:NaN},n.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(n.splice(3)):[r.x,r.y,n[2]].concat(n.splice(3)):[r.x,r.y].concat(n.splice(2)):[r.x,r.y]):(i=Pc(e,t,n),2===(a=Object.keys(n)).length||a.forEach((function(r){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;i[r]=n[r]})),i)}function Oc(e){return e instanceof yc?e:e.oProj?e.oProj:yc(e)}var kc=function(e,t,n){e=Oc(e);var r,i=!1;return void 0===t?(t=e,e=Lc,i=!0):(void 0!==t.x||Array.isArray(t))&&(n=t,t=e,e=Lc,i=!0),t=Oc(t),n?Rc(e,t,n):(r={forward:function(n){return Rc(e,t,n)},inverse:function(n){return Rc(t,e,n)}},i&&(r.oProj=t),r)},Ic=73,Nc=79,Dc={forward:jc,inverse:function(e){var t=Uc(Wc(e.toUpperCase()));if(t.lat&&t.lon)return[t.lon,t.lat,t.lon,t.lat];return[t.left,t.bottom,t.right,t.top]},toPoint:Fc};function jc(e,t){return t=t||5,function(e,t){var n="00000"+e.easting,r="00000"+e.northing;return e.zoneNumber+e.zoneLetter+(f=e.easting,p=e.northing,m=e.zoneNumber,g=Gc(m),v=Math.floor(f/1e5),y=Math.floor(p/1e5)%20,i=v,a=y,o=g,s=o-1,l="AJSAJS".charCodeAt(s),c="AFAFAF".charCodeAt(s),u=l+i-1,h=c+a,d=!1,u>90&&(u=u-90+65-1,d=!0),(u===Ic||lIc||(u>Ic||lNc||(u>Nc||l90&&(u=u-90+65-1),h>86?(h=h-86+65-1,d=!0):d=!1,(h===Ic||cIc||(h>Ic||cNc||(h>Nc||c86&&(h=h-86+65-1),String.fromCharCode(u)+String.fromCharCode(h))+n.substr(n.length-5,t)+r.substr(r.length-5,t);var i,a,o,s,l,c,u,h,d;var f,p,m,g,v,y}(function(e){var t,n,r,i,a,o,s,l=e.lat,c=e.lon,u=6378137,h=zc(l),d=zc(c);s=Math.floor((c+180)/6)+1,180===c&&(s=60);l>=56&&l<64&&c>=3&&c<12&&(s=32);l>=72&&l<84&&(c>=0&&c<9?s=31:c>=9&&c<21?s=33:c>=21&&c<33?s=35:c>=33&&c<42&&(s=37));o=zc(6*(s-1)-180+3),.006739496752268451,t=u/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),n=Math.tan(h)*Math.tan(h),r=.006739496752268451*Math.cos(h)*Math.cos(h),i=Math.cos(h)*(d-o),a=u*(.9983242984503243*h-.002514607064228144*Math.sin(2*h)+2639046602129982e-21*Math.sin(4*h)-3.418046101696858e-9*Math.sin(6*h));var f=.9996*t*(i+(1-n+r)*i*i*i/6+(5-18*n+n*n+72*r-.39089081163157013)*i*i*i*i*i/120)+5e5,p=.9996*(a+t*Math.tan(h)*(i*i/2+(5-n+9*r+4*r*r)*i*i*i*i/24+(61-58*n+n*n+600*r-2.2240339282485886)*i*i*i*i*i*i/720));l<0&&(p+=1e7);return{northing:Math.round(p),easting:Math.round(f),zoneNumber:s,zoneLetter:Hc(l)}}({lat:e[1],lon:e[0]}),t)}function Fc(e){var t=Uc(Wc(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function zc(e){return e*(Math.PI/180)}function Bc(e){return e/Math.PI*180}function Uc(e){var t=e.northing,n=e.easting,r=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var a,o,s,l,c,u,h,d,f=6378137,p=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=n-5e5,g=t;r<"N"&&(g-=1e7),u=6*(i-1)-180+3,d=(h=g/.9996/6367449.145945056)+(3*p/2-27*p*p*p/32)*Math.sin(2*h)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*h)+151*p*p*p/96*Math.sin(6*h),a=f/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),o=Math.tan(d)*Math.tan(d),s=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*f/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),c=m/(.9996*a);var v=d-a*Math.tan(d)/l*(c*c/2-(5+3*o+10*s-4*s*s-.06065547077041606)*c*c*c*c/24+(61+90*o+298*s+45*o*o-1.6983531815716497-3*s*s)*c*c*c*c*c*c/720);v=Bc(v);var y,b=(c-(1+2*o+s)*c*c*c/6+(5-2*s+28*o-3*s*s+.05391597401814761+24*o*o)*c*c*c*c*c/120)/Math.cos(d);if(b=u+Bc(b),e.accuracy){var _=Uc({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});y={top:_.lat,right:_.lon,bottom:v,left:b}}else y={lat:v,lon:b};return y}function Hc(e){var t="Z";return 84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C"),t}function Gc(e){var t=e%6;return 0===t&&(t=6),t}function Wc(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,n=e.length,r=null,i="",a=0;!/[A-Z]/.test(t=e.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+e;i+=t,a++}var o=parseInt(i,10);if(0===a||a+3>n)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;r=e.substring(a,a+=2);for(var l=Gc(o),c=function(e,t){var n="AJSAJS".charCodeAt(t-1),r=1e5,i=!1;for(;n!==e.charCodeAt(0);){if(++n===Ic&&n++,n===Nc&&n++,n>90){if(i)throw"Bad character: "+e;n=65,i=!0}r+=1e5}return r}(r.charAt(0),l),u=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var n="AFAFAF".charCodeAt(t-1),r=0,i=!1;for(;n!==e.charCodeAt(0);){if(++n===Ic&&n++,n===Nc&&n++,n>86){if(i)throw"Bad character: "+e;n=65,i=!0}r+=1e5}return r}(r.charAt(1),l);u0&&(d=1e5/Math.pow(10,m),f=e.substring(a,a+m),g=parseFloat(f)*d,p=e.substring(a+m),v=parseFloat(p)*d),{easting:g+c,northing:v+u,zoneLetter:s,zoneNumber:o,accuracy:d}}function Vc(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function qc(e,t,n){if(!(this instanceof qc))return new qc(e,t,n);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var r=e.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=e,this.y=t,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}qc.fromMGRS=function(e){return new qc(Fc(e))},qc.prototype.toMGRS=function(e){return jc([this.x,this.y],e)};var Xc=qc,Yc=.01068115234375,Zc=function(e){var t=[];t[0]=1-e*(.25+e*(.046875+e*(.01953125+e*Yc))),t[1]=e*(.75-e*(.046875+e*(.01953125+e*Yc)));var n=e*e;return t[2]=n*(.46875-e*(.013020833333333334+.007120768229166667*e)),n*=e,t[3]=n*(.3645833333333333-.005696614583333333*e),t[4]=n*e*.3076171875,t},Jc=function(e,t,n,r){return n*=t,t*=t,r[0]*e-n*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))},Kc=function(e,t,n){for(var r=1/(1-t),i=e,a=20;a;--a){var o=Math.sin(i),s=1-t*o*o;if(i-=s=(Jc(i,o,Math.cos(i),n)-e)*(s*Math.sqrt(s))*r,Math.abs(s)<1e-10)return i}return i};var Qc={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Zc(this.es),this.ml0=Jc(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,n,r,i=e.x,a=e.y,o=Kl(i-this.long0),s=Math.sin(a),l=Math.cos(a);if(this.es){var c=l*o,u=Math.pow(c,2),h=this.ep2*Math.pow(l,2),d=Math.pow(h,2),f=Math.abs(l)>1e-10?Math.tan(a):0,p=Math.pow(f,2),m=Math.pow(p,2);t=1-this.es*Math.pow(s,2),c/=Math.sqrt(t);var g=Jc(a,s,l,this.en);n=this.a*(this.k0*c*(1+u/6*(1-p+h+u/20*(5-18*p+m+14*h-58*p*h+u/42*(61+179*m-m*p-479*p)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+s*o*c/2*(1+u/12*(5-p+9*h+4*d+u/30*(61+m-58*p+270*h-330*p*h+u/56*(1385+543*m-m*p-3111*p))))))+this.y0}else{var v=l*Math.sin(o);if(Math.abs(Math.abs(v)-1)<1e-10)return 93;if(n=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=l*Math.cos(o)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>1e-10)return 93;r=0}else r=Math.acos(r);a<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return e.x=n,e.y=r,e},inverse:function(e){var t,n,r,i,a=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,n=Kc(t,this.es,this.en),Math.abs(n)1e-10?Math.tan(n):0,u=this.ep2*Math.pow(l,2),h=Math.pow(u,2),d=Math.pow(c,2),f=Math.pow(d,2);t=1-this.es*Math.pow(s,2);var p=a*Math.sqrt(t)/this.k0,m=Math.pow(p,2);r=n-(t*=c)*m/(1-this.es)*.5*(1-m/12*(5+3*d-9*u*d+u-4*h-m/30*(61+90*d-252*u*d+45*f+46*u-m/56*(1385+3633*d+4095*f+1574*f*d)))),i=Kl(this.long0+p*(1-m/6*(1+2*d+u-m/20*(5+28*d+24*f+8*u*d+6*u-m/42*(61+662*d+1320*f+720*f*d))))/l)}else r=xl*Jl(o),i=0;else{var g=Math.exp(a/this.k0),v=.5*(g-1/g),y=this.lat0+o/this.k0,b=Math.cos(y);t=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(v,2))),r=Math.asin(t),o<0&&(r=-r),i=0===v&&0===b?0:Kl(Math.atan2(v,b)+this.long0)}return e.x=i,e.y=r,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},$c=function(e){var t=Math.exp(e);return t=(t-1/t)/2},eu=function(e,t){e=Math.abs(e),t=Math.abs(t);var n=Math.max(e,t),r=Math.min(e,t)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))},tu=function(e){var t=Math.abs(e);return t=function(e){var t=1+e,n=t-1;return 0===n?e:e*Math.log(t)/n}(t*(1+t/(eu(1,t)+1))),e<0?-t:t},nu=function(e,t){for(var n,r=2*Math.cos(2*t),i=e.length-1,a=e[i],o=0;--i>=0;)n=r*a-o+e[i],o=a,a=n;return t+n*Math.sin(2*t)},ru=function(e,t,n){for(var r,i,a=Math.sin(t),o=Math.cos(t),s=$c(n),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(n),c=2*o*l,u=-2*a*s,h=e.length-1,d=e[h],f=0,p=0,m=0;--h>=0;)r=p,i=f,d=c*(p=d)-r-u*(f=m)+e[h],m=u*p-i+c*f;return[(c=a*l)*d-(u=o*s)*m,c*m+u*d]};var iu={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Qc.init.apply(this),this.forward=Qc.forward,this.inverse=Qc.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),n=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),n*=t,this.cgb[1]=n*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),n*=t,this.cgb[2]=n*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=n*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),n*=t,this.cgb[3]=n*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=n*(1237/630+t*(t*(-24832/14175)-2.4)),n*=t,this.cgb[4]=n*(4174/315+t*(-144838/6237)),this.cbg[4]=n*(-734/315+t*(109598/31185)),n*=t,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=n*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=n*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),n*=t,this.utg[2]=n*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=n*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),n*=t,this.utg[3]=n*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=n*(49561/161280+t*(-179/168+t*(6601661/7257600))),n*=t,this.utg[4]=n*(-4583/161280+t*(108847/3991680)),this.gtu[4]=n*(34729/80640+t*(-3418889/1995840)),n*=t,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var r=nu(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(e,t){for(var n,r=2*Math.cos(t),i=e.length-1,a=e[i],o=0;--i>=0;)n=r*a-o+e[i],o=a,a=n;return Math.sin(t)*n}(this.gtu,2*r))},forward:function(e){var t=Kl(e.x-this.long0),n=e.y;n=nu(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),a=Math.sin(t),o=Math.cos(t);n=Math.atan2(r,o*i),t=Math.atan2(a*i,eu(r,i*o)),t=tu(Math.tan(t));var s,l,c=ru(this.gtu,2*n,2*t);return n+=c[0],t+=c[1],Math.abs(t)<=2.623395162778?(s=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(s=1/0,l=1/0),e.x=s,e.y=l,e},inverse:function(e){var t,n,r=(e.x-this.x0)*(1/this.a),i=(e.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var a=ru(this.utg,2*i,2*r);i+=a[0],r+=a[1],r=Math.atan($c(r));var o=Math.sin(i),s=Math.cos(i),l=Math.sin(r),c=Math.cos(r);i=Math.atan2(o*c,eu(l,c*s)),r=Math.atan2(l,c*s),t=Kl(r+this.long0),n=nu(this.cgb,i)}else t=1/0,n=1/0;return e.x=t,e.y=n,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]};var au={init:function(){var e=function(e,t){if(void 0===e){if((e=Math.floor(30*(Kl(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e}(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*wl,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,iu.init.apply(this),this.forward=iu.forward,this.inverse=iu.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},ou=function(e,t){return Math.pow((1-e)/(1+e),t)};var su={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Sl)/(Math.pow(Math.tan(.5*this.lat0+Sl),this.C)*ou(this.e*e,this.ratexp))},forward:function(e){var t=e.x,n=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+Sl),this.C)*ou(this.e*Math.sin(n),this.ratexp))-xl,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,n=e.y,r=Math.pow(Math.tan(.5*n+Sl)/this.K,1/this.C),i=20;i>0&&(n=2*Math.atan(r*ou(this.e*Math.sin(e.y),-.5*this.e))-xl,!(Math.abs(n-e.y)<1e-14));--i)e.y=n;return i?(e.x=t,e.y=n,e):null},names:["gauss"]};var lu={init:function(){su.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(e){var t,n,r,i;return e.x=Kl(e.x-this.long0),su.forward.apply(this,[e]),t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*n*r),e.x=i*n*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*n*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,n,r,i,a;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,a=Math.sqrt(e.x*e.x+e.y*e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),n=Math.cos(o),i=Math.asin(n*this.sinc0+e.y*t*this.cosc0/a),r=Math.atan2(e.x*t,a*this.cosc0*n-e.y*this.sinc0*t)}else i=this.phic0,r=0;return e.x=r,e.y=i,su.inverse.apply(this,[e]),e.x=Kl(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var cu={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+Jl(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*this.cons*Zl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ql(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Zl(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-xl,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,n,r,i,a,o,s=e.x,l=e.y,c=Math.sin(l),u=Math.cos(l),h=Kl(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=1e-10&&Math.abs(l+this.lat0)<=1e-10?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(h)),e.x=this.a*t*u*Math.sin(h)+this.x0,e.y=this.a*t*(this.coslat0*c-this.sinlat0*u*Math.cos(h))+this.y0,e):(n=2*Math.atan(this.ssfn_(l,c,this.e))-xl,i=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=1e-10?(a=Ql(this.e,l*this.con,this.con*c),o=2*this.a*this.k0*a/this.cons,e.x=this.x0+o*Math.sin(s-this.long0),e.y=this.y0-this.con*o*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)<1e-10?(t=2*this.a*this.k0/(1+i*Math.cos(h)),e.y=t*r):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*i*Math.cos(h))),e.y=t*(this.cosX0*r-this.sinX0*i*Math.cos(h))+this.y0),e.x=t*i*Math.sin(h)+this.x0,e))},inverse:function(e){var t,n,r,i,a;e.x-=this.x0,e.y-=this.y0;var o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,n=this.lat0,o<=1e-10?(e.x=t,e.y=n,e):(n=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/o),t=Math.abs(this.coslat0)<1e-10?this.lat0>0?Kl(this.long0+Math.atan2(e.x,-1*e.y)):Kl(this.long0+Math.atan2(e.x,e.y)):Kl(this.long0+Math.atan2(e.x*Math.sin(s),o*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=n,e)}if(Math.abs(this.coslat0)<=1e-10){if(o<=1e-10)return n=this.lat0,t=this.long0,e.x=t,e.y=n,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),n=this.con*$l(this.e,r),t=this.con*Kl(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=1e-10?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/o),t=Kl(this.long0+Math.atan2(e.x*Math.sin(i),o*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)))),n=-1*$l(this.e,Math.tan(.5*(xl+a)));return e.x=t,e.y=n,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(e,t,n){return t*=n,Math.tan(.5*(xl+e))*Math.pow((1-t)/(1+t),.5*n)}};var uu={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),n=this.a,r=1/this.rf,i=2*r-Math.pow(r,2),a=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*Math.pow(t,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,n=e.y-this.y0,r=t/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+o/this.alpha,l=0,c=a,u=-1e3,h=0;Math.abs(c-u)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),u=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=c,e},names:["somerc"]};var hu={init:function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var e=Math.sin(this.lat0),t=Math.cos(this.lat0),n=this.e*e;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(t,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-n*n);var r,i,a=Ql(this.e,this.lat0,e),o=this.bl/t*Math.sqrt((1-this.es)/(1-n*n));if(o*o<1&&(o=1),isNaN(this.longc)){var s=Ql(this.e,this.lat1,Math.sin(this.lat1)),l=Ql(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(o+Math.sqrt(o*o-1))*Math.pow(a,this.bl):this.el=(o-Math.sqrt(o*o-1))*Math.pow(a,this.bl);var c=Math.pow(s,this.bl),u=Math.pow(l,this.bl);i=.5*((r=this.el/c)-1/r);var h=(this.el*this.el-u*c)/(this.el*this.el+u*c),d=(u-c)/(u+c),f=Kl(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(h*Math.tan(.5*this.bl*f)/d)/this.bl,this.long0=Kl(this.long0);var p=Kl(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*p)/i),this.alpha=Math.asin(o*Math.sin(this.gamma0))}else r=this.lat0>=0?o+Math.sqrt(o*o-1):o-Math.sqrt(o*o-1),this.el=r*Math.pow(a,this.bl),i=.5*(r-1/r),this.gamma0=Math.asin(Math.sin(this.alpha)/o),this.long0=this.longc-Math.asin(i*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(o*o-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(o*o-1),Math.cos(this.alpha))},forward:function(e){var t,n,r,i=e.x,a=e.y,o=Kl(i-this.long0);if(Math.abs(Math.abs(a)-xl)<=1e-10)r=a>0?-1:1,n=this.al/this.bl*Math.log(Math.tan(Sl+r*this.gamma0*.5)),t=-1*r*xl*this.al/this.bl;else{var s=Ql(this.e,a,Math.sin(a)),l=this.el/Math.pow(s,this.bl),c=.5*(l-1/l),u=.5*(l+1/l),h=Math.sin(this.bl*o),d=(c*Math.sin(this.gamma0)-h*Math.cos(this.gamma0))/u;n=Math.abs(Math.abs(d)-1)<=1e-10?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-d)/(1+d))/this.bl,t=Math.abs(Math.cos(this.bl*o))<=1e-10?this.al*this.bl*o:this.al*Math.atan2(c*Math.cos(this.gamma0)+h*Math.sin(this.gamma0),Math.cos(this.bl*o))/this.bl}return this.no_rot?(e.x=this.x0+t,e.y=this.y0+n):(t-=this.uc,e.x=this.x0+n*Math.cos(this.alpha)+t*Math.sin(this.alpha),e.y=this.y0+t*Math.cos(this.alpha)-n*Math.sin(this.alpha)),e},inverse:function(e){var t,n;this.no_rot?(n=e.y-this.y0,t=e.x-this.x0):(n=(e.x-this.x0)*Math.cos(this.alpha)-(e.y-this.y0)*Math.sin(this.alpha),t=(e.y-this.y0)*Math.cos(this.alpha)+(e.x-this.x0)*Math.sin(this.alpha),t+=this.uc);var r=Math.exp(-1*this.bl*n/this.al),i=.5*(r-1/r),a=.5*(r+1/r),o=Math.sin(this.bl*t/this.al),s=(o*Math.cos(this.gamma0)+i*Math.sin(this.gamma0))/a,l=Math.pow(this.el/Math.sqrt((1+s)/(1-s)),1/this.bl);return Math.abs(s-1)<1e-10?(e.x=this.long0,e.y=xl):Math.abs(s+1)<1e-10?(e.x=this.long0,e.y=-1*xl):(e.y=$l(this.e,l),e.x=Kl(this.long0-Math.atan2(i*Math.cos(this.gamma0)-o*Math.sin(this.gamma0),Math.cos(this.bl*t/this.al))/this.bl)),e},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]};var du={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),n=Math.cos(this.lat1),r=Zl(this.e,t,n),i=Ql(this.e,this.lat1,t),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=Zl(this.e,a,o),l=Ql(this.e,this.lat2,a),c=Ql(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(r/s)/Math.log(i/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,n=e.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=Jl(n)*(xl-2e-10));var r,i,a=Math.abs(Math.abs(n)-xl);if(a>1e-10)r=Ql(this.e,n,Math.sin(n)),i=this.a*this.f0*Math.pow(r,this.ns);else{if((a=n*this.ns)<=0)return null;i=0}var o=this.ns*Kl(t-this.long0);return e.x=this.k0*(i*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-i*Math.cos(o))+this.y0,e},inverse:function(e){var t,n,r,i,a,o=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+s*s),n=1):(t=-Math.sqrt(o*o+s*s),n=-1);var l=0;if(0!==t&&(l=Math.atan2(n*o,n*s)),0!==t||this.ns>0){if(n=1/this.ns,r=Math.pow(t/(this.a*this.f0),n),-9999===(i=$l(this.e,r)))return null}else i=-xl;return a=Kl(l/this.ns+this.long0),e.x=a,e.y=i,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]};var fu={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(e){var t,n,r,i,a,o,s,l=e.x,c=e.y,u=Kl(l-this.long0);return t=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/t)-this.s45),r=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),a=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,n,r,i,a,o,s,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),i=Math.atan2(e.y,e.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(t)),e.x=this.long0-n/this.alfa,o=t,s=0;var c=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(s=1),o=e.y,c+=1}while(0===s&&c<15);return c>=15?null:e},names:["Krovak","krovak"]},pu=function(e,t,n,r,i){return e*i-t*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)},mu=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},gu=function(e){return.375*e*(1+.25*e*(1+.46875*e))},vu=function(e){return.05859375*e*e*(1+.75*e)},yu=function(e){return e*e*e*(35/3072)},bu=function(e,t,n){var r=t*n;return e/Math.sqrt(1-r*r)},_u=function(e){return Math.abs(e)1e-7?(1-e*e)*(t/(1-(n=e*t)*n)-.5/e*Math.log((1-n)/(1+n))):2*t};var Su={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-xl)<1e-10?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<1e-10?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Mu(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,n=[];return n[0]=.3333333333333333*e,t=e*e,n[0]+=.17222222222222222*t,n[1]=.06388888888888888*t,t*=e,n[0]+=.10257936507936508*t,n[1]+=.0664021164021164*t,n[2]=.016415012942191543*t,n}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Mu(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(e){var t,n,r,i,a,o,s,l,c,u,h=e.x,d=e.y;if(h=Kl(h-this.long0),this.sphere){if(a=Math.sin(d),u=Math.cos(d),r=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+u*r:1+this.sinph0*a+this.cosph0*u*r)<=1e-10)return null;t=(n=Math.sqrt(2/n))*u*Math.sin(h),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*u*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(d+this.lat0)<1e-10)return null;n=Sl-.5*d,t=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(h),n*=r}}else{switch(s=0,l=0,c=0,r=Math.cos(h),i=Math.sin(h),a=Math.sin(d),o=Mu(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=o/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:c=1+this.sinb1*s+this.cosb1*l*r;break;case this.EQUIT:c=1+l*r;break;case this.N_POLE:c=xl+d,o=this.qp-o;break;case this.S_POLE:c=d-xl,o=this.qp+o}if(Math.abs(c)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),n=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*s-this.sinb1*l*r):(c=Math.sqrt(2/(1+l*r)))*s*this.ymf,t=this.xmf*c*l*i;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(c=Math.sqrt(o))*i,n=r*(this.mode===this.S_POLE?c:-c)):t=n=0}}return e.x=this.a*t+this.x0,e.y=this.a*n+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,a,o,s,l,c,u,h=e.x/this.a,d=e.y/this.a;if(this.sphere){var f,p=0,m=0;if((n=.5*(f=Math.sqrt(h*h+d*d)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(n),p=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(f)<=1e-10?0:Math.asin(d*m/f),h*=m,d=p*f;break;case this.OBLIQ:n=Math.abs(f)<=1e-10?this.lat0:Math.asin(p*this.sinph0+d*m*this.cosph0/f),h*=m*this.cosph0,d=(p-Math.sin(n)*this.sinph0)*f;break;case this.N_POLE:d=-d,n=xl-n;break;case this.S_POLE:n-=xl}t=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(h,d):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(h/=this.dd,d*=this.dd,(o=Math.sqrt(h*h+d*d))<1e-10)return e.x=this.long0,e.y=this.lat0,e;i=2*Math.asin(.5*o/this.rq),r=Math.cos(i),h*=i=Math.sin(i),this.mode===this.OBLIQ?(s=r*this.sinb1+d*i*this.cosb1/o,a=this.qp*s,d=o*this.cosb1*r-d*this.sinb1*i):(s=d*i/o,a=this.qp*s,d=o*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(d=-d),!(a=h*h+d*d))return e.x=this.long0,e.y=this.lat0,e;s=1-a/this.qp,this.mode===this.S_POLE&&(s=-s)}t=Math.atan2(h,d),l=Math.asin(s),c=this.apa,u=l+l,n=l+c[0]*Math.sin(u)+c[1]*Math.sin(u+u)+c[2]*Math.sin(u+u+u)}return e.x=Kl(this.long0+t),e.y=n,e},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Tu=function(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)};var Eu={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Zl(this.e3,this.sin_po,this.cos_po),this.qs1=Mu(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Zl(this.e3,this.sin_po,this.cos_po),this.qs2=Mu(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Mu(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,n=e.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=Mu(this.e3,this.sin_phi,this.cos_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*Kl(t-this.long0),o=i*Math.sin(a)+this.x0,s=this.rh-i*Math.cos(a)+this.y0;return e.x=o,e.y=s,e},inverse:function(e){var t,n,r,i,a,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),i=0,0!==t&&(i=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,n)),a=Kl(i/this.ns0+this.long0),e.x=a,e.y=o,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var n,r,i,a,o=Tu(.5*t);if(e<1e-10)return o;for(var s=e*e,l=1;l<=25;l++)if(o+=a=.5*(i=1-(r=e*(n=Math.sin(o)))*r)*i/Math.cos(o)*(t/(1-s)-n/i+.5/e*Math.log((1-r)/(1+r))),Math.abs(a)<=1e-7)return o;return null}};var Cu={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(e){var t,n,r,i,a,o,s,l=e.x,c=e.y;return r=Kl(l-this.long0),t=Math.sin(c),n=Math.cos(c),i=Math.cos(r),1,(a=this.sin_p14*t+this.cos_p14*n*i)>0||Math.abs(a)<=1e-10?(o=this.x0+1*this.a*n*Math.sin(r)/a,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*n*i)/a):(o=this.x0+this.infinity_dist*n*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*n*i)),e.x=o,e.y=s,e},inverse:function(e){var t,n,r,i,a,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),n=Math.sin(i),r=Math.cos(i),o=Tu(r*this.sin_p14+e.y*n*this.cos_p14/t),a=Math.atan2(e.x*n,t*this.cos_p14*r-e.y*this.sin_p14*n),a=Kl(this.long0+a)):(o=this.phic0,a=0),e.x=a,e.y=o,e},names:["gnom"]};var Au={init:function(){this.sphere||(this.k0=Zl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,n,r=e.x,i=e.y,a=Kl(r-this.long0);if(this.sphere)t=this.x0+this.a*a*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var o=Mu(this.e,Math.sin(i));t=this.x0+this.a*this.k0*a,n=this.y0+this.a*o*.5/this.k0}return e.x=t,e.y=n,e},inverse:function(e){var t,n;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=Kl(this.long0+e.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(n=function(e,t){var n=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-n)<1e-6)return t<0?-1*xl:xl;for(var r,i,a,o,s=Math.asin(.5*t),l=0;l<30;l++)if(i=Math.sin(s),a=Math.cos(s),o=e*i,s+=r=Math.pow(1-o*o,2)/(2*a)*(t/(1-e*e)-i/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),Math.abs(r)<=1e-10)return s;return NaN}(this.e,2*e.y*this.k0/this.a),t=Kl(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=n,e},names:["cea"]};var Pu={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(e){var t=e.x,n=e.y,r=Kl(t-this.long0),i=_u(n-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*i,e},inverse:function(e){var t=e.x,n=e.y;return e.x=Kl(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=_u(this.lat0+(n-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var Lu={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=mu(this.es),this.e1=gu(this.es),this.e2=vu(this.es),this.e3=yu(this.es),this.ml0=this.a*pu(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,n,r,i=e.x,a=e.y,o=Kl(i-this.long0);if(r=o*Math.sin(a),this.sphere)Math.abs(a)<=1e-10?(t=this.a*o,n=-1*this.a*this.lat0):(t=this.a*Math.sin(r)/Math.tan(a),n=this.a*(_u(a-this.lat0)+(1-Math.cos(r))/Math.tan(a)));else if(Math.abs(a)<=1e-10)t=this.a*o,n=-1*this.ml0;else{var s=bu(this.a,this.e,Math.sin(a))/Math.tan(a);t=s*Math.sin(r),n=this.a*pu(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+s*(1-Math.cos(r))}return e.x=t+this.x0,e.y=n+this.y0,e},inverse:function(e){var t,n,r,i,a,o,s,l,c;if(r=e.x-this.x0,i=e.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=1e-10)t=Kl(r/this.a+this.long0),n=0;else{var u;for(o=this.lat0+i/this.a,s=r*r/this.a/this.a+o*o,l=o,a=20;a;--a)if(l+=c=-1*(o*(l*(u=Math.tan(l))+1)-l-.5*(l*l+s)*u)/((l-o)/u-1),Math.abs(c)<=1e-10){n=l;break}t=Kl(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(n))}else if(Math.abs(i+this.ml0)<=1e-10)n=0,t=Kl(this.long0+r/this.a);else{var h,d,f,p,m;for(o=(this.ml0+i)/this.a,s=r*r/this.a/this.a+o*o,l=o,a=20;a;--a)if(m=this.e*Math.sin(l),h=Math.sqrt(1-m*m)*Math.tan(l),d=this.a*pu(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(o*(h*(p=d/this.a)+1)-p-.5*h*(p*p+s))/(this.es*Math.sin(2*l)*(p*p+s-2*o*p)/(4*h)+(o-p)*(h*f-2/Math.sin(2*l))-f),Math.abs(c)<=1e-10){n=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),t=Kl(this.long0+Math.asin(r*h/this.a)/Math.sin(n))}return e.x=t,e.y=n,e},names:["Polyconic","poly"]};var Ru={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var t,n=e.x,r=e.y-this.lat0,i=n-this.long0,a=r/_l*1e-5,o=i,s=1,l=0;for(t=1;t<=10;t++)s*=a,l+=this.A[t]*s;var c,u=l,h=o,d=1,f=0,p=0,m=0;for(t=1;t<=6;t++)c=f*u+d*h,d=d*u-f*h,f=c,p=p+this.B_re[t]*d-this.B_im[t]*f,m=m+this.B_im[t]*d+this.B_re[t]*f;return e.x=m*this.a+this.x0,e.y=p*this.a+this.y0,e},inverse:function(e){var t,n,r=e.x,i=e.y,a=r-this.x0,o=(i-this.y0)/this.a,s=a/this.a,l=1,c=0,u=0,h=0;for(t=1;t<=6;t++)n=c*o+l*s,l=l*o-c*s,c=n,u=u+this.C_re[t]*l-this.C_im[t]*c,h=h+this.C_im[t]*l+this.C_re[t]*c;for(var d=0;d.999999999999&&(n=.999999999999),t=Math.asin(n);var r=Kl(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*t+Math.sin(2*t))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return e.x=r,e.y=i,e},names:["Mollweide","moll"]};var Nu={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=mu(this.es),this.e1=gu(this.es),this.e2=vu(this.es),this.e3=yu(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Zl(this.e,this.sinphi,this.cosphi),this.ml1=pu(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Zl(this.e,this.sinphi,this.cosphi),this.ml2=pu(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=pu(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(e){var t,n=e.x,r=e.y;if(this.sphere)t=this.a*(this.g-r);else{var i=pu(this.e0,this.e1,this.e2,this.e3,r);t=this.a*(this.g-i)}var a=this.ns*Kl(n-this.long0),o=this.x0+t*Math.sin(a),s=this.y0+this.rh-t*Math.cos(a);return e.x=o,e.y=s,e},inverse:function(e){var t,n,r,i;e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns>=0?(n=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(n=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var a=0;if(0!==n&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere)return i=Kl(this.long0+a/this.ns),r=_u(this.g-n/this.a),e.x=i,e.y=r,e;var o=this.g-n/this.a;return r=xu(o,this.e0,this.e1,this.e2,this.e3),i=Kl(this.long0+a/this.ns),e.x=i,e.y=r,e},names:["Equidistant_Conic","eqdc"]};var Du={init:function(){this.R=this.a},forward:function(e){var t,n,r=e.x,i=e.y,a=Kl(r-this.long0);Math.abs(i)<=1e-10&&(t=this.x0+this.R*a,n=this.y0);var o=Tu(2*Math.abs(i/Math.PI));(Math.abs(a)<=1e-10||Math.abs(Math.abs(i)-xl)<=1e-10)&&(t=this.x0,n=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/a-a/Math.PI),l=s*s,c=Math.sin(o),u=Math.cos(o),h=u/(c+u-1),d=h*h,f=h*(2/c-1),p=f*f,m=Math.PI*this.R*(s*(h-p)+Math.sqrt(l*(h-p)*(h-p)-(p+l)*(d-p)))/(p+l);a<0&&(m=-m),t=this.x0+m;var g=l+h;return m=Math.PI*this.R*(f*g-s*Math.sqrt((p+l)*(l+1)-g*g))/(p+l),n=i>=0?this.y0+m:this.y0-m,e.x=t,e.y=n,e},inverse:function(e){var t,n,r,i,a,o,s,l,c,u,h,d;return e.x-=this.x0,e.y-=this.y0,h=Math.PI*this.R,a=(r=e.x/h)*r+(i=e.y/h)*i,h=3*(i*i/(l=-2*(o=-Math.abs(i)*(1+a))+1+2*i*i+a*a)+(2*(s=o-2*i*i+r*r)*s*s/l/l/l-9*o*s/l/l)/27)/(c=(o-s*s/3/l)/l)/(u=2*Math.sqrt(-c/3)),Math.abs(h)>1&&(h=h>=0?1:-1),d=Math.acos(h)/3,n=e.y>=0?(-u*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI:-(-u*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI,t=Math.abs(r)<1e-10?this.long0:Kl(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-i*i)+a*a))/2/r),e.x=t,e.y=n,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var ju={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(e){var t,n,r,i,a,o,s,l,c,u,h,d,f,p,m,g,v,y,b,_,x,w,M=e.x,S=e.y,T=Math.sin(e.y),E=Math.cos(e.y),C=Kl(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(e.x=this.x0+this.a*(xl-S)*Math.sin(C),e.y=this.y0-this.a*(xl-S)*Math.cos(C),e):Math.abs(this.sin_p12+1)<=1e-10?(e.x=this.x0+this.a*(xl+S)*Math.sin(C),e.y=this.y0+this.a*(xl+S)*Math.cos(C),e):(y=this.sin_p12*T+this.cos_p12*E*Math.cos(C),v=(g=Math.acos(y))?g/Math.sin(g):1,e.x=this.x0+this.a*v*E*Math.sin(C),e.y=this.y0+this.a*v*(this.cos_p12*T-this.sin_p12*E*Math.cos(C)),e):(t=mu(this.es),n=gu(this.es),r=vu(this.es),i=yu(this.es),Math.abs(this.sin_p12-1)<=1e-10?(a=this.a*pu(t,n,r,i,xl),o=this.a*pu(t,n,r,i,S),e.x=this.x0+(a-o)*Math.sin(C),e.y=this.y0-(a-o)*Math.cos(C),e):Math.abs(this.sin_p12+1)<=1e-10?(a=this.a*pu(t,n,r,i,xl),o=this.a*pu(t,n,r,i,S),e.x=this.x0+(a+o)*Math.sin(C),e.y=this.y0+(a+o)*Math.cos(C),e):(s=T/E,l=bu(this.a,this.e,this.sin_p12),c=bu(this.a,this.e,T),u=Math.atan((1-this.es)*s+this.es*l*this.sin_p12/(c*E)),b=0===(h=Math.atan2(Math.sin(C),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(C)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(h)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(C)*Math.cos(u)/Math.sin(h)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),g=l*b*(1-(_=b*b)*(m=(f=this.e*this.cos_p12*Math.cos(h)/Math.sqrt(1-this.es))*f)*(1-m)/6+(x=_*b)/8*(p=d*f)*(1-2*m)+(w=x*b)/120*(m*(4-7*m)-3*d*d*(1-7*m))-w*b/48*p),e.x=this.x0+g*Math.sin(h),e.y=this.y0+g*Math.cos(h),e))},inverse:function(e){var t,n,r,i,a,o,s,l,c,u,h,d,f,p,m,g,v,y,b,_,x,w,M;if(e.x-=this.x0,e.y-=this.y0,this.sphere){if((t=Math.sqrt(e.x*e.x+e.y*e.y))>2*xl*this.a)return;return n=t/this.a,r=Math.sin(n),i=Math.cos(n),a=this.long0,Math.abs(t)<=1e-10?o=this.lat0:(o=Tu(i*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-xl,a=Math.abs(s)<=1e-10?this.lat0>=0?Kl(this.long0+Math.atan2(e.x,-e.y)):Kl(this.long0-Math.atan2(-e.x,e.y)):Kl(this.long0+Math.atan2(e.x*r,t*this.cos_p12*i-e.y*this.sin_p12*r))),e.x=a,e.y=o,e}return l=mu(this.es),c=gu(this.es),u=vu(this.es),h=yu(this.es),Math.abs(this.sin_p12-1)<=1e-10?(d=this.a*pu(l,c,u,h,xl),t=Math.sqrt(e.x*e.x+e.y*e.y),o=xu((d-t)/this.a,l,c,u,h),a=Kl(this.long0+Math.atan2(e.x,-1*e.y)),e.x=a,e.y=o,e):Math.abs(this.sin_p12+1)<=1e-10?(d=this.a*pu(l,c,u,h,xl),t=Math.sqrt(e.x*e.x+e.y*e.y),o=xu((t-d)/this.a,l,c,u,h),a=Kl(this.long0+Math.atan2(e.x,e.y)),e.x=a,e.y=o,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),m=Math.atan2(e.x,e.y),f=bu(this.a,this.e,this.sin_p12),g=Math.cos(m),y=-(v=this.e*this.cos_p12*g)*v/(1-this.es),b=3*this.es*(1-y)*this.sin_p12*this.cos_p12*g/(1-this.es),w=1-y*(x=(_=t/f)-y*(1+y)*Math.pow(_,3)/6-b*(1+3*y)*Math.pow(_,4)/24)*x/2-_*x*x*x/6,p=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*g),a=Kl(this.long0+Math.asin(Math.sin(m)*Math.sin(x)/Math.cos(p))),M=Math.sin(p),o=Math.atan2((M-this.es*w*this.sin_p12)*Math.tan(p),M*(1-this.es)),e.x=a,e.y=o,e)},names:["Azimuthal_Equidistant","aeqd"]};var Fu={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,n,r,i,a,o,s,l=e.x,c=e.y;return r=Kl(l-this.long0),t=Math.sin(c),n=Math.cos(c),i=Math.cos(r),1,((a=this.sin_p14*t+this.cos_p14*n*i)>0||Math.abs(a)<=1e-10)&&(o=1*this.a*n*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*n*i)),e.x=o,e.y=s,e},inverse:function(e){var t,n,r,i,a,o,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),n=Tu(t/this.a),r=Math.sin(n),i=Math.cos(n),o=this.long0,Math.abs(t)<=1e-10?(s=this.lat0,e.x=o,e.y=s,e):(s=Tu(i*this.sin_p14+e.y*r*this.cos_p14/t),a=Math.abs(this.lat0)-xl,Math.abs(a)<=1e-10?(o=this.lat0>=0?Kl(this.long0+Math.atan2(e.x,-e.y)):Kl(this.long0-Math.atan2(-e.x,e.y)),e.x=o,e.y=s,e):(o=Kl(this.long0+Math.atan2(e.x*r,t*this.cos_p14*i-e.y*this.sin_p14*r)),e.x=o,e.y=s,e))},names:["ortho"]},zu=1,Bu=2,Uu=3,Hu=4,Gu=5,Wu=6,Vu=1,qu=2,Xu=3,Yu=4;function Zu(e,t,n,r){var i;return e<1e-10?(r.value=Vu,i=0):(i=Math.atan2(t,n),Math.abs(i)<=Sl?r.value=Vu:i>Sl&&i<=xl+Sl?(r.value=qu,i-=xl):i>xl+Sl||i<=-(xl+Sl)?(r.value=Xu,i=i>=0?i-El:i+El):(r.value=Yu,i+=xl)),i}function Ju(e,t){var n=e+t;return n<-El?n+=Tl:n>+El&&(n-=Tl),n}var Ku={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=xl-Sl/2?this.face=Gu:this.lat0<=-(xl-Sl/2)?this.face=Wu:Math.abs(this.long0)<=Sl?this.face=zu:Math.abs(this.long0)<=xl+Sl?this.face=this.long0>0?Bu:Hu:this.face=Uu,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(e){var t,n,r,i,a,o,s={x:0,y:0},l={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,n=e.x,this.face===Gu)i=xl-t,n>=Sl&&n<=xl+Sl?(l.value=Vu,r=n-xl):n>xl+Sl||n<=-(xl+Sl)?(l.value=qu,r=n>0?n-El:n+El):n>-(xl+Sl)&&n<=-Sl?(l.value=Xu,r=n+xl):(l.value=Yu,r=n);else if(this.face===Wu)i=xl+t,n>=Sl&&n<=xl+Sl?(l.value=Vu,r=-n+xl):n=-Sl?(l.value=qu,r=-n):n<-Sl&&n>=-(xl+Sl)?(l.value=Xu,r=-n-xl):(l.value=Yu,r=n>0?-n+El:-n-El);else{var c,u,h,d,f,p;this.face===Bu?n=Ju(n,+xl):this.face===Uu?n=Ju(n,+El):this.face===Hu&&(n=Ju(n,-xl)),d=Math.sin(t),f=Math.cos(t),p=Math.sin(n),c=f*Math.cos(n),u=f*p,h=d,this.face===zu?r=Zu(i=Math.acos(c),h,u,l):this.face===Bu?r=Zu(i=Math.acos(u),h,-c,l):this.face===Uu?r=Zu(i=Math.acos(-c),h,-u,l):this.face===Hu?r=Zu(i=Math.acos(-u),h,c,l):(i=r=0,l.value=Vu)}return o=Math.atan(12/El*(r+Math.acos(Math.sin(r)*Math.cos(Sl))-xl)),a=Math.sqrt((1-Math.cos(i))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===qu?o+=xl:l.value===Xu?o+=El:l.value===Yu&&(o+=1.5*El),s.x=a*Math.cos(o),s.y=a*Math.sin(o),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,e.x=s.x,e.y=s.y,e},inverse:function(e){var t,n,r,i,a,o,s,l,c,u,h,d,f={lam:0,phi:0},p={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,n=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?p.value=Vu:e.y>=0&&e.y>=Math.abs(e.x)?(p.value=qu,t-=xl):e.x<0&&-e.x>=Math.abs(e.y)?(p.value=Xu,t=t<0?t+El:t-El):(p.value=Yu,t+=xl),c=El/12*Math.tan(t),a=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(a),(s=1-(r=Math.cos(t))*r*(i=Math.tan(n))*i*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?s=-1:s>1&&(s=1),this.face===Gu)l=Math.acos(s),f.phi=xl-l,p.value===Vu?f.lam=o+xl:p.value===qu?f.lam=o<0?o+El:o-El:p.value===Xu?f.lam=o-xl:f.lam=o;else if(this.face===Wu)l=Math.acos(s),f.phi=l-xl,p.value===Vu?f.lam=-o+xl:p.value===qu?f.lam=-o:p.value===Xu?f.lam=-o-xl:f.lam=o<0?-o-El:-o+El;else{var m,g,v;c=(m=s)*m,g=(c+=(v=c>=1?0:Math.sqrt(1-c)*Math.sin(o))*v)>=1?0:Math.sqrt(1-c),p.value===qu?(c=g,g=-v,v=c):p.value===Xu?(g=-g,v=-v):p.value===Yu&&(c=g,g=v,v=-c),this.face===Bu?(c=m,m=-g,g=c):this.face===Uu?(m=-m,g=-g):this.face===Hu&&(c=m,m=g,g=-c),f.phi=Math.acos(-v)-xl,f.lam=Math.atan2(g,m),this.face===Bu?f.lam=Ju(f.lam,-xl):this.face===Uu?f.lam=Ju(f.lam,-El):this.face===Hu&&(f.lam=Ju(f.lam,+xl))}return 0!==this.es&&(u=f.phi<0?1:0,h=Math.tan(f.phi),d=this.b/Math.sqrt(h*h+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),u&&(f.phi=-f.phi)),f.lam+=this.long0,e.x=f.lam,e.y=f.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Qu=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],$u=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],eh=Ml/5,th=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))};var nh={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(e){var t=Kl(e.x-this.long0),n=Math.abs(e.y),r=Math.floor(n*eh);r<0?r=0:r>=18&&(r=17);var i={x:th(Qu[r],n=Ml*(n-.08726646259971647*r))*t,y:th($u[r],n)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*.8487+this.x0,i.y=i.y*this.a*1.3523+this.y0,i},inverse:function(e){var t={x:(e.x-this.x0)/(.8487*this.a),y:Math.abs(e.y-this.y0)/(1.3523*this.a)};if(t.y>=1)t.x/=Qu[18][0],t.y=e.y<0?-xl:xl;else{var n=Math.floor(18*t.y);for(n<0?n=0:n>=18&&(n=17);;)if($u[n][0]>t.y)--n;else{if(!($u[n+1][0]<=t.y))break;++n}var r=$u[n],i=5*(t.y-r[0])/($u[n+1][0]-r[0]);i=function(e,t,n,r){for(var i=t;r;--r){var a=e(i);if(i-=a,Math.abs(a)1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var a={header:i,subgrids:function(e,t,n){for(var r=[],i=0;i=0;o--)this.options.resolutions[o]&&(this._scales[o]=1/this.options.resolutions[o])}}return e.prototype.project=function(e,t,n){return this.projection.project(e)},e.prototype.unproject=function(e,t,n){return this.projection.unproject(e)},e.prototype.latLngToPoint=function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},e.prototype.pointToLatLng=function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},e.prototype.scale=function(e){var t,n=Math.floor(e);return e===n?this._scales[e]:(t=this._scales[n])+(this._scales[n+1]-t)*(e-n)},e}(),ph=function(){function e(e,t,n){var r,i=void 0!==(r=e).inverse&&void 0!==r.forward;this._proj=i?e:this._projFromCodeDef(e,t),this.bounds=i?t:n}return e.prototype.project=function(e){var t=this._proj.forward([e.lng,e.lat]);return{x:t[0],y:t[1]}},e.prototype.unproject=function(e){var t=this._proj.inverse([e.x,e.y]);return{lat:t[1],lng:t[0]}},e.prototype._projFromCodeDef=function(e,t){if(t)dh.defs(e,t);else if(void 0===dh.defs[e]){var n=e.split(":");if(n.length>3&&(e=n[n.length-3]+":"+n[n.length-1]),void 0===dh.defs[e])throw"No projection definition for code "+e}return dh(e)},e}(),mh=function(){function e(e,t,n,r){if(yl.isArray(e))return this._a=e[0],this._b=e[1],this._c=e[2],void(this._d=e[3]);this._a=e,this._b=t,this._c=n,this._d=r}return e.prototype.transform=function(e,t){return this._transform({x:e.x,y:e.y},t)},e.prototype._transform=function(e,t){return t=null!=t?t:1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},e.prototype.untransform=function(e,t){return t=null!=t?t:1,{x:(e.x/t-this._b)/this._a,y:(e.y/t-this._d)/this._c}},e}();!function(e){e.Major="major",e.Minor="minor"}(hh||(hh={}));var gh=function(){function e(e,t,n,r){var i=this;if(this.setRadius=function(e,t){void 0===t&&(t=hh.Major),"major"==t.toLowerCase()?i.radii.major=e||i.baseRadius:"minor"==t.toLowerCase()&&(i.radii.minor=e||i.radii.major||i.baseRadius)},this.invertY=function(e,t){var n=i.crs.projection.bounds;if("EPSG:4326"===i.tileMapResource.crsCode)return Math.pow(2,t)-1-e;var r=i.crs.scale(t),a=i.crs.transformation.transform(n.min,r);return Math.ceil(a.y/256)-1-e},this.toBounds=function(e,t){var n={min:{x:null,y:null},max:{x:null,y:null}};return n.min.x=Math.min(e.x,t.x),n.max.x=Math.max(e.x,t.x),n.min.y=Math.min(e.y,t.y),n.max.y=Math.max(e.y,t.y),n},this.tileXYZ2NwSe=function(e,t,n,r){if(null==i.tileMapResource.proj)return null;var a=((r=Math.max(r||1,1))-1)*t,o={x:e.x*t-a,y:e.y*t-a},s={x:o.x+t+2*a,y:o.y+t+2*a},l=i.crs.pointToLatLng(o,e.z),c=i.crs.pointToLatLng(s,e.z);return n?i.toBounds(i.crs.project(l),i.crs.project(c)):{nw:l,se:c}},this.tileXYZ2LatLng=function(e,t,n,r){if(null==i.tileMapResource.proj){var a=e/Math.pow(2,n)*360-180,o=Math.PI-2*Math.PI*t/Math.pow(2,n);return{lat:180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o))),lng:a}}t=-t;var s=i.trueTileResolution*e*i.res[n]+i.tileMapResource.origin[0],l=i.trueTileResolution*t*i.res[n]+i.tileMapResource.origin[1];return i.crs.unproject({x:s,y:l})},this.latLngZ2TileXYZ=function(e,t,n,r){if(null==i.tileMapResource.proj){var a=(t+180)/360*Math.pow(2,n),o=(1-Math.log(Math.tan(e*(Math.PI/180))+1/Math.cos(e*(Math.PI/180)))/Math.PI)/2*Math.pow(2,n);return null==r&&(a=Math.floor(a),o=Math.floor(o)),{x:a,y:o,z:n}}var s=i.crs.project({lng:t,lat:e}),l=s.x,c=s.y;return{x:a=(l-i.tileMapResource.origin[0])/(i.trueTileResolution*i.res[n]),y:o=-(o=(c-i.tileMapResource.origin[1])/(i.trueTileResolution*i.res[n])),z:n}},this.vector3ToLatLng=function(e){var t=e.y,n=e.z;e.y=-n,e.z=-t;var r=i.radii.major/i.radiusScale,a=i.radii.minor/i.radiusScale,o=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2)),s=Math.pow(r,2)-Math.pow(a,2),l=54*Math.pow(r,2)*Math.pow(e.z,2),c=Math.pow(o,2)+(1-Math.pow(i.e,2))*Math.pow(e.z,2)-Math.pow(i.e,2)*s,u=Math.pow(i.e,4)*l*Math.pow(o,2)/Math.pow(c,3),h=Math.cbrt(1+u+Math.sqrt(Math.pow(u,2)+2*u)),d=l/(3*Math.pow(h+1/h+1,2)*Math.pow(c,2)),f=Math.sqrt(1+2*Math.pow(i.e,4)*d),p=-d*Math.pow(i.e,2)*o/(1+f)+Math.sqrt(.5*Math.pow(r,2)*(1+1/f)-d*(1-Math.pow(i.e,2))*Math.pow(e.z,2)/(f*(1+f))-.5*d*Math.pow(o,2)),m=Math.sqrt(o-Math.pow(i.e,2)*p+Math.pow(e.z,2)),g=Math.sqrt(Math.pow(o-Math.pow(i.e,2)*p,2)+(1-Math.pow(i.e,2))*Math.pow(e.z,2)),v=Math.pow(a,2)*e.z/(r*g),y=m*(1-Math.pow(a,2)/(r*g)),b=Math.atan((e.z+Math.pow(i.ep,2)*v)/o)*(180/Math.PI),_=-Math.atan2(e.y,e.x)*(180/Math.PI)-90;return _<-180&&(_+=360),{lat:b,lng:_,height:y}},this.lonLatToVector3=function(e,t,n){var r=t*(Math.PI/180),a=(e-180)*(Math.PI/180);return{x:(i.radii.major+n)/i.radiusScale*Math.cos(r)*Math.sin(a),y:-(i.radii.major+n)/i.radiusScale*Math.sin(r),z:-(i.radii.major+n)/i.radiusScale*Math.cos(r)*Math.cos(a)}},this.rotatePoint3D=function(e,t,n){null==n&&(n={x:0,y:0,z:0});var r=e.x-n.x,i=e.y-n.y,a=e.z-n.z,o=Math.sin(t.x),s=Math.cos(t.x),l=Math.sin(t.y),c=Math.cos(t.y),u=Math.sin(t.z),h=Math.cos(t.z);return{x:n.x+r*(c*h)+i*(-c*u)+a*l,y:n.y+r*(s*u+o*l*h)+i*(s*h-o*l*u)+a*(-o*c),z:n.z+r*(o*u-s*l*h)+i*(o*h+s*l*u)+a*(s*c)}},this.lon2tileUnfloored=function(e,t){return(e+180)/360*Math.pow(2,t)},this.lat2tileUnfloored=function(e,t){return(1-Math.log(Math.tan(e*Math.PI/180)+1/Math.cos(e*Math.PI/180))/Math.PI)/2*Math.pow(2,t)},this.lngLatDistBetween=function(e,t,n,r){var a=i.radii.major/i.radiusScale,o=t*(Math.PI/180),s=r*(Math.PI/180),l=(r-t)*(Math.PI/180),c=(n-e)*(Math.PI/180),u=Math.sin(l/2)*Math.sin(l/2)+Math.cos(o)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2);return a*(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)))},this._reset(),this.setRadius(e,hh.Major),this.setRadius(t,hh.Minor),this.tileMapResource=n||{bounds:null,origin:null,crsCode:null,epsg:null,proj:null,resunitsperpixel:null,reszoomlevel:null},this.tileMapResource.crsCode=this.tileMapResource.crsCode||"EPSG:4326",this.trueTileResolution=r||256,null!=this.tileMapResource.resunitsperpixel&&null!=this.tileMapResource.reszoomlevel){var a=this.tileMapResource.reszoomlevel;a+=Math.round(4*Math.PI*Math.pow(3396190,2)/(4*Math.PI*Math.pow(this.radii.major,2)));for(var o=this.tileMapResource.resunitsperpixel*Math.pow(2,a),s=[],l=0;l<32;l++)s.push(o/Math.pow(2,l));this.res=s}var c=this.tileMapResource;this.crs=new fh(Number.isFinite(parseInt(c.crsCode[0]))?"EPSG:"+c.epsg:c.crsCode,c.proj,{origin:[parseFloat(c.origin[0]),parseFloat(c.origin[1])],resolutions:this.res,bounds:[[parseFloat(c.bounds[0]),parseFloat(c.bounds[1])],[parseFloat(c.bounds[2]),parseFloat(c.bounds[3])]]},parseFloat(this.radii.major))}return e.prototype._reset=function(){this.baseRadius=6371e3,this.radiusScale=1,this.radii={major:this.baseRadius,minor:this.baseRadius},this.tileMapResource={bounds:null,origin:null,crsCode:"EPSG:4326",proj:null,resunitsperpixel:null,reszoomlevel:null},this.e=0,this.ep=0,this.flatteningFactor=0},e}(),vh={simplePoint:function(){return new zt({uniforms:{},vertexShader:"#ifdef GL_ES\nprecision highp float;\n#endif\nvoid main() {\ngl_PointSize = 50.\ngl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.)\n}",fragmentShader:"void main() {\ngl_FragColor = vec4(0.0, 1.0, 1.0, 0.0)\n}",transparent:!0})},multiTexture:function(e,t){for(var n=e.length,r="#ifdef GL_ES\nprecision highp float;\n#endif\n",i=0;i highestA ){ highestA = tA"+i+"; }\nvec4 C"+i+" = texture2D(t"+i+", vUv);\nC = vec4( C"+i+".rgb * (C"+i+".a * tA"+i+") + C.rgb * C.a * (1.0 - (C"+i+".a * tA"+i+")), 1);\n";r+="if (";for(i=0;i 0.4) { gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); }","}"].join("\n");return new zt({uniforms:{coefficient:{value:.1},power:{value:6},opacity:{value:.5},glowColor:{value:new Ue(e||"#FFFFFF")}},vertexShader:t,fragmentShader:n,blending:2,transparent:!0,depthWrite:!1})}},yh=n(3);function bh(e,t,n,r,i){return new Promise((function(n,i){fetch(e).then((function(e){return e.arrayBuffer()})).then((function(e){Object(yh.fromArrayBuffer)(e).then((function(e){e.readRasters().then((function(e){var i=e[0];if(t&&t.demFormatOptions&&!0===t.demFormatOptions.correctSeams){for(var a=--r+2,o=[],s=0;sr&&(n=r)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}return this.pos=n,this.buffer.subarray(t,n)},lookChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(e,t,n){for(var r=e+t;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,t,n)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},e}(),xh=function(){var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),n=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),r=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],i=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function a(e){throw new Error(e)}function o(e){var t=0,n=e[t++],r=e[t++];-1!=n&&-1!=r||a("Invalid header in flate stream"),8!=(15&n)&&a("Unknown compression method in flate stream"),((n<<8)+r)%31!=0&&a("Bad FCHECK in flate stream"),32&r&&a("FDICT bit set in flate stream"),this.bytes=e,this.bytesPos=2,this.codeSize=0,this.codeBuf=0,_h.call(this)}return o.prototype=Object.create(_h.prototype),o.prototype.getBits=function(e){for(var t,n=this.codeSize,r=this.codeBuf,i=this.bytes,o=this.bytesPos;n>e,this.codeSize=n-=e,this.bytesPos=o,t},o.prototype.getCode=function(e){for(var t=e[0],n=e[1],r=this.codeSize,i=this.codeBuf,o=this.bytes,s=this.bytesPos;r>16,h=65535&c;return(0==r||r>u,this.codeSize=r-u,this.bytesPos=s,h},o.prototype.generateHuffmanTable=function(e){for(var t=e.length,n=0,r=0;rn&&(n=e[r]);for(var i=1<>=1;for(r=u;r0;)t[p++]=i}var s=this.getBits(3);if(1&s&&(this.eof=!0),0!=(s>>=1)){var l,c;if(1==s)l=r,c=i;else if(2==s){for(var u=this.getBits(5)+257,h=this.getBits(5)+1,d=this.getBits(4)+4,f=Array(e.length),p=0;p=_&&(_=(O=this.ensureBuffer(x+1)).length),O[x++]=w;else{if(256==w)return void(this.bufferLength=x);var M=(w=t[w-=257])>>16;M>0&&(M=this.getBits(M));g=(65535&w)+M;w=this.getCode(c),(M=(w=n[w])>>16)>0&&(M=this.getBits(M));var S=(65535&w)+M;x+g>=_&&(_=(O=this.ensureBuffer(x+g)).length);for(var T=0;T0)for(t=0;tthis.data.length)throw new Error("Incomplete or corrupt PNG file")}}return e.load=function(t,n,r,i){var a=new XMLHttpRequest;return a.open("GET",t,!0),a.responseType="arraybuffer",a.withCredentials=n.withCredentials,a.onload=function(){var t=new Uint8Array(a.response||a.mozResponseArrayBuffer);if(404!==a.status){var n=new e(t);return"function"==typeof r?r(n):void 0}"function"==typeof i&&i(a.status)},a.send()},e.prototype.read=function(e){for(var t=new Array(e),n=0;n1&&n/i0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=1.3?"CRS":"SRS"]=l;var c=n.tileXYZ2NwSe(t,i,!0,!0===a.correctSeams?(r+1)/r:null),u=(parseFloat(o.VERSION)>=1.3&&"EPSG:4326"===l?[c.min.y,c.min.x,c.max.y,c.max.x]:[c.min.x,c.min.y,c.max.x,c.max.y]).join(",");return e+yl.getParamString(o,e,Oh.wmsExtension.extensionOptions.uppercase)+(Oh.wmsExtension.extensionOptions.uppercase?"&BBOX=":"&bbox=")+u}}},kh=Oh,Ih=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))},Nh=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0){var i=function(){e.tilesToBeDrawn.length>0&&e.addTile(e.tilesToBeDrawn.pop(),i).catch((function(){i()}))};this.addTile(this.tilesToBeDrawn.pop(),i).catch((function(){i()}))}if(0==this.tilesToBeDrawn.length&&0==this.tilesBeingDrawn.length){for(t=0;t=0;o--)if(e.isLODTile==f.tilesDrawn[o].isLODTile&&e.LODLevel==f.tilesDrawn[o].LODLevel){var s=[f.tilesDrawn[o].x,f.tilesDrawn[o].y,f.tilesDrawn[o].z],l=[e.x,e.y,e.z];e.zf.tilesDrawn[o].z&&yl.tileIsContained(s,l)&&(f.tilesDrawn[o].contents.push(l),f.tilesDrawn[o].contents.length>=yl.tileContains(s,e.z).length&&a.push(o))}for(o=f.tilesBeingDrawn.length-1;o>=0;o--)if(f.tilesBeingDrawn[o].x==e.x&&f.tilesBeingDrawn[o].y==e.y&&f.tilesBeingDrawn[o].z==e.z&&f.tilesBeingDrawn[o].isLODTile==e.isLODTile&&f.tilesBeingDrawn[o].LODLevel==e.LODLevel){if(f.tilesBeingDrawn[o].make)e.isLODTile?f.p.planetsLOD[e.LODLevel].add(r):f.p.planet.add(r),f.updateRastersForTile(e),a.forEach((function(e){f.removeTile(e,!0)}));else{r.geometry.dispose(),r.material.dispose();for(var c=f.tilesDrawn.length-1;c>=0;c--)f.tilesDrawn[c].x==e.x&&f.tilesDrawn[c].y==e.y&&f.tilesDrawn[c].z==e.z&&f.tilesDrawn[o].isLODTile==e.isLODTile&&f.tilesDrawn[o].LODLevel==e.LODLevel&&f.tilesDrawn.splice(c,1)}return void f.tilesBeingDrawn.splice(o,1)}}},a=function(t){var a=0,o=Math.pow(f.p.options.tileResolution,2),s=new Float32Array(3*o);null==t&&(t=new Array(o).fill(0));for(var l=0,c=Math.floor(t.length/2),u=0;(null==l||l>f.p.projection.radiusOfPlanetMajor||l<-f.p.projection.radiusOfPlanetMajor)&&u75&&E<-88?E=90:y<-75&&E>88&&(E=-90)),x=f.p.projection.lonLatToVector3(C,E,_*f.p.options.exaggeration),r.geometry.attributes.position.array[w]=x.x-b.x,r.geometry.attributes.position.array[w+1]=x.y-b.y,r.geometry.attributes.position.array[w+2]=x.z-b.z,a+=1}r.geometry.attributes.position.needsUpdate=!0,r.geometry.computeVertexNormals(),r.geometry.computeBoundingSphere(),r.geometry.setAttribute("customColor",new Ye(s,3)),n.data=!0,i()}},o=!1,s=null,l=this.p.layers.tile.length-1;l>=0;l--)if(this.p.layers.tile[l].on&&(e.z>=this.p.layers.tile[l].minZoom&&e.z<=this.p.layers.tile[l].maxZoom&&yl.isInExtent(e,this.p.layers.tile[l].boundingBox,this.p.projection)||"_vectorsastile_"==this.p.layers.tile[l].path)&&(s=l,null!=this.p.layers.tile[l].demPath)){o=!0;break}return c=null,o&&null!=s?(u=kh.buildPath(this.p.layers.tile[s].format,this.p.layers.tile[s].demPath,e,this.p.projection,this.p.options.tileResolution,this.p.options.trueTileResolution,this.p.layers.tile[s].demFormatOptions,!0))?(h=!1,[4,Lh(this.p.options.customParsers,u.path,this.p.layers.tile[s],u.xyz,this.p.options.tileResolution,Math.pow(this.p.options.tileResolution,2)).catch((function(){h=!0}))]):[3,3]:[3,4];case 1:return c=p.sent(),h&&null!=this.p.options.demFallback?(d=kh.buildPath(this.p.options.demFallback.format,this.p.options.demFallback.demPath,e,this.p.projection,this.p.options.tileResolution,this.p.options.trueTileResolution,this.p.layers.tile[s].demFormatOptions,!0))?[4,Lh(this.p.options.customParsers,d.path,this.p.layers.tile[s],d.xyz,this.p.options.tileResolution,Math.pow(this.p.options.tileResolution,2),this.p.options.demFallback.parserType).catch((function(){}))]:[3,3]:[3,3];case 2:c=p.sent(),p.label=3;case 3:return a(c||null),[3,7];case 4:return null==this.p.options.demFallback?[3,6]:(d=kh.buildPath(this.p.options.demFallback.format,this.p.options.demFallback.demPath,e,this.p.projection,this.p.options.tileResolution,this.p.options.trueTileResolution,this.p.layers.tile[s].demFormatOptions,!0))?[4,Lh(this.p.options.customParsers,d.path,this.p.layers.tile[s],d.xyz,this.p.options.tileResolution,Math.pow(this.p.options.tileResolution,2),this.p.options.demFallback.parserType).catch((function(){}))]:[3,6];case 5:c=p.sent(),p.label=6;case 6:a(),p.label=7;case 7:return[2]}}))}))},e.prototype.findTileDrawnBasedOnUUID=function(e){var t=null;return this.tilesDrawn.forEach((function(n){n.t.uuid!==e||(t=n)})),t},e.prototype.findTileDrawnBasedOnXYZLOD=function(e){var t=null;return this.tilesDrawn.forEach((function(n){n.x!==e.x||n.y!==e.y||n.z!==e.z||n.isLODTile!==e.isLODTile||n.LODLevel!=e.LODLevel||(t=n)})),t},e.prototype.updateRastersForTile=function(e){var t=this,n=this.findTileDrawnBasedOnXYZLOD(e);if(null!=n){for(var r=[],i=new Array(this.p.layers.tile.length).fill(!1),a=new Array(this.p.layers.clamped.length).fill(!1),o=function(){if(i.every(Boolean)&&(e.isLODTile||a.every(Boolean))){if(0==r.length)return void(n.t.visible=!1);r.sort((function(e,t){return e.i-t.i})),n.from.rasters=[];for(var o=0,s=0;s=l.p.layers.tile[e].minZoom&&n.z<=l.p.layers.tile[e].maxZoom&&yl.isInExtent({x:n.x,y:n.y,z:n.z},l.p.layers.tile[e].boundingBox,l.p.projection)){var a=kh.buildPath(l.p.layers.tile[e].format,l.p.layers.tile[e].path,n,l.p.projection,l.p.options.trueTileResolution,l.p.options.trueTileResolution,l.p.layers.tile[e].formatOptions);a?function(e){t._.loader.load(a,(function(n){n.magFilter=1003,n.minFilter=1003,t.p.layers.tile[e]&&r.push({name:t.p.layers.tile[e].name,type:"tile",texture:n,opacity:t.p.layers.tile[e].opacity,i:e}),i[e]=!0,o()}),(function(){console.log("")}),(function(){i[e]=!0,o()}))}(e):(i[e]=!0,o())}else i[e]=!0,o()},l=this,c=0;c=this.p.layers.clamped[c].minZoom)&&(null==this.p.layers.clamped[c].maxZoom||n.z<=this.p.layers.clamped[c].maxZoom)&&(null==this.p.layers.clamped[c].boundingBox||yl.isInExtent({x:n.x,y:n.y,z:n.z},this.p.layers.clamped[c].boundingBox,this.p.projection))){var u=this.p.layers._.layerers.clamped.getClampedTexture(c,{x:n.x,y:n.y,z:n.z});n.contains=n.contains||{},n.contains[this.p.layers.clamped[c].name]=u.features;var h=new la(u.canvas);h.magFilter=1003,h.minFilter=1003,this.p.layers.clamped[c]&&r.push({name:this.p.layers.clamped[c].name,type:"clamped",texture:h,opacity:this.p.layers.clamped[c].opacity,i:c}),a[c]=!0,o()}else a[c]=!0,o()}},e.prototype.updateClampedRasterForTile=function(e,t){if(!this.p.options.wireframeMode&&!e.isLODTile){for(var n=null,r=0;r=i.minZoom)&&(null==i.maxZoom||e.z<=i.maxZoom)&&(null==i.boundingBox||yl.isInExtent({x:e.x,y:e.y,z:e.z},i.boundingBox,this.p.projection))){var a=this.p.layers._.layerers.clamped.getClampedTexture(n,{x:e.x,y:e.y,z:e.z});e.contains=e.contains||{},e.contains[this.p.layers.clamped[n].name]=a.features;var o=new la(a.canvas);o.magFilter=1003,o.minFilter=1003;for(r=0;ri?Math.min(this.tilesDrawn[e].t.material.uniforms["tA"+t].value+.1,r):Math.max(this.tilesDrawn[e].t.material.uniforms["tA"+t].value-.1,r)}}},e.prototype.fadeOutTiles=function(){for(var e=this.tilesDrawn.length-1;e>=0;e--)if(this.tilesDrawn[e].fadeOutAndRemove)for(var t=0;this.tilesDrawn[e]&&t=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function zh(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Bh(e){return"Feature"===e.type?e.geometry:e}function Uh(e,t,n,r){void 0===r&&(r={});var i=Fh(e),a=Object(jh.degreesToRadians)(i[0]),o=Object(jh.degreesToRadians)(i[1]),s=Object(jh.degreesToRadians)(n),l=Object(jh.lengthToRadians)(t,r.units),c=Math.asin(Math.sin(o)*Math.cos(l)+Math.cos(o)*Math.sin(l)*Math.cos(s)),u=a+Math.atan2(Math.sin(s)*Math.sin(l)*Math.cos(o),Math.cos(l)-Math.sin(o)*Math.sin(c)),h=Object(jh.radiansToDegrees)(u),d=Object(jh.radiansToDegrees)(c);return Object(jh.point)([h,d],r.properties)}var Hh=function(e,t,n){void 0===n&&(n={});for(var r=n.steps||64,i=n.properties?n.properties:!Array.isArray(e)&&"Feature"===e.type&&e.properties?e.properties:{},a=[],o=0;o=e[0]&&t[3]>=e[1]}(r,o))return!1;"Polygon"===a&&(s=[s]);for(var l=!1,c=0;ce[1]!=c>e[1]&&e[0]<(l-o)*(e[1]-s)/(c-s)+o&&(r=!r)}return r}var Vh=n(1);var qh=function(e){if(!e)throw new Error("geojson is required");var t=[];return Object(Vh.flattenEach)(e,(function(e){!function(e,t){var n=[],r=e.geometry;if(null!==r){switch(r.type){case"Polygon":n=zh(r);break;case"LineString":n=[zh(r)]}n.forEach((function(n){(function(e,t){var n=[];return e.reduce((function(e,r){var i,a,o,s,l,c,u=Object(jh.lineString)([e,r],t);return u.bbox=(a=r,o=(i=e)[0],s=i[1],l=a[0],c=a[1],[ol?o:l,s>c?s:c]),n.push(u),r})),n})(n,e.properties).forEach((function(e){e.id=t.length,t.push(e)}))}))}}(e,t)})),Object(jh.featureCollection)(t)},Xh=n(4),Yh=n.n(Xh);function Zh(e,t){var n=zh(e),r=zh(t);if(2!==n.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==r.length)throw new Error(" line2 must only contain 2 coordinates");var i=n[0][0],a=n[0][1],o=n[1][0],s=n[1][1],l=r[0][0],c=r[0][1],u=r[1][0],h=r[1][1],d=(h-c)*(o-i)-(u-l)*(s-a),f=(u-l)*(a-c)-(h-c)*(i-l),p=(o-i)*(a-c)-(s-a)*(i-l);if(0===d)return null;var m=f/d,g=p/d;if(m>=0&&m<=1&&g>=0&&g<=1){var v=i+m*(o-i),y=a+m*(s-a);return Object(jh.point)([v,y])}return null}var Jh=function(e,t){var n={},r=[];if("LineString"===e.type&&(e=Object(jh.feature)(e)),"LineString"===t.type&&(t=Object(jh.feature)(t)),"Feature"===e.type&&"Feature"===t.type&&null!==e.geometry&&null!==t.geometry&&"LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length){var i=Zh(e,t);return i&&r.push(i),Object(jh.featureCollection)(r)}var a=Yh()();return a.load(qh(t)),Object(Vh.featureEach)(qh(e),(function(e){Object(Vh.featureEach)(a.search(e),(function(t){var i=Zh(e,t);if(i){var a=zh(i).join(",");n[a]||(n[a]=!0,r.push(i))}}))})),Object(jh.featureCollection)(r)},Kh=function(e,t){void 0===t&&(t={});var n=Bh(e);switch(t.properties||"Feature"!==e.type||(t.properties=e.properties),n.type){case"Polygon":return function(e,t){void 0===t&&(t={});var n=Bh(e).coordinates,r=t.properties?t.properties:"Feature"===e.type?e.properties:{};return Qh(n,r)}(n,t);case"MultiPolygon":return function(e,t){void 0===t&&(t={});var n=Bh(e).coordinates,r=t.properties?t.properties:"Feature"===e.type?e.properties:{},i=[];return n.forEach((function(e){i.push(Qh(e,r))})),Object(jh.featureCollection)(i)}(n,t);default:throw new Error("invalid poly")}};function Qh(e,t){return e.length>1?Object(jh.multiLineString)(e,t):Object(jh.lineString)(e[0],t)}function $h(e,t){for(var n=0;n0}function td(e,t,n){var r=n[0]-e[0],i=n[1]-e[1],a=t[0]-e[0],o=t[1]-e[1];return 0==r*o-i*a&&(Math.abs(a)>=Math.abs(o)?a>0?e[0]<=n[0]&&n[0]<=t[0]:t[0]<=n[0]&&n[0]<=e[0]:o>0?e[1]<=n[1]&&n[1]<=t[1]:t[1]<=n[1]&&n[1]<=e[1])}var nd=function(e,t){var n=!0;return Object(Vh.flattenEach)(e,(function(e){Object(Vh.flattenEach)(t,(function(t){if(!1===n)return!1;n=function(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return n=e.coordinates,r=t.coordinates,!(n[0]===r[0]&&n[1]===r[1]);case"LineString":return!$h(t,e);case"Polygon":return!Gh(e,t)}break;case"LineString":switch(t.type){case"Point":return!$h(e,t);case"LineString":return!function(e,t){if(Jh(e,t).features.length>0)return!0;return!1}(e,t);case"Polygon":return!ed(t,e)}break;case"Polygon":switch(t.type){case"Point":return!Gh(t,e);case"LineString":return!ed(e,t);case"Polygon":return!function(e,t){for(var n=0,r=e.coordinates[0];n0)return!0;return!1}(t,e)}}var n,r;return!1}(e.geometry,t.geometry)}))})),n};function rd(e,t){var n=!1;return Object(Vh.flattenEach)(e,(function(e){Object(Vh.flattenEach)(t,(function(t){if(!0===n)return!0;n=!nd(e.geometry,t.geometry)}))})),n}var id=function(){function e(e){var t=this;this._rotateGlobe=function(e,n){if(n&&(t._.prevMouseXY.x=n.x,t._.prevMouseXY.y=n.y),e){!e.pageX&&e.touches&&(e.pageX=yl.arrayAverage(e.touches,"pageX")),!e.pageY&&e.touches&&(e.pageY=yl.arrayAverage(e.touches,"pageY")),e.hasOwnProperty("x")&&e.hasOwnProperty("y")&&t.p._.cameras.isFirstPerson&&(t._.prevMouseXY.x=0,t._.prevMouseXY.y=0,e.pageX=e.x,e.pageY=e.y);var r=.5*yl.getRadiansPerPixel(t.p.trueZoom)*(t.p._.marsRadius/t.p.projection.radii.major),i=0,a=new _(t.p._.cameras.orbit.camera.position.x,0,t.p._.cameras.orbit.camera.position.z);a.applyAxisAngle(new _(0,1,0),Math.PI/2);var o=new _(t.p._.cameras.orbit.camera.position.x,0,t.p._.cameras.orbit.camera.position.z);if(e.pageYt._.prevMouseXY.y&&(i=Math.abs(e.pageY-t._.prevMouseXY.y),t._rotateAroundArbAxis(a,-r*i)),e.pageX>t._.prevMouseXY.x?(i=Math.abs(e.pageX-t._.prevMouseXY.x),t._rotateAroundArbAxis(o,-r*i)):e.pageX2&&(t._.prevMouseXY.x=yl.arrayAverage(e.touches,"pageX"),t._.prevMouseXY.y=yl.arrayAverage(e.touches,"pageY"),t.p._.sceneContainer.addEventListener("touchmove",t._rotateGlobe,!1),t.p._.sceneContainer.addEventListener("touchend",t._rotateGlobe_MouseUp,!1))},this._rotateGlobe_MouseUp=function(e){t.p._.sceneContainer.removeEventListener("mousemove",t._rotateGlobe),t.p._.sceneContainer.removeEventListener("mouseup",t._rotateGlobe_MouseUp),t.p._.sceneContainer.removeEventListener("mouseleave",t._rotateGlobe_MouseUp),t.p._.sceneContainer.removeEventListener("touchmove",t._rotateGlobe),t.p._.sceneContainer.removeEventListener("touchend",t._rotateGlobe_MouseUp)},this._onZoom=function(e){t._.zoomedSince=0;var n=t.p._.cameras.orbit.camera.position.distanceTo(t.p._.cameras.orbit.controls.target),r=8-(t.p.projection.radiusScale.toString().length-1),i=Math.ceil((r*Math.log(2)-Math.log(n/Math.pow(5,r-1)))/Math.log(2))+1;t._.desiredZoom=i,t._attenuate()},this._onTouchZoom=function(e){e.touches&&1==e.touches.length&&t._onZoom(e)},this._onClick=function(e){if(t.hoveredFeature&&t.hoverInfo){var n=t.p.layers.getLayerByName(t.hoveredFeature.layerName);n&&(t.setActiveFeature({layerName:t.hoveredFeature.layerName,type:t.hoveredFeature.type,obj:t.hoveredFeature.obj,feature:t.hoveredFeature.feature||t.hoveredFeature.obj.feature,lnglat:{lng:t.hoveredFeature.lnglat.lng,lat:t.hoveredFeature.lnglat.lat}}),"function"==typeof n.onClick&&n.onClick(JSON.parse(JSON.stringify(t.hoveredFeature.feature)),JSON.parse(JSON.stringify(t.hoveredFeature.lnglat)),n))}},this._onKeyDown=function(e){if(!t.p._.cameras.isFirstPerson){var n=e.shiftKey?20:8;switch(e.key){case"w":case"ArrowUp":t._rotateGlobe({pageX:0,pageY:n},{x:0,y:0});break;case"a":case"ArrowLeft":t._rotateGlobe({pageX:n,pageY:0},{x:0,y:0});break;case"s":case"ArrowDown":t._rotateGlobe({pageX:0,pageY:-n},{x:0,y:0});break;case"d":case"ArrowRight":t._rotateGlobe({pageX:-n,pageY:0},{x:0,y:0});break;case"g":case"PageDown":var r=(new _).lerpVectors(t.p._.cameras.orbit.camera.position,t.p._.cameras.orbit.controls.target,e.shiftKey?-.035:-.02);t.p._.cameras.orbit.camera.position.set(r.x,r.y,r.z),t._onZoom();break;case"t":case"PageUp":var i=(new _).lerpVectors(t.p._.cameras.orbit.camera.position,t.p._.cameras.orbit.controls.target,e.shiftKey?.035:.02);t.p._.cameras.orbit.camera.position.set(i.x,i.y,i.z),t._onZoom();break;case"q":t.p._.cameras.orbit.controls.rotateLeft(Math.PI/64);break;case"e":t.p._.cameras.orbit.controls.rotateLeft(-Math.PI/64);break;case"r":t.p._.cameras.orbit.controls.rotateUp(Math.PI/64);break;case"f":t.p._.cameras.orbit.controls.rotateUp(-Math.PI/64)}}},this._onMouseMove=function(e){t.p._.mouseIsInScene=!0,t.p._.cameras.isFirstPerson?(t._.mouseXY.x=0,t._.mouseXY.y=0):(t._.mouseXY.x=(e.clientX-t.p._.renderer.domElement.getBoundingClientRect().left)/t.p._.renderer.domElement.clientWidth*2-1,t._.mouseXY.y=-(e.clientY-t.p._.renderer.domElement.getBoundingClientRect().top)/t.p._.renderer.domElement.clientHeight*2+1),t._.containerXY={x:e?e.offsetX:null,y:e?e.offsetY:null},t.updateHoverInfoPosition(),t.p._.raycaster.setFromCamera(t._.mouseXY,t.p._.cameras.camera);for(var n=[],r=0;r0){var o=a[0].object.type,s=null;switch(o){case"Sprite":case"Line2":s=a[0].object;break;case"Mesh":if(null==(s=t.p._.tiledWorld.findTileDrawnBasedOnUUID(a[0].object.uuid)))return;break;default:return}var l=a[0].point;a[0].point.y+=t.p.planetCenter.y,a[0].point=t.p.projection.rotatePoint3D(a[0].point,{x:-t.p.planet.rotation.x,y:0,z:0}),a[0].point=t.p.projection.rotatePoint3D(a[0].point,{x:0,y:-t.p.planet.rotation.y,z:0}),a[0].point=t.p.projection.rotatePoint3D(a[0].point,{x:0,y:0,z:-t.p.planet.rotation.z});var c=t.p.projection.vector3ToLatLng(a[0].point);c.height=l.length()*t.p.projection.radiusScale-t.p.projection.radii.major,t._updateMouseCoords(c.lng,c.lat,c.height),clearTimeout(t._.highlightTimeout),t._.highlightTimeout=setTimeout((function(){t._highlightFeature(c.lng,c.lat,o,s)}),10),t.p.controls._onMouseMove(c.lng,c.lat,c.height,e)}else t._updateMouseCoords(null,null,null),t._unhighlightHoveredFeature(),t.p.controls._onMouseMove(null,null,null,e)},this.p=e,this.activeFeature=null,this.hoveredFeature=null,this.hoverInfo=null,this._={mouseXY:{x:null,y:null},prevMouseXY:{x:null,y:null},containerXY:{x:null,y:null},lastZoomDelta:1,desiredZoom:null,zoomedSince:0,zoomWait:30,highlightTimeout:null},this._init()}return e.prototype._init=function(){var e=this;this._matchPlanetsLODToPlanet(),this.p._.sceneContainer.addEventListener("mousewheel",this._onZoom,!1),this.p._.sceneContainer.addEventListener("DOMMouseScroll",this._onZoom,!1),this.p._.sceneContainer.addEventListener("wheel",this._onZoom,!1),this.p._.sceneContainer.addEventListener("mouseleave",this.p.controls._onMouseOut,!1),this.p._.sceneContainer.addEventListener("touchend",this._onTouchZoom),this.p._.sceneContainer.addEventListener("mousedown",this._rotateGlobe_MouseDown,!1),this.p._.sceneContainer.addEventListener("mousemove",this._onMouseMove,!1),this.p._.sceneContainer.addEventListener("click",this._onClick,!1),this.p._.sceneContainer.addEventListener("mouseenter",(function(){e.p._.mouseIsInScene=!0}),!1),this.p._.sceneContainer.addEventListener("mouseleave",(function(){e.p._.mouseIsInScene=!1}),!1),window.addEventListener("keydown",this._onKeyDown,!1)},e.prototype._rotateAroundArbAxis=function(e,t,n){var r=new Y;r.makeRotationAxis(e.normalize(),t),!0!==n&&r.multiply(this.p.planet.matrix),this.p.planet.matrix=r,this.p.planet.rotation.setFromRotationMatrix(this.p.planet.matrix),this._matchPlanetsLODToPlanet(),this._refreshFrontGroupRotation()},e.prototype._checkDesiredZoom=function(){this._.zoomedSince++,null!=this._.desiredZoom&&(this.p._.cameras.setNearFarPlane(this._.desiredZoom<14),this._.zoomedSince>this._.zoomWait&&(this._.desiredZoom>=this.p._.minNativeZoom&&this._setZoom(this._.desiredZoom),this._.desiredZoom=null))},e.prototype._setZoom=function(e){var t=this.p.zoom;this.p.zoom=e,this.p.trueZoom=Math.max(0,e),this.p.zoom<0&&(this.p.zoom=0),this.p.zoomthis.p._.maxZoom&&(this.p.zoom=this.p._.maxZoom),this._.lastZoomDelta=Math.abs(this.p.zoom-t)},e.prototype._matchPlanetsLODToPlanet=function(){for(var e=0;e0?t.children.forEach((function(t){t instanceof wi&&t.scale.set(e*t.style.radius,e*t.style.radius,e*t.style.radius)})):t instanceof wi&&t.scale.set(e*mesh.style.radius,e*mesh.style.radius,e*mesh.style.radius)}))},e}(),ad=n(2),od=n.n(ad);class sd{constructor(){this.maxSize=800,this.minSize=600,this.unloadPercent=.05,this.itemSet=new Map,this.itemList=[],this.usedSet=new Set,this.callbacks=new Map,this.unloadPriorityCallback=null;const e=this.itemSet;this.defaultPriorityCallback=t=>e.get(t)}isFull(){return this.itemSet.size>=this.maxSize}add(e,t){const n=this.itemSet;if(n.has(e))return!1;if(this.isFull())return!1;const r=this.usedSet,i=this.itemList,a=this.callbacks;return i.push(e),r.add(e),n.set(e,Date.now()),a.set(e,t),!0}remove(e){const t=this.usedSet,n=this.itemSet,r=this.itemList,i=this.callbacks;if(n.has(e)){i.get(e)(e);const a=r.indexOf(e);return r.splice(a,1),t.delete(e),n.delete(e),i.delete(e),!0}return!1}markUsed(e){const t=this.itemSet,n=this.usedSet;t.has(e)&&!n.has(e)&&(t.set(e,Date.now()),n.add(e))}markAllUnused(){this.usedSet.clear()}unloadUnusedContent(){const e=this.unloadPercent,t=this.minSize,n=this.itemList,r=this.itemSet,i=this.usedSet,a=this.callbacks,o=n.length-i.size,s=n.length-t,l=this.unloadPriorityCallback||this.defaultPriorityCallback;if(s>0&&o>0){n.sort((e,t)=>{const n=i.has(e),r=i.has(t);return n&&r?0:n||r?n?1:-1:l(t)-l(e)});const c=Math.min(s,o),u=Math.max(t*e,c*e);let h=Math.min(u,o);h=Math.ceil(h);const d=n.splice(0,h);for(let e=0,t=d.length;e{this.scheduled=!1,this.unloadUnusedContent(),e&&this.markAllUnused()},Promise.resolve().then(t))}}class ld{constructor(){this.maxJobs=6,this.items=[],this.callbacks=new Map,this.currJobs=0,this.scheduled=!1,this.autoUpdate=!0,this.priorityCallback=()=>{throw new Error("PriorityQueue: PriorityCallback function not defined.")}}sort(){const e=this.priorityCallback;this.items.sort((t,n)=>e(t)-e(n))}add(e,t){return new Promise((n,r)=>{const i=this.items,a=this.callbacks;i.push(e),a.set(e,(...e)=>t(...e).then(n).catch(r)),this.autoUpdate&&this.scheduleJobRun()})}remove(e){const t=this.items,n=this.callbacks,r=t.indexOf(e);-1!==r&&(t.splice(r,1),n.delete(e))}tryRunJobs(){this.sort();const e=this.items,t=this.callbacks,n=this.maxJobs;let r=this.currJobs;for(;n>r&&e.length>0;){r++;const n=e.pop(),i=t.get(n);t.delete(n),i(n).then(()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()}).catch(()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()})}this.currJobs=r}scheduleJobRun(){this.scheduled||(requestAnimationFrame(()=>{this.tryRunJobs(),this.scheduled=!1}),this.scheduled=!0)}}function cd(e){return 3===e||4===e}function ud(e,t){return e.__lastFrameVisited===t&&e.__used}function hd(e,t){e.__lastFrameVisited!==t&&(e.__lastFrameVisited=t,e.__used=!1,e.__inFrustum=!1,e.__isLeaf=!1,e.__visible=!1,e.__active=!1,e.__error=0,e.__childrenWereVisible=!1,e.__allChildrenLoaded=!1)}function dd(e,t,n){if(hd(e,t),e.__used=!0,n.markUsed(e),e.__contentEmpty){const r=e.children;for(let e=0,i=r.length;e1/(e.__depthFromRenderedParent+1);function gd(e){let t="";for(let n=0,r=e.length;no+s)throw new Error("FeatureTable: Feature data read outside binary body length.");return d}}return a}}class yd extends vd{constructor(e,t,n,r,i){super(e,n,r,i),this.batchSize=t}getData(e,t=null,n=null){return super.getData(e,this.batchSize,n,t)}}var bd=function(){function e(e){_o.call(this,e),this.dracoLoader=null,this.ddsLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new o(e)})),this.register((function(e){return new l(e)})),this.register((function(e){return new h(e)})),this.register((function(e){return new s(e)})),this.register((function(e){return new i(e)})),this.register((function(e){return new d(e)}))}function t(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(_o.prototype),{constructor:e,load:function(e,t,n,r){var i,a=this;i=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:ps(e),this.manager.itemStart(e);var o=function(t){r?r(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},s=new wo(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{a.parse(n,i,(function(n){t(n),a.manager.itemEnd(e)}),o)}catch(e){o(e)}}),n,o)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},setKTX2Loader:function(e){return this.ktx2Loader=e,this},setMeshoptDecoder:function(e){return this.meshoptDecoder=e,this},register:function(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this},unregister:function(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this},parse:function(e,t,i,o){var s,l={},c={};if("string"==typeof e)s=e;else if(fs(new Uint8Array(e,0,4))===f){try{l[n.KHR_BINARY_GLTF]=new g(e)}catch(e){return void(o&&o(e))}s=l[n.KHR_BINARY_GLTF].content}else s=fs(new Uint8Array(e));var u=JSON.parse(s);if(void 0===u.asset||u.asset.version[0]<2)o&&o(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var h=new Z(u,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(var d=0;d=0&&void 0===c[m]&&console.warn('THREE.GLTFLoader: Unknown extension "'+m+'".')}}h.setExtensions(l),h.setPlugins(c),h.parse(i,o)}}});var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function r(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=e}function i(e){this.parser=e,this.name=n.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}function a(){this.name=n.KHR_MATERIALS_UNLIT}function o(e){this.parser=e,this.name=n.KHR_MATERIALS_CLEARCOAT}function s(e){this.parser=e,this.name=n.KHR_MATERIALS_TRANSMISSION}function l(e){this.parser=e,this.name=n.KHR_TEXTURE_BASISU}function h(e){this.parser=e,this.name=n.EXT_TEXTURE_WEBP,this.isSupported=null}function d(e){this.name=n.EXT_MESHOPT_COMPRESSION,this.parser=e}i.prototype._markDefs=function(){for(var e=this.parser,t=this.parser.json.nodes||[],n=0,r=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a,o)},h.prototype.loadTexture=function(e){var t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;var a=i.extensions[t],o=r.images[a.source],s=o.uri?n.options.manager.getHandler(o.uri):n.textureLoader;return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,o,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))},h.prototype.detectSupport=function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported},d.prototype.loadBufferView=function(e){var t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){var r=n.extensions[this.name],i=this.parser.getDependency("buffer",r.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([i,a.ready]).then((function(e){var t=r.byteOffset||0,n=r.byteLength||0,i=r.count,o=r.byteStride,s=new ArrayBuffer(i*o),l=new Uint8Array(e[0],t,n);return a.decodeGltfBuffer(new Uint8Array(s),i,o,l,r.mode,r.filter),s}))}return null};var f="glTF",p=1313821514,m=5130562;function g(e){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:fs(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==f)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var r=this.header.length-12,i=new DataView(e,12),a=0;a",t).replace("#include ",n).replace("#include ",r).replace("#include ",i).replace("#include ",a)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function x(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return b},extendParams:function(e,t,n){var r=t.extensions[this.name];e.color=new Ue(1,1,1),e.opacity=1;var i=[];if(Array.isArray(r.diffuseFactor)){var a=r.diffuseFactor;e.color.fromArray(a),e.opacity=a[3]}if(void 0!==r.diffuseTexture&&i.push(n.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new Ue(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new Ue(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var o=r.specularGlossinessTexture;i.push(n.assignTexture(e,"glossinessMap",o)),i.push(n.assignTexture(e,"specularMap",o))}return Promise.all(i)},createMaterial:function(e){var t=new b(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=0,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function w(){this.name=n.KHR_MESH_QUANTIZATION}function S(e,t,n,r){no.call(this,e,t,n,r)}v.prototype.decodePrimitive=function(e,t){var n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},l={};for(var c in a){var u=D[c]||c.toLowerCase();o[u]=a[c]}for(c in e.attributes){u=D[c]||c.toLowerCase();if(void 0!==a[c]){var h=n.accessors[e.attributes[c]],d=O[h.componentType];l[u]=d,s[u]=!0===h.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(var n in e.attributes){var r=e.attributes[n],i=s[n];void 0!==i&&(r.normalized=i)}t(e)}),o,l)}))}))},y.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},b.prototype=Object.create(qa.prototype),b.prototype.constructor=b,b.prototype.copy=function(e){return qa.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},S.prototype=Object.create(no.prototype),S.prototype.constructor=S,S.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r,a=0;a!==r;a++)t[a]=n[i+a];return t},S.prototype.beforeStart_=S.prototype.copySampleValue_,S.prototype.afterEnd_=S.prototype.copySampleValue_,S.prototype.interpolate_=function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,c=r-t,u=(n-t)/c,h=u*u,d=h*u,f=e*l,p=f-l,m=-2*d+3*h,g=d-h,v=1-m,y=g-h+u,b=0;b!==o;b++){var _=a[p+b+o],x=a[p+b+s]*c,w=a[f+b+o],M=a[f+b]*c;i[b]=v*_+y*x+m*w+g*M}return i};var T=0,E=1,C=2,A=3,P=4,L=5,R=6,O={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},k={9728:1003,9729:1006,9984:1004,9985:1007,9986:1005,9987:1008},I={33071:1001,33648:1002,10497:1e3},N={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},D={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},j={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},F={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300},B="OPAQUE",U="MASK",H="BLEND";function G(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function W(e,t,n){for(var r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function V(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function q(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,r=t.weights.length;n=2&&i.setY(S,x[w*o+1]),o>=3&&i.setZ(S,x[w*o+2]),o>=4&&i.setW(S,x[w*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i}))},Z.prototype.loadTexture=function(e){var t,r,i=this.json,a=this.options,o=i.textures[e],s=o.extensions||{};return(t=s[n.MSFT_TEXTURE_DDS]?i.images[s[n.MSFT_TEXTURE_DDS].source]:i.images[o.source]).uri&&(r=a.manager.getHandler(t.uri)),r||(r=s[n.MSFT_TEXTURE_DDS]?this.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(e,t,r)},Z.prototype.loadTextureImage=function(e,t,n){var r=this,i=this.json,a=this.options,o=i.textures[e],s=self.URL||self.webkitURL,l=t.uri,c=!1,u=!0;return"image/jpeg"===t.mimeType&&(u=!1),void 0!==t.bufferView&&(l=r.getDependency("bufferView",t.bufferView).then((function(e){if("image/png"===t.mimeType){var n=new DataView(e,25,1).getUint8(0,!1);u=6===n||4===n||3===n}c=!0;var r=new Blob([e],{type:t.mimeType});return l=s.createObjectURL(r)}))),Promise.resolve(l).then((function(e){return new Promise((function(t,r){var i=t;!0===n.isImageBitmapLoader&&(i=function(e){t(new la(e))}),n.load(G(e,a.path),i,void 0,r)}))})).then((function(t){!0===c&&s.revokeObjectURL(l),t.flipY=!1,o.name&&(t.name=o.name),u||(t.format=1022);var n=(i.samplers||{})[o.sampler]||{};return t.magFilter=k[n.magFilter]||1006,t.minFilter=k[n.minFilter]||1008,t.wrapS=I[n.wrapS]||1e3,t.wrapT=I[n.wrapT]||1e3,r.associations.set(t,{type:"textures",index:e}),t}))},Z.prototype.assignTexture=function(e,t,r){var i=this;return this.getDependency("texture",r.index).then((function(a){if(void 0===r.texCoord||0==r.texCoord||"aoMap"===t&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+t+" not yet supported."),i.extensions[n.KHR_TEXTURE_TRANSFORM]){var o=void 0!==r.extensions?r.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;if(o){var s=i.associations.get(a);a=i.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),i.associations.set(a,s)}}e[t]=a}))},Z.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,r=void 0!==t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal,o=!0===e.isSkinnedMesh,s=Object.keys(t.morphAttributes).length>0,l=s&&void 0!==t.morphAttributes.normal;if(e.isPoints){var c="PointsMaterial:"+n.uuid,u=this.cache.get(c);u||(u=new $i,We.prototype.copy.call(u,n),u.color.copy(n.color),u.map=n.map,u.sizeAttenuation=!1,this.cache.add(c,u)),n=u}else if(e.isLine){c="LineBasicMaterial:"+n.uuid;var h=this.cache.get(c);h||(h=new Hi,We.prototype.copy.call(h,n),h.color.copy(n.color),this.cache.add(c,h)),n=h}if(r||i||a||o||s){c="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),o&&(c+="skinning:"),r&&(c+="vertex-tangents:"),i&&(c+="vertex-colors:"),a&&(c+="flat-shading:"),s&&(c+="morph-targets:"),l&&(c+="morph-normals:");var d=this.cache.get(c);d||(d=n.clone(),o&&(d.skinning=!0),i&&(d.vertexColors=!0),a&&(d.flatShading=!0),s&&(d.morphTargets=!0),l&&(d.morphNormals=!0),r&&(d.vertexTangents=!0,d.normalScale&&(d.normalScale.y*=-1),d.clearcoatNormalScale&&(d.clearcoatNormalScale.y*=-1)),this.cache.add(c,d),this.associations.set(d,this.associations.get(n))),n=d}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=n},Z.prototype.getMaterialType=function(){return qa},Z.prototype.loadMaterial=function(e){var t,r=this,i=this.json,a=this.extensions,o=i.materials[e],s={},l=o.extensions||{},c=[];if(l[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var h=a[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=h.getMaterialType(),c.push(h.extendParams(s,o,r))}else if(l[n.KHR_MATERIALS_UNLIT]){var d=a[n.KHR_MATERIALS_UNLIT];t=d.getMaterialType(),c.push(d.extendParams(s,o,r))}else{var f=o.pbrMetallicRoughness||{};if(s.color=new Ue(1,1,1),s.opacity=1,Array.isArray(f.baseColorFactor)){var p=f.baseColorFactor;s.color.fromArray(p),s.opacity=p[3]}void 0!==f.baseColorTexture&&c.push(r.assignTexture(s,"map",f.baseColorTexture)),s.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,s.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture&&(c.push(r.assignTexture(s,"metalnessMap",f.metallicRoughnessTexture)),c.push(r.assignTexture(s,"roughnessMap",f.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),c.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,s)}))))}!0===o.doubleSided&&(s.side=2);var m=o.alphaMode||B;return m===H?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,m===U&&(s.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&t!==Ve&&(c.push(r.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new u(1,-1),void 0!==o.normalTexture.scale&&s.normalScale.set(o.normalTexture.scale,-o.normalTexture.scale)),void 0!==o.occlusionTexture&&t!==Ve&&(c.push(r.assignTexture(s,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(s.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&t!==Ve&&(s.emissive=(new Ue).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&t!==Ve&&c.push(r.assignTexture(s,"emissiveMap",o.emissiveTexture)),Promise.all(c).then((function(){var i;return i=t===b?a[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new t(s),o.name&&(i.name=o.name),i.map&&(i.map.encoding=3001),i.emissiveMap&&(i.emissiveMap.encoding=3001),V(i,o),r.associations.set(i,{type:"materials",index:e}),o.extensions&&W(a,i,o),i}))},Z.prototype.createUniqueName=function(e){for(var t=Us.sanitizeNodeName(e||""),n=t,r=1;this.nodeNamesUsed[n];++r)n=t+"_"+r;return this.nodeNamesUsed[n]=!0,n},Z.prototype.loadGeometries=function(e){var t=this,r=this.extensions,i=this.primitiveCache;function a(e){return r[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return J(n,e,t)}))}for(var o,s,l=[],c=0,u=e.length;c0&&q(h,a),h.name=n.createUniqueName(a.name||"mesh_"+e),V(h,a),f.extensions&&W(i,h,f),n.assignFinalMaterial(h),l.push(h)}if(1===l.length)return l[0];var m=new Qr;for(c=0,u=l.length;c1?new Qr:1===t.length?t[0]:new be)!==t[0])for(var s=0,l=t.length;s{if(!t.ok)throw new Error(`Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()}).then(e=>this.parse(e))}parse(e){const t=new DataView(e),n=String.fromCharCode(t.getUint8(0))+String.fromCharCode(t.getUint8(1))+String.fromCharCode(t.getUint8(2))+String.fromCharCode(t.getUint8(3));console.assert("b3dm"===n);const r=t.getUint32(4,!0);console.assert(1===r);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const a=t.getUint32(12,!0),o=t.getUint32(16,!0),s=t.getUint32(20,!0),l=t.getUint32(24,!0),c=e.slice(28,28+a+o),u=new vd(c,0,a,o),h=28+a+o,d=e.slice(h,h+s+l),f=new yd(d,u.getData("BATCH_LENGTH"),0,s,l),p=h+s+l;return{version:r,featureTable:u,batchTable:f,glbBytes:new Uint8Array(e,p,i-p)}}}{constructor(e=bo){super(),this.manager=e}parse(e){const t=super.parse(e),n=t.glbBytes.slice().buffer;return new Promise((e,r)=>{const i=this.manager;(i.getHandler("path.gltf")||new bd(i)).parse(n,null,n=>{const{batchTable:r,featureTable:i}=t,{scene:a}=n,o=i.getData("RTC_CENTER");o&&(a.position.x+=o[0],a.position.y+=o[1],a.position.z+=o[2]),n.batchTable=r,n.featureTable=i,a.batchTable=r,a.featureTable=i,e(n)},r)})}}class xd extends class{constructor(){this.fetchOptions={}}load(e){return fetch(e,this.fetchOptions).then(t=>{if(!t.ok)throw new Error(`Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()}).then(e=>this.parse(e))}parse(e){const t=new DataView(e),n=String.fromCharCode(t.getUint8(0))+String.fromCharCode(t.getUint8(1))+String.fromCharCode(t.getUint8(2))+String.fromCharCode(t.getUint8(3));console.assert("pnts"===n);const r=t.getUint32(4,!0);console.assert(1===r);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const a=t.getUint32(12,!0),o=t.getUint32(16,!0),s=t.getUint32(20,!0),l=t.getUint32(24,!0),c=e.slice(28,28+a+o),u=new vd(c,0,a,o),h=28+a+o,d=e.slice(h,h+s+l),f=new yd(d,u.getData("BATCH_LENGTH")||u.getData("POINTS_LENGTH"),0,s,l);return{version:r,featureTable:u,batchTable:f}}}{constructor(e=bo){super(),this.manager=e}parse(e){const t=super.parse(e),{featureTable:n}=t,r=n.getData("POINTS_LENGTH"),i=n.getData("POSITION",r,"FLOAT","VEC3"),a=n.getData("RGB",r,"UNSIGNED_BYTE","VEC3");if(null===i)throw new Error("PNTSLoader : POSITION_QUANTIZED feature type is not supported.");const o=new mt;o.setAttribute("position",new Ye(i,3,!1));const s=new $i;s.size=2,s.sizeAttenuation=!1,null!==a&&(o.setAttribute("color",new Ye(a,3,!0)),s.vertexColors=!0);const l=new ia(o,s);return t.scene=l,t.scene.featureTable=n,t}}const wd=new _,Md=new b,Sd=new _,Td=new Y;class Ed extends class{constructor(){this.fetchOptions={},this.workingPath=""}resolveExternalURL(e){return this.workingPath+"/"+e}load(e){return fetch(e,this.fetchOptions).then(t=>{if(!t.ok)throw new Error(`Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()}).then(t=>{if(""===this.workingPath){const t=e.split(/\\\//g);t.pop(),this.workingPath=t.join("/")}return this.parse(t)})}parse(e){const t=new DataView(e),n=String.fromCharCode(t.getUint8(0))+String.fromCharCode(t.getUint8(1))+String.fromCharCode(t.getUint8(2))+String.fromCharCode(t.getUint8(3));console.assert("i3dm"===n);const r=t.getUint32(4,!0);console.assert(1===r);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const a=t.getUint32(12,!0),o=t.getUint32(16,!0),s=t.getUint32(20,!0),l=t.getUint32(24,!0),c=t.getUint32(28,!0),u=e.slice(32,32+a+o),h=new vd(u,0,a,o),d=32+a+o,f=e.slice(d,d+s+l),p=new yd(f,h.getData("INSTANCES_LENGTH"),0,s,l),m=d+s+l,g=new Uint8Array(e,m,i-m);let v=null,y=null;if(c)v=g,y=Promise.resolve();else{const e=this.resolveExternalURL(gd(g));y=fetch(e,this.fetchOptions).then(t=>{if(!t.ok)throw new Error(`I3DMLoaderBase : Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()}).then(e=>{v=new Uint8Array(e)})}return y.then(()=>({version:r,featureTable:h,batchTable:p,glbBytes:v}))}}{constructor(e=bo){super(),this.manager=e}resolveExternalURL(e){return this.manager.resolveURL(super.resolveExternalURL(e))}parse(e){return super.parse(e).then(e=>{const{featureTable:t,batchTable:n}=e,r=e.glbBytes.slice().buffer;return new Promise((e,i)=>{const a=this.manager;(a.getHandler("path.gltf")||new bd(a)).parse(r,null,r=>{const i=t.getData("INSTANCES_LENGTH"),a=t.getData("POSITION",i,"FLOAT","VEC3"),o=new Map,s=[];r.scene.traverse(e=>{if(e.isMesh){const{geometry:t,material:n}=e,r=new Ui(t,n,i);s.push(r),o.set(e,r)}});const l=new _;for(let e=0;e{const n=t.parent;n&&(n.remove(t),n.add(e),e.position.copy(l))});for(let e=0;e{if(!t.ok)throw new Error(`Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()}).then(t=>{if(""===this.workingPath){const t=e.split(/\\\//g);t.pop(),this.workingPath=t.join("/")}return this.parse(t)})}parse(e){const t=new DataView(e),n=String.fromCharCode(t.getUint8(0))+String.fromCharCode(t.getUint8(1))+String.fromCharCode(t.getUint8(2))+String.fromCharCode(t.getUint8(3));console.assert("cmpt"===n);const r=t.getUint32(4,!0);console.assert(1===r);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const a=t.getUint32(12,!0),o=[];let s=16;for(let t=0;t{i.push(e),r.add(e.scene)});a.push(t);break}case"pnts":{const e=s.slice(),t=new xd(n).parse(e.buffer);i.push(t),r.add(t.scene);break}case"i3dm":{const e=s.slice(),t=new Ed(n);t.workingPath=this.workingPath,t.fetchOptions=this.fetchOptions;const o=t.parse(e.buffer).then(e=>{i.push(e),r.add(e.scene)});a.push(o);break}}}return Promise.all(a).then(()=>({tiles:i,scene:r}))}}const Ad=new Y;class Pd extends Qr{constructor(e){super(),this.tilesRenderer=e}raycast(e,t){this.tilesRenderer.raycast(e,t)}updateMatrixWorld(e){if(this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldNeedsUpdate||e){null===this.parent?Ad.copy(this.matrix):Ad.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1;const e=Ad.elements,t=this.matrixWorld.elements;let n=!1;for(let r=0;r<16;r++){const i=e[r],a=t[r];if(Math.abs(i-a)>Number.EPSILON){n=!0;break}}if(n){this.matrixWorld.copy(Ad);const e=this.children;for(let t=0,n=e.length;t{Object.getPrototypeOf(e).raycast.call(e,t,n)})}const Fd=Symbol("INITIAL_FRUSTUM_CULLED"),zd=c.DEG2RAD,Bd=new Y,Ud=new Y,Hd=new _,Gd=new _,Wd=new _,Vd=new _,qd=new _(1,0,0),Xd=new _(0,1,0);function Yd(){}function Zd(e,t){e.traverse(e=>{e.frustumCulled=e[Fd]&&t})}class Jd extends class{get rootTileSet(){const e=this.tileSets[this.rootURL];return!e||e instanceof Promise?null:e}get root(){const e=this.rootTileSet;return e?e.root:null}constructor(e){this.tileSets={},this.rootURL=e,this.fetchOptions={},this.preprocessURL=null;const t=new sd;t.unloadPriorityCallback=md;const n=new ld;n.maxJobs=4,n.priorityCallback=md;const r=new ld;r.maxJobs=1,r.priorityCallback=md,this.lruCache=t,this.downloadQueue=n,this.parseQueue=r,this.stats={parsing:0,downloading:0,failed:0,inFrustum:0,used:0,active:0,visible:0},this.frameCount=0,this.errorTarget=6,this.errorThreshold=1/0,this.loadSiblings=!0,this.displayActiveTiles=!1,this.maxDepth=1/0,this.stopAtEmptyTiles=!0}traverse(e,t){const n=this.tileSets[this.rootURL];n&&n.root&&pd(n.root,e,t)}update(){const e=this.stats,t=this.lruCache,n=this.tileSets,r=n[this.rootURL];if(!(this.rootURL in n))return void this.loadRootTileSet(this.rootURL);if(!r||!r.root)return;const i=r.root;e.inFrustum=0,e.used=0,e.active=0,e.visible=0,this.frameCount++,function e(t,n){const r=n.stats,i=n.frameCount,a=n.errorTarget,o=n.maxDepth,s=n.loadSiblings,l=n.lruCache,c=n.stopAtEmptyTiles;if(hd(t,i),!1===n.tileInView(t))return!1;if(t.__used=!0,l.markUsed(t),t.__inFrustum=!0,r.inFrustum++,(c||!t.__contentEmpty)&&!t.__externalTileSet){const e=n.calculateError(t);if(t.__error=e,e<=a)return!0;if(n.maxDepth>0&&t.__depth+1>=o)return!0}let u=!1;const h=t.children;for(let t=0,r=h.length;t{if(t.ok)return t.json();throw new Error(`TilesRenderer: Failed to load tileset "${e}" with status ${t.status} : ${t.statusText}`)}).then(t=>{const r=t.asset.version;console.assert("1.0"===r||"0.0"===r,'asset.version is expected to be a string of "1.0" or "0.0"');const i=od.a.dirname(e);return pd(t.root,(e,t)=>this.preprocessNode(e,t,i),null,n,n?n.__depth:0),t})}loadRootTileSet(e){const t=this.tileSets;if(e in t)return t[e]instanceof Error?Promise.reject(t[e]):Promise.resolve(t[e]);{const n=this.fetchTileSet(e,this.fetchOptions).then(n=>{t[e]=n});return n.catch(n=>{console.error(n),t[e]=n}),t[e]=n,n}}requestTileContents(e){if(0!==e.__loadingState)return;const t=this.stats,n=this.lruCache,r=this.downloadQueue,i=this.parseQueue,a=e.__externalTileSet;n.add(e,e=>{1===e.__loadingState?(e.__loadAbort.abort(),e.__loadAbort=null):a?e.children.length=0:this.disposeTile(e),1===e.__loadingState?t.downloading--:2===e.__loadingState&&t.parsing--,e.__loadingState=0,e.__loadIndex++,i.remove(e),r.remove(e)}),e.__loadIndex++;const o=e.__loadIndex,s=new AbortController,l=s.signal;t.downloading++,e.__loadAbort=s,e.__loadingState=1;const c=a=>{e.__loadIndex===o&&("AbortError"!==a.name?(i.remove(e),r.remove(e),2===e.__loadingState?t.parsing--:1===e.__loadingState&&t.downloading--,t.failed++,console.error(`TilesRenderer : Failed to load tile at url "${e.content.uri}".`),console.error(a),e.__loadingState=4):n.remove(e))};a?r.add(e,e=>{if(e.__loadIndex!==o)return Promise.resolve();const t=this.preprocessURL?this.preprocessURL(e.content.uri):e.content.uri;return this.fetchTileSet(t,Object.assign({signal:l},this.fetchOptions),e)}).then(n=>{e.__loadIndex===o&&(t.downloading--,e.__loadAbort=null,e.__loadingState=3,e.children.push(n.root))}).catch(c):r.add(e,e=>{if(e.__loadIndex!==o)return Promise.resolve();const t=this.preprocessURL?this.preprocessURL(e.content.uri):e.content.uri;return fetch(t,Object.assign({signal:l},this.fetchOptions))}).then(t=>{if(e.__loadIndex===o){if(t.ok)return t.arrayBuffer();throw new Error("Failed to load model with error code "+t.status)}}).then(n=>{if(e.__loadIndex===o)return t.downloading--,t.parsing++,e.__loadAbort=null,e.__loadingState=2,i.add(e,e=>{if(e.__loadIndex!==o)return Promise.resolve();const t=e.content.uri.split(/\./g).pop();return this.parseTile(n,e,t)})}).then(()=>{e.__loadIndex===o&&(t.parsing--,e.__loadingState=3,e.__wasSetVisible&&this.setTileVisible(e,!0),e.__wasSetActive&&this.setTileActive(e,!0))}).catch(c)}dispose(){const e=this.lruCache;this.traverse(t=>{e.remove(t)})}}{get autoDisableRendererCulling(){return this._autoDisableRendererCulling}set autoDisableRendererCulling(e){this._autoDisableRendererCulling!==e&&(super._autoDisableRendererCulling=e,this.traverse(t=>{t.scene&&Zd(t.scene,e)}))}constructor(...e){super(...e),this.group=new Pd(this),this.cameras=[],this.cameraMap=new Map,this.cameraInfo=[],this.activeTiles=new Set,this.visibleTiles=new Set,this._autoDisableRendererCulling=!0,this.onLoadTileSet=null,this.onLoadModel=null,this.onDisposeModel=null;const t=new yo;t.setURLModifier(e=>this.preprocessURL?this.preprocessURL(e):e),this.manager=t}getBounds(e){if(!this.root)return!1;const t=this.root.cached,n=t.box,r=t.boxTransform;return!!n&&(e.copy(n),e.applyMatrix4(r),!0)}getOrientedBounds(e,t){if(!this.root)return!1;const n=this.root.cached,r=n.box,i=n.boxTransform;return!!e&&(e.copy(r),t.copy(i),!0)}forEachLoadedModel(e){this.traverse(t=>{const n=t.cached.scene;n&&e(n,t)})}raycast(e,t){if(this.root)if(e.firstHitOnly){const n=function e(t,n,r,i){if(r.has(t)){if(jd(t.cached.scene,i,Nd),Nd.length>0){Nd.length>1&&Nd.sort(Dd);const e=Nd[0];return Nd.length=0,e}return null}const a=[],o=t.children;for(let e=0,t=o.length;e1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when raycasting.");let n={distance:1/0,tile:null};a.push(n),n.distance=Od.distanceToSquared(Id.origin)*e*e,n.tile=t}}}a.sort(Dd);let s=1/0,l=null;for(let t=0,o=a.length;ts)break;{const t=o.tile,a=t.cached.scene;let c=null;if(r.has(t)?(jd(a,i,Nd),Nd.length>0&&(Nd.length>1&&Nd.sort(Dd),c=Nd[0])):c=e(t,n,r,i),c){const e=c.distance*c.distance;e{this.onLoadTileSet&&Promise.resolve().then(()=>{this.onLoadTileSet(t,e)})}),n}update(){const e=this.group,t=this.cameras,n=this.cameraMap,r=this.cameraInfo;if(0===t.length)return void console.warn("TilesRenderer: no cameras defined. Cannot update 3d tiles.");for(;r.length>t.length;)r.pop();for(;r.length1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.");for(let a=0,o=r.length;ae.scene);break;case"pnts":l=Promise.resolve(new xd(o).parse(e).scene);break;case"i3dm":{const t=new Ed(o);t.workingPath=i,t.fetchOptions=a,l=t.parse(e).then(e=>e.scene);break}case"cmpt":{const t=new Cd(o);t.workingPath=i,t.fetchOptions=a,l=t.parse(e).then(e=>e.scene);break}default:console.warn(`TilesRenderer: Content type "${n}" not supported.`),l=Promise.resolve(null)}return l.then(e=>{if(t._loadIndex!==s)return;const n=this.rootTileSet.asset&&this.rootTileSet.asset.gltfUpAxis||"y",r=t.cached,i=r.transform;switch(n.toLowerCase()){case"x":e.matrix.makeRotationAxis(Xd,-Math.PI/2);break;case"y":e.matrix.makeRotationAxis(qd,Math.PI/2)}e.matrix.premultiply(i),e.matrix.decompose(e.position,e.quaternion,e.scale),e.traverse(e=>{e[Fd]=e.frustumCulled}),Zd(e,this.autoDisableRendererCulling),r.scene=e,e.traverse(e=>{e.raycast=Yd});const a=[],o=[],l=[];e.traverse(e=>{if(e.geometry&&o.push(e.geometry),e.material){const t=e.material;a.push(e.material);for(const e in t){const n=t[e];n&&n.isTexture&&l.push(n)}}}),r.materials=a,r.geometry=o,r.textures=l,this.onLoadModel&&this.onLoadModel(e,t)})}disposeTile(e){const t=e.cached;if(t.scene){const n=t.materials,r=t.geometry,i=t.textures;for(let e=0,t=r.length;e=e.minZoom&&t.p.p.zoom<=e.maxZoom&&t.p.p._.tiledWorld.removeAllTiles(),t.p.p._.maxZoom=t.p.findHighestMaxZoom(),t.p.p._.minNativeZoom=t.p.findLowestMinZoom()}else console.warn("Attempted to add an invalid tile layer.")}},this.toggle=function(e,n){if(!t.p.p._.wasInitialized)return!1;var r=!1;return t.p.tile.forEach((function(t){e===t.name&&(t.on=null!=n?n:!t.on,r=!0)})),!!r&&(t.p.p._.tiledWorld.outdateAllTiles(),t.p.p._.maxZoom=t.p.findHighestMaxZoom(),t.p.p._.minNativeZoom=t.p.findLowestMinZoom(),!0)},this.setOpacity=function(e,n){if(!t.p.p._.wasInitialized)return!1;for(var r=0;r=t.p.tile[n].minZoom&&t.p.p.zoom<=t.p.tile[n].maxZoom)for(var r=t.p.p._.tiledWorld.tilesDrawn.length,i=0;i=e.minZoom&&t.p.p.zoom<=e.maxZoom&&t.p.p._.tiledWorld.updateAllRasters(),"function"==typeof n&&n()};if(t.p.p._.tiledWorld.killDrawingTiles(),e.hasOwnProperty("name")&&e.hasOwnProperty("on")&&(!0===e.preDrawn&&e.hasOwnProperty("data")||(e.hasOwnProperty("geojsonPath")||e.hasOwnProperty("geojson"))&&e.hasOwnProperty("minZoom")&&e.hasOwnProperty("maxZoom")))if(e.hasOwnProperty("geojsonPath")&&!e.hasOwnProperty("geojson")){e.hasOwnProperty("opacity")||(e.opacity=1);var a=new XMLHttpRequest;a.open("GET",e.geojsonPath,!0),a.responseType="json",a.withCredentials=!0===e.withCredentials||!1,a.onload=function(){404!==a.status&&a.response?(e.geojson=a.response,i()):console.warn("Failed to fetch geojson data for clamped layer: "+e.name)},a.send()}else i();else console.warn("Attempted to add an invalid clamped layer: "+e.name)}},this.toggle=function(e,n){if(!t.p.p._.wasInitialized)return!1;var r=!1;return t.p.clamped.forEach((function(t){e===t.name&&(t.on=null!=n?n:!t.on,r=!0)})),!!r&&(t.p.p._.tiledWorld.updateAllRasters(),!0)},this.setOpacity=function(e,n){if(!t.p.p._.wasInitialized)return!1;for(var r=function(r){var i=t.p.clamped[r];if(e===i.name)return clearTimeout(tf),tf=setTimeout((function(){i.opacity=Math.max(Math.min(n,1),0),t.p.p.zoom>=i.minZoom&&t.p.p.zoom<=i.maxZoom&&(t.p.p._.tiledWorld.killDrawingTiles(),t.p.p._.tiledWorld.updateAllRasters())}),250),{value:!0}},i=0;i=r&&t.p.p.zoom<=i&&(t.p.p._.tiledWorld.killDrawingTiles(),t.p.p._.tiledWorld.updateAllRasters()),!0}return!1},this.getClampedTexture=function(e,n){var r,i=.5,a=t.p.clamped[e],o=document.createElement("canvas");o.id="vectorsastile",o.width=256/i,i*=Math.pow(2,t.p.p.zoom-n.z),o.height=o.width;var s,l,c=o.getContext("2d"),u=[];if(i<128)if(a.preDrawn)c.imageSmoothingEnabled=!1,a.data&&a.data[n.z]&&a.data[n.z][n.x]&&null!=a.data[n.z][n.x][n.y]&&c.drawImage(a.data[n.z][n.x][n.y],0,0,o.width,o.height);else for(var h=0,d=a.geojson.features;h=0&&A=0&&P=0&&A=0&&P=0&&A=0&&P=0&&A=0&&P=0&&A=0&&P\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include \n\t\t\t#include \n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t"};var of=function(e){zt.call(this,{type:"LineMaterial",uniforms:Ft.clone(en.line.uniforms),vertexShader:en.line.vertexShader,fragmentShader:en.line.fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}}}),this.setValues(e)};(of.prototype=Object.create(zt.prototype)).constructor=of,of.prototype.isLineMaterial=!0;var sf,lf,cf=function(e,t){void 0===e&&(e=new rf),void 0===t&&(t=new of({color:16777215*Math.random()})),kt.call(this,e,t),this.type="LineSegments2"};cf.prototype=Object.assign(Object.create(kt.prototype),{constructor:cf,isLineSegments2:!0,computeLineDistances:(sf=new _,lf=new _,function(){for(var e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.data.count),i=0,a=0,o=t.data.count;ix&&t.z>x)){if(e.z>x){const n=e.z-t.z,r=(e.z-x)/n;e.lerp(t,r)}else if(t.z>x){const n=t.z-e.z,r=(t.z-x)/n;t.lerp(e,r)}e.applyMatrix4(f),t.applyMatrix4(f),e.multiplyScalar(1/e.w),t.multiplyScalar(1/t.w),e.x*=g.x/2,e.y*=g.y/2,t.x*=g.x/2,t.y*=g.y/2,a.start.copy(e),a.start.z=0,a.end.copy(t),a.end.z=0;var T=a.closestPointToPointParameter(r,!0);a.at(T,o);var E=c.lerp(e.z,t.z,T),C=E>=-1&&E<=1,A=r.distanceTo(o)<.5*v;if(C&&A){a.start.fromBufferAttribute(y,M),a.end.fromBufferAttribute(b,M),a.start.applyMatrix4(w),a.end.applyMatrix4(w);var P=new _,L=new _;h.distanceSqToSegment(a.start,a.end,L,P),l.push({point:L,pointOnLine:P,distance:h.origin.distanceTo(L),object:this,face:null,faceIndex:M,uv:null,uv2:null})}}}}}()});var uf=function(e,t){void 0===e&&(e=new af),void 0===t&&(t=new of({color:16777215*Math.random()})),cf.call(this,e,t),this.type="Line2"};uf.prototype=Object.assign(Object.create(cf.prototype),{constructor:uf,isLine2:!0});var hf={spriteMaterials:{},makeMarkerSprite:function(e,t,n){var r=new wi(hf.makeMarkerMaterial(e,t,n));return r.style=r.style||{},r.style.radius=e.hasOwnProperty("radius")?e.radius:32,r},makeMarkerMaterial:function(e,t,n){if(t&&this.spriteMaterials.hasOwnProperty(t)&&!0!==n)return this.spriteMaterials[t];void 0===e&&(e={});var r=e.hasOwnProperty("radius")?e.radius:64;r=Math.max(r,64);var i=e.hasOwnProperty("fillColor")?e.fillColor:{r:255,g:255,b:255,a:null!=e.fillOpacity?e.fillOpacity:1},a=e.hasOwnProperty("weight")?e.weight:4,o=e.hasOwnProperty("color")?e.color:{r:0,g:0,b:0,a:1},s=document.createElement("canvas"),l=s.getContext("2d"),c=2*r,u=2*r;s.width=c,s.height=u,l.beginPath(),l.arc(s.width/2,s.height/2,r-a*(r/12),0,2*Math.PI,!1),l.fillStyle="object"==typeof i?"rgba("+i.r+","+i.g+","+i.b+","+i.a+")":i,l.fill(),l.lineWidth=a*(r/8),l.strokeStyle="object"==typeof o?"rgba("+o.r+","+o.g+","+o.b+","+o.a+")":o,l.stroke();var h=new m(s);h.needsUpdate=!0;var d=new li({map:h,transparent:!0,alphaTest:.01});return t&&!0!==n&&(this.spriteMaterials[t]=d),d},makeTextSprite:function(e,t){void 0===t&&(t={});var n=t.hasOwnProperty("fontface")?t.fontface:"Arial",r=t.hasOwnProperty("fontsize")?t.fontsize:18,i=t.hasOwnProperty("strokeWeight")?t.strokeWeight:4,a=t.hasOwnProperty("strokeColor")?t.strokeColor:{r:0,g:0,b:0,a:1},o=t.hasOwnProperty("fontColor")?t.fontColor:{r:255,g:255,b:255,a:1},s=document.createElement("canvas"),l=s.getContext("2d");s.width=1024,s.height=64,l.font="Bold "+r+"px "+n,l.strokeStyle="rgba("+a.r+","+a.g+","+a.b+","+a.a+")",l.lineWidth=i,l.fillStyle="rgba("+o.r+","+o.g+","+o.b+","+o.a+")",l.textAlign="left",l.strokeText(e,512+r,64-r/1.8),l.fillText(e,512+r,64-r/1.8);var c=new m(s);c.needsUpdate=!0;var u=new wi(new li({map:c}));return u.scale.set(64,4,1),u}},df=hf,ff=function(e){var t=this;this.add=function(e,n){if(t.p.p._.wasInitialized){var r=!1,i=function(){for(var i=0;i0?t[t.length-1]:"",smooth:void 0!==n?n.smooth:this.smooth,groupStart:void 0!==n?n.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},n&&n.name&&"function"==typeof n.clone){var r=n.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseNormalIndex:function(e,t){var n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseUVIndex:function(e,t){var n=parseInt(e,10);return 2*(n>=0?n-1:n+t/2)},addVertex:function(e,t,n){var r=this.vertices,i=this.object.geometry.vertices;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){var r=this.normals,i=this.object.geometry.normals;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addFaceNormal:function(e,t,n){var r=this.vertices,c=this.object.geometry.normals;i.fromArray(r,e),a.fromArray(r,t),o.fromArray(r,n),l.subVectors(o,a),s.subVectors(i,a),l.cross(s),l.normalize(),c.push(l.x,l.y,l.z),c.push(l.x,l.y,l.z),c.push(l.x,l.y,l.z)},addColor:function(e,t,n){var r=this.colors,i=this.object.geometry.colors;void 0!==r[e]&&i.push(r[e+0],r[e+1],r[e+2]),void 0!==r[t]&&i.push(r[t+0],r[t+1],r[t+2]),void 0!==r[n]&&i.push(r[n+0],r[n+1],r[n+2])},addUV:function(e,t,n){var r=this.uvs,i=this.object.geometry.uvs;i.push(r[e+0],r[e+1]),i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1])},addDefaultUV:function(){var e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,r,i,a,o,s,l){var c=this.vertices.length,u=this.parseVertexIndex(e,c),h=this.parseVertexIndex(t,c),d=this.parseVertexIndex(n,c);if(this.addVertex(u,h,d),this.addColor(u,h,d),void 0!==o&&""!==o){var f=this.normals.length;u=this.parseNormalIndex(o,f),h=this.parseNormalIndex(s,f),d=this.parseNormalIndex(l,f),this.addNormal(u,h,d)}else this.addFaceNormal(u,h,d);if(void 0!==r&&""!==r){var p=this.uvs.length;u=this.parseUVIndex(r,p),h=this.parseUVIndex(i,p),d=this.parseUVIndex(a,p),this.addUV(u,h,d),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,n=0,r=e.length;n=7?a.colors.push(parseFloat(p[4]),parseFloat(p[5]),parseFloat(p[6])):a.colors.push(void 0,void 0,void 0);break;case"vn":a.normals.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3]));break;case"vt":a.uvs.push(parseFloat(p[1]),parseFloat(p[2]))}}else if("f"===l){for(var m=s.substr(1).trim().split(/\s+/),g=[],v=0,y=m.length;v0){var _=b.split("/");g.push(_)}}var x=g[0];for(v=1,y=g.length-1;v1){var O=u[1].trim().toLowerCase();a.object.smooth="0"!==O&&"off"!==O}else a.object.smooth=!0;(V=a.object.currentMaterial())&&(V.smooth=a.object.smooth)}else{if("\0"===s)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+s+'"')}a.finalize();var k=new Qr;if(k.materialLibraries=[].concat(a.materialLibraries),!0===!(1===a.objects.length&&0===a.objects[0].geometry.vertices.length))for(d=0,f=a.objects.length;d0&&Z.setAttribute("normal",new rt(N.normals,3)),N.colors.length>0&&(z=!0,Z.setAttribute("color",new rt(N.colors,3))),!0===N.hasUVIndices&&Z.setAttribute("uv",new rt(N.uvs,2));for(var B,U=[],H=0,G=D.length;H1){for(H=0,G=D.length;H0){var Z;V=new $i({size:1,sizeAttenuation:!1});(Z=new mt).setAttribute("position",new rt(a.vertices,3)),a.colors.length>0&&void 0!==a.colors[0]&&(Z.setAttribute("color",new rt(a.colors,3)),V.vertexColors=!0);var J=new ia(Z,V);k.add(J)}return k}}),u}(),mf=function(e){_o.call(this,e)};mf.prototype=Object.assign(Object.create(_o.prototype),{constructor:mf,load:function(e,t,n,r){var i=this,a=""===this.path?ps(e):this.path,o=new wo(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{t(i.parse(n,a))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)},setMaterialOptions:function(e){return this.materialOptions=e,this},parse:function(e,t){for(var n=e.split("\n"),r={},i=/\s+/,a={},o=0;o=0?s.substring(0,l):s;c=c.toLowerCase();var u=l>=0?s.substring(l+1):"";if(u=u.trim(),"newmtl"===c)r={name:u},a[u]=r;else if("ka"===c||"kd"===c||"ks"===c||"ke"===c){var h=u.split(i,3);r[c]=[parseFloat(h[0]),parseFloat(h[1]),parseFloat(h[2])]}else r[c]=u}}var d=new mf.MaterialCreator(this.resourcePath||t,this.materialOptions);return d.setCrossOrigin(this.crossOrigin),d.setManager(this.manager),d.setMaterials(a),d}}),(mf.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:0,this.wrap=this.options&&this.options.wrap?this.options.wrap:1e3}).prototype={constructor:mf.MaterialCreator,crossOrigin:"anonymous",setCrossOrigin:function(e){return this.crossOrigin=e,this},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var n in e){var r=e[n],i={};for(var a in t[n]=i,r){var o=!0,s=r[a],l=a.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(i[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,n=this.materialsInfo[e],r={name:e,side:this.side};function i(e,n){if(!r[e]){var i,a,o=t.getTextureParams(n,r),s=t.loadTexture((i=t.baseUrl,"string"!=typeof(a=o.url)||""===a?"":/^https?:\/\//i.test(a)?a:i+a));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,r[e]=s}}for(var a in n){var o,s=n[a];if(""!==s)switch(a.toLowerCase()){case"kd":r.color=(new Ue).fromArray(s);break;case"ks":r.specular=(new Ue).fromArray(s);break;case"ke":r.emissive=(new Ue).fromArray(s);break;case"map_kd":i("map",s);break;case"map_ks":i("specularMap",s);break;case"map_ke":i("emissiveMap",s);break;case"norm":i("normalMap",s);break;case"map_bump":case"bump":i("bumpMap",s);break;case"map_d":i("alphaMap",s),r.transparent=!0;break;case"ns":r.shininess=parseFloat(s);break;case"d":(o=parseFloat(s))<1&&(r.opacity=o,r.transparent=!0);break;case"tr":o=parseFloat(s),this.options&&this.options.invertTrProperty&&(o=1-o),o>0&&(r.opacity=1-o,r.transparent=!0)}}return this.materials[e]=new Ya(r),this.materials[e]},getTextureParams:function(e,t){var n,r={scale:new u(1,1),offset:new u(0,0)},i=e.split(/\s+/);return(n=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[n+1]),i.splice(n,2)),(n=i.indexOf("-s"))>=0&&(r.scale.set(parseFloat(i[n+1]),parseFloat(i[n+2])),i.splice(n,4)),(n=i.indexOf("-o"))>=0&&(r.offset.set(parseFloat(i[n+1]),parseFloat(i[n+2])),i.splice(n,4)),r.url=i.join(" ").trim(),r},loadTexture:function(e,t,n,r,i){var a,o=void 0!==this.manager?this.manager:bo,s=o.getHandler(e);return null===s&&(s=new Ao(o)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),a=s.load(e,n,r,i),void 0!==t&&(a.mapping=t),a}};var gf=function(e){_o.call(this,e)};gf.prototype=Object.assign(Object.create(_o.prototype),{constructor:gf,load:function(e,t,n,r){var i=this,a=new m,o=new wo(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.setWithCredentials(this.withCredentials),o.load(e,(function(e){a.image=i.parse(e),a.needsUpdate=!0,void 0!==t&&t(a)}),n,r),a},parse:function(e){var t=0,n=1,r=2,i=3,a=9,o=10,s=11,l=48,c=4,u=0,h=1,d=2,f=3;e.length<19&&console.error("THREE.TGALoader: Not enough data to contain header.");var p=new Uint8Array(e),m=0,g={id_length:p[m++],colormap_type:p[m++],image_type:p[m++],colormap_index:p[m++]|p[m++]<<8,colormap_length:p[m++]|p[m++]<<8,colormap_size:p[m++],origin:[p[m++]|p[m++]<<8,p[m++]|p[m++]<<8],width:p[m++]|p[m++]<<8,height:p[m++]|p[m++]<<8,pixel_size:p[m++],flags:p[m++]};!function(e){switch(e.image_type){case n:case a:(e.colormap_length>256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case r:case i:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(g),g.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=g.id_length;var v=!1,y=!1,b=!1;switch(g.image_type){case a:v=!0,y=!0;break;case n:y=!0;break;case o:v=!0;break;case r:break;case s:v=!0,b=!0;break;case i:b=!0}var _="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(g.width,g.height):document.createElement("canvas");_.width=g.width,_.height=g.height;var x=_.getContext("2d"),w=x.createImageData(g.width,g.height),M=function(e,t,n,r,i){var a,o,s,l;if(o=n.pixel_size>>3,s=n.width*n.height*o,t&&(l=i.subarray(r,r+=n.colormap_length*(n.colormap_size>>3))),e){var c,u,h;a=new Uint8Array(s);for(var d=0,f=new Uint8Array(o);d>c){default:case d:a=0,s=1,m=t,o=0,p=1,v=n;break;case u:a=0,s=1,m=t,o=n-1,p=-1,v=-1;break;case f:a=t-1,s=-1,m=-1,o=0,p=1,v=n;break;case h:a=t-1,s=-1,m=-1,o=n-1,p=-1,v=-1}if(b)switch(g.pixel_size){case 8:!function(e,t,n,r,i,a,o,s){var l,c,u,h=0,d=g.width;for(u=t;u!==r;u+=n)for(c=i;c!==o;c+=a,h++)l=s[h],e[4*(c+d*u)+0]=l,e[4*(c+d*u)+1]=l,e[4*(c+d*u)+2]=l,e[4*(c+d*u)+3]=255}(e,o,p,v,a,s,m,r);break;case 16:!function(e,t,n,r,i,a,o,s){var l,c,u=0,h=g.width;for(c=t;c!==r;c+=n)for(l=i;l!==o;l+=a,u+=2)e[4*(l+h*c)+0]=s[u+0],e[4*(l+h*c)+1]=s[u+0],e[4*(l+h*c)+2]=s[u+0],e[4*(l+h*c)+3]=s[u+1]}(e,o,p,v,a,s,m,r);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(g.pixel_size){case 8:!function(e,t,n,r,i,a,o,s,l){var c,u,h,d=l,f=0,p=g.width;for(h=t;h!==r;h+=n)for(u=i;u!==o;u+=a,f++)c=s[f],e[4*(u+p*h)+3]=255,e[4*(u+p*h)+2]=d[3*c+0],e[4*(u+p*h)+1]=d[3*c+1],e[4*(u+p*h)+0]=d[3*c+2]}(e,o,p,v,a,s,m,r,i);break;case 16:!function(e,t,n,r,i,a,o,s){var l,c,u,h=0,d=g.width;for(u=t;u!==r;u+=n)for(c=i;c!==o;c+=a,h+=2)l=s[h+0]+(s[h+1]<<8),e[4*(c+d*u)+0]=(31744&l)>>7,e[4*(c+d*u)+1]=(992&l)>>2,e[4*(c+d*u)+2]=(31&l)>>3,e[4*(c+d*u)+3]=32768&l?0:255}(e,o,p,v,a,s,m,r);break;case 24:!function(e,t,n,r,i,a,o,s){var l,c,u=0,h=g.width;for(c=t;c!==r;c+=n)for(l=i;l!==o;l+=a,u+=3)e[4*(l+h*c)+3]=255,e[4*(l+h*c)+2]=s[u+0],e[4*(l+h*c)+1]=s[u+1],e[4*(l+h*c)+0]=s[u+2]}(e,o,p,v,a,s,m,r);break;case 32:!function(e,t,n,r,i,a,o,s){var l,c,u=0,h=g.width;for(c=t;c!==r;c+=n)for(l=i;l!==o;l+=a,u+=4)e[4*(l+h*c)+2]=s[u+0],e[4*(l+h*c)+1]=s[u+1],e[4*(l+h*c)+0]=s[u+2],e[4*(l+h*c)+3]=s[u+3]}(e,o,p,v,a,s,m,r);break;default:console.error("THREE.TGALoader: Format not supported.")}}(w.data,g.width,g.height,M.pixel_data,M.palettes),x.putImageData(w,0,0),_}});var vf=function(e){_o.call(this,e)};vf.prototype=Object.assign(Object.create(_o.prototype),{constructor:vf,load:function(e,t,n,r){var i=this,a=""===i.path?ps(e):i.path,o=new wo(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(n,a))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)},options:{set convertUpAxis(e){console.warn("THREE.ColladaLoader: options.convertUpAxis() has been removed. Up axis is converted automatically.")}},parse:function(e,t){function n(e,t){for(var n=[],r=e.childNodes,i=0,a=r.length;i0&&t.push(new po(r+".position",i,a)),o.length>0&&t.push(new ho(r+".quaternion",i,o)),s.length>0&&t.push(new po(r+".scale",i,s)),t}function T(e,t,n){var r,i,a,o=!0;for(i=0,a=e.length;i=0;){var r=e[t];if(null!==r.value[n])return r;t--}return null}function C(e,t,n){for(;t>>0));switch(n=n.toLowerCase()){case"tga":t=Ke;break;default:t=$e}return t}(n);if(void 0!==i){var a=i.load(n),o=e.extra;if(void 0!==o&&void 0!==o.technique&&!1===s(o.technique)){var l=o.technique;a.wrapS=l.wrapU?1e3:1001,a.wrapT=l.wrapV?1e3:1001,a.offset.set(l.offsetU||0,l.offsetV||0),a.repeat.set(l.repeatU||1,l.repeatV||1)}else a.wrapS=1e3,a.wrapT=1e3;return a}return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",n),null}return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",e.id),null}n.name=e.name||"";var l=i.parameters;for(var c in l){var u=l[c];switch(c){case"diffuse":u.color&&n.color.fromArray(u.color),u.texture&&(n.map=o(u.texture));break;case"specular":u.color&&n.specular&&n.specular.fromArray(u.color),u.texture&&(n.specularMap=o(u.texture));break;case"bump":u.texture&&(n.normalMap=o(u.texture));break;case"ambient":u.texture&&(n.lightMap=o(u.texture));break;case"shininess":u.float&&n.shininess&&(n.shininess=u.float);break;case"emission":u.color&&n.emissive&&n.emissive.fromArray(u.color),u.texture&&(n.emissiveMap=o(u.texture))}}var h=l.transparent,d=l.transparency;if(void 0===d&&h&&(d={float:1}),void 0===h&&d&&(h={opaque:"A_ONE",data:{color:[1,1,1,1]}}),h&&d)if(h.data.texture)n.transparent=!0;else{var p=h.data.color;switch(h.opaque){case"A_ONE":n.opacity=p[3]*d.float;break;case"RGB_ZERO":n.opacity=1-p[0]*d.float;break;case"A_ZERO":n.opacity=1-p[3]*d.float;break;case"RGB_ONE":n.opacity=p[0]*d.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',h.opaque)}n.opacity<1&&(n.transparent=!0)}return void 0!==a&&void 0!==a.technique&&1===a.technique.double_sided&&(n.side=2),n}function Q(e){return f(it.materials[e],K)}function $(e){for(var t=0;t0?l+u:l;t.inputs[h]={id:s,offset:c},t.stride=Math.max(t.stride,c+1),"TEXCOORD"===l&&(t.hasUV=!0);break;case"vcount":t.vcount=a(i.textContent);break;case"p":t.p=a(i.textContent)}}return t}function de(e){for(var t=0,n=0,r=e.length;n0&&t0&&f.setAttribute("position",new rt(i.array,i.stride)),a.array.length>0&&f.setAttribute("normal",new rt(a.array,a.stride)),l.array.length>0&&f.setAttribute("color",new rt(l.array,l.stride)),o.array.length>0&&f.setAttribute("uv",new rt(o.array,o.stride)),s.array.length>0&&f.setAttribute("uv2",new rt(s.array,s.stride)),c.length>0&&f.setAttribute("skinIndex",new rt(c,u)),h.length>0&&f.setAttribute("skinWeight",new rt(h,d)),r.data=f,r.type=e[0].type,r.materialKeys=p,r}function me(e,t,n,r){var i=e.p,a=e.stride,o=e.vcount;function s(e){for(var t=i[e+n]*c,a=t+c;t4)for(var v=1,y=f-2;v<=y;v++){p=u+a*v,m=u+a*(v+1);s(u+0*a),s(p),s(m)}u+=a*f}else for(h=0,d=i.length;h=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function xe(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},n=0;nr.limits.max||t0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]i?e.rotation[i]:e.rotation[e.rotation.length-1]:e.rotation,d=h.order||"YXZ";3!=d.length&&(console.warn('Lithosphere: Warning - Model Layer "'+e.name+"\" has an invalid rotation.order. Defaulting back to 'YXZ'"),d="YXZ"),a.rotation.order=d,d.split("").forEach((function(t){switch(t){case"X":a.rotateX(h.x||0);break;case"Y":a.rotateY(-h.y||0);break;case"Z":a.rotateZ(h.z||0);break;default:console.warn('Lithosphere: Warning - Model Layer "'+e.name+'" has an invalid rotation.order axis: '+t+". Must be one of X, Y, Z")}}))}if(null!=e.scale){var f=e.scale[i]||e.scale||1;a.scale.set(f||1,f||1,f||1)}r.add(a)},a=0;ae&&(e=t.tile[n].maxZoom);return e},this.findLowestMinZoom=function(){var e=1/0;for(var n in t.tile)t.tile[n].on&&t.tile[n].minZoom","
N
","","","","","","","","","
",""].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_compass_azimuth").addEventListener("mouseenter",(function(e){e.target.style.opacity="1"})),document.getElementById("_lithosphere_control_compass_azimuth").addEventListener("mouseleave",(function(e){e.target.style.opacity="0"}))},this.onUpdate=function(){n.setDirection()},this.setDirection=function(){var e,t,r,i=n.p._.cameras.isFirstPerson?n.p._.cameras.firstPerson:n.p._.cameras.orbit;if(null!=i){if(n.p._.cameras.isFirstPerson)t=-(i.controls.getObject().rotation.y%(2*Math.PI)+Math.PI)*(180/Math.PI);else{var a=i.camera.position.x,o=i.camera.position.z;t=Math.atan2(a,o)*(180/Math.PI)}r=i.camera.fov}e=function(e,t,n,r,i){var a=Cf(e,t,n,i),o=Cf(e,t,n,r),s=i-r<=180?"0":"1";return["M",a.x,a.y,"A",n,n,0,s,0,o.x,o.y,"L",e,t].join(" ")}(20,20,20,t-r/2,t+r/2),document.getElementById("_lithosphere_control_compass_arc").setAttribute("d",e),t<0&&(t+=360),document.getElementById("_lithosphere_control_compass_azimuth").innerHTML=parseInt(t)+" °"},this.p=e,this.name=t,this._={},this.corner="BottomLeft"};function Cf(e,t,n,r){var i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}var Af=function(e,t,n){var r=this;this.getControl=function(){var e=(null!=r.params.existingDivId?"display: none; ":"")+"background: black; padding: 5px; font-size: 14px;";return["
","
"].join("")},this.attachEvents=function(){},this.onUpdate=function(){(r.p._.mouseIsInScene||r.p._.cameras.isFirstPerson)&&r.updateMouseCoords()},this.updateMouseCoords=function(){var e="Outer Space";null!=r.p.mouse.lat&&null!=r.p.mouse.lng&&(e=r.p.mouse.lng.toFixed(8)+"°, "+r.p.mouse.lat.toFixed(8)+"°, "+r.p.mouse.elev.toFixed(3)+"m");var t=document.getElementById("_lithosphere_control_coordinate_root");if(t&&t.innerHTML!=e&&(t.innerHTML=e),null!=r.params.existingDivId){var n=document.getElementById(r.params.existingDivId);n&&n.innerHTML!=e&&(n.innerHTML=e)}},this.p=e,this.name=t,this.params=n||{},this._={},this.corner="BottomRight"},Pf=function(e,t){var n=this;this.getControl=function(){return["
",'','',"","
"].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_home_root").addEventListener("click",(function(){n.p.setCenter(n.p.options.initialView,null,!0)}))},this.p=e,this.name=t,this._={},this.corner="TopLeft"},Lf=function(e,t){var n=this;this.getControl=function(){return["
",'
',n.getInactiveContent(),"
","",n.getActiveContent(),"","
"].join("")},this.attachEvents=function(){document.getElementById(n.id).addEventListener("mouseenter",(function(){document.getElementById(n.id+"_active").innerHTML=n.getActiveContent(),n.attachEventsInternal(),document.getElementById(n.id+"_active").style.pointerEvents="all",document.getElementById(n.id+"_active").style.opacity="1"})),document.getElementById(n.id+"_active").addEventListener("mouseleave",(function(){document.getElementById(n.id+"_active").style.pointerEvents="none",document.getElementById(n.id+"_active").style.opacity="0"}))},this.getInactiveContent=function(){return['','',""].join("")},this.getActiveContent=function(){var e=[];for(var t in n.p.layers.all)if(n.p.layers.all[t].length>0){for(var r=[],i=0,a=n.p.layers.all[t];i','
','',''+o.name+"","
",'
','',"
",""].join(""))}e.push(['
','
'+t+"
",'
    ',r.join(""),"
","
"].join(""))}return['
',e.join(""),"
"].join("")},this.attachEventsInternal=function(){for(var e=function(e){e.addEventListener("click",(function(t){n.p.toggleLayer(e.getAttribute("layer-name"))}))},t=0,r=document.getElementsByClassName(n.id+"_toggle");t",n.getInactiveContent(),"",n.getActiveContent(),"",""].join("")},this.attachEvents=function(){document.getElementById(n.id).addEventListener("mouseenter",(function(){document.getElementById(n.id+"_active").style.pointerEvents="all",document.getElementById(n.id+"_active").style.opacity="1"})),document.getElementById(n.id+"_active").addEventListener("mouseleave",(function(){document.getElementById(n.id+"_active").style.pointerEvents="none",document.getElementById(n.id+"_active").style.opacity="0"}));for(var e=document.getElementsByClassName(n.id+"_option"),t=function(t){e[t].addEventListener("click",(function(){for(var r=parseFloat(e[t].getAttribute("value")),i=0;i','','',"",""].join("")},this.getActiveContent=function(){return['
',n.getInactiveContent(),'
','
1x
','
2x
','
5x
',"
","
"].join("")},this.setExaggeration=function(e){n.p.options.exaggeration=e,n.p._.tiledWorld.removeAllTiles()},this.id="_lithosphere_control_exaggerate_root",this.p=e,this.name=t,this._={},this.corner="TopLeft",this.exaggeration=1},Of=function(e,t){var n=this;this.getControl=function(){return["
",n.getInactiveContent(),"",n.getActiveContent(),"","
"].join("")},this.getInactiveContent=function(){return["
",'','',"","
"].join("")},this.getActiveContent=function(){var e=n.p.getCenter();return['
',n.getInactiveContent(),'
',"
","
    ","
  • ","
    Field of View
    ","","
    °
    ","","
  • ","
  • ","
    Vertical FOV
    ","","
    °
    ","
  • ","
  • ","
    Focal Length
    ","","
    m
    m
    ","
  • ","
  • ","
    Azimuth
    ","","
    °
    ","
  • ","
  • ","
    Elevation
    ","","
    °
    ","
  • ","
  • ","
    Height
    ","","
    m
    ","
  • ","
  • ","
    Latitude
    ","","
    °
    ","
  • ","
  • ","
    Longitude
    ","","
    °
    ","
  • ","
","
","","
Observe
","
","
","
","
"].join("")},this.attachEvents=function(){document.getElementById(n.id).addEventListener("mouseenter",(function(){document.getElementById(n.id+"_active").style.pointerEvents="all",document.getElementById(n.id+"_active").style.opacity="1"})),document.getElementById(n.id+"_active").addEventListener("mouseleave",(function(){document.getElementById(n.id+"_active").style.pointerEvents="none",document.getElementById(n.id+"_active").style.opacity="0"})),document.getElementById("_lithosphere_WalkStand").addEventListener("click",(function(){n.setCamera(!0),n.toggleFOVOverlay(!0);var e=n.getObserverValues();n.updateFOVOverlayBounds(e.vfieldofview,e.elevation,e.fieldofview,e.azimuth),document.addEventListener("keydown",n.keydownObserverSettings);try{n.p.controls.controlContainer.removeChild(n.helpDiv)}catch(e){}var t=["
W
Up
","
A
Left
","
S
Down
","
D
Right
","
R
Higher
","
F
Lower
","
T
FOV +
","
G
FOV -
","
Y
vFOV +
","
H
vFOV -
","
SHIFT+
Fast
","
ESC
Quit
"].join("\n");n.helpDiv=document.createElement("div"),n.helpDiv.id="_lithosphere_control_walk_help",n.helpDiv.style="position: absolute; bottom: 47px; right: 15px; background: black; font-size: 13px;",n.helpDiv.innerHTML=t,n.p.controls.controlContainer.appendChild(n.helpDiv)}))},this.setCamera=function(e,t){var r=n.getObserverValues();n.p.setCenter({lat:r.latitude,lng:r.longitude,zoom:n.p.zoom},!0),n.p._.cameras.setFirstPersonHeight(r.height),n.p._.cameras.setCameraAzimuthElevation(r.azimuth,r.elevation,!0),n.p._.cameras.setFirstPersonFocalLength(r.focallength),n.p._.cameras.setFirstPersonFOV(Math.max(r.vfieldofview,60)),n.p._.cameras.swap(e,t),"onpointerlockchange"in document?document.addEventListener("pointerlockchange",n.leaveObserver,!1):"onmozpointerlockchange"in document&&document.addEventListener("mozpointerlockchange",n.leaveObserver,!1)},this.leaveObserver=function(){if(document.pointerLockElement===document.body||document.mozPointerLockElement===document.body);else try{n.p.controls.controlContainer.removeChild(n.helpDiv),n.toggleFOVOverlay(!1),document.removeEventListener("keydown",n.keydownObserverSettings)}catch(e){}},this.getObserverValues=function(){return{fieldofview:parseFloat(document.getElementById("_lithosphere_WalkSettingsFovValue").value)||60,fieldofviewRaw:parseFloat(document.getElementById("_lithosphere_WalkSettingsFovValueRaw").value)||60,vfieldofview:parseFloat(document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value)||60,focallength:parseFloat(document.getElementById("_lithosphere_WalkSettingsFocalLengthValue").value)||35,azimuth:parseFloat(document.getElementById("_lithosphere_WalkSettingsAzimuthValue").value)||0,elevation:parseFloat(document.getElementById("_lithosphere_WalkSettingsElevationValue").value)||0,height:parseFloat(document.getElementById("_lithosphere_WalkSettingsHeightValue").value)||3,latitude:parseFloat(document.getElementById("_lithosphere_WalkSettingsLatitudeValue").value)||n.p.getCenter().lat||0,longitude:parseFloat(document.getElementById("_lithosphere_WalkSettingsLongitudeValue").value)||n.p.getCenter().lon||0}},this.keydownObserverSettings=function(e){var t=n.getObserverValues();84===e.which?document.getElementById("_lithosphere_WalkSettingsFovValue").value=+(t.fieldofview+(e.shiftKey?1:.2)).toFixed(4):71===e.which?document.getElementById("_lithosphere_WalkSettingsFovValue").value=+(t.fieldofview-(e.shiftKey?1:.2)).toFixed(4):89===e.which?document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value=+(t.vfieldofview+(e.shiftKey?1:.2)).toFixed(4):72===e.which?document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value=+(t.vfieldofview-(e.shiftKey?1:.2)).toFixed(4):68===e.which?document.getElementById("_lithosphere_WalkSettingsAzimuthValue").value=+(t.azimuth+(e.shiftKey?1:.2)).toFixed(4):65===e.which?document.getElementById("_lithosphere_WalkSettingsAzimuthValue").value=+(t.azimuth-(e.shiftKey?1:.2)).toFixed(4):87===e.which?document.getElementById("_lithosphere_WalkSettingsElevationValue").value=+(t.elevation+(e.shiftKey?1:.2)).toFixed(4):83===e.which?document.getElementById("_lithosphere_WalkSettingsElevationValue").value=+(t.elevation-(e.shiftKey?1:.2)).toFixed(4):82===e.which?document.getElementById("_lithosphere_WalkSettingsHeightValue").value=+(t.height+(e.shiftKey?1:.2)).toFixed(4):70===e.which&&(document.getElementById("_lithosphere_WalkSettingsHeightValue").value=+(t.height-(e.shiftKey?1:.2)).toFixed(4));var r=n.getObserverValues();n.p._.cameras.setFirstPersonHeight(r.height),n.p._.cameras.setCameraAzimuthElevation(r.azimuth,r.elevation,!0),r.vfieldofview!==t.vfieldofview?(n.p._.cameras.setFirstPersonFOV(Math.max(r.vfieldofview,60)),document.getElementById("_lithosphere_WalkSettingsFocalLengthValue").value=+n.p._.cameras.getFirstPersonFocalLength().toFixed(4)):r.focallength!==t.focallength&&(n.p._.cameras.setFirstPersonFocalLength(r.focallength),document.getElementById("_lithosphere_WalkSettingsFovValue").value=+n.p._.cameras.getFirstPersonFOV().toFixed(4)),n.updateFOVOverlayBounds(r.vfieldofview,r.elevation,r.fieldofview,r.azimuth)},this.toggleFOVOverlay=function(e){var t=document.getElementById("_lithosphere_WalkFOVOverlay");if(e){if(null==t){var r=document.createElement("div");r.id="_lithosphere_WalkFOVOverlay",r.style=["position: absolute","left: 0","top: 0","width: 100%","height: 100%","pointer-events: none"].join(";"),r.innerHTML=["
","
","
","
","
","
","
","
"].join("\n"),n.p.getContainer().appendChild(r)}}else null!=t&&n.p.getContainer().removeChild(t)},this.updateFOVOverlayBounds=function(e,t,r,i){e=document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value;var a=n.p._.cameras.getFirstPersonFOV(),o=n.p.getContainer().getBoundingClientRect(),s=o.height*(e/a),l=(o.height/2-s/2)/o.height*100,c=(o.height/2+s/2)/o.height*100,u=o.height/a*r,h=(o.width/2-u/2)/o.width*100,d=(o.width/2+u/2)/o.width*100,f=document.getElementById("_lithosphere_Walk_NW");f.style.top="0%",f.style.height=l+"%",f.style.left="0%",f.style.width=h+"%";var p=document.getElementById("_lithosphere_Walk_N");p.style.top="0%",p.style.height=l+"%",p.style.left=h+"%",p.style.width=d-h+"%";var m=document.getElementById("_lithosphere_Walk_NE");m.style.top="0%",m.style.height=l+"%",m.style.left=d+"%",m.style.width=100-d+"%";var g=document.getElementById("_lithosphere_Walk_E");g.style.top=l+"%",g.style.height=c-l+"%",g.style.left=d+"%",g.style.width=100-d+"%";var v=document.getElementById("_lithosphere_Walk_SE");v.style.top=c+"%",v.style.height=100-c+"%",v.style.left=d+"%",v.style.width=100-d+"%";var y=document.getElementById("_lithosphere_Walk_S");y.style.top=c+"%",y.style.height=100-c+"%",y.style.left=h+"%",y.style.width=d-h+"%";var b=document.getElementById("_lithosphere_Walk_SW");b.style.top=c+"%",b.style.height=100-c+"%",b.style.left="0%",b.style.width=h+"%";var _=document.getElementById("_lithosphere_Walk_W");_.style.top=l+"%",_.style.height=c-l+"%",_.style.left="0%",_.style.width=h+"%"},this.p=e,this.name=t,this.id="_lithosphere_control_observe_root",this._={},this.corner="TopLeft"},kf=function(e,t){var n=this;this.getControl=function(){return["
",'','',"","
"].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_walk_root").addEventListener("click",(function(){n.setCamera(!1);try{n.p.controls.controlContainer.removeChild(n.helpDiv)}catch(e){}var e=["
W
Forward
","
A
Left
","
S
Back
","
D
Right
","
SHIFT+
Fast
","
ESC
Quit
"].join("\n");n.helpDiv=document.createElement("div"),n.helpDiv.id="_lithosphere_control_walk_help",n.helpDiv.style="position: absolute; bottom: 47px; right: 15px; background: black; font-size: 13px;",n.helpDiv.innerHTML=e,n.p.controls.controlContainer.appendChild(n.helpDiv)}))},this.setCamera=function(e,t){n.p._.cameras.swap(e,t),"onpointerlockchange"in document?document.addEventListener("pointerlockchange",n.leaveWalking,!1):"onmozpointerlockchange"in document&&document.addEventListener("mozpointerlockchange",n.leaveWalking,!1)},this.leaveWalking=function(){if(document.pointerLockElement===document.body||document.mozPointerLockElement===document.body);else try{n.p.controls.controlContainer.removeChild(n.helpDiv)}catch(e){}},this.p=e,this.name=t,this.helpDiv=null,this._={},this.corner="TopLeft"},If=function(e,t,n){var r=this;this.getControl=function(){return[""].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_link_root").addEventListener("click",(function(){r.return.isLinked=!r.return.isLinked;var e=document.getElementById("_lithosphere_control_link_root");r.return.isLinked?(e.style.background="#FBC02D",e.style.color="black"):(e.style.background="black",e.style.color="white"),"function"==typeof r.params.onToggle&&r.params.onToggle(r.return.isLinked)}))},this.getReturn=function(){return r.return},this.onMove=function(e,t,n){r.return.isLinked&&"function"==typeof r.params.onMove&&(r._.linkPanned=!0,r.params.onMove(e,t,n),clearTimeout(r._.linkPannedTimeout),r._.linkPannedTimeout=setTimeout((function(){r._.linkPanned=!1}),500))},this.onMouseMove=function(e,t,n){r.return.isLinked&&"function"==typeof r.params.onMouseMove&&r.params.onMouseMove(e,t,n)},this.onMouseOut=function(){r.return.isLinked&&"function"==typeof r.params.onMouseOut&&r.params.onMouseOut()},this.onFirstPersonUpdate=function(){"function"==typeof r.params.onFirstPersonUpdate&&r.params.onFirstPersonUpdate()},this.onOrbitalUpdate=function(){"function"==typeof r.params.onOrbitalUpdate&&r.params.onOrbitalUpdate()},this.setLink=function(e,t,n){if(r.p._.wasInitialized&&(null!=r._.targetPoint&&r.p.frontGroup.remove(r._.targetPoint),null!=e)){var i=new mt,a=new Ve({color:65280});r._.targetPoint=new kt(i,a);var o=r.p.getElevationAtLngLat(e.lng,e.lat);if(0!=o){var s=r.p.projection.lonLatToVector3(e.lng,e.lat,(o+.4)*r.p.options.exaggeration);t=t||{radius:8,fillColor:{r:0,g:255,b:0,a:.7},weight:2,color:"rgb(0,255,0)"},null==n&&(n="linkTargetPoint");var l=df.makeMarkerSprite(t,n);l.style=t,r._.targetPoint.attenuate=!0,r._.targetPoint.position.set(s.x,s.y,s.z),r._.targetPoint.add(l),r.p.frontGroup.add(r._.targetPoint),r.p._.events._attenuate(),r.p._.events._refreshFrontGroupRotation()}}},this.linkMove=function(e,t){r.return.isLinked&&!r._.linkPanned&&r.p.setCenter({lat:t,lng:e,z:0},!0)},this.linkMouseMove=function(e,t){r.return.isLinked&&r.setLink({lat:t,lng:e})},this.linkMouseOut=function(){r.setLink()},this.p=e,this.name=t,this.params=n||{},this._={linkPanned:!1,linkPannedTimeout:null},this.corner="TopLeft",this.return={isLinked:this.params.initiallyLinked||!1,linkMove:this.linkMove,linkMouseMove:this.linkMouseMove,linkMouseOut:this.linkMouseOut}},Nf=function(e){var t=this;this.addControl=function(e,n,r,i){if(null==t.activeControls[e]){try{t.activeControls[e]=new n(t.p,e,r)}catch(n){return null!=t.activeControls[e]&&delete t.activeControls[e],void console.warn("Error adding UI Element with name '"+e+"' -",n)}i=i||t.activeControls[e].corner||"TopLeft";var a=document.createElement("div");return a.setAttribute("id","_lithosphere_control_"+e),a.innerHTML=t.activeControls[e].getControl(),a.style.marginRight="5px","TopLeft"!==i&&"TopRight"!==i||(a.style.marginBottom="5px"),t.corners[i].appendChild(a),t.activeControls[e].attachEvents(),t.activeControls[e].getReturn?t.activeControls[e].getReturn():void 0}console.warn("UI Control control with identifying name '"+e+"' already exists. Remove the existing one or pick a different name to add this control.")},this.removeControl=function(e){delete t.activeControls[e],document.getElementById("_lithosphere_control_"+e).remove()},this._onUpdateEvent=function(){Object.values(t.activeControls).forEach((function(e){"function"==typeof e.onUpdate&&e.onUpdate()}))},this._onMove=function(e,n,r){Object.values(t.activeControls).forEach((function(t){"function"==typeof t.onMove&&t.onMove(e,n,r)}))},this._onMouseMove=function(e,n,r){Object.values(t.activeControls).forEach((function(t){"function"==typeof t.onMouseMove&&t.onMouseMove(e,n,r)}))},this._onMouseOut=function(e){Object.values(t.activeControls).forEach((function(t){"function"==typeof t.onMouseOut&&t.onMouseOut(e)}))},this._onFirstPersonUpdate=function(){Object.values(t.activeControls).forEach((function(e){"function"==typeof e.onFirstPersonUpdate&&e.onFirstPersonUpdate()}))},this._onOrbitalUpdate=function(e){Object.values(t.activeControls).forEach((function(t){"function"==typeof t.onOrbitalUpdate&&t.onOrbitalUpdate(e)}))},this.p=e,this.activeControls={},this.controlContainer=document.createElement("div"),this.controlContainer.setAttribute("id","_lithosphere_controls"),this.controlContainer.style.position="absolute",this.controlContainer.style.top="0",this.controlContainer.style.left="0",this.controlContainer.style.width="100%",this.controlContainer.style.height="100%",this.controlContainer.style.pointerEvents="none",this.controlContainer.style.color="white",this.controlContainer.style.fontFamily="sans-serif",this.controlContainer.style.zIndex="1000",this.p._.container.appendChild(this.controlContainer),this.corners={TopLeft:null,TopRight:null,BottomLeft:null,BottomRight:null},this.corners.TopLeft=document.createElement("div"),this.corners.TopLeft.setAttribute("id","_lithosphere_controls_topleft"),this.corners.TopLeft.style.position="absolute",this.corners.TopLeft.style.top="10px",this.corners.TopLeft.style.left="10px",this.corners.TopLeft.style.pointerEvents="all",this.corners.TopLeft.style.display="flex",this.corners.TopLeft.style.flexFlow="column",this.controlContainer.appendChild(this.corners.TopLeft),this.corners.TopRight=document.createElement("div"),this.corners.TopRight.setAttribute("id","_lithosphere_controls_topright"),this.corners.TopRight.style.position="absolute",this.corners.TopRight.style.top="10px",this.corners.TopRight.style.right="10px",this.corners.TopRight.style.pointerEvents="all",this.corners.TopRight.style.display="flex",this.controlContainer.appendChild(this.corners.TopRight),this.corners.BottomLeft=document.createElement("div"),this.corners.BottomLeft.setAttribute("id","_lithosphere_controls_bottomleft"),this.corners.BottomLeft.style.position="absolute",this.corners.BottomLeft.style.bottom="10px",this.corners.BottomLeft.style.left="10px",this.corners.BottomLeft.style.pointerEvents="all",this.corners.BottomLeft.style.display="flex",this.controlContainer.appendChild(this.corners.BottomLeft),this.corners.BottomRight=document.createElement("div"),this.corners.BottomRight.setAttribute("id","_lithosphere_controls_bottomright"),this.corners.BottomRight.style.position="absolute",this.corners.BottomRight.style.bottom="10px",this.corners.BottomRight.style.right="10px",this.corners.BottomRight.style.pointerEvents="all",this.corners.BottomRight.style.display="flex",this.controlContainer.appendChild(this.corners.BottomRight),this.compass=Ef,this.coordinates=Af,this.home=Pf,this.layers=Lf,this.exaggerate=Rf,this.observe=Of,this.walk=kf,this.link=If},Df=(n(11),function(e){var t=this;this.end=function(e){!1!==t.p.options.loadingScreen&&t.loadingContainer&&(t.loadingContainer.style.opacity="0",t.p._.sceneContainer.style.filter="blur(0px) brightness(1)",setTimeout((function(){t.loadingContainer.remove(),t.loadingContainer=null,t.p._.sceneContainer.style.filter=null,t.p._.sceneContainer.style.transition=null}),500))},this.p=e,!1!==this.p.options.loadingScreen&&(this.loadingContainer=document.createElement("div"),this.loadingContainer.setAttribute("id","_lithosphere_loadingscreen"),this.loadingContainer.style.position="absolute",this.loadingContainer.style.top="0",this.loadingContainer.style.left="0",this.loadingContainer.style.width="100%",this.loadingContainer.style.height="100%",this.loadingContainer.style.background="black",this.loadingContainer.style.color="white",this.loadingContainer.style.fontFamily="sans-serif",this.loadingContainer.style.zIndex="9001",this.loadingContainer.style.opacity="1",this.loadingContainer.style.transition="opacity 0.5s ease-in",this.loadingContainer.innerHTML=["
","
","
","
","
","
","
","
"].join("\n"),this.p._.container.appendChild(this.loadingContainer),this.p._.sceneContainer.style.filter="blur(10px) brightness(0.5)",this.p._.sceneContainer.style.transition="filter 0.5s ease-in-out")}),jf=function(){return(jf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?(i[0].point.y+=n.planetCenter.y,i[0].point):new _(0,0,0)}var a={x:n.planetCenter.x,y:n.planetCenter.y,z:n.planetCenter.z};return a=n.projection.rotatePoint3D(a,{x:-n.planet.rotation.x,y:0,z:0}),a=n.projection.rotatePoint3D(a,{x:0,y:-n.planet.rotation.y,z:0}),a=n.projection.rotatePoint3D(a,{x:0,y:0,z:-n.planet.rotation.z}),new _(a.x,a.y,a.z)},this.getCenter=function(e){var t=n.getCenterXYZ(e);if(e){var r=JSON.parse(JSON.stringify(t));return r=n.projection.rotatePoint3D(r,{x:-n.planet.rotation.x,y:0,z:0}),r=n.projection.rotatePoint3D(r,{x:0,y:-n.planet.rotation.y,z:0}),r=n.projection.rotatePoint3D(r,{x:0,y:0,z:-n.planet.rotation.z}),(r=n.projection.vector3ToLatLng(r)).height=t.length()*n.projection.radiusScale-n.projection.radii.major,r}return n.projection.vector3ToLatLng(t)},this.getCenterElevation=function(){return n.getCenterXYZ(!0).length()*n.projection.radiusScale-n.projection.radii.major},this.getCenterElevationRaw=function(){var e=n.getCenterXYZ(!0).length();if(!(e<=.1&&e>=-.1))return e},this.getElevationAtLngLat=function(e,t){var r=n.projection.lonLatToVector3(e,t,1e5*n.options.exaggeration),i=new be;i.position.set(0,-n.planetCenter.y,0),i.rotation.set(n.planet.rotation.x,n.planet.rotation.y,n.planet.rotation.z);var a=new kt(new Ha(200,32,32),new Ve({color:16776960}));a.position.set(r.x,r.y,r.z),i.add(a),i.updateMatrixWorld();var o=new _;o.setFromMatrixPosition(a.matrixWorld),n._.raycaster.set(o,new _(0,-n.planetCenter.y,0).normalize());for(var s=[],l=0;l0?(c[c.length-1].point.y+=n.planetCenter.y,c[c.length-1].point.length()*n.projection.radiusScale-n.projection.radii.major):0},this.getCenterTile=function(){var e=n.getCenter();return n.projection.latLngZ2TileXYZ(e.lat,e.lng,n.zoom)},this.getCameras=function(){return{camera:n._.cameras.camera,isFirstPerson:n._.cameras.isFirstPerson,firstPerson:n._.cameras.firstPerson,orbit:n._.cameras.orbit}},this.getContainer=function(){return n._.container},this.invalidateSize=function(){n._.wasInitialized&&(n._.renderer.setSize(n._.sceneContainer.offsetWidth,n._.sceneContainer.offsetHeight),n._.cameras.updateSize())};var r=document.getElementById(e).appendChild(document.createElement("div"));r.id="_lithosphere_scene",r.style.width="100%",r.style.height="100%",this._={containerId:e,container:document.getElementById(e),sceneContainer:r,wasInitialized:!1,rendererWrapper:null,renderer:null,cameras:null,cameraPositionTarget:null,tiledWorld:null,events:null,maxZoom:0,minNativeZoom:0,loader:new Ao,raycaster:new Xs,updateEveryNthRender:1,counters:{update:0,frame:0},lastCameraWasFirst:!1,firstUpdate:!0,firstLoad:!1,loadingScreen:null,renderOnlyWhenOpen:!0,zCutOff:3,firstViewOverride:null,mouseIsInScene:!1,marsRadius:3396190},this._.container.style.position="relative",this.scene=new ii,this.scenesLOD=[new ii,new ii,new ii],this.sceneBack=new ii,this.sceneFront=new ii,this.planet=new be,this.planetsLOD=[new be,new be,new be],this.frontGroup=new be;t=t||{},this.options=jf(jf({},{loadingScreen:!0,tileMapResource:null,customParsers:{},radiusOfTiles:4,useLOD:!0,LOD:[{radiusOfTiles:4,zoomsUp:3},{radiusOfTiles:2,zoomsUp:7},{radiusOfTiles:2,zoomsUp:11}],tileResolution:32,trueTileResolution:256,showAxes:!1,wireframeMode:!1,exaggeration:1,renderOnlyWhenOpen:!0,targetYOffset:0,highlightColor:"yellow",activeColor:"red"}),t),this._init()}return e.prototype._init=function(){if(this._.rendererWrapper=new pl(this._.sceneContainer),this._.renderer=this._.rendererWrapper.renderer,!this._.renderer)return!1;if(this._.wasInitialized=!0,this.projection=new gh(this.options.majorRadius,this.options.minorRadius,this.options.tileMapResource,this.options.trueTileResolution),this._.cameras=new bl(this._.container,this._.sceneContainer,this.scene,this.projection),this.layers=new Tf(this),this.addLayer=this.layers.addLayer,this.removeLayer=this.layers.removeLayer,this.toggleLayer=this.layers.toggleLayer,this.setLayerOpacity=this.layers.setLayerOpacity,this.getLayerByName=this.layers.getLayerByName,this.hasLayer=this.layers.hasLayer,this._.tiledWorld=new Dh(this),this.zoom=10,this.trueZoom=this.zoom,this.mouse={lat:null,lng:null,elev:null},this.planetCenter=new _(0,-this.projection.radii.major/this.projection.radiusScale,0),this.planet.position.set(this.planetCenter.x,-this.planetCenter.y,this.planetCenter.z),this.scene.add(this.planet),this.scenesLOD[0].add(this.planetsLOD[0]),this.scenesLOD[1].add(this.planetsLOD[1]),this.scenesLOD[2].add(this.planetsLOD[2]),this.frontGroup.position.set(this.planetCenter.x,-this.planetCenter.y,this.planetCenter.z),this.sceneFront.add(this.frontGroup),this.scene.add(new ls(16711422)),this.options.starsphere){var e=new Ha(1e3*this.planetCenter.y,64,64),t=new Ve({color:this.options.starsphere.color||11184810});this.options.starsphere.url&&(t.map=this._.loader.load(this.options.starsphere.url)),t.opacity=1,this.starsphere=new kt(e,t),this.sceneBack.add(this.starsphere)}if(this.options.atmosphere&&(this.atmosphere=new kt(new Ha(1.5*this.planetCenter.y,128,128),vh.atmosphere(this.options.atmosphere.color)),this.sceneBack.add(this.atmosphere)),!0===this.options.showAxes){var n=new Hi({color:16711680}),r=new Yi((new mt).setFromPoints([new _(0,0,0),new _(2*this.planetCenter.y,0,0)]),n);this.scene.add(r);var i=new Hi({color:65280}),a=new Yi((new mt).setFromPoints([new _(0,0,0),new _(0,2*this.planetCenter.y,0)]),i);this.scene.add(a);var o=new Hi({color:255}),s=new Yi((new mt).setFromPoints([new _(0,0,0),new _(0,0,2*this.planetCenter.y)]),o);this.scene.add(s)}return this.controls=new Nf(this),this.addControl=this.controls.addControl,this.removeControl=this.controls.removeControl,!1===this.options.renderOnlyWhenOpen&&(this._.renderOnlyWhenOpen=!1),this._.loadingScreen=new Df(this),this._.events=new id(this),this.setCenter(this.options.initialView),this._animate(),!0},e.prototype._render=function(){if(this._.renderer.clear(),this._.renderOnlyWhenOpen){var e=this._.container.getBoundingClientRect();if(e.width<=0||e.height<=0)return}this._.counters.update=(this._.counters.update+1)%this._.updateEveryNthRender,0===this._.counters.update&&this._update(),this._.cameras.isFirstPerson||this._.cameras.orbit.controls.update(),this.layers.tile3d.forEach((function(e){e.renderer.update()})),this._.renderer.render(this.sceneBack,this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scenesLOD[2],this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scenesLOD[1],this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scenesLOD[0],this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scene,this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.sceneFront,this._.cameras.camera)},e.prototype._update=function(){if(this._.wasInitialized){if(this._.renderOnlyWhenOpen){var e=this._.container.getBoundingClientRect();if(e.width<=0||e.height<=0)return}if(this._.counters.frame=(this._.counters.frame+1)%4,this.scene.rotation.x=0,this.scene.position.y=0,this._.firstUpdate||this._.tiledWorld.refreshTiles(),this._.events._checkDesiredZoom(),this.controls._onUpdateEvent(),this._.cameras.isFirstPerson){this._.lastCameraWasFirst=!0,this._.cameras.firstPerson.controls.getObject().position.y=this._.cameras.orbit.controls.target.y-this._.cameras.firstPerson.height/this.projection.radiusScale;var t=this._.cameras.update();this._.events._rotateGlobe(t),this._.events._onMouseMove(),this.controls._onFirstPersonUpdate()}else this._.lastCameraWasFirst&&(this._.lastCameraWasFirst=!1,this.controls._onOrbitalUpdate());if(this._.firstUpdate){null!=this._.firstViewOverride?this.setCenter(this._.firstViewOverride):this.setCenter(this.options.initialView,!0);var n=this._.cameras.orbit,r=n.camera,i=n.controls,a=r.position,o=i.target;this._.cameraPositionTarget=[a.x,a.y,a.z,o.x,o.y,o.z],this._.firstUpdate=!1}}},e}();t.default=Ff}])})); \ No newline at end of file