From 0a7f4faea5499c56d2ab02f1e78ce22410ac74e7 Mon Sep 17 00:00:00 2001 From: Tariq Soliman Date: Mon, 23 May 2022 17:13:32 -0700 Subject: [PATCH] v1.5.0 (#45) * v1.3.0 (#24) * Update README.md * Added boundingBoxEN option to tile layerer (#30) Co-authored-by: Tom Cannon * #1 Add Navigation Control (#31) * Bump v1.4.0 * Add initialCamera option (#33) * Update * #35 Ability to reorder clamped and tile layers after they've been created (#40) * Update (#36) * orderLayers * v1.4.2 * #37 Support larger radius (#43) * #37 Passably poor fix for radiusScale * #37 FarPlane support * #42 Annotations (#44) * #42 Annotations and visibility cutoffs * Bump v1.5.0 Co-authored-by: Thomas Cannon Co-authored-by: Tom Cannon --- .gitattributes | 2 + CHANGELOG.md | 25 +++ README.md | 3 +- dist/lithosphere.js | 22 +- dist/src/core/cameras.d.ts | 2 +- dist/src/core/events.d.ts | 9 +- dist/src/core/projection.d.ts | 3 +- dist/src/layers/clamped.d.ts | 1 + dist/src/layers/index.d.ts | 6 +- dist/src/layers/tile.d.ts | 1 + dist/src/layers/vector.d.ts | 1 - dist/src/lithosphere.d.ts | 2 +- dist/src/secondary/sprites.d.ts | 5 +- dist/src/utils/index.d.ts | 1 + docs/Gemfile | 2 + docs/Gemfile.lock | 79 ++++--- docs/assets/js/demo.js | 71 ++++++ docs/assets/js/lithosphere.js | 61 +++-- docs/pages/Functions/functions.markdown | 11 + docs/pages/Layers/Clamped/clamped.markdown | 34 ++- docs/pages/Layers/Vector/vector.markdown | 30 +++ package-lock.json | 99 ++++----- package.json | 2 +- public/dist/lithosphere.js | 22 +- public/examples/demo.html | 2 +- public/examples/example.html | 143 +++++++++++- public/examples/juno_test.html | 89 ++++++++ public/index.html | 8 + src/core/cameras.ts | 10 +- src/core/events.ts | 132 +++++++++-- src/core/projection.ts | 69 ++++-- src/generalTypes.d.ts | 2 + src/layers/clamped.ts | 217 ++++++++++++------ src/layers/index.ts | 152 +++++++++++-- src/layers/tile.ts | 21 ++ src/layers/vector.ts | 30 ++- src/lithosphere.ts | 23 +- src/secondary/sprites.ts | 245 ++++++++++----------- src/utils/index.ts | 28 ++- 39 files changed, 1239 insertions(+), 426 deletions(-) create mode 100644 .gitattributes create mode 100644 public/examples/juno_test.html diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..54a67b8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* linguist-vendored +src/* linguist-vendored=false \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e7ebdc7..cd802c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,31 @@ [Official Releases](https://github.com/NASA-AMMOS/LithoSphere/releases) +## v1.5.0 + +_May 23, 2022_ + +#### Added + +- Support for clamped and vector layer annotations +- Support for clamped and vector layer visibility cutoffs + +#### Fixed + +- Near-Far plane issues with large planetary radii. + +--- + +## v1.4.2 + +_May 5, 2022_ + +#### Added + +- New `orderLayers` function + +--- + ## v1.4.1 _May 2, 2022_ diff --git a/README.md b/README.md index 91c58ce..34f199f 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Head over to the **[Documentation](https://nasa-ammos.github.io/LithoSphere/)** - Tile - Tile3d - Model + - Curtain - Adjustable planetary radii - Scripts for tiling Digital Elevation Maps (DEM) and custom projections - Various tile formats: @@ -58,7 +59,7 @@ Head over to the **[Documentation](https://nasa-ammos.github.io/LithoSphere/)** - Home - Exaggerate - Crop (upcoming?) - - Controls (upcoming) + - Controls - Coordinates - Link - The ability to use custom parsers for your own tiled data formats diff --git a/dist/lithosphere.js b/dist/lithosphere.js index 7df2376..45d06e6 100644 --- a/dist/lithosphere.js +++ b/dist/lithosphere.js @@ -1971,7 +1971,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _uti /***/ (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/* harmony import */ var _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../secondary/OrbitControls */ \"./src/secondary/OrbitControls.ts\");\n/* harmony import */ var _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../secondary/PointerLockControls */ \"./src/secondary/PointerLockControls.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Camera = function () {\n function Camera(container, sceneContainer, scene, projection) {\n var _this = this;\n\n this.onKeyDown = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = true;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = true;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = true;\n break;\n\n case 39:\n case 68:\n _this.moveRight = true;\n break;\n\n case 32:\n if (_this.canJump === true) _this.velocity.y += 350;\n _this.canJump = false;\n break;\n }\n };\n\n this.onKeyUp = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = false;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = false;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = false;\n break;\n\n case 39:\n case 68:\n _this.moveRight = false;\n break;\n }\n };\n\n this.updateSize = function () {\n _this.orbit.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.orbit.camera.updateProjectionMatrix();\n\n _this.firstPerson.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setNearFarPlane = function (farther, near, far, keepNear) {\n if (keepNear === true) _this._.keepNear = true;\n if (keepNear === false) _this._.keepNear = false;\n\n if (farther) {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near * 10000;\n } else {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near;\n _this.orbit.camera.far = _this.orbit.far;\n }\n\n if (near != null) _this.orbit.camera.near = near;\n if (far != null) _this.orbit.camera.far = far;\n\n _this.orbit.camera.updateProjectionMatrix();\n };\n\n this.setFirstPersonHeight = function (height) {\n _this.firstPerson.height = height || 3;\n };\n\n this.getFirstPersonFocalLength = function () {\n return _this.firstPerson.camera.getFocalLength();\n };\n\n this.setFirstPersonFocalLength = function (focalLength) {\n _this.firstPerson.camera.setFocalLength(focalLength);\n };\n\n this.getFirstPersonFOV = function () {\n return _this.firstPerson.camera.fov;\n };\n\n this.setFirstPersonFOV = function (fov) {\n _this.firstPerson.camera.fov = fov;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.getFirstPersonAspect = function () {\n return _this.firstPerson.camera.aspect;\n };\n\n this.setFirstPersonAspect = function (aspect) {\n _this.firstPerson.camera.aspect = aspect;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setCameraAzimuthElevation = function (az, el, cameraIsFirstPerson) {\n _this.firstPerson.controls.getObject().rotation.y = (-az + 180) * (Math.PI / 180);\n _this.firstPerson.controls.getPitchObject().rotation.x = el * (Math.PI / 180);\n };\n\n this.update = function () {\n if (_this.isFirstPerson) {\n var time = performance.now();\n var delta = (time - _this.prevTime) / 1000;\n var speedFactor = 1000;\n _this.prevTime = time;\n _this.velocity.x -= _this.velocity.x * 10.0 * delta;\n _this.velocity.z -= _this.velocity.z * 10.0 * delta;\n _this.velocity.y -= 9.8 * 100.0 * delta;\n if (_this.moveForward) _this.velocity.z -= speedFactor * delta;\n if (_this.moveBackward) _this.velocity.z += speedFactor * delta;\n if (_this.moveLeft) _this.velocity.x -= speedFactor * delta;\n if (_this.moveRight) _this.velocity.x += speedFactor * delta;\n var rp = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].rotatePoint({\n x: _this.velocity.x * delta,\n y: _this.velocity.z * delta\n }, [0, 0], -_this.firstPerson.controls.getObject().rotation.y);\n\n if (_this.isShift) {\n rp.x *= 7;\n rp.y *= 7;\n } else {\n rp.x *= 3;\n rp.y *= 3;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector2\"](rp.x, rp.y);\n }\n\n return null;\n };\n\n this.container = container;\n this.sceneContainer = sceneContainer;\n this.reset();\n\n this._init(scene, projection);\n }\n\n Camera.prototype.reset = function () {\n this.camera = null;\n this.controls = null;\n this.orbit = {\n camera: null,\n controls: null,\n near: 0.1,\n far: 15000000000\n };\n this.firstPerson = {\n camera: null,\n controls: null,\n lockControls: false,\n height: 3\n };\n this.isFirstPerson = false;\n this._ = {\n keepNear: false,\n crosshair: null\n };\n this.isShift = false;\n this.moveForward = null;\n this.moveBackward = null;\n this.moveLeft = null;\n this.moveRight = null;\n this.canJump = null;\n this.prevTime = performance.now();\n this.velocity = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\n };\n\n Camera.prototype._init = function (scene, projection) {\n this.orbit.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, this.orbit.near, this.orbit.far);\n this.orbit.camera.up = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, -1, 0);\n this.orbit.camera.position.set(0, -10000000 / projection.radiusScale, 0);\n this.orbit.controls = new _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.orbit.camera, this.sceneContainer);\n this.orbit.controls.enabled = true;\n this.orbit.controls.enableDamping = true;\n this.orbit.controls.dampingFactor = 0.2;\n this.orbit.controls.target.y = 1;\n this.orbit.controls.mouseButtons.ORBIT = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].RIGHT;\n this.orbit.controls.mouseButtons.PAN = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].LEFT;\n this.orbit.controls.maxDistance = projection.radii.major * 4;\n this.orbit.controls.maxPolarAngle = Math.PI / 2;\n this.orbit.controls.enablePan = false;\n this.firstPerson.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, 0.1, 150000000);\n this.firstPerson.controls = new _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.firstPerson.camera);\n this.firstPerson.controls.getObject().rotation.set(Math.PI, Math.PI, 0);\n this.firstPerson.controls.getObject().position.set(0, 10000000 / projection.radiusScale, 0);\n scene.add(this.firstPerson.controls.getObject());\n\n if (this.isFirstPerson) {\n this.requestPointerLocking();\n } else {\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n\n this.updateSize();\n this.setupEvents();\n this.orbit.controls.update();\n };\n\n Camera.prototype.swap = function (lockControls, skipLock) {\n this.isFirstPerson = !this.isFirstPerson;\n\n if (this.isFirstPerson) {\n this.firstPerson.lockControls = lockControls || false;\n if (!skipLock) this.requestPointerLocking();\n this.inToFirstPerson();\n } else {\n this.outFromFirstPerson();\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n };\n\n Camera.prototype.inToFirstPerson = function () {\n this.isFirstPerson = true;\n this.toggleCrosshair(true);\n this.camera = this.firstPerson.camera;\n this.firstPerson.controls.enabled = !this.firstPerson.lockControls;\n this.controls = this.firstPerson.controls;\n this.orbit.controls.resetPosition();\n };\n\n Camera.prototype.outFromFirstPerson = function () {\n this.isFirstPerson = false;\n this.toggleCrosshair(false);\n this.firstPerson.controls.enabled = false;\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n };\n\n Camera.prototype.toggleCrosshair = function (on) {\n if (this._.crosshair == null) {\n this._.crosshair = document.createElement('div');\n this._.crosshair.id = '_lithosphere_crosshair';\n 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(';');\n this.container.appendChild(this._.crosshair);\n }\n\n if (on) this._.crosshair.style.display = 'inherit';else this._.crosshair.style.display = 'none';\n };\n\n Camera.prototype.requestPointerLocking = function () {\n var _this = this;\n\n var havePointerLock = ('pointerLockElement' in document);\n\n if (havePointerLock) {\n var element_1 = document.body;\n\n var pointerlockchange = function () {\n if (document.pointerLockElement === element_1) {\n _this.inToFirstPerson();\n } else {\n _this.outFromFirstPerson();\n }\n };\n\n var pointerlockerror = function (e) {\n alert('Pointer Lock Error');\n };\n\n document.addEventListener('pointerlockchange', pointerlockchange, false);\n document.addEventListener('mozpointerlockchange', pointerlockchange, false);\n document.addEventListener('webkitpointerlockchange', pointerlockchange, false);\n document.addEventListener('pointerlockerror', pointerlockerror, false);\n document.addEventListener('mozpointerlockerror', pointerlockerror, false);\n document.addEventListener('webkitpointerlockerror', pointerlockerror, false);\n\n if (/Firefox/i.test(navigator.userAgent)) {\n var fullscreenchange_1 = function () {\n if (document.fullscreenElement === element_1) {\n document.removeEventListener('fullscreenchange', fullscreenchange_1);\n document.removeEventListener('mozfullscreenchange', fullscreenchange_1);\n element_1.requestPointerLock();\n }\n };\n\n document.addEventListener('fullscreenchange', fullscreenchange_1, false);\n document.addEventListener('mozfullscreenchange', fullscreenchange_1, false);\n element_1.requestFullscreen();\n } else {\n element_1.requestPointerLock();\n }\n } else {\n this.isFirstPerson = false;\n alert('This browser does not support Pointer Locking.');\n }\n };\n\n Camera.prototype.setupEvents = function () {\n document.addEventListener('keydown', this.onKeyDown, false);\n document.addEventListener('keyup', this.onKeyUp, false);\n window.addEventListener('resize', this.updateSize, false);\n };\n\n return Camera;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Camera);\n\n//# sourceURL=webpack://LithoSphere/./src/core/cameras.ts?"); +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/* harmony import */ var _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../secondary/OrbitControls */ \"./src/secondary/OrbitControls.ts\");\n/* harmony import */ var _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../secondary/PointerLockControls */ \"./src/secondary/PointerLockControls.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Camera = function () {\n function Camera(container, sceneContainer, scene, projection) {\n var _this = this;\n\n this.onKeyDown = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = true;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = true;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = true;\n break;\n\n case 39:\n case 68:\n _this.moveRight = true;\n break;\n\n case 32:\n if (_this.canJump === true) _this.velocity.y += 350;\n _this.canJump = false;\n break;\n }\n };\n\n this.onKeyUp = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = false;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = false;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = false;\n break;\n\n case 39:\n case 68:\n _this.moveRight = false;\n break;\n }\n };\n\n this.updateSize = function () {\n _this.orbit.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.orbit.camera.updateProjectionMatrix();\n\n _this.firstPerson.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setNearFarPlane = function (scalar, farther, near, far, keepNear) {\n if (scalar === void 0) {\n scalar = 1;\n }\n\n if (keepNear === true) _this._.keepNear = true;\n if (keepNear === false) _this._.keepNear = false;\n\n if (farther) {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near * 10000 / scalar;\n } else {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near;\n _this.orbit.camera.far = _this.orbit.far;\n }\n\n if (near != null) _this.orbit.camera.near = near;\n if (far != null) _this.orbit.camera.far = far;\n\n _this.orbit.camera.updateProjectionMatrix();\n };\n\n this.setFirstPersonHeight = function (height) {\n _this.firstPerson.height = height || 3;\n };\n\n this.getFirstPersonFocalLength = function () {\n return _this.firstPerson.camera.getFocalLength();\n };\n\n this.setFirstPersonFocalLength = function (focalLength) {\n _this.firstPerson.camera.setFocalLength(focalLength);\n };\n\n this.getFirstPersonFOV = function () {\n return _this.firstPerson.camera.fov;\n };\n\n this.setFirstPersonFOV = function (fov) {\n _this.firstPerson.camera.fov = fov;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.getFirstPersonAspect = function () {\n return _this.firstPerson.camera.aspect;\n };\n\n this.setFirstPersonAspect = function (aspect) {\n _this.firstPerson.camera.aspect = aspect;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setCameraAzimuthElevation = function (az, el, cameraIsFirstPerson) {\n _this.firstPerson.controls.getObject().rotation.y = (-az + 180) * (Math.PI / 180);\n _this.firstPerson.controls.getPitchObject().rotation.x = el * (Math.PI / 180);\n };\n\n this.update = function () {\n if (_this.isFirstPerson) {\n var time = performance.now();\n var delta = (time - _this.prevTime) / 1000;\n var speedFactor = 1000;\n _this.prevTime = time;\n _this.velocity.x -= _this.velocity.x * 10.0 * delta;\n _this.velocity.z -= _this.velocity.z * 10.0 * delta;\n _this.velocity.y -= 9.8 * 100.0 * delta;\n if (_this.moveForward) _this.velocity.z -= speedFactor * delta;\n if (_this.moveBackward) _this.velocity.z += speedFactor * delta;\n if (_this.moveLeft) _this.velocity.x -= speedFactor * delta;\n if (_this.moveRight) _this.velocity.x += speedFactor * delta;\n var rp = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].rotatePoint({\n x: _this.velocity.x * delta,\n y: _this.velocity.z * delta\n }, [0, 0], -_this.firstPerson.controls.getObject().rotation.y);\n\n if (_this.isShift) {\n rp.x *= 7;\n rp.y *= 7;\n } else {\n rp.x *= 3;\n rp.y *= 3;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector2\"](rp.x, rp.y);\n }\n\n return null;\n };\n\n this.container = container;\n this.sceneContainer = sceneContainer;\n this.reset();\n\n this._init(scene, projection);\n }\n\n Camera.prototype.reset = function () {\n this.camera = null;\n this.controls = null;\n this.orbit = {\n camera: null,\n controls: null,\n near: 0.1,\n far: 150000000000\n };\n this.firstPerson = {\n camera: null,\n controls: null,\n lockControls: false,\n height: 3\n };\n this.isFirstPerson = false;\n this._ = {\n keepNear: false,\n crosshair: null\n };\n this.isShift = false;\n this.moveForward = null;\n this.moveBackward = null;\n this.moveLeft = null;\n this.moveRight = null;\n this.canJump = null;\n this.prevTime = performance.now();\n this.velocity = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\n };\n\n Camera.prototype._init = function (scene, projection) {\n this.orbit.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, this.orbit.near, this.orbit.far);\n this.orbit.camera.up = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, -1, 0);\n this.orbit.camera.position.set(0, -10000000 * projection.radiusScale, 0);\n this.orbit.controls = new _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.orbit.camera, this.sceneContainer);\n this.orbit.controls.enabled = true;\n this.orbit.controls.enableDamping = true;\n this.orbit.controls.dampingFactor = 0.2;\n this.orbit.controls.target.y = 1;\n this.orbit.controls.mouseButtons.ORBIT = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].RIGHT;\n this.orbit.controls.mouseButtons.PAN = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].LEFT;\n this.orbit.controls.maxDistance = projection.radii.major * 4;\n this.orbit.controls.maxPolarAngle = Math.PI / 2;\n this.orbit.controls.enablePan = false;\n this.firstPerson.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, 0.1, 150000000);\n this.firstPerson.controls = new _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.firstPerson.camera);\n this.firstPerson.controls.getObject().rotation.set(Math.PI, Math.PI, 0);\n this.firstPerson.controls.getObject().position.set(0, 10000000 * projection.radiusScale, 0);\n scene.add(this.firstPerson.controls.getObject());\n\n if (this.isFirstPerson) {\n this.requestPointerLocking();\n } else {\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n\n this.updateSize();\n this.setupEvents();\n this.orbit.controls.update();\n };\n\n Camera.prototype.swap = function (lockControls, skipLock) {\n this.isFirstPerson = !this.isFirstPerson;\n\n if (this.isFirstPerson) {\n this.firstPerson.lockControls = lockControls || false;\n if (!skipLock) this.requestPointerLocking();\n this.inToFirstPerson();\n } else {\n this.outFromFirstPerson();\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n };\n\n Camera.prototype.inToFirstPerson = function () {\n this.isFirstPerson = true;\n this.toggleCrosshair(true);\n this.camera = this.firstPerson.camera;\n this.firstPerson.controls.enabled = !this.firstPerson.lockControls;\n this.controls = this.firstPerson.controls;\n this.orbit.controls.resetPosition();\n };\n\n Camera.prototype.outFromFirstPerson = function () {\n this.isFirstPerson = false;\n this.toggleCrosshair(false);\n this.firstPerson.controls.enabled = false;\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n };\n\n Camera.prototype.toggleCrosshair = function (on) {\n if (this._.crosshair == null) {\n this._.crosshair = document.createElement('div');\n this._.crosshair.id = '_lithosphere_crosshair';\n 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(';');\n this.container.appendChild(this._.crosshair);\n }\n\n if (on) this._.crosshair.style.display = 'inherit';else this._.crosshair.style.display = 'none';\n };\n\n Camera.prototype.requestPointerLocking = function () {\n var _this = this;\n\n var havePointerLock = ('pointerLockElement' in document);\n\n if (havePointerLock) {\n var element_1 = document.body;\n\n var pointerlockchange = function () {\n if (document.pointerLockElement === element_1) {\n _this.inToFirstPerson();\n } else {\n _this.outFromFirstPerson();\n }\n };\n\n var pointerlockerror = function (e) {\n alert('Pointer Lock Error');\n };\n\n document.addEventListener('pointerlockchange', pointerlockchange, false);\n document.addEventListener('mozpointerlockchange', pointerlockchange, false);\n document.addEventListener('webkitpointerlockchange', pointerlockchange, false);\n document.addEventListener('pointerlockerror', pointerlockerror, false);\n document.addEventListener('mozpointerlockerror', pointerlockerror, false);\n document.addEventListener('webkitpointerlockerror', pointerlockerror, false);\n\n if (/Firefox/i.test(navigator.userAgent)) {\n var fullscreenchange_1 = function () {\n if (document.fullscreenElement === element_1) {\n document.removeEventListener('fullscreenchange', fullscreenchange_1);\n document.removeEventListener('mozfullscreenchange', fullscreenchange_1);\n element_1.requestPointerLock();\n }\n };\n\n document.addEventListener('fullscreenchange', fullscreenchange_1, false);\n document.addEventListener('mozfullscreenchange', fullscreenchange_1, false);\n element_1.requestFullscreen();\n } else {\n element_1.requestPointerLock();\n }\n } else {\n this.isFirstPerson = false;\n alert('This browser does not support Pointer Locking.');\n }\n };\n\n Camera.prototype.setupEvents = function () {\n document.addEventListener('keydown', this.onKeyDown, false);\n document.addEventListener('keyup', this.onKeyUp, false);\n window.addEventListener('resize', this.updateSize, false);\n };\n\n return Camera;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Camera);\n\n//# sourceURL=webpack://LithoSphere/./src/core/cameras.ts?"); /***/ }), @@ -1983,7 +1983,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (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/* harmony import */ var _turf_circle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/circle */ \"./node_modules/@turf/circle/dist/es/index.js\");\n/* harmony import */ var _turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/boolean-intersects */ \"./node_modules/@turf/boolean-intersects/dist/es/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Events = function () {\n function Events(parent) {\n var _this = this;\n\n this._rotateGlobe = function (e, prevXY) {\n if (prevXY) {\n _this._.prevMouseXY.x = prevXY.x;\n _this._.prevMouseXY.y = prevXY.y;\n }\n\n if (!e) return;\n if (!e.pageX && e.touches) e.pageX = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n if (!e.pageY && e.touches) e.pageY = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n if (e.hasOwnProperty('x') && e.hasOwnProperty('y') && _this.p._.cameras.isFirstPerson) {\n _this._.prevMouseXY.x = 0;\n _this._.prevMouseXY.y = 0;\n e.pageX = e.x;\n e.pageY = e.y;\n }\n\n var rotSpeed = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getRadiansPerPixel(_this.p.trueZoom) * 0.5 * (_this.p._.marsRadius / _this.p.projection.radii.major);\n\n var pixelDif = 0;\n var cpX = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n cpX.applyAxisAngle(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, 1, 0), Math.PI / 2);\n var cpY = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n\n if (e.pageY < _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, rotSpeed * pixelDif);\n } else if (e.pageY > _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, -rotSpeed * pixelDif);\n }\n\n if (e.pageX > _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, -rotSpeed * pixelDif);\n } else if (e.pageX < _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, rotSpeed * pixelDif);\n }\n\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n if (_this.p.zoom <= _this.p._.zCutOff) {\n _this.p._.cameras.orbit.controls.target.x = 0;\n _this.p._.cameras.orbit.controls.target.y = -_this.p.planetCenter.y;\n _this.p._.cameras.orbit.controls.target.z = 0;\n\n _this.p._.cameras.orbit.controls.update();\n } else {\n var elevRaw = _this.p.getCenterElevationRaw();\n\n if (elevRaw != null) {\n var newLookAtY = -(elevRaw + _this.p.planetCenter.y);\n if (newLookAtY != 0 && newLookAtY != -10000) _this.p._.cameras.orbit.controls.target.y = newLookAtY - _this.p.options.targetYOffset;\n }\n\n var center = _this.p.getCenter();\n\n _this.p.controls._onMove(center.lng, center.lat, center.height);\n }\n };\n\n this._rotateGlobe_MouseDown = function (e) {\n if (e.which === 1 || e.button === 0) {\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n _this.p._.sceneContainer.addEventListener('mousemove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('mouseup', _this._rotateGlobe_MouseUp, false);\n\n _this.p._.sceneContainer.addEventListener('mouseleave', _this._rotateGlobe_MouseUp, false);\n } else if (e.touches && e.touches.length > 2) {\n _this._.prevMouseXY.x = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n _this._.prevMouseXY.y = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n _this.p._.sceneContainer.addEventListener('touchmove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('touchend', _this._rotateGlobe_MouseUp, false);\n }\n };\n\n this._rotateGlobe_MouseUp = function (e) {\n _this.p._.sceneContainer.removeEventListener('mousemove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('mouseup', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('mouseleave', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('touchmove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('touchend', _this._rotateGlobe_MouseUp);\n };\n\n this._onZoom = function (e) {\n _this._.zoomedSince = 0;\n\n var zoomDist = _this.p._.cameras.orbit.camera.position.distanceTo(_this.p._.cameras.orbit.controls.target);\n\n var nf = 8 - (_this.p.projection.radiusScale.toString().length - 1);\n var dZoom = Math.ceil((nf * Math.log(2) - Math.log(zoomDist / Math.pow(5, nf - 1))) / Math.log(2)) + 1;\n _this._.desiredZoom = dZoom;\n\n _this._attenuate();\n };\n\n this._onTouchZoom = function (e) {\n if (e.touches && e.touches.length == 1) _this._onZoom(e);\n };\n\n this._onClick = function (e) {\n if (_this.hoveredFeature && _this.hoverInfo) {\n var layer = _this.p.layers.getLayerByName(_this.hoveredFeature.layerName);\n\n if (layer) {\n _this.setActiveFeature({\n layerName: _this.hoveredFeature.layerName,\n type: _this.hoveredFeature.type,\n obj: _this.hoveredFeature.obj,\n feature: _this.hoveredFeature.feature || _this.hoveredFeature.obj.feature,\n lnglat: {\n lng: _this.hoveredFeature.lnglat.lng,\n lat: _this.hoveredFeature.lnglat.lat\n }\n });\n\n if (typeof layer.onClick === 'function') {\n layer.onClick(JSON.parse(JSON.stringify(_this.hoveredFeature.feature)), JSON.parse(JSON.stringify(_this.hoveredFeature.lnglat)), layer);\n }\n }\n }\n };\n\n this._onKeyDown = function (e) {\n if (_this.p._.cameras.isFirstPerson) return;\n var speed = e.shiftKey ? 20 : 8;\n\n switch (e.key) {\n case 'w':\n case 'ArrowUp':\n _this._rotateGlobe({\n pageX: 0,\n pageY: speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'a':\n case 'ArrowLeft':\n _this._rotateGlobe({\n pageX: speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 's':\n case 'ArrowDown':\n _this._rotateGlobe({\n pageX: 0,\n pageY: -speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'd':\n case 'ArrowRight':\n _this._rotateGlobe({\n pageX: -speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'g':\n case 'PageDown':\n var lerpedDown = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? -0.035 : -0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedDown.x, lerpedDown.y, lerpedDown.z);\n\n _this._onZoom();\n\n break;\n\n case 't':\n case 'PageUp':\n var lerpedUp = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? 0.035 : 0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedUp.x, lerpedUp.y, lerpedUp.z);\n\n _this._onZoom();\n\n break;\n\n case 'q':\n _this.p._.cameras.orbit.controls.rotateLeft(Math.PI / 64);\n\n break;\n\n case 'e':\n _this.p._.cameras.orbit.controls.rotateLeft(-Math.PI / 64);\n\n break;\n\n case 'r':\n _this.p._.cameras.orbit.controls.rotateUp(Math.PI / 64);\n\n break;\n\n case 'f':\n _this.p._.cameras.orbit.controls.rotateUp(-Math.PI / 64);\n\n break;\n }\n };\n\n this._onMouseMove = function (e) {\n _this.p._.mouseIsInScene = true;\n\n if (_this.p._.cameras.isFirstPerson) {\n _this._.mouseXY.x = 0;\n _this._.mouseXY.y = 0;\n } else {\n _this._.mouseXY.x = (e.clientX - _this.p._.renderer.domElement.getBoundingClientRect().left) / _this.p._.renderer.domElement.clientWidth * 2 - 1;\n _this._.mouseXY.y = -((e.clientY - _this.p._.renderer.domElement.getBoundingClientRect().top) / _this.p._.renderer.domElement.clientHeight) * 2 + 1;\n }\n\n _this._.containerXY = {\n x: e ? e.offsetX : null,\n y: e ? e.offsetY : null\n };\n\n _this.updateHoverInfoPosition();\n\n _this.p._.raycaster.setFromCamera(_this._.mouseXY, _this.p._.cameras.camera);\n\n var intersectArr = [];\n\n for (var i = 0; i < _this.p._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this.p._.tiledWorld.tilesDrawn[i].isLODTile) intersectArr.push(_this.p._.tiledWorld.tilesDrawn[i].t);\n }\n\n for (var i = 0; i < _this.p.layers.vector.length; i++) {\n if (_this.p.layers.vector[i].meshes && _this.p.layers.vector[i].meshes.children) for (var j = 0; j < _this.p.layers.vector[i].meshes.children.length; j++) intersectArr.push(_this.p.layers.vector[i].meshes.children[j]);\n }\n\n for (var i = 0; i < _this.p.layers.curtain.length; i++) {\n if (_this.p.layers.curtain[i].curtain && _this.p.layers.curtain[i].curtain.children) for (var j = 0; j < _this.p.layers.curtain[i].curtain.children.length; j++) intersectArr.push(_this.p.layers.curtain[i].curtain.children[j]);\n }\n\n var intersects = _this.p._.raycaster.intersectObjects(intersectArr);\n\n if (intersects.length > 0) {\n var type_1 = intersects[0].object.type;\n var obj_1 = null;\n\n switch (type_1) {\n case 'Sprite':\n obj_1 = intersects[0].object;\n break;\n\n case 'Line2':\n obj_1 = intersects[0].object;\n break;\n\n case 'Mesh':\n obj_1 = _this.p._.tiledWorld.findTileDrawnBasedOnUUID(intersects[0].object.uuid);\n\n if (obj_1 == null) {\n obj_1 = intersects[0].object;\n }\n\n break;\n\n default:\n return;\n break;\n }\n\n var savedIntersectionPoint_1 = intersects[0].point;\n intersects[0].point.y += _this.p.planetCenter.y;\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: -_this.p.planet.rotation.x,\n y: 0,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: -_this.p.planet.rotation.y,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: 0,\n z: -_this.p.planet.rotation.z\n });\n\n var intersectedLL_1 = _this.p.projection.vector3ToLatLng(intersects[0].point);\n\n intersectedLL_1.height = savedIntersectionPoint_1.length() * _this.p.projection.radiusScale - _this.p.projection.radii.major;\n\n _this._updateMouseCoords(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height);\n\n clearTimeout(_this._.highlightTimeout);\n _this._.highlightTimeout = setTimeout(function () {\n _this._highlightFeature(intersectedLL_1.lng, intersectedLL_1.lat, type_1, obj_1, intersects[0], savedIntersectionPoint_1);\n }, 10);\n\n _this.p.layers._onMouseMove(intersectedLL_1, e, obj_1, intersects[0], savedIntersectionPoint_1);\n\n _this.p.controls._onMouseMove(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height, e);\n } else {\n _this._updateMouseCoords(null, null, null);\n\n _this._unhighlightHoveredFeature();\n\n _this.p.controls._onMouseMove(null, null, null, e);\n }\n };\n\n this.p = parent;\n this.activeFeature = null;\n this.hoveredFeature = null;\n this.hoverInfo = null;\n this._ = {\n mouseXY: {\n x: null,\n y: null\n },\n prevMouseXY: {\n x: null,\n y: null\n },\n containerXY: {\n x: null,\n y: null\n },\n lastZoomDelta: 1,\n desiredZoom: null,\n zoomedSince: 0,\n zoomWait: 30,\n highlightTimeout: null\n };\n\n this._init();\n }\n\n Events.prototype._init = function () {\n var _this = this;\n\n this._matchPlanetsLODToPlanet();\n\n this.p._.sceneContainer.addEventListener('mousewheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('DOMMouseScroll', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('wheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', this.p.controls._onMouseOut, false);\n\n this.p._.sceneContainer.addEventListener('touchend', this._onTouchZoom);\n\n this.p._.sceneContainer.addEventListener('mousedown', this._rotateGlobe_MouseDown, false);\n\n this.p._.sceneContainer.addEventListener('mousemove', this._onMouseMove, false);\n\n this.p._.sceneContainer.addEventListener('click', this._onClick, false);\n\n this.p._.sceneContainer.addEventListener('mouseenter', function () {\n _this.p._.mouseIsInScene = true;\n }, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', function () {\n _this.p._.mouseIsInScene = false;\n }, false);\n\n window.addEventListener('keydown', this._onKeyDown, false);\n };\n\n Events.prototype._rotateAroundArbAxis = function (axis, radians, noPremultiply) {\n var rotationMatrix = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\n rotationMatrix.makeRotationAxis(axis.normalize(), radians);\n if (noPremultiply !== true) rotationMatrix.multiply(this.p.planet.matrix);\n this.p.planet.matrix = rotationMatrix;\n this.p.planet.rotation.setFromRotationMatrix(this.p.planet.matrix);\n\n this._matchPlanetsLODToPlanet();\n\n this._refreshFrontGroupRotation();\n };\n\n Events.prototype._checkDesiredZoom = function () {\n this._.zoomedSince++;\n\n if (this._.desiredZoom != null) {\n this.p._.cameras.setNearFarPlane(this._.desiredZoom < 14);\n\n if (this._.zoomedSince > this._.zoomWait) {\n if (this._.desiredZoom >= this.p._.minNativeZoom) this._setZoom(this._.desiredZoom);\n this._.desiredZoom = null;\n }\n }\n };\n\n Events.prototype._setZoom = function (newZoom) {\n var zoomSave = this.p.zoom;\n this.p.zoom = newZoom;\n this.p.trueZoom = Math.max(0, newZoom);\n if (this.p.zoom < 0) this.p.zoom = 0;\n if (this.p.zoom < this.p._.minNativeZoom) this.p.zoom = this.p._.minNativeZoom;\n if (this.p.zoom > this.p._.maxZoom) this.p.zoom = this.p._.maxZoom;\n this._.lastZoomDelta = Math.abs(this.p.zoom - zoomSave);\n };\n\n Events.prototype._matchPlanetsLODToPlanet = function () {\n for (var i = 0; i < this.p.planetsLOD.length; i++) {\n this.p.planetsLOD[i].matrix = this.p.planet.matrix;\n this.p.planetsLOD[i].position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.planetsLOD[i].rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n\n if (this.p.atmosphere) {\n this.p.atmosphere.matrix = this.p.planet.matrix;\n this.p.atmosphere.position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.atmosphere.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n };\n\n Events.prototype._refreshFrontGroupRotation = function () {\n this.p.frontGroup.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n };\n\n Events.prototype._updateMouseCoords = function (lng, lat, elev) {\n this.p.mouse.lng = lng;\n this.p.mouse.lat = lat;\n this.p.mouse.elev = elev;\n };\n\n Events.prototype.updateHoverInfoPosition = function () {\n if (this.hoverInfo) {\n this.hoverInfo.style.left = this._.containerXY.x + 14 + \"px\";\n this.hoverInfo.style.top = this._.containerXY.y + 14 + \"px\";\n }\n };\n\n Events.prototype._highlightFeature = function (lng, lat, type, obj, intersectionRaw, intersectionPoint) {\n var cursor = {\n type: 'Point',\n coordinates: [lng, lat]\n };\n var highlighted = false;\n\n switch (type) {\n case 'Sprite':\n case 'Line2':\n highlighted = true;\n if (obj.feature._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n obj.feature._highlighted = true;\n obj.restyle();\n this.setHoveredFeature({\n layerName: obj.layerName,\n type: type,\n obj: obj,\n feature: obj.feature,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n break;\n\n case 'Mesh':\n if (obj.layerType === 'curtain') {} else if (obj.layerType === 'model') {} else if (obj.contains) {\n for (var _i = 0, _a = Object.keys(obj.contains).reverse(); _i < _a.length; _i++) {\n var layerName = _a[_i];\n\n for (var _b = 0, _c = obj.contains[layerName].reverse(); _b < _c.length; _b++) {\n var f = _c[_b];\n var feature = Object.assign({}, f);\n\n if (feature.geometry.type.toLowerCase() === 'point') {\n feature = Object(_turf_circle__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(feature.geometry.coordinates, feature._radiusInMeters || 1, {\n steps: 12,\n units: 'meters',\n properties: feature.properties\n });\n }\n\n if (Object(_turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(feature, cursor)) {\n highlighted = true;\n if (f._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n f._highlighted = true;\n this.setHoveredFeature({\n layerName: layerName,\n type: type,\n obj: obj,\n feature: f,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n\n this.p._.tiledWorld.updateClampedRasterForTile(obj, layerName);\n\n break;\n }\n }\n\n if (highlighted) return;\n }\n }\n\n break;\n\n default:\n break;\n }\n\n if (!highlighted) {\n this._unhighlightHoveredFeature();\n }\n };\n\n Events.prototype._unhighlightHoveredFeature = function () {\n if (this.hoveredFeature) {\n this.hoveredFeature.feature._highlighted = false;\n\n switch (this.hoveredFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.hoveredFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.hoveredFeature.obj, this.hoveredFeature.layerName);\n\n break;\n\n default:\n break;\n }\n\n this.clearHoveredFeature();\n }\n };\n\n Events.prototype.setHoveredFeature = function (hoveredFeature) {\n this.hoveredFeature = hoveredFeature;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n }\n\n this.hoverInfo = document.createElement('div');\n this.hoverInfo.id = '_lithosphere_hover_info';\n var layer = this.p.layers.getLayerByName(this.hoveredFeature.layerName);\n\n if (layer && layer.useKeyAsHoverName) {\n var text = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getIn(this.hoveredFeature.feature.properties, layer.useKeyAsHoverName.split('.'));\n\n if (text != null) {\n this.hoverInfo.innerHTML = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].capitalizeFirstLetter(layer.useKeyAsHoverName + \": \" + text);\n this.hoverInfo.style.position = 'absolute';\n this.hoverInfo.style.background = 'black';\n this.hoverInfo.style.color = 'white';\n this.hoverInfo.style.fontSize = '16px';\n this.hoverInfo.style.fontFamily = 'sans-serif';\n this.hoverInfo.style.fontWeight = 'bold';\n this.hoverInfo.style.padding = '4px 8px';\n this.updateHoverInfoPosition();\n }\n }\n\n this.p._.container.appendChild(this.hoverInfo);\n\n this.p._.container.style.cursor = 'pointer';\n };\n\n Events.prototype.clearHoveredFeature = function () {\n this.hoveredFeature = null;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n this.p._.container.style.cursor = 'default';\n }\n };\n\n Events.prototype.setActiveFeature = function (activeFeature) {\n this.clearActiveFeature();\n this.activeFeature = activeFeature;\n this.activeFeature.feature._active = true;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n };\n\n Events.prototype.clearActiveFeature = function () {\n if (this.activeFeature) {\n this.activeFeature.feature._active = false;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n }\n\n this.activeFeature = null;\n };\n\n Events.prototype._attenuate = function () {\n var zoomDist = this.p._.cameras.camera.position.distanceTo(this.p._.cameras.controls.target);\n\n var attenuationFactor = zoomDist / 256;\n\n if (this.p.layers.vector) {\n this.p.layers.vector.forEach(function (vectorLayer) {\n if (vectorLayer.meshes && vectorLayer.meshes.children) {\n vectorLayer.meshes.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius);\n }\n });\n }\n });\n }\n\n if (this.p.frontGroup.children) {\n this.p.frontGroup.children.forEach(function (child) {\n if (child.children && child.children.length > 0) {\n child.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius);\n }\n });\n } else {\n if (child instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n child.scale.set(attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius);\n }\n }\n });\n }\n };\n\n return Events;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Events);\n\n//# sourceURL=webpack://LithoSphere/./src/core/events.ts?"); +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/* harmony import */ var _turf_circle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/circle */ \"./node_modules/@turf/circle/dist/es/index.js\");\n/* harmony import */ var _turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/boolean-intersects */ \"./node_modules/@turf/boolean-intersects/dist/es/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Events = function () {\n function Events(parent) {\n var _this = this;\n\n this._rotateGlobe = function (e, prevXY, fromDamping) {\n if (prevXY) {\n _this._.prevMouseXY.x = prevXY.x;\n _this._.prevMouseXY.y = prevXY.y;\n } else if (!fromDamping) {\n _this._.panned = true;\n }\n\n if (!e) return;\n if (!e.pageX && e.touches) e.pageX = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n if (!e.pageY && e.touches) e.pageY = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n if (e.hasOwnProperty('x') && e.hasOwnProperty('y') && _this.p._.cameras.isFirstPerson) {\n _this._.prevMouseXY.x = 0;\n _this._.prevMouseXY.y = 0;\n e.pageX = e.x;\n e.pageY = e.y;\n }\n\n var rotSpeed = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getRadiansPerPixel(_this.p.trueZoom) * 0.5 * (3396190 / _this.p.projection.radii.major);\n\n var pixelDif = 0;\n var cpX = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n cpX.applyAxisAngle(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, 1, 0), Math.PI / 2);\n var cpY = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n\n if (e.pageY < _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, rotSpeed * pixelDif);\n } else if (e.pageY > _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, -rotSpeed * pixelDif);\n }\n\n if (e.pageX > _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, -rotSpeed * pixelDif);\n } else if (e.pageX < _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, rotSpeed * pixelDif);\n }\n\n _this._.oldPrevMouseXY.x = _this._.prevMouseXY.x;\n _this._.oldPrevMouseXY.y = _this._.prevMouseXY.y;\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n if (_this.p.zoom <= _this.p._.zCutOff) {\n _this.p._.cameras.orbit.controls.target.x = 0;\n _this.p._.cameras.orbit.controls.target.y = -_this.p.planetCenter.y;\n _this.p._.cameras.orbit.controls.target.z = 0;\n\n _this.p._.cameras.orbit.controls.update();\n } else {\n var elevRaw = _this.p.getCenterElevationRaw();\n\n if (elevRaw != null) {\n var newLookAtY = -(elevRaw + _this.p.planetCenter.y);\n if (newLookAtY != 0 && newLookAtY != -10000) _this.p._.cameras.orbit.controls.target.y = newLookAtY - _this.p.options.targetYOffset;\n }\n\n var center = _this.p.getCenter();\n\n _this.p.controls._onMove(center.lng, center.lat, center.height);\n }\n };\n\n this._rotateGlobe_MouseDown = function (e) {\n clearInterval(_this._.rotationDampingInterval);\n\n if (e.which === 1 || e.button === 0) {\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n _this.p._.sceneContainer.addEventListener('mousemove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('mouseup', _this._rotateGlobe_MouseUp, false);\n\n _this.p._.sceneContainer.addEventListener('mouseleave', _this._rotateGlobe_MouseUp, false);\n } else if (e.touches && e.touches.length > 2) {\n _this._.prevMouseXY.x = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n _this._.prevMouseXY.y = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n _this.p._.sceneContainer.addEventListener('touchmove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('touchend', _this._rotateGlobe_MouseUp, false);\n }\n };\n\n this._rotateGlobe_MouseUp = function (e) {\n _this.p._.sceneContainer.removeEventListener('mousemove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('mouseup', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('mouseleave', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('touchmove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('touchend', _this._rotateGlobe_MouseUp);\n\n if (_this._.panned) {\n clearInterval(_this._.rotationDampingInterval);\n var dif = {\n x: _this._.oldPrevMouseXY.x - _this._.prevMouseXY.x,\n y: _this._.oldPrevMouseXY.y - _this._.prevMouseXY.y\n };\n var difs_1 = [];\n\n while (dif.x > 2 || dif.x < -2 || dif.y > 2 || dif.y < -2) {\n var xSize = dif.x / 3;\n var ySize = dif.y / 3;\n dif.x -= xSize;\n dif.y -= ySize;\n difs_1.push({\n x: dif.x,\n y: dif.y\n });\n }\n\n difs_1.reverse();\n _this._.rotationDampingInterval = setInterval(function () {\n if (difs_1.length > 0) _this._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, difs_1.pop(), true);else clearInterval(_this._.rotationDampingInterval);\n }, 50);\n }\n\n _this._.panned = false;\n };\n\n this._onZoom = function (e) {\n _this._.zoomedSince = 0;\n\n var zoomDist = _this.p._.cameras.orbit.camera.position.distanceTo(_this.p._.cameras.orbit.controls.target);\n\n var nf = 8 - (parseInt(_this.p.projection.radiusScale).toString().length - 1);\n var rf = Math.max(parseInt(_this.p.planetCenter.y).toString().length - 7, 0) + (_this.p.options.zoomLevelShift || 0);\n if (Math.abs(_this.p.planetCenter.y) > 30000000) rf += 1;\n var dZoom = Math.ceil((nf * Math.log(2) - Math.log(zoomDist / Math.pow(5, nf - 1))) / Math.log(2)) + rf;\n _this._.desiredZoom = dZoom;\n\n _this._attenuate();\n };\n\n this._onTouchZoom = function (e) {\n if (e.touches && e.touches.length == 1) _this._onZoom(e);\n };\n\n this._onClick = function (e) {\n if (_this.hoveredFeature && _this.hoverInfo) {\n var layer = _this.p.layers.getLayerByName(_this.hoveredFeature.layerName);\n\n if (layer) {\n _this.setActiveFeature({\n layerName: _this.hoveredFeature.layerName,\n type: _this.hoveredFeature.type,\n obj: _this.hoveredFeature.obj,\n feature: _this.hoveredFeature.feature || _this.hoveredFeature.obj.feature,\n lnglat: {\n lng: _this.hoveredFeature.lnglat.lng,\n lat: _this.hoveredFeature.lnglat.lat\n }\n });\n\n if (typeof layer.onClick === 'function') {\n layer.onClick(JSON.parse(JSON.stringify(_this.hoveredFeature.feature)), JSON.parse(JSON.stringify(_this.hoveredFeature.lnglat)), layer);\n }\n }\n }\n };\n\n this._onKeyDown = function (e) {\n if (_this.p._.cameras.isFirstPerson) return;\n var speed = e.shiftKey ? 20 : 8;\n\n switch (e.key) {\n case 'w':\n case 'ArrowUp':\n _this._rotateGlobe({\n pageX: 0,\n pageY: speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'a':\n case 'ArrowLeft':\n _this._rotateGlobe({\n pageX: speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 's':\n case 'ArrowDown':\n _this._rotateGlobe({\n pageX: 0,\n pageY: -speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'd':\n case 'ArrowRight':\n _this._rotateGlobe({\n pageX: -speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'g':\n case 'PageDown':\n var lerpedDown = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? -0.035 : -0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedDown.x, lerpedDown.y, lerpedDown.z);\n\n _this._onZoom();\n\n break;\n\n case 't':\n case 'PageUp':\n var lerpedUp = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? 0.035 : 0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedUp.x, lerpedUp.y, lerpedUp.z);\n\n _this._onZoom();\n\n break;\n\n case 'q':\n _this.p._.cameras.orbit.controls.rotateLeft(Math.PI / 64);\n\n break;\n\n case 'e':\n _this.p._.cameras.orbit.controls.rotateLeft(-Math.PI / 64);\n\n break;\n\n case 'r':\n _this.p._.cameras.orbit.controls.rotateUp(Math.PI / 64);\n\n break;\n\n case 'f':\n _this.p._.cameras.orbit.controls.rotateUp(-Math.PI / 64);\n\n break;\n }\n };\n\n this._onMouseMove = function (e) {\n _this.p._.mouseIsInScene = true;\n\n if (_this.p._.cameras.isFirstPerson) {\n _this._.mouseXY.x = 0;\n _this._.mouseXY.y = 0;\n } else {\n _this._.mouseXY.x = (e.clientX - _this.p._.renderer.domElement.getBoundingClientRect().left) / _this.p._.renderer.domElement.clientWidth * 2 - 1;\n _this._.mouseXY.y = -((e.clientY - _this.p._.renderer.domElement.getBoundingClientRect().top) / _this.p._.renderer.domElement.clientHeight) * 2 + 1;\n }\n\n _this._.containerXY = {\n x: e ? e.offsetX : null,\n y: e ? e.offsetY : null\n };\n\n _this.updateHoverInfoPosition();\n\n _this.p._.raycaster.setFromCamera(_this._.mouseXY, _this.p._.cameras.camera);\n\n var intersectArr = [];\n\n for (var i = 0; i < _this.p._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this.p._.tiledWorld.tilesDrawn[i].isLODTile) intersectArr.push(_this.p._.tiledWorld.tilesDrawn[i].t);\n }\n\n for (var i = 0; i < _this.p.layers.vector.length; i++) {\n if (_this.p.layers.vector[i].meshes && _this.p.layers.vector[i].meshes.children) for (var j = 0; j < _this.p.layers.vector[i].meshes.children.length; j++) intersectArr.push(_this.p.layers.vector[i].meshes.children[j]);\n }\n\n for (var i = 0; i < _this.p.layers.curtain.length; i++) {\n if (_this.p.layers.curtain[i].curtain && _this.p.layers.curtain[i].curtain.children) for (var j = 0; j < _this.p.layers.curtain[i].curtain.children.length; j++) intersectArr.push(_this.p.layers.curtain[i].curtain.children[j]);\n }\n\n var intersects = _this.p._.raycaster.intersectObjects(intersectArr);\n\n if (intersects.length > 0) {\n var type_1 = intersects[0].object.type;\n var obj_1 = null;\n\n switch (type_1) {\n case 'Sprite':\n obj_1 = intersects[0].object;\n break;\n\n case 'Line2':\n obj_1 = intersects[0].object;\n break;\n\n case 'Mesh':\n obj_1 = _this.p._.tiledWorld.findTileDrawnBasedOnUUID(intersects[0].object.uuid);\n\n if (obj_1 == null) {\n obj_1 = intersects[0].object;\n }\n\n break;\n\n default:\n return;\n break;\n }\n\n var savedIntersectionPoint_1 = intersects[0].point;\n intersects[0].point.y += _this.p.planetCenter.y;\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: -_this.p.planet.rotation.x,\n y: 0,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: -_this.p.planet.rotation.y,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: 0,\n z: -_this.p.planet.rotation.z\n });\n\n var intersectedLL_1 = _this.p.projection.vector3ToLatLng(intersects[0].point);\n\n intersectedLL_1.height = (savedIntersectionPoint_1.length() - _this.p.planet.position.y) / _this.p.projection.radiusScale;\n\n _this._updateMouseCoords(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height);\n\n clearTimeout(_this._.highlightTimeout);\n _this._.highlightTimeout = setTimeout(function () {\n _this._highlightFeature(intersectedLL_1.lng, intersectedLL_1.lat, type_1, obj_1, intersects[0], savedIntersectionPoint_1);\n }, 10);\n\n _this.p.layers._onMouseMove(intersectedLL_1, e, obj_1, intersects[0], savedIntersectionPoint_1);\n\n _this.p.controls._onMouseMove(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height, e);\n } else {\n _this._updateMouseCoords(null, null, null);\n\n _this._unhighlightHoveredFeature();\n\n _this.p.controls._onMouseMove(null, null, null, e);\n }\n };\n\n this.p = parent;\n this.activeFeature = null;\n this.hoveredFeature = null;\n this.hoverInfo = null;\n this._ = {\n mouseXY: {\n x: null,\n y: null\n },\n prevMouseXY: {\n x: null,\n y: null\n },\n oldPrevMouseXY: {\n x: null,\n y: null\n },\n containerXY: {\n x: null,\n y: null\n },\n lastZoomDelta: 1,\n desiredZoom: null,\n zoomedSince: 0,\n zoomWait: 30,\n highlightTimeout: null,\n rotationDampingInterval: null,\n panned: false\n };\n\n this._init();\n }\n\n Events.prototype._init = function () {\n var _this = this;\n\n this._matchPlanetsLODToPlanet();\n\n this.p._.sceneContainer.addEventListener('mousewheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('DOMMouseScroll', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('wheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', this.p.controls._onMouseOut, false);\n\n this.p._.sceneContainer.addEventListener('touchend', this._onTouchZoom);\n\n this.p._.sceneContainer.addEventListener('mousedown', this._rotateGlobe_MouseDown, false);\n\n this.p._.sceneContainer.addEventListener('mousemove', this._onMouseMove, false);\n\n this.p._.sceneContainer.addEventListener('click', this._onClick, false);\n\n this.p._.sceneContainer.addEventListener('mouseenter', function () {\n _this.p._.mouseIsInScene = true;\n }, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', function () {\n _this.p._.mouseIsInScene = false;\n }, false);\n\n window.addEventListener('keydown', this._onKeyDown, false);\n };\n\n Events.prototype._rotateAroundArbAxis = function (axis, radians, noPremultiply) {\n var rotationMatrix = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\n rotationMatrix.makeRotationAxis(axis.normalize(), radians);\n if (noPremultiply !== true) rotationMatrix.multiply(this.p.planet.matrix);\n this.p.planet.matrix = rotationMatrix;\n this.p.planet.rotation.setFromRotationMatrix(this.p.planet.matrix);\n\n this._matchPlanetsLODToPlanet();\n\n this._refreshFrontGroupRotation();\n };\n\n Events.prototype._checkDesiredZoom = function () {\n this._.zoomedSince++;\n\n if (this._.desiredZoom != null) {\n this.p._.cameras.setNearFarPlane(this.p.projection.radiusScale, this._.desiredZoom < 14);\n\n if (this._.zoomedSince > this._.zoomWait) {\n if (this._.desiredZoom >= this.p._.minNativeZoom) this._setZoom(this._.desiredZoom);\n this._.desiredZoom = null;\n }\n }\n };\n\n Events.prototype._setZoom = function (newZoom) {\n var zoomSave = this.p.zoom;\n this.p.zoom = newZoom;\n this.p.trueZoom = Math.max(0, newZoom);\n if (this.p.zoom < 0) this.p.zoom = 0;\n if (this.p.zoom < this.p._.minNativeZoom) this.p.zoom = this.p._.minNativeZoom;\n if (this.p.zoom > this.p._.maxZoom) this.p.zoom = this.p._.maxZoom;\n this._.lastZoomDelta = Math.abs(this.p.zoom - zoomSave);\n };\n\n Events.prototype._matchPlanetsLODToPlanet = function () {\n for (var i = 0; i < this.p.planetsLOD.length; i++) {\n this.p.planetsLOD[i].matrix = this.p.planet.matrix;\n this.p.planetsLOD[i].position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.planetsLOD[i].rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n\n if (this.p.atmosphere) {\n this.p.atmosphere.matrix = this.p.planet.matrix;\n this.p.atmosphere.position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.atmosphere.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n };\n\n Events.prototype._refreshFrontGroupRotation = function () {\n this.p.frontGroup.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n };\n\n Events.prototype._updateMouseCoords = function (lng, lat, elev) {\n this.p.mouse.lng = lng;\n this.p.mouse.lat = lat;\n this.p.mouse.elev = elev;\n };\n\n Events.prototype.updateHoverInfoPosition = function () {\n if (this.hoverInfo) {\n this.hoverInfo.style.left = this._.containerXY.x + 14 + \"px\";\n this.hoverInfo.style.top = this._.containerXY.y + 14 + \"px\";\n }\n };\n\n Events.prototype._highlightFeature = function (lng, lat, type, obj, intersectionRaw, intersectionPoint) {\n var cursor = {\n type: 'Point',\n coordinates: [lng, lat]\n };\n var highlighted = false;\n\n switch (type) {\n case 'Sprite':\n case 'Line2':\n highlighted = true;\n if (obj.feature._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n obj.feature._highlighted = true;\n obj.restyle();\n this.setHoveredFeature({\n layerName: obj.layerName,\n type: type,\n obj: obj,\n feature: obj.feature,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n break;\n\n case 'Mesh':\n if (obj.layerType === 'curtain') {} else if (obj.layerType === 'model') {} else if (obj.contains) {\n for (var _i = 0, _a = Object.keys(obj.contains).reverse(); _i < _a.length; _i++) {\n var layerName = _a[_i];\n\n for (var _b = 0, _c = obj.contains[layerName].reverse(); _b < _c.length; _b++) {\n var f = _c[_b];\n var feature = Object.assign({}, f);\n\n if (feature.geometry.type.toLowerCase() === 'point') {\n feature = Object(_turf_circle__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(feature.geometry.coordinates, feature._radiusInMeters || 1, {\n steps: 12,\n units: 'meters',\n properties: feature.properties\n });\n }\n\n if (Object(_turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(feature, cursor)) {\n highlighted = true;\n if (f._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n f._highlighted = true;\n this.setHoveredFeature({\n layerName: layerName,\n type: type,\n obj: obj,\n feature: f,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n\n this.p._.tiledWorld.updateClampedRasterForTile(obj, layerName);\n\n break;\n }\n }\n\n if (highlighted) return;\n }\n }\n\n break;\n\n default:\n break;\n }\n\n if (!highlighted) {\n this._unhighlightHoveredFeature();\n }\n };\n\n Events.prototype._unhighlightHoveredFeature = function () {\n if (this.hoveredFeature) {\n this.hoveredFeature.feature._highlighted = false;\n\n switch (this.hoveredFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.hoveredFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.hoveredFeature.obj, this.hoveredFeature.layerName);\n\n break;\n\n default:\n break;\n }\n\n this.clearHoveredFeature();\n }\n };\n\n Events.prototype.setHoveredFeature = function (hoveredFeature) {\n this.hoveredFeature = hoveredFeature;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n }\n\n this.hoverInfo = document.createElement('div');\n this.hoverInfo.id = '_lithosphere_hover_info';\n var layer = this.p.layers.getLayerByName(this.hoveredFeature.layerName);\n\n if (layer && layer.useKeyAsHoverName) {\n var text = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getIn(this.hoveredFeature.feature.properties, layer.useKeyAsHoverName.split('.'));\n\n if (text != null) {\n this.hoverInfo.innerHTML = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].capitalizeFirstLetter(layer.useKeyAsHoverName + \": \" + text);\n this.hoverInfo.style.position = 'absolute';\n this.hoverInfo.style.background = 'black';\n this.hoverInfo.style.color = 'white';\n this.hoverInfo.style.fontSize = '16px';\n this.hoverInfo.style.fontFamily = 'sans-serif';\n this.hoverInfo.style.fontWeight = 'bold';\n this.hoverInfo.style.padding = '4px 8px';\n this.updateHoverInfoPosition();\n }\n }\n\n this.p._.container.appendChild(this.hoverInfo);\n\n this.p._.container.style.cursor = 'pointer';\n };\n\n Events.prototype.clearHoveredFeature = function () {\n this.hoveredFeature = null;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n this.p._.container.style.cursor = 'default';\n }\n };\n\n Events.prototype.setActiveFeature = function (activeFeature) {\n this.clearActiveFeature();\n this.activeFeature = activeFeature;\n this.activeFeature.feature._active = true;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n };\n\n Events.prototype.clearActiveFeature = function () {\n if (this.activeFeature) {\n this.activeFeature.feature._active = false;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n }\n\n this.activeFeature = null;\n };\n\n Events.prototype._setMissingElevation = function (mesh) {\n var _a, _b;\n\n if (mesh.noElevation != null) {\n var height = this.p.getElevationAtLngLat(mesh.noElevation.lng, mesh.noElevation.lat) || false;\n\n if (height) {\n var v = this.p.projection.lonLatToVector3(mesh.noElevation.lng, mesh.noElevation.lat, (height || 0) + (mesh.noElevation.elevOffset || 0) * this.p.options.exaggeration);\n mesh.position.set(v.x, v.y, v.z);\n delete mesh.noElevation;\n }\n }\n\n if (_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInZoomRange((_a = mesh.style) === null || _a === void 0 ? void 0 : _a.minZoom, (_b = mesh.style) === null || _b === void 0 ? void 0 : _b.maxZoom, this.p.zoom)) mesh.visible = true;else mesh.visible = false;\n };\n\n Events.prototype._attenuate = function () {\n var _this = this;\n\n var zoomDist = this.p._.cameras.camera.position.distanceTo(this.p._.cameras.controls.target);\n\n var attenuationFactor = zoomDist / 256;\n\n if (this.p.layers.vector) {\n this.p.layers.vector.forEach(function (vectorLayer) {\n if (vectorLayer.meshes && vectorLayer.meshes.children) {\n vectorLayer.meshes.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * (mesh.style.width || mesh.style.radius), attenuationFactor * (mesh.style.height || mesh.style.radius), attenuationFactor * mesh.style.radius);\n\n _this._setMissingElevation(mesh);\n }\n });\n }\n });\n }\n\n if (this.p.frontGroup.children) {\n this.p.frontGroup.children.forEach(function (child) {\n if (child.children && child.children.length > 0) {\n child.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * (mesh.style.width || mesh.style.radius), attenuationFactor * (mesh.style.height || mesh.style.radius), attenuationFactor * mesh.style.radius);\n\n _this._setMissingElevation(mesh);\n }\n });\n } else {\n if (child instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n child.scale.set(attenuationFactor * (mesh.style.width || mesh.style.radius), attenuationFactor * (mesh.style.height || mesh.style.radius), attenuationFactor * mesh.style.radius);\n\n _this._setMissingElevation(child);\n }\n }\n });\n }\n };\n\n return Events;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Events);\n\n//# sourceURL=webpack://LithoSphere/./src/core/events.ts?"); /***/ }), @@ -2007,7 +2007,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ren /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CRS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CRS */ \"./src/core/CRS.ts\");\n\nvar RadiusE;\n\n(function (RadiusE) {\n RadiusE[\"Major\"] = \"major\";\n RadiusE[\"Minor\"] = \"minor\";\n})(RadiusE || (RadiusE = {}));\n\nvar Projection = function () {\n function Projection(majorRadius, minorRadius, tileMapResource, trueTileResolution) {\n var _this = this;\n\n this.setRadius = function (radius, which) {\n if (which === void 0) {\n which = RadiusE.Major;\n }\n\n if (which.toLowerCase() == 'major') _this.radii.major = radius || _this.baseRadius;else if (which.toLowerCase() == 'minor') _this.radii.minor = radius || _this.radii.major || _this.baseRadius;\n };\n\n this.invertY = function (y, z) {\n var b = _this.crs.projection.bounds;\n\n if (_this.tileMapResource.crsCode === 'EPSG:4326') {\n return Math.pow(2, z) - 1 - y;\n }\n\n var s = _this.crs.scale(z);\n\n var max = _this.crs.transformation.transform(b.min, s);\n\n var yMax = Math.ceil(max.y / 256) - 1;\n return yMax - y;\n };\n\n this.toBounds = function (a, b) {\n var bounds = {\n min: {\n x: null,\n y: null\n },\n max: {\n x: null,\n y: null\n }\n };\n bounds.min.x = Math.min(a.x, b.x);\n bounds.max.x = Math.max(a.x, b.x);\n bounds.min.y = Math.min(a.y, b.y);\n bounds.max.y = Math.max(a.y, b.y);\n return bounds;\n };\n\n this.tileXYZ2NwSe = function (xyz, tileResolution, asBounds, stretchFactor) {\n if (_this.tileMapResource.proj == null) return null;\n stretchFactor = Math.max(stretchFactor || 1, 1);\n var stretchAmount = (stretchFactor - 1) * tileResolution;\n var nwPoint = {\n x: xyz.x * tileResolution - stretchAmount,\n y: xyz.y * tileResolution - stretchAmount\n };\n var sePoint = {\n x: nwPoint.x + tileResolution + stretchAmount * 2,\n y: nwPoint.y + tileResolution + stretchAmount * 2\n };\n\n var nw = _this.crs.pointToLatLng(nwPoint, xyz.z);\n\n var se = _this.crs.pointToLatLng(sePoint, xyz.z);\n\n if (asBounds) return _this.toBounds(_this.crs.project(nw), _this.crs.project(se));\n return {\n nw: nw,\n se: se\n };\n };\n\n this.tileXYZ2LatLng = function (x, y, z, flatXYZ) {\n if (_this.tileMapResource.proj == null) {\n var lng = x / Math.pow(2, z) * 360 - 180;\n var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z);\n var lat = 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n return {\n lat: lat,\n lng: lng\n };\n } else {\n y = -y;\n var easting = _this.trueTileResolution * x * _this.res[z] + _this.tileMapResource.origin[0];\n var northing = _this.trueTileResolution * y * _this.res[z] + _this.tileMapResource.origin[1];\n return _this.crs.unproject({\n x: easting,\n y: northing\n });\n }\n };\n\n this.latLngZ2TileXYZ = function (lat, lng, z, dontFloor) {\n if (_this.tileMapResource.proj == null) {\n var x = (lng + 180) / 360 * Math.pow(2, z);\n var y = (1 - Math.log(Math.tan(lat * (Math.PI / 180)) + 1 / Math.cos(lat * (Math.PI / 180))) / Math.PI) / 2 * Math.pow(2, z);\n\n if (dontFloor == null) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n\n return {\n x: x,\n y: y,\n z: z\n };\n } else {\n var p = _this.crs.project({\n lng: lng,\n lat: lat\n });\n\n var easting = p.x;\n var northing = p.y;\n var x = (easting - _this.tileMapResource.origin[0]) / (_this.trueTileResolution * _this.res[z]);\n var y = (northing - _this.tileMapResource.origin[1]) / (_this.trueTileResolution * _this.res[z]);\n y = -y;\n return {\n x: x,\n y: y,\n z: z\n };\n }\n };\n\n this.vector3ToLatLng = function (xyz) {\n var y = xyz.y;\n var z = xyz.z;\n xyz.y = -z;\n xyz.z = -y;\n var rs = _this.radii.major / _this.radiusScale;\n var rs2 = _this.radii.minor / _this.radiusScale;\n var r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2));\n var E2 = Math.pow(rs, 2) - Math.pow(rs2, 2);\n var F = 54 * Math.pow(rs, 2) * Math.pow(xyz.z, 2);\n var G = Math.pow(r, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) - Math.pow(_this.e, 2) * E2;\n var C = Math.pow(_this.e, 4) * F * Math.pow(r, 2) / Math.pow(G, 3);\n var S = Math.cbrt(1 + C + Math.sqrt(Math.pow(C, 2) + 2 * C));\n var P = F / (3 * Math.pow(S + 1 / S + 1, 2) * Math.pow(G, 2));\n var Q = Math.sqrt(1 + 2 * Math.pow(_this.e, 4) * P);\n var r0 = -(P * Math.pow(_this.e, 2) * r) / (1 + Q) + Math.sqrt(0.5 * Math.pow(rs, 2) * (1 + 1 / Q) - P * (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) / (Q * (1 + Q)) - 0.5 * P * Math.pow(r, 2));\n var U = Math.sqrt(r - Math.pow(_this.e, 2) * r0 + Math.pow(xyz.z, 2));\n var V = Math.sqrt(Math.pow(r - Math.pow(_this.e, 2) * r0, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2));\n var Z0 = Math.pow(rs2, 2) * xyz.z / (rs * V);\n var h = U * (1 - Math.pow(rs2, 2) / (rs * V));\n var phi = Math.atan((xyz.z + Math.pow(_this.ep, 2) * Z0) / r) * (180 / Math.PI);\n var lambda = -(Math.atan2(xyz.y, xyz.x) * (180 / Math.PI)) - 90;\n if (lambda < -180) lambda += 360;\n return {\n lat: phi,\n lng: lambda,\n height: h\n };\n };\n\n this.lonLatToVector3 = function (lon, lat, height) {\n var phi = lat * (Math.PI / 180);\n var theta = (lon - 180) * (Math.PI / 180);\n var x = (_this.radii.major + height) / _this.radiusScale * Math.cos(phi) * Math.sin(theta);\n var y = -(_this.radii.major + height) / _this.radiusScale * Math.sin(phi);\n var z = -(_this.radii.major + height) / _this.radiusScale * Math.cos(phi) * Math.cos(theta);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.rotatePoint3D = function (pt, angle, center) {\n if (center == undefined) center = {\n x: 0,\n y: 0,\n z: 0\n };\n var dx = pt.x - center.x;\n var dy = pt.y - center.y;\n var dz = pt.z - center.z;\n var sx = Math.sin(angle.x);\n var cx = Math.cos(angle.x);\n var sy = Math.sin(angle.y);\n var cy = Math.cos(angle.y);\n var sz = Math.sin(angle.z);\n var cz = Math.cos(angle.z);\n var x = center.x + dx * (cy * cz) + dy * (-cy * sz) + dz * sy;\n var y = center.y + dx * (cx * sz + sx * sy * cz) + dy * (cx * cz - sx * sy * sz) + dz * (-sx * cy);\n var z = center.z + dx * (sx * sz - cx * sy * cz) + dy * (sx * cz + cx * sy * sz) + dz * (cx * cy);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.lngLatDistBetween = function (lon1, lat1, lon2, lat2) {\n var R = _this.radii.major / _this.radiusScale;\n var φ1 = lat1 * (Math.PI / 180);\n var φ2 = lat2 * (Math.PI / 180);\n var Δφ = (lat2 - lat1) * (Math.PI / 180);\n var Δλ = (lon2 - lon1) * (Math.PI / 180);\n var a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) + Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c;\n };\n\n this._reset();\n\n this.setRadius(majorRadius, RadiusE.Major);\n this.setRadius(minorRadius, RadiusE.Minor);\n this.tileMapResource = tileMapResource || {\n bounds: null,\n origin: null,\n crsCode: null,\n epsg: null,\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.tileMapResource.crsCode = this.tileMapResource.crsCode || 'EPSG:4326';\n this.trueTileResolution = trueTileResolution || 256;\n\n if (this.tileMapResource.resunitsperpixel != null && this.tileMapResource.reszoomlevel != null) {\n var baseRes = this.tileMapResource.resunitsperpixel * Math.pow(2, this.tileMapResource.reszoomlevel);\n var res = [];\n\n for (var i = 0; i < 32; i++) {\n res.push(baseRes / Math.pow(2, i));\n }\n\n this.res = res;\n }\n\n var tmr = this.tileMapResource;\n this.crs = new _CRS__WEBPACK_IMPORTED_MODULE_0__[\"default\"](Number.isFinite(parseInt(tmr.crsCode[0])) ? \"EPSG:\" + tmr.epsg : tmr.crsCode, tmr.proj, {\n origin: [parseFloat(tmr.origin[0]), parseFloat(tmr.origin[1])],\n resolutions: this.res,\n bounds: [[parseFloat(tmr.bounds[0]), parseFloat(tmr.bounds[1])], [parseFloat(tmr.bounds[2]), parseFloat(tmr.bounds[3])]]\n }, parseFloat(this.radii.major));\n }\n\n Projection.prototype._reset = function () {\n this.baseRadius = 6371000;\n this.radiusScale = 1;\n this.radii = {\n major: this.baseRadius,\n minor: this.baseRadius\n };\n this.tileMapResource = {\n bounds: null,\n origin: null,\n crsCode: 'EPSG:4326',\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.e = 0;\n this.ep = 0;\n this.flatteningFactor = 0;\n };\n\n return Projection;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Projection);\n\n//# sourceURL=webpack://LithoSphere/./src/core/projection.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CRS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CRS */ \"./src/core/CRS.ts\");\n\nvar RadiusE;\n\n(function (RadiusE) {\n RadiusE[\"Major\"] = \"major\";\n RadiusE[\"Minor\"] = \"minor\";\n})(RadiusE || (RadiusE = {}));\n\nvar Projection = function () {\n function Projection(majorRadius, minorRadius, tileMapResource, trueTileResolution, radiusCutoff) {\n var _this = this;\n\n this.setRadius = function (radius, which) {\n if (which === void 0) {\n which = RadiusE.Major;\n }\n\n if (which.toLowerCase() == 'major') {\n _this.radii.major = radius || _this.baseRadius;\n if (_this.radii.major > _this.radiusCutoff) _this.radiusScale = _this.radii.major / _this.radiusCutoff;\n } else if (which.toLowerCase() == 'minor') _this.radii.minor = radius || _this.radii.major || _this.baseRadius;\n };\n\n this.invertY = function (y, z) {\n var b = _this.crs.projection.bounds;\n\n if (_this.tileMapResource.crsCode === 'EPSG:4326') {\n return Math.pow(2, z) - 1 - y;\n }\n\n var s = _this.crs.scale(z);\n\n var max = _this.crs.transformation.transform(b.min, s);\n\n var yMax = Math.ceil(max.y / 256) - 1;\n return yMax - y;\n };\n\n this.toBounds = function (a, b) {\n var bounds = {\n min: {\n x: null,\n y: null\n },\n max: {\n x: null,\n y: null\n }\n };\n bounds.min.x = Math.min(a.x, b.x);\n bounds.max.x = Math.max(a.x, b.x);\n bounds.min.y = Math.min(a.y, b.y);\n bounds.max.y = Math.max(a.y, b.y);\n return bounds;\n };\n\n this.tileXYZ2NwSe = function (xyz, tileResolution, asBounds, stretchFactor) {\n if (_this.tileMapResource.proj == null) return null;\n stretchFactor = Math.max(stretchFactor || 1, 1);\n var stretchAmount = (stretchFactor - 1) * tileResolution;\n var nwPoint = {\n x: xyz.x * tileResolution - stretchAmount,\n y: xyz.y * tileResolution - stretchAmount\n };\n var sePoint = {\n x: nwPoint.x + tileResolution + stretchAmount * 2,\n y: nwPoint.y + tileResolution + stretchAmount * 2\n };\n\n var nw = _this.crs.pointToLatLng(nwPoint, xyz.z);\n\n var se = _this.crs.pointToLatLng(sePoint, xyz.z);\n\n if (asBounds) return _this.toBounds(_this.crs.project(nw), _this.crs.project(se));\n return {\n nw: nw,\n se: se\n };\n };\n\n this.tileXYZ2LatLng = function (x, y, z, flatXYZ) {\n if (_this.tileMapResource.proj == null) {\n var lng = x / Math.pow(2, z) * 360 - 180;\n var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z);\n var lat = 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n return {\n lat: lat,\n lng: lng\n };\n } else {\n y = -y;\n var easting = _this.trueTileResolution * x * _this.res[z] + _this.tileMapResource.origin[0];\n var northing = _this.trueTileResolution * y * _this.res[z] + _this.tileMapResource.origin[1];\n return _this.crs.unproject({\n x: easting,\n y: northing\n });\n }\n };\n\n this.latLngZ2TileXYZ = function (lat, lng, z, dontFloor) {\n if (_this.tileMapResource.proj == null) {\n var x = (lng + 180) / 360 * Math.pow(2, z);\n var y = (1 - Math.log(Math.tan(lat * (Math.PI / 180)) + 1 / Math.cos(lat * (Math.PI / 180))) / Math.PI) / 2 * Math.pow(2, z);\n\n if (dontFloor == null) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n\n return {\n x: x,\n y: y,\n z: z\n };\n } else {\n var p = _this.crs.project({\n lng: lng,\n lat: lat\n });\n\n var easting = p.x;\n var northing = p.y;\n var x = (easting - _this.tileMapResource.origin[0]) / (_this.trueTileResolution * _this.res[z]);\n var y = (northing - _this.tileMapResource.origin[1]) / (_this.trueTileResolution * _this.res[z]);\n y = -y;\n return {\n x: x,\n y: y,\n z: z\n };\n }\n };\n\n this.vector3ToLatLng = function (xyz) {\n var y = xyz.y;\n var z = xyz.z;\n xyz.y = -z;\n xyz.z = -y;\n var rs = _this.radii.major / _this.radiusScale;\n var rs2 = _this.radii.minor / _this.radiusScale;\n var r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2));\n var E2 = Math.pow(rs, 2) - Math.pow(rs2, 2);\n var F = 54 * Math.pow(rs, 2) * Math.pow(xyz.z, 2);\n var G = Math.pow(r, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) - Math.pow(_this.e, 2) * E2;\n var C = Math.pow(_this.e, 4) * F * Math.pow(r, 2) / Math.pow(G, 3);\n var S = Math.cbrt(1 + C + Math.sqrt(Math.pow(C, 2) + 2 * C));\n var P = F / (3 * Math.pow(S + 1 / S + 1, 2) * Math.pow(G, 2));\n var Q = Math.sqrt(1 + 2 * Math.pow(_this.e, 4) * P);\n var r0 = -(P * Math.pow(_this.e, 2) * r) / (1 + Q) + Math.sqrt(0.5 * Math.pow(rs, 2) * (1 + 1 / Q) - P * (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) / (Q * (1 + Q)) - 0.5 * P * Math.pow(r, 2));\n var U = Math.sqrt(r - Math.pow(_this.e, 2) * r0 + Math.pow(xyz.z, 2));\n var V = Math.sqrt(Math.pow(r - Math.pow(_this.e, 2) * r0, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2));\n var Z0 = Math.pow(rs2, 2) * xyz.z / (rs * V);\n var h = U * (1 - Math.pow(rs2, 2) / (rs * V));\n var phi = Math.atan((xyz.z + Math.pow(_this.ep, 2) * Z0) / r) * (180 / Math.PI);\n var lambda = -(Math.atan2(xyz.y, xyz.x) * (180 / Math.PI)) - 90;\n if (lambda < -180) lambda += 360;\n return {\n lat: phi,\n lng: lambda,\n height: h\n };\n };\n\n this.lonLatToVector3 = function (lon, lat, height) {\n var phi = lat * (Math.PI / 180);\n var theta = (lon - 180) * (Math.PI / 180);\n var h = _this.radii.major / _this.radiusScale + height;\n var x = h * Math.cos(phi) * Math.sin(theta);\n var y = -h * Math.sin(phi);\n var z = -h * Math.cos(phi) * Math.cos(theta);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.rotatePoint3D = function (pt, angle, center) {\n if (center == undefined) center = {\n x: 0,\n y: 0,\n z: 0\n };\n var dx = pt.x - center.x;\n var dy = pt.y - center.y;\n var dz = pt.z - center.z;\n var sx = Math.sin(angle.x);\n var cx = Math.cos(angle.x);\n var sy = Math.sin(angle.y);\n var cy = Math.cos(angle.y);\n var sz = Math.sin(angle.z);\n var cz = Math.cos(angle.z);\n var x = center.x + dx * (cy * cz) + dy * (-cy * sz) + dz * sy;\n var y = center.y + dx * (cx * sz + sx * sy * cz) + dy * (cx * cz - sx * sy * sz) + dz * (-sx * cy);\n var z = center.z + dx * (sx * sz - cx * sy * cz) + dy * (sx * cz + cx * sy * sz) + dz * (cx * cy);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.lngLatDistBetween = function (lon1, lat1, lon2, lat2) {\n var R = _this.radii.major / _this.radiusScale;\n var φ1 = lat1 * (Math.PI / 180);\n var φ2 = lat2 * (Math.PI / 180);\n var Δφ = (lat2 - lat1) * (Math.PI / 180);\n var Δλ = (lon2 - lon1) * (Math.PI / 180);\n var a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) + Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c;\n };\n\n this.radiusCutoff = radiusCutoff || Infinity;\n\n this._reset();\n\n this.setRadius(majorRadius, RadiusE.Major);\n this.setRadius(minorRadius, RadiusE.Minor);\n this.tileMapResource = tileMapResource || {\n bounds: null,\n origin: null,\n crsCode: null,\n epsg: null,\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.tileMapResource.crsCode = this.tileMapResource.crsCode || 'EPSG:4326';\n this.trueTileResolution = trueTileResolution || 256;\n\n if (this.tileMapResource.resunitsperpixel != null && this.tileMapResource.reszoomlevel != null) {\n var baseRes = this.tileMapResource.resunitsperpixel * Math.pow(2, this.tileMapResource.reszoomlevel);\n var res = [];\n\n for (var i = 0; i < 32; i++) {\n res.push(baseRes / Math.pow(2, i));\n }\n\n this.res = res;\n }\n\n var tmr = this.tileMapResource;\n this.crs = new _CRS__WEBPACK_IMPORTED_MODULE_0__[\"default\"](Number.isFinite(parseInt(tmr.crsCode[0])) ? \"EPSG:\" + tmr.epsg : tmr.crsCode, tmr.proj, tmr.origin != null ? {\n origin: [parseFloat(tmr.origin[0]), parseFloat(tmr.origin[1])],\n resolutions: this.res,\n bounds: [[parseFloat(tmr.bounds[0]), parseFloat(tmr.bounds[1])], [parseFloat(tmr.bounds[2]), parseFloat(tmr.bounds[3])]]\n } : {\n origin: [0, 0],\n resolutions: this.res,\n bounds: [0, 0, 0, 0]\n }, parseFloat(this.radii.major));\n }\n\n Projection.prototype._reset = function () {\n this.baseRadius = 6371000;\n this.radiusScale = 1;\n this.radii = {\n major: this.baseRadius,\n minor: this.baseRadius\n };\n this.tileMapResource = {\n bounds: null,\n origin: null,\n crsCode: 'EPSG:4326',\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.e = 0;\n this.ep = 0;\n this.flatteningFactor = 0;\n };\n\n return Projection;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Projection);\n\n//# sourceURL=webpack://LithoSphere/./src/core/projection.ts?"); /***/ }), @@ -2055,7 +2055,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ___W /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\nvar opacityTimeout = null;\n\nvar ClampedLayerer = function () {\n function ClampedLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == layerObj.name) {\n _this.p.clamped[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.clamped.push(layerObj);\n\n _this.p.clamped.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n if (typeof callback === 'function') callback();\n };\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.preDrawn === true && layerObj.hasOwnProperty('data') || (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && layerObj.hasOwnProperty('minZoom') && layerObj.hasOwnProperty('maxZoom'))) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n if (!layerObj.hasOwnProperty('opacity')) layerObj.opacity = 1;\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for clamped layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid clamped layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.clamped.forEach(function (layer) {\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.updateAllRasters();\n\n return true;\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.clamped[i];\n\n if (name === layer.name) {\n clearTimeout(opacityTimeout);\n opacityTimeout = setTimeout(function () {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n\n if (_this.p.p.zoom >= layer.minZoom && _this.p.p.zoom <= layer.maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n }, 250);\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == name) {\n var minZoom = _this.p.clamped[i].minZoom;\n var maxZoom = _this.p.clamped[i].maxZoom;\n\n _this.p.clamped.splice(i, 1);\n\n if (_this.p.p.zoom >= minZoom && _this.p.p.zoom <= maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.getClampedTexture = function (i, xyz) {\n var _a;\n\n var scaleFactor = 0.5;\n var c = _this.p.clamped[i];\n var canvas = document.createElement('canvas');\n canvas.id = 'vectorsastile';\n canvas.width = 256 / scaleFactor;\n scaleFactor = scaleFactor * Math.pow(2, _this.p.p.zoom - xyz.z);\n canvas.height = canvas.width;\n var ctx = canvas.getContext('2d');\n var tileXYZ;\n var overlappedFeatures = [];\n\n if (scaleFactor < 128) {\n if (c.preDrawn) {\n ctx.imageSmoothingEnabled = false;\n\n if (c.data && c.data[xyz.z] && c.data[xyz.z][xyz.x] && c.data[xyz.z][xyz.x][xyz.y] != null) {\n ctx.drawImage(c.data[xyz.z][xyz.x][xyz.y], 0, 0, canvas.width, canvas.height);\n }\n } else {\n for (var _i = 0, _b = c.geojson.features; _i < _b.length; _i++) {\n var f = _b[_i];\n\n var style = _this.p.getFeatureStyle(c, f);\n\n var doesFeatureOverlapTile = false;\n\n if (style.fillColor.substring(0, 3).toLowerCase() != 'rgb') {\n var col = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hexToRGB(style.fillColor);\n\n if (col) {\n style.fillColor = 'rgba(' + col.r + ',' + col.g + ',' + col.b + ',' + style.fillOpacity + ')';\n }\n } else {\n var rgb = style.fillColor.substring(4, style.fillColor.length - 1).replace(/ /g, '').split(',');\n style.fillColor = 'rgba(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ',' + style.fillOpacity + ')';\n }\n\n ctx.fillStyle = style.fillColor;\n ctx.strokeStyle = style.color;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n ctx.globalAlpha = c.opacity;\n ctx.lineCap = 'round';\n style.radius *= 1 / scaleFactor * 1 || 10;\n\n if ((f.geometry.type == 'Polygon' || f.geometry.type == 'MultiPolygon') && f.geometry.coordinates[0]) {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n if (typeof f.geometry.coordinates[p][0][0] === 'number') {\n for (var i_1 = 0; i_1 < f.geometry.coordinates[p].length; i_1++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_1][1], f.geometry.coordinates[p][i_1][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_1 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n } else if (typeof f.geometry.coordinates[p][0][0][0] === 'number') {\n for (var i_2 = 0; i_2 < f.geometry.coordinates[p].length; i_2++) {\n for (var j = 0; j < f.geometry.coordinates[p][i_2].length; j++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_2][j][1], f.geometry.coordinates[p][i_2][j][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (j == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n }\n }\n\n ctx.stroke();\n ctx.closePath();\n ctx.fill();\n }\n } else if (f.geometry.type == 'LineString' || f.geometry.type == 'MultiLineString') {\n if (typeof f.geometry.coordinates[0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][1], f.geometry.coordinates[p][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (p == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n } else if (typeof f.geometry.coordinates[0][0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n for (var i_3 = 0; i_3 < f.geometry.coordinates[p].length; i_3++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_3][1], f.geometry.coordinates[p][i_3][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_3 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n }\n }\n } else if (f.geometry.type.toLowerCase() === 'point') {\n var lnglat = void 0;\n\n if (typeof f.geometry.coordinates[0] === 'number') {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[1], f.geometry.coordinates[0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0],\n lat: f.geometry.coordinates[1]\n };\n } else {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[0][1], f.geometry.coordinates[0][0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0][0],\n lat: f.geometry.coordinates[0][1]\n };\n }\n\n var lnglatRadiusAway = _this.p.p.projection.tileXYZ2LatLng(tileXYZ.x + (style.radius + ctx.lineWidth) / canvas.width, tileXYZ.y, _this.p.p.zoom);\n\n f._radiusInMeters = _this.p.p.projection.lngLatDistBetween(lnglat.lng, lnglat.lat, lnglatRadiusAway.lng, lnglatRadiusAway.lat);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if ((_a = c.style) === null || _a === void 0 ? void 0 : _a.bearing) {\n var unit = c.style.bearing.angleUnit || 'deg';\n var bearingProp = c.style.bearing.angleProp || false;\n var yaw = 0;\n\n if (bearingProp !== false) {\n yaw = parseFloat(_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(f.properties, bearingProp, 0));\n\n if (unit === 'deg') {\n yaw = yaw * (Math.PI / 180);\n }\n }\n\n yaw += Math.PI;\n var startingPoint = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw - 45 * (Math.PI / 180));\n var indicator = [_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius * 2\n }, [canvasX, canvasY], yaw), _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw + 45 * (Math.PI / 180)), startingPoint];\n ctx.fillStyle = c.style.bearing.color || 'red';\n ctx.lineWidth = 1 / scaleFactor * 1;\n ctx.beginPath();\n ctx.moveTo(startingPoint.x, startingPoint.y);\n indicator.forEach(function (ind) {\n ctx.lineTo(ind.x, ind.y);\n });\n ctx.closePath();\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = style.fillColor;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n }\n\n ctx.beginPath();\n ctx.arc(canvasX, canvasY, style.radius, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n if (doesFeatureOverlapTile) {\n f._highlighted = f._highlighted || false;\n overlappedFeatures.push(f);\n }\n }\n }\n }\n\n return {\n canvas: canvas,\n features: overlappedFeatures\n };\n };\n\n this.p = parent;\n }\n\n return ClampedLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ClampedLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/clamped.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\nvar opacityTimeout = null;\n\nvar ClampedLayerer = function () {\n function ClampedLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == layerObj.name) {\n _this.p.clamped[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.clamped.push(layerObj);\n\n _this.p.clamped.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n if (typeof callback === 'function') callback();\n };\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.preDrawn === true && layerObj.hasOwnProperty('data') || layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson'))) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n if (!layerObj.hasOwnProperty('opacity')) layerObj.opacity = 1;\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for clamped layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid clamped layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.clamped.forEach(function (layer) {\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.updateAllRasters();\n\n return true;\n }\n\n return false;\n };\n\n this.orderLayers = function (ordering) {\n var missingCount = 0;\n\n _this.p.clamped.forEach(function (layer) {\n var newOrder = ordering.indexOf(layer.name);\n\n if (newOrder >= 0) {\n layer.order = _this.p.clamped.length - newOrder;\n } else {\n layer.order = _this.p.clamped.length - ordering.length - missingCount;\n missingCount++;\n }\n });\n\n _this.p.clamped.sort(function (a, b) {\n return a.order - b.order;\n });\n\n return true;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.clamped[i];\n\n if (name === layer.name) {\n clearTimeout(opacityTimeout);\n opacityTimeout = setTimeout(function () {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n\n if (_this.p.p.zoom >= layer.minZoom && _this.p.p.zoom <= layer.maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n }, 250);\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == name) {\n var minZoom = _this.p.clamped[i].minZoom;\n var maxZoom = _this.p.clamped[i].maxZoom;\n\n _this.p.clamped.splice(i, 1);\n\n if (_this.p.p.zoom >= minZoom && _this.p.p.zoom <= maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.getClampedTexture = function (i, xyz) {\n var _a;\n\n var scaleFactor = 0.5;\n var c = _this.p.clamped[i];\n var canvas = document.createElement('canvas');\n canvas.id = 'vectorsastile';\n canvas.width = 256 / scaleFactor;\n scaleFactor = scaleFactor * Math.pow(2, _this.p.p.zoom - xyz.z);\n canvas.height = canvas.width;\n var ctx = canvas.getContext('2d');\n var tileXYZ;\n var overlappedFeatures = [];\n\n if (scaleFactor < 128) {\n if (c.preDrawn) {\n ctx.imageSmoothingEnabled = false;\n\n if (c.data && c.data[xyz.z] && c.data[xyz.z][xyz.x] && c.data[xyz.z][xyz.x][xyz.y] != null) {\n ctx.drawImage(c.data[xyz.z][xyz.x][xyz.y], 0, 0, canvas.width, canvas.height);\n }\n } else {\n for (var _i = 0, _b = c.geojson.features; _i < _b.length; _i++) {\n var f = _b[_i];\n\n var style = _this.p.getFeatureStyle(c, f);\n\n if (!_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isInZoomRange(style.minZoom != null ? style.minZoom : c.minZoom, style.maxZoom != null ? style.maxZoom : c.maxZoom, _this.p.p.zoom)) continue;\n var doesFeatureOverlapTile = false;\n\n if (style.fillColor.substring(0, 3).toLowerCase() != 'rgb') {\n var col = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hexToRGB(style.fillColor);\n\n if (col) {\n style.fillColor = 'rgba(' + col.r + ',' + col.g + ',' + col.b + ',' + style.fillOpacity + ')';\n }\n } else {\n var rgb = style.fillColor.substring(4, style.fillColor.length - 1).replace(/ /g, '').split(',');\n style.fillColor = 'rgba(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ',' + style.fillOpacity + ')';\n }\n\n ctx.fillStyle = style.fillColor;\n ctx.strokeStyle = style.color;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n ctx.globalAlpha = c.opacity;\n ctx.lineCap = 'round';\n style.radius *= 1 / scaleFactor * 1 || 10;\n\n if ((f.geometry.type == 'Polygon' || f.geometry.type == 'MultiPolygon') && f.geometry.coordinates[0]) {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n if (typeof f.geometry.coordinates[p][0][0] === 'number') {\n for (var i_1 = 0; i_1 < f.geometry.coordinates[p].length; i_1++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_1][1], f.geometry.coordinates[p][i_1][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_1 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n } else if (typeof f.geometry.coordinates[p][0][0][0] === 'number') {\n for (var i_2 = 0; i_2 < f.geometry.coordinates[p].length; i_2++) {\n for (var j = 0; j < f.geometry.coordinates[p][i_2].length; j++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_2][j][1], f.geometry.coordinates[p][i_2][j][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (j == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n }\n }\n\n ctx.stroke();\n ctx.closePath();\n ctx.fill();\n }\n } else if (f.geometry.type == 'LineString' || f.geometry.type == 'MultiLineString') {\n if (typeof f.geometry.coordinates[0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][1], f.geometry.coordinates[p][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (p == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n } else if (typeof f.geometry.coordinates[0][0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n for (var i_3 = 0; i_3 < f.geometry.coordinates[p].length; i_3++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_3][1], f.geometry.coordinates[p][i_3][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_3 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n }\n }\n } else if (f.geometry.type.toLowerCase() === 'point') {\n var lnglat = void 0;\n\n if (typeof f.geometry.coordinates[0] === 'number') {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[1], f.geometry.coordinates[0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0],\n lat: f.geometry.coordinates[1]\n };\n } else {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[0][1], f.geometry.coordinates[0][0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0][0],\n lat: f.geometry.coordinates[0][1]\n };\n }\n\n var lnglatRadiusAway = _this.p.p.projection.tileXYZ2LatLng(tileXYZ.x + (style.radius + ctx.lineWidth) / canvas.width, tileXYZ.y, _this.p.p.zoom);\n\n f._radiusInMeters = _this.p.p.projection.lngLatDistBetween(lnglat.lng, lnglat.lat, lnglatRadiusAway.lng, lnglatRadiusAway.lat);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (f.properties.annotation === true) {\n var text = f.properties.name || '';\n var fontXOffset = 10;\n var fontSize = style.fontSize || '16px';\n fontSize = parseInt(fontSize.replace('px', '')) * 1.2;\n ctx.font = fontSize + \"pt sans-serif\";\n var heightOverflow = 2;\n var textSize = {\n width: ctx.measureText(text).width + fontXOffset * 2,\n height: fontSize + heightOverflow\n };\n var rotAngle = -(style.rotation || 0) * Math.PI / 180;\n ctx.translate(canvasX, canvasY);\n ctx.rotate(rotAngle);\n ctx.translate(-canvasX, -canvasY);\n ctx.fillStyle = style.color;\n ctx.fillRect(canvasX, canvasY - textSize.height + heightOverflow / 2, textSize.width, textSize.height);\n ctx.fillStyle = style.fillColor;\n ctx.fillText(text, canvasX + fontXOffset, canvasY);\n var anchorRadius = 6;\n ctx.lineWidth = anchorRadius;\n ctx.beginPath();\n ctx.arc(canvasX, canvasY, 8, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n ctx.translate(canvasX, canvasY);\n ctx.rotate(-rotAngle);\n ctx.translate(-canvasX, -canvasY);\n } else {\n if ((_a = c.style) === null || _a === void 0 ? void 0 : _a.bearing) {\n var unit = c.style.bearing.angleUnit || 'deg';\n var bearingProp = c.style.bearing.angleProp || false;\n var yaw = 0;\n\n if (bearingProp !== false) {\n yaw = parseFloat(_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(f.properties, bearingProp, 0));\n\n if (unit === 'deg') {\n yaw = yaw * (Math.PI / 180);\n }\n }\n\n yaw += Math.PI;\n var startingPoint = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw - 45 * (Math.PI / 180));\n var indicator = [_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius * 2\n }, [canvasX, canvasY], yaw), _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw + 45 * (Math.PI / 180)), startingPoint];\n ctx.fillStyle = c.style.bearing.color || 'red';\n ctx.lineWidth = 1 / scaleFactor * 1;\n ctx.beginPath();\n ctx.moveTo(startingPoint.x, startingPoint.y);\n indicator.forEach(function (ind) {\n ctx.lineTo(ind.x, ind.y);\n });\n ctx.closePath();\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = style.fillColor;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n }\n\n ctx.beginPath();\n ctx.arc(canvasX, canvasY, style.radius, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n if (doesFeatureOverlapTile) {\n f._highlighted = f._highlighted || false;\n overlappedFeatures.push(f);\n }\n }\n }\n }\n\n return {\n canvas: canvas,\n features: overlappedFeatures\n };\n };\n\n this.p = parent;\n }\n\n return ClampedLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ClampedLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/clamped.ts?"); /***/ }), @@ -2079,7 +2079,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n/* harmony import */ var _tile3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tile3d */ \"./src/layers/tile3d.ts\");\n/* harmony import */ var _tile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tile */ \"./src/layers/tile.ts\");\n/* harmony import */ var _clamped__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./clamped */ \"./src/layers/clamped.ts\");\n/* harmony import */ var _vector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vector */ \"./src/layers/vector.ts\");\n/* harmony import */ var _curtain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curtain */ \"./src/layers/curtain.ts\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model */ \"./src/layers/model.ts\");\n\n\n\n\n\n\n\n\nvar Layers = function () {\n function Layers(parent) {\n var _this = this;\n\n this.addLayer = function (type, layerObj, callback, sI) {\n if (layerObj.on == 1) layerObj.on = true;else if (layerObj.on == 0) layerObj.on = false;\n layerObj._type = type;\n if (_this._.layerers[type]) _this._.layerers[type].add(layerObj, callback);else console.warn(\"Cannot add unknown layer type \" + type + \".\");\n };\n\n this.removeLayer = function (name) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didRemove = _this._.layerers[type].remove(name);\n\n if (didRemove) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.toggleLayer = function (name, on) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didToggle = _this._.layerers[type].toggle(name, on);\n\n if (didToggle) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerOpacity = function (name, opacity) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didOpacity = _this._.layerers[type].setOpacity(name, parseFloat(opacity));\n\n if (didOpacity) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerFilterEffect = function (name, filter, value) {\n var allowableFilterEffects = ['brightness', 'contrast', 'saturation', 'blendCode'];\n\n if (!allowableFilterEffects.includes(filter)) {\n console.warn(\"Filter \" + filter + \" must be one of: \" + allowableFilterEffects.toString() + \".\");\n return false;\n }\n\n var didFilter = _this._.layerers.tile.setFilterEffect(name, filter, parseFloat(value));\n\n if (!didFilter) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerSpecificOptions = function (name, options) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n if (typeof _this._.layerers[type].setLayerSpecificOptions === 'function') {\n var didOptions = _this._.layerers[type].setLayerSpecificOptions(name, options);\n\n if (didOptions) foundMatch = true;\n }\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.findHighestMaxZoom = function () {\n var highest = 0;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].maxZoom > highest) {\n highest = _this.tile[l].maxZoom;\n }\n }\n\n return highest;\n };\n\n this.findLowestMinZoom = function () {\n var lowest = Infinity;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].minZoom < lowest) {\n lowest = _this.tile[l].minZoom;\n }\n }\n\n return lowest;\n };\n\n this.getFeatureStyleProp = function (value, feature) {\n if (value != null && typeof value === 'string' && value.includes('=')) {\n var propValue = null;\n var split = value.split('=');\n propValue = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, split[1].split('.'));\n return propValue;\n } else {\n return value;\n }\n };\n\n this.getLayerByName = function (layerName) {\n for (var type in _this.all) {\n for (var i = 0; i < _this.all[type].length; i++) {\n if (_this.all[type][i].name === layerName) return _this.all[type][i];\n }\n }\n\n return null;\n };\n\n this.hasLayer = function (layerName) {\n return _this.getLayerByName(layerName) != null;\n };\n\n this.getFeatureStyle = function (layer, feature, isStrokeless) {\n var _a, _b;\n\n var style = JSON.parse(JSON.stringify(_this.baseStyle));\n\n if (layer.style) {\n var geomType = feature.geometry.type.toLowerCase();\n\n for (var key in style) {\n if (layer.style.default && layer.style.default[key] != null) {\n var defaultOverride = _this.getFeatureStyleProp(layer.style.default[key], feature);\n\n style[key] = defaultOverride != null ? defaultOverride : style[key];\n }\n\n if (geomType === 'point' && layer.style.point) {\n var pointOverride = _this.getFeatureStyleProp(layer.style.point[key], feature);\n\n style[key] = pointOverride != null ? pointOverride : style[key];\n } else if (geomType === 'linestring' && layer.style.line) {\n var lineOverride = _this.getFeatureStyleProp(layer.style.line[key], feature);\n\n style[key] = lineOverride != null ? lineOverride : style[key];\n } else if (geomType === 'polygon' && layer.style.polygon) {\n var polygonOverride = _this.getFeatureStyleProp(layer.style.polygon[key], feature);\n\n style[key] = polygonOverride != null ? polygonOverride : style[key];\n }\n\n if (layer.style.byProp) {\n for (var propPath in layer.style.byProp) {\n var path = propPath.split(':')[0].split('=')[1];\n var value = propPath.split(':')[1];\n\n if (_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, path.split('.')) == value) {\n var propOverride = _this.getFeatureStyleProp(layer.style.byProp[propPath][key], feature);\n\n style[key] = propOverride != null ? propOverride : style[key];\n }\n }\n }\n\n if (layer.style.letPropertiesStyleOverride === true) {\n var styleOverride = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn((_a = feature.properties) === null || _a === void 0 ? void 0 : _a.style, key);\n style[key] = styleOverride != null ? styleOverride : style[key];\n }\n }\n }\n\n if (style.fillColor === 'none') style.fillColor = 'rgba(0,0,0,0)';\n var type = ((_b = feature.geometry) === null || _b === void 0 ? void 0 : _b.type) ? feature.geometry.type.toLowerCase() : '';\n\n if (feature._active) {\n if (_this.p.options.canBecomeActive !== false && layer.canBecomeActive !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeActive !== false)) style.fillColor = _this.p.options.activeColor || 'red';\n } else if (feature._highlighted) {\n if (_this.p.options.canBecomeHighlighted !== false && layer.canBecomeHighlighted !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeHighlighted !== false)) style.fillColor = _this.p.options.highlightColor || 'yellow';\n }\n\n if (isStrokeless === true) {\n style.color = style.fillColor;\n }\n\n return style;\n };\n\n this._onMouseMove = function (intersectedLL, e, obj, intersectionRaw, intersectionPoint) {\n var _a;\n\n if (obj.layerType && _this[obj.layerType]) {\n var layers = _this[obj.layerType];\n\n for (var l in layers) {\n if (((_a = obj.parent) === null || _a === void 0 ? void 0 : _a.uuid) === layers[l].curtain.uuid) if (typeof layers[l].onMouseMove === 'function') layers[l].onMouseMove(e, layers[l], obj, intersectionRaw, intersectedLL, intersectionPoint);\n }\n }\n };\n\n this.p = parent;\n this.baseStyle = {\n fillColor: 'rgb(0,0,0)',\n fillOpacity: 0.4,\n color: 'rgb(255,255,255)',\n weight: 2,\n radius: 6\n };\n this._ = {\n layerers: {\n tile3d: new _tile3d__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this),\n tile: new _tile__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this),\n clamped: new _clamped__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this),\n vector: new _vector__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this),\n curtain: new _curtain__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this),\n model: new _model__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this)\n }\n };\n\n this._reset();\n }\n\n Layers.prototype._reset = function () {\n this.tile3d = [];\n this.tile = [];\n this.clamped = [];\n this.vector = [];\n this.curtain = [];\n this.model = [];\n this.all = {\n tile3d: this.tile3d,\n tile: this.tile,\n clamped: this.clamped,\n vector: this.vector,\n curtain: this.curtain,\n model: this.model\n };\n };\n\n return Layers;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Layers);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/index.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n/* harmony import */ var _tile3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tile3d */ \"./src/layers/tile3d.ts\");\n/* harmony import */ var _tile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tile */ \"./src/layers/tile.ts\");\n/* harmony import */ var _clamped__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./clamped */ \"./src/layers/clamped.ts\");\n/* harmony import */ var _vector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vector */ \"./src/layers/vector.ts\");\n/* harmony import */ var _curtain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curtain */ \"./src/layers/curtain.ts\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model */ \"./src/layers/model.ts\");\n\n\n\n\n\n\n\n\nvar Layers = function () {\n function Layers(parent) {\n var _this = this;\n\n this.addLayer = function (type, layerObj, callback, sI) {\n var _a;\n\n if (layerObj.on == 1) layerObj.on = true;else if (layerObj.on == 0) layerObj.on = false;\n layerObj._type = type;\n\n if (((_a = layerObj.order) === null || _a === void 0 ? void 0 : _a.length) != null) {\n layerObj.order = _this.getDesiredOrder(layerObj.name, type, layerObj.order);\n }\n\n if (layerObj.order == null) layerObj.order = _this.all[type].length;\n if (_this._.layerers[type]) _this._.layerers[type].add(layerObj, callback);else console.warn(\"Cannot add unknown layer type \" + type + \".\");\n };\n\n this.removeLayer = function (name) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didRemove = _this._.layerers[type].remove(name);\n\n if (didRemove) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.toggleLayer = function (name, on) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didToggle = _this._.layerers[type].toggle(name, on);\n\n if (didToggle) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.orderLayers = function (ordering) {\n var orderingTyped = {};\n ordering.forEach(function (name) {\n var layer = _this.getLayerByName(name);\n\n if (layer && layer._type) {\n if (orderingTyped[layer._type] == null) orderingTyped[layer._type] = [];\n\n orderingTyped[layer._type].push(name);\n }\n });\n var hit = false;\n\n for (var type in orderingTyped) {\n if (typeof _this._.layerers[type].orderLayers === 'function') {\n _this._.layerers[type].orderLayers(orderingTyped[type]);\n\n hit = true;\n }\n }\n\n if (hit) {\n _this.p._.tiledWorld.removeAllTiles();\n }\n\n return true;\n };\n\n this.getDesiredOrder = function (name, type, ordering) {\n var orderingTyped = {};\n ordering.forEach(function (layerName, idx) {\n var layer = _this.getLayerByName(layerName);\n\n if (layer && layer._type) {\n if (orderingTyped[layer._type] == null) orderingTyped[layer._type] = [];\n\n orderingTyped[layer._type].push({\n name: layer.name,\n order: layer.order,\n index: idx\n });\n }\n });\n\n if (orderingTyped[type]) {\n var index = ordering.indexOf(name);\n var desiredOrder = 0;\n\n for (var i = 0; i < orderingTyped[type].length; i++) {\n if (index > orderingTyped[type][i].index) {\n if (i == orderingTyped[type].length - 1) desiredOrder = orderingTyped[type][i].index + 1;else desiredOrder = (orderingTyped[type][i].order + orderingTyped[type][i + 1].order) / 2;\n return desiredOrder;\n }\n }\n\n if (orderingTyped[type].length > 0) return orderingTyped[type][0].order + 1;\n }\n\n if (ordering.includes(name)) return ordering.length - ordering.indexOf(name) - 1;\n return 0;\n };\n\n this.setLayerOpacity = function (name, opacity) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didOpacity = _this._.layerers[type].setOpacity(name, parseFloat(opacity));\n\n if (didOpacity) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerFilterEffect = function (name, filter, value) {\n var allowableFilterEffects = ['brightness', 'contrast', 'saturation', 'blendCode'];\n\n if (!allowableFilterEffects.includes(filter)) {\n console.warn(\"Filter \" + filter + \" must be one of: \" + allowableFilterEffects.toString() + \".\");\n return false;\n }\n\n var didFilter = _this._.layerers.tile.setFilterEffect(name, filter, parseFloat(value));\n\n if (!didFilter) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerSpecificOptions = function (name, options) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n if (typeof _this._.layerers[type].setLayerSpecificOptions === 'function') {\n var didOptions = _this._.layerers[type].setLayerSpecificOptions(name, options);\n\n if (didOptions) foundMatch = true;\n }\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.findHighestMaxZoom = function () {\n var highest = 0;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].maxZoom > highest) {\n highest = _this.tile[l].maxZoom;\n }\n }\n\n return highest;\n };\n\n this.findLowestMinZoom = function () {\n var lowest = Infinity;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].minZoom < lowest) {\n lowest = _this.tile[l].minZoom;\n }\n }\n\n return lowest;\n };\n\n this.getLayerByName = function (layerName) {\n for (var type in _this.all) {\n for (var i = 0; i < _this.all[type].length; i++) {\n if (_this.all[type][i].name === layerName) return _this.all[type][i];\n }\n }\n\n return null;\n };\n\n this.hasLayer = function (layerName) {\n return _this.getLayerByName(layerName) != null;\n };\n\n this.getFeatureStyleProp = function (value, feature) {\n if (value != null && typeof value === 'string' && value.includes('=')) {\n var propValue = null;\n var split = value.split('=');\n propValue = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, split[1].split('.'));\n return propValue;\n } else {\n return value;\n }\n };\n\n this.getBaseStyle = function (feature, type, geomType) {\n var _a;\n\n var baseStyle = {\n fillColor: 'rgb(0,0,0)',\n fillOpacity: 0.4,\n color: 'rgb(255,255,255)',\n weight: 2,\n radius: 6\n };\n\n if (((_a = feature === null || feature === void 0 ? void 0 : feature.properties) === null || _a === void 0 ? void 0 : _a.annotation) === true) {\n baseStyle.fontSize = '16px';\n baseStyle.rotation = 0;\n baseStyle.fillOpacity = 1;\n }\n\n if (type === 'vector' && geomType === 'point') {\n baseStyle.elevOffset = 20;\n }\n\n if (type === 'vector' || type === 'clamped') {\n baseStyle.minZoom = null;\n baseStyle.maxZoom = null;\n }\n\n return baseStyle;\n };\n\n this.getFeatureStyle = function (layer, feature, isStrokeless) {\n var _a, _b;\n\n var geomType = feature.geometry.type.toLowerCase();\n\n var style = _this.getBaseStyle(feature, layer._type, geomType);\n\n if (layer.style) {\n for (var key in style) {\n if (layer.style.default && layer.style.default[key] != null) {\n var defaultOverride = _this.getFeatureStyleProp(layer.style.default[key], feature);\n\n style[key] = defaultOverride != null ? defaultOverride : style[key];\n }\n\n if (geomType === 'point' && layer.style.point) {\n var pointOverride = _this.getFeatureStyleProp(layer.style.point[key], feature);\n\n style[key] = pointOverride != null ? pointOverride : style[key];\n } else if (geomType === 'linestring' && layer.style.line) {\n var lineOverride = _this.getFeatureStyleProp(layer.style.line[key], feature);\n\n style[key] = lineOverride != null ? lineOverride : style[key];\n } else if (geomType === 'polygon' && layer.style.polygon) {\n var polygonOverride = _this.getFeatureStyleProp(layer.style.polygon[key], feature);\n\n style[key] = polygonOverride != null ? polygonOverride : style[key];\n }\n\n if (layer.style.byProp) {\n for (var propPath in layer.style.byProp) {\n var path = propPath.split(':')[0].split('=')[1];\n var value = propPath.split(':')[1];\n\n if (_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, path.split('.')) == value) {\n var propOverride = _this.getFeatureStyleProp(layer.style.byProp[propPath][key], feature);\n\n style[key] = propOverride != null ? propOverride : style[key];\n }\n }\n }\n\n if (layer.style.letPropertiesStyleOverride === true) {\n var styleOverride = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn((_a = feature.properties) === null || _a === void 0 ? void 0 : _a.style, key);\n style[key] = styleOverride != null ? styleOverride : style[key];\n }\n }\n }\n\n if (style.fillColor === 'none') style.fillColor = 'rgba(0,0,0,0)';\n var type = ((_b = feature.geometry) === null || _b === void 0 ? void 0 : _b.type) ? feature.geometry.type.toLowerCase() : '';\n\n if (feature._active) {\n if (_this.p.options.canBecomeActive !== false && layer.canBecomeActive !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeActive !== false)) style.fillColor = _this.p.options.activeColor || 'red';\n } else if (feature._highlighted) {\n if (_this.p.options.canBecomeHighlighted !== false && layer.canBecomeHighlighted !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeHighlighted !== false)) style.fillColor = _this.p.options.highlightColor || 'yellow';\n }\n\n if (isStrokeless === true) {\n style.color = style.fillColor;\n }\n\n return style;\n };\n\n this._onMouseMove = function (intersectedLL, e, obj, intersectionRaw, intersectionPoint) {\n var _a;\n\n if (obj.layerType && _this[obj.layerType]) {\n var layers = _this[obj.layerType];\n\n for (var l in layers) {\n if (((_a = obj.parent) === null || _a === void 0 ? void 0 : _a.uuid) === layers[l].curtain.uuid) if (typeof layers[l].onMouseMove === 'function') layers[l].onMouseMove(e, layers[l], obj, intersectionRaw, intersectedLL, intersectionPoint);\n }\n }\n };\n\n this.p = parent;\n this._ = {\n layerers: {\n tile3d: new _tile3d__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this),\n tile: new _tile__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this),\n clamped: new _clamped__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this),\n vector: new _vector__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this),\n curtain: new _curtain__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this),\n model: new _model__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this)\n }\n };\n\n this._reset();\n }\n\n Layers.prototype._reset = function () {\n this.tile3d = [];\n this.tile = [];\n this.clamped = [];\n this.vector = [];\n this.curtain = [];\n this.model = [];\n this.all = {\n tile3d: this.tile3d,\n tile: this.tile,\n clamped: this.clamped,\n vector: this.vector,\n curtain: this.curtain,\n model: this.model\n };\n };\n\n return Layers;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Layers);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/index.ts?"); /***/ }), @@ -2103,7 +2103,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar TileLayerer = function () {\n function TileLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj) {\n if (!_this.p.p._.wasInitialized) return;\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n var alreadyExists = false;\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && layerObj.hasOwnProperty('path') && layerObj.hasOwnProperty('opacity') && layerObj.hasOwnProperty('minZoom') && layerObj.hasOwnProperty('maxZoom')) {\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == layerObj.name) {\n _this.p.tile[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.tile.push(layerObj);\n\n _this.p.tile.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.removeAllTiles();\n }\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n } else {\n console.warn('Attempted to add an invalid tile layer.');\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.tile.forEach(function (t) {\n if (name === t.name) {\n t.on = on != null ? on : !t.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.outdateAllTiles();\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].opacity = opacity;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.setFilterEffect = function (name, filter, value) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n _this.p.tile[i].filters = _this.p.tile[i].filters || {};\n\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].filters[filter] = value;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (_this.p.p.zoom >= _this.p.tile[i].minZoom && _this.p.p.zoom <= _this.p.tile[i].maxZoom) {\n var startingLength = _this.p.p._.tiledWorld.tilesDrawn.length;\n\n for (var j = 0; j < startingLength; j++) {\n _this.p.p._.tiledWorld.removeTile(0);\n }\n }\n\n _this.p.tile.splice(i, 1);\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.p = parent;\n }\n\n return TileLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TileLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/tile.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar TileLayerer = function () {\n function TileLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj) {\n if (!_this.p.p._.wasInitialized) return;\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n var alreadyExists = false;\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && layerObj.hasOwnProperty('path') && layerObj.hasOwnProperty('opacity') && layerObj.hasOwnProperty('minZoom') && layerObj.hasOwnProperty('maxZoom')) {\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == layerObj.name) {\n _this.p.tile[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.tile.push(layerObj);\n\n _this.p.tile.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.removeAllTiles();\n }\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n } else {\n console.warn('Attempted to add an invalid tile layer.');\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.tile.forEach(function (t) {\n if (name === t.name) {\n t.on = on != null ? on : !t.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.outdateAllTiles();\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n\n return false;\n };\n\n this.orderLayers = function (ordering) {\n var missingCount = 0;\n\n _this.p.tile.forEach(function (layer) {\n var newOrder = ordering.indexOf(layer.name);\n\n if (newOrder >= 0) {\n layer.order = _this.p.tile.length - newOrder;\n } else {\n layer.order = _this.p.tile.length - ordering.length - missingCount;\n missingCount++;\n }\n });\n\n _this.p.tile.sort(function (a, b) {\n return a.order - b.order;\n });\n\n return true;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].opacity = opacity;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.setFilterEffect = function (name, filter, value) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n _this.p.tile[i].filters = _this.p.tile[i].filters || {};\n\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].filters[filter] = value;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (_this.p.p.zoom >= _this.p.tile[i].minZoom && _this.p.p.zoom <= _this.p.tile[i].maxZoom) {\n var startingLength = _this.p.p._.tiledWorld.tilesDrawn.length;\n\n for (var j = 0; j < startingLength; j++) {\n _this.p.p._.tiledWorld.removeTile(0);\n }\n }\n\n _this.p.tile.splice(i, 1);\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.p = parent;\n }\n\n return TileLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TileLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/tile.ts?"); /***/ }), @@ -2127,7 +2127,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _3d_ /***/ (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/* harmony import */ var three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three/examples/jsm/lines/LineGeometry */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/lines/LineMaterial */ \"./node_modules/three/examples/jsm/lines/LineMaterial.js\");\n/* harmony import */ var three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three/examples/jsm/lines/Line2 */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\n/* harmony import */ var _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../secondary/sprites */ \"./src/secondary/sprites.ts\");\n\n\n\n\n\n\nvar VectorLayerer = function () {\n function VectorLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].hasOwnProperty('name')) {\n if (_this.p.vector[i].name == layerObj.name) {\n _this.p.vector[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n var meshes = _this.generateVectors(layerObj);\n\n _this.p.p.planet.add(meshes);\n\n layerObj.meshes = meshes;\n\n _this.p.vector.push(layerObj);\n\n _this.p.vector.sort(function (a, b) {\n return b.order - a.order;\n });\n }\n\n _this.p.p._.events._attenuate();\n\n if (typeof callback === 'function') callback();\n };\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && layerObj.hasOwnProperty('opacity')) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for vector layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid vector layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n layer.meshes.visible = layer.on;\n console.log(layer);\n\n _this.p.p._.events._attenuate();\n\n return true;\n }\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n layer.meshes.children.forEach(function (mesh) {\n mesh.material.opacity = layer.opacity;\n });\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].name === name) {\n _this.p.p.planet.remove(_this.p.vector[i].meshes);\n\n _this.p.vector.splice(i, 1);\n\n return true;\n }\n }\n\n return false;\n };\n\n this.generateVectors = function (layerObj) {\n var vectorGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\n\n if (layerObj.geojson == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has no geojson.\");\n return;\n }\n\n var features = layerObj.geojson.features;\n\n if (features == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has invalid geojson.\");\n return;\n }\n\n var pointType = layerObj.style ? layerObj.style.pointType : '';\n var lineType = layerObj.style ? layerObj.style.lineType : '';\n\n for (var _i = 0, features_1 = features; _i < features_1.length; _i++) {\n var f = features_1[_i];\n var type = f.geometry.type;\n var mesh = null;\n\n switch (type.toLowerCase()) {\n case 'point':\n switch (pointType) {\n case 'sphere':\n break;\n\n default:\n mesh = _this.geomTo.sprite(layerObj, f);\n }\n\n break;\n\n case 'linestring':\n switch (lineType) {\n case 'thin':\n mesh = _this.geomTo.line(layerObj, f);\n break;\n\n default:\n mesh = _this.geomTo.thickLine(layerObj, f);\n }\n\n break;\n\n case 'polygon':\n break;\n\n default:\n console.warn(\"Vector layer: \" + layerObj.name + \" has an unsupported geojson geometry type: \" + type + \".\");\n break;\n }\n\n mesh.feature = f;\n vectorGroup.add(mesh);\n }\n\n if (layerObj.on == false) {\n vectorGroup.visible = false;\n }\n\n return vectorGroup;\n };\n\n this.geomTo = {\n sprite: function (layerObj, feature, forceNewMaterial) {\n var g = feature.geometry.coordinates;\n\n var style = _this.p.getFeatureStyle(layerObj, feature);\n\n var sprite = _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__[\"default\"].makeMarkerSprite(style, layerObj.name, forceNewMaterial);\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n if (typeof g[0] == 'number') g = [g];\n\n var v = _this.p.p.projection.lonLatToVector3(g[0][i0], g[0][i1], (g[0][2] || 0) * _this.p.p.options.exaggeration);\n\n sprite.position.set(v.x, v.y, v.z);\n sprite.renderOrder = layerObj.index;\n\n if (layerObj.on == false) {\n sprite.visible = false;\n }\n\n sprite.layerName = layerObj.name;\n sprite.useKeyAsHoverName = layerObj.useKeyAsHoverName;\n sprite.name = layerObj.name;\n sprite.style = style;\n\n sprite.restyle = function () {\n var newSprite = _this.geomTo.sprite(layerObj, sprite.feature, sprite.feature._highlighted || sprite.feature._active);\n\n sprite.style = newSprite.style;\n sprite.material.dispose();\n sprite.material = newSprite.material;\n sprite.material.map.needsUpdate = true;\n sprite.material.needsUpdate = true;\n };\n\n return sprite;\n },\n line: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n var vertices = [];\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z));\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferGeometry\"]().setFromPoints(vertices);\n var mesh = new three__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](geometry, new three__WEBPACK_IMPORTED_MODULE_0__[\"LineBasicMaterial\"]({\n transparent: true,\n color: style.color\n }));\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n return mesh;\n },\n thickLine: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var path = [];\n var firstPos;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n if (i == 0) {\n firstPos = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z);\n }\n\n path.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x - firstPos.x, v.y - firstPos.y, v.z - firstPos.z));\n if (i != 0 || i != g.length - 1) path.push(path[path.length - 1]);\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var positions = [];\n var spline = new three__WEBPACK_IMPORTED_MODULE_0__[\"CatmullRomCurve3\"](path);\n var divisions = Math.round(1 * path.length);\n\n for (var i = 0, l = divisions; i < l; i++) {\n var point = spline.getPoint(i / l);\n positions.push(point.x, point.y, point.z);\n }\n\n var geometry = new three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__[\"LineGeometry\"]();\n geometry.setPositions(positions);\n var material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n var mesh = new three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__[\"Line2\"](geometry, material);\n mesh.computeLineDistances();\n mesh.position.set(firstPos.x, firstPos.y, firstPos.z);\n mesh.scale.set(1, 1, 1);\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n\n mesh.restyle = function () {\n var style = _this.p.getFeatureStyle(layerObj, mesh.feature, true);\n\n mesh.material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n mesh.strokeColor = style.color;\n };\n\n return mesh;\n }\n };\n this.p = parent;\n this.baseStyle = {\n fillColor: 'rgb(255,255,255)',\n fillOpacity: 0.4,\n color: 'rgb(0,0,0)',\n weight: 2,\n radius: 6\n };\n }\n\n return VectorLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (VectorLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/vector.ts?"); +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/* harmony import */ var three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three/examples/jsm/lines/LineGeometry */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/lines/LineMaterial */ \"./node_modules/three/examples/jsm/lines/LineMaterial.js\");\n/* harmony import */ var three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three/examples/jsm/lines/Line2 */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\n/* harmony import */ var _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../secondary/sprites */ \"./src/secondary/sprites.ts\");\n\n\n\n\n\n\nvar VectorLayerer = function () {\n function VectorLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].hasOwnProperty('name')) {\n if (_this.p.vector[i].name == layerObj.name) {\n _this.p.vector[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n var meshes = _this.generateVectors(layerObj);\n\n _this.p.p.planet.add(meshes);\n\n layerObj.meshes = meshes;\n\n _this.p.vector.push(layerObj);\n\n _this.p.vector.sort(function (a, b) {\n return b.order - a.order;\n });\n }\n\n _this.p.p._.events._attenuate();\n\n if (typeof callback === 'function') callback();\n };\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && layerObj.hasOwnProperty('opacity')) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for vector layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid vector layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n layer.meshes.visible = layer.on;\n console.log(layer);\n\n _this.p.p._.events._attenuate();\n\n return true;\n }\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n layer.meshes.children.forEach(function (mesh) {\n mesh.material.opacity = layer.opacity;\n });\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].name === name) {\n _this.p.p.planet.remove(_this.p.vector[i].meshes);\n\n _this.p.vector.splice(i, 1);\n\n return true;\n }\n }\n\n return false;\n };\n\n this.generateVectors = function (layerObj) {\n var vectorGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\n\n if (layerObj.geojson == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has no geojson.\");\n return;\n }\n\n var features = layerObj.geojson.features;\n\n if (features == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has invalid geojson.\");\n return;\n }\n\n var pointType = layerObj.style ? layerObj.style.pointType : '';\n var lineType = layerObj.style ? layerObj.style.lineType : '';\n\n for (var _i = 0, features_1 = features; _i < features_1.length; _i++) {\n var f = features_1[_i];\n var type = f.geometry.type;\n var mesh = null;\n\n switch (type.toLowerCase()) {\n case 'point':\n switch (pointType) {\n case 'sphere':\n break;\n\n default:\n mesh = _this.geomTo.sprite(layerObj, f);\n }\n\n break;\n\n case 'linestring':\n switch (lineType) {\n case 'thin':\n mesh = _this.geomTo.line(layerObj, f);\n break;\n\n default:\n mesh = _this.geomTo.thickLine(layerObj, f);\n }\n\n break;\n\n case 'polygon':\n break;\n\n default:\n console.warn(\"Vector layer: \" + layerObj.name + \" has an unsupported geojson geometry type: \" + type + \".\");\n break;\n }\n\n mesh.feature = f;\n vectorGroup.add(mesh);\n }\n\n if (layerObj.on == false) {\n vectorGroup.visible = false;\n }\n\n return vectorGroup;\n };\n\n this.geomTo = {\n sprite: function (layerObj, feature, forceNewMaterial) {\n var _a, _b;\n\n var g = feature.geometry.coordinates;\n\n var style = _this.p.getFeatureStyle(layerObj, feature);\n\n var options = {};\n\n if (((_a = feature === null || feature === void 0 ? void 0 : feature.properties) === null || _a === void 0 ? void 0 : _a.annotation) === true) {\n options.annotation = true;\n options.name = (_b = feature === null || feature === void 0 ? void 0 : feature.properties) === null || _b === void 0 ? void 0 : _b.name;\n }\n\n var sprite = _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__[\"default\"].makeMarkerSprite(style, layerObj.name, options, forceNewMaterial);\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n if (typeof g[0] == 'number') g = [g];\n var height = g[0][2] || _this.p.p.getElevationAtLngLat(g[0][i0], g[0][i1]) || false;\n\n var v = _this.p.p.projection.lonLatToVector3(g[0][i0], g[0][i1], (height || 0) * _this.p.p.options.exaggeration);\n\n if (height === false) sprite.noElevation = {\n lng: g[0][i0],\n lat: g[0][i1],\n elevOffset: style.elevOffset\n };\n sprite.position.set(v.x, v.y, v.z);\n sprite.renderOrder = layerObj.index;\n\n if (layerObj.on == false) {\n sprite.visible = false;\n }\n\n sprite.layerName = layerObj.name;\n sprite.useKeyAsHoverName = layerObj.useKeyAsHoverName;\n sprite.name = layerObj.name;\n sprite.style = style;\n\n sprite.restyle = function () {\n var newSprite = _this.geomTo.sprite(layerObj, sprite.feature, sprite.feature._highlighted || sprite.feature._active);\n\n sprite.style = newSprite.style;\n sprite.material.dispose();\n sprite.material = newSprite.material;\n sprite.material.map.needsUpdate = true;\n sprite.material.needsUpdate = true;\n };\n\n return sprite;\n },\n line: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n var vertices = [];\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z));\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferGeometry\"]().setFromPoints(vertices);\n var mesh = new three__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](geometry, new three__WEBPACK_IMPORTED_MODULE_0__[\"LineBasicMaterial\"]({\n transparent: true,\n color: style.color\n }));\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n return mesh;\n },\n thickLine: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var path = [];\n var firstPos;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n if (i == 0) {\n firstPos = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z);\n }\n\n path.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x - firstPos.x, v.y - firstPos.y, v.z - firstPos.z));\n if (i != 0 || i != g.length - 1) path.push(path[path.length - 1]);\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var positions = [];\n var spline = new three__WEBPACK_IMPORTED_MODULE_0__[\"CatmullRomCurve3\"](path);\n var divisions = Math.round(1 * path.length);\n\n for (var i = 0, l = divisions; i < l; i++) {\n var point = spline.getPoint(i / l);\n positions.push(point.x, point.y, point.z);\n }\n\n var geometry = new three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__[\"LineGeometry\"]();\n geometry.setPositions(positions);\n var material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n var mesh = new three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__[\"Line2\"](geometry, material);\n mesh.computeLineDistances();\n mesh.position.set(firstPos.x, firstPos.y, firstPos.z);\n mesh.scale.set(1, 1, 1);\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n\n mesh.restyle = function () {\n var style = _this.p.getFeatureStyle(layerObj, mesh.feature, true);\n\n mesh.material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n mesh.strokeColor = style.color;\n };\n\n return mesh;\n }\n };\n this.p = parent;\n }\n\n return VectorLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (VectorLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/vector.ts?"); /***/ }), @@ -2139,7 +2139,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (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 */ \"./src/core/index.ts\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _layers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layers */ \"./src/layers/index.ts\");\n/* harmony import */ var _controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controls */ \"./src/controls/index.ts\");\n/* harmony import */ var _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./secondary/loadingScreen */ \"./src/secondary/loadingScreen.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\n\n\n\n\n\nvar LithoSphere = function () {\n function LithoSphere(containerId, options) {\n var _this = this;\n\n this._animate = function () {\n window.requestAnimationFrame(_this._animate);\n\n _this._render();\n };\n\n this._onFirstLoad = function () {\n _this._.firstLoad = true;\n\n _this._.events._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, {\n x: 0.0001,\n y: 0.0001\n });\n\n _this._.rendererWrapper.updateSize();\n\n setTimeout(function () {\n _this.setCenter(_this.options.initialView, false, true);\n\n _this._setInitialCameraPositionTarget();\n\n _this._.events._onZoom();\n\n _this._.loadingScreen.end();\n }, 100);\n };\n\n this.setCenter = function (latLngZoom, ignoreZoom, accountForHeight) {\n if (!_this._.wasInitialized) return false;\n var rotLat = (90 - (latLngZoom.lat || 0)) * (Math.PI / 180);\n var rotLng = (latLngZoom.lng || 0) * (Math.PI / 180);\n\n _this.planet.rotation.set(rotLat, rotLng, 0);\n\n _this._.events._matchPlanetsLODToPlanet();\n\n if (latLngZoom.zoom != null && ignoreZoom != true) {\n _this.zoom = latLngZoom.zoom;\n\n var center = _this.getCenter(true);\n\n _this._.cameras.orbit.camera.position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.orbit.camera.position.y -= center.height;\n _this._.cameras.firstPerson.controls.getObject().position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.firstPerson.controls.getObject().position.y -= center.height;\n }\n\n _this._.events._refreshFrontGroupRotation();\n\n return true;\n };\n\n this.getCenterXYZ = function (raycasted) {\n if (raycasted) {\n _this._.raycaster.set(new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, _this.planetCenter.y, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 1, 0));\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[0].point.y += _this.planetCenter.y;\n return intersects[0].point;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0);\n } else {\n var centerPoint = {\n x: _this.planetCenter.x,\n y: _this.planetCenter.y,\n z: _this.planetCenter.z\n };\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](centerPoint.x, centerPoint.y, centerPoint.z);\n }\n };\n\n this.getCenter = function (raycasted) {\n var centerXYZ = _this.getCenterXYZ(raycasted);\n\n if (raycasted) {\n var center = JSON.parse(JSON.stringify(centerXYZ));\n center = _this.projection.rotatePoint3D(center, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n center = _this.projection.vector3ToLatLng(center);\n center.height = centerXYZ.length() * _this.projection.radiusScale - _this.projection.radii.major;\n return center;\n }\n\n return _this.projection.vector3ToLatLng(centerXYZ);\n };\n\n this.getCenterElevation = function () {\n return _this.getCenterXYZ(true).length() * _this.projection.radiusScale - _this.projection.radii.major;\n };\n\n this.getCenterElevationRaw = function () {\n var elev = _this.getCenterXYZ(true).length();\n\n if (elev <= 0.1 && elev >= -0.1) return;\n return elev;\n };\n\n this.getElevationAtLngLat = function (lng, lat) {\n var v = _this.projection.lonLatToVector3(lng, lat, 100000 * _this.options.exaggeration);\n\n var tempObj = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n tempObj.position.set(0, -_this.planetCenter.y, 0);\n tempObj.rotation.set(_this.planet.rotation.x, _this.planet.rotation.y, _this.planet.rotation.z);\n var geometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](200, 32, 32);\n var material = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: 0xffff00\n });\n var tempObj2 = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](geometry, material);\n tempObj2.position.set(v.x, v.y, v.z);\n tempObj.add(tempObj2);\n tempObj.updateMatrixWorld();\n var vector = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\n vector.setFromMatrixPosition(tempObj2.matrixWorld);\n\n _this._.raycaster.set(vector, new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -_this.planetCenter.y, 0).normalize());\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[intersects.length - 1].point.y += _this.planetCenter.y;\n return intersects[intersects.length - 1].point.length() * _this.projection.radiusScale - _this.projection.radii.major;\n }\n\n return 0;\n };\n\n this.getCenterTile = function () {\n var centerll = _this.getCenter();\n\n return _this.projection.latLngZ2TileXYZ(centerll.lat, centerll.lng, _this.zoom);\n };\n\n this.getCameras = function () {\n return {\n camera: _this._.cameras.camera,\n isFirstPerson: _this._.cameras.isFirstPerson,\n firstPerson: _this._.cameras.firstPerson,\n orbit: _this._.cameras.orbit\n };\n };\n\n this._setInitialCameraPositionTarget = function () {\n var o = _this._.cameras.orbit;\n var cam = o.camera;\n var con = o.controls;\n var pos = cam.position;\n var tar = con.target;\n var position = {\n x: pos.x,\n y: pos.y,\n z: pos.z\n };\n var target = {\n x: tar.x,\n y: tar.y,\n z: tar.z\n };\n\n if (_this.options.initialCamera) {\n var iC = _this.options.initialCamera;\n\n if (iC.position) {\n position = {\n x: iC.position.x || position.x,\n y: iC.position.y || position.y,\n z: iC.position.z || position.z\n };\n }\n\n if (iC.target) {\n target = {\n x: iC.target.x || target.x,\n y: iC.target.y || target.y,\n z: iC.target.z || target.z\n };\n }\n\n _this.setCameraPositionTarget(position, target);\n }\n };\n\n this.setCameraPositionTarget = function (position, target) {\n if (position) {\n _this._.cameras.orbit.camera.position.set(position.x || 9, position.y || 0, position.z || 0);\n }\n\n if (target) {\n _this._.cameras.orbit.controls.target.x = target.x || 0;\n _this._.cameras.orbit.controls.target.y = target.y || 0;\n _this._.cameras.orbit.controls.target.z = target.z || 0;\n }\n\n _this._.cameras.orbit.controls.update();\n };\n\n this.getContainer = function () {\n return _this._.container;\n };\n\n this.invalidateSize = function () {\n if (_this._.wasInitialized) {\n _this._.renderer.setSize(_this._.sceneContainer.offsetWidth, _this._.sceneContainer.offsetHeight);\n\n _this._.cameras.updateSize();\n }\n };\n\n var sceneContainer = document.getElementById(containerId).appendChild(document.createElement('div'));\n sceneContainer.id = '_lithosphere_scene';\n sceneContainer.style.width = '100%';\n sceneContainer.style.height = '100%';\n this._ = {\n containerId: containerId,\n container: document.getElementById(containerId),\n sceneContainer: sceneContainer,\n wasInitialized: false,\n rendererWrapper: null,\n renderer: null,\n cameras: null,\n tiledWorld: null,\n events: null,\n maxZoom: 0,\n minNativeZoom: 0,\n loader: new three__WEBPACK_IMPORTED_MODULE_1__[\"TextureLoader\"](),\n raycaster: new three__WEBPACK_IMPORTED_MODULE_1__[\"Raycaster\"](),\n updateEveryNthRender: 1,\n counters: {\n update: 0,\n frame: 0\n },\n lastCameraWasFirst: false,\n firstUpdate: true,\n firstLoad: false,\n loadingScreen: null,\n renderOnlyWhenOpen: true,\n zCutOff: 3,\n firstViewOverride: null,\n mouseIsInScene: false,\n marsRadius: 3396190\n };\n this._.container.style.position = 'relative';\n this.scene = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.scenesLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]()];\n this.sceneBack = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.sceneFront = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.planet = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n this.planetsLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]()];\n this.frontGroup = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n var defaultOptions = {\n loadingScreen: true,\n tileMapResource: null,\n customParsers: {},\n radiusOfTiles: 4,\n useLOD: true,\n LOD: [{\n radiusOfTiles: 4,\n zoomsUp: 3\n }, {\n radiusOfTiles: 2,\n zoomsUp: 7\n }, {\n radiusOfTiles: 2,\n zoomsUp: 11\n }],\n tileResolution: 32,\n trueTileResolution: 256,\n showAxes: false,\n wireframeMode: false,\n exaggeration: 1,\n renderOnlyWhenOpen: true,\n targetYOffset: 0,\n highlightColor: 'yellow',\n activeColor: 'red'\n };\n options = options || {};\n this.options = __assign(__assign({}, defaultOptions), options);\n\n this._init();\n }\n\n LithoSphere.prototype._init = function () {\n this._.rendererWrapper = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Renderer\"](this._.sceneContainer);\n this._.renderer = this._.rendererWrapper.renderer;\n\n if (this._.renderer) {\n this._.wasInitialized = true;\n } else return false;\n\n this.projection = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Projection\"](this.options.majorRadius, this.options.minorRadius, this.options.tileMapResource, this.options.trueTileResolution);\n this._.cameras = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Cameras\"](this._.container, this._.sceneContainer, this.scene, this.projection);\n this.layers = new _layers__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this);\n this.addLayer = this.layers.addLayer;\n this.removeLayer = this.layers.removeLayer;\n this.toggleLayer = this.layers.toggleLayer;\n this.setLayerOpacity = this.layers.setLayerOpacity;\n this.setLayerFilterEffect = this.layers.setLayerFilterEffect;\n this.setLayerSpecificOptions = this.layers.setLayerSpecificOptions;\n this.getLayerByName = this.layers.getLayerByName;\n this.hasLayer = this.layers.hasLayer;\n this._.tiledWorld = new _core__WEBPACK_IMPORTED_MODULE_0__[\"TiledWorld\"](this);\n this.zoom = 10;\n this.trueZoom = this.zoom;\n this.mouse = {\n lat: null,\n lng: null,\n elev: null\n };\n this.planetCenter = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -(this.projection.radii.major / this.projection.radiusScale), 0);\n this.planet.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.scene.add(this.planet);\n this.scenesLOD[0].add(this.planetsLOD[0]);\n this.scenesLOD[1].add(this.planetsLOD[1]);\n this.scenesLOD[2].add(this.planetsLOD[2]);\n this.frontGroup.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.sceneFront.add(this.frontGroup);\n this.scene.add(new three__WEBPACK_IMPORTED_MODULE_1__[\"AmbientLight\"](0xfefefe));\n\n if (this.options.starsphere) {\n var starsphereGeometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1000, 64, 64);\n var starsphereMaterial = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: this.options.starsphere.color || 0xaaaaaa\n });\n if (this.options.starsphere.url) starsphereMaterial.map = this._.loader.load(this.options.starsphere.url);\n starsphereMaterial.opacity = 1;\n this.starsphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](starsphereGeometry, starsphereMaterial);\n this.sceneBack.add(this.starsphere);\n }\n\n if (this.options.atmosphere) {\n this.atmosphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1.5, 128, 128), _core__WEBPACK_IMPORTED_MODULE_0__[\"Shaders\"].atmosphere(this.options.atmosphere.color));\n this.sceneBack.add(this.atmosphere);\n }\n\n if (this.options.showAxes === true) {\n var materialx = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0xff0000\n });\n var geometryx = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0 * 2, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](this.planetCenter.y * 2, 0, 0)]);\n var linex = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryx, materialx);\n this.scene.add(linex);\n var materialy = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x00ff00\n });\n var geometryy = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, this.planetCenter.y * 2, 0)]);\n var liney = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryy, materialy);\n this.scene.add(liney);\n var materialz = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x0000ff\n });\n var geometryz = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, this.planetCenter.y * 2)]);\n var linez = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryz, materialz);\n this.scene.add(linez);\n }\n\n this.controls = new _controls__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this);\n this.addControl = this.controls.addControl;\n this.removeControl = this.controls.removeControl;\n\n if (this.options.renderOnlyWhenOpen === false) {\n this._.renderOnlyWhenOpen = false;\n }\n\n this._.loadingScreen = new _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this);\n this._.events = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Events\"](this);\n this.setCenter(this.options.initialView);\n\n this._setInitialCameraPositionTarget();\n\n this._animate();\n\n return true;\n };\n\n LithoSphere.prototype._render = function () {\n this._.renderer.clear();\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.update = (this._.counters.update + 1) % this._.updateEveryNthRender;\n if (this._.counters.update === 0) this._update();\n if (!this._.cameras.isFirstPerson) this._.cameras.orbit.controls.update();\n this.layers.tile3d.forEach(function (tile3d) {\n tile3d.renderer.update();\n });\n\n this._.renderer.render(this.sceneBack, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[2], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[1], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[0], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scene, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.sceneFront, this._.cameras.camera);\n };\n\n LithoSphere.prototype._update = function () {\n if (!this._.wasInitialized) return;\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.frame = (this._.counters.frame + 1) % 4;\n this.scene.rotation.x = 0;\n this.scene.position.y = 0;\n\n if (!this._.firstUpdate) {\n this._.tiledWorld.refreshTiles();\n }\n\n this._.events._checkDesiredZoom();\n\n this.controls._onUpdateEvent();\n\n if (this._.cameras.isFirstPerson) {\n this._.lastCameraWasFirst = true;\n this._.cameras.firstPerson.controls.getObject().position.y = this._.cameras.orbit.controls.target.y - this._.cameras.firstPerson.height / this.projection.radiusScale;\n\n var v2 = this._.cameras.update();\n\n this._.events._rotateGlobe(v2);\n\n this._.events._onMouseMove();\n\n this.controls._onFirstPersonUpdate();\n } else if (this._.lastCameraWasFirst) {\n this._.lastCameraWasFirst = false;\n\n this.controls._onOrbitalUpdate();\n }\n\n if (this._.firstUpdate) {\n if (this._.firstViewOverride != null) this.setCenter(this._.firstViewOverride);else this.setCenter(this.options.initialView, true);\n\n this._setInitialCameraPositionTarget();\n\n this._.firstUpdate = false;\n }\n };\n\n return LithoSphere;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LithoSphere);\n\n//# sourceURL=webpack://LithoSphere/./src/lithosphere.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core */ \"./src/core/index.ts\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _layers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layers */ \"./src/layers/index.ts\");\n/* harmony import */ var _controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controls */ \"./src/controls/index.ts\");\n/* harmony import */ var _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./secondary/loadingScreen */ \"./src/secondary/loadingScreen.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\n\n\n\n\n\nvar LithoSphere = function () {\n function LithoSphere(containerId, options) {\n var _this = this;\n\n this._animate = function () {\n window.requestAnimationFrame(_this._animate);\n\n _this._render();\n };\n\n this._onFirstLoad = function () {\n _this._.firstLoad = true;\n\n _this._.events._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, {\n x: 0.0001,\n y: 0.0001\n });\n\n _this._.rendererWrapper.updateSize();\n\n setTimeout(function () {\n _this.setCenter(_this.options.initialView, false, true);\n\n _this._setInitialCameraPositionTarget();\n\n _this._.events._onZoom();\n\n _this._.loadingScreen.end();\n }, 100);\n };\n\n this.setCenter = function (latLngZoom, ignoreZoom, accountForHeight) {\n if (!_this._.wasInitialized) return false;\n var rotLat = (90 - (latLngZoom.lat || 0)) * (Math.PI / 180);\n var rotLng = (latLngZoom.lng || 0) * (Math.PI / 180);\n\n _this.planet.rotation.set(rotLat, rotLng, 0);\n\n _this._.events._matchPlanetsLODToPlanet();\n\n if (latLngZoom.zoom != null && ignoreZoom != true) {\n _this.zoom = latLngZoom.zoom;\n\n var center = _this.getCenter(true);\n\n _this._.cameras.orbit.camera.position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.orbit.camera.position.y -= center.height;\n _this._.cameras.firstPerson.controls.getObject().position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.firstPerson.controls.getObject().position.y -= center.height;\n }\n\n _this._.events._refreshFrontGroupRotation();\n\n return true;\n };\n\n this.getCenterXYZ = function (raycasted) {\n if (raycasted) {\n _this._.raycaster.set(new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, _this.planetCenter.y, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 1, 0));\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[0].point.y += _this.planetCenter.y;\n return intersects[0].point;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0);\n } else {\n var centerPoint = {\n x: _this.planetCenter.x,\n y: _this.planetCenter.y,\n z: _this.planetCenter.z\n };\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](centerPoint.x, centerPoint.y, centerPoint.z);\n }\n };\n\n this.getCenter = function (raycasted) {\n var centerXYZ = _this.getCenterXYZ(raycasted);\n\n if (raycasted) {\n var center = JSON.parse(JSON.stringify(centerXYZ));\n center = _this.projection.rotatePoint3D(center, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n center = _this.projection.vector3ToLatLng(center);\n center.height = (centerXYZ.length() - _this.planet.position.y) / _this.projection.radiusScale;\n return center;\n }\n\n return _this.projection.vector3ToLatLng(centerXYZ);\n };\n\n this.getCenterElevation = function () {\n return (_this.getCenterXYZ(true).length() - _this.planet.position.y) / _this.projection.radiusScale;\n };\n\n this.getCenterElevationRaw = function () {\n var elev = _this.getCenterXYZ(true).length();\n\n if (elev <= 0.1 && elev >= -0.1) return;\n return elev;\n };\n\n this.getElevationAtLngLat = function (lng, lat) {\n var v = _this.projection.lonLatToVector3(lng, lat, 100000 * _this.options.exaggeration);\n\n var tempObj = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n tempObj.position.set(0, -_this.planetCenter.y, 0);\n tempObj.rotation.set(_this.planet.rotation.x, _this.planet.rotation.y, _this.planet.rotation.z);\n var geometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](200, 32, 32);\n var material = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: 0xffff00\n });\n var tempObj2 = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](geometry, material);\n tempObj2.position.set(v.x, v.y, v.z);\n tempObj.add(tempObj2);\n tempObj.updateMatrixWorld();\n var vector = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\n vector.setFromMatrixPosition(tempObj2.matrixWorld);\n\n _this._.raycaster.set(vector, new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -_this.planetCenter.y, 0).normalize());\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[intersects.length - 1].point.y += _this.planetCenter.y;\n return (intersects[intersects.length - 1].point.length() - _this.planet.position.y) / _this.projection.radiusScale;\n }\n\n return 0;\n };\n\n this.getCenterTile = function () {\n var centerll = _this.getCenter();\n\n return _this.projection.latLngZ2TileXYZ(centerll.lat, centerll.lng, _this.zoom);\n };\n\n this.getCameras = function () {\n return {\n camera: _this._.cameras.camera,\n isFirstPerson: _this._.cameras.isFirstPerson,\n firstPerson: _this._.cameras.firstPerson,\n orbit: _this._.cameras.orbit\n };\n };\n\n this._setInitialCameraPositionTarget = function () {\n var o = _this._.cameras.orbit;\n var cam = o.camera;\n var con = o.controls;\n var pos = cam.position;\n var tar = con.target;\n var position = {\n x: pos.x,\n y: pos.y,\n z: pos.z\n };\n var target = {\n x: tar.x,\n y: tar.y,\n z: tar.z\n };\n\n if (_this.options.initialCamera) {\n var iC = _this.options.initialCamera;\n\n if (iC.position) {\n position = {\n x: iC.position.x || position.x,\n y: iC.position.y || position.y,\n z: iC.position.z || position.z\n };\n }\n\n if (iC.target) {\n target = {\n x: iC.target.x || target.x,\n y: iC.target.y || target.y,\n z: iC.target.z || target.z\n };\n }\n\n _this.setCameraPositionTarget(position, target);\n }\n };\n\n this.setCameraPositionTarget = function (position, target) {\n if (position) {\n _this._.cameras.orbit.camera.position.set(position.x || 9, position.y || 0, position.z || 0);\n }\n\n if (target) {\n _this._.cameras.orbit.controls.target.x = target.x || 0;\n _this._.cameras.orbit.controls.target.y = target.y || 0;\n _this._.cameras.orbit.controls.target.z = target.z || 0;\n }\n\n _this._.cameras.orbit.controls.update();\n };\n\n this.getContainer = function () {\n return _this._.container;\n };\n\n this.invalidateSize = function () {\n if (_this._.wasInitialized) {\n _this._.renderer.setSize(_this._.sceneContainer.offsetWidth, _this._.sceneContainer.offsetHeight);\n\n _this._.cameras.updateSize();\n }\n };\n\n var sceneContainer = document.getElementById(containerId).appendChild(document.createElement('div'));\n sceneContainer.id = '_lithosphere_scene';\n sceneContainer.style.width = '100%';\n sceneContainer.style.height = '100%';\n this._ = {\n containerId: containerId,\n container: document.getElementById(containerId),\n sceneContainer: sceneContainer,\n wasInitialized: false,\n rendererWrapper: null,\n renderer: null,\n cameras: null,\n tiledWorld: null,\n events: null,\n maxZoom: 0,\n minNativeZoom: 0,\n loader: new three__WEBPACK_IMPORTED_MODULE_1__[\"TextureLoader\"](),\n raycaster: new three__WEBPACK_IMPORTED_MODULE_1__[\"Raycaster\"](),\n updateEveryNthRender: 1,\n counters: {\n update: 0,\n frame: 0\n },\n lastCameraWasFirst: false,\n firstUpdate: true,\n firstLoad: false,\n loadingScreen: null,\n renderOnlyWhenOpen: true,\n zCutOff: 3,\n firstViewOverride: null,\n mouseIsInScene: false\n };\n this._.container.style.position = 'relative';\n this.scene = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.scenesLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]()];\n this.sceneBack = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.sceneFront = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.planet = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n this.planetsLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]()];\n this.frontGroup = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n var defaultOptions = {\n loadingScreen: true,\n tileMapResource: null,\n customParsers: {},\n radiusOfTiles: 4,\n useLOD: true,\n LOD: [{\n radiusOfTiles: 4,\n zoomsUp: 3\n }, {\n radiusOfTiles: 2,\n zoomsUp: 7\n }, {\n radiusOfTiles: 2,\n zoomsUp: 11\n }],\n tileResolution: 32,\n trueTileResolution: 256,\n showAxes: false,\n wireframeMode: false,\n exaggeration: 1,\n renderOnlyWhenOpen: true,\n targetYOffset: 0,\n highlightColor: 'yellow',\n activeColor: 'red'\n };\n options = options || {};\n this.options = __assign(__assign({}, defaultOptions), options);\n\n this._init();\n }\n\n LithoSphere.prototype._init = function () {\n this._.rendererWrapper = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Renderer\"](this._.sceneContainer);\n this._.renderer = this._.rendererWrapper.renderer;\n\n if (this._.renderer) {\n this._.wasInitialized = true;\n } else return false;\n\n this.projection = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Projection\"](this.options.majorRadius, this.options.minorRadius, this.options.tileMapResource, this.options.trueTileResolution, this.options.radiusCutoff);\n this._.cameras = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Cameras\"](this._.container, this._.sceneContainer, this.scene, this.projection);\n this.layers = new _layers__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this);\n this.addLayer = this.layers.addLayer;\n this.removeLayer = this.layers.removeLayer;\n this.toggleLayer = this.layers.toggleLayer;\n this.orderLayers = this.layers.orderLayers;\n this.setLayerOpacity = this.layers.setLayerOpacity;\n this.setLayerFilterEffect = this.layers.setLayerFilterEffect;\n this.setLayerSpecificOptions = this.layers.setLayerSpecificOptions;\n this.getLayerByName = this.layers.getLayerByName;\n this.hasLayer = this.layers.hasLayer;\n this._.tiledWorld = new _core__WEBPACK_IMPORTED_MODULE_0__[\"TiledWorld\"](this);\n this.zoom = 10;\n this.trueZoom = this.zoom;\n this.mouse = {\n lat: null,\n lng: null,\n elev: null\n };\n this.planetCenter = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -(this.projection.radii.major / this.projection.radiusScale), 0);\n this.planet.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.scene.add(this.planet);\n this.scenesLOD[0].add(this.planetsLOD[0]);\n this.scenesLOD[1].add(this.planetsLOD[1]);\n this.scenesLOD[2].add(this.planetsLOD[2]);\n this.frontGroup.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.sceneFront.add(this.frontGroup);\n this.scene.add(new three__WEBPACK_IMPORTED_MODULE_1__[\"AmbientLight\"](0xfefefe));\n\n if (this.options.starsphere) {\n var starsphereGeometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1000, 64, 64);\n var starsphereMaterial = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: this.options.starsphere.color || 0xaaaaaa\n });\n if (this.options.starsphere.url) starsphereMaterial.map = this._.loader.load(this.options.starsphere.url);\n starsphereMaterial.opacity = 1;\n this.starsphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](starsphereGeometry, starsphereMaterial);\n this.sceneBack.add(this.starsphere);\n }\n\n if (this.options.atmosphere) {\n this.atmosphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1.5, 128, 128), _core__WEBPACK_IMPORTED_MODULE_0__[\"Shaders\"].atmosphere(this.options.atmosphere.color));\n this.sceneBack.add(this.atmosphere);\n }\n\n if (this.options.showAxes === true) {\n var materialx = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0xff0000\n });\n var geometryx = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0 * 2, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](this.planetCenter.y * 2, 0, 0)]);\n var linex = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryx, materialx);\n this.scene.add(linex);\n var materialy = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x00ff00\n });\n var geometryy = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, this.planetCenter.y * 2, 0)]);\n var liney = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryy, materialy);\n this.scene.add(liney);\n var materialz = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x0000ff\n });\n var geometryz = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, this.planetCenter.y * 2)]);\n var linez = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryz, materialz);\n this.scene.add(linez);\n }\n\n this.controls = new _controls__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this);\n this.addControl = this.controls.addControl;\n this.removeControl = this.controls.removeControl;\n\n if (this.options.renderOnlyWhenOpen === false) {\n this._.renderOnlyWhenOpen = false;\n }\n\n this._.loadingScreen = new _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this);\n this._.events = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Events\"](this);\n this.setCenter(this.options.initialView);\n\n this._setInitialCameraPositionTarget();\n\n this._animate();\n\n return true;\n };\n\n LithoSphere.prototype._render = function () {\n this._.renderer.clear();\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.update = (this._.counters.update + 1) % this._.updateEveryNthRender;\n if (this._.counters.update === 0) this._update();\n if (!this._.cameras.isFirstPerson) this._.cameras.orbit.controls.update();\n this.layers.tile3d.forEach(function (tile3d) {\n tile3d.renderer.update();\n });\n\n this._.renderer.render(this.sceneBack, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[2], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[1], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[0], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scene, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.sceneFront, this._.cameras.camera);\n };\n\n LithoSphere.prototype._update = function () {\n if (!this._.wasInitialized) return;\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.frame = (this._.counters.frame + 1) % 4;\n this.scene.rotation.x = 0;\n this.scene.position.y = 0;\n\n if (!this._.firstUpdate) {\n this._.tiledWorld.refreshTiles();\n }\n\n this._.events._checkDesiredZoom();\n\n this.controls._onUpdateEvent();\n\n if (this._.cameras.isFirstPerson) {\n this._.lastCameraWasFirst = true;\n this._.cameras.firstPerson.controls.getObject().position.y = this._.cameras.orbit.controls.target.y - this._.cameras.firstPerson.height / this.projection.radiusScale;\n\n var v2 = this._.cameras.update();\n\n this._.events._rotateGlobe(v2);\n\n this._.events._onMouseMove();\n\n this.controls._onFirstPersonUpdate();\n } else if (this._.lastCameraWasFirst) {\n this._.lastCameraWasFirst = false;\n\n this.controls._onOrbitalUpdate();\n }\n\n if (this._.firstUpdate) {\n if (this._.firstViewOverride != null) this.setCenter(this._.firstViewOverride);else this.setCenter(this.options.initialView, true);\n\n this._setInitialCameraPositionTarget();\n\n this._.firstUpdate = false;\n }\n };\n\n return LithoSphere;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LithoSphere);\n\n//# sourceURL=webpack://LithoSphere/./src/lithosphere.ts?"); /***/ }), @@ -2245,7 +2245,7 @@ eval("function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find mod /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var require;/**\n * Minified by jsDelivr using Terser v5.3.5.\n * Original file: /npm/geotiff@1.0.4/dist-browser/geotiff.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\nparcelRequire=function(e,t,r,n){var i,o=\"function\"==typeof parcelRequire&&parcelRequire,a=\"function\"==typeof require&&require;function s(r,n){if(!t[r]){if(!e[r]){var i=\"function\"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(r,!0);if(o)return o(r,!0);if( true&&\"string\"==typeof r)return __webpack_require__(\"./src/secondary/geotiff sync recursive\")(r);var u=new Error(\"Cannot find module '\"+r+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}f.resolve=function(t){return e[r][1][t]||t},f.cache={};var l=t[r]=new s.Module(r);e[r][0].call(l.exports,f,l,l.exports,this)}return t[r].exports;function f(e){return s(f.resolve(e))}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.exports={}},s.modules=e,s.cache=t,s.parent=o,s.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]};for(var u=0;u=0;--o){var a=this.tryEntries[o],s=a.completion;if(\"root\"===a.tryLoc)return i(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;T(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),p}},e}(\"object\"==typeof t?t.exports:{});try{regeneratorRuntime=n}catch(e){Function(\"r\",\"regeneratorRuntime = r\")(n)}},{}],PMvg:[function(e,t,r){t.exports=e(\"regenerator-runtime\")},{\"regenerator-runtime\":\"QVnC\"}],IxO8:[function(e,t,r){t.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},{}],OUZ9:[function(e,t,r){t.exports=function(e){if(Array.isArray(e))return e}},{}],vKPt:[function(e,t,r){t.exports=function(e,t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},{}],NVR6:[function(e,t,r){t.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>23&511;return a[r]+((8388607&t)>>s[r])},r.convertToNumber=function(e){const t=e>>10;return o[0]=u[f[t]+(1023&e)]+l[t],i[0]};const n=new ArrayBuffer(4),i=new Float32Array(n),o=new Uint32Array(n),a=new Uint32Array(512),s=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(a[0|e]=0,a[256|e]=32768,s[0|e]=24,s[256|e]=24):t<-14?(a[0|e]=1024>>-t-14,a[256|e]=1024>>-t-14|32768,s[0|e]=-t-1,s[256|e]=-t-1):t<=15?(a[0|e]=t+15<<10,a[256|e]=t+15<<10|32768,s[0|e]=13,s[256|e]=13):t<128?(a[0|e]=31744,a[256|e]=64512,s[0|e]=24,s[256|e]=24):(a[0|e]=31744,a[256|e]=64512,s[0|e]=13,s[256|e]=13)}const u=new Uint32Array(2048),l=new Uint32Array(64),f=new Uint32Array(64);u[0]=0;for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;0==(8388608&t);)r-=8388608,t<<=1;t&=-8388609,r+=947912704,u[e]=t|r}for(let e=1024;e<2048;++e)u[e]=939524096+(e-1024<<13);l[0]=0;for(let e=1;e<31;++e)l[e]=e<<23;l[31]=1199570944,l[32]=2147483648;for(let e=33;e<63;++e)l[e]=2147483648+(e-32<<23);l[63]=3347054592,f[0]=0;for(let e=1;e<64;++e)f[e]=32===e?0:1024},{}],G4sf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=function(e){if(e=Number(e),!Number.isFinite(e)||0===e)return e;const t=(0,n.roundToFloat16Bits)(e);return(0,n.convertToNumber)(t)};var n=e(\"./lib\")},{\"./lib\":\"GG94\"}],xQUP:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.ToInteger=function(e){return\"number\"!=typeof e&&(e=Number(e)),Number.isNaN(e)&&(e=0),Math.trunc(e)},r.defaultCompareFunction=function(e,t){const[r,n]=[Number.isNaN(e),Number.isNaN(t)];if(r&&n)return 0;if(r)return 1;if(n)return-1;if(et)return 1;if(0===e&&0===t){const[r,n]=[Object.is(e,0),Object.is(t,0)];if(!r&&n)return-1;if(r&&!n)return 1}return 0}},{}],iJ7y:[function(e,t,r){var n=arguments[3];Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var i=\"object\"==typeof n&&n&&n.Object===Object&&n,o=i;r.default=o},{}],ygki:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof self&&self&&self.Object===Object&&self,o=n.default||i||Function(\"return this\")();r.default=o},{\"./_freeGlobal.js\":\"iJ7y\"}],Oi8n:[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(\"./_root.js\")).default.Symbol;r.default=n},{\"./_root.js\":\"ygki\"}],InRc:[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(\"./_Symbol.js\"));var i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n.default?n.default.toStringTag:void 0;var u=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i};r.default=u},{\"./_Symbol.js\":\"Oi8n\"}],iwg4:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Object.prototype.toString;var i=function(e){return n.call(e)};r.default=i},{}],svpX:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_Symbol.js\")),i=a(e(\"./_getRawTag.js\")),o=a(e(\"./_objectToString.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=n.default?n.default.toStringTag:void 0;var u=function(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":s&&s in Object(e)?(0,i.default)(e):(0,o.default)(e)};r.default=u},{\"./_Symbol.js\":\"Oi8n\",\"./_getRawTag.js\":\"InRc\",\"./_objectToString.js\":\"iwg4\"}],UKR9:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return null!=e&&\"object\"==typeof e};r.default=n},{}],MYZg:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObjectLike.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){return(0,i.default)(e)&&\"[object ArrayBuffer]\"==(0,n.default)(e)};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObjectLike.js\":\"UKR9\"}],pmj6:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return function(t){return e(t)}};r.default=n},{}],oPFz:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof r&&r&&!r.nodeType&&r,o=i&&\"object\"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&n.default.process,s=function(){try{return o&&o.require&&o.require(\"util\").types||a&&a.binding&&a.binding(\"util\")}catch(e){}}();r.default=s},{\"./_freeGlobal.js\":\"iJ7y\"}],rXXV:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_baseIsArrayBuffer.js\")),i=a(e(\"./_baseUnary.js\")),o=a(e(\"./_nodeUtil.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=o.default&&o.default.isArrayBuffer,u=s?(0,i.default)(s):n.default;r.default=u},{\"./_baseIsArrayBuffer.js\":\"MYZg\",\"./_baseUnary.js\":\"pmj6\",\"./_nodeUtil.js\":\"oPFz\"}],XYHx:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.isDataView=function(e){return e instanceof DataView},r.isStringNumberKey=function(e){return\"string\"==typeof e&&e===(0,n.ToInteger)(e)+\"\"},Object.defineProperty(r,\"isArrayBuffer\",{enumerable:!0,get:function(){return i.default}});var n=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,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.createPrivateStorage=function(){const e=new WeakMap;return t=>{let r=e.get(t);return r||(r=Object.create(null),e.set(t,r),r)}}},{}],DTZk:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)};r.default=n},{}],tWvT:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObject.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){if(!(0,i.default)(e))return!1;var t=(0,n.default)(e);return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObject.js\":\"DTZk\"}],xFkS:[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(\"./_root.js\")).default[\"__core-js_shared__\"];r.default=n},{\"./_root.js\":\"ygki\"}],pULC:[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(\"./_coreJsData.js\"));var i=function(){var e=/[^.]+$/.exec(n.default&&n.default.keys&&n.default.keys.IE_PROTO||\"\");return e?\"Symbol(src)_1.\"+e:\"\"}();var o=function(e){return!!i&&i in e};r.default=o},{\"./_coreJsData.js\":\"xFkS\"}],UKJK:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Function.prototype.toString;var i=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"};r.default=i},{}],Zczf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=s(e(\"./isFunction.js\")),i=s(e(\"./_isMasked.js\")),o=s(e(\"./isObject.js\")),a=s(e(\"./_toSource.js\"));function s(e){return e&&e.__esModule?e:{default:e}}var u=/^\\[object .+?Constructor\\]$/,l=Function.prototype,f=Object.prototype,c=l.toString,h=f.hasOwnProperty,d=RegExp(\"^\"+c.call(h).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");var p=function(e){return!(!(0,o.default)(e)||(0,i.default)(e))&&((0,n.default)(e)?d:u).test((0,a.default)(e))};r.default=p},{\"./isFunction.js\":\"tWvT\",\"./_isMasked.js\":\"pULC\",\"./isObject.js\":\"DTZk\",\"./_toSource.js\":\"UKJK\"}],ZVQn:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e,t){return null==e?void 0:e[t]};r.default=n},{}],tx41:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseIsNative.js\")),i=o(e(\"./_getValue.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e,t){var r=(0,i.default)(e,t);return(0,n.default)(r)?r:void 0};r.default=a},{\"./_baseIsNative.js\":\"Zczf\",\"./_getValue.js\":\"ZVQn\"}],YsDH:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=(0,function(e){return e&&e.__esModule?e:{default:e}}(e(\"./_getNative.js\")).default)(Object,\"create\");r.default=n},{\"./_getNative.js\":\"tx41\"}],sJnX:[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(\"./_nativeCreate.js\"));var i=function(){this.__data__=n.default?(0,n.default)(null):{},this.size=0};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],c9sB:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};r.default=n},{}],zYTU:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;if(n.default){var r=t[e];return\"__lodash_hash_undefined__\"===r?void 0:r}return i.call(t,e)?t[e]:void 0};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],ZFwF:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;return n.default?void 0!==t[e]:i.call(t,e)};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],i3LK:[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(\"./_nativeCreate.js\"));var i=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n.default&&void 0===t?\"__lodash_hash_undefined__\":t,this};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],tE4I:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_hashClear.js\")),i=u(e(\"./_hashDelete.js\")),o=u(e(\"./_hashGet.js\")),a=u(e(\"./_hashHas.js\")),s=u(e(\"./_hashSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],GGNI:[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(\"./_assocIndexOf.js\"));var i=function(e,t){var r=this.__data__,i=(0,n.default)(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],UlXa:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_listCacheClear.js\")),i=u(e(\"./_listCacheDelete.js\")),o=u(e(\"./_listCacheGet.js\")),a=u(e(\"./_listCacheHas.js\")),s=u(e(\"./_listCacheSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tf(t)&&function(e){return\"function\"==typeof e&&v.has(e)}(e)?Reflect.apply(e,l(t).target,r):Reflect.apply(e,t,r)},p={get(e,t){let r=null;if(u.isTypedArrayIndexedPropertyWritable||(e=l(r=e).target),(0,i.isStringNumberKey)(t))return Reflect.has(e,t)?(0,s.convertToNumber)(Reflect.get(e,t)):void 0;{const n=null!==r&&Reflect.has(r,t)?Reflect.get(r,t):Reflect.get(e,t);if(\"function\"!=typeof n)return n;let i=l(n).proxy;return void 0===i&&(i=l(n).proxy=new Proxy(n,d)),i}},set(e,t,r){let n=null;return u.isTypedArrayIndexedPropertyWritable||(e=l(n=e).target),(0,i.isStringNumberKey)(t)?Reflect.set(e,t,(0,s.roundToFloat16Bits)(r)):null===n||Reflect.has(e,t)&&!Object.isFrozen(n)?Reflect.set(e,t,r):Reflect.set(n,t,r)}};u.isTypedArrayIndexedPropertyWritable||(p.getPrototypeOf=e=>Reflect.getPrototypeOf(l(e).target),p.setPrototypeOf=(e,t)=>Reflect.setPrototypeOf(l(e).target,t),p.defineProperty=(e,t,r)=>{const n=l(e).target;return!Reflect.has(n,t)||Object.isFrozen(e)?Reflect.defineProperty(e,t,r):Reflect.defineProperty(n,t,r)},p.deleteProperty=(e,t)=>{const r=l(e).target;return Reflect.has(e,t)?Reflect.deleteProperty(e,t):Reflect.deleteProperty(r,t)},p.has=(e,t)=>Reflect.has(e,t)||Reflect.has(l(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 b extends Uint16Array{constructor(e,t,r){if(f(e))super(l(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,r);break;default:super(...arguments)}else{const t=Reflect.has(e,\"length\")||void 0===e[Symbol.iterator]?e:[...e],r=t.length;super(r);for(let e=0;et(r(e),r(n)))),l(this).proxy}slice(...e){let t;c(this);try{t=super.slice(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).slice(...e)}return new b(t.buffer)}subarray(...e){let t;c(this);try{t=super.subarray(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).subarray(...e)}return new b(t.buffer,t.byteOffset,t.length)}indexOf(e,...t){c(this);const r=this.length;let i=(0,n.ToInteger)(t[0]);i<0&&(i+=r)<0&&(i=0);for(let t=i,n=r;t=0?i=i0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error(\"Possible EventEmitter memory leak detected. \"+a.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");s.name=\"MaxListenersExceededWarning\",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function h(){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 d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error(\"Unhandled error.\"+(a?\" (\"+a.message+\")\":\"\"));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if(\"function\"==typeof u)o(u,this,t);else{var l=u.length,f=y(u,l);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);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):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],ExO1:[function(e,t,r){t.exports=e(\"events\").EventEmitter},{events:\"FRpO\"}],yh9p:[function(e,t,r){\"use strict\";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=l(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,c=s>0?a-4:a;for(r=0;r>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+\"==\")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\")),o.join(\"\")};for(var n=[],i=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",s=0,u=a.length;s0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=e.indexOf(\"=\");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],o=t;o>1,f=-7,c=r?i-1:0,h=r?-1:1,d=e[t+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*u-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*b}},{}],REa7:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return\"[object Array]\"==n.call(e)}},{}],dskh:[function(e,t,r){var n=arguments[3],i=e(\"base64-js\"),o=e(\"ieee754\"),a=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 u(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(u()=u())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+u().toString(16)+\" bytes\");return 0|e}function w(e){return+e!=e&&(e=0),f.alloc(+e)}function _(e,t){if(f.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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return Q(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return ee(e).length;default:if(n)return Q(e).length;t=(\"\"+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return F(this,t,r);case\"utf8\":case\"utf-8\":return A(this,t,r);case\"ascii\":return L(this,t,r);case\"latin1\":case\"binary\":return N(this,t,r);case\"base64\":return M(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return U(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function x(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:O(e,t,r,n,i);if(\"number\"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):O(e,[t],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function O(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;hi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError(\"Invalid hex string\");n>o/2&&(n=o/2);for(var a=0;a239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return D(n)}r.Buffer=f,r.SlowBuffer=w,r.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:s(),r.kMaxLength=u(),f.poolSize=8192,f._augment=function(e){return e.__proto__=f.prototype,e},f.from=function(e,t,r){return c(null,e,t,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,\"undefined\"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(e,t,r){return d(null,e,t,r)},f.allocUnsafe=function(e){return p(null,e)},f.allocUnsafeSlow=function(e){return p(null,e)},f.isBuffer=function(e){return!(null==e||!e._isBuffer)},f.compare=function(e,t){if(!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError(\"Arguments must be Buffers\");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString(\"hex\",0,t).match(/.{2}/g).join(\" \"),this.length>t&&(e+=\" ... \")),\"\"},f.prototype.compare=function(e,t,r,n,i){if(!f.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return T(this,e,t,r);case\"utf8\":case\"utf-8\":return E(this,e,t,r);case\"ascii\":return C(this,e,t,r);case\"latin1\":case\"binary\":return P(this,e,t,r);case\"base64\":return j(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return R(this,e,t,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function D(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);for(var r=\"\",n=0;nn)&&(r=n);for(var i=\"\",o=t;or)throw new RangeError(\"Trying to access beyond buffer length\")}function G(e,t,r,n,i,o){if(!f.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 z(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function H(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function W(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function q(e,t,r,n,i){return i||W(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function K(e,t,r,n,i){return i||W(e,0,r,8),o.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},f.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},f.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]},f.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])},f.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},f.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},f.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},f.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]},f.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):H(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):H(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function ee(e){return i.toByteArray(Y(e))}function te(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e){return e!=e}},{\"base64-js\":\"yh9p\",ieee754:\"JgNJ\",isarray:\"REa7\",buffer:\"dskh\"}],VCcH:[function(e,t,r){\"use strict\";function n(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 i(e){for(var t=1;t0?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,r=\"\"+t.data;t=t.next;)r+=e+t.data;return r}},{key:\"concat\",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:\"consume\",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:\"_getBuffer\",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:\"dskh\",util:\"rDCW\"}],pBGv:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error(\"setTimeout has not been defined\")}function s(){throw new Error(\"clearTimeout has not been defined\")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function l(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}!function(){try{n=\"function\"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i=\"function\"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var f,c=[],h=!1,d=-1;function p(){h&&f&&(h=!1,f.length?c=f.concat(c):d=-1,c.length&&b())}function b(){if(!h){var e=u(p);h=!0;for(var t=c.length;t;){for(f=c,c=[];++d1)for(var r=1;r2?\"one of \".concat(t,\" \").concat(e.slice(0,r-1).join(\", \"),\", or \")+e[r-1]:2===r?\"one of \".concat(t,\" \").concat(e[0],\" or \").concat(e[1]):\"of \".concat(t,\" \").concat(e[0])}return\"of \".concat(t,\" \").concat(String(e))}o(\"ERR_INVALID_OPT_VALUE\",(function(e,t){return'The value \"'+t+'\" is invalid for option \"'+e+'\"'}),TypeError),o(\"ERR_INVALID_ARG_TYPE\",(function(e,t,r){var i,o;if(\"string\"==typeof t&&function(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}(t,\"not \")?(i=\"must not be\",t=t.replace(/^not /,\"\")):i=\"must be\",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e,\" argument\"))o=\"The \".concat(e,\" \").concat(i,\" \").concat(a(t,\"type\"));else{var s=function(e,t,r){return\"number\"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,\".\")?\"property\":\"argument\";o='The \"'.concat(e,'\" ').concat(s,\" \").concat(i,\" \").concat(a(t,\"type\"))}return o+\". Received type \".concat(n(r))}),TypeError),o(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),o(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(e){return\"The \"+e+\" method is not implemented\"})),o(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),o(\"ERR_STREAM_DESTROYED\",(function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"})),o(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),o(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),o(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),o(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),o(\"ERR_UNKNOWN_ENCODING\",(function(e){return\"Unknown encoding: \"+e}),TypeError),o(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=i},{}],TWVJ:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:\"highWaterMark\",o);return Math.floor(o)}return e.objectMode?16:16384}}},{\"../../../errors\":\"Yj9o\"}],Bm0n:[function(e,t,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],yM1o:[function(e,t,r){var n=arguments[3];function i(e,t){if(o(\"noDeprecation\"))return e;var r=!1;return function(){if(!r){if(o(\"throwDeprecation\"))throw new Error(t);o(\"traceDeprecation\")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}function o(e){try{if(!n.localStorage)return!1}catch(e){return!1}var t=n.localStorage[e];return null!=t&&\"true\"===String(t).toLowerCase()}t.exports=i},{}],WSyY:[function(e,t,r){e(\"process\");var n,i=arguments[3],o=e(\"process\");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){K(t,e)}}t.exports=P,P.WritableState=C;var s={deprecate:e(\"util-deprecate\")},u=e(\"./internal/streams/stream\"),l=e(\"buffer\").Buffer,f=i.Uint8Array||function(){};function c(e){return l.from(e)}function h(e){return l.isBuffer(e)||e instanceof f}var d,p=e(\"./internal/streams/destroy\"),b=e(\"./internal/streams/state\"),y=b.getHighWaterMark,v=e(\"../errors\").codes,g=v.ERR_INVALID_ARG_TYPE,m=v.ERR_METHOD_NOT_IMPLEMENTED,w=v.ERR_MULTIPLE_CALLBACK,_=v.ERR_STREAM_CANNOT_PIPE,k=v.ERR_STREAM_DESTROYED,x=v.ERR_STREAM_NULL_VALUES,S=v.ERR_STREAM_WRITE_AFTER_END,O=v.ERR_UNKNOWN_ENCODING,T=p.errorOrDestroy;function E(){}function C(t,r,i){n=n||e(\"./_stream_duplex\"),t=t||{},\"boolean\"!=typeof i&&(i=r instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=y(this,t,\"writableHighWaterMark\",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){N(r,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 a(this)}function P(t){var r=this instanceof(n=n||e(\"./_stream_duplex\"));if(!r&&!d.call(P,this))return new P(t);this._writableState=new C(t,this,r),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 j(e,t){var r=new S;T(e,r),o.nextTick(t,r)}function R(e,t,r,n){var i;return null===r?i=new x:\"string\"==typeof r||t.objectMode||(i=new g(\"chunk\",[\"string\",\"Buffer\"],r)),!i||(T(e,i),o.nextTick(n,i),!1)}function M(e,t,r){return e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=l.from(t,r)),t}function A(e,t,r,n,i,o){if(!r){var a=M(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 O(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,r){r(new m(\"_write()\"))},P.prototype._writev=null,P.prototype.end=function(e,t,r){var n=this._writableState;return\"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||q(this,n,r),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,r){e(\"process\");var n=e(\"process\"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var o=e(\"./_stream_readable\"),a=e(\"./_stream_writable\");e(\"inherits\")(f,o);for(var s=i(a.prototype),u=0;u>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\":\"Wugr\"}],mrEY:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,o){if(\"function\"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(\"string\"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=f(t)),n)a.endEmitted?T(e,new O):M(e,a,t,!0);else if(a.ended)T(e,new x);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):B(e,a)):M(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.length=I?e=I:(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=D(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function N(e,t){if(h(\"onEofChunk\"),!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,t.sync?F(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U(e)))}}function F(e){var t=e._readableState;h(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h(\"emitReadable\",t.flowing),t.emittedReadable=!0,o.nextTick(U,e))}function U(e){var t=e._readableState;h(\"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,V(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(G,e,t))}function G(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){h(\"readable nexttick read 0\"),e.read(0)}function q(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(K,e,t))}function K(e,t){h(\"resume\",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(\"resume\"),V(e),t.flowing&&!t.reading&&e.read(0)}function V(e){var t=e._readableState;for(h(\"flow\",t.flowing);t.flowing&&null!==e.read(););}function Y(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function Z(e){var t=e._readableState;h(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(J,t,e))}function J(e,t){if(h(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Q(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return h(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?Z(this):F(this),null;if(0===(e=L(e,t))&&t.ended)return 0===t.length&&Z(this),null;var n,i=t.needReadable;return h(\"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),r!==e&&t.ended&&Z(this)),null!==n&&this.emit(\"data\",n),n},j.prototype._read=function(e){T(this,new S(\"_read()\"))},j.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,h(\"pipe count=%d opts=%j\",n.pipesCount,t);var i=t&&!1===t.end||e===o.stdout||e===o.stderr?b:s;function s(){h(\"onend\"),e.end()}n.endEmitted?o.nextTick(i):r.once(\"end\",i),e.on(\"unpipe\",(function t(i,o){h(\"onunpipe\"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,h(\"cleanup\"),e.removeListener(\"close\",d),e.removeListener(\"finish\",p),e.removeListener(\"drain\",u),e.removeListener(\"error\",c),e.removeListener(\"unpipe\",t),r.removeListener(\"end\",s),r.removeListener(\"end\",b),r.removeListener(\"data\",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=z(r);e.on(\"drain\",u);var l=!1;function f(t){h(\"ondata\");var i=e.write(t);h(\"dest.write\",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Q(n.pipes,e))&&!l&&(h(\"false write response, pause\",n.awaitDrain),n.awaitDrain++),r.pause())}function c(t){h(\"onerror\",t),b(),e.removeListener(\"error\",c),0===a(e,\"error\")&&T(e,t)}function d(){e.removeListener(\"finish\",p),b()}function p(){h(\"onfinish\"),e.removeListener(\"close\",d),b()}function b(){h(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",f),C(e,\"error\",c),e.once(\"close\",d),e.once(\"finish\",p),e.emit(\"pipe\",r),n.flowing||(h(\"pipe resume\"),r.resume()),e},j.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;o0,!1!==n.flowing&&this.resume()):\"readable\"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,h(\"on readable\",n.length,n.reading),n.length?F(this):n.reading||o.nextTick(W,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return\"readable\"===e&&o.nextTick(H,this),r},j.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==e&&void 0!==e||o.nextTick(H,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(h(\"resume\"),e.flowing=!e.readableListening,q(this,e)),e.paused=!1,this},j.prototype.pause=function(){return h(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(h(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on(\"end\",(function(){if(h(\"wrapped end\"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on(\"data\",(function(i){h(\"wrapped data\"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!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 o=0;o0,(function(e){n||(n=e),e&&a.forEach(l),o||(a.forEach(l),i(n))}))}));return t.reduce(f)}},{\"../../../errors\":\"Yj9o\",\"./end-of-stream\":\"mrEY\"}],tzeh:[function(e,t,r){(r=t.exports=e(\"./lib/_stream_readable.js\")).Stream=r,r.Readable=r,r.Writable=e(\"./lib/_stream_writable.js\"),r.Duplex=e(\"./lib/_stream_duplex.js\"),r.Transform=e(\"./lib/_stream_transform.js\"),r.PassThrough=e(\"./lib/_stream_passthrough.js\"),r.finished=e(\"./lib/internal/streams/end-of-stream.js\"),r.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,r){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,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],gfUn:[function(e,t,r){e(\"process\");var n=e(\"process\"),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case\"%s\":return String(n[r++]);case\"%d\":return Number(n[r++]);case\"%j\":try{return JSON.stringify(n[r++])}catch(e){return\"[Circular]\"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?\"\u001b[\"+u.colors[r][0]+\"m\"+e+\"\u001b[\"+u.colors[r][1]+\"m\":e}function f(e,t){return e}function c(e,t,n){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return m(i)||(i=c(e,i,n)),i}var o=h(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),S(t)&&(a.indexOf(\"message\")>=0||a.indexOf(\"description\")>=0))return d(t);if(0===a.length){if(O(t)){var u=t.name?\": \"+t.name:\"\";return e.stylize(\"[Function\"+u+\"]\",\"special\")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),\"regexp\");if(x(t))return e.stylize(Date.prototype.toString.call(t),\"date\");if(S(t))return d(t)}var l,f=\"\",y=!1,v=[\"{\",\"}\"];return b(t)&&(y=!0,v=[\"[\",\"]\"]),O(t)&&(f=\" [Function\"+(t.name?\": \"+t.name:\"\")+\"]\"),_(t)&&(f=\" \"+RegExp.prototype.toString.call(t)),x(t)&&(f=\" \"+Date.prototype.toUTCString.call(t)),S(t)&&(f=\" \"+d(t)),0!==a.length||y&&0!=t.length?n<0?_(t)?e.stylize(RegExp.prototype.toString.call(t),\"regexp\"):e.stylize(\"[Object]\",\"special\"):(e.seen.push(t),l=y?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60?r[0]+(\"\"===t?\"\":t+\"\\n \")+\" \"+e.join(\",\\n \")+\" \"+r[1]:r[0]+t+\" \"+e.join(\", \")+\" \"+r[1]}(l,f,v)):v[0]+f+v[1]}function h(e,t){if(w(t))return e.stylize(\"undefined\",\"undefined\");if(m(t)){var r=\"'\"+JSON.stringify(t).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return e.stylize(r,\"string\")}return g(t)?e.stylize(\"\"+t,\"number\"):y(t)?e.stylize(\"\"+t,\"boolean\"):v(t)?e.stylize(\"null\",\"null\"):void 0}function d(e){return\"[\"+Error.prototype.toString.call(e)+\"]\"}function p(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize(\"[Getter/Setter]\",\"special\"):e.stylize(\"[Getter]\",\"special\"):u.set&&(s=e.stylize(\"[Setter]\",\"special\")),j(n,i)||(a=\"[\"+i+\"]\"),s||(e.seen.indexOf(u.value)<0?(s=v(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf(\"\\n\")>-1&&(s=o?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\")),w(a)){if(o&&i.match(/^\\d+$/))return s;(a=JSON.stringify(\"\"+i)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,\"name\")):(a=a.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),a=e.stylize(a,\"string\"))}return a+\": \"+s}function b(e){return Array.isArray(e)}function y(e){return\"boolean\"==typeof e}function v(e){return null===e}function g(e){return\"number\"==typeof e}function m(e){return\"string\"==typeof e}function w(e){return void 0===e}function _(e){return k(e)&&\"[object RegExp]\"===T(e)}function k(e){return\"object\"==typeof e&&null!==e}function x(e){return k(e)&&\"[object Date]\"===T(e)}function S(e){return k(e)&&(\"[object Error]\"===T(e)||e instanceof Error)}function O(e){return\"function\"==typeof e}function T(e){return Object.prototype.toString.call(e)}function E(e){return e<10?\"0\"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(w(a)&&(a=\"\"),e=e.toUpperCase(),!s[e])if(new RegExp(\"\\\\b\"+e+\"\\\\b\",\"i\").test(a)){var t=n.pid;s[e]=function(){var n=r.format.apply(r,arguments);console.error(\"%s %d: %s\",e,t,n)}}else s[e]=function(){};return s[e]},r.inspect=u,u.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]},u.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},r.isArray=b,r.isBoolean=y,r.isNull=v,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=m,r.isSymbol=function(e){return\"symbol\"==typeof e},r.isUndefined=w,r.isRegExp=_,r.isObject=k,r.isDate=x,r.isError=S,r.isFunction=O,r.isPrimitive=function(e){return null===e||\"boolean\"==typeof e||\"number\"==typeof e||\"string\"==typeof e||\"symbol\"==typeof e||void 0===e},r.isBuffer=e(\"./support/isBuffer\");var C=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];function P(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(\":\");return[e.getDate(),C[e.getMonth()],t].join(\" \")}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log(\"%s - %s\",P(),r.format.apply(r,arguments))},r.inherits=e(\"inherits\"),r._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R=\"undefined\"!=typeof Symbol?Symbol(\"util.promisify.custom\"):void 0;function M(e,t){if(!e){var r=new Error(\"Promise was rejected with a falsy value\");r.reason=e,e=r}return t(e)}r.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,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o\".charCodeAt(0),a=\"-\".charCodeAt(0),s=\"/\".charCodeAt(0),u=\"!\".charCodeAt(0),l=\"'\".charCodeAt(0),f='\"'.charCodeAt(0);function c(){for(var t=[];e[r];)if(e.charCodeAt(r)==i){if(e.charCodeAt(r+1)===s)return(r=e.indexOf(\">\",r))+1&&(r+=1),t;if(e.charCodeAt(r+1)===u){if(e.charCodeAt(r+2)==a){for(;-1!==r&&(e.charCodeAt(r)!==o||e.charCodeAt(r-1)!=a||e.charCodeAt(r-2)!=a||-1==r);)r=e.indexOf(\">\",r+1);-1===r&&(r=e.length)}else for(r+=2;e.charCodeAt(r)!==o&&e[r];)r++;r++;continue}var n=b();t.push(n)}else{var l=h();l.trim().length>0&&t.push(l),r++}return t}function h(){var t=r;return-2==(r=e.indexOf(\"<\",r)-1)&&(r=e.length),e.slice(t,r+1)}function d(){for(var t=r;-1===\"\\n\\t>/= \".indexOf(e[r])&&e[r];)r++;return e.slice(t,r)}var p=t.noChildNodes||[\"img\",\"br\",\"input\",\"meta\",\"link\"];function b(){r++;const t=d(),n={};let i=[];for(;e.charCodeAt(r)!==o&&e[r];){var a=e.charCodeAt(r);if(a>64&&a<91||a>96&&a<123){for(var u=d(),h=e.charCodeAt(r);h&&h!==l&&h!==f&&!(h>64&&h<91||h>96&&h<123)&&h!==o;)r++,h=e.charCodeAt(r);if(h===l||h===f){var b=y();if(-1===r)return{tagName:t,attributes:n,children:i}}else b=null,r--;n[u]=b}r++}if(e.charCodeAt(r-1)!==s)if(\"script\"==t){var v=r+1;r=e.indexOf(\"<\\/script>\",r),i=[e.slice(v,r-1)],r+=9}else\"style\"==t?(v=r+1,r=e.indexOf(\"\",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?"); +eval("var require;/**\r\n * Minified by jsDelivr using Terser v5.3.5.\r\n * Original file: /npm/geotiff@1.0.4/dist-browser/geotiff.js\r\n *\r\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\r\n */\r\nparcelRequire=function(e,t,r,n){var i,o=\"function\"==typeof parcelRequire&&parcelRequire,a=\"function\"==typeof require&&require;function s(r,n){if(!t[r]){if(!e[r]){var i=\"function\"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(r,!0);if(o)return o(r,!0);if( true&&\"string\"==typeof r)return __webpack_require__(\"./src/secondary/geotiff sync recursive\")(r);var u=new Error(\"Cannot find module '\"+r+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}f.resolve=function(t){return e[r][1][t]||t},f.cache={};var l=t[r]=new s.Module(r);e[r][0].call(l.exports,f,l,l.exports,this)}return t[r].exports;function f(e){return s(f.resolve(e))}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.exports={}},s.modules=e,s.cache=t,s.parent=o,s.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]};for(var u=0;u=0;--o){var a=this.tryEntries[o],s=a.completion;if(\"root\"===a.tryLoc)return i(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;T(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),p}},e}(\"object\"==typeof t?t.exports:{});try{regeneratorRuntime=n}catch(e){Function(\"r\",\"regeneratorRuntime = r\")(n)}},{}],PMvg:[function(e,t,r){t.exports=e(\"regenerator-runtime\")},{\"regenerator-runtime\":\"QVnC\"}],IxO8:[function(e,t,r){t.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},{}],OUZ9:[function(e,t,r){t.exports=function(e){if(Array.isArray(e))return e}},{}],vKPt:[function(e,t,r){t.exports=function(e,t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},{}],NVR6:[function(e,t,r){t.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>23&511;return a[r]+((8388607&t)>>s[r])},r.convertToNumber=function(e){const t=e>>10;return o[0]=u[f[t]+(1023&e)]+l[t],i[0]};const n=new ArrayBuffer(4),i=new Float32Array(n),o=new Uint32Array(n),a=new Uint32Array(512),s=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(a[0|e]=0,a[256|e]=32768,s[0|e]=24,s[256|e]=24):t<-14?(a[0|e]=1024>>-t-14,a[256|e]=1024>>-t-14|32768,s[0|e]=-t-1,s[256|e]=-t-1):t<=15?(a[0|e]=t+15<<10,a[256|e]=t+15<<10|32768,s[0|e]=13,s[256|e]=13):t<128?(a[0|e]=31744,a[256|e]=64512,s[0|e]=24,s[256|e]=24):(a[0|e]=31744,a[256|e]=64512,s[0|e]=13,s[256|e]=13)}const u=new Uint32Array(2048),l=new Uint32Array(64),f=new Uint32Array(64);u[0]=0;for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;0==(8388608&t);)r-=8388608,t<<=1;t&=-8388609,r+=947912704,u[e]=t|r}for(let e=1024;e<2048;++e)u[e]=939524096+(e-1024<<13);l[0]=0;for(let e=1;e<31;++e)l[e]=e<<23;l[31]=1199570944,l[32]=2147483648;for(let e=33;e<63;++e)l[e]=2147483648+(e-32<<23);l[63]=3347054592,f[0]=0;for(let e=1;e<64;++e)f[e]=32===e?0:1024},{}],G4sf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=function(e){if(e=Number(e),!Number.isFinite(e)||0===e)return e;const t=(0,n.roundToFloat16Bits)(e);return(0,n.convertToNumber)(t)};var n=e(\"./lib\")},{\"./lib\":\"GG94\"}],xQUP:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.ToInteger=function(e){return\"number\"!=typeof e&&(e=Number(e)),Number.isNaN(e)&&(e=0),Math.trunc(e)},r.defaultCompareFunction=function(e,t){const[r,n]=[Number.isNaN(e),Number.isNaN(t)];if(r&&n)return 0;if(r)return 1;if(n)return-1;if(et)return 1;if(0===e&&0===t){const[r,n]=[Object.is(e,0),Object.is(t,0)];if(!r&&n)return-1;if(r&&!n)return 1}return 0}},{}],iJ7y:[function(e,t,r){var n=arguments[3];Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var i=\"object\"==typeof n&&n&&n.Object===Object&&n,o=i;r.default=o},{}],ygki:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof self&&self&&self.Object===Object&&self,o=n.default||i||Function(\"return this\")();r.default=o},{\"./_freeGlobal.js\":\"iJ7y\"}],Oi8n:[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(\"./_root.js\")).default.Symbol;r.default=n},{\"./_root.js\":\"ygki\"}],InRc:[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(\"./_Symbol.js\"));var i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n.default?n.default.toStringTag:void 0;var u=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i};r.default=u},{\"./_Symbol.js\":\"Oi8n\"}],iwg4:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Object.prototype.toString;var i=function(e){return n.call(e)};r.default=i},{}],svpX:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_Symbol.js\")),i=a(e(\"./_getRawTag.js\")),o=a(e(\"./_objectToString.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=n.default?n.default.toStringTag:void 0;var u=function(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":s&&s in Object(e)?(0,i.default)(e):(0,o.default)(e)};r.default=u},{\"./_Symbol.js\":\"Oi8n\",\"./_getRawTag.js\":\"InRc\",\"./_objectToString.js\":\"iwg4\"}],UKR9:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return null!=e&&\"object\"==typeof e};r.default=n},{}],MYZg:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObjectLike.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){return(0,i.default)(e)&&\"[object ArrayBuffer]\"==(0,n.default)(e)};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObjectLike.js\":\"UKR9\"}],pmj6:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return function(t){return e(t)}};r.default=n},{}],oPFz:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof r&&r&&!r.nodeType&&r,o=i&&\"object\"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&n.default.process,s=function(){try{return o&&o.require&&o.require(\"util\").types||a&&a.binding&&a.binding(\"util\")}catch(e){}}();r.default=s},{\"./_freeGlobal.js\":\"iJ7y\"}],rXXV:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_baseIsArrayBuffer.js\")),i=a(e(\"./_baseUnary.js\")),o=a(e(\"./_nodeUtil.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=o.default&&o.default.isArrayBuffer,u=s?(0,i.default)(s):n.default;r.default=u},{\"./_baseIsArrayBuffer.js\":\"MYZg\",\"./_baseUnary.js\":\"pmj6\",\"./_nodeUtil.js\":\"oPFz\"}],XYHx:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.isDataView=function(e){return e instanceof DataView},r.isStringNumberKey=function(e){return\"string\"==typeof e&&e===(0,n.ToInteger)(e)+\"\"},Object.defineProperty(r,\"isArrayBuffer\",{enumerable:!0,get:function(){return i.default}});var n=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,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.createPrivateStorage=function(){const e=new WeakMap;return t=>{let r=e.get(t);return r||(r=Object.create(null),e.set(t,r),r)}}},{}],DTZk:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)};r.default=n},{}],tWvT:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObject.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){if(!(0,i.default)(e))return!1;var t=(0,n.default)(e);return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObject.js\":\"DTZk\"}],xFkS:[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(\"./_root.js\")).default[\"__core-js_shared__\"];r.default=n},{\"./_root.js\":\"ygki\"}],pULC:[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(\"./_coreJsData.js\"));var i=function(){var e=/[^.]+$/.exec(n.default&&n.default.keys&&n.default.keys.IE_PROTO||\"\");return e?\"Symbol(src)_1.\"+e:\"\"}();var o=function(e){return!!i&&i in e};r.default=o},{\"./_coreJsData.js\":\"xFkS\"}],UKJK:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Function.prototype.toString;var i=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"};r.default=i},{}],Zczf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=s(e(\"./isFunction.js\")),i=s(e(\"./_isMasked.js\")),o=s(e(\"./isObject.js\")),a=s(e(\"./_toSource.js\"));function s(e){return e&&e.__esModule?e:{default:e}}var u=/^\\[object .+?Constructor\\]$/,l=Function.prototype,f=Object.prototype,c=l.toString,h=f.hasOwnProperty,d=RegExp(\"^\"+c.call(h).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");var p=function(e){return!(!(0,o.default)(e)||(0,i.default)(e))&&((0,n.default)(e)?d:u).test((0,a.default)(e))};r.default=p},{\"./isFunction.js\":\"tWvT\",\"./_isMasked.js\":\"pULC\",\"./isObject.js\":\"DTZk\",\"./_toSource.js\":\"UKJK\"}],ZVQn:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e,t){return null==e?void 0:e[t]};r.default=n},{}],tx41:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseIsNative.js\")),i=o(e(\"./_getValue.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e,t){var r=(0,i.default)(e,t);return(0,n.default)(r)?r:void 0};r.default=a},{\"./_baseIsNative.js\":\"Zczf\",\"./_getValue.js\":\"ZVQn\"}],YsDH:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=(0,function(e){return e&&e.__esModule?e:{default:e}}(e(\"./_getNative.js\")).default)(Object,\"create\");r.default=n},{\"./_getNative.js\":\"tx41\"}],sJnX:[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(\"./_nativeCreate.js\"));var i=function(){this.__data__=n.default?(0,n.default)(null):{},this.size=0};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],c9sB:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};r.default=n},{}],zYTU:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;if(n.default){var r=t[e];return\"__lodash_hash_undefined__\"===r?void 0:r}return i.call(t,e)?t[e]:void 0};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],ZFwF:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;return n.default?void 0!==t[e]:i.call(t,e)};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],i3LK:[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(\"./_nativeCreate.js\"));var i=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n.default&&void 0===t?\"__lodash_hash_undefined__\":t,this};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],tE4I:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_hashClear.js\")),i=u(e(\"./_hashDelete.js\")),o=u(e(\"./_hashGet.js\")),a=u(e(\"./_hashHas.js\")),s=u(e(\"./_hashSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],GGNI:[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(\"./_assocIndexOf.js\"));var i=function(e,t){var r=this.__data__,i=(0,n.default)(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],UlXa:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_listCacheClear.js\")),i=u(e(\"./_listCacheDelete.js\")),o=u(e(\"./_listCacheGet.js\")),a=u(e(\"./_listCacheHas.js\")),s=u(e(\"./_listCacheSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tf(t)&&function(e){return\"function\"==typeof e&&v.has(e)}(e)?Reflect.apply(e,l(t).target,r):Reflect.apply(e,t,r)},p={get(e,t){let r=null;if(u.isTypedArrayIndexedPropertyWritable||(e=l(r=e).target),(0,i.isStringNumberKey)(t))return Reflect.has(e,t)?(0,s.convertToNumber)(Reflect.get(e,t)):void 0;{const n=null!==r&&Reflect.has(r,t)?Reflect.get(r,t):Reflect.get(e,t);if(\"function\"!=typeof n)return n;let i=l(n).proxy;return void 0===i&&(i=l(n).proxy=new Proxy(n,d)),i}},set(e,t,r){let n=null;return u.isTypedArrayIndexedPropertyWritable||(e=l(n=e).target),(0,i.isStringNumberKey)(t)?Reflect.set(e,t,(0,s.roundToFloat16Bits)(r)):null===n||Reflect.has(e,t)&&!Object.isFrozen(n)?Reflect.set(e,t,r):Reflect.set(n,t,r)}};u.isTypedArrayIndexedPropertyWritable||(p.getPrototypeOf=e=>Reflect.getPrototypeOf(l(e).target),p.setPrototypeOf=(e,t)=>Reflect.setPrototypeOf(l(e).target,t),p.defineProperty=(e,t,r)=>{const n=l(e).target;return!Reflect.has(n,t)||Object.isFrozen(e)?Reflect.defineProperty(e,t,r):Reflect.defineProperty(n,t,r)},p.deleteProperty=(e,t)=>{const r=l(e).target;return Reflect.has(e,t)?Reflect.deleteProperty(e,t):Reflect.deleteProperty(r,t)},p.has=(e,t)=>Reflect.has(e,t)||Reflect.has(l(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 b extends Uint16Array{constructor(e,t,r){if(f(e))super(l(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,r);break;default:super(...arguments)}else{const t=Reflect.has(e,\"length\")||void 0===e[Symbol.iterator]?e:[...e],r=t.length;super(r);for(let e=0;et(r(e),r(n)))),l(this).proxy}slice(...e){let t;c(this);try{t=super.slice(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).slice(...e)}return new b(t.buffer)}subarray(...e){let t;c(this);try{t=super.subarray(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).subarray(...e)}return new b(t.buffer,t.byteOffset,t.length)}indexOf(e,...t){c(this);const r=this.length;let i=(0,n.ToInteger)(t[0]);i<0&&(i+=r)<0&&(i=0);for(let t=i,n=r;t=0?i=i0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error(\"Possible EventEmitter memory leak detected. \"+a.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");s.name=\"MaxListenersExceededWarning\",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function h(){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 d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error(\"Unhandled error.\"+(a?\" (\"+a.message+\")\":\"\"));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if(\"function\"==typeof u)o(u,this,t);else{var l=u.length,f=y(u,l);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);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):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],ExO1:[function(e,t,r){t.exports=e(\"events\").EventEmitter},{events:\"FRpO\"}],yh9p:[function(e,t,r){\"use strict\";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=l(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,c=s>0?a-4:a;for(r=0;r>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+\"==\")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\")),o.join(\"\")};for(var n=[],i=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",s=0,u=a.length;s0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=e.indexOf(\"=\");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],o=t;o>1,f=-7,c=r?i-1:0,h=r?-1:1,d=e[t+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*u-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*b}},{}],REa7:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return\"[object Array]\"==n.call(e)}},{}],dskh:[function(e,t,r){var n=arguments[3],i=e(\"base64-js\"),o=e(\"ieee754\"),a=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 u(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(u()=u())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+u().toString(16)+\" bytes\");return 0|e}function w(e){return+e!=e&&(e=0),f.alloc(+e)}function _(e,t){if(f.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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return Q(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return ee(e).length;default:if(n)return Q(e).length;t=(\"\"+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return F(this,t,r);case\"utf8\":case\"utf-8\":return A(this,t,r);case\"ascii\":return L(this,t,r);case\"latin1\":case\"binary\":return N(this,t,r);case\"base64\":return M(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return U(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function x(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:O(e,t,r,n,i);if(\"number\"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):O(e,[t],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function O(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;hi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError(\"Invalid hex string\");n>o/2&&(n=o/2);for(var a=0;a239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return D(n)}r.Buffer=f,r.SlowBuffer=w,r.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:s(),r.kMaxLength=u(),f.poolSize=8192,f._augment=function(e){return e.__proto__=f.prototype,e},f.from=function(e,t,r){return c(null,e,t,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,\"undefined\"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(e,t,r){return d(null,e,t,r)},f.allocUnsafe=function(e){return p(null,e)},f.allocUnsafeSlow=function(e){return p(null,e)},f.isBuffer=function(e){return!(null==e||!e._isBuffer)},f.compare=function(e,t){if(!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError(\"Arguments must be Buffers\");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString(\"hex\",0,t).match(/.{2}/g).join(\" \"),this.length>t&&(e+=\" ... \")),\"\"},f.prototype.compare=function(e,t,r,n,i){if(!f.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return T(this,e,t,r);case\"utf8\":case\"utf-8\":return E(this,e,t,r);case\"ascii\":return C(this,e,t,r);case\"latin1\":case\"binary\":return P(this,e,t,r);case\"base64\":return j(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return R(this,e,t,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function D(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);for(var r=\"\",n=0;nn)&&(r=n);for(var i=\"\",o=t;or)throw new RangeError(\"Trying to access beyond buffer length\")}function G(e,t,r,n,i,o){if(!f.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 z(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function H(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function W(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function q(e,t,r,n,i){return i||W(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function K(e,t,r,n,i){return i||W(e,0,r,8),o.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},f.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},f.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]},f.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])},f.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},f.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},f.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},f.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]},f.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):H(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):H(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function ee(e){return i.toByteArray(Y(e))}function te(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e){return e!=e}},{\"base64-js\":\"yh9p\",ieee754:\"JgNJ\",isarray:\"REa7\",buffer:\"dskh\"}],VCcH:[function(e,t,r){\"use strict\";function n(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 i(e){for(var t=1;t0?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,r=\"\"+t.data;t=t.next;)r+=e+t.data;return r}},{key:\"concat\",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:\"consume\",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:\"_getBuffer\",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:\"dskh\",util:\"rDCW\"}],pBGv:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error(\"setTimeout has not been defined\")}function s(){throw new Error(\"clearTimeout has not been defined\")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function l(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}!function(){try{n=\"function\"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i=\"function\"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var f,c=[],h=!1,d=-1;function p(){h&&f&&(h=!1,f.length?c=f.concat(c):d=-1,c.length&&b())}function b(){if(!h){var e=u(p);h=!0;for(var t=c.length;t;){for(f=c,c=[];++d1)for(var r=1;r2?\"one of \".concat(t,\" \").concat(e.slice(0,r-1).join(\", \"),\", or \")+e[r-1]:2===r?\"one of \".concat(t,\" \").concat(e[0],\" or \").concat(e[1]):\"of \".concat(t,\" \").concat(e[0])}return\"of \".concat(t,\" \").concat(String(e))}o(\"ERR_INVALID_OPT_VALUE\",(function(e,t){return'The value \"'+t+'\" is invalid for option \"'+e+'\"'}),TypeError),o(\"ERR_INVALID_ARG_TYPE\",(function(e,t,r){var i,o;if(\"string\"==typeof t&&function(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}(t,\"not \")?(i=\"must not be\",t=t.replace(/^not /,\"\")):i=\"must be\",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e,\" argument\"))o=\"The \".concat(e,\" \").concat(i,\" \").concat(a(t,\"type\"));else{var s=function(e,t,r){return\"number\"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,\".\")?\"property\":\"argument\";o='The \"'.concat(e,'\" ').concat(s,\" \").concat(i,\" \").concat(a(t,\"type\"))}return o+\". Received type \".concat(n(r))}),TypeError),o(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),o(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(e){return\"The \"+e+\" method is not implemented\"})),o(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),o(\"ERR_STREAM_DESTROYED\",(function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"})),o(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),o(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),o(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),o(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),o(\"ERR_UNKNOWN_ENCODING\",(function(e){return\"Unknown encoding: \"+e}),TypeError),o(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=i},{}],TWVJ:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:\"highWaterMark\",o);return Math.floor(o)}return e.objectMode?16:16384}}},{\"../../../errors\":\"Yj9o\"}],Bm0n:[function(e,t,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],yM1o:[function(e,t,r){var n=arguments[3];function i(e,t){if(o(\"noDeprecation\"))return e;var r=!1;return function(){if(!r){if(o(\"throwDeprecation\"))throw new Error(t);o(\"traceDeprecation\")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}function o(e){try{if(!n.localStorage)return!1}catch(e){return!1}var t=n.localStorage[e];return null!=t&&\"true\"===String(t).toLowerCase()}t.exports=i},{}],WSyY:[function(e,t,r){e(\"process\");var n,i=arguments[3],o=e(\"process\");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){K(t,e)}}t.exports=P,P.WritableState=C;var s={deprecate:e(\"util-deprecate\")},u=e(\"./internal/streams/stream\"),l=e(\"buffer\").Buffer,f=i.Uint8Array||function(){};function c(e){return l.from(e)}function h(e){return l.isBuffer(e)||e instanceof f}var d,p=e(\"./internal/streams/destroy\"),b=e(\"./internal/streams/state\"),y=b.getHighWaterMark,v=e(\"../errors\").codes,g=v.ERR_INVALID_ARG_TYPE,m=v.ERR_METHOD_NOT_IMPLEMENTED,w=v.ERR_MULTIPLE_CALLBACK,_=v.ERR_STREAM_CANNOT_PIPE,k=v.ERR_STREAM_DESTROYED,x=v.ERR_STREAM_NULL_VALUES,S=v.ERR_STREAM_WRITE_AFTER_END,O=v.ERR_UNKNOWN_ENCODING,T=p.errorOrDestroy;function E(){}function C(t,r,i){n=n||e(\"./_stream_duplex\"),t=t||{},\"boolean\"!=typeof i&&(i=r instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=y(this,t,\"writableHighWaterMark\",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){N(r,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 a(this)}function P(t){var r=this instanceof(n=n||e(\"./_stream_duplex\"));if(!r&&!d.call(P,this))return new P(t);this._writableState=new C(t,this,r),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 j(e,t){var r=new S;T(e,r),o.nextTick(t,r)}function R(e,t,r,n){var i;return null===r?i=new x:\"string\"==typeof r||t.objectMode||(i=new g(\"chunk\",[\"string\",\"Buffer\"],r)),!i||(T(e,i),o.nextTick(n,i),!1)}function M(e,t,r){return e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=l.from(t,r)),t}function A(e,t,r,n,i,o){if(!r){var a=M(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 O(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,r){r(new m(\"_write()\"))},P.prototype._writev=null,P.prototype.end=function(e,t,r){var n=this._writableState;return\"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||q(this,n,r),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,r){e(\"process\");var n=e(\"process\"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var o=e(\"./_stream_readable\"),a=e(\"./_stream_writable\");e(\"inherits\")(f,o);for(var s=i(a.prototype),u=0;u>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\":\"Wugr\"}],mrEY:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,o){if(\"function\"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(\"string\"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=f(t)),n)a.endEmitted?T(e,new O):M(e,a,t,!0);else if(a.ended)T(e,new x);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):B(e,a)):M(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.length=I?e=I:(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=D(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function N(e,t){if(h(\"onEofChunk\"),!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,t.sync?F(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U(e)))}}function F(e){var t=e._readableState;h(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h(\"emitReadable\",t.flowing),t.emittedReadable=!0,o.nextTick(U,e))}function U(e){var t=e._readableState;h(\"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,V(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(G,e,t))}function G(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){h(\"readable nexttick read 0\"),e.read(0)}function q(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(K,e,t))}function K(e,t){h(\"resume\",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(\"resume\"),V(e),t.flowing&&!t.reading&&e.read(0)}function V(e){var t=e._readableState;for(h(\"flow\",t.flowing);t.flowing&&null!==e.read(););}function Y(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function Z(e){var t=e._readableState;h(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(J,t,e))}function J(e,t){if(h(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Q(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return h(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?Z(this):F(this),null;if(0===(e=L(e,t))&&t.ended)return 0===t.length&&Z(this),null;var n,i=t.needReadable;return h(\"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),r!==e&&t.ended&&Z(this)),null!==n&&this.emit(\"data\",n),n},j.prototype._read=function(e){T(this,new S(\"_read()\"))},j.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,h(\"pipe count=%d opts=%j\",n.pipesCount,t);var i=t&&!1===t.end||e===o.stdout||e===o.stderr?b:s;function s(){h(\"onend\"),e.end()}n.endEmitted?o.nextTick(i):r.once(\"end\",i),e.on(\"unpipe\",(function t(i,o){h(\"onunpipe\"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,h(\"cleanup\"),e.removeListener(\"close\",d),e.removeListener(\"finish\",p),e.removeListener(\"drain\",u),e.removeListener(\"error\",c),e.removeListener(\"unpipe\",t),r.removeListener(\"end\",s),r.removeListener(\"end\",b),r.removeListener(\"data\",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=z(r);e.on(\"drain\",u);var l=!1;function f(t){h(\"ondata\");var i=e.write(t);h(\"dest.write\",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Q(n.pipes,e))&&!l&&(h(\"false write response, pause\",n.awaitDrain),n.awaitDrain++),r.pause())}function c(t){h(\"onerror\",t),b(),e.removeListener(\"error\",c),0===a(e,\"error\")&&T(e,t)}function d(){e.removeListener(\"finish\",p),b()}function p(){h(\"onfinish\"),e.removeListener(\"close\",d),b()}function b(){h(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",f),C(e,\"error\",c),e.once(\"close\",d),e.once(\"finish\",p),e.emit(\"pipe\",r),n.flowing||(h(\"pipe resume\"),r.resume()),e},j.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;o0,!1!==n.flowing&&this.resume()):\"readable\"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,h(\"on readable\",n.length,n.reading),n.length?F(this):n.reading||o.nextTick(W,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return\"readable\"===e&&o.nextTick(H,this),r},j.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==e&&void 0!==e||o.nextTick(H,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(h(\"resume\"),e.flowing=!e.readableListening,q(this,e)),e.paused=!1,this},j.prototype.pause=function(){return h(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(h(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on(\"end\",(function(){if(h(\"wrapped end\"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on(\"data\",(function(i){h(\"wrapped data\"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!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 o=0;o0,(function(e){n||(n=e),e&&a.forEach(l),o||(a.forEach(l),i(n))}))}));return t.reduce(f)}},{\"../../../errors\":\"Yj9o\",\"./end-of-stream\":\"mrEY\"}],tzeh:[function(e,t,r){(r=t.exports=e(\"./lib/_stream_readable.js\")).Stream=r,r.Readable=r,r.Writable=e(\"./lib/_stream_writable.js\"),r.Duplex=e(\"./lib/_stream_duplex.js\"),r.Transform=e(\"./lib/_stream_transform.js\"),r.PassThrough=e(\"./lib/_stream_passthrough.js\"),r.finished=e(\"./lib/internal/streams/end-of-stream.js\"),r.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,r){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,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],gfUn:[function(e,t,r){e(\"process\");var n=e(\"process\"),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case\"%s\":return String(n[r++]);case\"%d\":return Number(n[r++]);case\"%j\":try{return JSON.stringify(n[r++])}catch(e){return\"[Circular]\"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?\"\u001b[\"+u.colors[r][0]+\"m\"+e+\"\u001b[\"+u.colors[r][1]+\"m\":e}function f(e,t){return e}function c(e,t,n){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return m(i)||(i=c(e,i,n)),i}var o=h(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),S(t)&&(a.indexOf(\"message\")>=0||a.indexOf(\"description\")>=0))return d(t);if(0===a.length){if(O(t)){var u=t.name?\": \"+t.name:\"\";return e.stylize(\"[Function\"+u+\"]\",\"special\")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),\"regexp\");if(x(t))return e.stylize(Date.prototype.toString.call(t),\"date\");if(S(t))return d(t)}var l,f=\"\",y=!1,v=[\"{\",\"}\"];return b(t)&&(y=!0,v=[\"[\",\"]\"]),O(t)&&(f=\" [Function\"+(t.name?\": \"+t.name:\"\")+\"]\"),_(t)&&(f=\" \"+RegExp.prototype.toString.call(t)),x(t)&&(f=\" \"+Date.prototype.toUTCString.call(t)),S(t)&&(f=\" \"+d(t)),0!==a.length||y&&0!=t.length?n<0?_(t)?e.stylize(RegExp.prototype.toString.call(t),\"regexp\"):e.stylize(\"[Object]\",\"special\"):(e.seen.push(t),l=y?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60?r[0]+(\"\"===t?\"\":t+\"\\n \")+\" \"+e.join(\",\\n \")+\" \"+r[1]:r[0]+t+\" \"+e.join(\", \")+\" \"+r[1]}(l,f,v)):v[0]+f+v[1]}function h(e,t){if(w(t))return e.stylize(\"undefined\",\"undefined\");if(m(t)){var r=\"'\"+JSON.stringify(t).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return e.stylize(r,\"string\")}return g(t)?e.stylize(\"\"+t,\"number\"):y(t)?e.stylize(\"\"+t,\"boolean\"):v(t)?e.stylize(\"null\",\"null\"):void 0}function d(e){return\"[\"+Error.prototype.toString.call(e)+\"]\"}function p(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize(\"[Getter/Setter]\",\"special\"):e.stylize(\"[Getter]\",\"special\"):u.set&&(s=e.stylize(\"[Setter]\",\"special\")),j(n,i)||(a=\"[\"+i+\"]\"),s||(e.seen.indexOf(u.value)<0?(s=v(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf(\"\\n\")>-1&&(s=o?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\")),w(a)){if(o&&i.match(/^\\d+$/))return s;(a=JSON.stringify(\"\"+i)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,\"name\")):(a=a.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),a=e.stylize(a,\"string\"))}return a+\": \"+s}function b(e){return Array.isArray(e)}function y(e){return\"boolean\"==typeof e}function v(e){return null===e}function g(e){return\"number\"==typeof e}function m(e){return\"string\"==typeof e}function w(e){return void 0===e}function _(e){return k(e)&&\"[object RegExp]\"===T(e)}function k(e){return\"object\"==typeof e&&null!==e}function x(e){return k(e)&&\"[object Date]\"===T(e)}function S(e){return k(e)&&(\"[object Error]\"===T(e)||e instanceof Error)}function O(e){return\"function\"==typeof e}function T(e){return Object.prototype.toString.call(e)}function E(e){return e<10?\"0\"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(w(a)&&(a=\"\"),e=e.toUpperCase(),!s[e])if(new RegExp(\"\\\\b\"+e+\"\\\\b\",\"i\").test(a)){var t=n.pid;s[e]=function(){var n=r.format.apply(r,arguments);console.error(\"%s %d: %s\",e,t,n)}}else s[e]=function(){};return s[e]},r.inspect=u,u.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]},u.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},r.isArray=b,r.isBoolean=y,r.isNull=v,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=m,r.isSymbol=function(e){return\"symbol\"==typeof e},r.isUndefined=w,r.isRegExp=_,r.isObject=k,r.isDate=x,r.isError=S,r.isFunction=O,r.isPrimitive=function(e){return null===e||\"boolean\"==typeof e||\"number\"==typeof e||\"string\"==typeof e||\"symbol\"==typeof e||void 0===e},r.isBuffer=e(\"./support/isBuffer\");var C=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];function P(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(\":\");return[e.getDate(),C[e.getMonth()],t].join(\" \")}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log(\"%s - %s\",P(),r.format.apply(r,arguments))},r.inherits=e(\"inherits\"),r._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R=\"undefined\"!=typeof Symbol?Symbol(\"util.promisify.custom\"):void 0;function M(e,t){if(!e){var r=new Error(\"Promise was rejected with a falsy value\");r.reason=e,e=r}return t(e)}r.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,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o\".charCodeAt(0),a=\"-\".charCodeAt(0),s=\"/\".charCodeAt(0),u=\"!\".charCodeAt(0),l=\"'\".charCodeAt(0),f='\"'.charCodeAt(0);function c(){for(var t=[];e[r];)if(e.charCodeAt(r)==i){if(e.charCodeAt(r+1)===s)return(r=e.indexOf(\">\",r))+1&&(r+=1),t;if(e.charCodeAt(r+1)===u){if(e.charCodeAt(r+2)==a){for(;-1!==r&&(e.charCodeAt(r)!==o||e.charCodeAt(r-1)!=a||e.charCodeAt(r-2)!=a||-1==r);)r=e.indexOf(\">\",r+1);-1===r&&(r=e.length)}else for(r+=2;e.charCodeAt(r)!==o&&e[r];)r++;r++;continue}var n=b();t.push(n)}else{var l=h();l.trim().length>0&&t.push(l),r++}return t}function h(){var t=r;return-2==(r=e.indexOf(\"<\",r)-1)&&(r=e.length),e.slice(t,r+1)}function d(){for(var t=r;-1===\"\\n\\t>/= \".indexOf(e[r])&&e[r];)r++;return e.slice(t,r)}var p=t.noChildNodes||[\"img\",\"br\",\"input\",\"meta\",\"link\"];function b(){r++;const t=d(),n={};let i=[];for(;e.charCodeAt(r)!==o&&e[r];){var a=e.charCodeAt(r);if(a>64&&a<91||a>96&&a<123){for(var u=d(),h=e.charCodeAt(r);h&&h!==l&&h!==f&&!(h>64&&h<91||h>96&&h<123)&&h!==o;)r++,h=e.charCodeAt(r);if(h===l||h===f){var b=y();if(-1===r)return{tagName:t,attributes:n,children:i}}else b=null,r--;n[u]=b}r++}if(e.charCodeAt(r-1)!==s)if(\"script\"==t){var v=r+1;r=e.indexOf(\"<\\/script>\",r),i=[e.slice(v,r-1)],r+=9}else\"style\"==t?(v=r+1,r=e.indexOf(\"\",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\");\r\n//# sourceMappingURL=/sm/6b05ec3e6aee27214397dcd933f0a1a0def04511045c0ced378787b04765ef87.map\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/geotiff/geotiff.js?"); /***/ }), @@ -2280,7 +2280,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _loa /***/ (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 (parameters === undefined) parameters = {};\n\n if (id && this.spriteMaterials.hasOwnProperty(id + \"_\" + JSON.stringify(parameters)) && forceNewMaterial !== true) {\n return this.spriteMaterials[id + \"_\" + JSON.stringify(parameters)];\n } else {\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 * Math.ceil(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 texture.anisotropy = 0;\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.wrapT = three__WEBPACK_IMPORTED_MODULE_0__[\"ClampToEdgeWrapping\"];\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 + \"_\" + JSON.stringify(parameters)] = 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?"); +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, options, forceNewMaterial) {\n if (options === void 0) {\n options = {};\n }\n\n var sprite = new three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"](Sprites.makeMarkerMaterial(parameters, id, options, 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, options, forceNewMaterial) {\n if (parameters === undefined) parameters = {};\n\n if (id && this.spriteMaterials.hasOwnProperty(id + \"_\" + JSON.stringify(parameters)) && forceNewMaterial !== true) {\n return this.spriteMaterials[id + \"_\" + JSON.stringify(parameters)];\n } else {\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 ctx = canvas.getContext('2d');\n ctx.lineWidth = strokeWeight * Math.ceil(radius / 8);\n\n if (options.annotation === true) {\n var text = options.name || '';\n var fontXOffset = 8;\n var fontSize = parameters.fontSize || '16px';\n fontSize = parseInt(fontSize.replace('px', '')) * 1.1;\n ctx.font = fontSize + \"pt sans-serif\";\n var heightInnerOverflow = 10;\n var heightOuterOverflow = fontSize / 3.5;\n var textSize = {\n width: ctx.measureText(text).width + fontXOffset * 2,\n height: fontSize + heightInnerOverflow + heightOuterOverflow\n };\n canvas.width = textSize.width;\n canvas.height = textSize.height;\n parameters.width = canvas.width / 6;\n parameters.height = canvas.height / 6;\n ctx.font = fontSize + \"pt sans-serif\";\n var canvasX = 0;\n ctx.fillStyle = strokeColor;\n ctx.fillRect(0, heightOuterOverflow / 2, textSize.width, textSize.height - heightOuterOverflow);\n ctx.fillStyle = fillColor;\n ctx.fillText(text, canvasX + fontXOffset, fontSize + heightOuterOverflow / 2 + heightInnerOverflow / 2);\n } else {\n var width = radius * 2;\n var height = radius * 2;\n canvas.width = width;\n canvas.height = height;\n ctx.beginPath();\n ctx.arc(canvas.width / 2, canvas.height / 2, radius - strokeWeight * (radius / 12), 0, 2 * Math.PI, false);\n\n if (typeof fillColor === 'object') {\n ctx.fillStyle = 'rgba(' + fillColor.r + ',' + fillColor.g + ',' + fillColor.b + ',' + fillColor.a + ')';\n } else {\n ctx.fillStyle = fillColor;\n }\n\n ctx.fill();\n\n if (typeof strokeColor === 'object') {\n ctx.strokeStyle = 'rgba(' + strokeColor.r + ',' + strokeColor.g + ',' + strokeColor.b + ',' + strokeColor.a + ')';\n } else {\n ctx.strokeStyle = strokeColor;\n }\n\n ctx.stroke();\n }\n\n var texture = new three__WEBPACK_IMPORTED_MODULE_0__[\"Texture\"](canvas);\n texture.needsUpdate = true;\n texture.anisotropy = 0;\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.wrapT = three__WEBPACK_IMPORTED_MODULE_0__[\"ClampToEdgeWrapping\"];\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 + \"_\" + JSON.stringify(parameters)] = spriteMaterial;\n }\n\n return spriteMaterial;\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Sprites);\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/sprites.ts?"); /***/ }), @@ -2292,7 +2292,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (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 isInExtentEN: function (xyz, bb, proj, margin) {\n if (margin === void 0) {\n margin = 0.0000001;\n }\n\n if (!bb) return true;\n var minE = bb[0],\n minN = bb[1],\n maxE = bb[2],\n maxN = bb[3];\n\n var _a = proj.tileXYZ2NwSe(xyz, proj.trueTileResolution, true),\n min = _a.min,\n max = _a.max;\n\n return max.x > minE + margin && min.x < maxE - margin && max.y > minN + margin && min.y < maxN - margin;\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?"); +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 isInExtentEN: function (xyz, bb, proj, margin) {\n if (margin === void 0) {\n margin = 0.0000001;\n }\n\n if (!bb) return true;\n var minE = bb[0],\n minN = bb[1],\n maxE = bb[2],\n maxN = bb[3];\n\n var _a = proj.tileXYZ2NwSe(xyz, proj.trueTileResolution, true),\n min = _a.min,\n max = _a.max;\n\n return max.x > minE + margin && min.x < maxE - margin && max.y > minN + margin && min.y < maxN - margin;\n },\n isInZoomRange: function (minZoom, maxZoom, zoom) {\n if (minZoom != null || maxZoom != null) {\n minZoom = minZoom || 0;\n maxZoom = maxZoom || Infinity;\n if (zoom >= minZoom && zoom <= maxZoom) return true;else return false;\n }\n\n return true;\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?"); /***/ }), diff --git a/dist/src/core/cameras.d.ts b/dist/src/core/cameras.d.ts index 11443e5..0c1281f 100644 --- a/dist/src/core/cameras.d.ts +++ b/dist/src/core/cameras.d.ts @@ -44,7 +44,7 @@ export default class Camera { onKeyDown: (event: KeyboardEvent) => void; onKeyUp: (event: KeyboardEvent) => void; updateSize: () => void; - setNearFarPlane: (farther: any, near: any, far: any, keepNear: any) => void; + setNearFarPlane: (scalar: number, farther: any, near: any, far: any, keepNear: any) => void; setFirstPersonHeight: (height: any) => void; getFirstPersonFocalLength: () => number; setFirstPersonFocalLength: (focalLength: any) => void; diff --git a/dist/src/core/events.d.ts b/dist/src/core/events.d.ts index a949cf5..be541fb 100644 --- a/dist/src/core/events.d.ts +++ b/dist/src/core/events.d.ts @@ -7,6 +7,10 @@ interface Private { x: number; y: number; }; + oldPrevMouseXY: { + x: number; + y: number; + }; containerXY: { x: number; y: number; @@ -16,6 +20,8 @@ interface Private { zoomedSince: number; zoomWait: number; highlightTimeout: any; + rotationDampingInterval: any; + panned: boolean; } export default class Events { _: Private; @@ -25,7 +31,7 @@ export default class Events { hoverInfo: HTMLElement; constructor(parent: any); _init(): void; - _rotateGlobe: (e: any, prevXY?: any) => void; + _rotateGlobe: (e: any, prevXY?: any, fromDamping?: boolean) => void; private _rotateAroundArbAxis; private _rotateGlobe_MouseDown; private _rotateGlobe_MouseUp; @@ -46,6 +52,7 @@ export default class Events { private clearHoveredFeature; private setActiveFeature; private clearActiveFeature; + _setMissingElevation(mesh: any): void; _attenuate(): void; } export {}; diff --git a/dist/src/core/projection.d.ts b/dist/src/core/projection.d.ts index 5a47660..d7893e4 100644 --- a/dist/src/core/projection.d.ts +++ b/dist/src/core/projection.d.ts @@ -13,6 +13,7 @@ declare enum RadiusE { export default class Projection { _: Private; baseRadius: number; + radiusCutoff: number; radiusScale: number; radii: Radii; tileMapResource: TileMapResource; @@ -22,7 +23,7 @@ export default class Projection { e: number; ep: number; flatteningFactor: number; - constructor(majorRadius?: number, minorRadius?: number, tileMapResource?: TileMapResource, trueTileResolution?: number); + constructor(majorRadius?: number, minorRadius?: number, tileMapResource?: TileMapResource, trueTileResolution?: number, radiusCutoff?: number); _reset(): void; setRadius: (radius: number, which?: RadiusE) => void; invertY: (y: number, z: number) => number; diff --git a/dist/src/layers/clamped.d.ts b/dist/src/layers/clamped.d.ts index 3efb0f4..69219ff 100644 --- a/dist/src/layers/clamped.d.ts +++ b/dist/src/layers/clamped.d.ts @@ -4,6 +4,7 @@ export default class ClampedLayerer { constructor(parent: any); add: (layerObj: any, callback?: Function) => void; toggle: (name: string, on?: boolean) => boolean; + orderLayers: (ordering: string[]) => boolean; setOpacity: (name: string, opacity: number) => boolean; remove: (name: string) => boolean; getClampedTexture: (i: number, xyz: XYZ) => any; diff --git a/dist/src/layers/index.d.ts b/dist/src/layers/index.d.ts index 9c72d7a..25c7ed5 100644 --- a/dist/src/layers/index.d.ts +++ b/dist/src/layers/index.d.ts @@ -17,7 +17,6 @@ interface Private { export default class Layers { _: Private; p: any; - baseStyle: any; tile3d: any; tile: any; clamped: any; @@ -30,14 +29,17 @@ export default class Layers { addLayer: (type: string, layerObj: any, callback?: Function, sI?: number) => void; removeLayer: (name: string) => boolean; toggleLayer: (name: string, on?: boolean) => boolean; + orderLayers: (ordering: string[]) => boolean; + private getDesiredOrder; setLayerOpacity: (name: string, opacity: number) => boolean; setLayerFilterEffect: (name: string, filter: string, value: number) => boolean; setLayerSpecificOptions: (name: string, options: any) => boolean; findHighestMaxZoom: () => number; findLowestMinZoom: () => number; - private getFeatureStyleProp; getLayerByName: (layerName: string) => any; hasLayer: (layerName: string) => boolean; + private getFeatureStyleProp; + private getBaseStyle; getFeatureStyle: (layer: any, feature: any, isStrokeless?: boolean) => any; _onMouseMove: (intersectedLL: any, e: MouseEvent, obj: any, intersectionRaw: any, intersectionPoint: any) => void; } diff --git a/dist/src/layers/tile.d.ts b/dist/src/layers/tile.d.ts index 2527afb..2aa6f21 100644 --- a/dist/src/layers/tile.d.ts +++ b/dist/src/layers/tile.d.ts @@ -3,6 +3,7 @@ export default class TileLayerer { constructor(parent: any); add: (layerObj: any) => void; toggle: (name: string, on?: boolean) => boolean; + orderLayers: (ordering: string[]) => boolean; setOpacity: (name: string, opacity: number) => boolean; setFilterEffect: (name: string, filter: string, value: number) => boolean; remove: (name: string) => boolean; diff --git a/dist/src/layers/vector.d.ts b/dist/src/layers/vector.d.ts index 8b5ff02..2650397 100644 --- a/dist/src/layers/vector.d.ts +++ b/dist/src/layers/vector.d.ts @@ -1,6 +1,5 @@ export default class VectorLayerer { p: any; - baseStyle: any; constructor(parent: any); add: (layerObj: any, callback?: Function) => void; toggle: (name: string, on?: boolean) => boolean; diff --git a/dist/src/lithosphere.d.ts b/dist/src/lithosphere.d.ts index 821bb45..bd2d83e 100644 --- a/dist/src/lithosphere.d.ts +++ b/dist/src/lithosphere.d.ts @@ -30,7 +30,6 @@ interface Private { zCutOff: number; firstViewOverride: any; mouseIsInScene: boolean; - marsRadius: number; } export default class LithoSphere { _: Private; @@ -41,6 +40,7 @@ export default class LithoSphere { addLayer: Function; removeLayer: Function; toggleLayer: Function; + orderLayers: Function; setLayerOpacity: Function; setLayerFilterEffect: Function; setLayerSpecificOptions: Function; diff --git a/dist/src/secondary/sprites.d.ts b/dist/src/secondary/sprites.d.ts index e9fd951..736e829 100644 --- a/dist/src/secondary/sprites.d.ts +++ b/dist/src/secondary/sprites.d.ts @@ -1,8 +1,7 @@ import { Sprite } from 'three'; declare const Sprites: { spriteMaterials: {}; - makeMarkerSprite: (parameters: any, id: any, forceNewMaterial?: boolean) => Sprite; - makeMarkerMaterial: (parameters: any, id: any, forceNewMaterial?: boolean) => any; - makeTextSprite: (message: any, parameters: any) => Sprite; + makeMarkerSprite: (parameters: any, id: any, options?: {}, forceNewMaterial?: boolean) => Sprite; + makeMarkerMaterial: (parameters: any, id: any, options: any, forceNewMaterial?: boolean) => any; }; export default Sprites; diff --git a/dist/src/utils/index.d.ts b/dist/src/utils/index.d.ts index a348252..96d0d40 100644 --- a/dist/src/utils/index.d.ts +++ b/dist/src/utils/index.d.ts @@ -6,6 +6,7 @@ declare const Utils: { findLowestMinZoom: (tileLayers: any) => number; isInExtent: (xyz: XYZ, bb: any, projection: any) => boolean; isInExtentEN: (xyz: XYZ, bb: any, proj: any, margin?: number) => boolean; + isInZoomRange: (minZoom: number, maxZoom: number, zoom: number) => boolean; clone: (obj: any) => any; capitalizeFirstLetter: (string: string) => string; getExtension: (string: string) => string; diff --git a/docs/Gemfile b/docs/Gemfile index a320bee..edee01d 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -30,3 +30,5 @@ end # Performance-booster for watching directories on Windows gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] + +gem "webrick", "~> 1.7" diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index b33f57d..a0f01ae 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,13 +1,13 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.3.7) + activesupport (6.0.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2, >= 2.2.2) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) coffee-script (2.4.1) coffee-script-source @@ -16,26 +16,42 @@ GEM colorator (1.1.0) commonmarker (0.17.13) ruby-enum (~> 0.5) - concurrent-ruby (1.1.8) - dnsruby (1.61.5) + concurrent-ruby (1.1.10) + dnsruby (1.61.9) simpleidn (~> 0.1) - em-websocket (0.5.2) + em-websocket (0.5.3) eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) - ethon (0.14.0) + http_parser.rb (~> 0) + ethon (0.15.0) ffi (>= 1.15.0) + eventmachine (1.2.7) eventmachine (1.2.7-x64-mingw32) execjs (2.8.1) - faraday (1.4.1) + faraday (1.10.0) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - multipart-post (>= 1.2, < 3) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.3) + multipart-post (>= 1.2, < 3) faraday-net_http (1.0.1) - faraday-net_http_persistent (1.1.0) - ffi (1.15.0-x64-mingw32) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + ffi (1.15.5-x64-mingw-ucrt) + ffi (1.15.5-x64-mingw32) forwardable-extended (2.6.0) gemoji (3.0.1) github-pages (214) @@ -88,10 +104,10 @@ GEM octokit (~> 4.0) public_suffix (>= 2.0.2, < 5.0) typhoeus (~> 1.3) - html-pipeline (2.14.0) + html-pipeline (2.14.1) activesupport (>= 2) nokogiri (>= 1.4) - http_parser.rb (0.6.0) + http_parser.rb (0.8.0) i18n (0.9.5) concurrent-ruby (~> 1.0) jekyll (3.9.0) @@ -209,35 +225,37 @@ GEM kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) liquid (4.0.3) - listen (3.5.1) + listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) + mini_portile2 (2.8.0) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.14.4) + minitest (5.15.0) multipart-post (2.1.1) - nokogiri (1.11.3-x64-mingw32) + nokogiri (1.13.6) + mini_portile2 (~> 2.8.0) racc (~> 1.4) - octokit (4.21.0) + octokit (4.22.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.6) - racc (1.5.2) - rake (13.0.3) - rb-fsevent (0.11.0) + public_suffix (4.0.7) + racc (1.6.0) + rake (13.0.6) + rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) rexml (3.2.5) rouge (3.26.0) ruby-enum (0.9.0) i18n - ruby2_keywords (0.0.4) - rubyzip (2.3.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) safe_yaml (1.0.5) sass (3.7.4) sass-listen (~> 4.0.0) @@ -256,16 +274,18 @@ GEM ethon (>= 0.9.0) tzinfo (1.2.9) thread_safe (~> 0.1) - tzinfo-data (1.2021.1) + tzinfo-data (1.2022.1) tzinfo (>= 1.0.0) unf (0.1.4) unf_ext - unf_ext (0.0.7.7-x64-mingw32) - unicode-display_width (1.7.0) + unf_ext (0.0.8.1) + unicode-display_width (1.8.0) wdm (0.1.1) - zeitwerk (2.4.2) + webrick (1.7.0) + zeitwerk (2.5.4) PLATFORMS + x64-mingw-ucrt x64-mingw32 DEPENDENCIES @@ -277,6 +297,7 @@ DEPENDENCIES tzinfo (~> 1.2) tzinfo-data wdm (~> 0.1.1) + webrick (~> 1.7) BUNDLED WITH - 2.2.17 + 2.3.13 diff --git a/docs/assets/js/demo.js b/docs/assets/js/demo.js index 1b22e01..b0adae1 100644 --- a/docs/assets/js/demo.js +++ b/docs/assets/js/demo.js @@ -233,6 +233,77 @@ Litho.addLayer('vector', { }) //Litho.removeLayer('vectorLine') +Litho.addLayer('clamped', { + name: 'clampedAnnotation', + on: true, + geojson: { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + geometry: { + type: 'Point', + coordinates: [137.3678972, -4.66902518], + }, + properties: { + annotation: true, + name: 'Annotation [c]', + style: { + color: 'rgb(50, 50, 50)', + fillColor: 'rgb(255, 255, 0)', + fillOpacity: 1, + weight: 2, + fontSize: '12px', + rotation: 45, + }, + }, + }, + ], + }, + opacity: 1, + minZoom: 0, + maxZoom: 30, + style: { + // Prefer feature[f].properties.style values + letPropertiesStyleOverride: true, + }, +}) + +Litho.addLayer('vector', { + name: 'vectorAnnotation', + on: true, + geojson: { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + geometry: { + type: 'Point', + coordinates: [137.372697, -4.66928, -4430], + }, + properties: { + annotation: true, + name: 'Annotation [v]', + style: { + color: 'rgb(0, 0, 0)', + fillColor: 'rgb(255, 255, 255)', + fillOpacity: 1, + weight: 2, + fontSize: '18px', + }, + }, + }, + ], + }, + opacity: 1, + minZoom: 0, + maxZoom: 30, + style: { + // Prefer feature[f].properties.style values + letPropertiesStyleOverride: true, + }, +}) + Litho.addLayer('vector', { name: 'vectorPoints', order: 2, diff --git a/docs/assets/js/lithosphere.js b/docs/assets/js/lithosphere.js index b6beab2..b7c6b91 100644 --- a/docs/assets/js/lithosphere.js +++ b/docs/assets/js/lithosphere.js @@ -504,6 +504,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ }), +/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./src/controls/navigation.css": +/*!*******************************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./src/controls/navigation.css ***! + \*******************************************************************************************************************************/ +/*! 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_control_navigation_root {\\r\\n display: flex;\\r\\n}\\r\\n#_lithosphere_control_navigation_root svg {\\r\\n width: 24px;\\r\\n height: 24px;\\r\\n}\\r\\n#_lithosphere_control_navigation_root > div {\\r\\n width: 80px;\\r\\n margin-right: 6px;\\r\\n display: flex;\\r\\n flex-flow: column;\\r\\n}\\r\\n#_lithosphere_control_navigation_root > div > div:first-child {\\r\\n background: black;\\r\\n color: white;\\r\\n height: 26px;\\r\\n line-height: 26px;\\r\\n text-transform: uppercase;\\r\\n font-size: 12px;\\r\\n}\\r\\n#_lithosphere_control_navigation_root > div > div:first-child svg {\\r\\n width: 18px;\\r\\n height: 18px;\\r\\n padding: 4px 0px;\\r\\n}\\r\\n\\r\\n._lithosphere_control_navigation_panel {\\r\\n width: 80px;\\r\\n max-height: 0px;\\r\\n overflow: hidden;\\r\\n line-height: 42px;\\r\\n background: black;\\r\\n color: white;\\r\\n display: flex;\\r\\n border-top: 1px solid #444;\\r\\n opacity: 0;\\r\\n pointer-events: none;\\r\\n transition: all 0.2s ease-out;\\r\\n}\\r\\n\\r\\n#_lithosphere_control_navigation_root\\r\\n > div:hover\\r\\n > ._lithosphere_control_navigation_panel,\\r\\n#_lithosphere_control_navigation_root\\r\\n ._lithosphere_control_navigation_panel.active {\\r\\n opacity: 1;\\r\\n max-height: 100px;\\r\\n pointer-events: inherit;\\r\\n}\\r\\n._lithosphere_control_navigation_panel div {\\r\\n cursor: pointer;\\r\\n transition: background 0.2s ease-out;\\r\\n}\\r\\n._lithosphere_control_navigation_panel div:hover {\\r\\n background: rgba(255, 255, 255, 0.15);\\r\\n}\\r\\n\\r\\n#_lithosphere_control_navigation_spin_root\\r\\n ._lithosphere_control_navigation_panel {\\r\\n height: 30px;\\r\\n}\\r\\n#_lithosphere_control_navigation_dolly_root\\r\\n ._lithosphere_control_navigation_panel {\\r\\n height: 30px;\\r\\n}\\r\\n#_lithosphere_control_navigation_pan_root\\r\\n ._lithosphere_control_navigation_panel {\\r\\n line-height: 30px;\\r\\n height: 90px;\\r\\n flex-flow: column;\\r\\n}\\r\\n#_lithosphere_control_navigation_zoom_root\\r\\n ._lithosphere_control_navigation_panel {\\r\\n height: 30px;\\r\\n}\\r\\n\\r\\n#_lithosphere_control_navigation_spin_left,\\r\\n#_lithosphere_control_navigation_spin_right,\\r\\n#_lithosphere_control_navigation_dolly_up,\\r\\n#_lithosphere_control_navigation_dolly_down,\\r\\n#_lithosphere_control_navigation_zoom_in,\\r\\n#_lithosphere_control_navigation_zoom_out {\\r\\n width: 50%;\\r\\n text-align: center;\\r\\n}\\r\\n\\r\\n#_lithosphere_control_navigation_pan_up {\\r\\n height: 30px;\\r\\n line-height: 49px;\\r\\n text-align: center;\\r\\n}\\r\\n#_lithosphere_control_navigation_pan_left,\\r\\n#_lithosphere_control_navigation_pan_right {\\r\\n height: 30px;\\r\\n line-height: 44px;\\r\\n width: 50%;\\r\\n text-align: center;\\r\\n}\\r\\n#_lithosphere_control_navigation_pan_down {\\r\\n height: 30px;\\r\\n line-height: 38px;\\r\\n text-align: center;\\r\\n}\\r\\n\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://LithoSphere/./src/controls/navigation.css?./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2"); + +/***/ }), + /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./src/secondary/loadingScreen.css": /*!***********************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./src/secondary/loadingScreen.css ***! @@ -1864,7 +1876,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nvar Home = function () {\n f /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _compass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compass */ \"./src/controls/compass.ts\");\n/* harmony import */ var _coordinates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./coordinates */ \"./src/controls/coordinates.ts\");\n/* harmony import */ var _home__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./home */ \"./src/controls/home.ts\");\n/* harmony import */ var _layers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./layers */ \"./src/controls/layers.ts\");\n/* harmony import */ var _exaggerate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./exaggerate */ \"./src/controls/exaggerate.ts\");\n/* harmony import */ var _observe__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./observe */ \"./src/controls/observe.ts\");\n/* harmony import */ var _walk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./walk */ \"./src/controls/walk.ts\");\n/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./link */ \"./src/controls/link.ts\");\n\n\n\n\n\n\n\n\n\nvar Controls = function () {\n function Controls(parent) {\n var _this = this;\n\n this.addControl = function (name, control, params, corner) {\n if (_this.activeControls[name] != null) {\n console.warn(\"UI Control control with identifying name '\" + name + \"' already exists. Remove the existing one or pick a different name to add this control.\");\n return;\n }\n\n try {\n _this.activeControls[name] = new control(_this.p, name, params);\n } catch (err) {\n if (_this.activeControls[name] != null) delete _this.activeControls[name];\n console.warn(\"Error adding UI Element with name '\" + name + \"' -\", err);\n return;\n }\n\n corner = corner || _this.activeControls[name].corner || \"TopLeft\";\n var newControl = document.createElement('div');\n newControl.setAttribute('id', \"_lithosphere_control_\" + name);\n newControl.innerHTML = _this.activeControls[name].getControl();\n newControl.style.marginRight = '5px';\n if (corner === \"TopLeft\" || corner === \"TopRight\") newControl.style.marginBottom = '5px';\n\n _this.corners[corner].appendChild(newControl);\n\n _this.activeControls[name].attachEvents();\n\n if (_this.activeControls[name].getReturn) {\n return _this.activeControls[name].getReturn();\n }\n };\n\n this.removeControl = function (name) {\n delete _this.activeControls[name];\n document.getElementById(\"_lithosphere_control_\" + name).remove();\n };\n\n this._onUpdateEvent = function () {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onUpdate === 'function') control.onUpdate();\n });\n };\n\n this._onMove = function (lng, lat, height) {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onMove === 'function') control.onMove(lng, lat, height);\n });\n };\n\n this._onMouseMove = function (lng, lat, height) {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onMouseMove === 'function') control.onMouseMove(lng, lat, height);\n });\n };\n\n this._onMouseOut = function (e) {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onMouseOut === 'function') control.onMouseOut(e);\n });\n };\n\n this._onFirstPersonUpdate = function () {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onFirstPersonUpdate === 'function') control.onFirstPersonUpdate();\n });\n };\n\n this._onOrbitalUpdate = function (e) {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onOrbitalUpdate === 'function') control.onOrbitalUpdate(e);\n });\n };\n\n this.p = parent;\n this.activeControls = {};\n this.controlContainer = document.createElement('div');\n this.controlContainer.setAttribute('id', '_lithosphere_controls');\n this.controlContainer.style.position = 'absolute';\n this.controlContainer.style.top = '0';\n this.controlContainer.style.left = '0';\n this.controlContainer.style.width = '100%';\n this.controlContainer.style.height = '100%';\n this.controlContainer.style.pointerEvents = 'none';\n this.controlContainer.style.color = 'white';\n this.controlContainer.style.fontFamily = 'sans-serif';\n this.controlContainer.style.zIndex = '1000';\n\n this.p._.container.appendChild(this.controlContainer);\n\n this.corners = {\n TopLeft: null,\n TopRight: null,\n BottomLeft: null,\n BottomRight: null\n };\n var margin = '10px';\n this.corners.TopLeft = document.createElement('div');\n this.corners.TopLeft.setAttribute('id', '_lithosphere_controls_topleft');\n this.corners.TopLeft.style.position = 'absolute';\n this.corners.TopLeft.style.top = margin;\n this.corners.TopLeft.style.left = margin;\n this.corners.TopLeft.style.pointerEvents = 'all';\n this.corners.TopLeft.style.display = 'flex';\n this.corners.TopLeft.style.flexFlow = 'column';\n this.controlContainer.appendChild(this.corners.TopLeft);\n this.corners.TopRight = document.createElement('div');\n this.corners.TopRight.setAttribute('id', '_lithosphere_controls_topright');\n this.corners.TopRight.style.position = 'absolute';\n this.corners.TopRight.style.top = margin;\n this.corners.TopRight.style.right = margin;\n this.corners.TopRight.style.pointerEvents = 'all';\n this.corners.TopRight.style.display = 'flex';\n this.controlContainer.appendChild(this.corners.TopRight);\n this.corners.BottomLeft = document.createElement('div');\n this.corners.BottomLeft.setAttribute('id', '_lithosphere_controls_bottomleft');\n this.corners.BottomLeft.style.position = 'absolute';\n this.corners.BottomLeft.style.bottom = margin;\n this.corners.BottomLeft.style.left = margin;\n this.corners.BottomLeft.style.pointerEvents = 'all';\n this.corners.BottomLeft.style.display = 'flex';\n this.controlContainer.appendChild(this.corners.BottomLeft);\n this.corners.BottomRight = document.createElement('div');\n this.corners.BottomRight.setAttribute('id', '_lithosphere_controls_bottomright');\n this.corners.BottomRight.style.position = 'absolute';\n this.corners.BottomRight.style.bottom = margin;\n this.corners.BottomRight.style.right = margin;\n this.corners.BottomRight.style.pointerEvents = 'all';\n this.corners.BottomRight.style.display = 'flex';\n this.controlContainer.appendChild(this.corners.BottomRight);\n this.compass = _compass__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n this.coordinates = _coordinates__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n this.home = _home__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\n this.layers = _layers__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n this.exaggerate = _exaggerate__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n this.observe = _observe__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n this.walk = _walk__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n this.link = _link__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n }\n\n return Controls;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Controls);\n\n//# sourceURL=webpack://LithoSphere/./src/controls/index.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _compass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compass */ \"./src/controls/compass.ts\");\n/* harmony import */ var _navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./navigation */ \"./src/controls/navigation.ts\");\n/* harmony import */ var _coordinates__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./coordinates */ \"./src/controls/coordinates.ts\");\n/* harmony import */ var _home__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./home */ \"./src/controls/home.ts\");\n/* harmony import */ var _layers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./layers */ \"./src/controls/layers.ts\");\n/* harmony import */ var _exaggerate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./exaggerate */ \"./src/controls/exaggerate.ts\");\n/* harmony import */ var _observe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./observe */ \"./src/controls/observe.ts\");\n/* harmony import */ var _walk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./walk */ \"./src/controls/walk.ts\");\n/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./link */ \"./src/controls/link.ts\");\n\n\n\n\n\n\n\n\n\n\nvar Controls = function () {\n function Controls(parent) {\n var _this = this;\n\n this.addControl = function (name, control, params, corner) {\n if (_this.activeControls[name] != null) {\n console.warn(\"UI Control control with identifying name '\" + name + \"' already exists. Remove the existing one or pick a different name to add this control.\");\n return;\n }\n\n try {\n _this.activeControls[name] = new control(_this.p, name, params);\n } catch (err) {\n if (_this.activeControls[name] != null) delete _this.activeControls[name];\n console.warn(\"Error adding UI Element with name '\" + name + \"' -\", err);\n return;\n }\n\n corner = corner || _this.activeControls[name].corner || \"TopLeft\";\n var newControl = document.createElement('div');\n newControl.setAttribute('id', \"_lithosphere_control_\" + name);\n newControl.innerHTML = _this.activeControls[name].getControl();\n newControl.style.marginRight = '5px';\n if (corner === \"TopLeft\" || corner === \"TopRight\") newControl.style.marginBottom = '5px';\n\n _this.corners[corner].appendChild(newControl);\n\n _this.activeControls[name].attachEvents();\n\n if (_this.activeControls[name].getReturn) {\n return _this.activeControls[name].getReturn();\n }\n };\n\n this.removeControl = function (name) {\n delete _this.activeControls[name];\n document.getElementById(\"_lithosphere_control_\" + name).remove();\n };\n\n this._onUpdateEvent = function () {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onUpdate === 'function') control.onUpdate();\n });\n };\n\n this._onMove = function (lng, lat, height) {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onMove === 'function') control.onMove(lng, lat, height);\n });\n };\n\n this._onMouseMove = function (lng, lat, height) {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onMouseMove === 'function') control.onMouseMove(lng, lat, height);\n });\n };\n\n this._onMouseOut = function (e) {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onMouseOut === 'function') control.onMouseOut(e);\n });\n };\n\n this._onFirstPersonUpdate = function () {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onFirstPersonUpdate === 'function') control.onFirstPersonUpdate();\n });\n };\n\n this._onOrbitalUpdate = function (e) {\n Object.values(_this.activeControls).forEach(function (control) {\n if (typeof control.onOrbitalUpdate === 'function') control.onOrbitalUpdate(e);\n });\n };\n\n this.p = parent;\n this.activeControls = {};\n this.controlContainer = document.createElement('div');\n this.controlContainer.setAttribute('id', '_lithosphere_controls');\n this.controlContainer.style.position = 'absolute';\n this.controlContainer.style.top = '0';\n this.controlContainer.style.left = '0';\n this.controlContainer.style.width = '100%';\n this.controlContainer.style.height = '100%';\n this.controlContainer.style.pointerEvents = 'none';\n this.controlContainer.style.color = 'white';\n this.controlContainer.style.fontFamily = 'sans-serif';\n this.controlContainer.style.zIndex = '1000';\n\n this.p._.container.appendChild(this.controlContainer);\n\n this.corners = {\n TopLeft: null,\n TopRight: null,\n BottomLeft: null,\n BottomRight: null\n };\n var margin = '10px';\n this.corners.TopLeft = document.createElement('div');\n this.corners.TopLeft.setAttribute('id', '_lithosphere_controls_topleft');\n this.corners.TopLeft.style.position = 'absolute';\n this.corners.TopLeft.style.top = margin;\n this.corners.TopLeft.style.left = margin;\n this.corners.TopLeft.style.pointerEvents = 'all';\n this.corners.TopLeft.style.display = 'flex';\n this.corners.TopLeft.style.flexFlow = 'column';\n this.controlContainer.appendChild(this.corners.TopLeft);\n this.corners.TopRight = document.createElement('div');\n this.corners.TopRight.setAttribute('id', '_lithosphere_controls_topright');\n this.corners.TopRight.style.position = 'absolute';\n this.corners.TopRight.style.top = margin;\n this.corners.TopRight.style.right = margin;\n this.corners.TopRight.style.pointerEvents = 'all';\n this.corners.TopRight.style.display = 'flex';\n this.controlContainer.appendChild(this.corners.TopRight);\n this.corners.BottomLeft = document.createElement('div');\n this.corners.BottomLeft.setAttribute('id', '_lithosphere_controls_bottomleft');\n this.corners.BottomLeft.style.position = 'absolute';\n this.corners.BottomLeft.style.bottom = margin;\n this.corners.BottomLeft.style.left = margin;\n this.corners.BottomLeft.style.pointerEvents = 'all';\n this.corners.BottomLeft.style.display = 'flex';\n this.controlContainer.appendChild(this.corners.BottomLeft);\n this.corners.BottomRight = document.createElement('div');\n this.corners.BottomRight.setAttribute('id', '_lithosphere_controls_bottomright');\n this.corners.BottomRight.style.position = 'absolute';\n this.corners.BottomRight.style.bottom = margin;\n this.corners.BottomRight.style.right = margin;\n this.corners.BottomRight.style.pointerEvents = 'all';\n this.corners.BottomRight.style.display = 'flex';\n this.controlContainer.appendChild(this.corners.BottomRight);\n this.compass = _compass__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n this.coordinates = _coordinates__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\n this.navigation = _navigation__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n this.home = _home__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n this.layers = _layers__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n this.exaggerate = _exaggerate__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n this.observe = _observe__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n this.walk = _walk__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n this.link = _link__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n }\n\n return Controls;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Controls);\n\n//# sourceURL=webpack://LithoSphere/./src/controls/index.ts?"); /***/ }), @@ -1892,6 +1904,29 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ }), +/***/ "./src/controls/navigation.css": +/*!*************************************!*\ + !*** ./src/controls/navigation.css ***! + \*************************************/ +/*! 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!./navigation.css */ \"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./src/controls/navigation.css\");\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/controls/navigation.css?"); + +/***/ }), + +/***/ "./src/controls/navigation.ts": +/*!************************************!*\ + !*** ./src/controls/navigation.ts ***! + \************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _navigation_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./navigation.css */ \"./src/controls/navigation.css\");\n/* harmony import */ var _navigation_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_navigation_css__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar Navigation = function () {\n function Navigation(parent, name) {\n var _this = this;\n\n this.getControl = function () {\n return [\"
\", \"
\", \"
\", \"\", \"\", \"\", \"
spin
\", \"
\", \"
\", \"
\", \"\", \"\", \"\", \"
\", \"
\", \"\", \"\", \"\", \"
\", \"
\", \"
\", \"
\", \"
\", \"\", \"\", \"\", \"
tilt
\", \"
\", \"
\", \"
\", \"\", \"\", \"\", \"
\", \"
\", \"\", \"\", \"\", \"
\", \"
\", \"
\", \"
\", \"
\", \"\", \"\", \"\", \"
pan
\", \"
\", \"
\", \"
\", \"\", \"\", \"\", \"
\", \"\", \"
\", \"\", \"\", \"\", \"
\", \"
\", \"\", \"\", \"\", \"
\", \"
\", \"
\", \"\", \"\", \"\", \"
\", \"
\", \"
\", \"
\", \"
\", \"\", \"\", \"\", \"
zoom
\", '
', \"
\", \"
\", \"\", \"\", \"\", \"
\", \"
\", \"\", \"\", \"\", \"
\", \"
\", \"
\", \"
\"].join('\\n');\n };\n\n this.attachEvents = function () {\n document.getElementById('_lithosphere_control_navigation_spin').addEventListener('click', function (e) {\n document.querySelector('#_lithosphere_control_navigation_spin_root ._lithosphere_control_navigation_panel').classList.toggle('active');\n });\n document.getElementById('_lithosphere_control_navigation_spin_left').addEventListener('click', function () {\n _this.p._.cameras.controls.rotateLeft(3 * (Math.PI / 180));\n });\n document.getElementById('_lithosphere_control_navigation_spin_right').addEventListener('click', function () {\n _this.p._.cameras.controls.rotateLeft(-3 * (Math.PI / 180));\n });\n document.getElementById('_lithosphere_control_navigation_dolly').addEventListener('click', function (e) {\n document.querySelector('#_lithosphere_control_navigation_dolly_root ._lithosphere_control_navigation_panel').classList.toggle('active');\n });\n document.getElementById('_lithosphere_control_navigation_dolly_up').addEventListener('click', function () {\n _this.p._.cameras.controls.rotateUp(1.3 * (Math.PI / 180));\n });\n document.getElementById('_lithosphere_control_navigation_dolly_down').addEventListener('click', function () {\n _this.p._.cameras.controls.rotateUp(-1.3 * (Math.PI / 180));\n });\n document.getElementById('_lithosphere_control_navigation_pan').addEventListener('click', function (e) {\n document.querySelector('#_lithosphere_control_navigation_pan_root ._lithosphere_control_navigation_panel').classList.toggle('active');\n });\n document.getElementById('_lithosphere_control_navigation_pan_up').addEventListener('click', function () {\n _this.p._.events._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, {\n x: 0,\n y: -200\n });\n });\n document.getElementById('_lithosphere_control_navigation_pan_left').addEventListener('click', function () {\n _this.p._.events._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, {\n x: -200,\n y: 0\n });\n });\n document.getElementById('_lithosphere_control_navigation_pan_right').addEventListener('click', function () {\n _this.p._.events._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, {\n x: 200,\n y: 0\n });\n });\n document.getElementById('_lithosphere_control_navigation_pan_down').addEventListener('click', function () {\n _this.p._.events._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, {\n x: 0,\n y: 200\n });\n });\n document.getElementById('_lithosphere_control_navigation_zoom').addEventListener('click', function (e) {\n document.querySelector('#_lithosphere_control_navigation_zoom_root ._lithosphere_control_navigation_panel').classList.toggle('active');\n });\n document.getElementById('_lithosphere_control_navigation_zoom_in').addEventListener('click', function () {\n _this.p._.cameras.controls.handleMouseWheel({\n deltaY: -200\n });\n\n _this.p._.events._onZoom();\n });\n document.getElementById('_lithosphere_control_navigation_zoom_out').addEventListener('click', function () {\n _this.p._.cameras.controls.handleMouseWheel({\n deltaY: 200\n });\n\n _this.p._.events._onZoom();\n });\n };\n\n this.p = parent;\n this.name = name;\n this._ = {};\n this.corner = \"TopRight\";\n }\n\n return Navigation;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Navigation);\n\n//# sourceURL=webpack://LithoSphere/./src/controls/navigation.ts?"); + +/***/ }), + /***/ "./src/controls/observe.ts": /*!*********************************!*\ !*** ./src/controls/observe.ts ***! @@ -1936,7 +1971,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _uti /***/ (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/* harmony import */ var _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../secondary/OrbitControls */ \"./src/secondary/OrbitControls.ts\");\n/* harmony import */ var _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../secondary/PointerLockControls */ \"./src/secondary/PointerLockControls.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Camera = function () {\n function Camera(container, sceneContainer, scene, projection) {\n var _this = this;\n\n this.onKeyDown = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = true;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = true;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = true;\n break;\n\n case 39:\n case 68:\n _this.moveRight = true;\n break;\n\n case 32:\n if (_this.canJump === true) _this.velocity.y += 350;\n _this.canJump = false;\n break;\n }\n };\n\n this.onKeyUp = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = false;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = false;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = false;\n break;\n\n case 39:\n case 68:\n _this.moveRight = false;\n break;\n }\n };\n\n this.updateSize = function () {\n _this.orbit.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.orbit.camera.updateProjectionMatrix();\n\n _this.firstPerson.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setNearFarPlane = function (farther, near, far, keepNear) {\n if (keepNear === true) _this._.keepNear = true;\n if (keepNear === false) _this._.keepNear = false;\n\n if (farther) {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near * 10000;\n } else {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near;\n _this.orbit.camera.far = _this.orbit.far;\n }\n\n if (near != null) _this.orbit.camera.near = near;\n if (far != null) _this.orbit.camera.far = far;\n\n _this.orbit.camera.updateProjectionMatrix();\n };\n\n this.setFirstPersonHeight = function (height) {\n _this.firstPerson.height = height || 3;\n };\n\n this.getFirstPersonFocalLength = function () {\n return _this.firstPerson.camera.getFocalLength();\n };\n\n this.setFirstPersonFocalLength = function (focalLength) {\n _this.firstPerson.camera.setFocalLength(focalLength);\n };\n\n this.getFirstPersonFOV = function () {\n return _this.firstPerson.camera.fov;\n };\n\n this.setFirstPersonFOV = function (fov) {\n _this.firstPerson.camera.fov = fov;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.getFirstPersonAspect = function () {\n return _this.firstPerson.camera.aspect;\n };\n\n this.setFirstPersonAspect = function (aspect) {\n _this.firstPerson.camera.aspect = aspect;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setCameraAzimuthElevation = function (az, el, cameraIsFirstPerson) {\n _this.firstPerson.controls.getObject().rotation.y = (-az + 180) * (Math.PI / 180);\n _this.firstPerson.controls.getPitchObject().rotation.x = el * (Math.PI / 180);\n };\n\n this.update = function () {\n if (_this.isFirstPerson) {\n var time = performance.now();\n var delta = (time - _this.prevTime) / 1000;\n var speedFactor = 1000;\n _this.prevTime = time;\n _this.velocity.x -= _this.velocity.x * 10.0 * delta;\n _this.velocity.z -= _this.velocity.z * 10.0 * delta;\n _this.velocity.y -= 9.8 * 100.0 * delta;\n if (_this.moveForward) _this.velocity.z -= speedFactor * delta;\n if (_this.moveBackward) _this.velocity.z += speedFactor * delta;\n if (_this.moveLeft) _this.velocity.x -= speedFactor * delta;\n if (_this.moveRight) _this.velocity.x += speedFactor * delta;\n var rp = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].rotatePoint({\n x: _this.velocity.x * delta,\n y: _this.velocity.z * delta\n }, [0, 0], -_this.firstPerson.controls.getObject().rotation.y);\n\n if (_this.isShift) {\n rp.x *= 7;\n rp.y *= 7;\n } else {\n rp.x *= 3;\n rp.y *= 3;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector2\"](rp.x, rp.y);\n }\n\n return null;\n };\n\n this.container = container;\n this.sceneContainer = sceneContainer;\n this.reset();\n\n this._init(scene, projection);\n }\n\n Camera.prototype.reset = function () {\n this.camera = null;\n this.controls = null;\n this.orbit = {\n camera: null,\n controls: null,\n near: 0.1,\n far: 15000000000\n };\n this.firstPerson = {\n camera: null,\n controls: null,\n lockControls: false,\n height: 3\n };\n this.isFirstPerson = false;\n this._ = {\n keepNear: false,\n crosshair: null\n };\n this.isShift = false;\n this.moveForward = null;\n this.moveBackward = null;\n this.moveLeft = null;\n this.moveRight = null;\n this.canJump = null;\n this.prevTime = performance.now();\n this.velocity = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\n };\n\n Camera.prototype._init = function (scene, projection) {\n this.orbit.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, this.orbit.near, this.orbit.far);\n this.orbit.camera.up = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, -1, 0);\n this.orbit.camera.position.set(0, -10000000 / projection.radiusScale, 0);\n this.orbit.controls = new _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.orbit.camera, this.sceneContainer);\n this.orbit.controls.enabled = true;\n this.orbit.controls.enableDamping = true;\n this.orbit.controls.dampingFactor = 0.2;\n this.orbit.controls.target.y = 1;\n this.orbit.controls.mouseButtons.ORBIT = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].RIGHT;\n this.orbit.controls.mouseButtons.PAN = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].LEFT;\n this.orbit.controls.maxDistance = projection.radii.major * 4;\n this.orbit.controls.maxPolarAngle = Math.PI / 2;\n this.orbit.controls.enablePan = false;\n this.firstPerson.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, 0.1, 150000000);\n this.firstPerson.controls = new _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.firstPerson.camera);\n this.firstPerson.controls.getObject().rotation.set(Math.PI, Math.PI, 0);\n this.firstPerson.controls.getObject().position.set(0, 10000000 / projection.radiusScale, 0);\n scene.add(this.firstPerson.controls.getObject());\n\n if (this.isFirstPerson) {\n this.requestPointerLocking();\n } else {\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n\n this.updateSize();\n this.setupEvents();\n this.orbit.controls.update();\n };\n\n Camera.prototype.swap = function (lockControls, skipLock) {\n this.isFirstPerson = !this.isFirstPerson;\n\n if (this.isFirstPerson) {\n this.firstPerson.lockControls = lockControls || false;\n if (!skipLock) this.requestPointerLocking();\n this.inToFirstPerson();\n } else {\n this.outFromFirstPerson();\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n };\n\n Camera.prototype.inToFirstPerson = function () {\n this.isFirstPerson = true;\n this.toggleCrosshair(true);\n this.camera = this.firstPerson.camera;\n this.firstPerson.controls.enabled = !this.firstPerson.lockControls;\n this.controls = this.firstPerson.controls;\n this.orbit.controls.resetPosition();\n };\n\n Camera.prototype.outFromFirstPerson = function () {\n this.isFirstPerson = false;\n this.toggleCrosshair(false);\n this.firstPerson.controls.enabled = false;\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n };\n\n Camera.prototype.toggleCrosshair = function (on) {\n if (this._.crosshair == null) {\n this._.crosshair = document.createElement('div');\n this._.crosshair.id = '_lithosphere_crosshair';\n 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(';');\n this.container.appendChild(this._.crosshair);\n }\n\n if (on) this._.crosshair.style.display = 'inherit';else this._.crosshair.style.display = 'none';\n };\n\n Camera.prototype.requestPointerLocking = function () {\n var _this = this;\n\n var havePointerLock = ('pointerLockElement' in document);\n\n if (havePointerLock) {\n var element_1 = document.body;\n\n var pointerlockchange = function () {\n if (document.pointerLockElement === element_1) {\n _this.inToFirstPerson();\n } else {\n _this.outFromFirstPerson();\n }\n };\n\n var pointerlockerror = function (e) {\n alert('Pointer Lock Error');\n };\n\n document.addEventListener('pointerlockchange', pointerlockchange, false);\n document.addEventListener('mozpointerlockchange', pointerlockchange, false);\n document.addEventListener('webkitpointerlockchange', pointerlockchange, false);\n document.addEventListener('pointerlockerror', pointerlockerror, false);\n document.addEventListener('mozpointerlockerror', pointerlockerror, false);\n document.addEventListener('webkitpointerlockerror', pointerlockerror, false);\n\n if (/Firefox/i.test(navigator.userAgent)) {\n var fullscreenchange_1 = function () {\n if (document.fullscreenElement === element_1) {\n document.removeEventListener('fullscreenchange', fullscreenchange_1);\n document.removeEventListener('mozfullscreenchange', fullscreenchange_1);\n element_1.requestPointerLock();\n }\n };\n\n document.addEventListener('fullscreenchange', fullscreenchange_1, false);\n document.addEventListener('mozfullscreenchange', fullscreenchange_1, false);\n element_1.requestFullscreen();\n } else {\n element_1.requestPointerLock();\n }\n } else {\n this.isFirstPerson = false;\n alert('This browser does not support Pointer Locking.');\n }\n };\n\n Camera.prototype.setupEvents = function () {\n document.addEventListener('keydown', this.onKeyDown, false);\n document.addEventListener('keyup', this.onKeyUp, false);\n window.addEventListener('resize', this.updateSize, false);\n };\n\n return Camera;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Camera);\n\n//# sourceURL=webpack://LithoSphere/./src/core/cameras.ts?"); +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/* harmony import */ var _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../secondary/OrbitControls */ \"./src/secondary/OrbitControls.ts\");\n/* harmony import */ var _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../secondary/PointerLockControls */ \"./src/secondary/PointerLockControls.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Camera = function () {\n function Camera(container, sceneContainer, scene, projection) {\n var _this = this;\n\n this.onKeyDown = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = true;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = true;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = true;\n break;\n\n case 39:\n case 68:\n _this.moveRight = true;\n break;\n\n case 32:\n if (_this.canJump === true) _this.velocity.y += 350;\n _this.canJump = false;\n break;\n }\n };\n\n this.onKeyUp = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = false;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = false;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = false;\n break;\n\n case 39:\n case 68:\n _this.moveRight = false;\n break;\n }\n };\n\n this.updateSize = function () {\n _this.orbit.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.orbit.camera.updateProjectionMatrix();\n\n _this.firstPerson.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setNearFarPlane = function (scalar, farther, near, far, keepNear) {\n if (scalar === void 0) {\n scalar = 1;\n }\n\n if (keepNear === true) _this._.keepNear = true;\n if (keepNear === false) _this._.keepNear = false;\n\n if (farther) {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near * 10000 / scalar;\n } else {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near;\n _this.orbit.camera.far = _this.orbit.far;\n }\n\n if (near != null) _this.orbit.camera.near = near;\n if (far != null) _this.orbit.camera.far = far;\n\n _this.orbit.camera.updateProjectionMatrix();\n };\n\n this.setFirstPersonHeight = function (height) {\n _this.firstPerson.height = height || 3;\n };\n\n this.getFirstPersonFocalLength = function () {\n return _this.firstPerson.camera.getFocalLength();\n };\n\n this.setFirstPersonFocalLength = function (focalLength) {\n _this.firstPerson.camera.setFocalLength(focalLength);\n };\n\n this.getFirstPersonFOV = function () {\n return _this.firstPerson.camera.fov;\n };\n\n this.setFirstPersonFOV = function (fov) {\n _this.firstPerson.camera.fov = fov;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.getFirstPersonAspect = function () {\n return _this.firstPerson.camera.aspect;\n };\n\n this.setFirstPersonAspect = function (aspect) {\n _this.firstPerson.camera.aspect = aspect;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setCameraAzimuthElevation = function (az, el, cameraIsFirstPerson) {\n _this.firstPerson.controls.getObject().rotation.y = (-az + 180) * (Math.PI / 180);\n _this.firstPerson.controls.getPitchObject().rotation.x = el * (Math.PI / 180);\n };\n\n this.update = function () {\n if (_this.isFirstPerson) {\n var time = performance.now();\n var delta = (time - _this.prevTime) / 1000;\n var speedFactor = 1000;\n _this.prevTime = time;\n _this.velocity.x -= _this.velocity.x * 10.0 * delta;\n _this.velocity.z -= _this.velocity.z * 10.0 * delta;\n _this.velocity.y -= 9.8 * 100.0 * delta;\n if (_this.moveForward) _this.velocity.z -= speedFactor * delta;\n if (_this.moveBackward) _this.velocity.z += speedFactor * delta;\n if (_this.moveLeft) _this.velocity.x -= speedFactor * delta;\n if (_this.moveRight) _this.velocity.x += speedFactor * delta;\n var rp = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].rotatePoint({\n x: _this.velocity.x * delta,\n y: _this.velocity.z * delta\n }, [0, 0], -_this.firstPerson.controls.getObject().rotation.y);\n\n if (_this.isShift) {\n rp.x *= 7;\n rp.y *= 7;\n } else {\n rp.x *= 3;\n rp.y *= 3;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector2\"](rp.x, rp.y);\n }\n\n return null;\n };\n\n this.container = container;\n this.sceneContainer = sceneContainer;\n this.reset();\n\n this._init(scene, projection);\n }\n\n Camera.prototype.reset = function () {\n this.camera = null;\n this.controls = null;\n this.orbit = {\n camera: null,\n controls: null,\n near: 0.1,\n far: 150000000000\n };\n this.firstPerson = {\n camera: null,\n controls: null,\n lockControls: false,\n height: 3\n };\n this.isFirstPerson = false;\n this._ = {\n keepNear: false,\n crosshair: null\n };\n this.isShift = false;\n this.moveForward = null;\n this.moveBackward = null;\n this.moveLeft = null;\n this.moveRight = null;\n this.canJump = null;\n this.prevTime = performance.now();\n this.velocity = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\n };\n\n Camera.prototype._init = function (scene, projection) {\n this.orbit.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, this.orbit.near, this.orbit.far);\n this.orbit.camera.up = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, -1, 0);\n this.orbit.camera.position.set(0, -10000000 * projection.radiusScale, 0);\n this.orbit.controls = new _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.orbit.camera, this.sceneContainer);\n this.orbit.controls.enabled = true;\n this.orbit.controls.enableDamping = true;\n this.orbit.controls.dampingFactor = 0.2;\n this.orbit.controls.target.y = 1;\n this.orbit.controls.mouseButtons.ORBIT = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].RIGHT;\n this.orbit.controls.mouseButtons.PAN = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].LEFT;\n this.orbit.controls.maxDistance = projection.radii.major * 4;\n this.orbit.controls.maxPolarAngle = Math.PI / 2;\n this.orbit.controls.enablePan = false;\n this.firstPerson.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, 0.1, 150000000);\n this.firstPerson.controls = new _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.firstPerson.camera);\n this.firstPerson.controls.getObject().rotation.set(Math.PI, Math.PI, 0);\n this.firstPerson.controls.getObject().position.set(0, 10000000 * projection.radiusScale, 0);\n scene.add(this.firstPerson.controls.getObject());\n\n if (this.isFirstPerson) {\n this.requestPointerLocking();\n } else {\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n\n this.updateSize();\n this.setupEvents();\n this.orbit.controls.update();\n };\n\n Camera.prototype.swap = function (lockControls, skipLock) {\n this.isFirstPerson = !this.isFirstPerson;\n\n if (this.isFirstPerson) {\n this.firstPerson.lockControls = lockControls || false;\n if (!skipLock) this.requestPointerLocking();\n this.inToFirstPerson();\n } else {\n this.outFromFirstPerson();\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n };\n\n Camera.prototype.inToFirstPerson = function () {\n this.isFirstPerson = true;\n this.toggleCrosshair(true);\n this.camera = this.firstPerson.camera;\n this.firstPerson.controls.enabled = !this.firstPerson.lockControls;\n this.controls = this.firstPerson.controls;\n this.orbit.controls.resetPosition();\n };\n\n Camera.prototype.outFromFirstPerson = function () {\n this.isFirstPerson = false;\n this.toggleCrosshair(false);\n this.firstPerson.controls.enabled = false;\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n };\n\n Camera.prototype.toggleCrosshair = function (on) {\n if (this._.crosshair == null) {\n this._.crosshair = document.createElement('div');\n this._.crosshair.id = '_lithosphere_crosshair';\n 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(';');\n this.container.appendChild(this._.crosshair);\n }\n\n if (on) this._.crosshair.style.display = 'inherit';else this._.crosshair.style.display = 'none';\n };\n\n Camera.prototype.requestPointerLocking = function () {\n var _this = this;\n\n var havePointerLock = ('pointerLockElement' in document);\n\n if (havePointerLock) {\n var element_1 = document.body;\n\n var pointerlockchange = function () {\n if (document.pointerLockElement === element_1) {\n _this.inToFirstPerson();\n } else {\n _this.outFromFirstPerson();\n }\n };\n\n var pointerlockerror = function (e) {\n alert('Pointer Lock Error');\n };\n\n document.addEventListener('pointerlockchange', pointerlockchange, false);\n document.addEventListener('mozpointerlockchange', pointerlockchange, false);\n document.addEventListener('webkitpointerlockchange', pointerlockchange, false);\n document.addEventListener('pointerlockerror', pointerlockerror, false);\n document.addEventListener('mozpointerlockerror', pointerlockerror, false);\n document.addEventListener('webkitpointerlockerror', pointerlockerror, false);\n\n if (/Firefox/i.test(navigator.userAgent)) {\n var fullscreenchange_1 = function () {\n if (document.fullscreenElement === element_1) {\n document.removeEventListener('fullscreenchange', fullscreenchange_1);\n document.removeEventListener('mozfullscreenchange', fullscreenchange_1);\n element_1.requestPointerLock();\n }\n };\n\n document.addEventListener('fullscreenchange', fullscreenchange_1, false);\n document.addEventListener('mozfullscreenchange', fullscreenchange_1, false);\n element_1.requestFullscreen();\n } else {\n element_1.requestPointerLock();\n }\n } else {\n this.isFirstPerson = false;\n alert('This browser does not support Pointer Locking.');\n }\n };\n\n Camera.prototype.setupEvents = function () {\n document.addEventListener('keydown', this.onKeyDown, false);\n document.addEventListener('keyup', this.onKeyUp, false);\n window.addEventListener('resize', this.updateSize, false);\n };\n\n return Camera;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Camera);\n\n//# sourceURL=webpack://LithoSphere/./src/core/cameras.ts?"); /***/ }), @@ -1948,7 +1983,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (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/* harmony import */ var _turf_circle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/circle */ \"./node_modules/@turf/circle/dist/es/index.js\");\n/* harmony import */ var _turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/boolean-intersects */ \"./node_modules/@turf/boolean-intersects/dist/es/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Events = function () {\n function Events(parent) {\n var _this = this;\n\n this._rotateGlobe = function (e, prevXY) {\n if (prevXY) {\n _this._.prevMouseXY.x = prevXY.x;\n _this._.prevMouseXY.y = prevXY.y;\n }\n\n if (!e) return;\n if (!e.pageX && e.touches) e.pageX = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n if (!e.pageY && e.touches) e.pageY = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n if (e.hasOwnProperty('x') && e.hasOwnProperty('y') && _this.p._.cameras.isFirstPerson) {\n _this._.prevMouseXY.x = 0;\n _this._.prevMouseXY.y = 0;\n e.pageX = e.x;\n e.pageY = e.y;\n }\n\n var rotSpeed = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getRadiansPerPixel(_this.p.trueZoom) * 0.5 * (_this.p._.marsRadius / _this.p.projection.radii.major);\n\n var pixelDif = 0;\n var cpX = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n cpX.applyAxisAngle(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, 1, 0), Math.PI / 2);\n var cpY = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n\n if (e.pageY < _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, rotSpeed * pixelDif);\n } else if (e.pageY > _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, -rotSpeed * pixelDif);\n }\n\n if (e.pageX > _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, -rotSpeed * pixelDif);\n } else if (e.pageX < _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, rotSpeed * pixelDif);\n }\n\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n if (_this.p.zoom <= _this.p._.zCutOff) {\n _this.p._.cameras.orbit.controls.target.x = 0;\n _this.p._.cameras.orbit.controls.target.y = -_this.p.planetCenter.y;\n _this.p._.cameras.orbit.controls.target.z = 0;\n\n _this.p._.cameras.orbit.controls.update();\n } else {\n var elevRaw = _this.p.getCenterElevationRaw();\n\n if (elevRaw != null) {\n var newLookAtY = -(elevRaw + _this.p.planetCenter.y);\n if (newLookAtY != 0 && newLookAtY != -10000) _this.p._.cameras.orbit.controls.target.y = newLookAtY - _this.p.options.targetYOffset;\n }\n\n var center = _this.p.getCenter();\n\n _this.p.controls._onMove(center.lng, center.lat, center.height);\n }\n };\n\n this._rotateGlobe_MouseDown = function (e) {\n if (e.which === 1 || e.button === 0) {\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n _this.p._.sceneContainer.addEventListener('mousemove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('mouseup', _this._rotateGlobe_MouseUp, false);\n\n _this.p._.sceneContainer.addEventListener('mouseleave', _this._rotateGlobe_MouseUp, false);\n } else if (e.touches && e.touches.length > 2) {\n _this._.prevMouseXY.x = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n _this._.prevMouseXY.y = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n _this.p._.sceneContainer.addEventListener('touchmove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('touchend', _this._rotateGlobe_MouseUp, false);\n }\n };\n\n this._rotateGlobe_MouseUp = function (e) {\n _this.p._.sceneContainer.removeEventListener('mousemove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('mouseup', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('mouseleave', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('touchmove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('touchend', _this._rotateGlobe_MouseUp);\n };\n\n this._onZoom = function (e) {\n _this._.zoomedSince = 0;\n\n var zoomDist = _this.p._.cameras.orbit.camera.position.distanceTo(_this.p._.cameras.orbit.controls.target);\n\n var nf = 8 - (_this.p.projection.radiusScale.toString().length - 1);\n var dZoom = Math.ceil((nf * Math.log(2) - Math.log(zoomDist / Math.pow(5, nf - 1))) / Math.log(2)) + 1;\n _this._.desiredZoom = dZoom;\n\n _this._attenuate();\n };\n\n this._onTouchZoom = function (e) {\n if (e.touches && e.touches.length == 1) _this._onZoom(e);\n };\n\n this._onClick = function (e) {\n if (_this.hoveredFeature && _this.hoverInfo) {\n var layer = _this.p.layers.getLayerByName(_this.hoveredFeature.layerName);\n\n if (layer) {\n _this.setActiveFeature({\n layerName: _this.hoveredFeature.layerName,\n type: _this.hoveredFeature.type,\n obj: _this.hoveredFeature.obj,\n feature: _this.hoveredFeature.feature || _this.hoveredFeature.obj.feature,\n lnglat: {\n lng: _this.hoveredFeature.lnglat.lng,\n lat: _this.hoveredFeature.lnglat.lat\n }\n });\n\n if (typeof layer.onClick === 'function') {\n layer.onClick(JSON.parse(JSON.stringify(_this.hoveredFeature.feature)), JSON.parse(JSON.stringify(_this.hoveredFeature.lnglat)), layer);\n }\n }\n }\n };\n\n this._onKeyDown = function (e) {\n if (_this.p._.cameras.isFirstPerson) return;\n var speed = e.shiftKey ? 20 : 8;\n\n switch (e.key) {\n case 'w':\n case 'ArrowUp':\n _this._rotateGlobe({\n pageX: 0,\n pageY: speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'a':\n case 'ArrowLeft':\n _this._rotateGlobe({\n pageX: speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 's':\n case 'ArrowDown':\n _this._rotateGlobe({\n pageX: 0,\n pageY: -speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'd':\n case 'ArrowRight':\n _this._rotateGlobe({\n pageX: -speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'g':\n case 'PageDown':\n var lerpedDown = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? -0.035 : -0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedDown.x, lerpedDown.y, lerpedDown.z);\n\n _this._onZoom();\n\n break;\n\n case 't':\n case 'PageUp':\n var lerpedUp = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? 0.035 : 0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedUp.x, lerpedUp.y, lerpedUp.z);\n\n _this._onZoom();\n\n break;\n\n case 'q':\n _this.p._.cameras.orbit.controls.rotateLeft(Math.PI / 64);\n\n break;\n\n case 'e':\n _this.p._.cameras.orbit.controls.rotateLeft(-Math.PI / 64);\n\n break;\n\n case 'r':\n _this.p._.cameras.orbit.controls.rotateUp(Math.PI / 64);\n\n break;\n\n case 'f':\n _this.p._.cameras.orbit.controls.rotateUp(-Math.PI / 64);\n\n break;\n }\n };\n\n this._onMouseMove = function (e) {\n _this.p._.mouseIsInScene = true;\n\n if (_this.p._.cameras.isFirstPerson) {\n _this._.mouseXY.x = 0;\n _this._.mouseXY.y = 0;\n } else {\n _this._.mouseXY.x = (e.clientX - _this.p._.renderer.domElement.getBoundingClientRect().left) / _this.p._.renderer.domElement.clientWidth * 2 - 1;\n _this._.mouseXY.y = -((e.clientY - _this.p._.renderer.domElement.getBoundingClientRect().top) / _this.p._.renderer.domElement.clientHeight) * 2 + 1;\n }\n\n _this._.containerXY = {\n x: e ? e.offsetX : null,\n y: e ? e.offsetY : null\n };\n\n _this.updateHoverInfoPosition();\n\n _this.p._.raycaster.setFromCamera(_this._.mouseXY, _this.p._.cameras.camera);\n\n var intersectArr = [];\n\n for (var i = 0; i < _this.p._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this.p._.tiledWorld.tilesDrawn[i].isLODTile) intersectArr.push(_this.p._.tiledWorld.tilesDrawn[i].t);\n }\n\n for (var i = 0; i < _this.p.layers.vector.length; i++) {\n if (_this.p.layers.vector[i].meshes && _this.p.layers.vector[i].meshes.children) for (var j = 0; j < _this.p.layers.vector[i].meshes.children.length; j++) intersectArr.push(_this.p.layers.vector[i].meshes.children[j]);\n }\n\n for (var i = 0; i < _this.p.layers.curtain.length; i++) {\n if (_this.p.layers.curtain[i].curtain && _this.p.layers.curtain[i].curtain.children) for (var j = 0; j < _this.p.layers.curtain[i].curtain.children.length; j++) intersectArr.push(_this.p.layers.curtain[i].curtain.children[j]);\n }\n\n var intersects = _this.p._.raycaster.intersectObjects(intersectArr);\n\n if (intersects.length > 0) {\n var type_1 = intersects[0].object.type;\n var obj_1 = null;\n\n switch (type_1) {\n case 'Sprite':\n obj_1 = intersects[0].object;\n break;\n\n case 'Line2':\n obj_1 = intersects[0].object;\n break;\n\n case 'Mesh':\n obj_1 = _this.p._.tiledWorld.findTileDrawnBasedOnUUID(intersects[0].object.uuid);\n\n if (obj_1 == null) {\n obj_1 = intersects[0].object;\n }\n\n break;\n\n default:\n return;\n break;\n }\n\n var savedIntersectionPoint_1 = intersects[0].point;\n intersects[0].point.y += _this.p.planetCenter.y;\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: -_this.p.planet.rotation.x,\n y: 0,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: -_this.p.planet.rotation.y,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: 0,\n z: -_this.p.planet.rotation.z\n });\n\n var intersectedLL_1 = _this.p.projection.vector3ToLatLng(intersects[0].point);\n\n intersectedLL_1.height = savedIntersectionPoint_1.length() * _this.p.projection.radiusScale - _this.p.projection.radii.major;\n\n _this._updateMouseCoords(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height);\n\n clearTimeout(_this._.highlightTimeout);\n _this._.highlightTimeout = setTimeout(function () {\n _this._highlightFeature(intersectedLL_1.lng, intersectedLL_1.lat, type_1, obj_1, intersects[0], savedIntersectionPoint_1);\n }, 10);\n\n _this.p.layers._onMouseMove(intersectedLL_1, e, obj_1, intersects[0], savedIntersectionPoint_1);\n\n _this.p.controls._onMouseMove(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height, e);\n } else {\n _this._updateMouseCoords(null, null, null);\n\n _this._unhighlightHoveredFeature();\n\n _this.p.controls._onMouseMove(null, null, null, e);\n }\n };\n\n this.p = parent;\n this.activeFeature = null;\n this.hoveredFeature = null;\n this.hoverInfo = null;\n this._ = {\n mouseXY: {\n x: null,\n y: null\n },\n prevMouseXY: {\n x: null,\n y: null\n },\n containerXY: {\n x: null,\n y: null\n },\n lastZoomDelta: 1,\n desiredZoom: null,\n zoomedSince: 0,\n zoomWait: 30,\n highlightTimeout: null\n };\n\n this._init();\n }\n\n Events.prototype._init = function () {\n var _this = this;\n\n this._matchPlanetsLODToPlanet();\n\n this.p._.sceneContainer.addEventListener('mousewheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('DOMMouseScroll', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('wheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', this.p.controls._onMouseOut, false);\n\n this.p._.sceneContainer.addEventListener('touchend', this._onTouchZoom);\n\n this.p._.sceneContainer.addEventListener('mousedown', this._rotateGlobe_MouseDown, false);\n\n this.p._.sceneContainer.addEventListener('mousemove', this._onMouseMove, false);\n\n this.p._.sceneContainer.addEventListener('click', this._onClick, false);\n\n this.p._.sceneContainer.addEventListener('mouseenter', function () {\n _this.p._.mouseIsInScene = true;\n }, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', function () {\n _this.p._.mouseIsInScene = false;\n }, false);\n\n window.addEventListener('keydown', this._onKeyDown, false);\n };\n\n Events.prototype._rotateAroundArbAxis = function (axis, radians, noPremultiply) {\n var rotationMatrix = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\n rotationMatrix.makeRotationAxis(axis.normalize(), radians);\n if (noPremultiply !== true) rotationMatrix.multiply(this.p.planet.matrix);\n this.p.planet.matrix = rotationMatrix;\n this.p.planet.rotation.setFromRotationMatrix(this.p.planet.matrix);\n\n this._matchPlanetsLODToPlanet();\n\n this._refreshFrontGroupRotation();\n };\n\n Events.prototype._checkDesiredZoom = function () {\n this._.zoomedSince++;\n\n if (this._.desiredZoom != null) {\n this.p._.cameras.setNearFarPlane(this._.desiredZoom < 14);\n\n if (this._.zoomedSince > this._.zoomWait) {\n if (this._.desiredZoom >= this.p._.minNativeZoom) this._setZoom(this._.desiredZoom);\n this._.desiredZoom = null;\n }\n }\n };\n\n Events.prototype._setZoom = function (newZoom) {\n var zoomSave = this.p.zoom;\n this.p.zoom = newZoom;\n this.p.trueZoom = Math.max(0, newZoom);\n if (this.p.zoom < 0) this.p.zoom = 0;\n if (this.p.zoom < this.p._.minNativeZoom) this.p.zoom = this.p._.minNativeZoom;\n if (this.p.zoom > this.p._.maxZoom) this.p.zoom = this.p._.maxZoom;\n this._.lastZoomDelta = Math.abs(this.p.zoom - zoomSave);\n };\n\n Events.prototype._matchPlanetsLODToPlanet = function () {\n for (var i = 0; i < this.p.planetsLOD.length; i++) {\n this.p.planetsLOD[i].matrix = this.p.planet.matrix;\n this.p.planetsLOD[i].position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.planetsLOD[i].rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n\n if (this.p.atmosphere) {\n this.p.atmosphere.matrix = this.p.planet.matrix;\n this.p.atmosphere.position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.atmosphere.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n };\n\n Events.prototype._refreshFrontGroupRotation = function () {\n this.p.frontGroup.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n };\n\n Events.prototype._updateMouseCoords = function (lng, lat, elev) {\n this.p.mouse.lng = lng;\n this.p.mouse.lat = lat;\n this.p.mouse.elev = elev;\n };\n\n Events.prototype.updateHoverInfoPosition = function () {\n if (this.hoverInfo) {\n this.hoverInfo.style.left = this._.containerXY.x + 14 + \"px\";\n this.hoverInfo.style.top = this._.containerXY.y + 14 + \"px\";\n }\n };\n\n Events.prototype._highlightFeature = function (lng, lat, type, obj, intersectionRaw, intersectionPoint) {\n var cursor = {\n type: 'Point',\n coordinates: [lng, lat]\n };\n var highlighted = false;\n\n switch (type) {\n case 'Sprite':\n case 'Line2':\n highlighted = true;\n if (obj.feature._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n obj.feature._highlighted = true;\n obj.restyle();\n this.setHoveredFeature({\n layerName: obj.layerName,\n type: type,\n obj: obj,\n feature: obj.feature,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n break;\n\n case 'Mesh':\n if (obj.layerType === 'curtain') {} else if (obj.layerType === 'model') {} else if (obj.contains) {\n for (var _i = 0, _a = Object.keys(obj.contains).reverse(); _i < _a.length; _i++) {\n var layerName = _a[_i];\n\n for (var _b = 0, _c = obj.contains[layerName].reverse(); _b < _c.length; _b++) {\n var f = _c[_b];\n var feature = Object.assign({}, f);\n\n if (feature.geometry.type.toLowerCase() === 'point') {\n feature = Object(_turf_circle__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(feature.geometry.coordinates, feature._radiusInMeters || 1, {\n steps: 12,\n units: 'meters',\n properties: feature.properties\n });\n }\n\n if (Object(_turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(feature, cursor)) {\n highlighted = true;\n if (f._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n f._highlighted = true;\n this.setHoveredFeature({\n layerName: layerName,\n type: type,\n obj: obj,\n feature: f,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n\n this.p._.tiledWorld.updateClampedRasterForTile(obj, layerName);\n\n break;\n }\n }\n\n if (highlighted) return;\n }\n }\n\n break;\n\n default:\n break;\n }\n\n if (!highlighted) {\n this._unhighlightHoveredFeature();\n }\n };\n\n Events.prototype._unhighlightHoveredFeature = function () {\n if (this.hoveredFeature) {\n this.hoveredFeature.feature._highlighted = false;\n\n switch (this.hoveredFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.hoveredFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.hoveredFeature.obj, this.hoveredFeature.layerName);\n\n break;\n\n default:\n break;\n }\n\n this.clearHoveredFeature();\n }\n };\n\n Events.prototype.setHoveredFeature = function (hoveredFeature) {\n this.hoveredFeature = hoveredFeature;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n }\n\n this.hoverInfo = document.createElement('div');\n this.hoverInfo.id = '_lithosphere_hover_info';\n var layer = this.p.layers.getLayerByName(this.hoveredFeature.layerName);\n\n if (layer && layer.useKeyAsHoverName) {\n var text = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getIn(this.hoveredFeature.feature.properties, layer.useKeyAsHoverName.split('.'));\n\n if (text != null) {\n this.hoverInfo.innerHTML = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].capitalizeFirstLetter(layer.useKeyAsHoverName + \": \" + text);\n this.hoverInfo.style.position = 'absolute';\n this.hoverInfo.style.background = 'black';\n this.hoverInfo.style.color = 'white';\n this.hoverInfo.style.fontSize = '16px';\n this.hoverInfo.style.fontFamily = 'sans-serif';\n this.hoverInfo.style.fontWeight = 'bold';\n this.hoverInfo.style.padding = '4px 8px';\n this.updateHoverInfoPosition();\n }\n }\n\n this.p._.container.appendChild(this.hoverInfo);\n\n this.p._.container.style.cursor = 'pointer';\n };\n\n Events.prototype.clearHoveredFeature = function () {\n this.hoveredFeature = null;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n this.p._.container.style.cursor = 'default';\n }\n };\n\n Events.prototype.setActiveFeature = function (activeFeature) {\n this.clearActiveFeature();\n this.activeFeature = activeFeature;\n this.activeFeature.feature._active = true;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n };\n\n Events.prototype.clearActiveFeature = function () {\n if (this.activeFeature) {\n this.activeFeature.feature._active = false;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n }\n\n this.activeFeature = null;\n };\n\n Events.prototype._attenuate = function () {\n var zoomDist = this.p._.cameras.camera.position.distanceTo(this.p._.cameras.controls.target);\n\n var attenuationFactor = zoomDist / 256;\n\n if (this.p.layers.vector) {\n this.p.layers.vector.forEach(function (vectorLayer) {\n if (vectorLayer.meshes && vectorLayer.meshes.children) {\n vectorLayer.meshes.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius);\n }\n });\n }\n });\n }\n\n if (this.p.frontGroup.children) {\n this.p.frontGroup.children.forEach(function (child) {\n if (child.children && child.children.length > 0) {\n child.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius);\n }\n });\n } else {\n if (child instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n child.scale.set(attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius);\n }\n }\n });\n }\n };\n\n return Events;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Events);\n\n//# sourceURL=webpack://LithoSphere/./src/core/events.ts?"); +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/* harmony import */ var _turf_circle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/circle */ \"./node_modules/@turf/circle/dist/es/index.js\");\n/* harmony import */ var _turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/boolean-intersects */ \"./node_modules/@turf/boolean-intersects/dist/es/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Events = function () {\n function Events(parent) {\n var _this = this;\n\n this._rotateGlobe = function (e, prevXY, fromDamping) {\n if (prevXY) {\n _this._.prevMouseXY.x = prevXY.x;\n _this._.prevMouseXY.y = prevXY.y;\n } else if (!fromDamping) {\n _this._.panned = true;\n }\n\n if (!e) return;\n if (!e.pageX && e.touches) e.pageX = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n if (!e.pageY && e.touches) e.pageY = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n if (e.hasOwnProperty('x') && e.hasOwnProperty('y') && _this.p._.cameras.isFirstPerson) {\n _this._.prevMouseXY.x = 0;\n _this._.prevMouseXY.y = 0;\n e.pageX = e.x;\n e.pageY = e.y;\n }\n\n var rotSpeed = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getRadiansPerPixel(_this.p.trueZoom) * 0.5 * (3396190 / _this.p.projection.radii.major);\n\n var pixelDif = 0;\n var cpX = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n cpX.applyAxisAngle(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, 1, 0), Math.PI / 2);\n var cpY = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n\n if (e.pageY < _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, rotSpeed * pixelDif);\n } else if (e.pageY > _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, -rotSpeed * pixelDif);\n }\n\n if (e.pageX > _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, -rotSpeed * pixelDif);\n } else if (e.pageX < _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, rotSpeed * pixelDif);\n }\n\n _this._.oldPrevMouseXY.x = _this._.prevMouseXY.x;\n _this._.oldPrevMouseXY.y = _this._.prevMouseXY.y;\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n if (_this.p.zoom <= _this.p._.zCutOff) {\n _this.p._.cameras.orbit.controls.target.x = 0;\n _this.p._.cameras.orbit.controls.target.y = -_this.p.planetCenter.y;\n _this.p._.cameras.orbit.controls.target.z = 0;\n\n _this.p._.cameras.orbit.controls.update();\n } else {\n var elevRaw = _this.p.getCenterElevationRaw();\n\n if (elevRaw != null) {\n var newLookAtY = -(elevRaw + _this.p.planetCenter.y);\n if (newLookAtY != 0 && newLookAtY != -10000) _this.p._.cameras.orbit.controls.target.y = newLookAtY - _this.p.options.targetYOffset;\n }\n\n var center = _this.p.getCenter();\n\n _this.p.controls._onMove(center.lng, center.lat, center.height);\n }\n };\n\n this._rotateGlobe_MouseDown = function (e) {\n clearInterval(_this._.rotationDampingInterval);\n\n if (e.which === 1 || e.button === 0) {\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n _this.p._.sceneContainer.addEventListener('mousemove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('mouseup', _this._rotateGlobe_MouseUp, false);\n\n _this.p._.sceneContainer.addEventListener('mouseleave', _this._rotateGlobe_MouseUp, false);\n } else if (e.touches && e.touches.length > 2) {\n _this._.prevMouseXY.x = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n _this._.prevMouseXY.y = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n _this.p._.sceneContainer.addEventListener('touchmove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('touchend', _this._rotateGlobe_MouseUp, false);\n }\n };\n\n this._rotateGlobe_MouseUp = function (e) {\n _this.p._.sceneContainer.removeEventListener('mousemove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('mouseup', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('mouseleave', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('touchmove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('touchend', _this._rotateGlobe_MouseUp);\n\n if (_this._.panned) {\n clearInterval(_this._.rotationDampingInterval);\n var dif = {\n x: _this._.oldPrevMouseXY.x - _this._.prevMouseXY.x,\n y: _this._.oldPrevMouseXY.y - _this._.prevMouseXY.y\n };\n var difs_1 = [];\n\n while (dif.x > 2 || dif.x < -2 || dif.y > 2 || dif.y < -2) {\n var xSize = dif.x / 4;\n var ySize = dif.y / 4;\n dif.x -= xSize;\n dif.y -= ySize;\n difs_1.push({\n x: dif.x,\n y: dif.y\n });\n }\n\n difs_1.reverse();\n _this._.rotationDampingInterval = setInterval(function () {\n if (difs_1.length > 0) _this._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, difs_1.pop(), true);else clearInterval(_this._.rotationDampingInterval);\n }, 50);\n }\n\n _this._.panned = false;\n };\n\n this._onZoom = function (e) {\n _this._.zoomedSince = 0;\n\n var zoomDist = _this.p._.cameras.orbit.camera.position.distanceTo(_this.p._.cameras.orbit.controls.target);\n\n var nf = 8 - (parseInt(_this.p.projection.radiusScale).toString().length - 1);\n var rf = Math.max(parseInt(_this.p.planetCenter.y).toString().length - 7, 0) + (_this.p.options.zoomLevelShift || 0);\n if (Math.abs(_this.p.planetCenter.y) > 30000000) rf += 1;\n var dZoom = Math.ceil((nf * Math.log(2) - Math.log(zoomDist / Math.pow(5, nf - 1))) / Math.log(2)) + rf;\n _this._.desiredZoom = dZoom;\n\n _this._attenuate();\n };\n\n this._onTouchZoom = function (e) {\n if (e.touches && e.touches.length == 1) _this._onZoom(e);\n };\n\n this._onClick = function (e) {\n if (_this.hoveredFeature && _this.hoverInfo) {\n var layer = _this.p.layers.getLayerByName(_this.hoveredFeature.layerName);\n\n if (layer) {\n _this.setActiveFeature({\n layerName: _this.hoveredFeature.layerName,\n type: _this.hoveredFeature.type,\n obj: _this.hoveredFeature.obj,\n feature: _this.hoveredFeature.feature || _this.hoveredFeature.obj.feature,\n lnglat: {\n lng: _this.hoveredFeature.lnglat.lng,\n lat: _this.hoveredFeature.lnglat.lat\n }\n });\n\n if (typeof layer.onClick === 'function') {\n layer.onClick(JSON.parse(JSON.stringify(_this.hoveredFeature.feature)), JSON.parse(JSON.stringify(_this.hoveredFeature.lnglat)), layer);\n }\n }\n }\n };\n\n this._onKeyDown = function (e) {\n if (_this.p._.cameras.isFirstPerson) return;\n var speed = e.shiftKey ? 20 : 8;\n\n switch (e.key) {\n case 'w':\n case 'ArrowUp':\n _this._rotateGlobe({\n pageX: 0,\n pageY: speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'a':\n case 'ArrowLeft':\n _this._rotateGlobe({\n pageX: speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 's':\n case 'ArrowDown':\n _this._rotateGlobe({\n pageX: 0,\n pageY: -speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'd':\n case 'ArrowRight':\n _this._rotateGlobe({\n pageX: -speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'g':\n case 'PageDown':\n var lerpedDown = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? -0.035 : -0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedDown.x, lerpedDown.y, lerpedDown.z);\n\n _this._onZoom();\n\n break;\n\n case 't':\n case 'PageUp':\n var lerpedUp = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? 0.035 : 0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedUp.x, lerpedUp.y, lerpedUp.z);\n\n _this._onZoom();\n\n break;\n\n case 'q':\n _this.p._.cameras.orbit.controls.rotateLeft(Math.PI / 64);\n\n break;\n\n case 'e':\n _this.p._.cameras.orbit.controls.rotateLeft(-Math.PI / 64);\n\n break;\n\n case 'r':\n _this.p._.cameras.orbit.controls.rotateUp(Math.PI / 64);\n\n break;\n\n case 'f':\n _this.p._.cameras.orbit.controls.rotateUp(-Math.PI / 64);\n\n break;\n }\n };\n\n this._onMouseMove = function (e) {\n _this.p._.mouseIsInScene = true;\n\n if (_this.p._.cameras.isFirstPerson) {\n _this._.mouseXY.x = 0;\n _this._.mouseXY.y = 0;\n } else {\n _this._.mouseXY.x = (e.clientX - _this.p._.renderer.domElement.getBoundingClientRect().left) / _this.p._.renderer.domElement.clientWidth * 2 - 1;\n _this._.mouseXY.y = -((e.clientY - _this.p._.renderer.domElement.getBoundingClientRect().top) / _this.p._.renderer.domElement.clientHeight) * 2 + 1;\n }\n\n _this._.containerXY = {\n x: e ? e.offsetX : null,\n y: e ? e.offsetY : null\n };\n\n _this.updateHoverInfoPosition();\n\n _this.p._.raycaster.setFromCamera(_this._.mouseXY, _this.p._.cameras.camera);\n\n var intersectArr = [];\n\n for (var i = 0; i < _this.p._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this.p._.tiledWorld.tilesDrawn[i].isLODTile) intersectArr.push(_this.p._.tiledWorld.tilesDrawn[i].t);\n }\n\n for (var i = 0; i < _this.p.layers.vector.length; i++) {\n if (_this.p.layers.vector[i].meshes && _this.p.layers.vector[i].meshes.children) for (var j = 0; j < _this.p.layers.vector[i].meshes.children.length; j++) intersectArr.push(_this.p.layers.vector[i].meshes.children[j]);\n }\n\n for (var i = 0; i < _this.p.layers.curtain.length; i++) {\n if (_this.p.layers.curtain[i].curtain && _this.p.layers.curtain[i].curtain.children) for (var j = 0; j < _this.p.layers.curtain[i].curtain.children.length; j++) intersectArr.push(_this.p.layers.curtain[i].curtain.children[j]);\n }\n\n var intersects = _this.p._.raycaster.intersectObjects(intersectArr);\n\n if (intersects.length > 0) {\n var type_1 = intersects[0].object.type;\n var obj_1 = null;\n\n switch (type_1) {\n case 'Sprite':\n obj_1 = intersects[0].object;\n break;\n\n case 'Line2':\n obj_1 = intersects[0].object;\n break;\n\n case 'Mesh':\n obj_1 = _this.p._.tiledWorld.findTileDrawnBasedOnUUID(intersects[0].object.uuid);\n\n if (obj_1 == null) {\n obj_1 = intersects[0].object;\n }\n\n break;\n\n default:\n return;\n break;\n }\n\n var savedIntersectionPoint_1 = intersects[0].point;\n intersects[0].point.y += _this.p.planetCenter.y;\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: -_this.p.planet.rotation.x,\n y: 0,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: -_this.p.planet.rotation.y,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: 0,\n z: -_this.p.planet.rotation.z\n });\n\n var intersectedLL_1 = _this.p.projection.vector3ToLatLng(intersects[0].point);\n\n intersectedLL_1.height = (savedIntersectionPoint_1.length() - _this.p.planet.position.y) / _this.p.projection.radiusScale;\n\n _this._updateMouseCoords(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height);\n\n clearTimeout(_this._.highlightTimeout);\n _this._.highlightTimeout = setTimeout(function () {\n _this._highlightFeature(intersectedLL_1.lng, intersectedLL_1.lat, type_1, obj_1, intersects[0], savedIntersectionPoint_1);\n }, 10);\n\n _this.p.layers._onMouseMove(intersectedLL_1, e, obj_1, intersects[0], savedIntersectionPoint_1);\n\n _this.p.controls._onMouseMove(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height, e);\n } else {\n _this._updateMouseCoords(null, null, null);\n\n _this._unhighlightHoveredFeature();\n\n _this.p.controls._onMouseMove(null, null, null, e);\n }\n };\n\n this.p = parent;\n this.activeFeature = null;\n this.hoveredFeature = null;\n this.hoverInfo = null;\n this._ = {\n mouseXY: {\n x: null,\n y: null\n },\n prevMouseXY: {\n x: null,\n y: null\n },\n oldPrevMouseXY: {\n x: null,\n y: null\n },\n containerXY: {\n x: null,\n y: null\n },\n lastZoomDelta: 1,\n desiredZoom: null,\n zoomedSince: 0,\n zoomWait: 30,\n highlightTimeout: null,\n rotationDampingInterval: null,\n panned: false\n };\n\n this._init();\n }\n\n Events.prototype._init = function () {\n var _this = this;\n\n this._matchPlanetsLODToPlanet();\n\n this.p._.sceneContainer.addEventListener('mousewheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('DOMMouseScroll', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('wheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', this.p.controls._onMouseOut, false);\n\n this.p._.sceneContainer.addEventListener('touchend', this._onTouchZoom);\n\n this.p._.sceneContainer.addEventListener('mousedown', this._rotateGlobe_MouseDown, false);\n\n this.p._.sceneContainer.addEventListener('mousemove', this._onMouseMove, false);\n\n this.p._.sceneContainer.addEventListener('click', this._onClick, false);\n\n this.p._.sceneContainer.addEventListener('mouseenter', function () {\n _this.p._.mouseIsInScene = true;\n }, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', function () {\n _this.p._.mouseIsInScene = false;\n }, false);\n\n window.addEventListener('keydown', this._onKeyDown, false);\n };\n\n Events.prototype._rotateAroundArbAxis = function (axis, radians, noPremultiply) {\n var rotationMatrix = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\n rotationMatrix.makeRotationAxis(axis.normalize(), radians);\n if (noPremultiply !== true) rotationMatrix.multiply(this.p.planet.matrix);\n this.p.planet.matrix = rotationMatrix;\n this.p.planet.rotation.setFromRotationMatrix(this.p.planet.matrix);\n\n this._matchPlanetsLODToPlanet();\n\n this._refreshFrontGroupRotation();\n };\n\n Events.prototype._checkDesiredZoom = function () {\n this._.zoomedSince++;\n\n if (this._.desiredZoom != null) {\n this.p._.cameras.setNearFarPlane(this.p.projection.radiusScale, this._.desiredZoom < 14);\n\n if (this._.zoomedSince > this._.zoomWait) {\n if (this._.desiredZoom >= this.p._.minNativeZoom) this._setZoom(this._.desiredZoom);\n this._.desiredZoom = null;\n }\n }\n };\n\n Events.prototype._setZoom = function (newZoom) {\n var zoomSave = this.p.zoom;\n this.p.zoom = newZoom;\n this.p.trueZoom = Math.max(0, newZoom);\n if (this.p.zoom < 0) this.p.zoom = 0;\n if (this.p.zoom < this.p._.minNativeZoom) this.p.zoom = this.p._.minNativeZoom;\n if (this.p.zoom > this.p._.maxZoom) this.p.zoom = this.p._.maxZoom;\n this._.lastZoomDelta = Math.abs(this.p.zoom - zoomSave);\n };\n\n Events.prototype._matchPlanetsLODToPlanet = function () {\n for (var i = 0; i < this.p.planetsLOD.length; i++) {\n this.p.planetsLOD[i].matrix = this.p.planet.matrix;\n this.p.planetsLOD[i].position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.planetsLOD[i].rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n\n if (this.p.atmosphere) {\n this.p.atmosphere.matrix = this.p.planet.matrix;\n this.p.atmosphere.position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.atmosphere.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n };\n\n Events.prototype._refreshFrontGroupRotation = function () {\n this.p.frontGroup.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n };\n\n Events.prototype._updateMouseCoords = function (lng, lat, elev) {\n this.p.mouse.lng = lng;\n this.p.mouse.lat = lat;\n this.p.mouse.elev = elev;\n };\n\n Events.prototype.updateHoverInfoPosition = function () {\n if (this.hoverInfo) {\n this.hoverInfo.style.left = this._.containerXY.x + 14 + \"px\";\n this.hoverInfo.style.top = this._.containerXY.y + 14 + \"px\";\n }\n };\n\n Events.prototype._highlightFeature = function (lng, lat, type, obj, intersectionRaw, intersectionPoint) {\n var cursor = {\n type: 'Point',\n coordinates: [lng, lat]\n };\n var highlighted = false;\n\n switch (type) {\n case 'Sprite':\n case 'Line2':\n highlighted = true;\n if (obj.feature._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n obj.feature._highlighted = true;\n obj.restyle();\n this.setHoveredFeature({\n layerName: obj.layerName,\n type: type,\n obj: obj,\n feature: obj.feature,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n break;\n\n case 'Mesh':\n if (obj.layerType === 'curtain') {} else if (obj.layerType === 'model') {} else if (obj.contains) {\n for (var _i = 0, _a = Object.keys(obj.contains).reverse(); _i < _a.length; _i++) {\n var layerName = _a[_i];\n\n for (var _b = 0, _c = obj.contains[layerName].reverse(); _b < _c.length; _b++) {\n var f = _c[_b];\n var feature = Object.assign({}, f);\n\n if (feature.geometry.type.toLowerCase() === 'point') {\n feature = Object(_turf_circle__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(feature.geometry.coordinates, feature._radiusInMeters || 1, {\n steps: 12,\n units: 'meters',\n properties: feature.properties\n });\n }\n\n if (Object(_turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(feature, cursor)) {\n highlighted = true;\n if (f._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n f._highlighted = true;\n this.setHoveredFeature({\n layerName: layerName,\n type: type,\n obj: obj,\n feature: f,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n\n this.p._.tiledWorld.updateClampedRasterForTile(obj, layerName);\n\n break;\n }\n }\n\n if (highlighted) return;\n }\n }\n\n break;\n\n default:\n break;\n }\n\n if (!highlighted) {\n this._unhighlightHoveredFeature();\n }\n };\n\n Events.prototype._unhighlightHoveredFeature = function () {\n if (this.hoveredFeature) {\n this.hoveredFeature.feature._highlighted = false;\n\n switch (this.hoveredFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.hoveredFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.hoveredFeature.obj, this.hoveredFeature.layerName);\n\n break;\n\n default:\n break;\n }\n\n this.clearHoveredFeature();\n }\n };\n\n Events.prototype.setHoveredFeature = function (hoveredFeature) {\n this.hoveredFeature = hoveredFeature;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n }\n\n this.hoverInfo = document.createElement('div');\n this.hoverInfo.id = '_lithosphere_hover_info';\n var layer = this.p.layers.getLayerByName(this.hoveredFeature.layerName);\n\n if (layer && layer.useKeyAsHoverName) {\n var text = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getIn(this.hoveredFeature.feature.properties, layer.useKeyAsHoverName.split('.'));\n\n if (text != null) {\n this.hoverInfo.innerHTML = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].capitalizeFirstLetter(layer.useKeyAsHoverName + \": \" + text);\n this.hoverInfo.style.position = 'absolute';\n this.hoverInfo.style.background = 'black';\n this.hoverInfo.style.color = 'white';\n this.hoverInfo.style.fontSize = '16px';\n this.hoverInfo.style.fontFamily = 'sans-serif';\n this.hoverInfo.style.fontWeight = 'bold';\n this.hoverInfo.style.padding = '4px 8px';\n this.updateHoverInfoPosition();\n }\n }\n\n this.p._.container.appendChild(this.hoverInfo);\n\n this.p._.container.style.cursor = 'pointer';\n };\n\n Events.prototype.clearHoveredFeature = function () {\n this.hoveredFeature = null;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n this.p._.container.style.cursor = 'default';\n }\n };\n\n Events.prototype.setActiveFeature = function (activeFeature) {\n this.clearActiveFeature();\n this.activeFeature = activeFeature;\n this.activeFeature.feature._active = true;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n };\n\n Events.prototype.clearActiveFeature = function () {\n if (this.activeFeature) {\n this.activeFeature.feature._active = false;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n }\n\n this.activeFeature = null;\n };\n\n Events.prototype._attenuate = function () {\n var zoomDist = this.p._.cameras.camera.position.distanceTo(this.p._.cameras.controls.target);\n\n var attenuationFactor = zoomDist / 256;\n\n if (this.p.layers.vector) {\n this.p.layers.vector.forEach(function (vectorLayer) {\n if (vectorLayer.meshes && vectorLayer.meshes.children) {\n vectorLayer.meshes.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * (mesh.style.width || mesh.style.radius), attenuationFactor * (mesh.style.height || mesh.style.radius), attenuationFactor * mesh.style.radius);\n }\n });\n }\n });\n }\n\n if (this.p.frontGroup.children) {\n this.p.frontGroup.children.forEach(function (child) {\n if (child.children && child.children.length > 0) {\n child.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * (mesh.style.width || mesh.style.radius), attenuationFactor * (mesh.style.height || mesh.style.radius), attenuationFactor * mesh.style.radius);\n }\n });\n } else {\n if (child instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n child.scale.set(attenuationFactor * (mesh.style.width || mesh.style.radius), attenuationFactor * (mesh.style.height || mesh.style.radius), attenuationFactor * mesh.style.radius);\n }\n }\n });\n }\n };\n\n return Events;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Events);\n\n//# sourceURL=webpack://LithoSphere/./src/core/events.ts?"); /***/ }), @@ -1972,7 +2007,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ren /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CRS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CRS */ \"./src/core/CRS.ts\");\n\nvar RadiusE;\n\n(function (RadiusE) {\n RadiusE[\"Major\"] = \"major\";\n RadiusE[\"Minor\"] = \"minor\";\n})(RadiusE || (RadiusE = {}));\n\nvar Projection = function () {\n function Projection(majorRadius, minorRadius, tileMapResource, trueTileResolution) {\n var _this = this;\n\n this.setRadius = function (radius, which) {\n if (which === void 0) {\n which = RadiusE.Major;\n }\n\n if (which.toLowerCase() == 'major') _this.radii.major = radius || _this.baseRadius;else if (which.toLowerCase() == 'minor') _this.radii.minor = radius || _this.radii.major || _this.baseRadius;\n };\n\n this.invertY = function (y, z) {\n var b = _this.crs.projection.bounds;\n\n if (_this.tileMapResource.crsCode === 'EPSG:4326') {\n return Math.pow(2, z) - 1 - y;\n }\n\n var s = _this.crs.scale(z);\n\n var max = _this.crs.transformation.transform(b.min, s);\n\n var yMax = Math.ceil(max.y / 256) - 1;\n return yMax - y;\n };\n\n this.toBounds = function (a, b) {\n var bounds = {\n min: {\n x: null,\n y: null\n },\n max: {\n x: null,\n y: null\n }\n };\n bounds.min.x = Math.min(a.x, b.x);\n bounds.max.x = Math.max(a.x, b.x);\n bounds.min.y = Math.min(a.y, b.y);\n bounds.max.y = Math.max(a.y, b.y);\n return bounds;\n };\n\n this.tileXYZ2NwSe = function (xyz, tileResolution, asBounds, stretchFactor) {\n if (_this.tileMapResource.proj == null) return null;\n stretchFactor = Math.max(stretchFactor || 1, 1);\n var stretchAmount = (stretchFactor - 1) * tileResolution;\n var nwPoint = {\n x: xyz.x * tileResolution - stretchAmount,\n y: xyz.y * tileResolution - stretchAmount\n };\n var sePoint = {\n x: nwPoint.x + tileResolution + stretchAmount * 2,\n y: nwPoint.y + tileResolution + stretchAmount * 2\n };\n\n var nw = _this.crs.pointToLatLng(nwPoint, xyz.z);\n\n var se = _this.crs.pointToLatLng(sePoint, xyz.z);\n\n if (asBounds) return _this.toBounds(_this.crs.project(nw), _this.crs.project(se));\n return {\n nw: nw,\n se: se\n };\n };\n\n this.tileXYZ2LatLng = function (x, y, z, flatXYZ) {\n if (_this.tileMapResource.proj == null) {\n var lng = x / Math.pow(2, z) * 360 - 180;\n var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z);\n var lat = 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n return {\n lat: lat,\n lng: lng\n };\n } else {\n y = -y;\n var easting = _this.trueTileResolution * x * _this.res[z] + _this.tileMapResource.origin[0];\n var northing = _this.trueTileResolution * y * _this.res[z] + _this.tileMapResource.origin[1];\n return _this.crs.unproject({\n x: easting,\n y: northing\n });\n }\n };\n\n this.latLngZ2TileXYZ = function (lat, lng, z, dontFloor) {\n if (_this.tileMapResource.proj == null) {\n var x = (lng + 180) / 360 * Math.pow(2, z);\n var y = (1 - Math.log(Math.tan(lat * (Math.PI / 180)) + 1 / Math.cos(lat * (Math.PI / 180))) / Math.PI) / 2 * Math.pow(2, z);\n\n if (dontFloor == null) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n\n return {\n x: x,\n y: y,\n z: z\n };\n } else {\n var p = _this.crs.project({\n lng: lng,\n lat: lat\n });\n\n var easting = p.x;\n var northing = p.y;\n var x = (easting - _this.tileMapResource.origin[0]) / (_this.trueTileResolution * _this.res[z]);\n var y = (northing - _this.tileMapResource.origin[1]) / (_this.trueTileResolution * _this.res[z]);\n y = -y;\n return {\n x: x,\n y: y,\n z: z\n };\n }\n };\n\n this.vector3ToLatLng = function (xyz) {\n var y = xyz.y;\n var z = xyz.z;\n xyz.y = -z;\n xyz.z = -y;\n var rs = _this.radii.major / _this.radiusScale;\n var rs2 = _this.radii.minor / _this.radiusScale;\n var r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2));\n var E2 = Math.pow(rs, 2) - Math.pow(rs2, 2);\n var F = 54 * Math.pow(rs, 2) * Math.pow(xyz.z, 2);\n var G = Math.pow(r, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) - Math.pow(_this.e, 2) * E2;\n var C = Math.pow(_this.e, 4) * F * Math.pow(r, 2) / Math.pow(G, 3);\n var S = Math.cbrt(1 + C + Math.sqrt(Math.pow(C, 2) + 2 * C));\n var P = F / (3 * Math.pow(S + 1 / S + 1, 2) * Math.pow(G, 2));\n var Q = Math.sqrt(1 + 2 * Math.pow(_this.e, 4) * P);\n var r0 = -(P * Math.pow(_this.e, 2) * r) / (1 + Q) + Math.sqrt(0.5 * Math.pow(rs, 2) * (1 + 1 / Q) - P * (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) / (Q * (1 + Q)) - 0.5 * P * Math.pow(r, 2));\n var U = Math.sqrt(r - Math.pow(_this.e, 2) * r0 + Math.pow(xyz.z, 2));\n var V = Math.sqrt(Math.pow(r - Math.pow(_this.e, 2) * r0, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2));\n var Z0 = Math.pow(rs2, 2) * xyz.z / (rs * V);\n var h = U * (1 - Math.pow(rs2, 2) / (rs * V));\n var phi = Math.atan((xyz.z + Math.pow(_this.ep, 2) * Z0) / r) * (180 / Math.PI);\n var lambda = -(Math.atan2(xyz.y, xyz.x) * (180 / Math.PI)) - 90;\n if (lambda < -180) lambda += 360;\n return {\n lat: phi,\n lng: lambda,\n height: h\n };\n };\n\n this.lonLatToVector3 = function (lon, lat, height) {\n var phi = lat * (Math.PI / 180);\n var theta = (lon - 180) * (Math.PI / 180);\n var x = (_this.radii.major + height) / _this.radiusScale * Math.cos(phi) * Math.sin(theta);\n var y = -(_this.radii.major + height) / _this.radiusScale * Math.sin(phi);\n var z = -(_this.radii.major + height) / _this.radiusScale * Math.cos(phi) * Math.cos(theta);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.rotatePoint3D = function (pt, angle, center) {\n if (center == undefined) center = {\n x: 0,\n y: 0,\n z: 0\n };\n var dx = pt.x - center.x;\n var dy = pt.y - center.y;\n var dz = pt.z - center.z;\n var sx = Math.sin(angle.x);\n var cx = Math.cos(angle.x);\n var sy = Math.sin(angle.y);\n var cy = Math.cos(angle.y);\n var sz = Math.sin(angle.z);\n var cz = Math.cos(angle.z);\n var x = center.x + dx * (cy * cz) + dy * (-cy * sz) + dz * sy;\n var y = center.y + dx * (cx * sz + sx * sy * cz) + dy * (cx * cz - sx * sy * sz) + dz * (-sx * cy);\n var z = center.z + dx * (sx * sz - cx * sy * cz) + dy * (sx * cz + cx * sy * sz) + dz * (cx * cy);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.lngLatDistBetween = function (lon1, lat1, lon2, lat2) {\n var R = _this.radii.major / _this.radiusScale;\n var φ1 = lat1 * (Math.PI / 180);\n var φ2 = lat2 * (Math.PI / 180);\n var Δφ = (lat2 - lat1) * (Math.PI / 180);\n var Δλ = (lon2 - lon1) * (Math.PI / 180);\n var a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) + Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c;\n };\n\n this._reset();\n\n this.setRadius(majorRadius, RadiusE.Major);\n this.setRadius(minorRadius, RadiusE.Minor);\n this.tileMapResource = tileMapResource || {\n bounds: null,\n origin: null,\n crsCode: null,\n epsg: null,\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.tileMapResource.crsCode = this.tileMapResource.crsCode || 'EPSG:4326';\n this.trueTileResolution = trueTileResolution || 256;\n\n if (this.tileMapResource.resunitsperpixel != null && this.tileMapResource.reszoomlevel != null) {\n var baseRes = this.tileMapResource.resunitsperpixel * Math.pow(2, this.tileMapResource.reszoomlevel);\n var res = [];\n\n for (var i = 0; i < 32; i++) {\n res.push(baseRes / Math.pow(2, i));\n }\n\n this.res = res;\n }\n\n var tmr = this.tileMapResource;\n this.crs = new _CRS__WEBPACK_IMPORTED_MODULE_0__[\"default\"](Number.isFinite(parseInt(tmr.crsCode[0])) ? \"EPSG:\" + tmr.epsg : tmr.crsCode, tmr.proj, {\n origin: [parseFloat(tmr.origin[0]), parseFloat(tmr.origin[1])],\n resolutions: this.res,\n bounds: [[parseFloat(tmr.bounds[0]), parseFloat(tmr.bounds[1])], [parseFloat(tmr.bounds[2]), parseFloat(tmr.bounds[3])]]\n }, parseFloat(this.radii.major));\n }\n\n Projection.prototype._reset = function () {\n this.baseRadius = 6371000;\n this.radiusScale = 1;\n this.radii = {\n major: this.baseRadius,\n minor: this.baseRadius\n };\n this.tileMapResource = {\n bounds: null,\n origin: null,\n crsCode: 'EPSG:4326',\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.e = 0;\n this.ep = 0;\n this.flatteningFactor = 0;\n };\n\n return Projection;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Projection);\n\n//# sourceURL=webpack://LithoSphere/./src/core/projection.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CRS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CRS */ \"./src/core/CRS.ts\");\n\nvar RadiusE;\n\n(function (RadiusE) {\n RadiusE[\"Major\"] = \"major\";\n RadiusE[\"Minor\"] = \"minor\";\n})(RadiusE || (RadiusE = {}));\n\nvar Projection = function () {\n function Projection(majorRadius, minorRadius, tileMapResource, trueTileResolution, radiusCutoff) {\n var _this = this;\n\n this.setRadius = function (radius, which) {\n if (which === void 0) {\n which = RadiusE.Major;\n }\n\n if (which.toLowerCase() == 'major') {\n _this.radii.major = radius || _this.baseRadius;\n if (_this.radii.major > _this.radiusCutoff) _this.radiusScale = _this.radii.major / _this.radiusCutoff;\n } else if (which.toLowerCase() == 'minor') _this.radii.minor = radius || _this.radii.major || _this.baseRadius;\n };\n\n this.invertY = function (y, z) {\n var b = _this.crs.projection.bounds;\n\n if (_this.tileMapResource.crsCode === 'EPSG:4326') {\n return Math.pow(2, z) - 1 - y;\n }\n\n var s = _this.crs.scale(z);\n\n var max = _this.crs.transformation.transform(b.min, s);\n\n var yMax = Math.ceil(max.y / 256) - 1;\n return yMax - y;\n };\n\n this.toBounds = function (a, b) {\n var bounds = {\n min: {\n x: null,\n y: null\n },\n max: {\n x: null,\n y: null\n }\n };\n bounds.min.x = Math.min(a.x, b.x);\n bounds.max.x = Math.max(a.x, b.x);\n bounds.min.y = Math.min(a.y, b.y);\n bounds.max.y = Math.max(a.y, b.y);\n return bounds;\n };\n\n this.tileXYZ2NwSe = function (xyz, tileResolution, asBounds, stretchFactor) {\n if (_this.tileMapResource.proj == null) return null;\n stretchFactor = Math.max(stretchFactor || 1, 1);\n var stretchAmount = (stretchFactor - 1) * tileResolution;\n var nwPoint = {\n x: xyz.x * tileResolution - stretchAmount,\n y: xyz.y * tileResolution - stretchAmount\n };\n var sePoint = {\n x: nwPoint.x + tileResolution + stretchAmount * 2,\n y: nwPoint.y + tileResolution + stretchAmount * 2\n };\n\n var nw = _this.crs.pointToLatLng(nwPoint, xyz.z);\n\n var se = _this.crs.pointToLatLng(sePoint, xyz.z);\n\n if (asBounds) return _this.toBounds(_this.crs.project(nw), _this.crs.project(se));\n return {\n nw: nw,\n se: se\n };\n };\n\n this.tileXYZ2LatLng = function (x, y, z, flatXYZ) {\n if (_this.tileMapResource.proj == null) {\n var lng = x / Math.pow(2, z) * 360 - 180;\n var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z);\n var lat = 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n return {\n lat: lat,\n lng: lng\n };\n } else {\n y = -y;\n var easting = _this.trueTileResolution * x * _this.res[z] + _this.tileMapResource.origin[0];\n var northing = _this.trueTileResolution * y * _this.res[z] + _this.tileMapResource.origin[1];\n return _this.crs.unproject({\n x: easting,\n y: northing\n });\n }\n };\n\n this.latLngZ2TileXYZ = function (lat, lng, z, dontFloor) {\n if (_this.tileMapResource.proj == null) {\n var x = (lng + 180) / 360 * Math.pow(2, z);\n var y = (1 - Math.log(Math.tan(lat * (Math.PI / 180)) + 1 / Math.cos(lat * (Math.PI / 180))) / Math.PI) / 2 * Math.pow(2, z);\n\n if (dontFloor == null) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n\n return {\n x: x,\n y: y,\n z: z\n };\n } else {\n var p = _this.crs.project({\n lng: lng,\n lat: lat\n });\n\n var easting = p.x;\n var northing = p.y;\n var x = (easting - _this.tileMapResource.origin[0]) / (_this.trueTileResolution * _this.res[z]);\n var y = (northing - _this.tileMapResource.origin[1]) / (_this.trueTileResolution * _this.res[z]);\n y = -y;\n return {\n x: x,\n y: y,\n z: z\n };\n }\n };\n\n this.vector3ToLatLng = function (xyz) {\n var y = xyz.y;\n var z = xyz.z;\n xyz.y = -z;\n xyz.z = -y;\n var rs = _this.radii.major / _this.radiusScale;\n var rs2 = _this.radii.minor / _this.radiusScale;\n var r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2));\n var E2 = Math.pow(rs, 2) - Math.pow(rs2, 2);\n var F = 54 * Math.pow(rs, 2) * Math.pow(xyz.z, 2);\n var G = Math.pow(r, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) - Math.pow(_this.e, 2) * E2;\n var C = Math.pow(_this.e, 4) * F * Math.pow(r, 2) / Math.pow(G, 3);\n var S = Math.cbrt(1 + C + Math.sqrt(Math.pow(C, 2) + 2 * C));\n var P = F / (3 * Math.pow(S + 1 / S + 1, 2) * Math.pow(G, 2));\n var Q = Math.sqrt(1 + 2 * Math.pow(_this.e, 4) * P);\n var r0 = -(P * Math.pow(_this.e, 2) * r) / (1 + Q) + Math.sqrt(0.5 * Math.pow(rs, 2) * (1 + 1 / Q) - P * (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) / (Q * (1 + Q)) - 0.5 * P * Math.pow(r, 2));\n var U = Math.sqrt(r - Math.pow(_this.e, 2) * r0 + Math.pow(xyz.z, 2));\n var V = Math.sqrt(Math.pow(r - Math.pow(_this.e, 2) * r0, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2));\n var Z0 = Math.pow(rs2, 2) * xyz.z / (rs * V);\n var h = U * (1 - Math.pow(rs2, 2) / (rs * V));\n var phi = Math.atan((xyz.z + Math.pow(_this.ep, 2) * Z0) / r) * (180 / Math.PI);\n var lambda = -(Math.atan2(xyz.y, xyz.x) * (180 / Math.PI)) - 90;\n if (lambda < -180) lambda += 360;\n return {\n lat: phi,\n lng: lambda,\n height: h\n };\n };\n\n this.lonLatToVector3 = function (lon, lat, height) {\n var phi = lat * (Math.PI / 180);\n var theta = (lon - 180) * (Math.PI / 180);\n var h = _this.radii.major / _this.radiusScale + height;\n var x = h * Math.cos(phi) * Math.sin(theta);\n var y = -h * Math.sin(phi);\n var z = -h * Math.cos(phi) * Math.cos(theta);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.rotatePoint3D = function (pt, angle, center) {\n if (center == undefined) center = {\n x: 0,\n y: 0,\n z: 0\n };\n var dx = pt.x - center.x;\n var dy = pt.y - center.y;\n var dz = pt.z - center.z;\n var sx = Math.sin(angle.x);\n var cx = Math.cos(angle.x);\n var sy = Math.sin(angle.y);\n var cy = Math.cos(angle.y);\n var sz = Math.sin(angle.z);\n var cz = Math.cos(angle.z);\n var x = center.x + dx * (cy * cz) + dy * (-cy * sz) + dz * sy;\n var y = center.y + dx * (cx * sz + sx * sy * cz) + dy * (cx * cz - sx * sy * sz) + dz * (-sx * cy);\n var z = center.z + dx * (sx * sz - cx * sy * cz) + dy * (sx * cz + cx * sy * sz) + dz * (cx * cy);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.lngLatDistBetween = function (lon1, lat1, lon2, lat2) {\n var R = _this.radii.major / _this.radiusScale;\n var φ1 = lat1 * (Math.PI / 180);\n var φ2 = lat2 * (Math.PI / 180);\n var Δφ = (lat2 - lat1) * (Math.PI / 180);\n var Δλ = (lon2 - lon1) * (Math.PI / 180);\n var a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) + Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c;\n };\n\n this.radiusCutoff = radiusCutoff || Infinity;\n\n this._reset();\n\n this.setRadius(majorRadius, RadiusE.Major);\n this.setRadius(minorRadius, RadiusE.Minor);\n this.tileMapResource = tileMapResource || {\n bounds: null,\n origin: null,\n crsCode: null,\n epsg: null,\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.tileMapResource.crsCode = this.tileMapResource.crsCode || 'EPSG:4326';\n this.trueTileResolution = trueTileResolution || 256;\n\n if (this.tileMapResource.resunitsperpixel != null && this.tileMapResource.reszoomlevel != null) {\n var baseRes = this.tileMapResource.resunitsperpixel * Math.pow(2, this.tileMapResource.reszoomlevel);\n var res = [];\n\n for (var i = 0; i < 32; i++) {\n res.push(baseRes / Math.pow(2, i));\n }\n\n this.res = res;\n }\n\n var tmr = this.tileMapResource;\n this.crs = new _CRS__WEBPACK_IMPORTED_MODULE_0__[\"default\"](Number.isFinite(parseInt(tmr.crsCode[0])) ? \"EPSG:\" + tmr.epsg : tmr.crsCode, tmr.proj, tmr.origin != null ? {\n origin: [parseFloat(tmr.origin[0]), parseFloat(tmr.origin[1])],\n resolutions: this.res,\n bounds: [[parseFloat(tmr.bounds[0]), parseFloat(tmr.bounds[1])], [parseFloat(tmr.bounds[2]), parseFloat(tmr.bounds[3])]]\n } : {\n origin: [0, 0],\n resolutions: this.res,\n bounds: [0, 0, 0, 0]\n }, parseFloat(this.radii.major));\n }\n\n Projection.prototype._reset = function () {\n this.baseRadius = 6371000;\n this.radiusScale = 1;\n this.radii = {\n major: this.baseRadius,\n minor: this.baseRadius\n };\n this.tileMapResource = {\n bounds: null,\n origin: null,\n crsCode: 'EPSG:4326',\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.e = 0;\n this.ep = 0;\n this.flatteningFactor = 0;\n };\n\n return Projection;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Projection);\n\n//# sourceURL=webpack://LithoSphere/./src/core/projection.ts?"); /***/ }), @@ -2008,7 +2043,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (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/core/index.ts\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _parsers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parsers */ \"./src/parsers/index.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n/* harmony import */ var _utils_paths__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/paths */ \"./src/utils/paths.ts\");\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nvar __generator = undefined && undefined.__generator || function (thisArg, body) {\n var _ = {\n label: 0,\n sent: function () {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n\n case 7:\n op = _.ops.pop();\n\n _.trys.pop();\n\n continue;\n\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n\n if (t && _.label < t[2]) {\n _.label = t[2];\n\n _.ops.push(op);\n\n break;\n }\n\n if (t[2]) _.ops.pop();\n\n _.trys.pop();\n\n continue;\n }\n\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n};\n\n\n\n\n\n\n\nvar TiledWorld = function () {\n function TiledWorld(parent) {\n this.p = parent;\n\n this._reset();\n }\n\n TiledWorld.prototype._reset = function () {\n this._ = {\n loader: new three__WEBPACK_IMPORTED_MODULE_1__[\"TextureLoader\"](),\n tileDimension: 6\n };\n this.tilesDrawn = [];\n this.tilesWanted = [];\n this.tilesToBeDrawn = [];\n this.tilesBeingDrawn = [];\n };\n\n TiledWorld.prototype.refreshTiles = function () {\n var _this = this;\n\n this.updateDesiredTiles();\n this.tilesToBeDrawn = [];\n\n for (var i = 0; i < this.tilesWanted.length; i++) {\n var matched = false;\n\n for (var j = 0; j < this.tilesDrawn.length; j++) {\n if (this.tilesWanted[i].x == this.tilesDrawn[j].x && this.tilesWanted[i].y == this.tilesDrawn[j].y && this.tilesWanted[i].z == this.tilesDrawn[j].z && this.tilesWanted[i].isLODTile == this.tilesDrawn[j].isLODTile && this.tilesWanted[i].LODLevel == this.tilesDrawn[j].LODLevel && this.tilesDrawn[j].outdated != true) {\n matched = true;\n break;\n }\n }\n\n for (var j = 0; j < this.tilesToBeDrawn.length; j++) {\n if (this.tilesWanted[i].x == this.tilesToBeDrawn[j].x && this.tilesWanted[i].y == this.tilesToBeDrawn[j].y && this.tilesWanted[i].z == this.tilesToBeDrawn[j].z && this.tilesWanted[i].isLODTile == this.tilesToBeDrawn[j].isLODTile && this.tilesWanted[i].LODLevel == this.tilesToBeDrawn[j].LODLevel) {\n matched = true;\n break;\n }\n }\n\n if (!matched) {\n this.tilesToBeDrawn.push(this.tilesWanted[i]);\n }\n }\n\n if (this.tilesToBeDrawn.length > 0) {\n var failCallback_1 = function () {\n if (_this.tilesToBeDrawn.length > 0) {\n _this.addTile(_this.tilesToBeDrawn.pop(), failCallback_1).catch(function () {\n failCallback_1();\n });\n }\n };\n\n this.addTile(this.tilesToBeDrawn.pop(), failCallback_1).catch(function () {\n failCallback_1();\n });\n }\n\n if (this.tilesToBeDrawn.length == 0 && this.tilesBeingDrawn.length == 0 || false && false) {\n for (var i = 0; i < this.tilesDrawn.length; i++) {\n var matched = false;\n\n for (var j = 0; j < this.tilesWanted.length; j++) {\n if (this.tilesDrawn[i].x == this.tilesWanted[j].x && this.tilesDrawn[i].y == this.tilesWanted[j].y && this.tilesDrawn[i].z == this.tilesWanted[j].z && this.tilesDrawn[i].isLODTile == this.tilesWanted[j].isLODTile && this.tilesDrawn[i].LODLevel == this.tilesWanted[j].LODLevel) {\n matched = true;\n break;\n }\n }\n\n if (!matched) {\n this.removeTile(i, true);\n }\n }\n\n this.removeAllOutdatedTiles();\n }\n\n if (this.tilesToBeDrawn.length == 0) {\n if (!this.p._.firstLoad) {\n this.p._onFirstLoad();\n }\n }\n\n var spinner = document.getElementById(this.p.options.loadingSpinnerId);\n var percent = document.getElementById(this.p.options.loadingPercentId);\n\n if (this.tilesToBeDrawn.length == 0) {\n if (spinner) spinner.style.opacity = '0';\n } else if (spinner && spinner.style.opacity == '0') {\n spinner.style.opacity = '1';\n }\n\n if (percent) percent.innerHTML = this.tilesToBeDrawn.length;\n this.filterEffects();\n this.fadeInTiles();\n this.fadeOutTiles();\n };\n\n TiledWorld.prototype.updateDesiredTiles = function () {\n this.tilesWanted = [];\n var center = this.p.getCenter();\n var projectedXYZ = this.p.projection.latLngZ2TileXYZ(center.lat, center.lng, this.p.zoom);\n var xCenter = projectedXYZ.x;\n var yCenter = projectedXYZ.y;\n var r = this.p.options.radiusOfTiles;\n var d;\n\n for (var x = xCenter - r + 1; x < xCenter + r; x++) {\n for (var y = yCenter - r + 1; y < yCenter + r; y++) {\n d = Math.pow(x - xCenter, 2) + Math.pow(y - yCenter, 2);\n\n if (d <= r * r) {\n this.tilesWanted.push({\n x: this.p.projection.tileMapResource.proj ? parseInt(x) : _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].mod(x, Math.pow(2, this.p.zoom)),\n y: this.p.projection.tileMapResource.proj ? parseInt(y) : _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].mod(y, Math.pow(2, this.p.zoom)),\n z: this.p.zoom,\n d: d,\n make: true,\n isLODTile: false\n });\n }\n }\n }\n\n var lastZ = null;\n\n if (this.p.options.useLOD) {\n for (var i = 0; i < this.p.options.LOD.length; i++) {\n var lr = this.p.options.LOD[i].radiusOfTiles;\n var z = Math.max(this.p._.minNativeZoom, this.p.zoom - this.p.options.LOD[i].zoomsUp);\n if (z == lastZ) break;\n lastZ = z;\n if (Math.abs(z - this.p.zoom) <= 1) continue;\n projectedXYZ = this.p.projection.latLngZ2TileXYZ(center.lat, center.lng, z);\n xCenter = projectedXYZ.x;\n yCenter = projectedXYZ.y;\n\n for (var x = xCenter - lr + 1; x < xCenter + lr; x++) {\n for (var y = yCenter - lr + 1; y < yCenter + lr; y++) {\n d = Math.pow(x - xCenter, 2) + Math.pow(y - yCenter, 2);\n\n if (d <= lr * lr) {\n this.tilesWanted.push({\n x: this.p.projection.tileMapResource.proj ? parseInt(x) : _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].mod(x, Math.pow(2, z)),\n y: this.p.projection.tileMapResource.proj ? parseInt(y) : _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].mod(y, Math.pow(2, z)),\n z: z,\n d: d,\n make: true,\n isLODTile: true,\n LODLevel: i\n });\n }\n }\n }\n }\n }\n\n this.tilesWanted.sort(function (a, b) {\n return b.d - a.d;\n });\n this.tilesWanted.sort(function (a, b) {\n var aLODLevel = a.isLODTile ? a.LODLevel : -1;\n var bLODLevel = b.isLODTile ? b.LODLevel : -1;\n return bLODLevel - aLODLevel;\n });\n };\n\n TiledWorld.prototype.addTile = function (xyz, failCallback) {\n return __awaiter(this, void 0, void 0, function () {\n var tileLoaded, t, onceTileLoaded, tileGeometry, loadDemTile, layerI, i, heightArr, builtDemPath, errored_1, builtDemPathFallback, builtDemPathFallback;\n\n var _this = this;\n\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (xyz === undefined) return [2];\n tileLoaded = {\n raster: false,\n data: false\n };\n t = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](new three__WEBPACK_IMPORTED_MODULE_1__[\"PlaneBufferGeometry\"](this._.tileDimension, this._.tileDimension, this.p.options.tileResolution - 1, this.p.options.tileResolution - 1), new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n visible: false\n }));\n this.tilesBeingDrawn.push({\n x: xyz.x,\n y: xyz.y,\n z: xyz.z,\n isLODTile: xyz.isLODTile,\n LODLevel: xyz.LODLevel,\n make: xyz.make\n });\n this.tilesDrawn.push({\n x: xyz.x,\n y: xyz.y,\n z: xyz.z,\n isLODTile: xyz.isLODTile,\n LODLevel: xyz.LODLevel,\n t: t,\n contents: [],\n from: {\n dems: [],\n rasters: [],\n data: []\n }\n });\n\n onceTileLoaded = function (destroy) {\n if (destroy) {\n t.geometry.dispose();\n t.material.dispose();\n if (typeof failCallback === 'function') failCallback();\n }\n\n if (tileLoaded.data) {\n var differentZoomTilesToRemove = [];\n\n if (_this.p._.events._.lastZoomDelta <= 2) {\n for (var i = _this.tilesDrawn.length - 1; i >= 0; i--) {\n if (xyz.isLODTile == _this.tilesDrawn[i].isLODTile && xyz.LODLevel == _this.tilesDrawn[i].LODLevel) {\n var drawnXYZ = [_this.tilesDrawn[i].x, _this.tilesDrawn[i].y, _this.tilesDrawn[i].z];\n var thisXYZ = [xyz.x, xyz.y, xyz.z];\n\n if (xyz.z < _this.tilesDrawn[i].z) {\n if (_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].tileIsContained(thisXYZ, drawnXYZ, true)) {\n differentZoomTilesToRemove.push(i);\n }\n } else if (xyz.z > _this.tilesDrawn[i].z) {\n if (_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].tileIsContained(drawnXYZ, thisXYZ)) {\n _this.tilesDrawn[i].contents.push(thisXYZ);\n\n if (_this.tilesDrawn[i].contents.length >= _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].tileContains(drawnXYZ, xyz.z).length) {\n differentZoomTilesToRemove.push(i);\n }\n }\n }\n }\n }\n }\n\n for (var i = _this.tilesBeingDrawn.length - 1; i >= 0; i--) {\n if (_this.tilesBeingDrawn[i].x == xyz.x && _this.tilesBeingDrawn[i].y == xyz.y && _this.tilesBeingDrawn[i].z == xyz.z && _this.tilesBeingDrawn[i].isLODTile == xyz.isLODTile && _this.tilesBeingDrawn[i].LODLevel == xyz.LODLevel) {\n if (_this.tilesBeingDrawn[i].make) {\n if (xyz.isLODTile) {\n _this.p.planetsLOD[xyz.LODLevel].add(t);\n } else {\n _this.p.planet.add(t);\n }\n\n _this.updateRastersForTile(xyz);\n\n differentZoomTilesToRemove.forEach(function (tileI) {\n _this.removeTile(tileI, true);\n });\n } else {\n t.geometry.dispose();\n t.material.dispose();\n\n for (var j = _this.tilesDrawn.length - 1; j >= 0; j--) {\n if (_this.tilesDrawn[j].x == xyz.x && _this.tilesDrawn[j].y == xyz.y && _this.tilesDrawn[j].z == xyz.z && _this.tilesDrawn[i].isLODTile == xyz.isLODTile && _this.tilesDrawn[i].LODLevel == xyz.LODLevel) {\n _this.tilesDrawn.splice(j, 1);\n }\n }\n }\n\n _this.tilesBeingDrawn.splice(i, 1);\n\n return;\n }\n }\n }\n };\n\n tileGeometry = function (heightArr) {\n var cnt = 0;\n var verts = Math.pow(_this.p.options.tileResolution, 2);\n var colors = new Float32Array(verts * 3);\n\n if (heightArr == null) {\n heightArr = new Array(verts).fill(0);\n }\n\n var centerHeight = 0;\n var centerCnt = Math.floor(heightArr.length / 2);\n var counter = 0;\n\n while ((centerHeight == null || centerHeight > _this.p.projection.radiusOfPlanetMajor || centerHeight < -_this.p.projection.radiusOfPlanetMajor) && counter < heightArr.length) {\n centerHeight = heightArr[centerCnt];\n counter++;\n }\n\n var centerP = Math.floor(t.geometry.attributes.position.array.length / 6) * 3;\n var tx = xyz.x + centerP / 3 % _this.p.options.tileResolution / (_this.p.options.tileResolution - 1);\n var ty = xyz.y + Math.floor(centerP / 3 / _this.p.options.tileResolution) / (_this.p.options.tileResolution - 1);\n\n var projectedLL = _this.p.projection.tileXYZ2LatLng(tx, ty, xyz.z);\n\n var tlat = projectedLL.lat;\n var tlon = projectedLL.lng;\n var centerLat = tlat;\n\n var centerPos = _this.p.projection.lonLatToVector3(tlon, tlat, centerHeight * _this.p.options.exaggeration);\n\n t.position.set(centerPos.x, centerPos.y, centerPos.z);\n\n if (t.geometry.attributes.position.array.length / 3 == verts) {\n var height = 0;\n var xyzPos = void 0;\n\n for (var p = 0; p < t.geometry.attributes.position.array.length; p += 3) {\n height = heightArr[cnt] || 0;\n colors[p] = 0;\n colors[p + 1] = 0;\n colors[p + 2] = 0;\n height = Math.min(height, 100000);\n height = Math.max(height, -100000);\n var tx_1 = xyz.x + p / 3 % _this.p.options.tileResolution / (_this.p.options.tileResolution - 1);\n var ty_1 = xyz.y + Math.floor(p / 3 / _this.p.options.tileResolution) / (_this.p.options.tileResolution - 1);\n\n var projectedLL_1 = _this.p.projection.tileXYZ2LatLng(tx_1, ty_1, xyz.z, xyz);\n\n var tlat_1 = projectedLL_1.lat;\n var tlon_1 = projectedLL_1.lng;\n\n if (_this.p.zoom <= _this.p._.zCutOff) {\n if (centerLat > 75 && tlat_1 < -88) {\n tlat_1 = 90;\n } else if (centerLat < -75 && tlat_1 > 88) {\n tlat_1 = -90;\n }\n }\n\n xyzPos = _this.p.projection.lonLatToVector3(tlon_1, tlat_1, height * _this.p.options.exaggeration);\n t.geometry.attributes.position.array[p] = xyzPos.x - centerPos.x;\n t.geometry.attributes.position.array[p + 1] = xyzPos.y - centerPos.y;\n t.geometry.attributes.position.array[p + 2] = xyzPos.z - centerPos.z;\n cnt += 1;\n }\n\n t.geometry.attributes.position.needsUpdate = true;\n t.geometry.computeVertexNormals();\n t.geometry.computeBoundingSphere();\n t.geometry.setAttribute('customColor', new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferAttribute\"](colors, 3));\n tileLoaded.data = true;\n onceTileLoaded();\n }\n };\n\n loadDemTile = false;\n layerI = null;\n\n for (i = this.p.layers.tile.length - 1; i >= 0; i--) {\n if (this.p.layers.tile[i].on && (xyz.z >= this.p.layers.tile[i].minZoom && xyz.z <= this.p.layers.tile[i].maxZoom && _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInExtent(xyz, this.p.layers.tile[i].boundingBox, this.p.projection) || this.p.layers.tile[i].path == '_vectorsastile_')) {\n layerI = i;\n\n if (this.p.layers.tile[i].demPath != undefined) {\n loadDemTile = true;\n break;\n }\n }\n }\n\n heightArr = null;\n if (!(loadDemTile && layerI != null)) return [3, 4];\n builtDemPath = _utils_paths__WEBPACK_IMPORTED_MODULE_4__[\"default\"].buildPath(this.p.layers.tile[layerI].format, this.p.layers.tile[layerI].demPath, xyz, this.p.projection, this.p.options.tileResolution, this.p.options.trueTileResolution, this.p.layers.tile[layerI].demFormatOptions, true);\n if (!builtDemPath) return [3, 3];\n errored_1 = false;\n return [4, Object(_parsers__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.p.options.customParsers, builtDemPath.path, this.p.layers.tile[layerI], builtDemPath.xyz, this.p.options.tileResolution, Math.pow(this.p.options.tileResolution, 2)).catch(function () {\n errored_1 = true;\n })];\n\n case 1:\n heightArr = _a.sent();\n if (!(errored_1 && this.p.options.demFallback != null)) return [3, 3];\n builtDemPathFallback = _utils_paths__WEBPACK_IMPORTED_MODULE_4__[\"default\"].buildPath(this.p.options.demFallback.format, this.p.options.demFallback.demPath, xyz, this.p.projection, this.p.options.tileResolution, this.p.options.trueTileResolution, this.p.layers.tile[layerI].demFormatOptions, true);\n if (!builtDemPathFallback) return [3, 3];\n return [4, Object(_parsers__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.p.options.customParsers, builtDemPathFallback.path, this.p.layers.tile[layerI], builtDemPathFallback.xyz, this.p.options.tileResolution, Math.pow(this.p.options.tileResolution, 2), this.p.options.demFallback.parserType).catch(function () {})];\n\n case 2:\n heightArr = _a.sent();\n _a.label = 3;\n\n case 3:\n tileGeometry(heightArr || null);\n return [3, 7];\n\n case 4:\n if (!(this.p.options.demFallback != null)) return [3, 6];\n builtDemPathFallback = _utils_paths__WEBPACK_IMPORTED_MODULE_4__[\"default\"].buildPath(this.p.options.demFallback.format, this.p.options.demFallback.demPath, xyz, this.p.projection, this.p.options.tileResolution, this.p.options.trueTileResolution, this.p.layers.tile[layerI].demFormatOptions, true);\n if (!builtDemPathFallback) return [3, 6];\n return [4, Object(_parsers__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.p.options.customParsers, builtDemPathFallback.path, this.p.layers.tile[layerI], builtDemPathFallback.xyz, this.p.options.tileResolution, Math.pow(this.p.options.tileResolution, 2), this.p.options.demFallback.parserType).catch(function () {})];\n\n case 5:\n heightArr = _a.sent();\n _a.label = 6;\n\n case 6:\n tileGeometry();\n _a.label = 7;\n\n case 7:\n return [2];\n }\n });\n });\n };\n\n TiledWorld.prototype.findTileDrawnBasedOnUUID = function (uuid) {\n var foundTile = null;\n this.tilesDrawn.forEach(function (tile) {\n if (tile.t.uuid === uuid) {\n foundTile = tile;\n return;\n }\n });\n return foundTile;\n };\n\n TiledWorld.prototype.findTileDrawnBasedOnXYZLOD = function (xyz) {\n var foundTile = null;\n this.tilesDrawn.forEach(function (tile) {\n if (tile.x === xyz.x && tile.y === xyz.y && tile.z === xyz.z && tile.isLODTile === xyz.isLODTile && tile.LODLevel == xyz.LODLevel) {\n foundTile = tile;\n return;\n }\n });\n return foundTile;\n };\n\n TiledWorld.prototype.updateRastersForTile = function (xyz) {\n var _this = this;\n\n var tD = this.findTileDrawnBasedOnXYZLOD(xyz);\n if (tD == null) return;\n var textures = [];\n var tileLayersComplete = new Array(this.p.layers.tile.length).fill(false);\n var clampedLayersComplete = new Array(this.p.layers.clamped.length).fill(false);\n\n var onceTexturesLoaded = function () {\n if (tileLayersComplete.every(Boolean) && (xyz.isLODTile || clampedLayersComplete.every(Boolean))) {\n if (textures.length == 0) {\n tD.t.visible = false;\n return;\n }\n\n textures.sort(function (a, b) {\n return a.i - b.i;\n });\n tD.from.rasters = [];\n var orderingI = 0;\n\n for (var i = 0; i < textures.length; i++) {\n if (textures[i].type == 'tile') {\n tD.from.rasters.push({\n name: textures[i].name,\n type: textures[i].type,\n texture: textures[i].texture,\n opacity: textures[i].opacity,\n isVAT: 0,\n filters: {\n brightness: 1,\n contrast: 1,\n saturation: 1,\n blendCode: 0,\n blend: 0\n },\n i: orderingI\n });\n orderingI++;\n }\n }\n\n for (var i = 0; i < textures.length; i++) {\n if (textures[i].type == 'clamped') {\n tD.from.rasters.push({\n name: textures[i].name,\n type: textures[i].type,\n texture: textures[i].texture,\n opacity: textures[i].opacity,\n isVAT: 1,\n filters: {\n brightness: 1,\n contrast: 1,\n saturation: 1,\n blendCode: 0,\n blend: 0\n },\n i: orderingI\n });\n orderingI++;\n }\n }\n\n tD.t.material = ___WEBPACK_IMPORTED_MODULE_0__[\"Shaders\"].multiTexture(tD.from.rasters);\n\n if (_this.p.options.wireframeMode) {\n tD.t.material = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: 0xffffff,\n wireframe: true\n });\n }\n\n tD.t.material.needsUpdate = true;\n }\n };\n\n var _loop_1 = function (i) {\n if (this_1.p.layers.tile[i].on && tD.z >= this_1.p.layers.tile[i].minZoom && tD.z <= this_1.p.layers.tile[i].maxZoom && _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInExtent({\n x: tD.x,\n y: tD.y,\n z: tD.z\n }, this_1.p.layers.tile[i].boundingBox, this_1.p.projection)) {\n var builtPath_1 = _utils_paths__WEBPACK_IMPORTED_MODULE_4__[\"default\"].buildPath(this_1.p.layers.tile[i].format, this_1.p.layers.tile[i].path, tD, this_1.p.projection, this_1.p.options.trueTileResolution, this_1.p.options.trueTileResolution, this_1.p.layers.tile[i].formatOptions);\n\n if (builtPath_1) {\n ;\n\n (function (i) {\n _this._.loader.load(builtPath_1, function (texture) {\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n if (_this.p.layers.tile[i]) textures.push({\n name: _this.p.layers.tile[i].name,\n type: 'tile',\n texture: texture,\n opacity: _this.p.layers.tile[i].opacity,\n i: i\n });\n tileLayersComplete[i] = true;\n onceTexturesLoaded();\n }, function () {\n console.log('');\n }, function () {\n tileLayersComplete[i] = true;\n onceTexturesLoaded();\n });\n })(i);\n } else {\n tileLayersComplete[i] = true;\n onceTexturesLoaded();\n }\n } else {\n tileLayersComplete[i] = true;\n onceTexturesLoaded();\n }\n };\n\n var this_1 = this;\n\n for (var i = 0; i < this.p.layers.tile.length; i++) {\n _loop_1(i);\n }\n\n if (!xyz.isLODTile) {\n for (var i = 0; i < this.p.layers.clamped.length; i++) {\n if (this.p.layers.clamped[i].on && (this.p.layers.clamped[i].minZoom == null || tD.z >= this.p.layers.clamped[i].minZoom) && (this.p.layers.clamped[i].maxZoom == null || tD.z <= this.p.layers.clamped[i].maxZoom) && (this.p.layers.clamped[i].boundingBox == null || _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInExtent({\n x: tD.x,\n y: tD.y,\n z: tD.z\n }, this.p.layers.clamped[i].boundingBox, this.p.projection))) {\n var clampedTexture = this.p.layers._.layerers.clamped.getClampedTexture(i, {\n x: tD.x,\n y: tD.y,\n z: tD.z\n });\n\n tD.contains = tD.contains || {};\n tD.contains[this.p.layers.clamped[i].name] = clampedTexture.features;\n var texture = new three__WEBPACK_IMPORTED_MODULE_1__[\"CanvasTexture\"](clampedTexture.canvas);\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n if (this.p.layers.clamped[i]) textures.push({\n name: this.p.layers.clamped[i].name,\n type: 'clamped',\n texture: texture,\n opacity: this.p.layers.clamped[i].opacity,\n i: i\n });\n clampedLayersComplete[i] = true;\n onceTexturesLoaded();\n } else {\n clampedLayersComplete[i] = true;\n onceTexturesLoaded();\n }\n }\n }\n };\n\n TiledWorld.prototype.updateClampedRasterForTile = function (tD, layerName) {\n if (this.p.options.wireframeMode || tD.isLODTile) return;\n var clampedLayerI = null;\n\n for (var i = 0; i < this.p.layers.clamped.length; i++) {\n if (this.p.layers.clamped[i].name === layerName) {\n clampedLayerI = i;\n break;\n }\n }\n\n var clampedLayer = clampedLayerI != null ? this.p.layers.clamped[clampedLayerI] : null;\n\n if (clampedLayer && clampedLayer.on && (clampedLayer.minZoom == null || tD.z >= clampedLayer.minZoom) && (clampedLayer.maxZoom == null || tD.z <= clampedLayer.maxZoom) && (clampedLayer.boundingBox == null || _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInExtent({\n x: tD.x,\n y: tD.y,\n z: tD.z\n }, clampedLayer.boundingBox, this.p.projection))) {\n var clampedTexture = this.p.layers._.layerers.clamped.getClampedTexture(clampedLayerI, {\n x: tD.x,\n y: tD.y,\n z: tD.z\n });\n\n tD.contains = tD.contains || {};\n tD.contains[this.p.layers.clamped[clampedLayerI].name] = clampedTexture.features;\n var texture = new three__WEBPACK_IMPORTED_MODULE_1__[\"CanvasTexture\"](clampedTexture.canvas);\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n\n for (var i = 0; i < tD.from.rasters.length; i++) {\n if (tD.from.rasters[i].name === layerName) {\n tD.from.rasters[i].texture = texture;\n break;\n }\n }\n\n tD.t.material = ___WEBPACK_IMPORTED_MODULE_0__[\"Shaders\"].multiTexture(tD.from.rasters);\n tD.t.material.needsUpdate = true;\n }\n };\n\n TiledWorld.prototype.updateAllRasters = function () {\n this.killDrawingTiles();\n var startingLength = this.tilesDrawn.length;\n\n for (var j = 0; j < startingLength; j++) {\n var tD = this.tilesDrawn[j];\n this.updateRastersForTile({\n x: tD.x,\n y: tD.y,\n z: tD.z,\n isLODTile: tD.isLODTile,\n LODLevel: tD.LODLevel\n });\n }\n };\n\n TiledWorld.prototype.removeTile = function (i, shouldFadeOut) {\n shouldFadeOut = false;\n\n if (this.tilesDrawn[i]) {\n if (shouldFadeOut) {\n this.tilesDrawn[i].fadeOutAndRemove = true;\n } else {\n this.tilesDrawn[i].t.geometry.dispose();\n this.tilesDrawn[i].t.material.dispose();\n if (this.tilesDrawn[i].isLODTile) this.p.planetsLOD[this.tilesDrawn[i].LODLevel].remove(this.tilesDrawn[i].t);else this.p.planet.remove(this.tilesDrawn[i].t);\n this.tilesDrawn.splice(i, 1);\n }\n }\n };\n\n TiledWorld.prototype.removeAllTiles = function () {\n this.killDrawingTiles();\n\n for (var j = 0; j < this.tilesDrawn.length; j++) {\n this.removeTile(0);\n }\n };\n\n TiledWorld.prototype.outdateAllTiles = function () {\n this.killDrawingTiles();\n this.tilesDrawn.forEach(function (tile) {\n tile.outdated = true;\n });\n };\n\n TiledWorld.prototype.removeAllOutdatedTiles = function () {\n var _this = this;\n\n var outdatedTileIndices = [];\n this.tilesDrawn.forEach(function (t, i) {\n if (t.outdated) outdatedTileIndices.push(i);\n });\n outdatedTileIndices = outdatedTileIndices.sort().reverse();\n outdatedTileIndices.forEach(function (i) {\n _this.removeTile(i);\n });\n };\n\n TiledWorld.prototype.removeTileXYZ = function (xyz) {\n for (var t in this.tilesDrawn) {\n if (this.tilesDrawn[t].x == xyz.x && this.tilesDrawn[t].y == xyz.y && this.tilesDrawn[t].z == xyz.z) {\n this.tilesDrawn[t].t.geometry.dispose();\n this.tilesDrawn[t].t.material.dispose();\n if (this.tilesDrawn[t].isLODTile) this.p.planetsLOD[this.tilesDrawn[t].LODLevel].remove(this.tilesDrawn[t].t);else this.p.planet.remove(this.tilesDrawn[t].t);\n this.tilesDrawn.splice(t, 1);\n }\n }\n };\n\n TiledWorld.prototype.killDrawingTiles = function () {\n for (var t in this.tilesToBeDrawn) {\n this.tilesToBeDrawn[t].make = false;\n }\n\n for (var t in this.tilesBeingDrawn) {\n this.tilesBeingDrawn[t].make = false;\n }\n };\n\n TiledWorld.prototype.filterEffects = function () {\n var _this = this;\n\n var transitionFilters = ['brightness', 'contrast', 'saturation', 'blendCode'];\n\n var _loop_2 = function (m) {\n var _loop_3 = function (n) {\n if (this_2.tilesDrawn[m] && this_2.tilesDrawn[m].t && this_2.tilesDrawn[m].t.material.hasOwnProperty('uniforms')) {\n var layer_1 = this_2.p.layers.getLayerByName(this_2.tilesDrawn[m].from.rasters[n].name);\n\n if (layer_1 && layer_1.filters) {\n transitionFilters.forEach(function (f) {\n var desiredFilter = layer_1.filters[f];\n if (desiredFilter == null) return;\n var currentFilter = _this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value;\n\n if (f == 'blendCode') {\n _this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value = desiredFilter;\n } else if (desiredFilter > currentFilter) {\n _this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value = Math.min(_this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value + 0.1, desiredFilter);\n } else {\n _this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value = Math.max(_this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value - 0.1, desiredFilter);\n }\n });\n }\n }\n };\n\n for (var n in this_2.tilesDrawn[m].from.rasters) {\n _loop_3(n);\n }\n };\n\n var this_2 = this;\n\n for (var m in this.tilesDrawn) {\n _loop_2(m);\n }\n };\n\n TiledWorld.prototype.fadeInTiles = function () {\n for (var m in this.tilesDrawn) {\n if (!this.tilesDrawn[m].fadeOutAndRemove) for (var n in this.tilesDrawn[m].from.rasters) {\n if (this.tilesDrawn[m] && this.tilesDrawn[m].t && this.tilesDrawn[m].t.material.hasOwnProperty('uniforms')) {\n var layer = this.p.layers.getLayerByName(this.tilesDrawn[m].from.rasters[n].name);\n\n if (layer) {\n var desiredOpacity = layer.opacity;\n var currentOpacity = this.tilesDrawn[m].t.material.uniforms['tA' + n].value;\n\n if (desiredOpacity > currentOpacity) {\n this.tilesDrawn[m].t.material.uniforms['tA' + n].value = Math.min(this.tilesDrawn[m].t.material.uniforms['tA' + n].value + 0.1, desiredOpacity);\n } else {\n this.tilesDrawn[m].t.material.uniforms['tA' + n].value = Math.max(this.tilesDrawn[m].t.material.uniforms['tA' + n].value - 0.1, desiredOpacity);\n }\n }\n }\n }\n }\n };\n\n TiledWorld.prototype.fadeOutTiles = function () {\n for (var i = this.tilesDrawn.length - 1; i >= 0; i--) {\n if (this.tilesDrawn[i].fadeOutAndRemove) {\n for (var n = 0; this.tilesDrawn[i] && n < this.tilesDrawn[i].from.rasters.length; n++) {\n if (this.tilesDrawn[i] && this.tilesDrawn[i].t && this.tilesDrawn[i].t.material.hasOwnProperty('uniforms') && this.tilesDrawn[i].t.material.uniforms['tA' + n] != null) {\n var nextOpacity = Math.max(this.tilesDrawn[i].t.material.uniforms['tA' + n].value - 0.1, 0);\n if (nextOpacity <= 0) this.removeTile(i);else {\n this.tilesDrawn[i].t.material.uniforms['tA' + n].value = nextOpacity;\n }\n } else {\n this.removeTile(i);\n }\n }\n }\n }\n };\n\n return TiledWorld;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TiledWorld);\n\n//# sourceURL=webpack://LithoSphere/./src/core/tiledWorld.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ */ \"./src/core/index.ts\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _parsers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parsers */ \"./src/parsers/index.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n/* harmony import */ var _utils_paths__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/paths */ \"./src/utils/paths.ts\");\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nvar __generator = undefined && undefined.__generator || function (thisArg, body) {\n var _ = {\n label: 0,\n sent: function () {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n\n case 7:\n op = _.ops.pop();\n\n _.trys.pop();\n\n continue;\n\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n\n if (t && _.label < t[2]) {\n _.label = t[2];\n\n _.ops.push(op);\n\n break;\n }\n\n if (t[2]) _.ops.pop();\n\n _.trys.pop();\n\n continue;\n }\n\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n};\n\n\n\n\n\n\n\nvar TiledWorld = function () {\n function TiledWorld(parent) {\n this.p = parent;\n\n this._reset();\n }\n\n TiledWorld.prototype._reset = function () {\n this._ = {\n loader: new three__WEBPACK_IMPORTED_MODULE_1__[\"TextureLoader\"](),\n tileDimension: 6\n };\n this.tilesDrawn = [];\n this.tilesWanted = [];\n this.tilesToBeDrawn = [];\n this.tilesBeingDrawn = [];\n };\n\n TiledWorld.prototype.refreshTiles = function () {\n var _this = this;\n\n this.updateDesiredTiles();\n this.tilesToBeDrawn = [];\n\n for (var i = 0; i < this.tilesWanted.length; i++) {\n var matched = false;\n\n for (var j = 0; j < this.tilesDrawn.length; j++) {\n if (this.tilesWanted[i].x == this.tilesDrawn[j].x && this.tilesWanted[i].y == this.tilesDrawn[j].y && this.tilesWanted[i].z == this.tilesDrawn[j].z && this.tilesWanted[i].isLODTile == this.tilesDrawn[j].isLODTile && this.tilesWanted[i].LODLevel == this.tilesDrawn[j].LODLevel && this.tilesDrawn[j].outdated != true) {\n matched = true;\n break;\n }\n }\n\n for (var j = 0; j < this.tilesToBeDrawn.length; j++) {\n if (this.tilesWanted[i].x == this.tilesToBeDrawn[j].x && this.tilesWanted[i].y == this.tilesToBeDrawn[j].y && this.tilesWanted[i].z == this.tilesToBeDrawn[j].z && this.tilesWanted[i].isLODTile == this.tilesToBeDrawn[j].isLODTile && this.tilesWanted[i].LODLevel == this.tilesToBeDrawn[j].LODLevel) {\n matched = true;\n break;\n }\n }\n\n if (!matched) {\n this.tilesToBeDrawn.push(this.tilesWanted[i]);\n }\n }\n\n if (this.tilesToBeDrawn.length > 0) {\n var failCallback_1 = function () {\n if (_this.tilesToBeDrawn.length > 0) {\n _this.addTile(_this.tilesToBeDrawn.pop(), failCallback_1).catch(function () {\n failCallback_1();\n });\n }\n };\n\n this.addTile(this.tilesToBeDrawn.pop(), failCallback_1).catch(function () {\n failCallback_1();\n });\n }\n\n if (this.tilesToBeDrawn.length == 0 && this.tilesBeingDrawn.length == 0 || false && false) {\n for (var i = 0; i < this.tilesDrawn.length; i++) {\n var matched = false;\n\n for (var j = 0; j < this.tilesWanted.length; j++) {\n if (this.tilesDrawn[i].x == this.tilesWanted[j].x && this.tilesDrawn[i].y == this.tilesWanted[j].y && this.tilesDrawn[i].z == this.tilesWanted[j].z && this.tilesDrawn[i].isLODTile == this.tilesWanted[j].isLODTile && this.tilesDrawn[i].LODLevel == this.tilesWanted[j].LODLevel) {\n matched = true;\n break;\n }\n }\n\n if (!matched) {\n this.removeTile(i, true);\n }\n }\n\n this.removeAllOutdatedTiles();\n }\n\n if (this.tilesToBeDrawn.length == 0) {\n if (!this.p._.firstLoad) {\n this.p._onFirstLoad();\n }\n }\n\n var spinner = document.getElementById(this.p.options.loadingSpinnerId);\n var percent = document.getElementById(this.p.options.loadingPercentId);\n\n if (this.tilesToBeDrawn.length == 0) {\n if (spinner) spinner.style.opacity = '0';\n } else if (spinner && spinner.style.opacity == '0') {\n spinner.style.opacity = '1';\n }\n\n if (percent) percent.innerHTML = this.tilesToBeDrawn.length;\n this.filterEffects();\n this.fadeInTiles();\n this.fadeOutTiles();\n };\n\n TiledWorld.prototype.updateDesiredTiles = function () {\n this.tilesWanted = [];\n var center = this.p.getCenter();\n var projectedXYZ = this.p.projection.latLngZ2TileXYZ(center.lat, center.lng, this.p.zoom);\n var xCenter = projectedXYZ.x;\n var yCenter = projectedXYZ.y;\n var r = this.p.options.radiusOfTiles;\n var d;\n\n for (var x = xCenter - r + 1; x < xCenter + r; x++) {\n for (var y = yCenter - r + 1; y < yCenter + r; y++) {\n d = Math.pow(x - xCenter, 2) + Math.pow(y - yCenter, 2);\n\n if (d <= r * r) {\n this.tilesWanted.push({\n x: this.p.projection.tileMapResource.proj ? parseInt(x) : _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].mod(x, Math.pow(2, this.p.zoom)),\n y: this.p.projection.tileMapResource.proj ? parseInt(y) : _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].mod(y, Math.pow(2, this.p.zoom)),\n z: this.p.zoom,\n d: d,\n make: true,\n isLODTile: false\n });\n }\n }\n }\n\n var lastZ = null;\n\n if (this.p.options.useLOD) {\n for (var i = 0; i < this.p.options.LOD.length; i++) {\n var lr = this.p.options.LOD[i].radiusOfTiles;\n var z = Math.max(this.p._.minNativeZoom, this.p.zoom - this.p.options.LOD[i].zoomsUp);\n if (z == lastZ) break;\n lastZ = z;\n if (Math.abs(z - this.p.zoom) <= 1) continue;\n projectedXYZ = this.p.projection.latLngZ2TileXYZ(center.lat, center.lng, z);\n xCenter = projectedXYZ.x;\n yCenter = projectedXYZ.y;\n\n for (var x = xCenter - lr + 1; x < xCenter + lr; x++) {\n for (var y = yCenter - lr + 1; y < yCenter + lr; y++) {\n d = Math.pow(x - xCenter, 2) + Math.pow(y - yCenter, 2);\n\n if (d <= lr * lr) {\n this.tilesWanted.push({\n x: this.p.projection.tileMapResource.proj ? parseInt(x) : _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].mod(x, Math.pow(2, z)),\n y: this.p.projection.tileMapResource.proj ? parseInt(y) : _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].mod(y, Math.pow(2, z)),\n z: z,\n d: d,\n make: true,\n isLODTile: true,\n LODLevel: i\n });\n }\n }\n }\n }\n }\n\n this.tilesWanted.sort(function (a, b) {\n return b.d - a.d;\n });\n this.tilesWanted.sort(function (a, b) {\n var aLODLevel = a.isLODTile ? a.LODLevel : -1;\n var bLODLevel = b.isLODTile ? b.LODLevel : -1;\n return bLODLevel - aLODLevel;\n });\n };\n\n TiledWorld.prototype.addTile = function (xyz, failCallback) {\n return __awaiter(this, void 0, void 0, function () {\n var tileLoaded, t, onceTileLoaded, tileGeometry, loadDemTile, layerI, i, heightArr, builtDemPath, errored_1, builtDemPathFallback, builtDemPathFallback;\n\n var _this = this;\n\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (xyz === undefined) return [2];\n tileLoaded = {\n raster: false,\n data: false\n };\n t = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](new three__WEBPACK_IMPORTED_MODULE_1__[\"PlaneBufferGeometry\"](this._.tileDimension, this._.tileDimension, this.p.options.tileResolution - 1, this.p.options.tileResolution - 1), new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n visible: false\n }));\n this.tilesBeingDrawn.push({\n x: xyz.x,\n y: xyz.y,\n z: xyz.z,\n isLODTile: xyz.isLODTile,\n LODLevel: xyz.LODLevel,\n make: xyz.make\n });\n this.tilesDrawn.push({\n x: xyz.x,\n y: xyz.y,\n z: xyz.z,\n isLODTile: xyz.isLODTile,\n LODLevel: xyz.LODLevel,\n t: t,\n contents: [],\n from: {\n dems: [],\n rasters: [],\n data: []\n }\n });\n\n onceTileLoaded = function (destroy) {\n if (destroy) {\n t.geometry.dispose();\n t.material.dispose();\n if (typeof failCallback === 'function') failCallback();\n }\n\n if (tileLoaded.data) {\n var differentZoomTilesToRemove = [];\n\n if (_this.p._.events._.lastZoomDelta <= 2) {\n for (var i = _this.tilesDrawn.length - 1; i >= 0; i--) {\n if (xyz.isLODTile == _this.tilesDrawn[i].isLODTile && xyz.LODLevel == _this.tilesDrawn[i].LODLevel) {\n var drawnXYZ = [_this.tilesDrawn[i].x, _this.tilesDrawn[i].y, _this.tilesDrawn[i].z];\n var thisXYZ = [xyz.x, xyz.y, xyz.z];\n\n if (xyz.z < _this.tilesDrawn[i].z) {\n if (_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].tileIsContained(thisXYZ, drawnXYZ, true)) {\n differentZoomTilesToRemove.push(i);\n }\n } else if (xyz.z > _this.tilesDrawn[i].z) {\n if (_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].tileIsContained(drawnXYZ, thisXYZ)) {\n _this.tilesDrawn[i].contents.push(thisXYZ);\n\n if (_this.tilesDrawn[i].contents.length >= _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].tileContains(drawnXYZ, xyz.z).length) {\n differentZoomTilesToRemove.push(i);\n }\n }\n }\n }\n }\n }\n\n for (var i = _this.tilesBeingDrawn.length - 1; i >= 0; i--) {\n if (_this.tilesBeingDrawn[i].x == xyz.x && _this.tilesBeingDrawn[i].y == xyz.y && _this.tilesBeingDrawn[i].z == xyz.z && _this.tilesBeingDrawn[i].isLODTile == xyz.isLODTile && _this.tilesBeingDrawn[i].LODLevel == xyz.LODLevel) {\n if (_this.tilesBeingDrawn[i].make) {\n if (xyz.isLODTile) {\n _this.p.planetsLOD[xyz.LODLevel].add(t);\n } else {\n _this.p.planet.add(t);\n }\n\n _this.updateRastersForTile(xyz);\n\n differentZoomTilesToRemove.forEach(function (tileI) {\n _this.removeTile(tileI, true);\n });\n } else {\n t.geometry.dispose();\n t.material.dispose();\n\n for (var j = _this.tilesDrawn.length - 1; j >= 0; j--) {\n if (_this.tilesDrawn[j].x == xyz.x && _this.tilesDrawn[j].y == xyz.y && _this.tilesDrawn[j].z == xyz.z && _this.tilesDrawn[i].isLODTile == xyz.isLODTile && _this.tilesDrawn[i].LODLevel == xyz.LODLevel) {\n _this.tilesDrawn.splice(j, 1);\n }\n }\n }\n\n _this.tilesBeingDrawn.splice(i, 1);\n\n return;\n }\n }\n }\n };\n\n tileGeometry = function (heightArr) {\n var cnt = 0;\n var verts = Math.pow(_this.p.options.tileResolution, 2);\n var colors = new Float32Array(verts * 3);\n\n if (heightArr == null) {\n heightArr = new Array(verts).fill(0);\n }\n\n var centerHeight = 0;\n var centerCnt = Math.floor(heightArr.length / 2);\n var counter = 0;\n\n while ((centerHeight == null || centerHeight > _this.p.projection.radiusOfPlanetMajor || centerHeight < -_this.p.projection.radiusOfPlanetMajor) && counter < heightArr.length) {\n centerHeight = heightArr[centerCnt];\n counter++;\n }\n\n var centerP = Math.floor(t.geometry.attributes.position.array.length / 6) * 3;\n var tx = xyz.x + centerP / 3 % _this.p.options.tileResolution / (_this.p.options.tileResolution - 1);\n var ty = xyz.y + Math.floor(centerP / 3 / _this.p.options.tileResolution) / (_this.p.options.tileResolution - 1);\n\n var projectedLL = _this.p.projection.tileXYZ2LatLng(tx, ty, xyz.z);\n\n var tlat = projectedLL.lat;\n var tlon = projectedLL.lng;\n var centerLat = tlat;\n\n var centerPos = _this.p.projection.lonLatToVector3(tlon, tlat, centerHeight * _this.p.options.exaggeration);\n\n t.position.set(centerPos.x, centerPos.y, centerPos.z);\n\n if (t.geometry.attributes.position.array.length / 3 == verts) {\n var height = 0;\n var xyzPos = void 0;\n\n for (var p = 0; p < t.geometry.attributes.position.array.length; p += 3) {\n height = heightArr[cnt] || 0;\n colors[p] = 0;\n colors[p + 1] = 0;\n colors[p + 2] = 0;\n height = Math.min(height, 100000);\n height = Math.max(height, -100000);\n var tx_1 = xyz.x + p / 3 % _this.p.options.tileResolution / (_this.p.options.tileResolution - 1);\n var ty_1 = xyz.y + Math.floor(p / 3 / _this.p.options.tileResolution) / (_this.p.options.tileResolution - 1);\n\n var projectedLL_1 = _this.p.projection.tileXYZ2LatLng(tx_1, ty_1, xyz.z, xyz);\n\n var tlat_1 = projectedLL_1.lat;\n var tlon_1 = projectedLL_1.lng;\n\n if (_this.p.zoom <= _this.p._.zCutOff) {\n if (centerLat > 75 && tlat_1 < -88) {\n tlat_1 = 90;\n } else if (centerLat < -75 && tlat_1 > 88) {\n tlat_1 = -90;\n }\n }\n\n xyzPos = _this.p.projection.lonLatToVector3(tlon_1, tlat_1, height * _this.p.options.exaggeration);\n t.geometry.attributes.position.array[p] = xyzPos.x - centerPos.x;\n t.geometry.attributes.position.array[p + 1] = xyzPos.y - centerPos.y;\n t.geometry.attributes.position.array[p + 2] = xyzPos.z - centerPos.z;\n cnt += 1;\n }\n\n t.geometry.attributes.position.needsUpdate = true;\n t.geometry.computeVertexNormals();\n t.geometry.computeBoundingSphere();\n t.geometry.setAttribute('customColor', new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferAttribute\"](colors, 3));\n tileLoaded.data = true;\n onceTileLoaded();\n }\n };\n\n loadDemTile = false;\n layerI = null;\n\n for (i = this.p.layers.tile.length - 1; i >= 0; i--) {\n if (this.p.layers.tile[i].on && (xyz.z >= this.p.layers.tile[i].minZoom && xyz.z <= this.p.layers.tile[i].maxZoom && _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInExtent(xyz, this.p.layers.tile[i].boundingBox, this.p.projection) && _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInExtentEN(xyz, this.p.layers.tile[i].boundingBoxEN, this.p.projection) || this.p.layers.tile[i].path == '_vectorsastile_')) {\n layerI = i;\n\n if (this.p.layers.tile[i].demPath != undefined) {\n loadDemTile = true;\n break;\n }\n }\n }\n\n heightArr = null;\n if (!(loadDemTile && layerI != null)) return [3, 4];\n builtDemPath = _utils_paths__WEBPACK_IMPORTED_MODULE_4__[\"default\"].buildPath(this.p.layers.tile[layerI].format, this.p.layers.tile[layerI].demPath, xyz, this.p.projection, this.p.options.tileResolution, this.p.options.trueTileResolution, this.p.layers.tile[layerI].demFormatOptions, true);\n if (!builtDemPath) return [3, 3];\n errored_1 = false;\n return [4, Object(_parsers__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.p.options.customParsers, builtDemPath.path, this.p.layers.tile[layerI], builtDemPath.xyz, this.p.options.tileResolution, Math.pow(this.p.options.tileResolution, 2)).catch(function () {\n errored_1 = true;\n })];\n\n case 1:\n heightArr = _a.sent();\n if (!(errored_1 && this.p.options.demFallback != null)) return [3, 3];\n builtDemPathFallback = _utils_paths__WEBPACK_IMPORTED_MODULE_4__[\"default\"].buildPath(this.p.options.demFallback.format, this.p.options.demFallback.demPath, xyz, this.p.projection, this.p.options.tileResolution, this.p.options.trueTileResolution, this.p.layers.tile[layerI].demFormatOptions, true);\n if (!builtDemPathFallback) return [3, 3];\n return [4, Object(_parsers__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.p.options.customParsers, builtDemPathFallback.path, this.p.layers.tile[layerI], builtDemPathFallback.xyz, this.p.options.tileResolution, Math.pow(this.p.options.tileResolution, 2), this.p.options.demFallback.parserType).catch(function () {})];\n\n case 2:\n heightArr = _a.sent();\n _a.label = 3;\n\n case 3:\n tileGeometry(heightArr || null);\n return [3, 7];\n\n case 4:\n if (!(this.p.options.demFallback != null)) return [3, 6];\n builtDemPathFallback = _utils_paths__WEBPACK_IMPORTED_MODULE_4__[\"default\"].buildPath(this.p.options.demFallback.format, this.p.options.demFallback.demPath, xyz, this.p.projection, this.p.options.tileResolution, this.p.options.trueTileResolution, this.p.layers.tile[layerI].demFormatOptions, true);\n if (!builtDemPathFallback) return [3, 6];\n return [4, Object(_parsers__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.p.options.customParsers, builtDemPathFallback.path, this.p.layers.tile[layerI], builtDemPathFallback.xyz, this.p.options.tileResolution, Math.pow(this.p.options.tileResolution, 2), this.p.options.demFallback.parserType).catch(function () {})];\n\n case 5:\n heightArr = _a.sent();\n _a.label = 6;\n\n case 6:\n tileGeometry();\n _a.label = 7;\n\n case 7:\n return [2];\n }\n });\n });\n };\n\n TiledWorld.prototype.findTileDrawnBasedOnUUID = function (uuid) {\n var foundTile = null;\n this.tilesDrawn.forEach(function (tile) {\n if (tile.t.uuid === uuid) {\n foundTile = tile;\n return;\n }\n });\n return foundTile;\n };\n\n TiledWorld.prototype.findTileDrawnBasedOnXYZLOD = function (xyz) {\n var foundTile = null;\n this.tilesDrawn.forEach(function (tile) {\n if (tile.x === xyz.x && tile.y === xyz.y && tile.z === xyz.z && tile.isLODTile === xyz.isLODTile && tile.LODLevel == xyz.LODLevel) {\n foundTile = tile;\n return;\n }\n });\n return foundTile;\n };\n\n TiledWorld.prototype.updateRastersForTile = function (xyz) {\n var _this = this;\n\n var tD = this.findTileDrawnBasedOnXYZLOD(xyz);\n if (tD == null) return;\n var textures = [];\n var tileLayersComplete = new Array(this.p.layers.tile.length).fill(false);\n var clampedLayersComplete = new Array(this.p.layers.clamped.length).fill(false);\n\n var onceTexturesLoaded = function () {\n if (tileLayersComplete.every(Boolean) && (xyz.isLODTile || clampedLayersComplete.every(Boolean))) {\n if (textures.length == 0) {\n tD.t.visible = false;\n return;\n }\n\n textures.sort(function (a, b) {\n return a.i - b.i;\n });\n tD.from.rasters = [];\n var orderingI = 0;\n\n for (var i = 0; i < textures.length; i++) {\n if (textures[i].type == 'tile') {\n tD.from.rasters.push({\n name: textures[i].name,\n type: textures[i].type,\n texture: textures[i].texture,\n opacity: textures[i].opacity,\n isVAT: 0,\n filters: {\n brightness: 1,\n contrast: 1,\n saturation: 1,\n blendCode: 0,\n blend: 0\n },\n i: orderingI\n });\n orderingI++;\n }\n }\n\n for (var i = 0; i < textures.length; i++) {\n if (textures[i].type == 'clamped') {\n tD.from.rasters.push({\n name: textures[i].name,\n type: textures[i].type,\n texture: textures[i].texture,\n opacity: textures[i].opacity,\n isVAT: 1,\n filters: {\n brightness: 1,\n contrast: 1,\n saturation: 1,\n blendCode: 0,\n blend: 0\n },\n i: orderingI\n });\n orderingI++;\n }\n }\n\n tD.t.material = ___WEBPACK_IMPORTED_MODULE_0__[\"Shaders\"].multiTexture(tD.from.rasters);\n\n if (_this.p.options.wireframeMode) {\n tD.t.material = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: 0xffffff,\n wireframe: true\n });\n }\n\n tD.t.material.needsUpdate = true;\n }\n };\n\n var _loop_1 = function (i) {\n if (this_1.p.layers.tile[i].on && tD.z >= this_1.p.layers.tile[i].minZoom && tD.z <= this_1.p.layers.tile[i].maxZoom && _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInExtent({\n x: tD.x,\n y: tD.y,\n z: tD.z\n }, this_1.p.layers.tile[i].boundingBox, this_1.p.projection)) {\n var builtPath_1 = _utils_paths__WEBPACK_IMPORTED_MODULE_4__[\"default\"].buildPath(this_1.p.layers.tile[i].format, this_1.p.layers.tile[i].path, tD, this_1.p.projection, this_1.p.options.trueTileResolution, this_1.p.options.trueTileResolution, this_1.p.layers.tile[i].formatOptions);\n\n if (builtPath_1) {\n ;\n\n (function (i) {\n _this._.loader.load(builtPath_1, function (texture) {\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n if (_this.p.layers.tile[i]) textures.push({\n name: _this.p.layers.tile[i].name,\n type: 'tile',\n texture: texture,\n opacity: _this.p.layers.tile[i].opacity,\n i: i\n });\n tileLayersComplete[i] = true;\n onceTexturesLoaded();\n }, function () {\n console.log('');\n }, function () {\n tileLayersComplete[i] = true;\n onceTexturesLoaded();\n });\n })(i);\n } else {\n tileLayersComplete[i] = true;\n onceTexturesLoaded();\n }\n } else {\n tileLayersComplete[i] = true;\n onceTexturesLoaded();\n }\n };\n\n var this_1 = this;\n\n for (var i = 0; i < this.p.layers.tile.length; i++) {\n _loop_1(i);\n }\n\n if (!xyz.isLODTile) {\n for (var i = 0; i < this.p.layers.clamped.length; i++) {\n if (this.p.layers.clamped[i].on && (this.p.layers.clamped[i].minZoom == null || tD.z >= this.p.layers.clamped[i].minZoom) && (this.p.layers.clamped[i].maxZoom == null || tD.z <= this.p.layers.clamped[i].maxZoom) && (this.p.layers.clamped[i].boundingBox == null || _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInExtent({\n x: tD.x,\n y: tD.y,\n z: tD.z\n }, this.p.layers.clamped[i].boundingBox, this.p.projection))) {\n var clampedTexture = this.p.layers._.layerers.clamped.getClampedTexture(i, {\n x: tD.x,\n y: tD.y,\n z: tD.z\n });\n\n tD.contains = tD.contains || {};\n tD.contains[this.p.layers.clamped[i].name] = clampedTexture.features;\n var texture = new three__WEBPACK_IMPORTED_MODULE_1__[\"CanvasTexture\"](clampedTexture.canvas);\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n if (this.p.layers.clamped[i]) textures.push({\n name: this.p.layers.clamped[i].name,\n type: 'clamped',\n texture: texture,\n opacity: this.p.layers.clamped[i].opacity,\n i: i\n });\n clampedLayersComplete[i] = true;\n onceTexturesLoaded();\n } else {\n clampedLayersComplete[i] = true;\n onceTexturesLoaded();\n }\n }\n }\n };\n\n TiledWorld.prototype.updateClampedRasterForTile = function (tD, layerName) {\n if (this.p.options.wireframeMode || tD.isLODTile) return;\n var clampedLayerI = null;\n\n for (var i = 0; i < this.p.layers.clamped.length; i++) {\n if (this.p.layers.clamped[i].name === layerName) {\n clampedLayerI = i;\n break;\n }\n }\n\n var clampedLayer = clampedLayerI != null ? this.p.layers.clamped[clampedLayerI] : null;\n\n if (clampedLayer && clampedLayer.on && (clampedLayer.minZoom == null || tD.z >= clampedLayer.minZoom) && (clampedLayer.maxZoom == null || tD.z <= clampedLayer.maxZoom) && (clampedLayer.boundingBox == null || _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInExtent({\n x: tD.x,\n y: tD.y,\n z: tD.z\n }, clampedLayer.boundingBox, this.p.projection))) {\n var clampedTexture = this.p.layers._.layerers.clamped.getClampedTexture(clampedLayerI, {\n x: tD.x,\n y: tD.y,\n z: tD.z\n });\n\n tD.contains = tD.contains || {};\n tD.contains[this.p.layers.clamped[clampedLayerI].name] = clampedTexture.features;\n var texture = new three__WEBPACK_IMPORTED_MODULE_1__[\"CanvasTexture\"](clampedTexture.canvas);\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_1__[\"NearestFilter\"];\n\n for (var i = 0; i < tD.from.rasters.length; i++) {\n if (tD.from.rasters[i].name === layerName) {\n tD.from.rasters[i].texture = texture;\n break;\n }\n }\n\n tD.t.material = ___WEBPACK_IMPORTED_MODULE_0__[\"Shaders\"].multiTexture(tD.from.rasters);\n tD.t.material.needsUpdate = true;\n }\n };\n\n TiledWorld.prototype.updateAllRasters = function () {\n this.killDrawingTiles();\n var startingLength = this.tilesDrawn.length;\n\n for (var j = 0; j < startingLength; j++) {\n var tD = this.tilesDrawn[j];\n this.updateRastersForTile({\n x: tD.x,\n y: tD.y,\n z: tD.z,\n isLODTile: tD.isLODTile,\n LODLevel: tD.LODLevel\n });\n }\n };\n\n TiledWorld.prototype.removeTile = function (i, shouldFadeOut) {\n shouldFadeOut = false;\n\n if (this.tilesDrawn[i]) {\n if (shouldFadeOut) {\n this.tilesDrawn[i].fadeOutAndRemove = true;\n } else {\n this.tilesDrawn[i].t.geometry.dispose();\n this.tilesDrawn[i].t.material.dispose();\n if (this.tilesDrawn[i].isLODTile) this.p.planetsLOD[this.tilesDrawn[i].LODLevel].remove(this.tilesDrawn[i].t);else this.p.planet.remove(this.tilesDrawn[i].t);\n this.tilesDrawn.splice(i, 1);\n }\n }\n };\n\n TiledWorld.prototype.removeAllTiles = function () {\n this.killDrawingTiles();\n\n for (var j = 0; j < this.tilesDrawn.length; j++) {\n this.removeTile(0);\n }\n };\n\n TiledWorld.prototype.outdateAllTiles = function () {\n this.killDrawingTiles();\n this.tilesDrawn.forEach(function (tile) {\n tile.outdated = true;\n });\n };\n\n TiledWorld.prototype.removeAllOutdatedTiles = function () {\n var _this = this;\n\n var outdatedTileIndices = [];\n this.tilesDrawn.forEach(function (t, i) {\n if (t.outdated) outdatedTileIndices.push(i);\n });\n outdatedTileIndices = outdatedTileIndices.sort().reverse();\n outdatedTileIndices.forEach(function (i) {\n _this.removeTile(i);\n });\n };\n\n TiledWorld.prototype.removeTileXYZ = function (xyz) {\n for (var t in this.tilesDrawn) {\n if (this.tilesDrawn[t].x == xyz.x && this.tilesDrawn[t].y == xyz.y && this.tilesDrawn[t].z == xyz.z) {\n this.tilesDrawn[t].t.geometry.dispose();\n this.tilesDrawn[t].t.material.dispose();\n if (this.tilesDrawn[t].isLODTile) this.p.planetsLOD[this.tilesDrawn[t].LODLevel].remove(this.tilesDrawn[t].t);else this.p.planet.remove(this.tilesDrawn[t].t);\n this.tilesDrawn.splice(t, 1);\n }\n }\n };\n\n TiledWorld.prototype.killDrawingTiles = function () {\n for (var t in this.tilesToBeDrawn) {\n this.tilesToBeDrawn[t].make = false;\n }\n\n for (var t in this.tilesBeingDrawn) {\n this.tilesBeingDrawn[t].make = false;\n }\n };\n\n TiledWorld.prototype.filterEffects = function () {\n var _this = this;\n\n var transitionFilters = ['brightness', 'contrast', 'saturation', 'blendCode'];\n\n var _loop_2 = function (m) {\n var _loop_3 = function (n) {\n if (this_2.tilesDrawn[m] && this_2.tilesDrawn[m].t && this_2.tilesDrawn[m].t.material.hasOwnProperty('uniforms')) {\n var layer_1 = this_2.p.layers.getLayerByName(this_2.tilesDrawn[m].from.rasters[n].name);\n\n if (layer_1 && layer_1.filters) {\n transitionFilters.forEach(function (f) {\n var desiredFilter = layer_1.filters[f];\n if (desiredFilter == null) return;\n var currentFilter = _this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value;\n\n if (f == 'blendCode') {\n _this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value = desiredFilter;\n } else if (desiredFilter > currentFilter) {\n _this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value = Math.min(_this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value + 0.1, desiredFilter);\n } else {\n _this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value = Math.max(_this.tilesDrawn[m].t.material.uniforms[\"f\" + f + n].value - 0.1, desiredFilter);\n }\n });\n }\n }\n };\n\n for (var n in this_2.tilesDrawn[m].from.rasters) {\n _loop_3(n);\n }\n };\n\n var this_2 = this;\n\n for (var m in this.tilesDrawn) {\n _loop_2(m);\n }\n };\n\n TiledWorld.prototype.fadeInTiles = function () {\n for (var m in this.tilesDrawn) {\n if (!this.tilesDrawn[m].fadeOutAndRemove) for (var n in this.tilesDrawn[m].from.rasters) {\n if (this.tilesDrawn[m] && this.tilesDrawn[m].t && this.tilesDrawn[m].t.material.hasOwnProperty('uniforms')) {\n var layer = this.p.layers.getLayerByName(this.tilesDrawn[m].from.rasters[n].name);\n\n if (layer) {\n var desiredOpacity = layer.opacity;\n var currentOpacity = this.tilesDrawn[m].t.material.uniforms['tA' + n].value;\n\n if (desiredOpacity > currentOpacity) {\n this.tilesDrawn[m].t.material.uniforms['tA' + n].value = Math.min(this.tilesDrawn[m].t.material.uniforms['tA' + n].value + 0.1, desiredOpacity);\n } else {\n this.tilesDrawn[m].t.material.uniforms['tA' + n].value = Math.max(this.tilesDrawn[m].t.material.uniforms['tA' + n].value - 0.1, desiredOpacity);\n }\n }\n }\n }\n }\n };\n\n TiledWorld.prototype.fadeOutTiles = function () {\n for (var i = this.tilesDrawn.length - 1; i >= 0; i--) {\n if (this.tilesDrawn[i].fadeOutAndRemove) {\n for (var n = 0; this.tilesDrawn[i] && n < this.tilesDrawn[i].from.rasters.length; n++) {\n if (this.tilesDrawn[i] && this.tilesDrawn[i].t && this.tilesDrawn[i].t.material.hasOwnProperty('uniforms') && this.tilesDrawn[i].t.material.uniforms['tA' + n] != null) {\n var nextOpacity = Math.max(this.tilesDrawn[i].t.material.uniforms['tA' + n].value - 0.1, 0);\n if (nextOpacity <= 0) this.removeTile(i);else {\n this.tilesDrawn[i].t.material.uniforms['tA' + n].value = nextOpacity;\n }\n } else {\n this.removeTile(i);\n }\n }\n }\n }\n };\n\n return TiledWorld;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TiledWorld);\n\n//# sourceURL=webpack://LithoSphere/./src/core/tiledWorld.ts?"); /***/ }), @@ -2020,7 +2055,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ___W /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\nvar opacityTimeout = null;\n\nvar ClampedLayerer = function () {\n function ClampedLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == layerObj.name) {\n _this.p.clamped[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.clamped.push(layerObj);\n\n _this.p.clamped.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n if (typeof callback === 'function') callback();\n };\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.preDrawn === true && layerObj.hasOwnProperty('data') || (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && layerObj.hasOwnProperty('minZoom') && layerObj.hasOwnProperty('maxZoom'))) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n if (!layerObj.hasOwnProperty('opacity')) layerObj.opacity = 1;\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for clamped layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid clamped layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.clamped.forEach(function (layer) {\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.updateAllRasters();\n\n return true;\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.clamped[i];\n\n if (name === layer.name) {\n clearTimeout(opacityTimeout);\n opacityTimeout = setTimeout(function () {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n\n if (_this.p.p.zoom >= layer.minZoom && _this.p.p.zoom <= layer.maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n }, 250);\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == name) {\n var minZoom = _this.p.clamped[i].minZoom;\n var maxZoom = _this.p.clamped[i].maxZoom;\n\n _this.p.clamped.splice(i, 1);\n\n if (_this.p.p.zoom >= minZoom && _this.p.p.zoom <= maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.getClampedTexture = function (i, xyz) {\n var _a;\n\n var scaleFactor = 0.5;\n var c = _this.p.clamped[i];\n var canvas = document.createElement('canvas');\n canvas.id = 'vectorsastile';\n canvas.width = 256 / scaleFactor;\n scaleFactor = scaleFactor * Math.pow(2, _this.p.p.zoom - xyz.z);\n canvas.height = canvas.width;\n var ctx = canvas.getContext('2d');\n var tileXYZ;\n var overlappedFeatures = [];\n\n if (scaleFactor < 128) {\n if (c.preDrawn) {\n ctx.imageSmoothingEnabled = false;\n\n if (c.data && c.data[xyz.z] && c.data[xyz.z][xyz.x] && c.data[xyz.z][xyz.x][xyz.y] != null) {\n ctx.drawImage(c.data[xyz.z][xyz.x][xyz.y], 0, 0, canvas.width, canvas.height);\n }\n } else {\n for (var _i = 0, _b = c.geojson.features; _i < _b.length; _i++) {\n var f = _b[_i];\n\n var style = _this.p.getFeatureStyle(c, f);\n\n var doesFeatureOverlapTile = false;\n\n if (style.fillColor.substring(0, 3).toLowerCase() != 'rgb') {\n var col = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hexToRGB(style.fillColor);\n\n if (col) {\n style.fillColor = 'rgba(' + col.r + ',' + col.g + ',' + col.b + ',' + style.fillOpacity + ')';\n }\n } else {\n var rgb = style.fillColor.substring(4, style.fillColor.length - 1).replace(/ /g, '').split(',');\n style.fillColor = 'rgba(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ',' + style.fillOpacity + ')';\n }\n\n ctx.fillStyle = style.fillColor;\n ctx.strokeStyle = style.color;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n ctx.globalAlpha = c.opacity;\n ctx.lineCap = 'round';\n style.radius *= 1 / scaleFactor * 1 || 10;\n\n if ((f.geometry.type == 'Polygon' || f.geometry.type == 'MultiPolygon') && f.geometry.coordinates[0]) {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n if (typeof f.geometry.coordinates[p][0][0] === 'number') {\n for (var i_1 = 0; i_1 < f.geometry.coordinates[p].length; i_1++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_1][1], f.geometry.coordinates[p][i_1][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_1 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n } else if (typeof f.geometry.coordinates[p][0][0][0] === 'number') {\n for (var i_2 = 0; i_2 < f.geometry.coordinates[p].length; i_2++) {\n for (var j = 0; j < f.geometry.coordinates[p][i_2].length; j++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_2][j][1], f.geometry.coordinates[p][i_2][j][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (j == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n }\n }\n\n ctx.stroke();\n ctx.closePath();\n ctx.fill();\n }\n } else if (f.geometry.type == 'LineString' || f.geometry.type == 'MultiLineString') {\n if (typeof f.geometry.coordinates[0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][1], f.geometry.coordinates[p][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (p == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n } else if (typeof f.geometry.coordinates[0][0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n for (var i_3 = 0; i_3 < f.geometry.coordinates[p].length; i_3++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_3][1], f.geometry.coordinates[p][i_3][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_3 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n }\n }\n } else if (f.geometry.type.toLowerCase() === 'point') {\n var lnglat = void 0;\n\n if (typeof f.geometry.coordinates[0] === 'number') {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[1], f.geometry.coordinates[0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0],\n lat: f.geometry.coordinates[1]\n };\n } else {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[0][1], f.geometry.coordinates[0][0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0][0],\n lat: f.geometry.coordinates[0][1]\n };\n }\n\n var lnglatRadiusAway = _this.p.p.projection.tileXYZ2LatLng(tileXYZ.x + (style.radius + ctx.lineWidth) / canvas.width, tileXYZ.y, _this.p.p.zoom);\n\n f._radiusInMeters = _this.p.p.projection.lngLatDistBetween(lnglat.lng, lnglat.lat, lnglatRadiusAway.lng, lnglatRadiusAway.lat);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if ((_a = c.style) === null || _a === void 0 ? void 0 : _a.bearing) {\n var unit = c.style.bearing.angleUnit || 'deg';\n var bearingProp = c.style.bearing.angleProp || false;\n var yaw = 0;\n\n if (bearingProp !== false) {\n yaw = parseFloat(_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(f.properties, bearingProp, 0));\n\n if (unit === 'deg') {\n yaw = yaw * (Math.PI / 180);\n }\n }\n\n yaw += Math.PI;\n var startingPoint = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw - 45 * (Math.PI / 180));\n var indicator = [_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius * 2\n }, [canvasX, canvasY], yaw), _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw + 45 * (Math.PI / 180)), startingPoint];\n ctx.fillStyle = c.style.bearing.color || 'red';\n ctx.lineWidth = 1 / scaleFactor * 1;\n ctx.beginPath();\n ctx.moveTo(startingPoint.x, startingPoint.y);\n indicator.forEach(function (ind) {\n ctx.lineTo(ind.x, ind.y);\n });\n ctx.closePath();\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = style.fillColor;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n }\n\n ctx.beginPath();\n ctx.arc(canvasX, canvasY, style.radius, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n if (doesFeatureOverlapTile) {\n f._highlighted = f._highlighted || false;\n overlappedFeatures.push(f);\n }\n }\n }\n }\n\n return {\n canvas: canvas,\n features: overlappedFeatures\n };\n };\n\n this.p = parent;\n }\n\n return ClampedLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ClampedLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/clamped.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\nvar opacityTimeout = null;\n\nvar ClampedLayerer = function () {\n function ClampedLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == layerObj.name) {\n _this.p.clamped[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.clamped.push(layerObj);\n\n _this.p.clamped.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n if (typeof callback === 'function') callback();\n };\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.preDrawn === true && layerObj.hasOwnProperty('data') || (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && layerObj.hasOwnProperty('minZoom') && layerObj.hasOwnProperty('maxZoom'))) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n if (!layerObj.hasOwnProperty('opacity')) layerObj.opacity = 1;\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for clamped layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid clamped layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.clamped.forEach(function (layer) {\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.updateAllRasters();\n\n return true;\n }\n\n return false;\n };\n\n this.orderLayers = function (ordering) {\n var missingCount = 0;\n\n _this.p.clamped.forEach(function (layer) {\n var newOrder = ordering.indexOf(layer.name);\n\n if (newOrder >= 0) {\n layer.order = _this.p.clamped.length - newOrder;\n } else {\n layer.order = _this.p.clamped.length - ordering.length - missingCount;\n missingCount++;\n }\n });\n\n _this.p.clamped.sort(function (a, b) {\n return a.order - b.order;\n });\n\n return true;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.clamped[i];\n\n if (name === layer.name) {\n clearTimeout(opacityTimeout);\n opacityTimeout = setTimeout(function () {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n\n if (_this.p.p.zoom >= layer.minZoom && _this.p.p.zoom <= layer.maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n }, 250);\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == name) {\n var minZoom = _this.p.clamped[i].minZoom;\n var maxZoom = _this.p.clamped[i].maxZoom;\n\n _this.p.clamped.splice(i, 1);\n\n if (_this.p.p.zoom >= minZoom && _this.p.p.zoom <= maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.getClampedTexture = function (i, xyz) {\n var _a;\n\n var scaleFactor = 0.5;\n var c = _this.p.clamped[i];\n var canvas = document.createElement('canvas');\n canvas.id = 'vectorsastile';\n canvas.width = 256 / scaleFactor;\n scaleFactor = scaleFactor * Math.pow(2, _this.p.p.zoom - xyz.z);\n canvas.height = canvas.width;\n var ctx = canvas.getContext('2d');\n var tileXYZ;\n var overlappedFeatures = [];\n\n if (scaleFactor < 128) {\n if (c.preDrawn) {\n ctx.imageSmoothingEnabled = false;\n\n if (c.data && c.data[xyz.z] && c.data[xyz.z][xyz.x] && c.data[xyz.z][xyz.x][xyz.y] != null) {\n ctx.drawImage(c.data[xyz.z][xyz.x][xyz.y], 0, 0, canvas.width, canvas.height);\n }\n } else {\n for (var _i = 0, _b = c.geojson.features; _i < _b.length; _i++) {\n var f = _b[_i];\n\n var style = _this.p.getFeatureStyle(c, f);\n\n var doesFeatureOverlapTile = false;\n\n if (style.fillColor.substring(0, 3).toLowerCase() != 'rgb') {\n var col = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hexToRGB(style.fillColor);\n\n if (col) {\n style.fillColor = 'rgba(' + col.r + ',' + col.g + ',' + col.b + ',' + style.fillOpacity + ')';\n }\n } else {\n var rgb = style.fillColor.substring(4, style.fillColor.length - 1).replace(/ /g, '').split(',');\n style.fillColor = 'rgba(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ',' + style.fillOpacity + ')';\n }\n\n ctx.fillStyle = style.fillColor;\n ctx.strokeStyle = style.color;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n ctx.globalAlpha = c.opacity;\n ctx.lineCap = 'round';\n style.radius *= 1 / scaleFactor * 1 || 10;\n\n if ((f.geometry.type == 'Polygon' || f.geometry.type == 'MultiPolygon') && f.geometry.coordinates[0]) {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n if (typeof f.geometry.coordinates[p][0][0] === 'number') {\n for (var i_1 = 0; i_1 < f.geometry.coordinates[p].length; i_1++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_1][1], f.geometry.coordinates[p][i_1][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_1 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n } else if (typeof f.geometry.coordinates[p][0][0][0] === 'number') {\n for (var i_2 = 0; i_2 < f.geometry.coordinates[p].length; i_2++) {\n for (var j = 0; j < f.geometry.coordinates[p][i_2].length; j++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_2][j][1], f.geometry.coordinates[p][i_2][j][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (j == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n }\n }\n\n ctx.stroke();\n ctx.closePath();\n ctx.fill();\n }\n } else if (f.geometry.type == 'LineString' || f.geometry.type == 'MultiLineString') {\n if (typeof f.geometry.coordinates[0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][1], f.geometry.coordinates[p][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (p == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n } else if (typeof f.geometry.coordinates[0][0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n for (var i_3 = 0; i_3 < f.geometry.coordinates[p].length; i_3++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_3][1], f.geometry.coordinates[p][i_3][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_3 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n }\n }\n } else if (f.geometry.type.toLowerCase() === 'point') {\n var lnglat = void 0;\n\n if (typeof f.geometry.coordinates[0] === 'number') {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[1], f.geometry.coordinates[0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0],\n lat: f.geometry.coordinates[1]\n };\n } else {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[0][1], f.geometry.coordinates[0][0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0][0],\n lat: f.geometry.coordinates[0][1]\n };\n }\n\n var lnglatRadiusAway = _this.p.p.projection.tileXYZ2LatLng(tileXYZ.x + (style.radius + ctx.lineWidth) / canvas.width, tileXYZ.y, _this.p.p.zoom);\n\n f._radiusInMeters = _this.p.p.projection.lngLatDistBetween(lnglat.lng, lnglat.lat, lnglatRadiusAway.lng, lnglatRadiusAway.lat);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (f.properties.annotation === true) {\n var text = f.properties.name || '';\n var fontXOffset = 10;\n var fontSize = style.fontSize || '16px';\n fontSize = parseInt(fontSize.replace('px', '')) * 1.2;\n ctx.font = fontSize + \"pt sans-serif\";\n var heightOverflow = 2;\n var textSize = {\n width: ctx.measureText(text).width + fontXOffset * 2,\n height: fontSize + heightOverflow\n };\n var rotAngle = -(style.rotation || 0) * Math.PI / 180;\n ctx.translate(canvasX, canvasY);\n ctx.rotate(rotAngle);\n ctx.translate(-canvasX, -canvasY);\n ctx.fillStyle = style.color;\n ctx.fillRect(canvasX, canvasY - textSize.height + heightOverflow / 2, textSize.width, textSize.height);\n ctx.fillStyle = style.fillColor;\n ctx.fillText(text, canvasX + fontXOffset, canvasY);\n var anchorRadius = 6;\n ctx.lineWidth = anchorRadius;\n ctx.beginPath();\n ctx.arc(canvasX, canvasY, 8, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n ctx.translate(canvasX, canvasY);\n ctx.rotate(-rotAngle);\n ctx.translate(-canvasX, -canvasY);\n } else {\n if ((_a = c.style) === null || _a === void 0 ? void 0 : _a.bearing) {\n var unit = c.style.bearing.angleUnit || 'deg';\n var bearingProp = c.style.bearing.angleProp || false;\n var yaw = 0;\n\n if (bearingProp !== false) {\n yaw = parseFloat(_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(f.properties, bearingProp, 0));\n\n if (unit === 'deg') {\n yaw = yaw * (Math.PI / 180);\n }\n }\n\n yaw += Math.PI;\n var startingPoint = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw - 45 * (Math.PI / 180));\n var indicator = [_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius * 2\n }, [canvasX, canvasY], yaw), _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw + 45 * (Math.PI / 180)), startingPoint];\n ctx.fillStyle = c.style.bearing.color || 'red';\n ctx.lineWidth = 1 / scaleFactor * 1;\n ctx.beginPath();\n ctx.moveTo(startingPoint.x, startingPoint.y);\n indicator.forEach(function (ind) {\n ctx.lineTo(ind.x, ind.y);\n });\n ctx.closePath();\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = style.fillColor;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n }\n\n ctx.beginPath();\n ctx.arc(canvasX, canvasY, style.radius, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n if (doesFeatureOverlapTile) {\n f._highlighted = f._highlighted || false;\n overlappedFeatures.push(f);\n }\n }\n }\n }\n\n return {\n canvas: canvas,\n features: overlappedFeatures\n };\n };\n\n this.p = parent;\n }\n\n return ClampedLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ClampedLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/clamped.ts?"); /***/ }), @@ -2044,7 +2079,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n/* harmony import */ var _tile3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tile3d */ \"./src/layers/tile3d.ts\");\n/* harmony import */ var _tile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tile */ \"./src/layers/tile.ts\");\n/* harmony import */ var _clamped__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./clamped */ \"./src/layers/clamped.ts\");\n/* harmony import */ var _vector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vector */ \"./src/layers/vector.ts\");\n/* harmony import */ var _curtain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curtain */ \"./src/layers/curtain.ts\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model */ \"./src/layers/model.ts\");\n\n\n\n\n\n\n\n\nvar Layers = function () {\n function Layers(parent) {\n var _this = this;\n\n this.addLayer = function (type, layerObj, callback, sI) {\n if (layerObj.on == 1) layerObj.on = true;else if (layerObj.on == 0) layerObj.on = false;\n layerObj._type = type;\n if (_this._.layerers[type]) _this._.layerers[type].add(layerObj, callback);else console.warn(\"Cannot add unknown layer type \" + type + \".\");\n };\n\n this.removeLayer = function (name) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didRemove = _this._.layerers[type].remove(name);\n\n if (didRemove) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.toggleLayer = function (name, on) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didToggle = _this._.layerers[type].toggle(name, on);\n\n if (didToggle) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerOpacity = function (name, opacity) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didOpacity = _this._.layerers[type].setOpacity(name, parseFloat(opacity));\n\n if (didOpacity) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerFilterEffect = function (name, filter, value) {\n var allowableFilterEffects = ['brightness', 'contrast', 'saturation', 'blendCode'];\n\n if (!allowableFilterEffects.includes(filter)) {\n console.warn(\"Filter \" + filter + \" must be one of: \" + allowableFilterEffects.toString() + \".\");\n return false;\n }\n\n var didFilter = _this._.layerers.tile.setFilterEffect(name, filter, parseFloat(value));\n\n if (!didFilter) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerSpecificOptions = function (name, options) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n if (typeof _this._.layerers[type].setLayerSpecificOptions === 'function') {\n var didOptions = _this._.layerers[type].setLayerSpecificOptions(name, options);\n\n if (didOptions) foundMatch = true;\n }\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.findHighestMaxZoom = function () {\n var highest = 0;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].maxZoom > highest) {\n highest = _this.tile[l].maxZoom;\n }\n }\n\n return highest;\n };\n\n this.findLowestMinZoom = function () {\n var lowest = Infinity;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].minZoom < lowest) {\n lowest = _this.tile[l].minZoom;\n }\n }\n\n return lowest;\n };\n\n this.getFeatureStyleProp = function (value, feature) {\n if (value != null && typeof value === 'string' && value.includes('=')) {\n var propValue = null;\n var split = value.split('=');\n propValue = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, split[1].split('.'));\n return propValue;\n } else {\n return value;\n }\n };\n\n this.getLayerByName = function (layerName) {\n for (var type in _this.all) {\n for (var i = 0; i < _this.all[type].length; i++) {\n if (_this.all[type][i].name === layerName) return _this.all[type][i];\n }\n }\n\n return null;\n };\n\n this.hasLayer = function (layerName) {\n return _this.getLayerByName(layerName) != null;\n };\n\n this.getFeatureStyle = function (layer, feature, isStrokeless) {\n var _a, _b;\n\n var style = JSON.parse(JSON.stringify(_this.baseStyle));\n\n if (layer.style) {\n var geomType = feature.geometry.type.toLowerCase();\n\n for (var key in style) {\n if (layer.style.default && layer.style.default[key] != null) {\n var defaultOverride = _this.getFeatureStyleProp(layer.style.default[key], feature);\n\n style[key] = defaultOverride != null ? defaultOverride : style[key];\n }\n\n if (geomType === 'point' && layer.style.point) {\n var pointOverride = _this.getFeatureStyleProp(layer.style.point[key], feature);\n\n style[key] = pointOverride != null ? pointOverride : style[key];\n } else if (geomType === 'linestring' && layer.style.line) {\n var lineOverride = _this.getFeatureStyleProp(layer.style.line[key], feature);\n\n style[key] = lineOverride != null ? lineOverride : style[key];\n } else if (geomType === 'polygon' && layer.style.polygon) {\n var polygonOverride = _this.getFeatureStyleProp(layer.style.polygon[key], feature);\n\n style[key] = polygonOverride != null ? polygonOverride : style[key];\n }\n\n if (layer.style.byProp) {\n for (var propPath in layer.style.byProp) {\n var path = propPath.split(':')[0].split('=')[1];\n var value = propPath.split(':')[1];\n\n if (_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, path.split('.')) == value) {\n var propOverride = _this.getFeatureStyleProp(layer.style.byProp[propPath][key], feature);\n\n style[key] = propOverride != null ? propOverride : style[key];\n }\n }\n }\n\n if (layer.style.letPropertiesStyleOverride === true) {\n var styleOverride = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn((_a = feature.properties) === null || _a === void 0 ? void 0 : _a.style, key);\n style[key] = styleOverride != null ? styleOverride : style[key];\n }\n }\n }\n\n if (style.fillColor === 'none') style.fillColor = 'rgba(0,0,0,0)';\n var type = ((_b = feature.geometry) === null || _b === void 0 ? void 0 : _b.type) ? feature.geometry.type.toLowerCase() : '';\n\n if (feature._active) {\n if (_this.p.options.canBecomeActive !== false && layer.canBecomeActive !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeActive !== false)) style.fillColor = _this.p.options.activeColor || 'red';\n } else if (feature._highlighted) {\n if (_this.p.options.canBecomeHighlighted !== false && layer.canBecomeHighlighted !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeHighlighted !== false)) style.fillColor = _this.p.options.highlightColor || 'yellow';\n }\n\n if (isStrokeless === true) {\n style.color = style.fillColor;\n }\n\n return style;\n };\n\n this._onMouseMove = function (intersectedLL, e, obj, intersectionRaw, intersectionPoint) {\n var _a;\n\n if (obj.layerType && _this[obj.layerType]) {\n var layers = _this[obj.layerType];\n\n for (var l in layers) {\n if (((_a = obj.parent) === null || _a === void 0 ? void 0 : _a.uuid) === layers[l].curtain.uuid) if (typeof layers[l].onMouseMove === 'function') layers[l].onMouseMove(e, layers[l], obj, intersectionRaw, intersectedLL, intersectionPoint);\n }\n }\n };\n\n this.p = parent;\n this.baseStyle = {\n fillColor: 'rgb(0,0,0)',\n fillOpacity: 0.4,\n color: 'rgb(255,255,255)',\n weight: 2,\n radius: 6\n };\n this._ = {\n layerers: {\n tile3d: new _tile3d__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this),\n tile: new _tile__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this),\n clamped: new _clamped__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this),\n vector: new _vector__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this),\n curtain: new _curtain__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this),\n model: new _model__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this)\n }\n };\n\n this._reset();\n }\n\n Layers.prototype._reset = function () {\n this.tile3d = [];\n this.tile = [];\n this.clamped = [];\n this.vector = [];\n this.curtain = [];\n this.model = [];\n this.all = {\n tile3d: this.tile3d,\n tile: this.tile,\n clamped: this.clamped,\n vector: this.vector,\n curtain: this.curtain,\n model: this.model\n };\n };\n\n return Layers;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Layers);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/index.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n/* harmony import */ var _tile3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tile3d */ \"./src/layers/tile3d.ts\");\n/* harmony import */ var _tile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tile */ \"./src/layers/tile.ts\");\n/* harmony import */ var _clamped__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./clamped */ \"./src/layers/clamped.ts\");\n/* harmony import */ var _vector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vector */ \"./src/layers/vector.ts\");\n/* harmony import */ var _curtain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curtain */ \"./src/layers/curtain.ts\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model */ \"./src/layers/model.ts\");\n\n\n\n\n\n\n\n\nvar Layers = function () {\n function Layers(parent) {\n var _this = this;\n\n this.addLayer = function (type, layerObj, callback, sI) {\n var _a;\n\n if (layerObj.on == 1) layerObj.on = true;else if (layerObj.on == 0) layerObj.on = false;\n layerObj._type = type;\n\n if (((_a = layerObj.order) === null || _a === void 0 ? void 0 : _a.length) != null) {\n layerObj.order = _this.getDesiredOrder(layerObj.name, type, layerObj.order);\n }\n\n if (layerObj.order == null) layerObj.order = _this.all[type].length;\n if (_this._.layerers[type]) _this._.layerers[type].add(layerObj, callback);else console.warn(\"Cannot add unknown layer type \" + type + \".\");\n };\n\n this.removeLayer = function (name) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didRemove = _this._.layerers[type].remove(name);\n\n if (didRemove) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.toggleLayer = function (name, on) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didToggle = _this._.layerers[type].toggle(name, on);\n\n if (didToggle) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.orderLayers = function (ordering) {\n var orderingTyped = {};\n ordering.forEach(function (name) {\n var layer = _this.getLayerByName(name);\n\n if (layer && layer._type) {\n if (orderingTyped[layer._type] == null) orderingTyped[layer._type] = [];\n\n orderingTyped[layer._type].push(name);\n }\n });\n var hit = false;\n\n for (var type in orderingTyped) {\n if (typeof _this._.layerers[type].orderLayers === 'function') {\n _this._.layerers[type].orderLayers(orderingTyped[type]);\n\n hit = true;\n }\n }\n\n if (hit) {\n _this.p._.tiledWorld.removeAllTiles();\n }\n\n return true;\n };\n\n this.getDesiredOrder = function (name, type, ordering) {\n var orderingTyped = {};\n ordering.forEach(function (layerName, idx) {\n var layer = _this.getLayerByName(layerName);\n\n if (layer && layer._type) {\n if (orderingTyped[layer._type] == null) orderingTyped[layer._type] = [];\n\n orderingTyped[layer._type].push({\n name: layer.name,\n order: layer.order,\n index: idx\n });\n }\n });\n\n if (orderingTyped[type]) {\n var index = ordering.indexOf(name);\n var desiredOrder = 0;\n\n for (var i = 0; i < orderingTyped[type].length; i++) {\n if (index > orderingTyped[type][i].index) {\n if (i == orderingTyped[type].length - 1) desiredOrder = orderingTyped[type][i].index + 1;else desiredOrder = (orderingTyped[type][i].order + orderingTyped[type][i + 1].order) / 2;\n return desiredOrder;\n }\n }\n\n if (orderingTyped[type].length > 0) return orderingTyped[type][0].order + 1;\n }\n\n if (ordering.includes(name)) return ordering.length - ordering.indexOf(name) - 1;\n return 0;\n };\n\n this.setLayerOpacity = function (name, opacity) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didOpacity = _this._.layerers[type].setOpacity(name, parseFloat(opacity));\n\n if (didOpacity) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerFilterEffect = function (name, filter, value) {\n var allowableFilterEffects = ['brightness', 'contrast', 'saturation', 'blendCode'];\n\n if (!allowableFilterEffects.includes(filter)) {\n console.warn(\"Filter \" + filter + \" must be one of: \" + allowableFilterEffects.toString() + \".\");\n return false;\n }\n\n var didFilter = _this._.layerers.tile.setFilterEffect(name, filter, parseFloat(value));\n\n if (!didFilter) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerSpecificOptions = function (name, options) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n if (typeof _this._.layerers[type].setLayerSpecificOptions === 'function') {\n var didOptions = _this._.layerers[type].setLayerSpecificOptions(name, options);\n\n if (didOptions) foundMatch = true;\n }\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.findHighestMaxZoom = function () {\n var highest = 0;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].maxZoom > highest) {\n highest = _this.tile[l].maxZoom;\n }\n }\n\n return highest;\n };\n\n this.findLowestMinZoom = function () {\n var lowest = Infinity;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].minZoom < lowest) {\n lowest = _this.tile[l].minZoom;\n }\n }\n\n return lowest;\n };\n\n this.getLayerByName = function (layerName) {\n for (var type in _this.all) {\n for (var i = 0; i < _this.all[type].length; i++) {\n if (_this.all[type][i].name === layerName) return _this.all[type][i];\n }\n }\n\n return null;\n };\n\n this.hasLayer = function (layerName) {\n return _this.getLayerByName(layerName) != null;\n };\n\n this.getFeatureStyleProp = function (value, feature) {\n if (value != null && typeof value === 'string' && value.includes('=')) {\n var propValue = null;\n var split = value.split('=');\n propValue = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, split[1].split('.'));\n return propValue;\n } else {\n return value;\n }\n };\n\n this.getBaseStyle = function (feature) {\n var _a;\n\n var baseStyle = {\n fillColor: 'rgb(0,0,0)',\n fillOpacity: 0.4,\n color: 'rgb(255,255,255)',\n weight: 2,\n radius: 6\n };\n\n if (((_a = feature === null || feature === void 0 ? void 0 : feature.properties) === null || _a === void 0 ? void 0 : _a.annotation) === true) {\n baseStyle.fontSize = '16px';\n baseStyle.rotation = 0;\n }\n\n return baseStyle;\n };\n\n this.getFeatureStyle = function (layer, feature, isStrokeless) {\n var _a, _b;\n\n var style = _this.getBaseStyle(feature);\n\n if (layer.style) {\n var geomType = feature.geometry.type.toLowerCase();\n\n for (var key in style) {\n if (layer.style.default && layer.style.default[key] != null) {\n var defaultOverride = _this.getFeatureStyleProp(layer.style.default[key], feature);\n\n style[key] = defaultOverride != null ? defaultOverride : style[key];\n }\n\n if (geomType === 'point' && layer.style.point) {\n var pointOverride = _this.getFeatureStyleProp(layer.style.point[key], feature);\n\n style[key] = pointOverride != null ? pointOverride : style[key];\n } else if (geomType === 'linestring' && layer.style.line) {\n var lineOverride = _this.getFeatureStyleProp(layer.style.line[key], feature);\n\n style[key] = lineOverride != null ? lineOverride : style[key];\n } else if (geomType === 'polygon' && layer.style.polygon) {\n var polygonOverride = _this.getFeatureStyleProp(layer.style.polygon[key], feature);\n\n style[key] = polygonOverride != null ? polygonOverride : style[key];\n }\n\n if (layer.style.byProp) {\n for (var propPath in layer.style.byProp) {\n var path = propPath.split(':')[0].split('=')[1];\n var value = propPath.split(':')[1];\n\n if (_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, path.split('.')) == value) {\n var propOverride = _this.getFeatureStyleProp(layer.style.byProp[propPath][key], feature);\n\n style[key] = propOverride != null ? propOverride : style[key];\n }\n }\n }\n\n if (layer.style.letPropertiesStyleOverride === true) {\n var styleOverride = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn((_a = feature.properties) === null || _a === void 0 ? void 0 : _a.style, key);\n style[key] = styleOverride != null ? styleOverride : style[key];\n }\n }\n }\n\n if (style.fillColor === 'none') style.fillColor = 'rgba(0,0,0,0)';\n var type = ((_b = feature.geometry) === null || _b === void 0 ? void 0 : _b.type) ? feature.geometry.type.toLowerCase() : '';\n\n if (feature._active) {\n if (_this.p.options.canBecomeActive !== false && layer.canBecomeActive !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeActive !== false)) style.fillColor = _this.p.options.activeColor || 'red';\n } else if (feature._highlighted) {\n if (_this.p.options.canBecomeHighlighted !== false && layer.canBecomeHighlighted !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeHighlighted !== false)) style.fillColor = _this.p.options.highlightColor || 'yellow';\n }\n\n if (isStrokeless === true) {\n style.color = style.fillColor;\n }\n\n return style;\n };\n\n this._onMouseMove = function (intersectedLL, e, obj, intersectionRaw, intersectionPoint) {\n var _a;\n\n if (obj.layerType && _this[obj.layerType]) {\n var layers = _this[obj.layerType];\n\n for (var l in layers) {\n if (((_a = obj.parent) === null || _a === void 0 ? void 0 : _a.uuid) === layers[l].curtain.uuid) if (typeof layers[l].onMouseMove === 'function') layers[l].onMouseMove(e, layers[l], obj, intersectionRaw, intersectedLL, intersectionPoint);\n }\n }\n };\n\n this.p = parent;\n this._ = {\n layerers: {\n tile3d: new _tile3d__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this),\n tile: new _tile__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this),\n clamped: new _clamped__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this),\n vector: new _vector__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this),\n curtain: new _curtain__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this),\n model: new _model__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this)\n }\n };\n\n this._reset();\n }\n\n Layers.prototype._reset = function () {\n this.tile3d = [];\n this.tile = [];\n this.clamped = [];\n this.vector = [];\n this.curtain = [];\n this.model = [];\n this.all = {\n tile3d: this.tile3d,\n tile: this.tile,\n clamped: this.clamped,\n vector: this.vector,\n curtain: this.curtain,\n model: this.model\n };\n };\n\n return Layers;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Layers);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/index.ts?"); /***/ }), @@ -2068,7 +2103,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar TileLayerer = function () {\n function TileLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj) {\n if (!_this.p.p._.wasInitialized) return;\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n var alreadyExists = false;\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && layerObj.hasOwnProperty('path') && layerObj.hasOwnProperty('opacity') && layerObj.hasOwnProperty('minZoom') && layerObj.hasOwnProperty('maxZoom')) {\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == layerObj.name) {\n _this.p.tile[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.tile.push(layerObj);\n\n _this.p.tile.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.removeAllTiles();\n }\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n } else {\n console.warn('Attempted to add an invalid tile layer.');\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.tile.forEach(function (t) {\n if (name === t.name) {\n t.on = on != null ? on : !t.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.outdateAllTiles();\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].opacity = opacity;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.setFilterEffect = function (name, filter, value) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n _this.p.tile[i].filters = _this.p.tile[i].filters || {};\n\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].filters[filter] = value;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (_this.p.p.zoom >= _this.p.tile[i].minZoom && _this.p.p.zoom <= _this.p.tile[i].maxZoom) {\n var startingLength = _this.p.p._.tiledWorld.tilesDrawn.length;\n\n for (var j = 0; j < startingLength; j++) {\n _this.p.p._.tiledWorld.removeTile(0);\n }\n }\n\n _this.p.tile.splice(i, 1);\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.p = parent;\n }\n\n return TileLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TileLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/tile.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar TileLayerer = function () {\n function TileLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj) {\n if (!_this.p.p._.wasInitialized) return;\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n var alreadyExists = false;\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && layerObj.hasOwnProperty('path') && layerObj.hasOwnProperty('opacity') && layerObj.hasOwnProperty('minZoom') && layerObj.hasOwnProperty('maxZoom')) {\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == layerObj.name) {\n _this.p.tile[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.tile.push(layerObj);\n\n _this.p.tile.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.removeAllTiles();\n }\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n } else {\n console.warn('Attempted to add an invalid tile layer.');\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.tile.forEach(function (t) {\n if (name === t.name) {\n t.on = on != null ? on : !t.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.outdateAllTiles();\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n\n return false;\n };\n\n this.orderLayers = function (ordering) {\n var missingCount = 0;\n\n _this.p.tile.forEach(function (layer) {\n var newOrder = ordering.indexOf(layer.name);\n\n if (newOrder >= 0) {\n layer.order = _this.p.tile.length - newOrder;\n } else {\n layer.order = _this.p.tile.length - ordering.length - missingCount;\n missingCount++;\n }\n });\n\n _this.p.tile.sort(function (a, b) {\n return a.order - b.order;\n });\n\n return true;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].opacity = opacity;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.setFilterEffect = function (name, filter, value) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n _this.p.tile[i].filters = _this.p.tile[i].filters || {};\n\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].filters[filter] = value;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (_this.p.p.zoom >= _this.p.tile[i].minZoom && _this.p.p.zoom <= _this.p.tile[i].maxZoom) {\n var startingLength = _this.p.p._.tiledWorld.tilesDrawn.length;\n\n for (var j = 0; j < startingLength; j++) {\n _this.p.p._.tiledWorld.removeTile(0);\n }\n }\n\n _this.p.tile.splice(i, 1);\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.p = parent;\n }\n\n return TileLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TileLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/tile.ts?"); /***/ }), @@ -2092,7 +2127,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _3d_ /***/ (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/* harmony import */ var three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three/examples/jsm/lines/LineGeometry */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/lines/LineMaterial */ \"./node_modules/three/examples/jsm/lines/LineMaterial.js\");\n/* harmony import */ var three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three/examples/jsm/lines/Line2 */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\n/* harmony import */ var _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../secondary/sprites */ \"./src/secondary/sprites.ts\");\n\n\n\n\n\n\nvar VectorLayerer = function () {\n function VectorLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].hasOwnProperty('name')) {\n if (_this.p.vector[i].name == layerObj.name) {\n _this.p.vector[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n var meshes = _this.generateVectors(layerObj);\n\n _this.p.p.planet.add(meshes);\n\n layerObj.meshes = meshes;\n\n _this.p.vector.push(layerObj);\n\n _this.p.vector.sort(function (a, b) {\n return b.order - a.order;\n });\n }\n\n _this.p.p._.events._attenuate();\n\n if (typeof callback === 'function') callback();\n };\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && layerObj.hasOwnProperty('opacity')) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for vector layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid vector layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n layer.meshes.visible = layer.on;\n console.log(layer);\n\n _this.p.p._.events._attenuate();\n\n return true;\n }\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n layer.meshes.children.forEach(function (mesh) {\n mesh.material.opacity = layer.opacity;\n });\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].name === name) {\n _this.p.p.planet.remove(_this.p.vector[i].meshes);\n\n _this.p.vector.splice(i, 1);\n\n return true;\n }\n }\n\n return false;\n };\n\n this.generateVectors = function (layerObj) {\n var vectorGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\n\n if (layerObj.geojson == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has no geojson.\");\n return;\n }\n\n var features = layerObj.geojson.features;\n\n if (features == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has invalid geojson.\");\n return;\n }\n\n var pointType = layerObj.style ? layerObj.style.pointType : '';\n var lineType = layerObj.style ? layerObj.style.lineType : '';\n\n for (var _i = 0, features_1 = features; _i < features_1.length; _i++) {\n var f = features_1[_i];\n var type = f.geometry.type;\n var mesh = null;\n\n switch (type.toLowerCase()) {\n case 'point':\n switch (pointType) {\n case 'sphere':\n break;\n\n default:\n mesh = _this.geomTo.sprite(layerObj, f);\n }\n\n break;\n\n case 'linestring':\n switch (lineType) {\n case 'thin':\n mesh = _this.geomTo.line(layerObj, f);\n break;\n\n default:\n mesh = _this.geomTo.thickLine(layerObj, f);\n }\n\n break;\n\n case 'polygon':\n break;\n\n default:\n console.warn(\"Vector layer: \" + layerObj.name + \" has an unsupported geojson geometry type: \" + type + \".\");\n break;\n }\n\n mesh.feature = f;\n vectorGroup.add(mesh);\n }\n\n if (layerObj.on == false) {\n vectorGroup.visible = false;\n }\n\n return vectorGroup;\n };\n\n this.geomTo = {\n sprite: function (layerObj, feature, forceNewMaterial) {\n var g = feature.geometry.coordinates;\n\n var style = _this.p.getFeatureStyle(layerObj, feature);\n\n var sprite = _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__[\"default\"].makeMarkerSprite(style, layerObj.name, forceNewMaterial);\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n if (typeof g[0] == 'number') g = [g];\n\n var v = _this.p.p.projection.lonLatToVector3(g[0][i0], g[0][i1], (g[0][2] || 0) * _this.p.p.options.exaggeration);\n\n sprite.position.set(v.x, v.y, v.z);\n sprite.renderOrder = layerObj.index;\n\n if (layerObj.on == false) {\n sprite.visible = false;\n }\n\n sprite.layerName = layerObj.name;\n sprite.useKeyAsHoverName = layerObj.useKeyAsHoverName;\n sprite.name = layerObj.name;\n sprite.style = style;\n\n sprite.restyle = function () {\n var newSprite = _this.geomTo.sprite(layerObj, sprite.feature, sprite.feature._highlighted || sprite.feature._active);\n\n sprite.style = newSprite.style;\n sprite.material.dispose();\n sprite.material = newSprite.material;\n sprite.material.map.needsUpdate = true;\n sprite.material.needsUpdate = true;\n };\n\n return sprite;\n },\n line: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n var vertices = [];\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z));\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferGeometry\"]().setFromPoints(vertices);\n var mesh = new three__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](geometry, new three__WEBPACK_IMPORTED_MODULE_0__[\"LineBasicMaterial\"]({\n transparent: true,\n color: style.color\n }));\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n return mesh;\n },\n thickLine: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var path = [];\n var firstPos;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n if (i == 0) {\n firstPos = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z);\n }\n\n path.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x - firstPos.x, v.y - firstPos.y, v.z - firstPos.z));\n if (i != 0 || i != g.length - 1) path.push(path[path.length - 1]);\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var positions = [];\n var spline = new three__WEBPACK_IMPORTED_MODULE_0__[\"CatmullRomCurve3\"](path);\n var divisions = Math.round(1 * path.length);\n\n for (var i = 0, l = divisions; i < l; i++) {\n var point = spline.getPoint(i / l);\n positions.push(point.x, point.y, point.z);\n }\n\n var geometry = new three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__[\"LineGeometry\"]();\n geometry.setPositions(positions);\n var material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n var mesh = new three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__[\"Line2\"](geometry, material);\n mesh.computeLineDistances();\n mesh.position.set(firstPos.x, firstPos.y, firstPos.z);\n mesh.scale.set(1, 1, 1);\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n\n mesh.restyle = function () {\n var style = _this.p.getFeatureStyle(layerObj, mesh.feature, true);\n\n mesh.material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n mesh.strokeColor = style.color;\n };\n\n return mesh;\n }\n };\n this.p = parent;\n this.baseStyle = {\n fillColor: 'rgb(255,255,255)',\n fillOpacity: 0.4,\n color: 'rgb(0,0,0)',\n weight: 2,\n radius: 6\n };\n }\n\n return VectorLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (VectorLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/vector.ts?"); +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/* harmony import */ var three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three/examples/jsm/lines/LineGeometry */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/lines/LineMaterial */ \"./node_modules/three/examples/jsm/lines/LineMaterial.js\");\n/* harmony import */ var three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three/examples/jsm/lines/Line2 */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\n/* harmony import */ var _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../secondary/sprites */ \"./src/secondary/sprites.ts\");\n\n\n\n\n\n\nvar VectorLayerer = function () {\n function VectorLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].hasOwnProperty('name')) {\n if (_this.p.vector[i].name == layerObj.name) {\n _this.p.vector[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n var meshes = _this.generateVectors(layerObj);\n\n _this.p.p.planet.add(meshes);\n\n layerObj.meshes = meshes;\n\n _this.p.vector.push(layerObj);\n\n _this.p.vector.sort(function (a, b) {\n return b.order - a.order;\n });\n }\n\n _this.p.p._.events._attenuate();\n\n if (typeof callback === 'function') callback();\n };\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && layerObj.hasOwnProperty('opacity')) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for vector layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid vector layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n layer.meshes.visible = layer.on;\n console.log(layer);\n\n _this.p.p._.events._attenuate();\n\n return true;\n }\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n layer.meshes.children.forEach(function (mesh) {\n mesh.material.opacity = layer.opacity;\n });\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].name === name) {\n _this.p.p.planet.remove(_this.p.vector[i].meshes);\n\n _this.p.vector.splice(i, 1);\n\n return true;\n }\n }\n\n return false;\n };\n\n this.generateVectors = function (layerObj) {\n var vectorGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\n\n if (layerObj.geojson == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has no geojson.\");\n return;\n }\n\n var features = layerObj.geojson.features;\n\n if (features == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has invalid geojson.\");\n return;\n }\n\n var pointType = layerObj.style ? layerObj.style.pointType : '';\n var lineType = layerObj.style ? layerObj.style.lineType : '';\n\n for (var _i = 0, features_1 = features; _i < features_1.length; _i++) {\n var f = features_1[_i];\n var type = f.geometry.type;\n var mesh = null;\n\n switch (type.toLowerCase()) {\n case 'point':\n switch (pointType) {\n case 'sphere':\n break;\n\n default:\n mesh = _this.geomTo.sprite(layerObj, f);\n }\n\n break;\n\n case 'linestring':\n switch (lineType) {\n case 'thin':\n mesh = _this.geomTo.line(layerObj, f);\n break;\n\n default:\n mesh = _this.geomTo.thickLine(layerObj, f);\n }\n\n break;\n\n case 'polygon':\n break;\n\n default:\n console.warn(\"Vector layer: \" + layerObj.name + \" has an unsupported geojson geometry type: \" + type + \".\");\n break;\n }\n\n mesh.feature = f;\n vectorGroup.add(mesh);\n }\n\n if (layerObj.on == false) {\n vectorGroup.visible = false;\n }\n\n return vectorGroup;\n };\n\n this.geomTo = {\n sprite: function (layerObj, feature, forceNewMaterial) {\n var _a, _b;\n\n var g = feature.geometry.coordinates;\n\n var style = _this.p.getFeatureStyle(layerObj, feature);\n\n var options = {};\n\n if (((_a = feature === null || feature === void 0 ? void 0 : feature.properties) === null || _a === void 0 ? void 0 : _a.annotation) === true) {\n options.annotation = true;\n options.name = (_b = feature === null || feature === void 0 ? void 0 : feature.properties) === null || _b === void 0 ? void 0 : _b.name;\n }\n\n var sprite = _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__[\"default\"].makeMarkerSprite(style, layerObj.name, options, forceNewMaterial);\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n if (typeof g[0] == 'number') g = [g];\n\n var v = _this.p.p.projection.lonLatToVector3(g[0][i0], g[0][i1], (g[0][2] || 0) * _this.p.p.options.exaggeration);\n\n sprite.position.set(v.x, v.y, v.z);\n sprite.renderOrder = layerObj.index;\n\n if (layerObj.on == false) {\n sprite.visible = false;\n }\n\n sprite.layerName = layerObj.name;\n sprite.useKeyAsHoverName = layerObj.useKeyAsHoverName;\n sprite.name = layerObj.name;\n sprite.style = style;\n\n sprite.restyle = function () {\n var newSprite = _this.geomTo.sprite(layerObj, sprite.feature, sprite.feature._highlighted || sprite.feature._active);\n\n sprite.style = newSprite.style;\n sprite.material.dispose();\n sprite.material = newSprite.material;\n sprite.material.map.needsUpdate = true;\n sprite.material.needsUpdate = true;\n };\n\n return sprite;\n },\n line: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n var vertices = [];\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z));\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferGeometry\"]().setFromPoints(vertices);\n var mesh = new three__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](geometry, new three__WEBPACK_IMPORTED_MODULE_0__[\"LineBasicMaterial\"]({\n transparent: true,\n color: style.color\n }));\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n return mesh;\n },\n thickLine: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var path = [];\n var firstPos;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n if (i == 0) {\n firstPos = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z);\n }\n\n path.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x - firstPos.x, v.y - firstPos.y, v.z - firstPos.z));\n if (i != 0 || i != g.length - 1) path.push(path[path.length - 1]);\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var positions = [];\n var spline = new three__WEBPACK_IMPORTED_MODULE_0__[\"CatmullRomCurve3\"](path);\n var divisions = Math.round(1 * path.length);\n\n for (var i = 0, l = divisions; i < l; i++) {\n var point = spline.getPoint(i / l);\n positions.push(point.x, point.y, point.z);\n }\n\n var geometry = new three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__[\"LineGeometry\"]();\n geometry.setPositions(positions);\n var material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n var mesh = new three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__[\"Line2\"](geometry, material);\n mesh.computeLineDistances();\n mesh.position.set(firstPos.x, firstPos.y, firstPos.z);\n mesh.scale.set(1, 1, 1);\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n\n mesh.restyle = function () {\n var style = _this.p.getFeatureStyle(layerObj, mesh.feature, true);\n\n mesh.material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n mesh.strokeColor = style.color;\n };\n\n return mesh;\n }\n };\n this.p = parent;\n }\n\n return VectorLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (VectorLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/vector.ts?"); /***/ }), @@ -2104,7 +2139,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (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 */ \"./src/core/index.ts\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _layers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layers */ \"./src/layers/index.ts\");\n/* harmony import */ var _controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controls */ \"./src/controls/index.ts\");\n/* harmony import */ var _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./secondary/loadingScreen */ \"./src/secondary/loadingScreen.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\n\n\n\n\n\nvar LithoSphere = function () {\n function LithoSphere(containerId, options) {\n var _this = this;\n\n this._animate = function () {\n window.requestAnimationFrame(_this._animate);\n\n _this._render();\n };\n\n this._onFirstLoad = function () {\n _this._.firstLoad = true;\n\n _this._.events._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, {\n x: 0.0001,\n y: 0.0001\n });\n\n _this._.rendererWrapper.updateSize();\n\n setTimeout(function () {\n _this.setCenter(_this.options.initialView, false, true);\n\n _this._.events._onZoom();\n\n _this._.loadingScreen.end();\n }, 100);\n };\n\n this.setCenter = function (latLngZoom, ignoreZoom, accountForHeight) {\n if (!_this._.wasInitialized) return false;\n var rotLat = (90 - (latLngZoom.lat || 0)) * (Math.PI / 180);\n var rotLng = (latLngZoom.lng || 0) * (Math.PI / 180);\n\n _this.planet.rotation.set(rotLat, rotLng, 0);\n\n _this._.events._matchPlanetsLODToPlanet();\n\n if (latLngZoom.zoom != null && ignoreZoom != true) {\n _this.zoom = latLngZoom.zoom;\n\n var center = _this.getCenter(true);\n\n _this._.cameras.orbit.camera.position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.orbit.camera.position.y -= center.height;\n _this._.cameras.firstPerson.controls.getObject().position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.firstPerson.controls.getObject().position.y -= center.height;\n }\n\n _this._.events._refreshFrontGroupRotation();\n\n return true;\n };\n\n this.getCenterXYZ = function (raycasted) {\n if (raycasted) {\n _this._.raycaster.set(new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, _this.planetCenter.y, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 1, 0));\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[0].point.y += _this.planetCenter.y;\n return intersects[0].point;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0);\n } else {\n var centerPoint = {\n x: _this.planetCenter.x,\n y: _this.planetCenter.y,\n z: _this.planetCenter.z\n };\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](centerPoint.x, centerPoint.y, centerPoint.z);\n }\n };\n\n this.getCenter = function (raycasted) {\n var centerXYZ = _this.getCenterXYZ(raycasted);\n\n if (raycasted) {\n var center = JSON.parse(JSON.stringify(centerXYZ));\n center = _this.projection.rotatePoint3D(center, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n center = _this.projection.vector3ToLatLng(center);\n center.height = centerXYZ.length() * _this.projection.radiusScale - _this.projection.radii.major;\n return center;\n }\n\n return _this.projection.vector3ToLatLng(centerXYZ);\n };\n\n this.getCenterElevation = function () {\n return _this.getCenterXYZ(true).length() * _this.projection.radiusScale - _this.projection.radii.major;\n };\n\n this.getCenterElevationRaw = function () {\n var elev = _this.getCenterXYZ(true).length();\n\n if (elev <= 0.1 && elev >= -0.1) return;\n return elev;\n };\n\n this.getElevationAtLngLat = function (lng, lat) {\n var v = _this.projection.lonLatToVector3(lng, lat, 100000 * _this.options.exaggeration);\n\n var tempObj = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n tempObj.position.set(0, -_this.planetCenter.y, 0);\n tempObj.rotation.set(_this.planet.rotation.x, _this.planet.rotation.y, _this.planet.rotation.z);\n var geometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](200, 32, 32);\n var material = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: 0xffff00\n });\n var tempObj2 = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](geometry, material);\n tempObj2.position.set(v.x, v.y, v.z);\n tempObj.add(tempObj2);\n tempObj.updateMatrixWorld();\n var vector = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\n vector.setFromMatrixPosition(tempObj2.matrixWorld);\n\n _this._.raycaster.set(vector, new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -_this.planetCenter.y, 0).normalize());\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[intersects.length - 1].point.y += _this.planetCenter.y;\n return intersects[intersects.length - 1].point.length() * _this.projection.radiusScale - _this.projection.radii.major;\n }\n\n return 0;\n };\n\n this.getCenterTile = function () {\n var centerll = _this.getCenter();\n\n return _this.projection.latLngZ2TileXYZ(centerll.lat, centerll.lng, _this.zoom);\n };\n\n this.getCameras = function () {\n return {\n camera: _this._.cameras.camera,\n isFirstPerson: _this._.cameras.isFirstPerson,\n firstPerson: _this._.cameras.firstPerson,\n orbit: _this._.cameras.orbit\n };\n };\n\n this.getContainer = function () {\n return _this._.container;\n };\n\n this.invalidateSize = function () {\n if (_this._.wasInitialized) {\n _this._.renderer.setSize(_this._.sceneContainer.offsetWidth, _this._.sceneContainer.offsetHeight);\n\n _this._.cameras.updateSize();\n }\n };\n\n var sceneContainer = document.getElementById(containerId).appendChild(document.createElement('div'));\n sceneContainer.id = '_lithosphere_scene';\n sceneContainer.style.width = '100%';\n sceneContainer.style.height = '100%';\n this._ = {\n containerId: containerId,\n container: document.getElementById(containerId),\n sceneContainer: sceneContainer,\n wasInitialized: false,\n rendererWrapper: null,\n renderer: null,\n cameras: null,\n cameraPositionTarget: null,\n tiledWorld: null,\n events: null,\n maxZoom: 0,\n minNativeZoom: 0,\n loader: new three__WEBPACK_IMPORTED_MODULE_1__[\"TextureLoader\"](),\n raycaster: new three__WEBPACK_IMPORTED_MODULE_1__[\"Raycaster\"](),\n updateEveryNthRender: 1,\n counters: {\n update: 0,\n frame: 0\n },\n lastCameraWasFirst: false,\n firstUpdate: true,\n firstLoad: false,\n loadingScreen: null,\n renderOnlyWhenOpen: true,\n zCutOff: 3,\n firstViewOverride: null,\n mouseIsInScene: false,\n marsRadius: 3396190\n };\n this._.container.style.position = 'relative';\n this.scene = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.scenesLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]()];\n this.sceneBack = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.sceneFront = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.planet = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n this.planetsLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]()];\n this.frontGroup = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n var defaultOptions = {\n loadingScreen: true,\n tileMapResource: null,\n customParsers: {},\n radiusOfTiles: 4,\n useLOD: true,\n LOD: [{\n radiusOfTiles: 4,\n zoomsUp: 3\n }, {\n radiusOfTiles: 2,\n zoomsUp: 7\n }, {\n radiusOfTiles: 2,\n zoomsUp: 11\n }],\n tileResolution: 32,\n trueTileResolution: 256,\n showAxes: false,\n wireframeMode: false,\n exaggeration: 1,\n renderOnlyWhenOpen: true,\n targetYOffset: 0,\n highlightColor: 'yellow',\n activeColor: 'red'\n };\n options = options || {};\n this.options = __assign(__assign({}, defaultOptions), options);\n\n this._init();\n }\n\n LithoSphere.prototype._init = function () {\n this._.rendererWrapper = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Renderer\"](this._.sceneContainer);\n this._.renderer = this._.rendererWrapper.renderer;\n\n if (this._.renderer) {\n this._.wasInitialized = true;\n } else return false;\n\n this.projection = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Projection\"](this.options.majorRadius, this.options.minorRadius, this.options.tileMapResource, this.options.trueTileResolution);\n this._.cameras = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Cameras\"](this._.container, this._.sceneContainer, this.scene, this.projection);\n this.layers = new _layers__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this);\n this.addLayer = this.layers.addLayer;\n this.removeLayer = this.layers.removeLayer;\n this.toggleLayer = this.layers.toggleLayer;\n this.setLayerOpacity = this.layers.setLayerOpacity;\n this.setLayerFilterEffect = this.layers.setLayerFilterEffect;\n this.setLayerSpecificOptions = this.layers.setLayerSpecificOptions;\n this.getLayerByName = this.layers.getLayerByName;\n this.hasLayer = this.layers.hasLayer;\n this._.tiledWorld = new _core__WEBPACK_IMPORTED_MODULE_0__[\"TiledWorld\"](this);\n this.zoom = 10;\n this.trueZoom = this.zoom;\n this.mouse = {\n lat: null,\n lng: null,\n elev: null\n };\n this.planetCenter = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -(this.projection.radii.major / this.projection.radiusScale), 0);\n this.planet.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.scene.add(this.planet);\n this.scenesLOD[0].add(this.planetsLOD[0]);\n this.scenesLOD[1].add(this.planetsLOD[1]);\n this.scenesLOD[2].add(this.planetsLOD[2]);\n this.frontGroup.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.sceneFront.add(this.frontGroup);\n this.scene.add(new three__WEBPACK_IMPORTED_MODULE_1__[\"AmbientLight\"](0xfefefe));\n\n if (this.options.starsphere) {\n var starsphereGeometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1000, 64, 64);\n var starsphereMaterial = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: this.options.starsphere.color || 0xaaaaaa\n });\n if (this.options.starsphere.url) starsphereMaterial.map = this._.loader.load(this.options.starsphere.url);\n starsphereMaterial.opacity = 1;\n this.starsphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](starsphereGeometry, starsphereMaterial);\n this.sceneBack.add(this.starsphere);\n }\n\n if (this.options.atmosphere) {\n this.atmosphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1.5, 128, 128), _core__WEBPACK_IMPORTED_MODULE_0__[\"Shaders\"].atmosphere(this.options.atmosphere.color));\n this.sceneBack.add(this.atmosphere);\n }\n\n if (this.options.showAxes === true) {\n var materialx = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0xff0000\n });\n var geometryx = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0 * 2, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](this.planetCenter.y * 2, 0, 0)]);\n var linex = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryx, materialx);\n this.scene.add(linex);\n var materialy = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x00ff00\n });\n var geometryy = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, this.planetCenter.y * 2, 0)]);\n var liney = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryy, materialy);\n this.scene.add(liney);\n var materialz = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x0000ff\n });\n var geometryz = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, this.planetCenter.y * 2)]);\n var linez = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryz, materialz);\n this.scene.add(linez);\n }\n\n this.controls = new _controls__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this);\n this.addControl = this.controls.addControl;\n this.removeControl = this.controls.removeControl;\n\n if (this.options.renderOnlyWhenOpen === false) {\n this._.renderOnlyWhenOpen = false;\n }\n\n this._.loadingScreen = new _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this);\n this._.events = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Events\"](this);\n this.setCenter(this.options.initialView);\n\n this._animate();\n\n return true;\n };\n\n LithoSphere.prototype._render = function () {\n this._.renderer.clear();\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.update = (this._.counters.update + 1) % this._.updateEveryNthRender;\n if (this._.counters.update === 0) this._update();\n if (!this._.cameras.isFirstPerson) this._.cameras.orbit.controls.update();\n this.layers.tile3d.forEach(function (tile3d) {\n tile3d.renderer.update();\n });\n\n this._.renderer.render(this.sceneBack, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[2], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[1], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[0], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scene, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.sceneFront, this._.cameras.camera);\n };\n\n LithoSphere.prototype._update = function () {\n if (!this._.wasInitialized) return;\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.frame = (this._.counters.frame + 1) % 4;\n this.scene.rotation.x = 0;\n this.scene.position.y = 0;\n\n if (!this._.firstUpdate) {\n this._.tiledWorld.refreshTiles();\n }\n\n this._.events._checkDesiredZoom();\n\n this.controls._onUpdateEvent();\n\n if (this._.cameras.isFirstPerson) {\n this._.lastCameraWasFirst = true;\n this._.cameras.firstPerson.controls.getObject().position.y = this._.cameras.orbit.controls.target.y - this._.cameras.firstPerson.height / this.projection.radiusScale;\n\n var v2 = this._.cameras.update();\n\n this._.events._rotateGlobe(v2);\n\n this._.events._onMouseMove();\n\n this.controls._onFirstPersonUpdate();\n } else if (this._.lastCameraWasFirst) {\n this._.lastCameraWasFirst = false;\n\n this.controls._onOrbitalUpdate();\n }\n\n if (this._.firstUpdate) {\n if (this._.firstViewOverride != null) this.setCenter(this._.firstViewOverride);else this.setCenter(this.options.initialView, true);\n var o = this._.cameras.orbit;\n var cam = o.camera;\n var con = o.controls;\n var pos = cam.position;\n var tar = con.target;\n this._.cameraPositionTarget = [pos.x, pos.y, pos.z, tar.x, tar.y, tar.z];\n this._.firstUpdate = false;\n }\n };\n\n return LithoSphere;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LithoSphere);\n\n//# sourceURL=webpack://LithoSphere/./src/lithosphere.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core */ \"./src/core/index.ts\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _layers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layers */ \"./src/layers/index.ts\");\n/* harmony import */ var _controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controls */ \"./src/controls/index.ts\");\n/* harmony import */ var _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./secondary/loadingScreen */ \"./src/secondary/loadingScreen.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\n\n\n\n\n\nvar LithoSphere = function () {\n function LithoSphere(containerId, options) {\n var _this = this;\n\n this._animate = function () {\n window.requestAnimationFrame(_this._animate);\n\n _this._render();\n };\n\n this._onFirstLoad = function () {\n _this._.firstLoad = true;\n\n _this._.events._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, {\n x: 0.0001,\n y: 0.0001\n });\n\n _this._.rendererWrapper.updateSize();\n\n setTimeout(function () {\n _this.setCenter(_this.options.initialView, false, true);\n\n _this._setInitialCameraPositionTarget();\n\n _this._.events._onZoom();\n\n _this._.loadingScreen.end();\n }, 100);\n };\n\n this.setCenter = function (latLngZoom, ignoreZoom, accountForHeight) {\n if (!_this._.wasInitialized) return false;\n var rotLat = (90 - (latLngZoom.lat || 0)) * (Math.PI / 180);\n var rotLng = (latLngZoom.lng || 0) * (Math.PI / 180);\n\n _this.planet.rotation.set(rotLat, rotLng, 0);\n\n _this._.events._matchPlanetsLODToPlanet();\n\n if (latLngZoom.zoom != null && ignoreZoom != true) {\n _this.zoom = latLngZoom.zoom;\n\n var center = _this.getCenter(true);\n\n _this._.cameras.orbit.camera.position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.orbit.camera.position.y -= center.height;\n _this._.cameras.firstPerson.controls.getObject().position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.firstPerson.controls.getObject().position.y -= center.height;\n }\n\n _this._.events._refreshFrontGroupRotation();\n\n return true;\n };\n\n this.getCenterXYZ = function (raycasted) {\n if (raycasted) {\n _this._.raycaster.set(new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, _this.planetCenter.y, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 1, 0));\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[0].point.y += _this.planetCenter.y;\n return intersects[0].point;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0);\n } else {\n var centerPoint = {\n x: _this.planetCenter.x,\n y: _this.planetCenter.y,\n z: _this.planetCenter.z\n };\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](centerPoint.x, centerPoint.y, centerPoint.z);\n }\n };\n\n this.getCenter = function (raycasted) {\n var centerXYZ = _this.getCenterXYZ(raycasted);\n\n if (raycasted) {\n var center = JSON.parse(JSON.stringify(centerXYZ));\n center = _this.projection.rotatePoint3D(center, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n center = _this.projection.vector3ToLatLng(center);\n center.height = (centerXYZ.length() - _this.planet.position.y) / _this.projection.radiusScale;\n return center;\n }\n\n return _this.projection.vector3ToLatLng(centerXYZ);\n };\n\n this.getCenterElevation = function () {\n return (_this.getCenterXYZ(true).length() - _this.planet.position.y) / _this.projection.radiusScale;\n };\n\n this.getCenterElevationRaw = function () {\n var elev = _this.getCenterXYZ(true).length();\n\n if (elev <= 0.1 && elev >= -0.1) return;\n return elev;\n };\n\n this.getElevationAtLngLat = function (lng, lat) {\n var v = _this.projection.lonLatToVector3(lng, lat, 100000 * _this.options.exaggeration);\n\n var tempObj = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n tempObj.position.set(0, -_this.planetCenter.y, 0);\n tempObj.rotation.set(_this.planet.rotation.x, _this.planet.rotation.y, _this.planet.rotation.z);\n var geometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](200, 32, 32);\n var material = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: 0xffff00\n });\n var tempObj2 = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](geometry, material);\n tempObj2.position.set(v.x, v.y, v.z);\n tempObj.add(tempObj2);\n tempObj.updateMatrixWorld();\n var vector = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\n vector.setFromMatrixPosition(tempObj2.matrixWorld);\n\n _this._.raycaster.set(vector, new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -_this.planetCenter.y, 0).normalize());\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[intersects.length - 1].point.y += _this.planetCenter.y;\n return (intersects[intersects.length - 1].point.length() - _this.planet.position.y) / _this.projection.radiusScale;\n }\n\n return 0;\n };\n\n this.getCenterTile = function () {\n var centerll = _this.getCenter();\n\n return _this.projection.latLngZ2TileXYZ(centerll.lat, centerll.lng, _this.zoom);\n };\n\n this.getCameras = function () {\n return {\n camera: _this._.cameras.camera,\n isFirstPerson: _this._.cameras.isFirstPerson,\n firstPerson: _this._.cameras.firstPerson,\n orbit: _this._.cameras.orbit\n };\n };\n\n this._setInitialCameraPositionTarget = function () {\n var o = _this._.cameras.orbit;\n var cam = o.camera;\n var con = o.controls;\n var pos = cam.position;\n var tar = con.target;\n var position = {\n x: pos.x,\n y: pos.y,\n z: pos.z\n };\n var target = {\n x: tar.x,\n y: tar.y,\n z: tar.z\n };\n\n if (_this.options.initialCamera) {\n var iC = _this.options.initialCamera;\n\n if (iC.position) {\n position = {\n x: iC.position.x || position.x,\n y: iC.position.y || position.y,\n z: iC.position.z || position.z\n };\n }\n\n if (iC.target) {\n target = {\n x: iC.target.x || target.x,\n y: iC.target.y || target.y,\n z: iC.target.z || target.z\n };\n }\n\n _this.setCameraPositionTarget(position, target);\n }\n };\n\n this.setCameraPositionTarget = function (position, target) {\n if (position) {\n _this._.cameras.orbit.camera.position.set(position.x || 9, position.y || 0, position.z || 0);\n }\n\n if (target) {\n _this._.cameras.orbit.controls.target.x = target.x || 0;\n _this._.cameras.orbit.controls.target.y = target.y || 0;\n _this._.cameras.orbit.controls.target.z = target.z || 0;\n }\n\n _this._.cameras.orbit.controls.update();\n };\n\n this.getContainer = function () {\n return _this._.container;\n };\n\n this.invalidateSize = function () {\n if (_this._.wasInitialized) {\n _this._.renderer.setSize(_this._.sceneContainer.offsetWidth, _this._.sceneContainer.offsetHeight);\n\n _this._.cameras.updateSize();\n }\n };\n\n var sceneContainer = document.getElementById(containerId).appendChild(document.createElement('div'));\n sceneContainer.id = '_lithosphere_scene';\n sceneContainer.style.width = '100%';\n sceneContainer.style.height = '100%';\n this._ = {\n containerId: containerId,\n container: document.getElementById(containerId),\n sceneContainer: sceneContainer,\n wasInitialized: false,\n rendererWrapper: null,\n renderer: null,\n cameras: null,\n tiledWorld: null,\n events: null,\n maxZoom: 0,\n minNativeZoom: 0,\n loader: new three__WEBPACK_IMPORTED_MODULE_1__[\"TextureLoader\"](),\n raycaster: new three__WEBPACK_IMPORTED_MODULE_1__[\"Raycaster\"](),\n updateEveryNthRender: 1,\n counters: {\n update: 0,\n frame: 0\n },\n lastCameraWasFirst: false,\n firstUpdate: true,\n firstLoad: false,\n loadingScreen: null,\n renderOnlyWhenOpen: true,\n zCutOff: 3,\n firstViewOverride: null,\n mouseIsInScene: false\n };\n this._.container.style.position = 'relative';\n this.scene = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.scenesLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]()];\n this.sceneBack = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.sceneFront = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.planet = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n this.planetsLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]()];\n this.frontGroup = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n var defaultOptions = {\n loadingScreen: true,\n tileMapResource: null,\n customParsers: {},\n radiusOfTiles: 4,\n useLOD: true,\n LOD: [{\n radiusOfTiles: 4,\n zoomsUp: 3\n }, {\n radiusOfTiles: 2,\n zoomsUp: 7\n }, {\n radiusOfTiles: 2,\n zoomsUp: 11\n }],\n tileResolution: 32,\n trueTileResolution: 256,\n showAxes: false,\n wireframeMode: false,\n exaggeration: 1,\n renderOnlyWhenOpen: true,\n targetYOffset: 0,\n highlightColor: 'yellow',\n activeColor: 'red'\n };\n options = options || {};\n this.options = __assign(__assign({}, defaultOptions), options);\n\n this._init();\n }\n\n LithoSphere.prototype._init = function () {\n this._.rendererWrapper = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Renderer\"](this._.sceneContainer);\n this._.renderer = this._.rendererWrapper.renderer;\n\n if (this._.renderer) {\n this._.wasInitialized = true;\n } else return false;\n\n this.projection = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Projection\"](this.options.majorRadius, this.options.minorRadius, this.options.tileMapResource, this.options.trueTileResolution, this.options.radiusCutoff);\n this._.cameras = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Cameras\"](this._.container, this._.sceneContainer, this.scene, this.projection);\n this.layers = new _layers__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this);\n this.addLayer = this.layers.addLayer;\n this.removeLayer = this.layers.removeLayer;\n this.toggleLayer = this.layers.toggleLayer;\n this.orderLayers = this.layers.orderLayers;\n this.setLayerOpacity = this.layers.setLayerOpacity;\n this.setLayerFilterEffect = this.layers.setLayerFilterEffect;\n this.setLayerSpecificOptions = this.layers.setLayerSpecificOptions;\n this.getLayerByName = this.layers.getLayerByName;\n this.hasLayer = this.layers.hasLayer;\n this._.tiledWorld = new _core__WEBPACK_IMPORTED_MODULE_0__[\"TiledWorld\"](this);\n this.zoom = 10;\n this.trueZoom = this.zoom;\n this.mouse = {\n lat: null,\n lng: null,\n elev: null\n };\n this.planetCenter = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -(this.projection.radii.major / this.projection.radiusScale), 0);\n this.planet.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.scene.add(this.planet);\n this.scenesLOD[0].add(this.planetsLOD[0]);\n this.scenesLOD[1].add(this.planetsLOD[1]);\n this.scenesLOD[2].add(this.planetsLOD[2]);\n this.frontGroup.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.sceneFront.add(this.frontGroup);\n this.scene.add(new three__WEBPACK_IMPORTED_MODULE_1__[\"AmbientLight\"](0xfefefe));\n\n if (this.options.starsphere) {\n var starsphereGeometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1000, 64, 64);\n var starsphereMaterial = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: this.options.starsphere.color || 0xaaaaaa\n });\n if (this.options.starsphere.url) starsphereMaterial.map = this._.loader.load(this.options.starsphere.url);\n starsphereMaterial.opacity = 1;\n this.starsphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](starsphereGeometry, starsphereMaterial);\n this.sceneBack.add(this.starsphere);\n }\n\n if (this.options.atmosphere) {\n this.atmosphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1.5, 128, 128), _core__WEBPACK_IMPORTED_MODULE_0__[\"Shaders\"].atmosphere(this.options.atmosphere.color));\n this.sceneBack.add(this.atmosphere);\n }\n\n if (this.options.showAxes === true) {\n var materialx = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0xff0000\n });\n var geometryx = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0 * 2, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](this.planetCenter.y * 2, 0, 0)]);\n var linex = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryx, materialx);\n this.scene.add(linex);\n var materialy = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x00ff00\n });\n var geometryy = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, this.planetCenter.y * 2, 0)]);\n var liney = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryy, materialy);\n this.scene.add(liney);\n var materialz = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x0000ff\n });\n var geometryz = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, this.planetCenter.y * 2)]);\n var linez = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryz, materialz);\n this.scene.add(linez);\n }\n\n this.controls = new _controls__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this);\n this.addControl = this.controls.addControl;\n this.removeControl = this.controls.removeControl;\n\n if (this.options.renderOnlyWhenOpen === false) {\n this._.renderOnlyWhenOpen = false;\n }\n\n this._.loadingScreen = new _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this);\n this._.events = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Events\"](this);\n this.setCenter(this.options.initialView);\n\n this._setInitialCameraPositionTarget();\n\n this._animate();\n\n return true;\n };\n\n LithoSphere.prototype._render = function () {\n this._.renderer.clear();\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.update = (this._.counters.update + 1) % this._.updateEveryNthRender;\n if (this._.counters.update === 0) this._update();\n if (!this._.cameras.isFirstPerson) this._.cameras.orbit.controls.update();\n this.layers.tile3d.forEach(function (tile3d) {\n tile3d.renderer.update();\n });\n\n this._.renderer.render(this.sceneBack, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[2], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[1], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[0], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scene, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.sceneFront, this._.cameras.camera);\n };\n\n LithoSphere.prototype._update = function () {\n if (!this._.wasInitialized) return;\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.frame = (this._.counters.frame + 1) % 4;\n this.scene.rotation.x = 0;\n this.scene.position.y = 0;\n\n if (!this._.firstUpdate) {\n this._.tiledWorld.refreshTiles();\n }\n\n this._.events._checkDesiredZoom();\n\n this.controls._onUpdateEvent();\n\n if (this._.cameras.isFirstPerson) {\n this._.lastCameraWasFirst = true;\n this._.cameras.firstPerson.controls.getObject().position.y = this._.cameras.orbit.controls.target.y - this._.cameras.firstPerson.height / this.projection.radiusScale;\n\n var v2 = this._.cameras.update();\n\n this._.events._rotateGlobe(v2);\n\n this._.events._onMouseMove();\n\n this.controls._onFirstPersonUpdate();\n } else if (this._.lastCameraWasFirst) {\n this._.lastCameraWasFirst = false;\n\n this.controls._onOrbitalUpdate();\n }\n\n if (this._.firstUpdate) {\n if (this._.firstViewOverride != null) this.setCenter(this._.firstViewOverride);else this.setCenter(this.options.initialView, true);\n\n this._setInitialCameraPositionTarget();\n\n this._.firstUpdate = false;\n }\n };\n\n return LithoSphere;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LithoSphere);\n\n//# sourceURL=webpack://LithoSphere/./src/lithosphere.ts?"); /***/ }), @@ -2210,7 +2245,7 @@ eval("function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find mod /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var require;/**\n * Minified by jsDelivr using Terser v5.3.5.\n * Original file: /npm/geotiff@1.0.4/dist-browser/geotiff.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\nparcelRequire=function(e,t,r,n){var i,o=\"function\"==typeof parcelRequire&&parcelRequire,a=\"function\"==typeof require&&require;function s(r,n){if(!t[r]){if(!e[r]){var i=\"function\"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(r,!0);if(o)return o(r,!0);if( true&&\"string\"==typeof r)return __webpack_require__(\"./src/secondary/geotiff sync recursive\")(r);var u=new Error(\"Cannot find module '\"+r+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}f.resolve=function(t){return e[r][1][t]||t},f.cache={};var l=t[r]=new s.Module(r);e[r][0].call(l.exports,f,l,l.exports,this)}return t[r].exports;function f(e){return s(f.resolve(e))}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.exports={}},s.modules=e,s.cache=t,s.parent=o,s.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]};for(var u=0;u=0;--o){var a=this.tryEntries[o],s=a.completion;if(\"root\"===a.tryLoc)return i(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;T(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),p}},e}(\"object\"==typeof t?t.exports:{});try{regeneratorRuntime=n}catch(e){Function(\"r\",\"regeneratorRuntime = r\")(n)}},{}],PMvg:[function(e,t,r){t.exports=e(\"regenerator-runtime\")},{\"regenerator-runtime\":\"QVnC\"}],IxO8:[function(e,t,r){t.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},{}],OUZ9:[function(e,t,r){t.exports=function(e){if(Array.isArray(e))return e}},{}],vKPt:[function(e,t,r){t.exports=function(e,t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},{}],NVR6:[function(e,t,r){t.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>23&511;return a[r]+((8388607&t)>>s[r])},r.convertToNumber=function(e){const t=e>>10;return o[0]=u[f[t]+(1023&e)]+l[t],i[0]};const n=new ArrayBuffer(4),i=new Float32Array(n),o=new Uint32Array(n),a=new Uint32Array(512),s=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(a[0|e]=0,a[256|e]=32768,s[0|e]=24,s[256|e]=24):t<-14?(a[0|e]=1024>>-t-14,a[256|e]=1024>>-t-14|32768,s[0|e]=-t-1,s[256|e]=-t-1):t<=15?(a[0|e]=t+15<<10,a[256|e]=t+15<<10|32768,s[0|e]=13,s[256|e]=13):t<128?(a[0|e]=31744,a[256|e]=64512,s[0|e]=24,s[256|e]=24):(a[0|e]=31744,a[256|e]=64512,s[0|e]=13,s[256|e]=13)}const u=new Uint32Array(2048),l=new Uint32Array(64),f=new Uint32Array(64);u[0]=0;for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;0==(8388608&t);)r-=8388608,t<<=1;t&=-8388609,r+=947912704,u[e]=t|r}for(let e=1024;e<2048;++e)u[e]=939524096+(e-1024<<13);l[0]=0;for(let e=1;e<31;++e)l[e]=e<<23;l[31]=1199570944,l[32]=2147483648;for(let e=33;e<63;++e)l[e]=2147483648+(e-32<<23);l[63]=3347054592,f[0]=0;for(let e=1;e<64;++e)f[e]=32===e?0:1024},{}],G4sf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=function(e){if(e=Number(e),!Number.isFinite(e)||0===e)return e;const t=(0,n.roundToFloat16Bits)(e);return(0,n.convertToNumber)(t)};var n=e(\"./lib\")},{\"./lib\":\"GG94\"}],xQUP:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.ToInteger=function(e){return\"number\"!=typeof e&&(e=Number(e)),Number.isNaN(e)&&(e=0),Math.trunc(e)},r.defaultCompareFunction=function(e,t){const[r,n]=[Number.isNaN(e),Number.isNaN(t)];if(r&&n)return 0;if(r)return 1;if(n)return-1;if(et)return 1;if(0===e&&0===t){const[r,n]=[Object.is(e,0),Object.is(t,0)];if(!r&&n)return-1;if(r&&!n)return 1}return 0}},{}],iJ7y:[function(e,t,r){var n=arguments[3];Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var i=\"object\"==typeof n&&n&&n.Object===Object&&n,o=i;r.default=o},{}],ygki:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof self&&self&&self.Object===Object&&self,o=n.default||i||Function(\"return this\")();r.default=o},{\"./_freeGlobal.js\":\"iJ7y\"}],Oi8n:[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(\"./_root.js\")).default.Symbol;r.default=n},{\"./_root.js\":\"ygki\"}],InRc:[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(\"./_Symbol.js\"));var i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n.default?n.default.toStringTag:void 0;var u=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i};r.default=u},{\"./_Symbol.js\":\"Oi8n\"}],iwg4:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Object.prototype.toString;var i=function(e){return n.call(e)};r.default=i},{}],svpX:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_Symbol.js\")),i=a(e(\"./_getRawTag.js\")),o=a(e(\"./_objectToString.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=n.default?n.default.toStringTag:void 0;var u=function(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":s&&s in Object(e)?(0,i.default)(e):(0,o.default)(e)};r.default=u},{\"./_Symbol.js\":\"Oi8n\",\"./_getRawTag.js\":\"InRc\",\"./_objectToString.js\":\"iwg4\"}],UKR9:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return null!=e&&\"object\"==typeof e};r.default=n},{}],MYZg:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObjectLike.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){return(0,i.default)(e)&&\"[object ArrayBuffer]\"==(0,n.default)(e)};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObjectLike.js\":\"UKR9\"}],pmj6:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return function(t){return e(t)}};r.default=n},{}],oPFz:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof r&&r&&!r.nodeType&&r,o=i&&\"object\"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&n.default.process,s=function(){try{return o&&o.require&&o.require(\"util\").types||a&&a.binding&&a.binding(\"util\")}catch(e){}}();r.default=s},{\"./_freeGlobal.js\":\"iJ7y\"}],rXXV:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_baseIsArrayBuffer.js\")),i=a(e(\"./_baseUnary.js\")),o=a(e(\"./_nodeUtil.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=o.default&&o.default.isArrayBuffer,u=s?(0,i.default)(s):n.default;r.default=u},{\"./_baseIsArrayBuffer.js\":\"MYZg\",\"./_baseUnary.js\":\"pmj6\",\"./_nodeUtil.js\":\"oPFz\"}],XYHx:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.isDataView=function(e){return e instanceof DataView},r.isStringNumberKey=function(e){return\"string\"==typeof e&&e===(0,n.ToInteger)(e)+\"\"},Object.defineProperty(r,\"isArrayBuffer\",{enumerable:!0,get:function(){return i.default}});var n=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,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.createPrivateStorage=function(){const e=new WeakMap;return t=>{let r=e.get(t);return r||(r=Object.create(null),e.set(t,r),r)}}},{}],DTZk:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)};r.default=n},{}],tWvT:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObject.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){if(!(0,i.default)(e))return!1;var t=(0,n.default)(e);return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObject.js\":\"DTZk\"}],xFkS:[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(\"./_root.js\")).default[\"__core-js_shared__\"];r.default=n},{\"./_root.js\":\"ygki\"}],pULC:[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(\"./_coreJsData.js\"));var i=function(){var e=/[^.]+$/.exec(n.default&&n.default.keys&&n.default.keys.IE_PROTO||\"\");return e?\"Symbol(src)_1.\"+e:\"\"}();var o=function(e){return!!i&&i in e};r.default=o},{\"./_coreJsData.js\":\"xFkS\"}],UKJK:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Function.prototype.toString;var i=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"};r.default=i},{}],Zczf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=s(e(\"./isFunction.js\")),i=s(e(\"./_isMasked.js\")),o=s(e(\"./isObject.js\")),a=s(e(\"./_toSource.js\"));function s(e){return e&&e.__esModule?e:{default:e}}var u=/^\\[object .+?Constructor\\]$/,l=Function.prototype,f=Object.prototype,c=l.toString,h=f.hasOwnProperty,d=RegExp(\"^\"+c.call(h).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");var p=function(e){return!(!(0,o.default)(e)||(0,i.default)(e))&&((0,n.default)(e)?d:u).test((0,a.default)(e))};r.default=p},{\"./isFunction.js\":\"tWvT\",\"./_isMasked.js\":\"pULC\",\"./isObject.js\":\"DTZk\",\"./_toSource.js\":\"UKJK\"}],ZVQn:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e,t){return null==e?void 0:e[t]};r.default=n},{}],tx41:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseIsNative.js\")),i=o(e(\"./_getValue.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e,t){var r=(0,i.default)(e,t);return(0,n.default)(r)?r:void 0};r.default=a},{\"./_baseIsNative.js\":\"Zczf\",\"./_getValue.js\":\"ZVQn\"}],YsDH:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=(0,function(e){return e&&e.__esModule?e:{default:e}}(e(\"./_getNative.js\")).default)(Object,\"create\");r.default=n},{\"./_getNative.js\":\"tx41\"}],sJnX:[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(\"./_nativeCreate.js\"));var i=function(){this.__data__=n.default?(0,n.default)(null):{},this.size=0};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],c9sB:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};r.default=n},{}],zYTU:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;if(n.default){var r=t[e];return\"__lodash_hash_undefined__\"===r?void 0:r}return i.call(t,e)?t[e]:void 0};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],ZFwF:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;return n.default?void 0!==t[e]:i.call(t,e)};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],i3LK:[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(\"./_nativeCreate.js\"));var i=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n.default&&void 0===t?\"__lodash_hash_undefined__\":t,this};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],tE4I:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_hashClear.js\")),i=u(e(\"./_hashDelete.js\")),o=u(e(\"./_hashGet.js\")),a=u(e(\"./_hashHas.js\")),s=u(e(\"./_hashSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],GGNI:[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(\"./_assocIndexOf.js\"));var i=function(e,t){var r=this.__data__,i=(0,n.default)(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],UlXa:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_listCacheClear.js\")),i=u(e(\"./_listCacheDelete.js\")),o=u(e(\"./_listCacheGet.js\")),a=u(e(\"./_listCacheHas.js\")),s=u(e(\"./_listCacheSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tf(t)&&function(e){return\"function\"==typeof e&&v.has(e)}(e)?Reflect.apply(e,l(t).target,r):Reflect.apply(e,t,r)},p={get(e,t){let r=null;if(u.isTypedArrayIndexedPropertyWritable||(e=l(r=e).target),(0,i.isStringNumberKey)(t))return Reflect.has(e,t)?(0,s.convertToNumber)(Reflect.get(e,t)):void 0;{const n=null!==r&&Reflect.has(r,t)?Reflect.get(r,t):Reflect.get(e,t);if(\"function\"!=typeof n)return n;let i=l(n).proxy;return void 0===i&&(i=l(n).proxy=new Proxy(n,d)),i}},set(e,t,r){let n=null;return u.isTypedArrayIndexedPropertyWritable||(e=l(n=e).target),(0,i.isStringNumberKey)(t)?Reflect.set(e,t,(0,s.roundToFloat16Bits)(r)):null===n||Reflect.has(e,t)&&!Object.isFrozen(n)?Reflect.set(e,t,r):Reflect.set(n,t,r)}};u.isTypedArrayIndexedPropertyWritable||(p.getPrototypeOf=e=>Reflect.getPrototypeOf(l(e).target),p.setPrototypeOf=(e,t)=>Reflect.setPrototypeOf(l(e).target,t),p.defineProperty=(e,t,r)=>{const n=l(e).target;return!Reflect.has(n,t)||Object.isFrozen(e)?Reflect.defineProperty(e,t,r):Reflect.defineProperty(n,t,r)},p.deleteProperty=(e,t)=>{const r=l(e).target;return Reflect.has(e,t)?Reflect.deleteProperty(e,t):Reflect.deleteProperty(r,t)},p.has=(e,t)=>Reflect.has(e,t)||Reflect.has(l(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 b extends Uint16Array{constructor(e,t,r){if(f(e))super(l(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,r);break;default:super(...arguments)}else{const t=Reflect.has(e,\"length\")||void 0===e[Symbol.iterator]?e:[...e],r=t.length;super(r);for(let e=0;et(r(e),r(n)))),l(this).proxy}slice(...e){let t;c(this);try{t=super.slice(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).slice(...e)}return new b(t.buffer)}subarray(...e){let t;c(this);try{t=super.subarray(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).subarray(...e)}return new b(t.buffer,t.byteOffset,t.length)}indexOf(e,...t){c(this);const r=this.length;let i=(0,n.ToInteger)(t[0]);i<0&&(i+=r)<0&&(i=0);for(let t=i,n=r;t=0?i=i0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error(\"Possible EventEmitter memory leak detected. \"+a.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");s.name=\"MaxListenersExceededWarning\",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function h(){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 d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error(\"Unhandled error.\"+(a?\" (\"+a.message+\")\":\"\"));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if(\"function\"==typeof u)o(u,this,t);else{var l=u.length,f=y(u,l);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);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):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],ExO1:[function(e,t,r){t.exports=e(\"events\").EventEmitter},{events:\"FRpO\"}],yh9p:[function(e,t,r){\"use strict\";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=l(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,c=s>0?a-4:a;for(r=0;r>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+\"==\")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\")),o.join(\"\")};for(var n=[],i=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",s=0,u=a.length;s0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=e.indexOf(\"=\");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],o=t;o>1,f=-7,c=r?i-1:0,h=r?-1:1,d=e[t+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*u-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*b}},{}],REa7:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return\"[object Array]\"==n.call(e)}},{}],dskh:[function(e,t,r){var n=arguments[3],i=e(\"base64-js\"),o=e(\"ieee754\"),a=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 u(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(u()=u())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+u().toString(16)+\" bytes\");return 0|e}function w(e){return+e!=e&&(e=0),f.alloc(+e)}function _(e,t){if(f.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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return Q(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return ee(e).length;default:if(n)return Q(e).length;t=(\"\"+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return F(this,t,r);case\"utf8\":case\"utf-8\":return A(this,t,r);case\"ascii\":return L(this,t,r);case\"latin1\":case\"binary\":return N(this,t,r);case\"base64\":return M(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return U(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function x(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:O(e,t,r,n,i);if(\"number\"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):O(e,[t],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function O(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;hi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError(\"Invalid hex string\");n>o/2&&(n=o/2);for(var a=0;a239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return D(n)}r.Buffer=f,r.SlowBuffer=w,r.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:s(),r.kMaxLength=u(),f.poolSize=8192,f._augment=function(e){return e.__proto__=f.prototype,e},f.from=function(e,t,r){return c(null,e,t,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,\"undefined\"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(e,t,r){return d(null,e,t,r)},f.allocUnsafe=function(e){return p(null,e)},f.allocUnsafeSlow=function(e){return p(null,e)},f.isBuffer=function(e){return!(null==e||!e._isBuffer)},f.compare=function(e,t){if(!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError(\"Arguments must be Buffers\");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString(\"hex\",0,t).match(/.{2}/g).join(\" \"),this.length>t&&(e+=\" ... \")),\"\"},f.prototype.compare=function(e,t,r,n,i){if(!f.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return T(this,e,t,r);case\"utf8\":case\"utf-8\":return E(this,e,t,r);case\"ascii\":return C(this,e,t,r);case\"latin1\":case\"binary\":return P(this,e,t,r);case\"base64\":return j(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return R(this,e,t,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function D(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);for(var r=\"\",n=0;nn)&&(r=n);for(var i=\"\",o=t;or)throw new RangeError(\"Trying to access beyond buffer length\")}function G(e,t,r,n,i,o){if(!f.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 z(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function H(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function W(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function q(e,t,r,n,i){return i||W(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function K(e,t,r,n,i){return i||W(e,0,r,8),o.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},f.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},f.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]},f.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])},f.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},f.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},f.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},f.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]},f.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):H(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):H(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function ee(e){return i.toByteArray(Y(e))}function te(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e){return e!=e}},{\"base64-js\":\"yh9p\",ieee754:\"JgNJ\",isarray:\"REa7\",buffer:\"dskh\"}],VCcH:[function(e,t,r){\"use strict\";function n(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 i(e){for(var t=1;t0?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,r=\"\"+t.data;t=t.next;)r+=e+t.data;return r}},{key:\"concat\",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:\"consume\",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:\"_getBuffer\",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:\"dskh\",util:\"rDCW\"}],pBGv:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error(\"setTimeout has not been defined\")}function s(){throw new Error(\"clearTimeout has not been defined\")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function l(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}!function(){try{n=\"function\"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i=\"function\"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var f,c=[],h=!1,d=-1;function p(){h&&f&&(h=!1,f.length?c=f.concat(c):d=-1,c.length&&b())}function b(){if(!h){var e=u(p);h=!0;for(var t=c.length;t;){for(f=c,c=[];++d1)for(var r=1;r2?\"one of \".concat(t,\" \").concat(e.slice(0,r-1).join(\", \"),\", or \")+e[r-1]:2===r?\"one of \".concat(t,\" \").concat(e[0],\" or \").concat(e[1]):\"of \".concat(t,\" \").concat(e[0])}return\"of \".concat(t,\" \").concat(String(e))}o(\"ERR_INVALID_OPT_VALUE\",(function(e,t){return'The value \"'+t+'\" is invalid for option \"'+e+'\"'}),TypeError),o(\"ERR_INVALID_ARG_TYPE\",(function(e,t,r){var i,o;if(\"string\"==typeof t&&function(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}(t,\"not \")?(i=\"must not be\",t=t.replace(/^not /,\"\")):i=\"must be\",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e,\" argument\"))o=\"The \".concat(e,\" \").concat(i,\" \").concat(a(t,\"type\"));else{var s=function(e,t,r){return\"number\"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,\".\")?\"property\":\"argument\";o='The \"'.concat(e,'\" ').concat(s,\" \").concat(i,\" \").concat(a(t,\"type\"))}return o+\". Received type \".concat(n(r))}),TypeError),o(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),o(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(e){return\"The \"+e+\" method is not implemented\"})),o(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),o(\"ERR_STREAM_DESTROYED\",(function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"})),o(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),o(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),o(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),o(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),o(\"ERR_UNKNOWN_ENCODING\",(function(e){return\"Unknown encoding: \"+e}),TypeError),o(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=i},{}],TWVJ:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:\"highWaterMark\",o);return Math.floor(o)}return e.objectMode?16:16384}}},{\"../../../errors\":\"Yj9o\"}],Bm0n:[function(e,t,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],yM1o:[function(e,t,r){var n=arguments[3];function i(e,t){if(o(\"noDeprecation\"))return e;var r=!1;return function(){if(!r){if(o(\"throwDeprecation\"))throw new Error(t);o(\"traceDeprecation\")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}function o(e){try{if(!n.localStorage)return!1}catch(e){return!1}var t=n.localStorage[e];return null!=t&&\"true\"===String(t).toLowerCase()}t.exports=i},{}],WSyY:[function(e,t,r){e(\"process\");var n,i=arguments[3],o=e(\"process\");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){K(t,e)}}t.exports=P,P.WritableState=C;var s={deprecate:e(\"util-deprecate\")},u=e(\"./internal/streams/stream\"),l=e(\"buffer\").Buffer,f=i.Uint8Array||function(){};function c(e){return l.from(e)}function h(e){return l.isBuffer(e)||e instanceof f}var d,p=e(\"./internal/streams/destroy\"),b=e(\"./internal/streams/state\"),y=b.getHighWaterMark,v=e(\"../errors\").codes,g=v.ERR_INVALID_ARG_TYPE,m=v.ERR_METHOD_NOT_IMPLEMENTED,w=v.ERR_MULTIPLE_CALLBACK,_=v.ERR_STREAM_CANNOT_PIPE,k=v.ERR_STREAM_DESTROYED,x=v.ERR_STREAM_NULL_VALUES,S=v.ERR_STREAM_WRITE_AFTER_END,O=v.ERR_UNKNOWN_ENCODING,T=p.errorOrDestroy;function E(){}function C(t,r,i){n=n||e(\"./_stream_duplex\"),t=t||{},\"boolean\"!=typeof i&&(i=r instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=y(this,t,\"writableHighWaterMark\",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){N(r,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 a(this)}function P(t){var r=this instanceof(n=n||e(\"./_stream_duplex\"));if(!r&&!d.call(P,this))return new P(t);this._writableState=new C(t,this,r),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 j(e,t){var r=new S;T(e,r),o.nextTick(t,r)}function R(e,t,r,n){var i;return null===r?i=new x:\"string\"==typeof r||t.objectMode||(i=new g(\"chunk\",[\"string\",\"Buffer\"],r)),!i||(T(e,i),o.nextTick(n,i),!1)}function M(e,t,r){return e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=l.from(t,r)),t}function A(e,t,r,n,i,o){if(!r){var a=M(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 O(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,r){r(new m(\"_write()\"))},P.prototype._writev=null,P.prototype.end=function(e,t,r){var n=this._writableState;return\"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||q(this,n,r),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,r){e(\"process\");var n=e(\"process\"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var o=e(\"./_stream_readable\"),a=e(\"./_stream_writable\");e(\"inherits\")(f,o);for(var s=i(a.prototype),u=0;u>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\":\"Wugr\"}],mrEY:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,o){if(\"function\"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(\"string\"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=f(t)),n)a.endEmitted?T(e,new O):M(e,a,t,!0);else if(a.ended)T(e,new x);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):B(e,a)):M(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.length=I?e=I:(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=D(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function N(e,t){if(h(\"onEofChunk\"),!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,t.sync?F(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U(e)))}}function F(e){var t=e._readableState;h(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h(\"emitReadable\",t.flowing),t.emittedReadable=!0,o.nextTick(U,e))}function U(e){var t=e._readableState;h(\"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,V(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(G,e,t))}function G(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){h(\"readable nexttick read 0\"),e.read(0)}function q(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(K,e,t))}function K(e,t){h(\"resume\",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(\"resume\"),V(e),t.flowing&&!t.reading&&e.read(0)}function V(e){var t=e._readableState;for(h(\"flow\",t.flowing);t.flowing&&null!==e.read(););}function Y(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function Z(e){var t=e._readableState;h(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(J,t,e))}function J(e,t){if(h(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Q(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return h(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?Z(this):F(this),null;if(0===(e=L(e,t))&&t.ended)return 0===t.length&&Z(this),null;var n,i=t.needReadable;return h(\"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),r!==e&&t.ended&&Z(this)),null!==n&&this.emit(\"data\",n),n},j.prototype._read=function(e){T(this,new S(\"_read()\"))},j.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,h(\"pipe count=%d opts=%j\",n.pipesCount,t);var i=t&&!1===t.end||e===o.stdout||e===o.stderr?b:s;function s(){h(\"onend\"),e.end()}n.endEmitted?o.nextTick(i):r.once(\"end\",i),e.on(\"unpipe\",(function t(i,o){h(\"onunpipe\"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,h(\"cleanup\"),e.removeListener(\"close\",d),e.removeListener(\"finish\",p),e.removeListener(\"drain\",u),e.removeListener(\"error\",c),e.removeListener(\"unpipe\",t),r.removeListener(\"end\",s),r.removeListener(\"end\",b),r.removeListener(\"data\",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=z(r);e.on(\"drain\",u);var l=!1;function f(t){h(\"ondata\");var i=e.write(t);h(\"dest.write\",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Q(n.pipes,e))&&!l&&(h(\"false write response, pause\",n.awaitDrain),n.awaitDrain++),r.pause())}function c(t){h(\"onerror\",t),b(),e.removeListener(\"error\",c),0===a(e,\"error\")&&T(e,t)}function d(){e.removeListener(\"finish\",p),b()}function p(){h(\"onfinish\"),e.removeListener(\"close\",d),b()}function b(){h(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",f),C(e,\"error\",c),e.once(\"close\",d),e.once(\"finish\",p),e.emit(\"pipe\",r),n.flowing||(h(\"pipe resume\"),r.resume()),e},j.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;o0,!1!==n.flowing&&this.resume()):\"readable\"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,h(\"on readable\",n.length,n.reading),n.length?F(this):n.reading||o.nextTick(W,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return\"readable\"===e&&o.nextTick(H,this),r},j.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==e&&void 0!==e||o.nextTick(H,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(h(\"resume\"),e.flowing=!e.readableListening,q(this,e)),e.paused=!1,this},j.prototype.pause=function(){return h(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(h(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on(\"end\",(function(){if(h(\"wrapped end\"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on(\"data\",(function(i){h(\"wrapped data\"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!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 o=0;o0,(function(e){n||(n=e),e&&a.forEach(l),o||(a.forEach(l),i(n))}))}));return t.reduce(f)}},{\"../../../errors\":\"Yj9o\",\"./end-of-stream\":\"mrEY\"}],tzeh:[function(e,t,r){(r=t.exports=e(\"./lib/_stream_readable.js\")).Stream=r,r.Readable=r,r.Writable=e(\"./lib/_stream_writable.js\"),r.Duplex=e(\"./lib/_stream_duplex.js\"),r.Transform=e(\"./lib/_stream_transform.js\"),r.PassThrough=e(\"./lib/_stream_passthrough.js\"),r.finished=e(\"./lib/internal/streams/end-of-stream.js\"),r.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,r){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,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],gfUn:[function(e,t,r){e(\"process\");var n=e(\"process\"),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case\"%s\":return String(n[r++]);case\"%d\":return Number(n[r++]);case\"%j\":try{return JSON.stringify(n[r++])}catch(e){return\"[Circular]\"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?\"\u001b[\"+u.colors[r][0]+\"m\"+e+\"\u001b[\"+u.colors[r][1]+\"m\":e}function f(e,t){return e}function c(e,t,n){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return m(i)||(i=c(e,i,n)),i}var o=h(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),S(t)&&(a.indexOf(\"message\")>=0||a.indexOf(\"description\")>=0))return d(t);if(0===a.length){if(O(t)){var u=t.name?\": \"+t.name:\"\";return e.stylize(\"[Function\"+u+\"]\",\"special\")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),\"regexp\");if(x(t))return e.stylize(Date.prototype.toString.call(t),\"date\");if(S(t))return d(t)}var l,f=\"\",y=!1,v=[\"{\",\"}\"];return b(t)&&(y=!0,v=[\"[\",\"]\"]),O(t)&&(f=\" [Function\"+(t.name?\": \"+t.name:\"\")+\"]\"),_(t)&&(f=\" \"+RegExp.prototype.toString.call(t)),x(t)&&(f=\" \"+Date.prototype.toUTCString.call(t)),S(t)&&(f=\" \"+d(t)),0!==a.length||y&&0!=t.length?n<0?_(t)?e.stylize(RegExp.prototype.toString.call(t),\"regexp\"):e.stylize(\"[Object]\",\"special\"):(e.seen.push(t),l=y?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60?r[0]+(\"\"===t?\"\":t+\"\\n \")+\" \"+e.join(\",\\n \")+\" \"+r[1]:r[0]+t+\" \"+e.join(\", \")+\" \"+r[1]}(l,f,v)):v[0]+f+v[1]}function h(e,t){if(w(t))return e.stylize(\"undefined\",\"undefined\");if(m(t)){var r=\"'\"+JSON.stringify(t).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return e.stylize(r,\"string\")}return g(t)?e.stylize(\"\"+t,\"number\"):y(t)?e.stylize(\"\"+t,\"boolean\"):v(t)?e.stylize(\"null\",\"null\"):void 0}function d(e){return\"[\"+Error.prototype.toString.call(e)+\"]\"}function p(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize(\"[Getter/Setter]\",\"special\"):e.stylize(\"[Getter]\",\"special\"):u.set&&(s=e.stylize(\"[Setter]\",\"special\")),j(n,i)||(a=\"[\"+i+\"]\"),s||(e.seen.indexOf(u.value)<0?(s=v(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf(\"\\n\")>-1&&(s=o?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\")),w(a)){if(o&&i.match(/^\\d+$/))return s;(a=JSON.stringify(\"\"+i)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,\"name\")):(a=a.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),a=e.stylize(a,\"string\"))}return a+\": \"+s}function b(e){return Array.isArray(e)}function y(e){return\"boolean\"==typeof e}function v(e){return null===e}function g(e){return\"number\"==typeof e}function m(e){return\"string\"==typeof e}function w(e){return void 0===e}function _(e){return k(e)&&\"[object RegExp]\"===T(e)}function k(e){return\"object\"==typeof e&&null!==e}function x(e){return k(e)&&\"[object Date]\"===T(e)}function S(e){return k(e)&&(\"[object Error]\"===T(e)||e instanceof Error)}function O(e){return\"function\"==typeof e}function T(e){return Object.prototype.toString.call(e)}function E(e){return e<10?\"0\"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(w(a)&&(a=\"\"),e=e.toUpperCase(),!s[e])if(new RegExp(\"\\\\b\"+e+\"\\\\b\",\"i\").test(a)){var t=n.pid;s[e]=function(){var n=r.format.apply(r,arguments);console.error(\"%s %d: %s\",e,t,n)}}else s[e]=function(){};return s[e]},r.inspect=u,u.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]},u.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},r.isArray=b,r.isBoolean=y,r.isNull=v,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=m,r.isSymbol=function(e){return\"symbol\"==typeof e},r.isUndefined=w,r.isRegExp=_,r.isObject=k,r.isDate=x,r.isError=S,r.isFunction=O,r.isPrimitive=function(e){return null===e||\"boolean\"==typeof e||\"number\"==typeof e||\"string\"==typeof e||\"symbol\"==typeof e||void 0===e},r.isBuffer=e(\"./support/isBuffer\");var C=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];function P(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(\":\");return[e.getDate(),C[e.getMonth()],t].join(\" \")}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log(\"%s - %s\",P(),r.format.apply(r,arguments))},r.inherits=e(\"inherits\"),r._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R=\"undefined\"!=typeof Symbol?Symbol(\"util.promisify.custom\"):void 0;function M(e,t){if(!e){var r=new Error(\"Promise was rejected with a falsy value\");r.reason=e,e=r}return t(e)}r.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,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o\".charCodeAt(0),a=\"-\".charCodeAt(0),s=\"/\".charCodeAt(0),u=\"!\".charCodeAt(0),l=\"'\".charCodeAt(0),f='\"'.charCodeAt(0);function c(){for(var t=[];e[r];)if(e.charCodeAt(r)==i){if(e.charCodeAt(r+1)===s)return(r=e.indexOf(\">\",r))+1&&(r+=1),t;if(e.charCodeAt(r+1)===u){if(e.charCodeAt(r+2)==a){for(;-1!==r&&(e.charCodeAt(r)!==o||e.charCodeAt(r-1)!=a||e.charCodeAt(r-2)!=a||-1==r);)r=e.indexOf(\">\",r+1);-1===r&&(r=e.length)}else for(r+=2;e.charCodeAt(r)!==o&&e[r];)r++;r++;continue}var n=b();t.push(n)}else{var l=h();l.trim().length>0&&t.push(l),r++}return t}function h(){var t=r;return-2==(r=e.indexOf(\"<\",r)-1)&&(r=e.length),e.slice(t,r+1)}function d(){for(var t=r;-1===\"\\n\\t>/= \".indexOf(e[r])&&e[r];)r++;return e.slice(t,r)}var p=t.noChildNodes||[\"img\",\"br\",\"input\",\"meta\",\"link\"];function b(){r++;const t=d(),n={};let i=[];for(;e.charCodeAt(r)!==o&&e[r];){var a=e.charCodeAt(r);if(a>64&&a<91||a>96&&a<123){for(var u=d(),h=e.charCodeAt(r);h&&h!==l&&h!==f&&!(h>64&&h<91||h>96&&h<123)&&h!==o;)r++,h=e.charCodeAt(r);if(h===l||h===f){var b=y();if(-1===r)return{tagName:t,attributes:n,children:i}}else b=null,r--;n[u]=b}r++}if(e.charCodeAt(r-1)!==s)if(\"script\"==t){var v=r+1;r=e.indexOf(\"<\\/script>\",r),i=[e.slice(v,r-1)],r+=9}else\"style\"==t?(v=r+1,r=e.indexOf(\"\",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?"); +eval("var require;/**\r\n * Minified by jsDelivr using Terser v5.3.5.\r\n * Original file: /npm/geotiff@1.0.4/dist-browser/geotiff.js\r\n *\r\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\r\n */\r\nparcelRequire=function(e,t,r,n){var i,o=\"function\"==typeof parcelRequire&&parcelRequire,a=\"function\"==typeof require&&require;function s(r,n){if(!t[r]){if(!e[r]){var i=\"function\"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(r,!0);if(o)return o(r,!0);if( true&&\"string\"==typeof r)return __webpack_require__(\"./src/secondary/geotiff sync recursive\")(r);var u=new Error(\"Cannot find module '\"+r+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}f.resolve=function(t){return e[r][1][t]||t},f.cache={};var l=t[r]=new s.Module(r);e[r][0].call(l.exports,f,l,l.exports,this)}return t[r].exports;function f(e){return s(f.resolve(e))}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.exports={}},s.modules=e,s.cache=t,s.parent=o,s.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]};for(var u=0;u=0;--o){var a=this.tryEntries[o],s=a.completion;if(\"root\"===a.tryLoc)return i(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;T(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),p}},e}(\"object\"==typeof t?t.exports:{});try{regeneratorRuntime=n}catch(e){Function(\"r\",\"regeneratorRuntime = r\")(n)}},{}],PMvg:[function(e,t,r){t.exports=e(\"regenerator-runtime\")},{\"regenerator-runtime\":\"QVnC\"}],IxO8:[function(e,t,r){t.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},{}],OUZ9:[function(e,t,r){t.exports=function(e){if(Array.isArray(e))return e}},{}],vKPt:[function(e,t,r){t.exports=function(e,t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},{}],NVR6:[function(e,t,r){t.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>23&511;return a[r]+((8388607&t)>>s[r])},r.convertToNumber=function(e){const t=e>>10;return o[0]=u[f[t]+(1023&e)]+l[t],i[0]};const n=new ArrayBuffer(4),i=new Float32Array(n),o=new Uint32Array(n),a=new Uint32Array(512),s=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(a[0|e]=0,a[256|e]=32768,s[0|e]=24,s[256|e]=24):t<-14?(a[0|e]=1024>>-t-14,a[256|e]=1024>>-t-14|32768,s[0|e]=-t-1,s[256|e]=-t-1):t<=15?(a[0|e]=t+15<<10,a[256|e]=t+15<<10|32768,s[0|e]=13,s[256|e]=13):t<128?(a[0|e]=31744,a[256|e]=64512,s[0|e]=24,s[256|e]=24):(a[0|e]=31744,a[256|e]=64512,s[0|e]=13,s[256|e]=13)}const u=new Uint32Array(2048),l=new Uint32Array(64),f=new Uint32Array(64);u[0]=0;for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;0==(8388608&t);)r-=8388608,t<<=1;t&=-8388609,r+=947912704,u[e]=t|r}for(let e=1024;e<2048;++e)u[e]=939524096+(e-1024<<13);l[0]=0;for(let e=1;e<31;++e)l[e]=e<<23;l[31]=1199570944,l[32]=2147483648;for(let e=33;e<63;++e)l[e]=2147483648+(e-32<<23);l[63]=3347054592,f[0]=0;for(let e=1;e<64;++e)f[e]=32===e?0:1024},{}],G4sf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=function(e){if(e=Number(e),!Number.isFinite(e)||0===e)return e;const t=(0,n.roundToFloat16Bits)(e);return(0,n.convertToNumber)(t)};var n=e(\"./lib\")},{\"./lib\":\"GG94\"}],xQUP:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.ToInteger=function(e){return\"number\"!=typeof e&&(e=Number(e)),Number.isNaN(e)&&(e=0),Math.trunc(e)},r.defaultCompareFunction=function(e,t){const[r,n]=[Number.isNaN(e),Number.isNaN(t)];if(r&&n)return 0;if(r)return 1;if(n)return-1;if(et)return 1;if(0===e&&0===t){const[r,n]=[Object.is(e,0),Object.is(t,0)];if(!r&&n)return-1;if(r&&!n)return 1}return 0}},{}],iJ7y:[function(e,t,r){var n=arguments[3];Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var i=\"object\"==typeof n&&n&&n.Object===Object&&n,o=i;r.default=o},{}],ygki:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof self&&self&&self.Object===Object&&self,o=n.default||i||Function(\"return this\")();r.default=o},{\"./_freeGlobal.js\":\"iJ7y\"}],Oi8n:[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(\"./_root.js\")).default.Symbol;r.default=n},{\"./_root.js\":\"ygki\"}],InRc:[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(\"./_Symbol.js\"));var i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n.default?n.default.toStringTag:void 0;var u=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i};r.default=u},{\"./_Symbol.js\":\"Oi8n\"}],iwg4:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Object.prototype.toString;var i=function(e){return n.call(e)};r.default=i},{}],svpX:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_Symbol.js\")),i=a(e(\"./_getRawTag.js\")),o=a(e(\"./_objectToString.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=n.default?n.default.toStringTag:void 0;var u=function(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":s&&s in Object(e)?(0,i.default)(e):(0,o.default)(e)};r.default=u},{\"./_Symbol.js\":\"Oi8n\",\"./_getRawTag.js\":\"InRc\",\"./_objectToString.js\":\"iwg4\"}],UKR9:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return null!=e&&\"object\"==typeof e};r.default=n},{}],MYZg:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObjectLike.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){return(0,i.default)(e)&&\"[object ArrayBuffer]\"==(0,n.default)(e)};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObjectLike.js\":\"UKR9\"}],pmj6:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return function(t){return e(t)}};r.default=n},{}],oPFz:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof r&&r&&!r.nodeType&&r,o=i&&\"object\"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&n.default.process,s=function(){try{return o&&o.require&&o.require(\"util\").types||a&&a.binding&&a.binding(\"util\")}catch(e){}}();r.default=s},{\"./_freeGlobal.js\":\"iJ7y\"}],rXXV:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_baseIsArrayBuffer.js\")),i=a(e(\"./_baseUnary.js\")),o=a(e(\"./_nodeUtil.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=o.default&&o.default.isArrayBuffer,u=s?(0,i.default)(s):n.default;r.default=u},{\"./_baseIsArrayBuffer.js\":\"MYZg\",\"./_baseUnary.js\":\"pmj6\",\"./_nodeUtil.js\":\"oPFz\"}],XYHx:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.isDataView=function(e){return e instanceof DataView},r.isStringNumberKey=function(e){return\"string\"==typeof e&&e===(0,n.ToInteger)(e)+\"\"},Object.defineProperty(r,\"isArrayBuffer\",{enumerable:!0,get:function(){return i.default}});var n=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,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.createPrivateStorage=function(){const e=new WeakMap;return t=>{let r=e.get(t);return r||(r=Object.create(null),e.set(t,r),r)}}},{}],DTZk:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)};r.default=n},{}],tWvT:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObject.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){if(!(0,i.default)(e))return!1;var t=(0,n.default)(e);return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObject.js\":\"DTZk\"}],xFkS:[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(\"./_root.js\")).default[\"__core-js_shared__\"];r.default=n},{\"./_root.js\":\"ygki\"}],pULC:[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(\"./_coreJsData.js\"));var i=function(){var e=/[^.]+$/.exec(n.default&&n.default.keys&&n.default.keys.IE_PROTO||\"\");return e?\"Symbol(src)_1.\"+e:\"\"}();var o=function(e){return!!i&&i in e};r.default=o},{\"./_coreJsData.js\":\"xFkS\"}],UKJK:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Function.prototype.toString;var i=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"};r.default=i},{}],Zczf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=s(e(\"./isFunction.js\")),i=s(e(\"./_isMasked.js\")),o=s(e(\"./isObject.js\")),a=s(e(\"./_toSource.js\"));function s(e){return e&&e.__esModule?e:{default:e}}var u=/^\\[object .+?Constructor\\]$/,l=Function.prototype,f=Object.prototype,c=l.toString,h=f.hasOwnProperty,d=RegExp(\"^\"+c.call(h).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");var p=function(e){return!(!(0,o.default)(e)||(0,i.default)(e))&&((0,n.default)(e)?d:u).test((0,a.default)(e))};r.default=p},{\"./isFunction.js\":\"tWvT\",\"./_isMasked.js\":\"pULC\",\"./isObject.js\":\"DTZk\",\"./_toSource.js\":\"UKJK\"}],ZVQn:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e,t){return null==e?void 0:e[t]};r.default=n},{}],tx41:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseIsNative.js\")),i=o(e(\"./_getValue.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e,t){var r=(0,i.default)(e,t);return(0,n.default)(r)?r:void 0};r.default=a},{\"./_baseIsNative.js\":\"Zczf\",\"./_getValue.js\":\"ZVQn\"}],YsDH:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=(0,function(e){return e&&e.__esModule?e:{default:e}}(e(\"./_getNative.js\")).default)(Object,\"create\");r.default=n},{\"./_getNative.js\":\"tx41\"}],sJnX:[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(\"./_nativeCreate.js\"));var i=function(){this.__data__=n.default?(0,n.default)(null):{},this.size=0};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],c9sB:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};r.default=n},{}],zYTU:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;if(n.default){var r=t[e];return\"__lodash_hash_undefined__\"===r?void 0:r}return i.call(t,e)?t[e]:void 0};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],ZFwF:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;return n.default?void 0!==t[e]:i.call(t,e)};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],i3LK:[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(\"./_nativeCreate.js\"));var i=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n.default&&void 0===t?\"__lodash_hash_undefined__\":t,this};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],tE4I:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_hashClear.js\")),i=u(e(\"./_hashDelete.js\")),o=u(e(\"./_hashGet.js\")),a=u(e(\"./_hashHas.js\")),s=u(e(\"./_hashSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],GGNI:[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(\"./_assocIndexOf.js\"));var i=function(e,t){var r=this.__data__,i=(0,n.default)(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],UlXa:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_listCacheClear.js\")),i=u(e(\"./_listCacheDelete.js\")),o=u(e(\"./_listCacheGet.js\")),a=u(e(\"./_listCacheHas.js\")),s=u(e(\"./_listCacheSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tf(t)&&function(e){return\"function\"==typeof e&&v.has(e)}(e)?Reflect.apply(e,l(t).target,r):Reflect.apply(e,t,r)},p={get(e,t){let r=null;if(u.isTypedArrayIndexedPropertyWritable||(e=l(r=e).target),(0,i.isStringNumberKey)(t))return Reflect.has(e,t)?(0,s.convertToNumber)(Reflect.get(e,t)):void 0;{const n=null!==r&&Reflect.has(r,t)?Reflect.get(r,t):Reflect.get(e,t);if(\"function\"!=typeof n)return n;let i=l(n).proxy;return void 0===i&&(i=l(n).proxy=new Proxy(n,d)),i}},set(e,t,r){let n=null;return u.isTypedArrayIndexedPropertyWritable||(e=l(n=e).target),(0,i.isStringNumberKey)(t)?Reflect.set(e,t,(0,s.roundToFloat16Bits)(r)):null===n||Reflect.has(e,t)&&!Object.isFrozen(n)?Reflect.set(e,t,r):Reflect.set(n,t,r)}};u.isTypedArrayIndexedPropertyWritable||(p.getPrototypeOf=e=>Reflect.getPrototypeOf(l(e).target),p.setPrototypeOf=(e,t)=>Reflect.setPrototypeOf(l(e).target,t),p.defineProperty=(e,t,r)=>{const n=l(e).target;return!Reflect.has(n,t)||Object.isFrozen(e)?Reflect.defineProperty(e,t,r):Reflect.defineProperty(n,t,r)},p.deleteProperty=(e,t)=>{const r=l(e).target;return Reflect.has(e,t)?Reflect.deleteProperty(e,t):Reflect.deleteProperty(r,t)},p.has=(e,t)=>Reflect.has(e,t)||Reflect.has(l(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 b extends Uint16Array{constructor(e,t,r){if(f(e))super(l(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,r);break;default:super(...arguments)}else{const t=Reflect.has(e,\"length\")||void 0===e[Symbol.iterator]?e:[...e],r=t.length;super(r);for(let e=0;et(r(e),r(n)))),l(this).proxy}slice(...e){let t;c(this);try{t=super.slice(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).slice(...e)}return new b(t.buffer)}subarray(...e){let t;c(this);try{t=super.subarray(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).subarray(...e)}return new b(t.buffer,t.byteOffset,t.length)}indexOf(e,...t){c(this);const r=this.length;let i=(0,n.ToInteger)(t[0]);i<0&&(i+=r)<0&&(i=0);for(let t=i,n=r;t=0?i=i0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error(\"Possible EventEmitter memory leak detected. \"+a.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");s.name=\"MaxListenersExceededWarning\",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function h(){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 d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error(\"Unhandled error.\"+(a?\" (\"+a.message+\")\":\"\"));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if(\"function\"==typeof u)o(u,this,t);else{var l=u.length,f=y(u,l);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);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):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],ExO1:[function(e,t,r){t.exports=e(\"events\").EventEmitter},{events:\"FRpO\"}],yh9p:[function(e,t,r){\"use strict\";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=l(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,c=s>0?a-4:a;for(r=0;r>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+\"==\")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\")),o.join(\"\")};for(var n=[],i=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",s=0,u=a.length;s0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=e.indexOf(\"=\");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],o=t;o>1,f=-7,c=r?i-1:0,h=r?-1:1,d=e[t+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*u-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*b}},{}],REa7:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return\"[object Array]\"==n.call(e)}},{}],dskh:[function(e,t,r){var n=arguments[3],i=e(\"base64-js\"),o=e(\"ieee754\"),a=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 u(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(u()=u())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+u().toString(16)+\" bytes\");return 0|e}function w(e){return+e!=e&&(e=0),f.alloc(+e)}function _(e,t){if(f.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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return Q(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return ee(e).length;default:if(n)return Q(e).length;t=(\"\"+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return F(this,t,r);case\"utf8\":case\"utf-8\":return A(this,t,r);case\"ascii\":return L(this,t,r);case\"latin1\":case\"binary\":return N(this,t,r);case\"base64\":return M(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return U(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function x(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:O(e,t,r,n,i);if(\"number\"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):O(e,[t],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function O(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;hi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError(\"Invalid hex string\");n>o/2&&(n=o/2);for(var a=0;a239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return D(n)}r.Buffer=f,r.SlowBuffer=w,r.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:s(),r.kMaxLength=u(),f.poolSize=8192,f._augment=function(e){return e.__proto__=f.prototype,e},f.from=function(e,t,r){return c(null,e,t,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,\"undefined\"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(e,t,r){return d(null,e,t,r)},f.allocUnsafe=function(e){return p(null,e)},f.allocUnsafeSlow=function(e){return p(null,e)},f.isBuffer=function(e){return!(null==e||!e._isBuffer)},f.compare=function(e,t){if(!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError(\"Arguments must be Buffers\");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString(\"hex\",0,t).match(/.{2}/g).join(\" \"),this.length>t&&(e+=\" ... \")),\"\"},f.prototype.compare=function(e,t,r,n,i){if(!f.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return T(this,e,t,r);case\"utf8\":case\"utf-8\":return E(this,e,t,r);case\"ascii\":return C(this,e,t,r);case\"latin1\":case\"binary\":return P(this,e,t,r);case\"base64\":return j(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return R(this,e,t,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function D(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);for(var r=\"\",n=0;nn)&&(r=n);for(var i=\"\",o=t;or)throw new RangeError(\"Trying to access beyond buffer length\")}function G(e,t,r,n,i,o){if(!f.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 z(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function H(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function W(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function q(e,t,r,n,i){return i||W(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function K(e,t,r,n,i){return i||W(e,0,r,8),o.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},f.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},f.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]},f.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])},f.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},f.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},f.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},f.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]},f.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):H(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):H(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function ee(e){return i.toByteArray(Y(e))}function te(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e){return e!=e}},{\"base64-js\":\"yh9p\",ieee754:\"JgNJ\",isarray:\"REa7\",buffer:\"dskh\"}],VCcH:[function(e,t,r){\"use strict\";function n(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 i(e){for(var t=1;t0?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,r=\"\"+t.data;t=t.next;)r+=e+t.data;return r}},{key:\"concat\",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:\"consume\",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:\"_getBuffer\",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:\"dskh\",util:\"rDCW\"}],pBGv:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error(\"setTimeout has not been defined\")}function s(){throw new Error(\"clearTimeout has not been defined\")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function l(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}!function(){try{n=\"function\"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i=\"function\"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var f,c=[],h=!1,d=-1;function p(){h&&f&&(h=!1,f.length?c=f.concat(c):d=-1,c.length&&b())}function b(){if(!h){var e=u(p);h=!0;for(var t=c.length;t;){for(f=c,c=[];++d1)for(var r=1;r2?\"one of \".concat(t,\" \").concat(e.slice(0,r-1).join(\", \"),\", or \")+e[r-1]:2===r?\"one of \".concat(t,\" \").concat(e[0],\" or \").concat(e[1]):\"of \".concat(t,\" \").concat(e[0])}return\"of \".concat(t,\" \").concat(String(e))}o(\"ERR_INVALID_OPT_VALUE\",(function(e,t){return'The value \"'+t+'\" is invalid for option \"'+e+'\"'}),TypeError),o(\"ERR_INVALID_ARG_TYPE\",(function(e,t,r){var i,o;if(\"string\"==typeof t&&function(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}(t,\"not \")?(i=\"must not be\",t=t.replace(/^not /,\"\")):i=\"must be\",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e,\" argument\"))o=\"The \".concat(e,\" \").concat(i,\" \").concat(a(t,\"type\"));else{var s=function(e,t,r){return\"number\"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,\".\")?\"property\":\"argument\";o='The \"'.concat(e,'\" ').concat(s,\" \").concat(i,\" \").concat(a(t,\"type\"))}return o+\". Received type \".concat(n(r))}),TypeError),o(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),o(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(e){return\"The \"+e+\" method is not implemented\"})),o(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),o(\"ERR_STREAM_DESTROYED\",(function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"})),o(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),o(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),o(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),o(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),o(\"ERR_UNKNOWN_ENCODING\",(function(e){return\"Unknown encoding: \"+e}),TypeError),o(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=i},{}],TWVJ:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:\"highWaterMark\",o);return Math.floor(o)}return e.objectMode?16:16384}}},{\"../../../errors\":\"Yj9o\"}],Bm0n:[function(e,t,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],yM1o:[function(e,t,r){var n=arguments[3];function i(e,t){if(o(\"noDeprecation\"))return e;var r=!1;return function(){if(!r){if(o(\"throwDeprecation\"))throw new Error(t);o(\"traceDeprecation\")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}function o(e){try{if(!n.localStorage)return!1}catch(e){return!1}var t=n.localStorage[e];return null!=t&&\"true\"===String(t).toLowerCase()}t.exports=i},{}],WSyY:[function(e,t,r){e(\"process\");var n,i=arguments[3],o=e(\"process\");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){K(t,e)}}t.exports=P,P.WritableState=C;var s={deprecate:e(\"util-deprecate\")},u=e(\"./internal/streams/stream\"),l=e(\"buffer\").Buffer,f=i.Uint8Array||function(){};function c(e){return l.from(e)}function h(e){return l.isBuffer(e)||e instanceof f}var d,p=e(\"./internal/streams/destroy\"),b=e(\"./internal/streams/state\"),y=b.getHighWaterMark,v=e(\"../errors\").codes,g=v.ERR_INVALID_ARG_TYPE,m=v.ERR_METHOD_NOT_IMPLEMENTED,w=v.ERR_MULTIPLE_CALLBACK,_=v.ERR_STREAM_CANNOT_PIPE,k=v.ERR_STREAM_DESTROYED,x=v.ERR_STREAM_NULL_VALUES,S=v.ERR_STREAM_WRITE_AFTER_END,O=v.ERR_UNKNOWN_ENCODING,T=p.errorOrDestroy;function E(){}function C(t,r,i){n=n||e(\"./_stream_duplex\"),t=t||{},\"boolean\"!=typeof i&&(i=r instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=y(this,t,\"writableHighWaterMark\",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){N(r,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 a(this)}function P(t){var r=this instanceof(n=n||e(\"./_stream_duplex\"));if(!r&&!d.call(P,this))return new P(t);this._writableState=new C(t,this,r),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 j(e,t){var r=new S;T(e,r),o.nextTick(t,r)}function R(e,t,r,n){var i;return null===r?i=new x:\"string\"==typeof r||t.objectMode||(i=new g(\"chunk\",[\"string\",\"Buffer\"],r)),!i||(T(e,i),o.nextTick(n,i),!1)}function M(e,t,r){return e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=l.from(t,r)),t}function A(e,t,r,n,i,o){if(!r){var a=M(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 O(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,r){r(new m(\"_write()\"))},P.prototype._writev=null,P.prototype.end=function(e,t,r){var n=this._writableState;return\"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||q(this,n,r),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,r){e(\"process\");var n=e(\"process\"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var o=e(\"./_stream_readable\"),a=e(\"./_stream_writable\");e(\"inherits\")(f,o);for(var s=i(a.prototype),u=0;u>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\":\"Wugr\"}],mrEY:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,o){if(\"function\"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(\"string\"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=f(t)),n)a.endEmitted?T(e,new O):M(e,a,t,!0);else if(a.ended)T(e,new x);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):B(e,a)):M(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.length=I?e=I:(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=D(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function N(e,t){if(h(\"onEofChunk\"),!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,t.sync?F(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U(e)))}}function F(e){var t=e._readableState;h(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h(\"emitReadable\",t.flowing),t.emittedReadable=!0,o.nextTick(U,e))}function U(e){var t=e._readableState;h(\"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,V(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(G,e,t))}function G(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){h(\"readable nexttick read 0\"),e.read(0)}function q(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(K,e,t))}function K(e,t){h(\"resume\",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(\"resume\"),V(e),t.flowing&&!t.reading&&e.read(0)}function V(e){var t=e._readableState;for(h(\"flow\",t.flowing);t.flowing&&null!==e.read(););}function Y(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function Z(e){var t=e._readableState;h(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(J,t,e))}function J(e,t){if(h(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Q(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return h(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?Z(this):F(this),null;if(0===(e=L(e,t))&&t.ended)return 0===t.length&&Z(this),null;var n,i=t.needReadable;return h(\"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),r!==e&&t.ended&&Z(this)),null!==n&&this.emit(\"data\",n),n},j.prototype._read=function(e){T(this,new S(\"_read()\"))},j.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,h(\"pipe count=%d opts=%j\",n.pipesCount,t);var i=t&&!1===t.end||e===o.stdout||e===o.stderr?b:s;function s(){h(\"onend\"),e.end()}n.endEmitted?o.nextTick(i):r.once(\"end\",i),e.on(\"unpipe\",(function t(i,o){h(\"onunpipe\"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,h(\"cleanup\"),e.removeListener(\"close\",d),e.removeListener(\"finish\",p),e.removeListener(\"drain\",u),e.removeListener(\"error\",c),e.removeListener(\"unpipe\",t),r.removeListener(\"end\",s),r.removeListener(\"end\",b),r.removeListener(\"data\",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=z(r);e.on(\"drain\",u);var l=!1;function f(t){h(\"ondata\");var i=e.write(t);h(\"dest.write\",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Q(n.pipes,e))&&!l&&(h(\"false write response, pause\",n.awaitDrain),n.awaitDrain++),r.pause())}function c(t){h(\"onerror\",t),b(),e.removeListener(\"error\",c),0===a(e,\"error\")&&T(e,t)}function d(){e.removeListener(\"finish\",p),b()}function p(){h(\"onfinish\"),e.removeListener(\"close\",d),b()}function b(){h(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",f),C(e,\"error\",c),e.once(\"close\",d),e.once(\"finish\",p),e.emit(\"pipe\",r),n.flowing||(h(\"pipe resume\"),r.resume()),e},j.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;o0,!1!==n.flowing&&this.resume()):\"readable\"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,h(\"on readable\",n.length,n.reading),n.length?F(this):n.reading||o.nextTick(W,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return\"readable\"===e&&o.nextTick(H,this),r},j.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==e&&void 0!==e||o.nextTick(H,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(h(\"resume\"),e.flowing=!e.readableListening,q(this,e)),e.paused=!1,this},j.prototype.pause=function(){return h(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(h(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on(\"end\",(function(){if(h(\"wrapped end\"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on(\"data\",(function(i){h(\"wrapped data\"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!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 o=0;o0,(function(e){n||(n=e),e&&a.forEach(l),o||(a.forEach(l),i(n))}))}));return t.reduce(f)}},{\"../../../errors\":\"Yj9o\",\"./end-of-stream\":\"mrEY\"}],tzeh:[function(e,t,r){(r=t.exports=e(\"./lib/_stream_readable.js\")).Stream=r,r.Readable=r,r.Writable=e(\"./lib/_stream_writable.js\"),r.Duplex=e(\"./lib/_stream_duplex.js\"),r.Transform=e(\"./lib/_stream_transform.js\"),r.PassThrough=e(\"./lib/_stream_passthrough.js\"),r.finished=e(\"./lib/internal/streams/end-of-stream.js\"),r.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,r){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,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],gfUn:[function(e,t,r){e(\"process\");var n=e(\"process\"),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case\"%s\":return String(n[r++]);case\"%d\":return Number(n[r++]);case\"%j\":try{return JSON.stringify(n[r++])}catch(e){return\"[Circular]\"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?\"\u001b[\"+u.colors[r][0]+\"m\"+e+\"\u001b[\"+u.colors[r][1]+\"m\":e}function f(e,t){return e}function c(e,t,n){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return m(i)||(i=c(e,i,n)),i}var o=h(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),S(t)&&(a.indexOf(\"message\")>=0||a.indexOf(\"description\")>=0))return d(t);if(0===a.length){if(O(t)){var u=t.name?\": \"+t.name:\"\";return e.stylize(\"[Function\"+u+\"]\",\"special\")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),\"regexp\");if(x(t))return e.stylize(Date.prototype.toString.call(t),\"date\");if(S(t))return d(t)}var l,f=\"\",y=!1,v=[\"{\",\"}\"];return b(t)&&(y=!0,v=[\"[\",\"]\"]),O(t)&&(f=\" [Function\"+(t.name?\": \"+t.name:\"\")+\"]\"),_(t)&&(f=\" \"+RegExp.prototype.toString.call(t)),x(t)&&(f=\" \"+Date.prototype.toUTCString.call(t)),S(t)&&(f=\" \"+d(t)),0!==a.length||y&&0!=t.length?n<0?_(t)?e.stylize(RegExp.prototype.toString.call(t),\"regexp\"):e.stylize(\"[Object]\",\"special\"):(e.seen.push(t),l=y?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60?r[0]+(\"\"===t?\"\":t+\"\\n \")+\" \"+e.join(\",\\n \")+\" \"+r[1]:r[0]+t+\" \"+e.join(\", \")+\" \"+r[1]}(l,f,v)):v[0]+f+v[1]}function h(e,t){if(w(t))return e.stylize(\"undefined\",\"undefined\");if(m(t)){var r=\"'\"+JSON.stringify(t).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return e.stylize(r,\"string\")}return g(t)?e.stylize(\"\"+t,\"number\"):y(t)?e.stylize(\"\"+t,\"boolean\"):v(t)?e.stylize(\"null\",\"null\"):void 0}function d(e){return\"[\"+Error.prototype.toString.call(e)+\"]\"}function p(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize(\"[Getter/Setter]\",\"special\"):e.stylize(\"[Getter]\",\"special\"):u.set&&(s=e.stylize(\"[Setter]\",\"special\")),j(n,i)||(a=\"[\"+i+\"]\"),s||(e.seen.indexOf(u.value)<0?(s=v(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf(\"\\n\")>-1&&(s=o?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\")),w(a)){if(o&&i.match(/^\\d+$/))return s;(a=JSON.stringify(\"\"+i)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,\"name\")):(a=a.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),a=e.stylize(a,\"string\"))}return a+\": \"+s}function b(e){return Array.isArray(e)}function y(e){return\"boolean\"==typeof e}function v(e){return null===e}function g(e){return\"number\"==typeof e}function m(e){return\"string\"==typeof e}function w(e){return void 0===e}function _(e){return k(e)&&\"[object RegExp]\"===T(e)}function k(e){return\"object\"==typeof e&&null!==e}function x(e){return k(e)&&\"[object Date]\"===T(e)}function S(e){return k(e)&&(\"[object Error]\"===T(e)||e instanceof Error)}function O(e){return\"function\"==typeof e}function T(e){return Object.prototype.toString.call(e)}function E(e){return e<10?\"0\"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(w(a)&&(a=\"\"),e=e.toUpperCase(),!s[e])if(new RegExp(\"\\\\b\"+e+\"\\\\b\",\"i\").test(a)){var t=n.pid;s[e]=function(){var n=r.format.apply(r,arguments);console.error(\"%s %d: %s\",e,t,n)}}else s[e]=function(){};return s[e]},r.inspect=u,u.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]},u.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},r.isArray=b,r.isBoolean=y,r.isNull=v,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=m,r.isSymbol=function(e){return\"symbol\"==typeof e},r.isUndefined=w,r.isRegExp=_,r.isObject=k,r.isDate=x,r.isError=S,r.isFunction=O,r.isPrimitive=function(e){return null===e||\"boolean\"==typeof e||\"number\"==typeof e||\"string\"==typeof e||\"symbol\"==typeof e||void 0===e},r.isBuffer=e(\"./support/isBuffer\");var C=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];function P(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(\":\");return[e.getDate(),C[e.getMonth()],t].join(\" \")}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log(\"%s - %s\",P(),r.format.apply(r,arguments))},r.inherits=e(\"inherits\"),r._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R=\"undefined\"!=typeof Symbol?Symbol(\"util.promisify.custom\"):void 0;function M(e,t){if(!e){var r=new Error(\"Promise was rejected with a falsy value\");r.reason=e,e=r}return t(e)}r.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,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o\".charCodeAt(0),a=\"-\".charCodeAt(0),s=\"/\".charCodeAt(0),u=\"!\".charCodeAt(0),l=\"'\".charCodeAt(0),f='\"'.charCodeAt(0);function c(){for(var t=[];e[r];)if(e.charCodeAt(r)==i){if(e.charCodeAt(r+1)===s)return(r=e.indexOf(\">\",r))+1&&(r+=1),t;if(e.charCodeAt(r+1)===u){if(e.charCodeAt(r+2)==a){for(;-1!==r&&(e.charCodeAt(r)!==o||e.charCodeAt(r-1)!=a||e.charCodeAt(r-2)!=a||-1==r);)r=e.indexOf(\">\",r+1);-1===r&&(r=e.length)}else for(r+=2;e.charCodeAt(r)!==o&&e[r];)r++;r++;continue}var n=b();t.push(n)}else{var l=h();l.trim().length>0&&t.push(l),r++}return t}function h(){var t=r;return-2==(r=e.indexOf(\"<\",r)-1)&&(r=e.length),e.slice(t,r+1)}function d(){for(var t=r;-1===\"\\n\\t>/= \".indexOf(e[r])&&e[r];)r++;return e.slice(t,r)}var p=t.noChildNodes||[\"img\",\"br\",\"input\",\"meta\",\"link\"];function b(){r++;const t=d(),n={};let i=[];for(;e.charCodeAt(r)!==o&&e[r];){var a=e.charCodeAt(r);if(a>64&&a<91||a>96&&a<123){for(var u=d(),h=e.charCodeAt(r);h&&h!==l&&h!==f&&!(h>64&&h<91||h>96&&h<123)&&h!==o;)r++,h=e.charCodeAt(r);if(h===l||h===f){var b=y();if(-1===r)return{tagName:t,attributes:n,children:i}}else b=null,r--;n[u]=b}r++}if(e.charCodeAt(r-1)!==s)if(\"script\"==t){var v=r+1;r=e.indexOf(\"<\\/script>\",r),i=[e.slice(v,r-1)],r+=9}else\"style\"==t?(v=r+1,r=e.indexOf(\"\",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\");\r\n//# sourceMappingURL=/sm/6b05ec3e6aee27214397dcd933f0a1a0def04511045c0ced378787b04765ef87.map\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/geotiff/geotiff.js?"); /***/ }), @@ -2245,7 +2280,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _loa /***/ (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 (parameters === undefined) parameters = {};\n\n if (id && this.spriteMaterials.hasOwnProperty(id + \"_\" + JSON.stringify(parameters)) && forceNewMaterial !== true) {\n return this.spriteMaterials[id + \"_\" + JSON.stringify(parameters)];\n } else {\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 * Math.ceil(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 texture.anisotropy = 0;\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.wrapT = three__WEBPACK_IMPORTED_MODULE_0__[\"ClampToEdgeWrapping\"];\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 + \"_\" + JSON.stringify(parameters)] = 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?"); +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, options, forceNewMaterial) {\n if (options === void 0) {\n options = {};\n }\n\n var sprite = new three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"](Sprites.makeMarkerMaterial(parameters, id, options, 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, options, forceNewMaterial) {\n if (parameters === undefined) parameters = {};\n\n if (id && this.spriteMaterials.hasOwnProperty(id + \"_\" + JSON.stringify(parameters)) && forceNewMaterial !== true) {\n return this.spriteMaterials[id + \"_\" + JSON.stringify(parameters)];\n } else {\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 ctx = canvas.getContext('2d');\n ctx.lineWidth = strokeWeight * Math.ceil(radius / 8);\n\n if (options.annotation === true) {\n var text = options.name || '';\n var fontXOffset = 10;\n var fontSize = parameters.fontSize || '16px';\n fontSize = parseInt(fontSize.replace('px', '')) * 1.25;\n ctx.font = fontSize + \"pt sans-serif\";\n var heightInnerOverflow = 10;\n var heightOuterOverflow = fontSize / 3.5;\n var textSize = {\n width: ctx.measureText(text).width + fontXOffset * 2,\n height: fontSize + heightInnerOverflow + heightOuterOverflow\n };\n canvas.width = textSize.width;\n canvas.height = textSize.height;\n parameters.width = canvas.width / 6;\n parameters.height = canvas.height / 6;\n ctx.font = fontSize + \"pt sans-serif\";\n var canvasX = 0;\n ctx.fillStyle = strokeColor;\n ctx.fillRect(0, heightOuterOverflow / 2, textSize.width, textSize.height - heightOuterOverflow);\n ctx.fillStyle = fillColor;\n ctx.fillText(text, canvasX + fontXOffset, fontSize + heightOuterOverflow / 2 + heightInnerOverflow / 2);\n } else {\n var width = radius * 2;\n var height = radius * 2;\n canvas.width = width;\n canvas.height = height;\n ctx.beginPath();\n ctx.arc(canvas.width / 2, canvas.height / 2, radius - strokeWeight * (radius / 12), 0, 2 * Math.PI, false);\n\n if (typeof fillColor === 'object') {\n ctx.fillStyle = 'rgba(' + fillColor.r + ',' + fillColor.g + ',' + fillColor.b + ',' + fillColor.a + ')';\n } else {\n ctx.fillStyle = fillColor;\n }\n\n ctx.fill();\n\n if (typeof strokeColor === 'object') {\n ctx.strokeStyle = 'rgba(' + strokeColor.r + ',' + strokeColor.g + ',' + strokeColor.b + ',' + strokeColor.a + ')';\n } else {\n ctx.strokeStyle = strokeColor;\n }\n\n ctx.stroke();\n }\n\n var texture = new three__WEBPACK_IMPORTED_MODULE_0__[\"Texture\"](canvas);\n texture.needsUpdate = true;\n texture.anisotropy = 0;\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.wrapT = three__WEBPACK_IMPORTED_MODULE_0__[\"ClampToEdgeWrapping\"];\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 + \"_\" + JSON.stringify(parameters)] = spriteMaterial;\n }\n\n return spriteMaterial;\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Sprites);\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/sprites.ts?"); /***/ }), @@ -2257,7 +2292,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (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?"); +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 isInExtentEN: function (xyz, bb, proj, margin) {\n if (margin === void 0) {\n margin = 0.0000001;\n }\n\n if (!bb) return true;\n var minE = bb[0],\n minN = bb[1],\n maxE = bb[2],\n maxN = bb[3];\n\n var _a = proj.tileXYZ2NwSe(xyz, proj.trueTileResolution, true),\n min = _a.min,\n max = _a.max;\n\n return max.x > minE + margin && min.x < maxE - margin && max.y > minN + margin && min.y < maxN - margin;\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?"); /***/ }), diff --git a/docs/pages/Functions/functions.markdown b/docs/pages/Functions/functions.markdown index ae179fd..0b7a2cb 100644 --- a/docs/pages/Functions/functions.markdown +++ b/docs/pages/Functions/functions.markdown @@ -12,6 +12,7 @@ A collection of potentially useful functions within the `Litho` object. You can ### addLayer() Adds a new layer to the globe. + `addLayer = (type: string, layerObj: any, callback?: Function): void` type | _string_ | Type of layer to add. | One of ['tile', 'tile3d', 'clamped', 'vector', 'model', ...] @@ -21,6 +22,7 @@ callback | _Function_ | Called when a layer finishes loading (i.e. a vector laye ### removeLayer() Removes an existing layer from the globe. + `removeLayer = (name: string): boolean` name | _string_ | Layer name to remove @@ -30,6 +32,15 @@ _returns_ | _boolean_ | `true` only if layer was found and removed `toggleLayer = (name: string, on?: boolean): boolean` +### orderLayers() + +Takes an array of layer names and does its best to reorder them. Layer names that come first are on top of all later layers. Ultimately only clamped and tile layers get ordered where clamped layers always draw on top of tile layers. Clamped and tile layers that are not listed in the new `ordering` get placed on the bottom of the new draw stack and are ordered there according to their pre-existing order. + +`orderLayers = (ordering: string[]): boolean` + +ordering | _string[]_ | A list of layer names. Index 0 draws on top of index 1 +_returns_ | _boolean_ | `true` + ### setLayerOpacity() `setLayerOpacity = (name: string, opacity: number): boolean` diff --git a/docs/pages/Layers/Clamped/clamped.markdown b/docs/pages/Layers/Clamped/clamped.markdown index f219874..d137b04 100644 --- a/docs/pages/Layers/Clamped/clamped.markdown +++ b/docs/pages/Layers/Clamped/clamped.markdown @@ -9,7 +9,35 @@ parent: Layers Rasterized vector data clamped to the terrain textures. -Example +### Annotations + +Clamped textual annotations can be added using the following extended Point feature schema: + +```json +{ + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [137.358048, -4.673226] + }, + "properties": { + "annotation": true, + "name": "Sample Text", + "style": { + "color": "rgb(0, 0, 0)", + "fillColor": "rgb(255, 255, 255)", + "fillOpacity": 1, + "weight": 2, + "fontSize": "54px", + "rotation": 0, + "minZoom": 15, + "maxZoom": 16 + } + } +} +``` + +## Example ```javascript Litho.addLayer( @@ -30,6 +58,8 @@ Litho.addLayer( color: 'black', weight: 2, radius: 'prop=radius', + minZoom: 11, + maxZoom: 18, }, point: {}, line: {}, @@ -47,8 +77,6 @@ Litho.addLayer( }, }, opacity: 1, - minZoom: 11, - maxZoom: 18, boundingBox: [ 137.3250006349, -4.72500217818315, diff --git a/docs/pages/Layers/Vector/vector.markdown b/docs/pages/Layers/Vector/vector.markdown index fd9e78e..abca3bc 100644 --- a/docs/pages/Layers/Vector/vector.markdown +++ b/docs/pages/Layers/Vector/vector.markdown @@ -9,6 +9,36 @@ parent: Layers An unclamped vector. +### Annotations + +Sprite-based textual annotations can be added using the following extended Point feature schema: + +```json +{ + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [137.348048, -4.673226] + }, + "properties": { + "annotation": true, + "name": "Sample Sprite Text", + "style": { + "color": "rgb(40, 20, 20)", + "fillColor": "rgb(0, 255, 255)", + "fillOpacity": 1, + "weight": 2, + "fontSize": "18px", + "elevOffset": 100, + "minZoom": 12, + "maxZoom": 14 + } + } +} +``` + +On sprite-based vectors, if elevations are not specified in the coordinates pair, the elevation will be automatically computed and given a small vertical offset. Setting the `elevOffset` style allows control (in meters) of what that offset is. + ### Example ```javascript diff --git a/package-lock.json b/package-lock.json index cb36b0f..53fecb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lithosphere", - "version": "1.3.0", + "version": "1.4.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "lithosphere", - "version": "1.3.0", + "version": "1.4.2", "license": "Apache-2.0", "dependencies": { "@turf/boolean-intersects": "^6.3.0", @@ -2369,9 +2369,9 @@ } }, "node_modules/anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", @@ -3359,36 +3359,31 @@ } }, "node_modules/chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], "optional": true, "dependencies": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "~3.6.0" }, "engines": { "node": ">= 8.10.0" - } - }, - "node_modules/chokidar/node_modules/fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" } }, "node_modules/chownr": { @@ -5911,10 +5906,11 @@ "dev": true }, "node_modules/fsevents": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.2.1.tgz", - "integrity": "sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -11860,9 +11856,9 @@ } }, "node_modules/readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "optional": true, "dependencies": { @@ -17389,9 +17385,9 @@ } }, "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "requires": { "normalize-path": "^3.0.0", @@ -18227,29 +18223,20 @@ "dev": true }, "chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "optional": true, "requires": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" - }, - "dependencies": { - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true - } + "readdirp": "~3.6.0" } }, "chownr": { @@ -20314,9 +20301,9 @@ "dev": true }, "fsevents": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.2.1.tgz", - "integrity": "sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "optional": true }, @@ -25117,9 +25104,9 @@ } }, "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "optional": true, "requires": { diff --git a/package.json b/package.json index c5b6bde..cfcf241 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lithosphere", - "version": "1.4.1", + "version": "1.5.0", "description": "LithoSphere is a GIS JavaScript library for building 3D tile-based globes in the web browser.", "author": "Tariq Soliman", "license": "Apache-2.0", diff --git a/public/dist/lithosphere.js b/public/dist/lithosphere.js index 7df2376..45d06e6 100644 --- a/public/dist/lithosphere.js +++ b/public/dist/lithosphere.js @@ -1971,7 +1971,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _uti /***/ (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/* harmony import */ var _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../secondary/OrbitControls */ \"./src/secondary/OrbitControls.ts\");\n/* harmony import */ var _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../secondary/PointerLockControls */ \"./src/secondary/PointerLockControls.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Camera = function () {\n function Camera(container, sceneContainer, scene, projection) {\n var _this = this;\n\n this.onKeyDown = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = true;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = true;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = true;\n break;\n\n case 39:\n case 68:\n _this.moveRight = true;\n break;\n\n case 32:\n if (_this.canJump === true) _this.velocity.y += 350;\n _this.canJump = false;\n break;\n }\n };\n\n this.onKeyUp = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = false;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = false;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = false;\n break;\n\n case 39:\n case 68:\n _this.moveRight = false;\n break;\n }\n };\n\n this.updateSize = function () {\n _this.orbit.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.orbit.camera.updateProjectionMatrix();\n\n _this.firstPerson.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setNearFarPlane = function (farther, near, far, keepNear) {\n if (keepNear === true) _this._.keepNear = true;\n if (keepNear === false) _this._.keepNear = false;\n\n if (farther) {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near * 10000;\n } else {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near;\n _this.orbit.camera.far = _this.orbit.far;\n }\n\n if (near != null) _this.orbit.camera.near = near;\n if (far != null) _this.orbit.camera.far = far;\n\n _this.orbit.camera.updateProjectionMatrix();\n };\n\n this.setFirstPersonHeight = function (height) {\n _this.firstPerson.height = height || 3;\n };\n\n this.getFirstPersonFocalLength = function () {\n return _this.firstPerson.camera.getFocalLength();\n };\n\n this.setFirstPersonFocalLength = function (focalLength) {\n _this.firstPerson.camera.setFocalLength(focalLength);\n };\n\n this.getFirstPersonFOV = function () {\n return _this.firstPerson.camera.fov;\n };\n\n this.setFirstPersonFOV = function (fov) {\n _this.firstPerson.camera.fov = fov;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.getFirstPersonAspect = function () {\n return _this.firstPerson.camera.aspect;\n };\n\n this.setFirstPersonAspect = function (aspect) {\n _this.firstPerson.camera.aspect = aspect;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setCameraAzimuthElevation = function (az, el, cameraIsFirstPerson) {\n _this.firstPerson.controls.getObject().rotation.y = (-az + 180) * (Math.PI / 180);\n _this.firstPerson.controls.getPitchObject().rotation.x = el * (Math.PI / 180);\n };\n\n this.update = function () {\n if (_this.isFirstPerson) {\n var time = performance.now();\n var delta = (time - _this.prevTime) / 1000;\n var speedFactor = 1000;\n _this.prevTime = time;\n _this.velocity.x -= _this.velocity.x * 10.0 * delta;\n _this.velocity.z -= _this.velocity.z * 10.0 * delta;\n _this.velocity.y -= 9.8 * 100.0 * delta;\n if (_this.moveForward) _this.velocity.z -= speedFactor * delta;\n if (_this.moveBackward) _this.velocity.z += speedFactor * delta;\n if (_this.moveLeft) _this.velocity.x -= speedFactor * delta;\n if (_this.moveRight) _this.velocity.x += speedFactor * delta;\n var rp = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].rotatePoint({\n x: _this.velocity.x * delta,\n y: _this.velocity.z * delta\n }, [0, 0], -_this.firstPerson.controls.getObject().rotation.y);\n\n if (_this.isShift) {\n rp.x *= 7;\n rp.y *= 7;\n } else {\n rp.x *= 3;\n rp.y *= 3;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector2\"](rp.x, rp.y);\n }\n\n return null;\n };\n\n this.container = container;\n this.sceneContainer = sceneContainer;\n this.reset();\n\n this._init(scene, projection);\n }\n\n Camera.prototype.reset = function () {\n this.camera = null;\n this.controls = null;\n this.orbit = {\n camera: null,\n controls: null,\n near: 0.1,\n far: 15000000000\n };\n this.firstPerson = {\n camera: null,\n controls: null,\n lockControls: false,\n height: 3\n };\n this.isFirstPerson = false;\n this._ = {\n keepNear: false,\n crosshair: null\n };\n this.isShift = false;\n this.moveForward = null;\n this.moveBackward = null;\n this.moveLeft = null;\n this.moveRight = null;\n this.canJump = null;\n this.prevTime = performance.now();\n this.velocity = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\n };\n\n Camera.prototype._init = function (scene, projection) {\n this.orbit.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, this.orbit.near, this.orbit.far);\n this.orbit.camera.up = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, -1, 0);\n this.orbit.camera.position.set(0, -10000000 / projection.radiusScale, 0);\n this.orbit.controls = new _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.orbit.camera, this.sceneContainer);\n this.orbit.controls.enabled = true;\n this.orbit.controls.enableDamping = true;\n this.orbit.controls.dampingFactor = 0.2;\n this.orbit.controls.target.y = 1;\n this.orbit.controls.mouseButtons.ORBIT = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].RIGHT;\n this.orbit.controls.mouseButtons.PAN = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].LEFT;\n this.orbit.controls.maxDistance = projection.radii.major * 4;\n this.orbit.controls.maxPolarAngle = Math.PI / 2;\n this.orbit.controls.enablePan = false;\n this.firstPerson.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, 0.1, 150000000);\n this.firstPerson.controls = new _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.firstPerson.camera);\n this.firstPerson.controls.getObject().rotation.set(Math.PI, Math.PI, 0);\n this.firstPerson.controls.getObject().position.set(0, 10000000 / projection.radiusScale, 0);\n scene.add(this.firstPerson.controls.getObject());\n\n if (this.isFirstPerson) {\n this.requestPointerLocking();\n } else {\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n\n this.updateSize();\n this.setupEvents();\n this.orbit.controls.update();\n };\n\n Camera.prototype.swap = function (lockControls, skipLock) {\n this.isFirstPerson = !this.isFirstPerson;\n\n if (this.isFirstPerson) {\n this.firstPerson.lockControls = lockControls || false;\n if (!skipLock) this.requestPointerLocking();\n this.inToFirstPerson();\n } else {\n this.outFromFirstPerson();\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n };\n\n Camera.prototype.inToFirstPerson = function () {\n this.isFirstPerson = true;\n this.toggleCrosshair(true);\n this.camera = this.firstPerson.camera;\n this.firstPerson.controls.enabled = !this.firstPerson.lockControls;\n this.controls = this.firstPerson.controls;\n this.orbit.controls.resetPosition();\n };\n\n Camera.prototype.outFromFirstPerson = function () {\n this.isFirstPerson = false;\n this.toggleCrosshair(false);\n this.firstPerson.controls.enabled = false;\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n };\n\n Camera.prototype.toggleCrosshair = function (on) {\n if (this._.crosshair == null) {\n this._.crosshair = document.createElement('div');\n this._.crosshair.id = '_lithosphere_crosshair';\n 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(';');\n this.container.appendChild(this._.crosshair);\n }\n\n if (on) this._.crosshair.style.display = 'inherit';else this._.crosshair.style.display = 'none';\n };\n\n Camera.prototype.requestPointerLocking = function () {\n var _this = this;\n\n var havePointerLock = ('pointerLockElement' in document);\n\n if (havePointerLock) {\n var element_1 = document.body;\n\n var pointerlockchange = function () {\n if (document.pointerLockElement === element_1) {\n _this.inToFirstPerson();\n } else {\n _this.outFromFirstPerson();\n }\n };\n\n var pointerlockerror = function (e) {\n alert('Pointer Lock Error');\n };\n\n document.addEventListener('pointerlockchange', pointerlockchange, false);\n document.addEventListener('mozpointerlockchange', pointerlockchange, false);\n document.addEventListener('webkitpointerlockchange', pointerlockchange, false);\n document.addEventListener('pointerlockerror', pointerlockerror, false);\n document.addEventListener('mozpointerlockerror', pointerlockerror, false);\n document.addEventListener('webkitpointerlockerror', pointerlockerror, false);\n\n if (/Firefox/i.test(navigator.userAgent)) {\n var fullscreenchange_1 = function () {\n if (document.fullscreenElement === element_1) {\n document.removeEventListener('fullscreenchange', fullscreenchange_1);\n document.removeEventListener('mozfullscreenchange', fullscreenchange_1);\n element_1.requestPointerLock();\n }\n };\n\n document.addEventListener('fullscreenchange', fullscreenchange_1, false);\n document.addEventListener('mozfullscreenchange', fullscreenchange_1, false);\n element_1.requestFullscreen();\n } else {\n element_1.requestPointerLock();\n }\n } else {\n this.isFirstPerson = false;\n alert('This browser does not support Pointer Locking.');\n }\n };\n\n Camera.prototype.setupEvents = function () {\n document.addEventListener('keydown', this.onKeyDown, false);\n document.addEventListener('keyup', this.onKeyUp, false);\n window.addEventListener('resize', this.updateSize, false);\n };\n\n return Camera;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Camera);\n\n//# sourceURL=webpack://LithoSphere/./src/core/cameras.ts?"); +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/* harmony import */ var _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../secondary/OrbitControls */ \"./src/secondary/OrbitControls.ts\");\n/* harmony import */ var _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../secondary/PointerLockControls */ \"./src/secondary/PointerLockControls.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Camera = function () {\n function Camera(container, sceneContainer, scene, projection) {\n var _this = this;\n\n this.onKeyDown = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = true;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = true;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = true;\n break;\n\n case 39:\n case 68:\n _this.moveRight = true;\n break;\n\n case 32:\n if (_this.canJump === true) _this.velocity.y += 350;\n _this.canJump = false;\n break;\n }\n };\n\n this.onKeyUp = function (event) {\n if (_this.firstPerson.lockControls) return;\n _this.isShift = event.shiftKey;\n\n switch (event.keyCode) {\n case 38:\n case 87:\n _this.moveForward = false;\n break;\n\n case 37:\n case 65:\n _this.moveLeft = false;\n break;\n\n case 40:\n case 83:\n _this.moveBackward = false;\n break;\n\n case 39:\n case 68:\n _this.moveRight = false;\n break;\n }\n };\n\n this.updateSize = function () {\n _this.orbit.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.orbit.camera.updateProjectionMatrix();\n\n _this.firstPerson.camera.aspect = _this.sceneContainer.offsetWidth / _this.sceneContainer.offsetHeight;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setNearFarPlane = function (scalar, farther, near, far, keepNear) {\n if (scalar === void 0) {\n scalar = 1;\n }\n\n if (keepNear === true) _this._.keepNear = true;\n if (keepNear === false) _this._.keepNear = false;\n\n if (farther) {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near * 10000 / scalar;\n } else {\n if (!_this._.keepNear) _this.orbit.camera.near = _this.orbit.near;\n _this.orbit.camera.far = _this.orbit.far;\n }\n\n if (near != null) _this.orbit.camera.near = near;\n if (far != null) _this.orbit.camera.far = far;\n\n _this.orbit.camera.updateProjectionMatrix();\n };\n\n this.setFirstPersonHeight = function (height) {\n _this.firstPerson.height = height || 3;\n };\n\n this.getFirstPersonFocalLength = function () {\n return _this.firstPerson.camera.getFocalLength();\n };\n\n this.setFirstPersonFocalLength = function (focalLength) {\n _this.firstPerson.camera.setFocalLength(focalLength);\n };\n\n this.getFirstPersonFOV = function () {\n return _this.firstPerson.camera.fov;\n };\n\n this.setFirstPersonFOV = function (fov) {\n _this.firstPerson.camera.fov = fov;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.getFirstPersonAspect = function () {\n return _this.firstPerson.camera.aspect;\n };\n\n this.setFirstPersonAspect = function (aspect) {\n _this.firstPerson.camera.aspect = aspect;\n\n _this.firstPerson.camera.updateProjectionMatrix();\n };\n\n this.setCameraAzimuthElevation = function (az, el, cameraIsFirstPerson) {\n _this.firstPerson.controls.getObject().rotation.y = (-az + 180) * (Math.PI / 180);\n _this.firstPerson.controls.getPitchObject().rotation.x = el * (Math.PI / 180);\n };\n\n this.update = function () {\n if (_this.isFirstPerson) {\n var time = performance.now();\n var delta = (time - _this.prevTime) / 1000;\n var speedFactor = 1000;\n _this.prevTime = time;\n _this.velocity.x -= _this.velocity.x * 10.0 * delta;\n _this.velocity.z -= _this.velocity.z * 10.0 * delta;\n _this.velocity.y -= 9.8 * 100.0 * delta;\n if (_this.moveForward) _this.velocity.z -= speedFactor * delta;\n if (_this.moveBackward) _this.velocity.z += speedFactor * delta;\n if (_this.moveLeft) _this.velocity.x -= speedFactor * delta;\n if (_this.moveRight) _this.velocity.x += speedFactor * delta;\n var rp = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].rotatePoint({\n x: _this.velocity.x * delta,\n y: _this.velocity.z * delta\n }, [0, 0], -_this.firstPerson.controls.getObject().rotation.y);\n\n if (_this.isShift) {\n rp.x *= 7;\n rp.y *= 7;\n } else {\n rp.x *= 3;\n rp.y *= 3;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector2\"](rp.x, rp.y);\n }\n\n return null;\n };\n\n this.container = container;\n this.sceneContainer = sceneContainer;\n this.reset();\n\n this._init(scene, projection);\n }\n\n Camera.prototype.reset = function () {\n this.camera = null;\n this.controls = null;\n this.orbit = {\n camera: null,\n controls: null,\n near: 0.1,\n far: 150000000000\n };\n this.firstPerson = {\n camera: null,\n controls: null,\n lockControls: false,\n height: 3\n };\n this.isFirstPerson = false;\n this._ = {\n keepNear: false,\n crosshair: null\n };\n this.isShift = false;\n this.moveForward = null;\n this.moveBackward = null;\n this.moveLeft = null;\n this.moveRight = null;\n this.canJump = null;\n this.prevTime = performance.now();\n this.velocity = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\n };\n\n Camera.prototype._init = function (scene, projection) {\n this.orbit.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, this.orbit.near, this.orbit.far);\n this.orbit.camera.up = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, -1, 0);\n this.orbit.camera.position.set(0, -10000000 * projection.radiusScale, 0);\n this.orbit.controls = new _secondary_OrbitControls__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.orbit.camera, this.sceneContainer);\n this.orbit.controls.enabled = true;\n this.orbit.controls.enableDamping = true;\n this.orbit.controls.dampingFactor = 0.2;\n this.orbit.controls.target.y = 1;\n this.orbit.controls.mouseButtons.ORBIT = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].RIGHT;\n this.orbit.controls.mouseButtons.PAN = three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].LEFT;\n this.orbit.controls.maxDistance = projection.radii.major * 4;\n this.orbit.controls.maxPolarAngle = Math.PI / 2;\n this.orbit.controls.enablePan = false;\n this.firstPerson.camera = new three__WEBPACK_IMPORTED_MODULE_0__[\"PerspectiveCamera\"](60, this.sceneContainer.offsetWidth / this.sceneContainer.offsetHeight, 0.1, 150000000);\n this.firstPerson.controls = new _secondary_PointerLockControls__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.firstPerson.camera);\n this.firstPerson.controls.getObject().rotation.set(Math.PI, Math.PI, 0);\n this.firstPerson.controls.getObject().position.set(0, 10000000 * projection.radiusScale, 0);\n scene.add(this.firstPerson.controls.getObject());\n\n if (this.isFirstPerson) {\n this.requestPointerLocking();\n } else {\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n\n this.updateSize();\n this.setupEvents();\n this.orbit.controls.update();\n };\n\n Camera.prototype.swap = function (lockControls, skipLock) {\n this.isFirstPerson = !this.isFirstPerson;\n\n if (this.isFirstPerson) {\n this.firstPerson.lockControls = lockControls || false;\n if (!skipLock) this.requestPointerLocking();\n this.inToFirstPerson();\n } else {\n this.outFromFirstPerson();\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n }\n };\n\n Camera.prototype.inToFirstPerson = function () {\n this.isFirstPerson = true;\n this.toggleCrosshair(true);\n this.camera = this.firstPerson.camera;\n this.firstPerson.controls.enabled = !this.firstPerson.lockControls;\n this.controls = this.firstPerson.controls;\n this.orbit.controls.resetPosition();\n };\n\n Camera.prototype.outFromFirstPerson = function () {\n this.isFirstPerson = false;\n this.toggleCrosshair(false);\n this.firstPerson.controls.enabled = false;\n this.camera = this.orbit.camera;\n this.controls = this.orbit.controls;\n };\n\n Camera.prototype.toggleCrosshair = function (on) {\n if (this._.crosshair == null) {\n this._.crosshair = document.createElement('div');\n this._.crosshair.id = '_lithosphere_crosshair';\n 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(';');\n this.container.appendChild(this._.crosshair);\n }\n\n if (on) this._.crosshair.style.display = 'inherit';else this._.crosshair.style.display = 'none';\n };\n\n Camera.prototype.requestPointerLocking = function () {\n var _this = this;\n\n var havePointerLock = ('pointerLockElement' in document);\n\n if (havePointerLock) {\n var element_1 = document.body;\n\n var pointerlockchange = function () {\n if (document.pointerLockElement === element_1) {\n _this.inToFirstPerson();\n } else {\n _this.outFromFirstPerson();\n }\n };\n\n var pointerlockerror = function (e) {\n alert('Pointer Lock Error');\n };\n\n document.addEventListener('pointerlockchange', pointerlockchange, false);\n document.addEventListener('mozpointerlockchange', pointerlockchange, false);\n document.addEventListener('webkitpointerlockchange', pointerlockchange, false);\n document.addEventListener('pointerlockerror', pointerlockerror, false);\n document.addEventListener('mozpointerlockerror', pointerlockerror, false);\n document.addEventListener('webkitpointerlockerror', pointerlockerror, false);\n\n if (/Firefox/i.test(navigator.userAgent)) {\n var fullscreenchange_1 = function () {\n if (document.fullscreenElement === element_1) {\n document.removeEventListener('fullscreenchange', fullscreenchange_1);\n document.removeEventListener('mozfullscreenchange', fullscreenchange_1);\n element_1.requestPointerLock();\n }\n };\n\n document.addEventListener('fullscreenchange', fullscreenchange_1, false);\n document.addEventListener('mozfullscreenchange', fullscreenchange_1, false);\n element_1.requestFullscreen();\n } else {\n element_1.requestPointerLock();\n }\n } else {\n this.isFirstPerson = false;\n alert('This browser does not support Pointer Locking.');\n }\n };\n\n Camera.prototype.setupEvents = function () {\n document.addEventListener('keydown', this.onKeyDown, false);\n document.addEventListener('keyup', this.onKeyUp, false);\n window.addEventListener('resize', this.updateSize, false);\n };\n\n return Camera;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Camera);\n\n//# sourceURL=webpack://LithoSphere/./src/core/cameras.ts?"); /***/ }), @@ -1983,7 +1983,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (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/* harmony import */ var _turf_circle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/circle */ \"./node_modules/@turf/circle/dist/es/index.js\");\n/* harmony import */ var _turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/boolean-intersects */ \"./node_modules/@turf/boolean-intersects/dist/es/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Events = function () {\n function Events(parent) {\n var _this = this;\n\n this._rotateGlobe = function (e, prevXY) {\n if (prevXY) {\n _this._.prevMouseXY.x = prevXY.x;\n _this._.prevMouseXY.y = prevXY.y;\n }\n\n if (!e) return;\n if (!e.pageX && e.touches) e.pageX = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n if (!e.pageY && e.touches) e.pageY = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n if (e.hasOwnProperty('x') && e.hasOwnProperty('y') && _this.p._.cameras.isFirstPerson) {\n _this._.prevMouseXY.x = 0;\n _this._.prevMouseXY.y = 0;\n e.pageX = e.x;\n e.pageY = e.y;\n }\n\n var rotSpeed = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getRadiansPerPixel(_this.p.trueZoom) * 0.5 * (_this.p._.marsRadius / _this.p.projection.radii.major);\n\n var pixelDif = 0;\n var cpX = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n cpX.applyAxisAngle(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, 1, 0), Math.PI / 2);\n var cpY = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n\n if (e.pageY < _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, rotSpeed * pixelDif);\n } else if (e.pageY > _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, -rotSpeed * pixelDif);\n }\n\n if (e.pageX > _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, -rotSpeed * pixelDif);\n } else if (e.pageX < _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, rotSpeed * pixelDif);\n }\n\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n if (_this.p.zoom <= _this.p._.zCutOff) {\n _this.p._.cameras.orbit.controls.target.x = 0;\n _this.p._.cameras.orbit.controls.target.y = -_this.p.planetCenter.y;\n _this.p._.cameras.orbit.controls.target.z = 0;\n\n _this.p._.cameras.orbit.controls.update();\n } else {\n var elevRaw = _this.p.getCenterElevationRaw();\n\n if (elevRaw != null) {\n var newLookAtY = -(elevRaw + _this.p.planetCenter.y);\n if (newLookAtY != 0 && newLookAtY != -10000) _this.p._.cameras.orbit.controls.target.y = newLookAtY - _this.p.options.targetYOffset;\n }\n\n var center = _this.p.getCenter();\n\n _this.p.controls._onMove(center.lng, center.lat, center.height);\n }\n };\n\n this._rotateGlobe_MouseDown = function (e) {\n if (e.which === 1 || e.button === 0) {\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n _this.p._.sceneContainer.addEventListener('mousemove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('mouseup', _this._rotateGlobe_MouseUp, false);\n\n _this.p._.sceneContainer.addEventListener('mouseleave', _this._rotateGlobe_MouseUp, false);\n } else if (e.touches && e.touches.length > 2) {\n _this._.prevMouseXY.x = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n _this._.prevMouseXY.y = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n _this.p._.sceneContainer.addEventListener('touchmove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('touchend', _this._rotateGlobe_MouseUp, false);\n }\n };\n\n this._rotateGlobe_MouseUp = function (e) {\n _this.p._.sceneContainer.removeEventListener('mousemove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('mouseup', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('mouseleave', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('touchmove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('touchend', _this._rotateGlobe_MouseUp);\n };\n\n this._onZoom = function (e) {\n _this._.zoomedSince = 0;\n\n var zoomDist = _this.p._.cameras.orbit.camera.position.distanceTo(_this.p._.cameras.orbit.controls.target);\n\n var nf = 8 - (_this.p.projection.radiusScale.toString().length - 1);\n var dZoom = Math.ceil((nf * Math.log(2) - Math.log(zoomDist / Math.pow(5, nf - 1))) / Math.log(2)) + 1;\n _this._.desiredZoom = dZoom;\n\n _this._attenuate();\n };\n\n this._onTouchZoom = function (e) {\n if (e.touches && e.touches.length == 1) _this._onZoom(e);\n };\n\n this._onClick = function (e) {\n if (_this.hoveredFeature && _this.hoverInfo) {\n var layer = _this.p.layers.getLayerByName(_this.hoveredFeature.layerName);\n\n if (layer) {\n _this.setActiveFeature({\n layerName: _this.hoveredFeature.layerName,\n type: _this.hoveredFeature.type,\n obj: _this.hoveredFeature.obj,\n feature: _this.hoveredFeature.feature || _this.hoveredFeature.obj.feature,\n lnglat: {\n lng: _this.hoveredFeature.lnglat.lng,\n lat: _this.hoveredFeature.lnglat.lat\n }\n });\n\n if (typeof layer.onClick === 'function') {\n layer.onClick(JSON.parse(JSON.stringify(_this.hoveredFeature.feature)), JSON.parse(JSON.stringify(_this.hoveredFeature.lnglat)), layer);\n }\n }\n }\n };\n\n this._onKeyDown = function (e) {\n if (_this.p._.cameras.isFirstPerson) return;\n var speed = e.shiftKey ? 20 : 8;\n\n switch (e.key) {\n case 'w':\n case 'ArrowUp':\n _this._rotateGlobe({\n pageX: 0,\n pageY: speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'a':\n case 'ArrowLeft':\n _this._rotateGlobe({\n pageX: speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 's':\n case 'ArrowDown':\n _this._rotateGlobe({\n pageX: 0,\n pageY: -speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'd':\n case 'ArrowRight':\n _this._rotateGlobe({\n pageX: -speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'g':\n case 'PageDown':\n var lerpedDown = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? -0.035 : -0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedDown.x, lerpedDown.y, lerpedDown.z);\n\n _this._onZoom();\n\n break;\n\n case 't':\n case 'PageUp':\n var lerpedUp = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? 0.035 : 0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedUp.x, lerpedUp.y, lerpedUp.z);\n\n _this._onZoom();\n\n break;\n\n case 'q':\n _this.p._.cameras.orbit.controls.rotateLeft(Math.PI / 64);\n\n break;\n\n case 'e':\n _this.p._.cameras.orbit.controls.rotateLeft(-Math.PI / 64);\n\n break;\n\n case 'r':\n _this.p._.cameras.orbit.controls.rotateUp(Math.PI / 64);\n\n break;\n\n case 'f':\n _this.p._.cameras.orbit.controls.rotateUp(-Math.PI / 64);\n\n break;\n }\n };\n\n this._onMouseMove = function (e) {\n _this.p._.mouseIsInScene = true;\n\n if (_this.p._.cameras.isFirstPerson) {\n _this._.mouseXY.x = 0;\n _this._.mouseXY.y = 0;\n } else {\n _this._.mouseXY.x = (e.clientX - _this.p._.renderer.domElement.getBoundingClientRect().left) / _this.p._.renderer.domElement.clientWidth * 2 - 1;\n _this._.mouseXY.y = -((e.clientY - _this.p._.renderer.domElement.getBoundingClientRect().top) / _this.p._.renderer.domElement.clientHeight) * 2 + 1;\n }\n\n _this._.containerXY = {\n x: e ? e.offsetX : null,\n y: e ? e.offsetY : null\n };\n\n _this.updateHoverInfoPosition();\n\n _this.p._.raycaster.setFromCamera(_this._.mouseXY, _this.p._.cameras.camera);\n\n var intersectArr = [];\n\n for (var i = 0; i < _this.p._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this.p._.tiledWorld.tilesDrawn[i].isLODTile) intersectArr.push(_this.p._.tiledWorld.tilesDrawn[i].t);\n }\n\n for (var i = 0; i < _this.p.layers.vector.length; i++) {\n if (_this.p.layers.vector[i].meshes && _this.p.layers.vector[i].meshes.children) for (var j = 0; j < _this.p.layers.vector[i].meshes.children.length; j++) intersectArr.push(_this.p.layers.vector[i].meshes.children[j]);\n }\n\n for (var i = 0; i < _this.p.layers.curtain.length; i++) {\n if (_this.p.layers.curtain[i].curtain && _this.p.layers.curtain[i].curtain.children) for (var j = 0; j < _this.p.layers.curtain[i].curtain.children.length; j++) intersectArr.push(_this.p.layers.curtain[i].curtain.children[j]);\n }\n\n var intersects = _this.p._.raycaster.intersectObjects(intersectArr);\n\n if (intersects.length > 0) {\n var type_1 = intersects[0].object.type;\n var obj_1 = null;\n\n switch (type_1) {\n case 'Sprite':\n obj_1 = intersects[0].object;\n break;\n\n case 'Line2':\n obj_1 = intersects[0].object;\n break;\n\n case 'Mesh':\n obj_1 = _this.p._.tiledWorld.findTileDrawnBasedOnUUID(intersects[0].object.uuid);\n\n if (obj_1 == null) {\n obj_1 = intersects[0].object;\n }\n\n break;\n\n default:\n return;\n break;\n }\n\n var savedIntersectionPoint_1 = intersects[0].point;\n intersects[0].point.y += _this.p.planetCenter.y;\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: -_this.p.planet.rotation.x,\n y: 0,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: -_this.p.planet.rotation.y,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: 0,\n z: -_this.p.planet.rotation.z\n });\n\n var intersectedLL_1 = _this.p.projection.vector3ToLatLng(intersects[0].point);\n\n intersectedLL_1.height = savedIntersectionPoint_1.length() * _this.p.projection.radiusScale - _this.p.projection.radii.major;\n\n _this._updateMouseCoords(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height);\n\n clearTimeout(_this._.highlightTimeout);\n _this._.highlightTimeout = setTimeout(function () {\n _this._highlightFeature(intersectedLL_1.lng, intersectedLL_1.lat, type_1, obj_1, intersects[0], savedIntersectionPoint_1);\n }, 10);\n\n _this.p.layers._onMouseMove(intersectedLL_1, e, obj_1, intersects[0], savedIntersectionPoint_1);\n\n _this.p.controls._onMouseMove(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height, e);\n } else {\n _this._updateMouseCoords(null, null, null);\n\n _this._unhighlightHoveredFeature();\n\n _this.p.controls._onMouseMove(null, null, null, e);\n }\n };\n\n this.p = parent;\n this.activeFeature = null;\n this.hoveredFeature = null;\n this.hoverInfo = null;\n this._ = {\n mouseXY: {\n x: null,\n y: null\n },\n prevMouseXY: {\n x: null,\n y: null\n },\n containerXY: {\n x: null,\n y: null\n },\n lastZoomDelta: 1,\n desiredZoom: null,\n zoomedSince: 0,\n zoomWait: 30,\n highlightTimeout: null\n };\n\n this._init();\n }\n\n Events.prototype._init = function () {\n var _this = this;\n\n this._matchPlanetsLODToPlanet();\n\n this.p._.sceneContainer.addEventListener('mousewheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('DOMMouseScroll', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('wheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', this.p.controls._onMouseOut, false);\n\n this.p._.sceneContainer.addEventListener('touchend', this._onTouchZoom);\n\n this.p._.sceneContainer.addEventListener('mousedown', this._rotateGlobe_MouseDown, false);\n\n this.p._.sceneContainer.addEventListener('mousemove', this._onMouseMove, false);\n\n this.p._.sceneContainer.addEventListener('click', this._onClick, false);\n\n this.p._.sceneContainer.addEventListener('mouseenter', function () {\n _this.p._.mouseIsInScene = true;\n }, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', function () {\n _this.p._.mouseIsInScene = false;\n }, false);\n\n window.addEventListener('keydown', this._onKeyDown, false);\n };\n\n Events.prototype._rotateAroundArbAxis = function (axis, radians, noPremultiply) {\n var rotationMatrix = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\n rotationMatrix.makeRotationAxis(axis.normalize(), radians);\n if (noPremultiply !== true) rotationMatrix.multiply(this.p.planet.matrix);\n this.p.planet.matrix = rotationMatrix;\n this.p.planet.rotation.setFromRotationMatrix(this.p.planet.matrix);\n\n this._matchPlanetsLODToPlanet();\n\n this._refreshFrontGroupRotation();\n };\n\n Events.prototype._checkDesiredZoom = function () {\n this._.zoomedSince++;\n\n if (this._.desiredZoom != null) {\n this.p._.cameras.setNearFarPlane(this._.desiredZoom < 14);\n\n if (this._.zoomedSince > this._.zoomWait) {\n if (this._.desiredZoom >= this.p._.minNativeZoom) this._setZoom(this._.desiredZoom);\n this._.desiredZoom = null;\n }\n }\n };\n\n Events.prototype._setZoom = function (newZoom) {\n var zoomSave = this.p.zoom;\n this.p.zoom = newZoom;\n this.p.trueZoom = Math.max(0, newZoom);\n if (this.p.zoom < 0) this.p.zoom = 0;\n if (this.p.zoom < this.p._.minNativeZoom) this.p.zoom = this.p._.minNativeZoom;\n if (this.p.zoom > this.p._.maxZoom) this.p.zoom = this.p._.maxZoom;\n this._.lastZoomDelta = Math.abs(this.p.zoom - zoomSave);\n };\n\n Events.prototype._matchPlanetsLODToPlanet = function () {\n for (var i = 0; i < this.p.planetsLOD.length; i++) {\n this.p.planetsLOD[i].matrix = this.p.planet.matrix;\n this.p.planetsLOD[i].position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.planetsLOD[i].rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n\n if (this.p.atmosphere) {\n this.p.atmosphere.matrix = this.p.planet.matrix;\n this.p.atmosphere.position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.atmosphere.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n };\n\n Events.prototype._refreshFrontGroupRotation = function () {\n this.p.frontGroup.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n };\n\n Events.prototype._updateMouseCoords = function (lng, lat, elev) {\n this.p.mouse.lng = lng;\n this.p.mouse.lat = lat;\n this.p.mouse.elev = elev;\n };\n\n Events.prototype.updateHoverInfoPosition = function () {\n if (this.hoverInfo) {\n this.hoverInfo.style.left = this._.containerXY.x + 14 + \"px\";\n this.hoverInfo.style.top = this._.containerXY.y + 14 + \"px\";\n }\n };\n\n Events.prototype._highlightFeature = function (lng, lat, type, obj, intersectionRaw, intersectionPoint) {\n var cursor = {\n type: 'Point',\n coordinates: [lng, lat]\n };\n var highlighted = false;\n\n switch (type) {\n case 'Sprite':\n case 'Line2':\n highlighted = true;\n if (obj.feature._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n obj.feature._highlighted = true;\n obj.restyle();\n this.setHoveredFeature({\n layerName: obj.layerName,\n type: type,\n obj: obj,\n feature: obj.feature,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n break;\n\n case 'Mesh':\n if (obj.layerType === 'curtain') {} else if (obj.layerType === 'model') {} else if (obj.contains) {\n for (var _i = 0, _a = Object.keys(obj.contains).reverse(); _i < _a.length; _i++) {\n var layerName = _a[_i];\n\n for (var _b = 0, _c = obj.contains[layerName].reverse(); _b < _c.length; _b++) {\n var f = _c[_b];\n var feature = Object.assign({}, f);\n\n if (feature.geometry.type.toLowerCase() === 'point') {\n feature = Object(_turf_circle__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(feature.geometry.coordinates, feature._radiusInMeters || 1, {\n steps: 12,\n units: 'meters',\n properties: feature.properties\n });\n }\n\n if (Object(_turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(feature, cursor)) {\n highlighted = true;\n if (f._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n f._highlighted = true;\n this.setHoveredFeature({\n layerName: layerName,\n type: type,\n obj: obj,\n feature: f,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n\n this.p._.tiledWorld.updateClampedRasterForTile(obj, layerName);\n\n break;\n }\n }\n\n if (highlighted) return;\n }\n }\n\n break;\n\n default:\n break;\n }\n\n if (!highlighted) {\n this._unhighlightHoveredFeature();\n }\n };\n\n Events.prototype._unhighlightHoveredFeature = function () {\n if (this.hoveredFeature) {\n this.hoveredFeature.feature._highlighted = false;\n\n switch (this.hoveredFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.hoveredFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.hoveredFeature.obj, this.hoveredFeature.layerName);\n\n break;\n\n default:\n break;\n }\n\n this.clearHoveredFeature();\n }\n };\n\n Events.prototype.setHoveredFeature = function (hoveredFeature) {\n this.hoveredFeature = hoveredFeature;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n }\n\n this.hoverInfo = document.createElement('div');\n this.hoverInfo.id = '_lithosphere_hover_info';\n var layer = this.p.layers.getLayerByName(this.hoveredFeature.layerName);\n\n if (layer && layer.useKeyAsHoverName) {\n var text = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getIn(this.hoveredFeature.feature.properties, layer.useKeyAsHoverName.split('.'));\n\n if (text != null) {\n this.hoverInfo.innerHTML = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].capitalizeFirstLetter(layer.useKeyAsHoverName + \": \" + text);\n this.hoverInfo.style.position = 'absolute';\n this.hoverInfo.style.background = 'black';\n this.hoverInfo.style.color = 'white';\n this.hoverInfo.style.fontSize = '16px';\n this.hoverInfo.style.fontFamily = 'sans-serif';\n this.hoverInfo.style.fontWeight = 'bold';\n this.hoverInfo.style.padding = '4px 8px';\n this.updateHoverInfoPosition();\n }\n }\n\n this.p._.container.appendChild(this.hoverInfo);\n\n this.p._.container.style.cursor = 'pointer';\n };\n\n Events.prototype.clearHoveredFeature = function () {\n this.hoveredFeature = null;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n this.p._.container.style.cursor = 'default';\n }\n };\n\n Events.prototype.setActiveFeature = function (activeFeature) {\n this.clearActiveFeature();\n this.activeFeature = activeFeature;\n this.activeFeature.feature._active = true;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n };\n\n Events.prototype.clearActiveFeature = function () {\n if (this.activeFeature) {\n this.activeFeature.feature._active = false;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n }\n\n this.activeFeature = null;\n };\n\n Events.prototype._attenuate = function () {\n var zoomDist = this.p._.cameras.camera.position.distanceTo(this.p._.cameras.controls.target);\n\n var attenuationFactor = zoomDist / 256;\n\n if (this.p.layers.vector) {\n this.p.layers.vector.forEach(function (vectorLayer) {\n if (vectorLayer.meshes && vectorLayer.meshes.children) {\n vectorLayer.meshes.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius);\n }\n });\n }\n });\n }\n\n if (this.p.frontGroup.children) {\n this.p.frontGroup.children.forEach(function (child) {\n if (child.children && child.children.length > 0) {\n child.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius);\n }\n });\n } else {\n if (child instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n child.scale.set(attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius, attenuationFactor * mesh.style.radius);\n }\n }\n });\n }\n };\n\n return Events;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Events);\n\n//# sourceURL=webpack://LithoSphere/./src/core/events.ts?"); +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/* harmony import */ var _turf_circle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/circle */ \"./node_modules/@turf/circle/dist/es/index.js\");\n/* harmony import */ var _turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/boolean-intersects */ \"./node_modules/@turf/boolean-intersects/dist/es/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\n\n\n\n\nvar Events = function () {\n function Events(parent) {\n var _this = this;\n\n this._rotateGlobe = function (e, prevXY, fromDamping) {\n if (prevXY) {\n _this._.prevMouseXY.x = prevXY.x;\n _this._.prevMouseXY.y = prevXY.y;\n } else if (!fromDamping) {\n _this._.panned = true;\n }\n\n if (!e) return;\n if (!e.pageX && e.touches) e.pageX = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n if (!e.pageY && e.touches) e.pageY = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n if (e.hasOwnProperty('x') && e.hasOwnProperty('y') && _this.p._.cameras.isFirstPerson) {\n _this._.prevMouseXY.x = 0;\n _this._.prevMouseXY.y = 0;\n e.pageX = e.x;\n e.pageY = e.y;\n }\n\n var rotSpeed = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getRadiansPerPixel(_this.p.trueZoom) * 0.5 * (3396190 / _this.p.projection.radii.major);\n\n var pixelDif = 0;\n var cpX = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n cpX.applyAxisAngle(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](0, 1, 0), Math.PI / 2);\n var cpY = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](_this.p._.cameras.orbit.camera.position.x, 0, _this.p._.cameras.orbit.camera.position.z);\n\n if (e.pageY < _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, rotSpeed * pixelDif);\n } else if (e.pageY > _this._.prevMouseXY.y) {\n pixelDif = Math.abs(e.pageY - _this._.prevMouseXY.y);\n\n _this._rotateAroundArbAxis(cpX, -rotSpeed * pixelDif);\n }\n\n if (e.pageX > _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, -rotSpeed * pixelDif);\n } else if (e.pageX < _this._.prevMouseXY.x) {\n pixelDif = Math.abs(e.pageX - _this._.prevMouseXY.x);\n\n _this._rotateAroundArbAxis(cpY, rotSpeed * pixelDif);\n }\n\n _this._.oldPrevMouseXY.x = _this._.prevMouseXY.x;\n _this._.oldPrevMouseXY.y = _this._.prevMouseXY.y;\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n if (_this.p.zoom <= _this.p._.zCutOff) {\n _this.p._.cameras.orbit.controls.target.x = 0;\n _this.p._.cameras.orbit.controls.target.y = -_this.p.planetCenter.y;\n _this.p._.cameras.orbit.controls.target.z = 0;\n\n _this.p._.cameras.orbit.controls.update();\n } else {\n var elevRaw = _this.p.getCenterElevationRaw();\n\n if (elevRaw != null) {\n var newLookAtY = -(elevRaw + _this.p.planetCenter.y);\n if (newLookAtY != 0 && newLookAtY != -10000) _this.p._.cameras.orbit.controls.target.y = newLookAtY - _this.p.options.targetYOffset;\n }\n\n var center = _this.p.getCenter();\n\n _this.p.controls._onMove(center.lng, center.lat, center.height);\n }\n };\n\n this._rotateGlobe_MouseDown = function (e) {\n clearInterval(_this._.rotationDampingInterval);\n\n if (e.which === 1 || e.button === 0) {\n _this._.prevMouseXY.x = e.pageX;\n _this._.prevMouseXY.y = e.pageY;\n\n _this.p._.sceneContainer.addEventListener('mousemove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('mouseup', _this._rotateGlobe_MouseUp, false);\n\n _this.p._.sceneContainer.addEventListener('mouseleave', _this._rotateGlobe_MouseUp, false);\n } else if (e.touches && e.touches.length > 2) {\n _this._.prevMouseXY.x = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageX');\n _this._.prevMouseXY.y = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].arrayAverage(e.touches, 'pageY');\n\n _this.p._.sceneContainer.addEventListener('touchmove', _this._rotateGlobe, false);\n\n _this.p._.sceneContainer.addEventListener('touchend', _this._rotateGlobe_MouseUp, false);\n }\n };\n\n this._rotateGlobe_MouseUp = function (e) {\n _this.p._.sceneContainer.removeEventListener('mousemove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('mouseup', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('mouseleave', _this._rotateGlobe_MouseUp);\n\n _this.p._.sceneContainer.removeEventListener('touchmove', _this._rotateGlobe);\n\n _this.p._.sceneContainer.removeEventListener('touchend', _this._rotateGlobe_MouseUp);\n\n if (_this._.panned) {\n clearInterval(_this._.rotationDampingInterval);\n var dif = {\n x: _this._.oldPrevMouseXY.x - _this._.prevMouseXY.x,\n y: _this._.oldPrevMouseXY.y - _this._.prevMouseXY.y\n };\n var difs_1 = [];\n\n while (dif.x > 2 || dif.x < -2 || dif.y > 2 || dif.y < -2) {\n var xSize = dif.x / 3;\n var ySize = dif.y / 3;\n dif.x -= xSize;\n dif.y -= ySize;\n difs_1.push({\n x: dif.x,\n y: dif.y\n });\n }\n\n difs_1.reverse();\n _this._.rotationDampingInterval = setInterval(function () {\n if (difs_1.length > 0) _this._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, difs_1.pop(), true);else clearInterval(_this._.rotationDampingInterval);\n }, 50);\n }\n\n _this._.panned = false;\n };\n\n this._onZoom = function (e) {\n _this._.zoomedSince = 0;\n\n var zoomDist = _this.p._.cameras.orbit.camera.position.distanceTo(_this.p._.cameras.orbit.controls.target);\n\n var nf = 8 - (parseInt(_this.p.projection.radiusScale).toString().length - 1);\n var rf = Math.max(parseInt(_this.p.planetCenter.y).toString().length - 7, 0) + (_this.p.options.zoomLevelShift || 0);\n if (Math.abs(_this.p.planetCenter.y) > 30000000) rf += 1;\n var dZoom = Math.ceil((nf * Math.log(2) - Math.log(zoomDist / Math.pow(5, nf - 1))) / Math.log(2)) + rf;\n _this._.desiredZoom = dZoom;\n\n _this._attenuate();\n };\n\n this._onTouchZoom = function (e) {\n if (e.touches && e.touches.length == 1) _this._onZoom(e);\n };\n\n this._onClick = function (e) {\n if (_this.hoveredFeature && _this.hoverInfo) {\n var layer = _this.p.layers.getLayerByName(_this.hoveredFeature.layerName);\n\n if (layer) {\n _this.setActiveFeature({\n layerName: _this.hoveredFeature.layerName,\n type: _this.hoveredFeature.type,\n obj: _this.hoveredFeature.obj,\n feature: _this.hoveredFeature.feature || _this.hoveredFeature.obj.feature,\n lnglat: {\n lng: _this.hoveredFeature.lnglat.lng,\n lat: _this.hoveredFeature.lnglat.lat\n }\n });\n\n if (typeof layer.onClick === 'function') {\n layer.onClick(JSON.parse(JSON.stringify(_this.hoveredFeature.feature)), JSON.parse(JSON.stringify(_this.hoveredFeature.lnglat)), layer);\n }\n }\n }\n };\n\n this._onKeyDown = function (e) {\n if (_this.p._.cameras.isFirstPerson) return;\n var speed = e.shiftKey ? 20 : 8;\n\n switch (e.key) {\n case 'w':\n case 'ArrowUp':\n _this._rotateGlobe({\n pageX: 0,\n pageY: speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'a':\n case 'ArrowLeft':\n _this._rotateGlobe({\n pageX: speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 's':\n case 'ArrowDown':\n _this._rotateGlobe({\n pageX: 0,\n pageY: -speed\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'd':\n case 'ArrowRight':\n _this._rotateGlobe({\n pageX: -speed,\n pageY: 0\n }, {\n x: 0,\n y: 0\n });\n\n break;\n\n case 'g':\n case 'PageDown':\n var lerpedDown = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? -0.035 : -0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedDown.x, lerpedDown.y, lerpedDown.z);\n\n _this._onZoom();\n\n break;\n\n case 't':\n case 'PageUp':\n var lerpedUp = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]().lerpVectors(_this.p._.cameras.orbit.camera.position, _this.p._.cameras.orbit.controls.target, e.shiftKey ? 0.035 : 0.02);\n\n _this.p._.cameras.orbit.camera.position.set(lerpedUp.x, lerpedUp.y, lerpedUp.z);\n\n _this._onZoom();\n\n break;\n\n case 'q':\n _this.p._.cameras.orbit.controls.rotateLeft(Math.PI / 64);\n\n break;\n\n case 'e':\n _this.p._.cameras.orbit.controls.rotateLeft(-Math.PI / 64);\n\n break;\n\n case 'r':\n _this.p._.cameras.orbit.controls.rotateUp(Math.PI / 64);\n\n break;\n\n case 'f':\n _this.p._.cameras.orbit.controls.rotateUp(-Math.PI / 64);\n\n break;\n }\n };\n\n this._onMouseMove = function (e) {\n _this.p._.mouseIsInScene = true;\n\n if (_this.p._.cameras.isFirstPerson) {\n _this._.mouseXY.x = 0;\n _this._.mouseXY.y = 0;\n } else {\n _this._.mouseXY.x = (e.clientX - _this.p._.renderer.domElement.getBoundingClientRect().left) / _this.p._.renderer.domElement.clientWidth * 2 - 1;\n _this._.mouseXY.y = -((e.clientY - _this.p._.renderer.domElement.getBoundingClientRect().top) / _this.p._.renderer.domElement.clientHeight) * 2 + 1;\n }\n\n _this._.containerXY = {\n x: e ? e.offsetX : null,\n y: e ? e.offsetY : null\n };\n\n _this.updateHoverInfoPosition();\n\n _this.p._.raycaster.setFromCamera(_this._.mouseXY, _this.p._.cameras.camera);\n\n var intersectArr = [];\n\n for (var i = 0; i < _this.p._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this.p._.tiledWorld.tilesDrawn[i].isLODTile) intersectArr.push(_this.p._.tiledWorld.tilesDrawn[i].t);\n }\n\n for (var i = 0; i < _this.p.layers.vector.length; i++) {\n if (_this.p.layers.vector[i].meshes && _this.p.layers.vector[i].meshes.children) for (var j = 0; j < _this.p.layers.vector[i].meshes.children.length; j++) intersectArr.push(_this.p.layers.vector[i].meshes.children[j]);\n }\n\n for (var i = 0; i < _this.p.layers.curtain.length; i++) {\n if (_this.p.layers.curtain[i].curtain && _this.p.layers.curtain[i].curtain.children) for (var j = 0; j < _this.p.layers.curtain[i].curtain.children.length; j++) intersectArr.push(_this.p.layers.curtain[i].curtain.children[j]);\n }\n\n var intersects = _this.p._.raycaster.intersectObjects(intersectArr);\n\n if (intersects.length > 0) {\n var type_1 = intersects[0].object.type;\n var obj_1 = null;\n\n switch (type_1) {\n case 'Sprite':\n obj_1 = intersects[0].object;\n break;\n\n case 'Line2':\n obj_1 = intersects[0].object;\n break;\n\n case 'Mesh':\n obj_1 = _this.p._.tiledWorld.findTileDrawnBasedOnUUID(intersects[0].object.uuid);\n\n if (obj_1 == null) {\n obj_1 = intersects[0].object;\n }\n\n break;\n\n default:\n return;\n break;\n }\n\n var savedIntersectionPoint_1 = intersects[0].point;\n intersects[0].point.y += _this.p.planetCenter.y;\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: -_this.p.planet.rotation.x,\n y: 0,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: -_this.p.planet.rotation.y,\n z: 0\n });\n intersects[0].point = _this.p.projection.rotatePoint3D(intersects[0].point, {\n x: 0,\n y: 0,\n z: -_this.p.planet.rotation.z\n });\n\n var intersectedLL_1 = _this.p.projection.vector3ToLatLng(intersects[0].point);\n\n intersectedLL_1.height = (savedIntersectionPoint_1.length() - _this.p.planet.position.y) / _this.p.projection.radiusScale;\n\n _this._updateMouseCoords(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height);\n\n clearTimeout(_this._.highlightTimeout);\n _this._.highlightTimeout = setTimeout(function () {\n _this._highlightFeature(intersectedLL_1.lng, intersectedLL_1.lat, type_1, obj_1, intersects[0], savedIntersectionPoint_1);\n }, 10);\n\n _this.p.layers._onMouseMove(intersectedLL_1, e, obj_1, intersects[0], savedIntersectionPoint_1);\n\n _this.p.controls._onMouseMove(intersectedLL_1.lng, intersectedLL_1.lat, intersectedLL_1.height, e);\n } else {\n _this._updateMouseCoords(null, null, null);\n\n _this._unhighlightHoveredFeature();\n\n _this.p.controls._onMouseMove(null, null, null, e);\n }\n };\n\n this.p = parent;\n this.activeFeature = null;\n this.hoveredFeature = null;\n this.hoverInfo = null;\n this._ = {\n mouseXY: {\n x: null,\n y: null\n },\n prevMouseXY: {\n x: null,\n y: null\n },\n oldPrevMouseXY: {\n x: null,\n y: null\n },\n containerXY: {\n x: null,\n y: null\n },\n lastZoomDelta: 1,\n desiredZoom: null,\n zoomedSince: 0,\n zoomWait: 30,\n highlightTimeout: null,\n rotationDampingInterval: null,\n panned: false\n };\n\n this._init();\n }\n\n Events.prototype._init = function () {\n var _this = this;\n\n this._matchPlanetsLODToPlanet();\n\n this.p._.sceneContainer.addEventListener('mousewheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('DOMMouseScroll', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('wheel', this._onZoom, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', this.p.controls._onMouseOut, false);\n\n this.p._.sceneContainer.addEventListener('touchend', this._onTouchZoom);\n\n this.p._.sceneContainer.addEventListener('mousedown', this._rotateGlobe_MouseDown, false);\n\n this.p._.sceneContainer.addEventListener('mousemove', this._onMouseMove, false);\n\n this.p._.sceneContainer.addEventListener('click', this._onClick, false);\n\n this.p._.sceneContainer.addEventListener('mouseenter', function () {\n _this.p._.mouseIsInScene = true;\n }, false);\n\n this.p._.sceneContainer.addEventListener('mouseleave', function () {\n _this.p._.mouseIsInScene = false;\n }, false);\n\n window.addEventListener('keydown', this._onKeyDown, false);\n };\n\n Events.prototype._rotateAroundArbAxis = function (axis, radians, noPremultiply) {\n var rotationMatrix = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\n rotationMatrix.makeRotationAxis(axis.normalize(), radians);\n if (noPremultiply !== true) rotationMatrix.multiply(this.p.planet.matrix);\n this.p.planet.matrix = rotationMatrix;\n this.p.planet.rotation.setFromRotationMatrix(this.p.planet.matrix);\n\n this._matchPlanetsLODToPlanet();\n\n this._refreshFrontGroupRotation();\n };\n\n Events.prototype._checkDesiredZoom = function () {\n this._.zoomedSince++;\n\n if (this._.desiredZoom != null) {\n this.p._.cameras.setNearFarPlane(this.p.projection.radiusScale, this._.desiredZoom < 14);\n\n if (this._.zoomedSince > this._.zoomWait) {\n if (this._.desiredZoom >= this.p._.minNativeZoom) this._setZoom(this._.desiredZoom);\n this._.desiredZoom = null;\n }\n }\n };\n\n Events.prototype._setZoom = function (newZoom) {\n var zoomSave = this.p.zoom;\n this.p.zoom = newZoom;\n this.p.trueZoom = Math.max(0, newZoom);\n if (this.p.zoom < 0) this.p.zoom = 0;\n if (this.p.zoom < this.p._.minNativeZoom) this.p.zoom = this.p._.minNativeZoom;\n if (this.p.zoom > this.p._.maxZoom) this.p.zoom = this.p._.maxZoom;\n this._.lastZoomDelta = Math.abs(this.p.zoom - zoomSave);\n };\n\n Events.prototype._matchPlanetsLODToPlanet = function () {\n for (var i = 0; i < this.p.planetsLOD.length; i++) {\n this.p.planetsLOD[i].matrix = this.p.planet.matrix;\n this.p.planetsLOD[i].position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.planetsLOD[i].rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n\n if (this.p.atmosphere) {\n this.p.atmosphere.matrix = this.p.planet.matrix;\n this.p.atmosphere.position.set(this.p.planet.position.x, this.p.planet.position.y, this.p.planet.position.z);\n this.p.atmosphere.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n }\n };\n\n Events.prototype._refreshFrontGroupRotation = function () {\n this.p.frontGroup.rotation.set(this.p.planet.rotation.x, this.p.planet.rotation.y, this.p.planet.rotation.z);\n };\n\n Events.prototype._updateMouseCoords = function (lng, lat, elev) {\n this.p.mouse.lng = lng;\n this.p.mouse.lat = lat;\n this.p.mouse.elev = elev;\n };\n\n Events.prototype.updateHoverInfoPosition = function () {\n if (this.hoverInfo) {\n this.hoverInfo.style.left = this._.containerXY.x + 14 + \"px\";\n this.hoverInfo.style.top = this._.containerXY.y + 14 + \"px\";\n }\n };\n\n Events.prototype._highlightFeature = function (lng, lat, type, obj, intersectionRaw, intersectionPoint) {\n var cursor = {\n type: 'Point',\n coordinates: [lng, lat]\n };\n var highlighted = false;\n\n switch (type) {\n case 'Sprite':\n case 'Line2':\n highlighted = true;\n if (obj.feature._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n obj.feature._highlighted = true;\n obj.restyle();\n this.setHoveredFeature({\n layerName: obj.layerName,\n type: type,\n obj: obj,\n feature: obj.feature,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n break;\n\n case 'Mesh':\n if (obj.layerType === 'curtain') {} else if (obj.layerType === 'model') {} else if (obj.contains) {\n for (var _i = 0, _a = Object.keys(obj.contains).reverse(); _i < _a.length; _i++) {\n var layerName = _a[_i];\n\n for (var _b = 0, _c = obj.contains[layerName].reverse(); _b < _c.length; _b++) {\n var f = _c[_b];\n var feature = Object.assign({}, f);\n\n if (feature.geometry.type.toLowerCase() === 'point') {\n feature = Object(_turf_circle__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(feature.geometry.coordinates, feature._radiusInMeters || 1, {\n steps: 12,\n units: 'meters',\n properties: feature.properties\n });\n }\n\n if (Object(_turf_boolean_intersects__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(feature, cursor)) {\n highlighted = true;\n if (f._highlighted == true) return;\n\n this._unhighlightHoveredFeature();\n\n f._highlighted = true;\n this.setHoveredFeature({\n layerName: layerName,\n type: type,\n obj: obj,\n feature: f,\n lnglat: {\n lng: lng,\n lat: lat\n }\n });\n\n this.p._.tiledWorld.updateClampedRasterForTile(obj, layerName);\n\n break;\n }\n }\n\n if (highlighted) return;\n }\n }\n\n break;\n\n default:\n break;\n }\n\n if (!highlighted) {\n this._unhighlightHoveredFeature();\n }\n };\n\n Events.prototype._unhighlightHoveredFeature = function () {\n if (this.hoveredFeature) {\n this.hoveredFeature.feature._highlighted = false;\n\n switch (this.hoveredFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.hoveredFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.hoveredFeature.obj, this.hoveredFeature.layerName);\n\n break;\n\n default:\n break;\n }\n\n this.clearHoveredFeature();\n }\n };\n\n Events.prototype.setHoveredFeature = function (hoveredFeature) {\n this.hoveredFeature = hoveredFeature;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n }\n\n this.hoverInfo = document.createElement('div');\n this.hoverInfo.id = '_lithosphere_hover_info';\n var layer = this.p.layers.getLayerByName(this.hoveredFeature.layerName);\n\n if (layer && layer.useKeyAsHoverName) {\n var text = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getIn(this.hoveredFeature.feature.properties, layer.useKeyAsHoverName.split('.'));\n\n if (text != null) {\n this.hoverInfo.innerHTML = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].capitalizeFirstLetter(layer.useKeyAsHoverName + \": \" + text);\n this.hoverInfo.style.position = 'absolute';\n this.hoverInfo.style.background = 'black';\n this.hoverInfo.style.color = 'white';\n this.hoverInfo.style.fontSize = '16px';\n this.hoverInfo.style.fontFamily = 'sans-serif';\n this.hoverInfo.style.fontWeight = 'bold';\n this.hoverInfo.style.padding = '4px 8px';\n this.updateHoverInfoPosition();\n }\n }\n\n this.p._.container.appendChild(this.hoverInfo);\n\n this.p._.container.style.cursor = 'pointer';\n };\n\n Events.prototype.clearHoveredFeature = function () {\n this.hoveredFeature = null;\n\n if (this.hoverInfo) {\n this.p._.container.removeChild(this.hoverInfo);\n\n this.hoverInfo = null;\n this.p._.container.style.cursor = 'default';\n }\n };\n\n Events.prototype.setActiveFeature = function (activeFeature) {\n this.clearActiveFeature();\n this.activeFeature = activeFeature;\n this.activeFeature.feature._active = true;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n };\n\n Events.prototype.clearActiveFeature = function () {\n if (this.activeFeature) {\n this.activeFeature.feature._active = false;\n\n switch (this.activeFeature.type) {\n case 'Sprite':\n case 'Line2':\n this.activeFeature.obj.restyle();\n break;\n\n case 'Mesh':\n this.p._.tiledWorld.updateClampedRasterForTile(this.activeFeature.obj, this.activeFeature.layerName);\n\n break;\n\n default:\n break;\n }\n }\n\n this.activeFeature = null;\n };\n\n Events.prototype._setMissingElevation = function (mesh) {\n var _a, _b;\n\n if (mesh.noElevation != null) {\n var height = this.p.getElevationAtLngLat(mesh.noElevation.lng, mesh.noElevation.lat) || false;\n\n if (height) {\n var v = this.p.projection.lonLatToVector3(mesh.noElevation.lng, mesh.noElevation.lat, (height || 0) + (mesh.noElevation.elevOffset || 0) * this.p.options.exaggeration);\n mesh.position.set(v.x, v.y, v.z);\n delete mesh.noElevation;\n }\n }\n\n if (_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isInZoomRange((_a = mesh.style) === null || _a === void 0 ? void 0 : _a.minZoom, (_b = mesh.style) === null || _b === void 0 ? void 0 : _b.maxZoom, this.p.zoom)) mesh.visible = true;else mesh.visible = false;\n };\n\n Events.prototype._attenuate = function () {\n var _this = this;\n\n var zoomDist = this.p._.cameras.camera.position.distanceTo(this.p._.cameras.controls.target);\n\n var attenuationFactor = zoomDist / 256;\n\n if (this.p.layers.vector) {\n this.p.layers.vector.forEach(function (vectorLayer) {\n if (vectorLayer.meshes && vectorLayer.meshes.children) {\n vectorLayer.meshes.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * (mesh.style.width || mesh.style.radius), attenuationFactor * (mesh.style.height || mesh.style.radius), attenuationFactor * mesh.style.radius);\n\n _this._setMissingElevation(mesh);\n }\n });\n }\n });\n }\n\n if (this.p.frontGroup.children) {\n this.p.frontGroup.children.forEach(function (child) {\n if (child.children && child.children.length > 0) {\n child.children.forEach(function (mesh) {\n if (mesh instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n mesh.scale.set(attenuationFactor * (mesh.style.width || mesh.style.radius), attenuationFactor * (mesh.style.height || mesh.style.radius), attenuationFactor * mesh.style.radius);\n\n _this._setMissingElevation(mesh);\n }\n });\n } else {\n if (child instanceof three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"]) {\n child.scale.set(attenuationFactor * (mesh.style.width || mesh.style.radius), attenuationFactor * (mesh.style.height || mesh.style.radius), attenuationFactor * mesh.style.radius);\n\n _this._setMissingElevation(child);\n }\n }\n });\n }\n };\n\n return Events;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Events);\n\n//# sourceURL=webpack://LithoSphere/./src/core/events.ts?"); /***/ }), @@ -2007,7 +2007,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ren /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CRS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CRS */ \"./src/core/CRS.ts\");\n\nvar RadiusE;\n\n(function (RadiusE) {\n RadiusE[\"Major\"] = \"major\";\n RadiusE[\"Minor\"] = \"minor\";\n})(RadiusE || (RadiusE = {}));\n\nvar Projection = function () {\n function Projection(majorRadius, minorRadius, tileMapResource, trueTileResolution) {\n var _this = this;\n\n this.setRadius = function (radius, which) {\n if (which === void 0) {\n which = RadiusE.Major;\n }\n\n if (which.toLowerCase() == 'major') _this.radii.major = radius || _this.baseRadius;else if (which.toLowerCase() == 'minor') _this.radii.minor = radius || _this.radii.major || _this.baseRadius;\n };\n\n this.invertY = function (y, z) {\n var b = _this.crs.projection.bounds;\n\n if (_this.tileMapResource.crsCode === 'EPSG:4326') {\n return Math.pow(2, z) - 1 - y;\n }\n\n var s = _this.crs.scale(z);\n\n var max = _this.crs.transformation.transform(b.min, s);\n\n var yMax = Math.ceil(max.y / 256) - 1;\n return yMax - y;\n };\n\n this.toBounds = function (a, b) {\n var bounds = {\n min: {\n x: null,\n y: null\n },\n max: {\n x: null,\n y: null\n }\n };\n bounds.min.x = Math.min(a.x, b.x);\n bounds.max.x = Math.max(a.x, b.x);\n bounds.min.y = Math.min(a.y, b.y);\n bounds.max.y = Math.max(a.y, b.y);\n return bounds;\n };\n\n this.tileXYZ2NwSe = function (xyz, tileResolution, asBounds, stretchFactor) {\n if (_this.tileMapResource.proj == null) return null;\n stretchFactor = Math.max(stretchFactor || 1, 1);\n var stretchAmount = (stretchFactor - 1) * tileResolution;\n var nwPoint = {\n x: xyz.x * tileResolution - stretchAmount,\n y: xyz.y * tileResolution - stretchAmount\n };\n var sePoint = {\n x: nwPoint.x + tileResolution + stretchAmount * 2,\n y: nwPoint.y + tileResolution + stretchAmount * 2\n };\n\n var nw = _this.crs.pointToLatLng(nwPoint, xyz.z);\n\n var se = _this.crs.pointToLatLng(sePoint, xyz.z);\n\n if (asBounds) return _this.toBounds(_this.crs.project(nw), _this.crs.project(se));\n return {\n nw: nw,\n se: se\n };\n };\n\n this.tileXYZ2LatLng = function (x, y, z, flatXYZ) {\n if (_this.tileMapResource.proj == null) {\n var lng = x / Math.pow(2, z) * 360 - 180;\n var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z);\n var lat = 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n return {\n lat: lat,\n lng: lng\n };\n } else {\n y = -y;\n var easting = _this.trueTileResolution * x * _this.res[z] + _this.tileMapResource.origin[0];\n var northing = _this.trueTileResolution * y * _this.res[z] + _this.tileMapResource.origin[1];\n return _this.crs.unproject({\n x: easting,\n y: northing\n });\n }\n };\n\n this.latLngZ2TileXYZ = function (lat, lng, z, dontFloor) {\n if (_this.tileMapResource.proj == null) {\n var x = (lng + 180) / 360 * Math.pow(2, z);\n var y = (1 - Math.log(Math.tan(lat * (Math.PI / 180)) + 1 / Math.cos(lat * (Math.PI / 180))) / Math.PI) / 2 * Math.pow(2, z);\n\n if (dontFloor == null) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n\n return {\n x: x,\n y: y,\n z: z\n };\n } else {\n var p = _this.crs.project({\n lng: lng,\n lat: lat\n });\n\n var easting = p.x;\n var northing = p.y;\n var x = (easting - _this.tileMapResource.origin[0]) / (_this.trueTileResolution * _this.res[z]);\n var y = (northing - _this.tileMapResource.origin[1]) / (_this.trueTileResolution * _this.res[z]);\n y = -y;\n return {\n x: x,\n y: y,\n z: z\n };\n }\n };\n\n this.vector3ToLatLng = function (xyz) {\n var y = xyz.y;\n var z = xyz.z;\n xyz.y = -z;\n xyz.z = -y;\n var rs = _this.radii.major / _this.radiusScale;\n var rs2 = _this.radii.minor / _this.radiusScale;\n var r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2));\n var E2 = Math.pow(rs, 2) - Math.pow(rs2, 2);\n var F = 54 * Math.pow(rs, 2) * Math.pow(xyz.z, 2);\n var G = Math.pow(r, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) - Math.pow(_this.e, 2) * E2;\n var C = Math.pow(_this.e, 4) * F * Math.pow(r, 2) / Math.pow(G, 3);\n var S = Math.cbrt(1 + C + Math.sqrt(Math.pow(C, 2) + 2 * C));\n var P = F / (3 * Math.pow(S + 1 / S + 1, 2) * Math.pow(G, 2));\n var Q = Math.sqrt(1 + 2 * Math.pow(_this.e, 4) * P);\n var r0 = -(P * Math.pow(_this.e, 2) * r) / (1 + Q) + Math.sqrt(0.5 * Math.pow(rs, 2) * (1 + 1 / Q) - P * (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) / (Q * (1 + Q)) - 0.5 * P * Math.pow(r, 2));\n var U = Math.sqrt(r - Math.pow(_this.e, 2) * r0 + Math.pow(xyz.z, 2));\n var V = Math.sqrt(Math.pow(r - Math.pow(_this.e, 2) * r0, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2));\n var Z0 = Math.pow(rs2, 2) * xyz.z / (rs * V);\n var h = U * (1 - Math.pow(rs2, 2) / (rs * V));\n var phi = Math.atan((xyz.z + Math.pow(_this.ep, 2) * Z0) / r) * (180 / Math.PI);\n var lambda = -(Math.atan2(xyz.y, xyz.x) * (180 / Math.PI)) - 90;\n if (lambda < -180) lambda += 360;\n return {\n lat: phi,\n lng: lambda,\n height: h\n };\n };\n\n this.lonLatToVector3 = function (lon, lat, height) {\n var phi = lat * (Math.PI / 180);\n var theta = (lon - 180) * (Math.PI / 180);\n var x = (_this.radii.major + height) / _this.radiusScale * Math.cos(phi) * Math.sin(theta);\n var y = -(_this.radii.major + height) / _this.radiusScale * Math.sin(phi);\n var z = -(_this.radii.major + height) / _this.radiusScale * Math.cos(phi) * Math.cos(theta);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.rotatePoint3D = function (pt, angle, center) {\n if (center == undefined) center = {\n x: 0,\n y: 0,\n z: 0\n };\n var dx = pt.x - center.x;\n var dy = pt.y - center.y;\n var dz = pt.z - center.z;\n var sx = Math.sin(angle.x);\n var cx = Math.cos(angle.x);\n var sy = Math.sin(angle.y);\n var cy = Math.cos(angle.y);\n var sz = Math.sin(angle.z);\n var cz = Math.cos(angle.z);\n var x = center.x + dx * (cy * cz) + dy * (-cy * sz) + dz * sy;\n var y = center.y + dx * (cx * sz + sx * sy * cz) + dy * (cx * cz - sx * sy * sz) + dz * (-sx * cy);\n var z = center.z + dx * (sx * sz - cx * sy * cz) + dy * (sx * cz + cx * sy * sz) + dz * (cx * cy);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.lngLatDistBetween = function (lon1, lat1, lon2, lat2) {\n var R = _this.radii.major / _this.radiusScale;\n var φ1 = lat1 * (Math.PI / 180);\n var φ2 = lat2 * (Math.PI / 180);\n var Δφ = (lat2 - lat1) * (Math.PI / 180);\n var Δλ = (lon2 - lon1) * (Math.PI / 180);\n var a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) + Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c;\n };\n\n this._reset();\n\n this.setRadius(majorRadius, RadiusE.Major);\n this.setRadius(minorRadius, RadiusE.Minor);\n this.tileMapResource = tileMapResource || {\n bounds: null,\n origin: null,\n crsCode: null,\n epsg: null,\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.tileMapResource.crsCode = this.tileMapResource.crsCode || 'EPSG:4326';\n this.trueTileResolution = trueTileResolution || 256;\n\n if (this.tileMapResource.resunitsperpixel != null && this.tileMapResource.reszoomlevel != null) {\n var baseRes = this.tileMapResource.resunitsperpixel * Math.pow(2, this.tileMapResource.reszoomlevel);\n var res = [];\n\n for (var i = 0; i < 32; i++) {\n res.push(baseRes / Math.pow(2, i));\n }\n\n this.res = res;\n }\n\n var tmr = this.tileMapResource;\n this.crs = new _CRS__WEBPACK_IMPORTED_MODULE_0__[\"default\"](Number.isFinite(parseInt(tmr.crsCode[0])) ? \"EPSG:\" + tmr.epsg : tmr.crsCode, tmr.proj, {\n origin: [parseFloat(tmr.origin[0]), parseFloat(tmr.origin[1])],\n resolutions: this.res,\n bounds: [[parseFloat(tmr.bounds[0]), parseFloat(tmr.bounds[1])], [parseFloat(tmr.bounds[2]), parseFloat(tmr.bounds[3])]]\n }, parseFloat(this.radii.major));\n }\n\n Projection.prototype._reset = function () {\n this.baseRadius = 6371000;\n this.radiusScale = 1;\n this.radii = {\n major: this.baseRadius,\n minor: this.baseRadius\n };\n this.tileMapResource = {\n bounds: null,\n origin: null,\n crsCode: 'EPSG:4326',\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.e = 0;\n this.ep = 0;\n this.flatteningFactor = 0;\n };\n\n return Projection;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Projection);\n\n//# sourceURL=webpack://LithoSphere/./src/core/projection.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CRS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CRS */ \"./src/core/CRS.ts\");\n\nvar RadiusE;\n\n(function (RadiusE) {\n RadiusE[\"Major\"] = \"major\";\n RadiusE[\"Minor\"] = \"minor\";\n})(RadiusE || (RadiusE = {}));\n\nvar Projection = function () {\n function Projection(majorRadius, minorRadius, tileMapResource, trueTileResolution, radiusCutoff) {\n var _this = this;\n\n this.setRadius = function (radius, which) {\n if (which === void 0) {\n which = RadiusE.Major;\n }\n\n if (which.toLowerCase() == 'major') {\n _this.radii.major = radius || _this.baseRadius;\n if (_this.radii.major > _this.radiusCutoff) _this.radiusScale = _this.radii.major / _this.radiusCutoff;\n } else if (which.toLowerCase() == 'minor') _this.radii.minor = radius || _this.radii.major || _this.baseRadius;\n };\n\n this.invertY = function (y, z) {\n var b = _this.crs.projection.bounds;\n\n if (_this.tileMapResource.crsCode === 'EPSG:4326') {\n return Math.pow(2, z) - 1 - y;\n }\n\n var s = _this.crs.scale(z);\n\n var max = _this.crs.transformation.transform(b.min, s);\n\n var yMax = Math.ceil(max.y / 256) - 1;\n return yMax - y;\n };\n\n this.toBounds = function (a, b) {\n var bounds = {\n min: {\n x: null,\n y: null\n },\n max: {\n x: null,\n y: null\n }\n };\n bounds.min.x = Math.min(a.x, b.x);\n bounds.max.x = Math.max(a.x, b.x);\n bounds.min.y = Math.min(a.y, b.y);\n bounds.max.y = Math.max(a.y, b.y);\n return bounds;\n };\n\n this.tileXYZ2NwSe = function (xyz, tileResolution, asBounds, stretchFactor) {\n if (_this.tileMapResource.proj == null) return null;\n stretchFactor = Math.max(stretchFactor || 1, 1);\n var stretchAmount = (stretchFactor - 1) * tileResolution;\n var nwPoint = {\n x: xyz.x * tileResolution - stretchAmount,\n y: xyz.y * tileResolution - stretchAmount\n };\n var sePoint = {\n x: nwPoint.x + tileResolution + stretchAmount * 2,\n y: nwPoint.y + tileResolution + stretchAmount * 2\n };\n\n var nw = _this.crs.pointToLatLng(nwPoint, xyz.z);\n\n var se = _this.crs.pointToLatLng(sePoint, xyz.z);\n\n if (asBounds) return _this.toBounds(_this.crs.project(nw), _this.crs.project(se));\n return {\n nw: nw,\n se: se\n };\n };\n\n this.tileXYZ2LatLng = function (x, y, z, flatXYZ) {\n if (_this.tileMapResource.proj == null) {\n var lng = x / Math.pow(2, z) * 360 - 180;\n var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z);\n var lat = 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n return {\n lat: lat,\n lng: lng\n };\n } else {\n y = -y;\n var easting = _this.trueTileResolution * x * _this.res[z] + _this.tileMapResource.origin[0];\n var northing = _this.trueTileResolution * y * _this.res[z] + _this.tileMapResource.origin[1];\n return _this.crs.unproject({\n x: easting,\n y: northing\n });\n }\n };\n\n this.latLngZ2TileXYZ = function (lat, lng, z, dontFloor) {\n if (_this.tileMapResource.proj == null) {\n var x = (lng + 180) / 360 * Math.pow(2, z);\n var y = (1 - Math.log(Math.tan(lat * (Math.PI / 180)) + 1 / Math.cos(lat * (Math.PI / 180))) / Math.PI) / 2 * Math.pow(2, z);\n\n if (dontFloor == null) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n\n return {\n x: x,\n y: y,\n z: z\n };\n } else {\n var p = _this.crs.project({\n lng: lng,\n lat: lat\n });\n\n var easting = p.x;\n var northing = p.y;\n var x = (easting - _this.tileMapResource.origin[0]) / (_this.trueTileResolution * _this.res[z]);\n var y = (northing - _this.tileMapResource.origin[1]) / (_this.trueTileResolution * _this.res[z]);\n y = -y;\n return {\n x: x,\n y: y,\n z: z\n };\n }\n };\n\n this.vector3ToLatLng = function (xyz) {\n var y = xyz.y;\n var z = xyz.z;\n xyz.y = -z;\n xyz.z = -y;\n var rs = _this.radii.major / _this.radiusScale;\n var rs2 = _this.radii.minor / _this.radiusScale;\n var r = Math.sqrt(Math.pow(xyz.x, 2) + Math.pow(xyz.y, 2));\n var E2 = Math.pow(rs, 2) - Math.pow(rs2, 2);\n var F = 54 * Math.pow(rs, 2) * Math.pow(xyz.z, 2);\n var G = Math.pow(r, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) - Math.pow(_this.e, 2) * E2;\n var C = Math.pow(_this.e, 4) * F * Math.pow(r, 2) / Math.pow(G, 3);\n var S = Math.cbrt(1 + C + Math.sqrt(Math.pow(C, 2) + 2 * C));\n var P = F / (3 * Math.pow(S + 1 / S + 1, 2) * Math.pow(G, 2));\n var Q = Math.sqrt(1 + 2 * Math.pow(_this.e, 4) * P);\n var r0 = -(P * Math.pow(_this.e, 2) * r) / (1 + Q) + Math.sqrt(0.5 * Math.pow(rs, 2) * (1 + 1 / Q) - P * (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2) / (Q * (1 + Q)) - 0.5 * P * Math.pow(r, 2));\n var U = Math.sqrt(r - Math.pow(_this.e, 2) * r0 + Math.pow(xyz.z, 2));\n var V = Math.sqrt(Math.pow(r - Math.pow(_this.e, 2) * r0, 2) + (1 - Math.pow(_this.e, 2)) * Math.pow(xyz.z, 2));\n var Z0 = Math.pow(rs2, 2) * xyz.z / (rs * V);\n var h = U * (1 - Math.pow(rs2, 2) / (rs * V));\n var phi = Math.atan((xyz.z + Math.pow(_this.ep, 2) * Z0) / r) * (180 / Math.PI);\n var lambda = -(Math.atan2(xyz.y, xyz.x) * (180 / Math.PI)) - 90;\n if (lambda < -180) lambda += 360;\n return {\n lat: phi,\n lng: lambda,\n height: h\n };\n };\n\n this.lonLatToVector3 = function (lon, lat, height) {\n var phi = lat * (Math.PI / 180);\n var theta = (lon - 180) * (Math.PI / 180);\n var h = _this.radii.major / _this.radiusScale + height;\n var x = h * Math.cos(phi) * Math.sin(theta);\n var y = -h * Math.sin(phi);\n var z = -h * Math.cos(phi) * Math.cos(theta);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.rotatePoint3D = function (pt, angle, center) {\n if (center == undefined) center = {\n x: 0,\n y: 0,\n z: 0\n };\n var dx = pt.x - center.x;\n var dy = pt.y - center.y;\n var dz = pt.z - center.z;\n var sx = Math.sin(angle.x);\n var cx = Math.cos(angle.x);\n var sy = Math.sin(angle.y);\n var cy = Math.cos(angle.y);\n var sz = Math.sin(angle.z);\n var cz = Math.cos(angle.z);\n var x = center.x + dx * (cy * cz) + dy * (-cy * sz) + dz * sy;\n var y = center.y + dx * (cx * sz + sx * sy * cz) + dy * (cx * cz - sx * sy * sz) + dz * (-sx * cy);\n var z = center.z + dx * (sx * sz - cx * sy * cz) + dy * (sx * cz + cx * sy * sz) + dz * (cx * cy);\n return {\n x: x,\n y: y,\n z: z\n };\n };\n\n this.lngLatDistBetween = function (lon1, lat1, lon2, lat2) {\n var R = _this.radii.major / _this.radiusScale;\n var φ1 = lat1 * (Math.PI / 180);\n var φ2 = lat2 * (Math.PI / 180);\n var Δφ = (lat2 - lat1) * (Math.PI / 180);\n var Δλ = (lon2 - lon1) * (Math.PI / 180);\n var a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) + Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c;\n };\n\n this.radiusCutoff = radiusCutoff || Infinity;\n\n this._reset();\n\n this.setRadius(majorRadius, RadiusE.Major);\n this.setRadius(minorRadius, RadiusE.Minor);\n this.tileMapResource = tileMapResource || {\n bounds: null,\n origin: null,\n crsCode: null,\n epsg: null,\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.tileMapResource.crsCode = this.tileMapResource.crsCode || 'EPSG:4326';\n this.trueTileResolution = trueTileResolution || 256;\n\n if (this.tileMapResource.resunitsperpixel != null && this.tileMapResource.reszoomlevel != null) {\n var baseRes = this.tileMapResource.resunitsperpixel * Math.pow(2, this.tileMapResource.reszoomlevel);\n var res = [];\n\n for (var i = 0; i < 32; i++) {\n res.push(baseRes / Math.pow(2, i));\n }\n\n this.res = res;\n }\n\n var tmr = this.tileMapResource;\n this.crs = new _CRS__WEBPACK_IMPORTED_MODULE_0__[\"default\"](Number.isFinite(parseInt(tmr.crsCode[0])) ? \"EPSG:\" + tmr.epsg : tmr.crsCode, tmr.proj, tmr.origin != null ? {\n origin: [parseFloat(tmr.origin[0]), parseFloat(tmr.origin[1])],\n resolutions: this.res,\n bounds: [[parseFloat(tmr.bounds[0]), parseFloat(tmr.bounds[1])], [parseFloat(tmr.bounds[2]), parseFloat(tmr.bounds[3])]]\n } : {\n origin: [0, 0],\n resolutions: this.res,\n bounds: [0, 0, 0, 0]\n }, parseFloat(this.radii.major));\n }\n\n Projection.prototype._reset = function () {\n this.baseRadius = 6371000;\n this.radiusScale = 1;\n this.radii = {\n major: this.baseRadius,\n minor: this.baseRadius\n };\n this.tileMapResource = {\n bounds: null,\n origin: null,\n crsCode: 'EPSG:4326',\n proj: null,\n resunitsperpixel: null,\n reszoomlevel: null\n };\n this.e = 0;\n this.ep = 0;\n this.flatteningFactor = 0;\n };\n\n return Projection;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Projection);\n\n//# sourceURL=webpack://LithoSphere/./src/core/projection.ts?"); /***/ }), @@ -2055,7 +2055,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ___W /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\nvar opacityTimeout = null;\n\nvar ClampedLayerer = function () {\n function ClampedLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == layerObj.name) {\n _this.p.clamped[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.clamped.push(layerObj);\n\n _this.p.clamped.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n if (typeof callback === 'function') callback();\n };\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.preDrawn === true && layerObj.hasOwnProperty('data') || (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && layerObj.hasOwnProperty('minZoom') && layerObj.hasOwnProperty('maxZoom'))) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n if (!layerObj.hasOwnProperty('opacity')) layerObj.opacity = 1;\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for clamped layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid clamped layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.clamped.forEach(function (layer) {\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.updateAllRasters();\n\n return true;\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.clamped[i];\n\n if (name === layer.name) {\n clearTimeout(opacityTimeout);\n opacityTimeout = setTimeout(function () {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n\n if (_this.p.p.zoom >= layer.minZoom && _this.p.p.zoom <= layer.maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n }, 250);\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == name) {\n var minZoom = _this.p.clamped[i].minZoom;\n var maxZoom = _this.p.clamped[i].maxZoom;\n\n _this.p.clamped.splice(i, 1);\n\n if (_this.p.p.zoom >= minZoom && _this.p.p.zoom <= maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.getClampedTexture = function (i, xyz) {\n var _a;\n\n var scaleFactor = 0.5;\n var c = _this.p.clamped[i];\n var canvas = document.createElement('canvas');\n canvas.id = 'vectorsastile';\n canvas.width = 256 / scaleFactor;\n scaleFactor = scaleFactor * Math.pow(2, _this.p.p.zoom - xyz.z);\n canvas.height = canvas.width;\n var ctx = canvas.getContext('2d');\n var tileXYZ;\n var overlappedFeatures = [];\n\n if (scaleFactor < 128) {\n if (c.preDrawn) {\n ctx.imageSmoothingEnabled = false;\n\n if (c.data && c.data[xyz.z] && c.data[xyz.z][xyz.x] && c.data[xyz.z][xyz.x][xyz.y] != null) {\n ctx.drawImage(c.data[xyz.z][xyz.x][xyz.y], 0, 0, canvas.width, canvas.height);\n }\n } else {\n for (var _i = 0, _b = c.geojson.features; _i < _b.length; _i++) {\n var f = _b[_i];\n\n var style = _this.p.getFeatureStyle(c, f);\n\n var doesFeatureOverlapTile = false;\n\n if (style.fillColor.substring(0, 3).toLowerCase() != 'rgb') {\n var col = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hexToRGB(style.fillColor);\n\n if (col) {\n style.fillColor = 'rgba(' + col.r + ',' + col.g + ',' + col.b + ',' + style.fillOpacity + ')';\n }\n } else {\n var rgb = style.fillColor.substring(4, style.fillColor.length - 1).replace(/ /g, '').split(',');\n style.fillColor = 'rgba(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ',' + style.fillOpacity + ')';\n }\n\n ctx.fillStyle = style.fillColor;\n ctx.strokeStyle = style.color;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n ctx.globalAlpha = c.opacity;\n ctx.lineCap = 'round';\n style.radius *= 1 / scaleFactor * 1 || 10;\n\n if ((f.geometry.type == 'Polygon' || f.geometry.type == 'MultiPolygon') && f.geometry.coordinates[0]) {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n if (typeof f.geometry.coordinates[p][0][0] === 'number') {\n for (var i_1 = 0; i_1 < f.geometry.coordinates[p].length; i_1++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_1][1], f.geometry.coordinates[p][i_1][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_1 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n } else if (typeof f.geometry.coordinates[p][0][0][0] === 'number') {\n for (var i_2 = 0; i_2 < f.geometry.coordinates[p].length; i_2++) {\n for (var j = 0; j < f.geometry.coordinates[p][i_2].length; j++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_2][j][1], f.geometry.coordinates[p][i_2][j][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (j == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n }\n }\n\n ctx.stroke();\n ctx.closePath();\n ctx.fill();\n }\n } else if (f.geometry.type == 'LineString' || f.geometry.type == 'MultiLineString') {\n if (typeof f.geometry.coordinates[0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][1], f.geometry.coordinates[p][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (p == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n } else if (typeof f.geometry.coordinates[0][0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n for (var i_3 = 0; i_3 < f.geometry.coordinates[p].length; i_3++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_3][1], f.geometry.coordinates[p][i_3][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_3 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n }\n }\n } else if (f.geometry.type.toLowerCase() === 'point') {\n var lnglat = void 0;\n\n if (typeof f.geometry.coordinates[0] === 'number') {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[1], f.geometry.coordinates[0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0],\n lat: f.geometry.coordinates[1]\n };\n } else {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[0][1], f.geometry.coordinates[0][0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0][0],\n lat: f.geometry.coordinates[0][1]\n };\n }\n\n var lnglatRadiusAway = _this.p.p.projection.tileXYZ2LatLng(tileXYZ.x + (style.radius + ctx.lineWidth) / canvas.width, tileXYZ.y, _this.p.p.zoom);\n\n f._radiusInMeters = _this.p.p.projection.lngLatDistBetween(lnglat.lng, lnglat.lat, lnglatRadiusAway.lng, lnglatRadiusAway.lat);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if ((_a = c.style) === null || _a === void 0 ? void 0 : _a.bearing) {\n var unit = c.style.bearing.angleUnit || 'deg';\n var bearingProp = c.style.bearing.angleProp || false;\n var yaw = 0;\n\n if (bearingProp !== false) {\n yaw = parseFloat(_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(f.properties, bearingProp, 0));\n\n if (unit === 'deg') {\n yaw = yaw * (Math.PI / 180);\n }\n }\n\n yaw += Math.PI;\n var startingPoint = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw - 45 * (Math.PI / 180));\n var indicator = [_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius * 2\n }, [canvasX, canvasY], yaw), _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw + 45 * (Math.PI / 180)), startingPoint];\n ctx.fillStyle = c.style.bearing.color || 'red';\n ctx.lineWidth = 1 / scaleFactor * 1;\n ctx.beginPath();\n ctx.moveTo(startingPoint.x, startingPoint.y);\n indicator.forEach(function (ind) {\n ctx.lineTo(ind.x, ind.y);\n });\n ctx.closePath();\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = style.fillColor;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n }\n\n ctx.beginPath();\n ctx.arc(canvasX, canvasY, style.radius, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n if (doesFeatureOverlapTile) {\n f._highlighted = f._highlighted || false;\n overlappedFeatures.push(f);\n }\n }\n }\n }\n\n return {\n canvas: canvas,\n features: overlappedFeatures\n };\n };\n\n this.p = parent;\n }\n\n return ClampedLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ClampedLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/clamped.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n\nvar opacityTimeout = null;\n\nvar ClampedLayerer = function () {\n function ClampedLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == layerObj.name) {\n _this.p.clamped[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.clamped.push(layerObj);\n\n _this.p.clamped.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n if (typeof callback === 'function') callback();\n };\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.preDrawn === true && layerObj.hasOwnProperty('data') || layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson'))) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n if (!layerObj.hasOwnProperty('opacity')) layerObj.opacity = 1;\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for clamped layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid clamped layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.clamped.forEach(function (layer) {\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.updateAllRasters();\n\n return true;\n }\n\n return false;\n };\n\n this.orderLayers = function (ordering) {\n var missingCount = 0;\n\n _this.p.clamped.forEach(function (layer) {\n var newOrder = ordering.indexOf(layer.name);\n\n if (newOrder >= 0) {\n layer.order = _this.p.clamped.length - newOrder;\n } else {\n layer.order = _this.p.clamped.length - ordering.length - missingCount;\n missingCount++;\n }\n });\n\n _this.p.clamped.sort(function (a, b) {\n return a.order - b.order;\n });\n\n return true;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.clamped[i];\n\n if (name === layer.name) {\n clearTimeout(opacityTimeout);\n opacityTimeout = setTimeout(function () {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n\n if (_this.p.p.zoom >= layer.minZoom && _this.p.p.zoom <= layer.maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n }, 250);\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.clamped.length; i++) {\n if (_this.p.clamped[i].hasOwnProperty('name')) {\n if (_this.p.clamped[i].name == name) {\n var minZoom = _this.p.clamped[i].minZoom;\n var maxZoom = _this.p.clamped[i].maxZoom;\n\n _this.p.clamped.splice(i, 1);\n\n if (_this.p.p.zoom >= minZoom && _this.p.p.zoom <= maxZoom) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n _this.p.p._.tiledWorld.updateAllRasters();\n }\n\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.getClampedTexture = function (i, xyz) {\n var _a;\n\n var scaleFactor = 0.5;\n var c = _this.p.clamped[i];\n var canvas = document.createElement('canvas');\n canvas.id = 'vectorsastile';\n canvas.width = 256 / scaleFactor;\n scaleFactor = scaleFactor * Math.pow(2, _this.p.p.zoom - xyz.z);\n canvas.height = canvas.width;\n var ctx = canvas.getContext('2d');\n var tileXYZ;\n var overlappedFeatures = [];\n\n if (scaleFactor < 128) {\n if (c.preDrawn) {\n ctx.imageSmoothingEnabled = false;\n\n if (c.data && c.data[xyz.z] && c.data[xyz.z][xyz.x] && c.data[xyz.z][xyz.x][xyz.y] != null) {\n ctx.drawImage(c.data[xyz.z][xyz.x][xyz.y], 0, 0, canvas.width, canvas.height);\n }\n } else {\n for (var _i = 0, _b = c.geojson.features; _i < _b.length; _i++) {\n var f = _b[_i];\n\n var style = _this.p.getFeatureStyle(c, f);\n\n if (!_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isInZoomRange(style.minZoom != null ? style.minZoom : c.minZoom, style.maxZoom != null ? style.maxZoom : c.maxZoom, _this.p.p.zoom)) continue;\n var doesFeatureOverlapTile = false;\n\n if (style.fillColor.substring(0, 3).toLowerCase() != 'rgb') {\n var col = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hexToRGB(style.fillColor);\n\n if (col) {\n style.fillColor = 'rgba(' + col.r + ',' + col.g + ',' + col.b + ',' + style.fillOpacity + ')';\n }\n } else {\n var rgb = style.fillColor.substring(4, style.fillColor.length - 1).replace(/ /g, '').split(',');\n style.fillColor = 'rgba(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ',' + style.fillOpacity + ')';\n }\n\n ctx.fillStyle = style.fillColor;\n ctx.strokeStyle = style.color;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n ctx.globalAlpha = c.opacity;\n ctx.lineCap = 'round';\n style.radius *= 1 / scaleFactor * 1 || 10;\n\n if ((f.geometry.type == 'Polygon' || f.geometry.type == 'MultiPolygon') && f.geometry.coordinates[0]) {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n if (typeof f.geometry.coordinates[p][0][0] === 'number') {\n for (var i_1 = 0; i_1 < f.geometry.coordinates[p].length; i_1++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_1][1], f.geometry.coordinates[p][i_1][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_1 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n } else if (typeof f.geometry.coordinates[p][0][0][0] === 'number') {\n for (var i_2 = 0; i_2 < f.geometry.coordinates[p].length; i_2++) {\n for (var j = 0; j < f.geometry.coordinates[p][i_2].length; j++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_2][j][1], f.geometry.coordinates[p][i_2][j][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (j == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n }\n }\n\n ctx.stroke();\n ctx.closePath();\n ctx.fill();\n }\n } else if (f.geometry.type == 'LineString' || f.geometry.type == 'MultiLineString') {\n if (typeof f.geometry.coordinates[0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][1], f.geometry.coordinates[p][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (p == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n } else if (typeof f.geometry.coordinates[0][0][0] === 'number') {\n for (var p = 0; p < f.geometry.coordinates.length; p++) {\n for (var i_3 = 0; i_3 < f.geometry.coordinates[p].length; i_3++) {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[p][i_3][1], f.geometry.coordinates[p][i_3][0], xyz.z, true);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (i_3 == 0) {\n ctx.beginPath();\n ctx.moveTo(canvasX, canvasY);\n } else {\n ctx.lineTo(canvasX, canvasY);\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n ctx.stroke();\n }\n }\n } else if (f.geometry.type.toLowerCase() === 'point') {\n var lnglat = void 0;\n\n if (typeof f.geometry.coordinates[0] === 'number') {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[1], f.geometry.coordinates[0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0],\n lat: f.geometry.coordinates[1]\n };\n } else {\n tileXYZ = _this.p.p.projection.latLngZ2TileXYZ(f.geometry.coordinates[0][1], f.geometry.coordinates[0][0], xyz.z, true);\n lnglat = {\n lng: f.geometry.coordinates[0][0],\n lat: f.geometry.coordinates[0][1]\n };\n }\n\n var lnglatRadiusAway = _this.p.p.projection.tileXYZ2LatLng(tileXYZ.x + (style.radius + ctx.lineWidth) / canvas.width, tileXYZ.y, _this.p.p.zoom);\n\n f._radiusInMeters = _this.p.p.projection.lngLatDistBetween(lnglat.lng, lnglat.lat, lnglatRadiusAway.lng, lnglatRadiusAway.lat);\n var canvasX = parseInt((tileXYZ.x - xyz.x) * canvas.width);\n var canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height);\n\n if (f.properties.annotation === true) {\n var text = f.properties.name || '';\n var fontXOffset = 10;\n var fontSize = style.fontSize || '16px';\n fontSize = parseInt(fontSize.replace('px', '')) * 1.2;\n ctx.font = fontSize + \"pt sans-serif\";\n var heightOverflow = 2;\n var textSize = {\n width: ctx.measureText(text).width + fontXOffset * 2,\n height: fontSize + heightOverflow\n };\n var rotAngle = -(style.rotation || 0) * Math.PI / 180;\n ctx.translate(canvasX, canvasY);\n ctx.rotate(rotAngle);\n ctx.translate(-canvasX, -canvasY);\n ctx.fillStyle = style.color;\n ctx.fillRect(canvasX, canvasY - textSize.height + heightOverflow / 2, textSize.width, textSize.height);\n ctx.fillStyle = style.fillColor;\n ctx.fillText(text, canvasX + fontXOffset, canvasY);\n var anchorRadius = 6;\n ctx.lineWidth = anchorRadius;\n ctx.beginPath();\n ctx.arc(canvasX, canvasY, 8, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n ctx.translate(canvasX, canvasY);\n ctx.rotate(-rotAngle);\n ctx.translate(-canvasX, -canvasY);\n } else {\n if ((_a = c.style) === null || _a === void 0 ? void 0 : _a.bearing) {\n var unit = c.style.bearing.angleUnit || 'deg';\n var bearingProp = c.style.bearing.angleProp || false;\n var yaw = 0;\n\n if (bearingProp !== false) {\n yaw = parseFloat(_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(f.properties, bearingProp, 0));\n\n if (unit === 'deg') {\n yaw = yaw * (Math.PI / 180);\n }\n }\n\n yaw += Math.PI;\n var startingPoint = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw - 45 * (Math.PI / 180));\n var indicator = [_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius * 2\n }, [canvasX, canvasY], yaw), _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].rotatePoint({\n x: canvasX,\n y: canvasY + style.radius + ctx.lineWidth - 2\n }, [canvasX, canvasY], yaw + 45 * (Math.PI / 180)), startingPoint];\n ctx.fillStyle = c.style.bearing.color || 'red';\n ctx.lineWidth = 1 / scaleFactor * 1;\n ctx.beginPath();\n ctx.moveTo(startingPoint.x, startingPoint.y);\n indicator.forEach(function (ind) {\n ctx.lineTo(ind.x, ind.y);\n });\n ctx.closePath();\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = style.fillColor;\n ctx.lineWidth = style.weight * (1 / scaleFactor * 1);\n }\n\n ctx.beginPath();\n ctx.arc(canvasX, canvasY, style.radius, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n }\n\n if (canvasX >= 0 && canvasX < canvas.width && canvasY >= 0 && canvasY < canvas.height) doesFeatureOverlapTile = true;\n }\n\n if (doesFeatureOverlapTile) {\n f._highlighted = f._highlighted || false;\n overlappedFeatures.push(f);\n }\n }\n }\n }\n\n return {\n canvas: canvas,\n features: overlappedFeatures\n };\n };\n\n this.p = parent;\n }\n\n return ClampedLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ClampedLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/clamped.ts?"); /***/ }), @@ -2079,7 +2079,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n/* harmony import */ var _tile3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tile3d */ \"./src/layers/tile3d.ts\");\n/* harmony import */ var _tile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tile */ \"./src/layers/tile.ts\");\n/* harmony import */ var _clamped__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./clamped */ \"./src/layers/clamped.ts\");\n/* harmony import */ var _vector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vector */ \"./src/layers/vector.ts\");\n/* harmony import */ var _curtain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curtain */ \"./src/layers/curtain.ts\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model */ \"./src/layers/model.ts\");\n\n\n\n\n\n\n\n\nvar Layers = function () {\n function Layers(parent) {\n var _this = this;\n\n this.addLayer = function (type, layerObj, callback, sI) {\n if (layerObj.on == 1) layerObj.on = true;else if (layerObj.on == 0) layerObj.on = false;\n layerObj._type = type;\n if (_this._.layerers[type]) _this._.layerers[type].add(layerObj, callback);else console.warn(\"Cannot add unknown layer type \" + type + \".\");\n };\n\n this.removeLayer = function (name) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didRemove = _this._.layerers[type].remove(name);\n\n if (didRemove) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.toggleLayer = function (name, on) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didToggle = _this._.layerers[type].toggle(name, on);\n\n if (didToggle) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerOpacity = function (name, opacity) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didOpacity = _this._.layerers[type].setOpacity(name, parseFloat(opacity));\n\n if (didOpacity) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerFilterEffect = function (name, filter, value) {\n var allowableFilterEffects = ['brightness', 'contrast', 'saturation', 'blendCode'];\n\n if (!allowableFilterEffects.includes(filter)) {\n console.warn(\"Filter \" + filter + \" must be one of: \" + allowableFilterEffects.toString() + \".\");\n return false;\n }\n\n var didFilter = _this._.layerers.tile.setFilterEffect(name, filter, parseFloat(value));\n\n if (!didFilter) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerSpecificOptions = function (name, options) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n if (typeof _this._.layerers[type].setLayerSpecificOptions === 'function') {\n var didOptions = _this._.layerers[type].setLayerSpecificOptions(name, options);\n\n if (didOptions) foundMatch = true;\n }\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.findHighestMaxZoom = function () {\n var highest = 0;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].maxZoom > highest) {\n highest = _this.tile[l].maxZoom;\n }\n }\n\n return highest;\n };\n\n this.findLowestMinZoom = function () {\n var lowest = Infinity;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].minZoom < lowest) {\n lowest = _this.tile[l].minZoom;\n }\n }\n\n return lowest;\n };\n\n this.getFeatureStyleProp = function (value, feature) {\n if (value != null && typeof value === 'string' && value.includes('=')) {\n var propValue = null;\n var split = value.split('=');\n propValue = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, split[1].split('.'));\n return propValue;\n } else {\n return value;\n }\n };\n\n this.getLayerByName = function (layerName) {\n for (var type in _this.all) {\n for (var i = 0; i < _this.all[type].length; i++) {\n if (_this.all[type][i].name === layerName) return _this.all[type][i];\n }\n }\n\n return null;\n };\n\n this.hasLayer = function (layerName) {\n return _this.getLayerByName(layerName) != null;\n };\n\n this.getFeatureStyle = function (layer, feature, isStrokeless) {\n var _a, _b;\n\n var style = JSON.parse(JSON.stringify(_this.baseStyle));\n\n if (layer.style) {\n var geomType = feature.geometry.type.toLowerCase();\n\n for (var key in style) {\n if (layer.style.default && layer.style.default[key] != null) {\n var defaultOverride = _this.getFeatureStyleProp(layer.style.default[key], feature);\n\n style[key] = defaultOverride != null ? defaultOverride : style[key];\n }\n\n if (geomType === 'point' && layer.style.point) {\n var pointOverride = _this.getFeatureStyleProp(layer.style.point[key], feature);\n\n style[key] = pointOverride != null ? pointOverride : style[key];\n } else if (geomType === 'linestring' && layer.style.line) {\n var lineOverride = _this.getFeatureStyleProp(layer.style.line[key], feature);\n\n style[key] = lineOverride != null ? lineOverride : style[key];\n } else if (geomType === 'polygon' && layer.style.polygon) {\n var polygonOverride = _this.getFeatureStyleProp(layer.style.polygon[key], feature);\n\n style[key] = polygonOverride != null ? polygonOverride : style[key];\n }\n\n if (layer.style.byProp) {\n for (var propPath in layer.style.byProp) {\n var path = propPath.split(':')[0].split('=')[1];\n var value = propPath.split(':')[1];\n\n if (_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, path.split('.')) == value) {\n var propOverride = _this.getFeatureStyleProp(layer.style.byProp[propPath][key], feature);\n\n style[key] = propOverride != null ? propOverride : style[key];\n }\n }\n }\n\n if (layer.style.letPropertiesStyleOverride === true) {\n var styleOverride = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn((_a = feature.properties) === null || _a === void 0 ? void 0 : _a.style, key);\n style[key] = styleOverride != null ? styleOverride : style[key];\n }\n }\n }\n\n if (style.fillColor === 'none') style.fillColor = 'rgba(0,0,0,0)';\n var type = ((_b = feature.geometry) === null || _b === void 0 ? void 0 : _b.type) ? feature.geometry.type.toLowerCase() : '';\n\n if (feature._active) {\n if (_this.p.options.canBecomeActive !== false && layer.canBecomeActive !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeActive !== false)) style.fillColor = _this.p.options.activeColor || 'red';\n } else if (feature._highlighted) {\n if (_this.p.options.canBecomeHighlighted !== false && layer.canBecomeHighlighted !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeHighlighted !== false)) style.fillColor = _this.p.options.highlightColor || 'yellow';\n }\n\n if (isStrokeless === true) {\n style.color = style.fillColor;\n }\n\n return style;\n };\n\n this._onMouseMove = function (intersectedLL, e, obj, intersectionRaw, intersectionPoint) {\n var _a;\n\n if (obj.layerType && _this[obj.layerType]) {\n var layers = _this[obj.layerType];\n\n for (var l in layers) {\n if (((_a = obj.parent) === null || _a === void 0 ? void 0 : _a.uuid) === layers[l].curtain.uuid) if (typeof layers[l].onMouseMove === 'function') layers[l].onMouseMove(e, layers[l], obj, intersectionRaw, intersectedLL, intersectionPoint);\n }\n }\n };\n\n this.p = parent;\n this.baseStyle = {\n fillColor: 'rgb(0,0,0)',\n fillOpacity: 0.4,\n color: 'rgb(255,255,255)',\n weight: 2,\n radius: 6\n };\n this._ = {\n layerers: {\n tile3d: new _tile3d__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this),\n tile: new _tile__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this),\n clamped: new _clamped__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this),\n vector: new _vector__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this),\n curtain: new _curtain__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this),\n model: new _model__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this)\n }\n };\n\n this._reset();\n }\n\n Layers.prototype._reset = function () {\n this.tile3d = [];\n this.tile = [];\n this.clamped = [];\n this.vector = [];\n this.curtain = [];\n this.model = [];\n this.all = {\n tile3d: this.tile3d,\n tile: this.tile,\n clamped: this.clamped,\n vector: this.vector,\n curtain: this.curtain,\n model: this.model\n };\n };\n\n return Layers;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Layers);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/index.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./src/utils/index.ts\");\n/* harmony import */ var _tile3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tile3d */ \"./src/layers/tile3d.ts\");\n/* harmony import */ var _tile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tile */ \"./src/layers/tile.ts\");\n/* harmony import */ var _clamped__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./clamped */ \"./src/layers/clamped.ts\");\n/* harmony import */ var _vector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vector */ \"./src/layers/vector.ts\");\n/* harmony import */ var _curtain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curtain */ \"./src/layers/curtain.ts\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model */ \"./src/layers/model.ts\");\n\n\n\n\n\n\n\n\nvar Layers = function () {\n function Layers(parent) {\n var _this = this;\n\n this.addLayer = function (type, layerObj, callback, sI) {\n var _a;\n\n if (layerObj.on == 1) layerObj.on = true;else if (layerObj.on == 0) layerObj.on = false;\n layerObj._type = type;\n\n if (((_a = layerObj.order) === null || _a === void 0 ? void 0 : _a.length) != null) {\n layerObj.order = _this.getDesiredOrder(layerObj.name, type, layerObj.order);\n }\n\n if (layerObj.order == null) layerObj.order = _this.all[type].length;\n if (_this._.layerers[type]) _this._.layerers[type].add(layerObj, callback);else console.warn(\"Cannot add unknown layer type \" + type + \".\");\n };\n\n this.removeLayer = function (name) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didRemove = _this._.layerers[type].remove(name);\n\n if (didRemove) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.toggleLayer = function (name, on) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didToggle = _this._.layerers[type].toggle(name, on);\n\n if (didToggle) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.orderLayers = function (ordering) {\n var orderingTyped = {};\n ordering.forEach(function (name) {\n var layer = _this.getLayerByName(name);\n\n if (layer && layer._type) {\n if (orderingTyped[layer._type] == null) orderingTyped[layer._type] = [];\n\n orderingTyped[layer._type].push(name);\n }\n });\n var hit = false;\n\n for (var type in orderingTyped) {\n if (typeof _this._.layerers[type].orderLayers === 'function') {\n _this._.layerers[type].orderLayers(orderingTyped[type]);\n\n hit = true;\n }\n }\n\n if (hit) {\n _this.p._.tiledWorld.removeAllTiles();\n }\n\n return true;\n };\n\n this.getDesiredOrder = function (name, type, ordering) {\n var orderingTyped = {};\n ordering.forEach(function (layerName, idx) {\n var layer = _this.getLayerByName(layerName);\n\n if (layer && layer._type) {\n if (orderingTyped[layer._type] == null) orderingTyped[layer._type] = [];\n\n orderingTyped[layer._type].push({\n name: layer.name,\n order: layer.order,\n index: idx\n });\n }\n });\n\n if (orderingTyped[type]) {\n var index = ordering.indexOf(name);\n var desiredOrder = 0;\n\n for (var i = 0; i < orderingTyped[type].length; i++) {\n if (index > orderingTyped[type][i].index) {\n if (i == orderingTyped[type].length - 1) desiredOrder = orderingTyped[type][i].index + 1;else desiredOrder = (orderingTyped[type][i].order + orderingTyped[type][i + 1].order) / 2;\n return desiredOrder;\n }\n }\n\n if (orderingTyped[type].length > 0) return orderingTyped[type][0].order + 1;\n }\n\n if (ordering.includes(name)) return ordering.length - ordering.indexOf(name) - 1;\n return 0;\n };\n\n this.setLayerOpacity = function (name, opacity) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n var didOpacity = _this._.layerers[type].setOpacity(name, parseFloat(opacity));\n\n if (didOpacity) foundMatch = true;\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerFilterEffect = function (name, filter, value) {\n var allowableFilterEffects = ['brightness', 'contrast', 'saturation', 'blendCode'];\n\n if (!allowableFilterEffects.includes(filter)) {\n console.warn(\"Filter \" + filter + \" must be one of: \" + allowableFilterEffects.toString() + \".\");\n return false;\n }\n\n var didFilter = _this._.layerers.tile.setFilterEffect(name, filter, parseFloat(value));\n\n if (!didFilter) {\n return false;\n }\n\n return true;\n };\n\n this.setLayerSpecificOptions = function (name, options) {\n var foundMatch = false;\n\n for (var type in _this._.layerers) {\n if (typeof _this._.layerers[type].setLayerSpecificOptions === 'function') {\n var didOptions = _this._.layerers[type].setLayerSpecificOptions(name, options);\n\n if (didOptions) foundMatch = true;\n }\n }\n\n if (!foundMatch) {\n return false;\n }\n\n return true;\n };\n\n this.findHighestMaxZoom = function () {\n var highest = 0;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].maxZoom > highest) {\n highest = _this.tile[l].maxZoom;\n }\n }\n\n return highest;\n };\n\n this.findLowestMinZoom = function () {\n var lowest = Infinity;\n\n for (var l in _this.tile) {\n if (_this.tile[l].on) if (_this.tile[l].minZoom < lowest) {\n lowest = _this.tile[l].minZoom;\n }\n }\n\n return lowest;\n };\n\n this.getLayerByName = function (layerName) {\n for (var type in _this.all) {\n for (var i = 0; i < _this.all[type].length; i++) {\n if (_this.all[type][i].name === layerName) return _this.all[type][i];\n }\n }\n\n return null;\n };\n\n this.hasLayer = function (layerName) {\n return _this.getLayerByName(layerName) != null;\n };\n\n this.getFeatureStyleProp = function (value, feature) {\n if (value != null && typeof value === 'string' && value.includes('=')) {\n var propValue = null;\n var split = value.split('=');\n propValue = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, split[1].split('.'));\n return propValue;\n } else {\n return value;\n }\n };\n\n this.getBaseStyle = function (feature, type, geomType) {\n var _a;\n\n var baseStyle = {\n fillColor: 'rgb(0,0,0)',\n fillOpacity: 0.4,\n color: 'rgb(255,255,255)',\n weight: 2,\n radius: 6\n };\n\n if (((_a = feature === null || feature === void 0 ? void 0 : feature.properties) === null || _a === void 0 ? void 0 : _a.annotation) === true) {\n baseStyle.fontSize = '16px';\n baseStyle.rotation = 0;\n baseStyle.fillOpacity = 1;\n }\n\n if (type === 'vector' && geomType === 'point') {\n baseStyle.elevOffset = 20;\n }\n\n if (type === 'vector' || type === 'clamped') {\n baseStyle.minZoom = null;\n baseStyle.maxZoom = null;\n }\n\n return baseStyle;\n };\n\n this.getFeatureStyle = function (layer, feature, isStrokeless) {\n var _a, _b;\n\n var geomType = feature.geometry.type.toLowerCase();\n\n var style = _this.getBaseStyle(feature, layer._type, geomType);\n\n if (layer.style) {\n for (var key in style) {\n if (layer.style.default && layer.style.default[key] != null) {\n var defaultOverride = _this.getFeatureStyleProp(layer.style.default[key], feature);\n\n style[key] = defaultOverride != null ? defaultOverride : style[key];\n }\n\n if (geomType === 'point' && layer.style.point) {\n var pointOverride = _this.getFeatureStyleProp(layer.style.point[key], feature);\n\n style[key] = pointOverride != null ? pointOverride : style[key];\n } else if (geomType === 'linestring' && layer.style.line) {\n var lineOverride = _this.getFeatureStyleProp(layer.style.line[key], feature);\n\n style[key] = lineOverride != null ? lineOverride : style[key];\n } else if (geomType === 'polygon' && layer.style.polygon) {\n var polygonOverride = _this.getFeatureStyleProp(layer.style.polygon[key], feature);\n\n style[key] = polygonOverride != null ? polygonOverride : style[key];\n }\n\n if (layer.style.byProp) {\n for (var propPath in layer.style.byProp) {\n var path = propPath.split(':')[0].split('=')[1];\n var value = propPath.split(':')[1];\n\n if (_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn(feature.properties, path.split('.')) == value) {\n var propOverride = _this.getFeatureStyleProp(layer.style.byProp[propPath][key], feature);\n\n style[key] = propOverride != null ? propOverride : style[key];\n }\n }\n }\n\n if (layer.style.letPropertiesStyleOverride === true) {\n var styleOverride = _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getIn((_a = feature.properties) === null || _a === void 0 ? void 0 : _a.style, key);\n style[key] = styleOverride != null ? styleOverride : style[key];\n }\n }\n }\n\n if (style.fillColor === 'none') style.fillColor = 'rgba(0,0,0,0)';\n var type = ((_b = feature.geometry) === null || _b === void 0 ? void 0 : _b.type) ? feature.geometry.type.toLowerCase() : '';\n\n if (feature._active) {\n if (_this.p.options.canBecomeActive !== false && layer.canBecomeActive !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeActive !== false)) style.fillColor = _this.p.options.activeColor || 'red';\n } else if (feature._highlighted) {\n if (_this.p.options.canBecomeHighlighted !== false && layer.canBecomeHighlighted !== false && (layer.style[type] == null || layer.style[type] && layer.style[type].canBecomeHighlighted !== false)) style.fillColor = _this.p.options.highlightColor || 'yellow';\n }\n\n if (isStrokeless === true) {\n style.color = style.fillColor;\n }\n\n return style;\n };\n\n this._onMouseMove = function (intersectedLL, e, obj, intersectionRaw, intersectionPoint) {\n var _a;\n\n if (obj.layerType && _this[obj.layerType]) {\n var layers = _this[obj.layerType];\n\n for (var l in layers) {\n if (((_a = obj.parent) === null || _a === void 0 ? void 0 : _a.uuid) === layers[l].curtain.uuid) if (typeof layers[l].onMouseMove === 'function') layers[l].onMouseMove(e, layers[l], obj, intersectionRaw, intersectedLL, intersectionPoint);\n }\n }\n };\n\n this.p = parent;\n this._ = {\n layerers: {\n tile3d: new _tile3d__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this),\n tile: new _tile__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this),\n clamped: new _clamped__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this),\n vector: new _vector__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this),\n curtain: new _curtain__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this),\n model: new _model__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this)\n }\n };\n\n this._reset();\n }\n\n Layers.prototype._reset = function () {\n this.tile3d = [];\n this.tile = [];\n this.clamped = [];\n this.vector = [];\n this.curtain = [];\n this.model = [];\n this.all = {\n tile3d: this.tile3d,\n tile: this.tile,\n clamped: this.clamped,\n vector: this.vector,\n curtain: this.curtain,\n model: this.model\n };\n };\n\n return Layers;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Layers);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/index.ts?"); /***/ }), @@ -2103,7 +2103,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar TileLayerer = function () {\n function TileLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj) {\n if (!_this.p.p._.wasInitialized) return;\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n var alreadyExists = false;\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && layerObj.hasOwnProperty('path') && layerObj.hasOwnProperty('opacity') && layerObj.hasOwnProperty('minZoom') && layerObj.hasOwnProperty('maxZoom')) {\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == layerObj.name) {\n _this.p.tile[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.tile.push(layerObj);\n\n _this.p.tile.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.removeAllTiles();\n }\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n } else {\n console.warn('Attempted to add an invalid tile layer.');\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.tile.forEach(function (t) {\n if (name === t.name) {\n t.on = on != null ? on : !t.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.outdateAllTiles();\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].opacity = opacity;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.setFilterEffect = function (name, filter, value) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n _this.p.tile[i].filters = _this.p.tile[i].filters || {};\n\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].filters[filter] = value;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (_this.p.p.zoom >= _this.p.tile[i].minZoom && _this.p.p.zoom <= _this.p.tile[i].maxZoom) {\n var startingLength = _this.p.p._.tiledWorld.tilesDrawn.length;\n\n for (var j = 0; j < startingLength; j++) {\n _this.p.p._.tiledWorld.removeTile(0);\n }\n }\n\n _this.p.tile.splice(i, 1);\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.p = parent;\n }\n\n return TileLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TileLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/tile.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar TileLayerer = function () {\n function TileLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj) {\n if (!_this.p.p._.wasInitialized) return;\n\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n var alreadyExists = false;\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && layerObj.hasOwnProperty('path') && layerObj.hasOwnProperty('opacity') && layerObj.hasOwnProperty('minZoom') && layerObj.hasOwnProperty('maxZoom')) {\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == layerObj.name) {\n _this.p.tile[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n _this.p.tile.push(layerObj);\n\n _this.p.tile.sort(function (a, b) {\n return a.order - b.order;\n });\n }\n\n if (_this.p.p.zoom >= layerObj.minZoom && _this.p.p.zoom <= layerObj.maxZoom) {\n _this.p.p._.tiledWorld.removeAllTiles();\n }\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n } else {\n console.warn('Attempted to add an invalid tile layer.');\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n var foundMatch = false;\n\n _this.p.tile.forEach(function (t) {\n if (name === t.name) {\n t.on = on != null ? on : !t.on;\n foundMatch = true;\n }\n });\n\n if (foundMatch) {\n _this.p.p._.tiledWorld.outdateAllTiles();\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n\n return false;\n };\n\n this.orderLayers = function (ordering) {\n var missingCount = 0;\n\n _this.p.tile.forEach(function (layer) {\n var newOrder = ordering.indexOf(layer.name);\n\n if (newOrder >= 0) {\n layer.order = _this.p.tile.length - newOrder;\n } else {\n layer.order = _this.p.tile.length - ordering.length - missingCount;\n missingCount++;\n }\n });\n\n _this.p.tile.sort(function (a, b) {\n return a.order - b.order;\n });\n\n return true;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].opacity = opacity;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.setFilterEffect = function (name, filter, value) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n _this.p.tile[i].filters = _this.p.tile[i].filters || {};\n\n if (_this.p.tile[i].name == name) {\n _this.p.tile[i].filters[filter] = value;\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.tile.length; i++) {\n if (_this.p.tile[i].hasOwnProperty('name')) {\n if (_this.p.tile[i].name == name) {\n _this.p.p._.tiledWorld.killDrawingTiles();\n\n if (_this.p.p.zoom >= _this.p.tile[i].minZoom && _this.p.p.zoom <= _this.p.tile[i].maxZoom) {\n var startingLength = _this.p.p._.tiledWorld.tilesDrawn.length;\n\n for (var j = 0; j < startingLength; j++) {\n _this.p.p._.tiledWorld.removeTile(0);\n }\n }\n\n _this.p.tile.splice(i, 1);\n\n _this.p.p._.maxZoom = _this.p.findHighestMaxZoom();\n _this.p.p._.minNativeZoom = _this.p.findLowestMinZoom();\n return true;\n }\n }\n }\n\n return false;\n };\n\n this.p = parent;\n }\n\n return TileLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TileLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/tile.ts?"); /***/ }), @@ -2127,7 +2127,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _3d_ /***/ (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/* harmony import */ var three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three/examples/jsm/lines/LineGeometry */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/lines/LineMaterial */ \"./node_modules/three/examples/jsm/lines/LineMaterial.js\");\n/* harmony import */ var three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three/examples/jsm/lines/Line2 */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\n/* harmony import */ var _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../secondary/sprites */ \"./src/secondary/sprites.ts\");\n\n\n\n\n\n\nvar VectorLayerer = function () {\n function VectorLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].hasOwnProperty('name')) {\n if (_this.p.vector[i].name == layerObj.name) {\n _this.p.vector[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n var meshes = _this.generateVectors(layerObj);\n\n _this.p.p.planet.add(meshes);\n\n layerObj.meshes = meshes;\n\n _this.p.vector.push(layerObj);\n\n _this.p.vector.sort(function (a, b) {\n return b.order - a.order;\n });\n }\n\n _this.p.p._.events._attenuate();\n\n if (typeof callback === 'function') callback();\n };\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && layerObj.hasOwnProperty('opacity')) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for vector layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid vector layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n layer.meshes.visible = layer.on;\n console.log(layer);\n\n _this.p.p._.events._attenuate();\n\n return true;\n }\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n layer.meshes.children.forEach(function (mesh) {\n mesh.material.opacity = layer.opacity;\n });\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].name === name) {\n _this.p.p.planet.remove(_this.p.vector[i].meshes);\n\n _this.p.vector.splice(i, 1);\n\n return true;\n }\n }\n\n return false;\n };\n\n this.generateVectors = function (layerObj) {\n var vectorGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\n\n if (layerObj.geojson == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has no geojson.\");\n return;\n }\n\n var features = layerObj.geojson.features;\n\n if (features == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has invalid geojson.\");\n return;\n }\n\n var pointType = layerObj.style ? layerObj.style.pointType : '';\n var lineType = layerObj.style ? layerObj.style.lineType : '';\n\n for (var _i = 0, features_1 = features; _i < features_1.length; _i++) {\n var f = features_1[_i];\n var type = f.geometry.type;\n var mesh = null;\n\n switch (type.toLowerCase()) {\n case 'point':\n switch (pointType) {\n case 'sphere':\n break;\n\n default:\n mesh = _this.geomTo.sprite(layerObj, f);\n }\n\n break;\n\n case 'linestring':\n switch (lineType) {\n case 'thin':\n mesh = _this.geomTo.line(layerObj, f);\n break;\n\n default:\n mesh = _this.geomTo.thickLine(layerObj, f);\n }\n\n break;\n\n case 'polygon':\n break;\n\n default:\n console.warn(\"Vector layer: \" + layerObj.name + \" has an unsupported geojson geometry type: \" + type + \".\");\n break;\n }\n\n mesh.feature = f;\n vectorGroup.add(mesh);\n }\n\n if (layerObj.on == false) {\n vectorGroup.visible = false;\n }\n\n return vectorGroup;\n };\n\n this.geomTo = {\n sprite: function (layerObj, feature, forceNewMaterial) {\n var g = feature.geometry.coordinates;\n\n var style = _this.p.getFeatureStyle(layerObj, feature);\n\n var sprite = _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__[\"default\"].makeMarkerSprite(style, layerObj.name, forceNewMaterial);\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n if (typeof g[0] == 'number') g = [g];\n\n var v = _this.p.p.projection.lonLatToVector3(g[0][i0], g[0][i1], (g[0][2] || 0) * _this.p.p.options.exaggeration);\n\n sprite.position.set(v.x, v.y, v.z);\n sprite.renderOrder = layerObj.index;\n\n if (layerObj.on == false) {\n sprite.visible = false;\n }\n\n sprite.layerName = layerObj.name;\n sprite.useKeyAsHoverName = layerObj.useKeyAsHoverName;\n sprite.name = layerObj.name;\n sprite.style = style;\n\n sprite.restyle = function () {\n var newSprite = _this.geomTo.sprite(layerObj, sprite.feature, sprite.feature._highlighted || sprite.feature._active);\n\n sprite.style = newSprite.style;\n sprite.material.dispose();\n sprite.material = newSprite.material;\n sprite.material.map.needsUpdate = true;\n sprite.material.needsUpdate = true;\n };\n\n return sprite;\n },\n line: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n var vertices = [];\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z));\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferGeometry\"]().setFromPoints(vertices);\n var mesh = new three__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](geometry, new three__WEBPACK_IMPORTED_MODULE_0__[\"LineBasicMaterial\"]({\n transparent: true,\n color: style.color\n }));\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n return mesh;\n },\n thickLine: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var path = [];\n var firstPos;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n if (i == 0) {\n firstPos = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z);\n }\n\n path.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x - firstPos.x, v.y - firstPos.y, v.z - firstPos.z));\n if (i != 0 || i != g.length - 1) path.push(path[path.length - 1]);\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var positions = [];\n var spline = new three__WEBPACK_IMPORTED_MODULE_0__[\"CatmullRomCurve3\"](path);\n var divisions = Math.round(1 * path.length);\n\n for (var i = 0, l = divisions; i < l; i++) {\n var point = spline.getPoint(i / l);\n positions.push(point.x, point.y, point.z);\n }\n\n var geometry = new three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__[\"LineGeometry\"]();\n geometry.setPositions(positions);\n var material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n var mesh = new three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__[\"Line2\"](geometry, material);\n mesh.computeLineDistances();\n mesh.position.set(firstPos.x, firstPos.y, firstPos.z);\n mesh.scale.set(1, 1, 1);\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n\n mesh.restyle = function () {\n var style = _this.p.getFeatureStyle(layerObj, mesh.feature, true);\n\n mesh.material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n mesh.strokeColor = style.color;\n };\n\n return mesh;\n }\n };\n this.p = parent;\n this.baseStyle = {\n fillColor: 'rgb(255,255,255)',\n fillOpacity: 0.4,\n color: 'rgb(0,0,0)',\n weight: 2,\n radius: 6\n };\n }\n\n return VectorLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (VectorLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/vector.ts?"); +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/* harmony import */ var three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three/examples/jsm/lines/LineGeometry */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/lines/LineMaterial */ \"./node_modules/three/examples/jsm/lines/LineMaterial.js\");\n/* harmony import */ var three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three/examples/jsm/lines/Line2 */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\n/* harmony import */ var _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../secondary/sprites */ \"./src/secondary/sprites.ts\");\n\n\n\n\n\n\nvar VectorLayerer = function () {\n function VectorLayerer(parent) {\n var _this = this;\n\n this.add = function (layerObj, callback) {\n if (!_this.p.p._.wasInitialized) return;\n var alreadyExists = false;\n\n var finallyAdd = function () {\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].hasOwnProperty('name')) {\n if (_this.p.vector[i].name == layerObj.name) {\n _this.p.vector[i] = layerObj;\n alreadyExists = true;\n break;\n }\n }\n }\n\n if (!alreadyExists) {\n var meshes = _this.generateVectors(layerObj);\n\n _this.p.p.planet.add(meshes);\n\n layerObj.meshes = meshes;\n\n _this.p.vector.push(layerObj);\n\n _this.p.vector.sort(function (a, b) {\n return b.order - a.order;\n });\n }\n\n _this.p.p._.events._attenuate();\n\n if (typeof callback === 'function') callback();\n };\n\n if (layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && layerObj.hasOwnProperty('opacity')) {\n if (layerObj.hasOwnProperty('geojsonPath') && !layerObj.hasOwnProperty('geojson')) {\n var xhr_1 = new XMLHttpRequest();\n xhr_1.open('GET', layerObj.geojsonPath, true);\n xhr_1.responseType = 'json';\n xhr_1.withCredentials = layerObj.withCredentials === true || false;\n\n xhr_1.onload = function () {\n if (xhr_1.status !== 404 && xhr_1.response) {\n layerObj.geojson = xhr_1.response;\n finallyAdd();\n } else {\n console.warn(\"Failed to fetch geojson data for vector layer: \" + layerObj.name);\n }\n };\n\n xhr_1.send();\n } else {\n finallyAdd();\n }\n } else {\n console.warn(\"Attempted to add an invalid vector layer: \" + layerObj.name);\n }\n };\n\n this.toggle = function (name, on) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.on = on != null ? on : !layer.on;\n layer.meshes.visible = layer.on;\n console.log(layer);\n\n _this.p.p._.events._attenuate();\n\n return true;\n }\n }\n\n return false;\n };\n\n this.setOpacity = function (name, opacity) {\n if (!_this.p.p._.wasInitialized) return false;\n\n var _loop_1 = function (i) {\n var layer = _this.p.vector[i];\n\n if (name === layer.name) {\n layer.opacity = Math.max(Math.min(opacity, 1), 0);\n layer.meshes.children.forEach(function (mesh) {\n mesh.material.opacity = layer.opacity;\n });\n return {\n value: true\n };\n }\n };\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n var state_1 = _loop_1(i);\n\n if (typeof state_1 === \"object\") return state_1.value;\n }\n\n return false;\n };\n\n this.remove = function (name) {\n if (!_this.p.p._.wasInitialized) return false;\n\n for (var i = 0; i < _this.p.vector.length; i++) {\n if (_this.p.vector[i].name === name) {\n _this.p.p.planet.remove(_this.p.vector[i].meshes);\n\n _this.p.vector.splice(i, 1);\n\n return true;\n }\n }\n\n return false;\n };\n\n this.generateVectors = function (layerObj) {\n var vectorGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\n\n if (layerObj.geojson == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has no geojson.\");\n return;\n }\n\n var features = layerObj.geojson.features;\n\n if (features == null) {\n console.warn(\"Vector layer: \" + layerObj.name + \" has invalid geojson.\");\n return;\n }\n\n var pointType = layerObj.style ? layerObj.style.pointType : '';\n var lineType = layerObj.style ? layerObj.style.lineType : '';\n\n for (var _i = 0, features_1 = features; _i < features_1.length; _i++) {\n var f = features_1[_i];\n var type = f.geometry.type;\n var mesh = null;\n\n switch (type.toLowerCase()) {\n case 'point':\n switch (pointType) {\n case 'sphere':\n break;\n\n default:\n mesh = _this.geomTo.sprite(layerObj, f);\n }\n\n break;\n\n case 'linestring':\n switch (lineType) {\n case 'thin':\n mesh = _this.geomTo.line(layerObj, f);\n break;\n\n default:\n mesh = _this.geomTo.thickLine(layerObj, f);\n }\n\n break;\n\n case 'polygon':\n break;\n\n default:\n console.warn(\"Vector layer: \" + layerObj.name + \" has an unsupported geojson geometry type: \" + type + \".\");\n break;\n }\n\n mesh.feature = f;\n vectorGroup.add(mesh);\n }\n\n if (layerObj.on == false) {\n vectorGroup.visible = false;\n }\n\n return vectorGroup;\n };\n\n this.geomTo = {\n sprite: function (layerObj, feature, forceNewMaterial) {\n var _a, _b;\n\n var g = feature.geometry.coordinates;\n\n var style = _this.p.getFeatureStyle(layerObj, feature);\n\n var options = {};\n\n if (((_a = feature === null || feature === void 0 ? void 0 : feature.properties) === null || _a === void 0 ? void 0 : _a.annotation) === true) {\n options.annotation = true;\n options.name = (_b = feature === null || feature === void 0 ? void 0 : feature.properties) === null || _b === void 0 ? void 0 : _b.name;\n }\n\n var sprite = _secondary_sprites__WEBPACK_IMPORTED_MODULE_4__[\"default\"].makeMarkerSprite(style, layerObj.name, options, forceNewMaterial);\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n if (typeof g[0] == 'number') g = [g];\n var height = g[0][2] || _this.p.p.getElevationAtLngLat(g[0][i0], g[0][i1]) || false;\n\n var v = _this.p.p.projection.lonLatToVector3(g[0][i0], g[0][i1], (height || 0) * _this.p.p.options.exaggeration);\n\n if (height === false) sprite.noElevation = {\n lng: g[0][i0],\n lat: g[0][i1],\n elevOffset: style.elevOffset\n };\n sprite.position.set(v.x, v.y, v.z);\n sprite.renderOrder = layerObj.index;\n\n if (layerObj.on == false) {\n sprite.visible = false;\n }\n\n sprite.layerName = layerObj.name;\n sprite.useKeyAsHoverName = layerObj.useKeyAsHoverName;\n sprite.name = layerObj.name;\n sprite.style = style;\n\n sprite.restyle = function () {\n var newSprite = _this.geomTo.sprite(layerObj, sprite.feature, sprite.feature._highlighted || sprite.feature._active);\n\n sprite.style = newSprite.style;\n sprite.material.dispose();\n sprite.material = newSprite.material;\n sprite.material.map.needsUpdate = true;\n sprite.material.needsUpdate = true;\n };\n\n return sprite;\n },\n line: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n var vertices = [];\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z));\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferGeometry\"]().setFromPoints(vertices);\n var mesh = new three__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](geometry, new three__WEBPACK_IMPORTED_MODULE_0__[\"LineBasicMaterial\"]({\n transparent: true,\n color: style.color\n }));\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n return mesh;\n },\n thickLine: function (layerObj, feature) {\n var g = feature.geometry.coordinates;\n var path = [];\n var firstPos;\n var i0 = 0;\n var i1 = 1;\n\n if (layerObj.swapLL) {\n i0 = 1;\n i1 = 0;\n }\n\n for (var i = 0; i < g.length; i++) {\n if (isNaN(g[i][i0])) g = g[0];\n\n var v = _this.p.p.projection.lonLatToVector3(g[i][i0], g[i][i1], (g[i][2] || 0) * _this.p.p.options.exaggeration);\n\n if (i == 0) {\n firstPos = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x, v.y, v.z);\n }\n\n path.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](v.x - firstPos.x, v.y - firstPos.y, v.z - firstPos.z));\n if (i != 0 || i != g.length - 1) path.push(path[path.length - 1]);\n }\n\n var style = _this.p.getFeatureStyle(layerObj, feature, true);\n\n var positions = [];\n var spline = new three__WEBPACK_IMPORTED_MODULE_0__[\"CatmullRomCurve3\"](path);\n var divisions = Math.round(1 * path.length);\n\n for (var i = 0, l = divisions; i < l; i++) {\n var point = spline.getPoint(i / l);\n positions.push(point.x, point.y, point.z);\n }\n\n var geometry = new three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_1__[\"LineGeometry\"]();\n geometry.setPositions(positions);\n var material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n var mesh = new three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_3__[\"Line2\"](geometry, material);\n mesh.computeLineDistances();\n mesh.position.set(firstPos.x, firstPos.y, firstPos.z);\n mesh.scale.set(1, 1, 1);\n mesh.layerName = layerObj.name;\n mesh.strokeColor = style.color;\n\n mesh.restyle = function () {\n var style = _this.p.getFeatureStyle(layerObj, mesh.feature, true);\n\n mesh.material = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_2__[\"LineMaterial\"]({\n color: style.color,\n linewidth: 0.0005 * (style.weight || 1)\n });\n mesh.strokeColor = style.color;\n };\n\n return mesh;\n }\n };\n this.p = parent;\n }\n\n return VectorLayerer;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (VectorLayerer);\n\n//# sourceURL=webpack://LithoSphere/./src/layers/vector.ts?"); /***/ }), @@ -2139,7 +2139,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (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 */ \"./src/core/index.ts\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _layers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layers */ \"./src/layers/index.ts\");\n/* harmony import */ var _controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controls */ \"./src/controls/index.ts\");\n/* harmony import */ var _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./secondary/loadingScreen */ \"./src/secondary/loadingScreen.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\n\n\n\n\n\nvar LithoSphere = function () {\n function LithoSphere(containerId, options) {\n var _this = this;\n\n this._animate = function () {\n window.requestAnimationFrame(_this._animate);\n\n _this._render();\n };\n\n this._onFirstLoad = function () {\n _this._.firstLoad = true;\n\n _this._.events._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, {\n x: 0.0001,\n y: 0.0001\n });\n\n _this._.rendererWrapper.updateSize();\n\n setTimeout(function () {\n _this.setCenter(_this.options.initialView, false, true);\n\n _this._setInitialCameraPositionTarget();\n\n _this._.events._onZoom();\n\n _this._.loadingScreen.end();\n }, 100);\n };\n\n this.setCenter = function (latLngZoom, ignoreZoom, accountForHeight) {\n if (!_this._.wasInitialized) return false;\n var rotLat = (90 - (latLngZoom.lat || 0)) * (Math.PI / 180);\n var rotLng = (latLngZoom.lng || 0) * (Math.PI / 180);\n\n _this.planet.rotation.set(rotLat, rotLng, 0);\n\n _this._.events._matchPlanetsLODToPlanet();\n\n if (latLngZoom.zoom != null && ignoreZoom != true) {\n _this.zoom = latLngZoom.zoom;\n\n var center = _this.getCenter(true);\n\n _this._.cameras.orbit.camera.position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.orbit.camera.position.y -= center.height;\n _this._.cameras.firstPerson.controls.getObject().position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.firstPerson.controls.getObject().position.y -= center.height;\n }\n\n _this._.events._refreshFrontGroupRotation();\n\n return true;\n };\n\n this.getCenterXYZ = function (raycasted) {\n if (raycasted) {\n _this._.raycaster.set(new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, _this.planetCenter.y, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 1, 0));\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[0].point.y += _this.planetCenter.y;\n return intersects[0].point;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0);\n } else {\n var centerPoint = {\n x: _this.planetCenter.x,\n y: _this.planetCenter.y,\n z: _this.planetCenter.z\n };\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](centerPoint.x, centerPoint.y, centerPoint.z);\n }\n };\n\n this.getCenter = function (raycasted) {\n var centerXYZ = _this.getCenterXYZ(raycasted);\n\n if (raycasted) {\n var center = JSON.parse(JSON.stringify(centerXYZ));\n center = _this.projection.rotatePoint3D(center, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n center = _this.projection.vector3ToLatLng(center);\n center.height = centerXYZ.length() * _this.projection.radiusScale - _this.projection.radii.major;\n return center;\n }\n\n return _this.projection.vector3ToLatLng(centerXYZ);\n };\n\n this.getCenterElevation = function () {\n return _this.getCenterXYZ(true).length() * _this.projection.radiusScale - _this.projection.radii.major;\n };\n\n this.getCenterElevationRaw = function () {\n var elev = _this.getCenterXYZ(true).length();\n\n if (elev <= 0.1 && elev >= -0.1) return;\n return elev;\n };\n\n this.getElevationAtLngLat = function (lng, lat) {\n var v = _this.projection.lonLatToVector3(lng, lat, 100000 * _this.options.exaggeration);\n\n var tempObj = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n tempObj.position.set(0, -_this.planetCenter.y, 0);\n tempObj.rotation.set(_this.planet.rotation.x, _this.planet.rotation.y, _this.planet.rotation.z);\n var geometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](200, 32, 32);\n var material = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: 0xffff00\n });\n var tempObj2 = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](geometry, material);\n tempObj2.position.set(v.x, v.y, v.z);\n tempObj.add(tempObj2);\n tempObj.updateMatrixWorld();\n var vector = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\n vector.setFromMatrixPosition(tempObj2.matrixWorld);\n\n _this._.raycaster.set(vector, new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -_this.planetCenter.y, 0).normalize());\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[intersects.length - 1].point.y += _this.planetCenter.y;\n return intersects[intersects.length - 1].point.length() * _this.projection.radiusScale - _this.projection.radii.major;\n }\n\n return 0;\n };\n\n this.getCenterTile = function () {\n var centerll = _this.getCenter();\n\n return _this.projection.latLngZ2TileXYZ(centerll.lat, centerll.lng, _this.zoom);\n };\n\n this.getCameras = function () {\n return {\n camera: _this._.cameras.camera,\n isFirstPerson: _this._.cameras.isFirstPerson,\n firstPerson: _this._.cameras.firstPerson,\n orbit: _this._.cameras.orbit\n };\n };\n\n this._setInitialCameraPositionTarget = function () {\n var o = _this._.cameras.orbit;\n var cam = o.camera;\n var con = o.controls;\n var pos = cam.position;\n var tar = con.target;\n var position = {\n x: pos.x,\n y: pos.y,\n z: pos.z\n };\n var target = {\n x: tar.x,\n y: tar.y,\n z: tar.z\n };\n\n if (_this.options.initialCamera) {\n var iC = _this.options.initialCamera;\n\n if (iC.position) {\n position = {\n x: iC.position.x || position.x,\n y: iC.position.y || position.y,\n z: iC.position.z || position.z\n };\n }\n\n if (iC.target) {\n target = {\n x: iC.target.x || target.x,\n y: iC.target.y || target.y,\n z: iC.target.z || target.z\n };\n }\n\n _this.setCameraPositionTarget(position, target);\n }\n };\n\n this.setCameraPositionTarget = function (position, target) {\n if (position) {\n _this._.cameras.orbit.camera.position.set(position.x || 9, position.y || 0, position.z || 0);\n }\n\n if (target) {\n _this._.cameras.orbit.controls.target.x = target.x || 0;\n _this._.cameras.orbit.controls.target.y = target.y || 0;\n _this._.cameras.orbit.controls.target.z = target.z || 0;\n }\n\n _this._.cameras.orbit.controls.update();\n };\n\n this.getContainer = function () {\n return _this._.container;\n };\n\n this.invalidateSize = function () {\n if (_this._.wasInitialized) {\n _this._.renderer.setSize(_this._.sceneContainer.offsetWidth, _this._.sceneContainer.offsetHeight);\n\n _this._.cameras.updateSize();\n }\n };\n\n var sceneContainer = document.getElementById(containerId).appendChild(document.createElement('div'));\n sceneContainer.id = '_lithosphere_scene';\n sceneContainer.style.width = '100%';\n sceneContainer.style.height = '100%';\n this._ = {\n containerId: containerId,\n container: document.getElementById(containerId),\n sceneContainer: sceneContainer,\n wasInitialized: false,\n rendererWrapper: null,\n renderer: null,\n cameras: null,\n tiledWorld: null,\n events: null,\n maxZoom: 0,\n minNativeZoom: 0,\n loader: new three__WEBPACK_IMPORTED_MODULE_1__[\"TextureLoader\"](),\n raycaster: new three__WEBPACK_IMPORTED_MODULE_1__[\"Raycaster\"](),\n updateEveryNthRender: 1,\n counters: {\n update: 0,\n frame: 0\n },\n lastCameraWasFirst: false,\n firstUpdate: true,\n firstLoad: false,\n loadingScreen: null,\n renderOnlyWhenOpen: true,\n zCutOff: 3,\n firstViewOverride: null,\n mouseIsInScene: false,\n marsRadius: 3396190\n };\n this._.container.style.position = 'relative';\n this.scene = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.scenesLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]()];\n this.sceneBack = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.sceneFront = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.planet = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n this.planetsLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]()];\n this.frontGroup = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n var defaultOptions = {\n loadingScreen: true,\n tileMapResource: null,\n customParsers: {},\n radiusOfTiles: 4,\n useLOD: true,\n LOD: [{\n radiusOfTiles: 4,\n zoomsUp: 3\n }, {\n radiusOfTiles: 2,\n zoomsUp: 7\n }, {\n radiusOfTiles: 2,\n zoomsUp: 11\n }],\n tileResolution: 32,\n trueTileResolution: 256,\n showAxes: false,\n wireframeMode: false,\n exaggeration: 1,\n renderOnlyWhenOpen: true,\n targetYOffset: 0,\n highlightColor: 'yellow',\n activeColor: 'red'\n };\n options = options || {};\n this.options = __assign(__assign({}, defaultOptions), options);\n\n this._init();\n }\n\n LithoSphere.prototype._init = function () {\n this._.rendererWrapper = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Renderer\"](this._.sceneContainer);\n this._.renderer = this._.rendererWrapper.renderer;\n\n if (this._.renderer) {\n this._.wasInitialized = true;\n } else return false;\n\n this.projection = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Projection\"](this.options.majorRadius, this.options.minorRadius, this.options.tileMapResource, this.options.trueTileResolution);\n this._.cameras = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Cameras\"](this._.container, this._.sceneContainer, this.scene, this.projection);\n this.layers = new _layers__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this);\n this.addLayer = this.layers.addLayer;\n this.removeLayer = this.layers.removeLayer;\n this.toggleLayer = this.layers.toggleLayer;\n this.setLayerOpacity = this.layers.setLayerOpacity;\n this.setLayerFilterEffect = this.layers.setLayerFilterEffect;\n this.setLayerSpecificOptions = this.layers.setLayerSpecificOptions;\n this.getLayerByName = this.layers.getLayerByName;\n this.hasLayer = this.layers.hasLayer;\n this._.tiledWorld = new _core__WEBPACK_IMPORTED_MODULE_0__[\"TiledWorld\"](this);\n this.zoom = 10;\n this.trueZoom = this.zoom;\n this.mouse = {\n lat: null,\n lng: null,\n elev: null\n };\n this.planetCenter = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -(this.projection.radii.major / this.projection.radiusScale), 0);\n this.planet.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.scene.add(this.planet);\n this.scenesLOD[0].add(this.planetsLOD[0]);\n this.scenesLOD[1].add(this.planetsLOD[1]);\n this.scenesLOD[2].add(this.planetsLOD[2]);\n this.frontGroup.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.sceneFront.add(this.frontGroup);\n this.scene.add(new three__WEBPACK_IMPORTED_MODULE_1__[\"AmbientLight\"](0xfefefe));\n\n if (this.options.starsphere) {\n var starsphereGeometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1000, 64, 64);\n var starsphereMaterial = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: this.options.starsphere.color || 0xaaaaaa\n });\n if (this.options.starsphere.url) starsphereMaterial.map = this._.loader.load(this.options.starsphere.url);\n starsphereMaterial.opacity = 1;\n this.starsphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](starsphereGeometry, starsphereMaterial);\n this.sceneBack.add(this.starsphere);\n }\n\n if (this.options.atmosphere) {\n this.atmosphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1.5, 128, 128), _core__WEBPACK_IMPORTED_MODULE_0__[\"Shaders\"].atmosphere(this.options.atmosphere.color));\n this.sceneBack.add(this.atmosphere);\n }\n\n if (this.options.showAxes === true) {\n var materialx = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0xff0000\n });\n var geometryx = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0 * 2, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](this.planetCenter.y * 2, 0, 0)]);\n var linex = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryx, materialx);\n this.scene.add(linex);\n var materialy = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x00ff00\n });\n var geometryy = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, this.planetCenter.y * 2, 0)]);\n var liney = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryy, materialy);\n this.scene.add(liney);\n var materialz = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x0000ff\n });\n var geometryz = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, this.planetCenter.y * 2)]);\n var linez = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryz, materialz);\n this.scene.add(linez);\n }\n\n this.controls = new _controls__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this);\n this.addControl = this.controls.addControl;\n this.removeControl = this.controls.removeControl;\n\n if (this.options.renderOnlyWhenOpen === false) {\n this._.renderOnlyWhenOpen = false;\n }\n\n this._.loadingScreen = new _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this);\n this._.events = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Events\"](this);\n this.setCenter(this.options.initialView);\n\n this._setInitialCameraPositionTarget();\n\n this._animate();\n\n return true;\n };\n\n LithoSphere.prototype._render = function () {\n this._.renderer.clear();\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.update = (this._.counters.update + 1) % this._.updateEveryNthRender;\n if (this._.counters.update === 0) this._update();\n if (!this._.cameras.isFirstPerson) this._.cameras.orbit.controls.update();\n this.layers.tile3d.forEach(function (tile3d) {\n tile3d.renderer.update();\n });\n\n this._.renderer.render(this.sceneBack, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[2], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[1], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[0], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scene, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.sceneFront, this._.cameras.camera);\n };\n\n LithoSphere.prototype._update = function () {\n if (!this._.wasInitialized) return;\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.frame = (this._.counters.frame + 1) % 4;\n this.scene.rotation.x = 0;\n this.scene.position.y = 0;\n\n if (!this._.firstUpdate) {\n this._.tiledWorld.refreshTiles();\n }\n\n this._.events._checkDesiredZoom();\n\n this.controls._onUpdateEvent();\n\n if (this._.cameras.isFirstPerson) {\n this._.lastCameraWasFirst = true;\n this._.cameras.firstPerson.controls.getObject().position.y = this._.cameras.orbit.controls.target.y - this._.cameras.firstPerson.height / this.projection.radiusScale;\n\n var v2 = this._.cameras.update();\n\n this._.events._rotateGlobe(v2);\n\n this._.events._onMouseMove();\n\n this.controls._onFirstPersonUpdate();\n } else if (this._.lastCameraWasFirst) {\n this._.lastCameraWasFirst = false;\n\n this.controls._onOrbitalUpdate();\n }\n\n if (this._.firstUpdate) {\n if (this._.firstViewOverride != null) this.setCenter(this._.firstViewOverride);else this.setCenter(this.options.initialView, true);\n\n this._setInitialCameraPositionTarget();\n\n this._.firstUpdate = false;\n }\n };\n\n return LithoSphere;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LithoSphere);\n\n//# sourceURL=webpack://LithoSphere/./src/lithosphere.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core */ \"./src/core/index.ts\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _layers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layers */ \"./src/layers/index.ts\");\n/* harmony import */ var _controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controls */ \"./src/controls/index.ts\");\n/* harmony import */ var _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./secondary/loadingScreen */ \"./src/secondary/loadingScreen.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\n\n\n\n\n\nvar LithoSphere = function () {\n function LithoSphere(containerId, options) {\n var _this = this;\n\n this._animate = function () {\n window.requestAnimationFrame(_this._animate);\n\n _this._render();\n };\n\n this._onFirstLoad = function () {\n _this._.firstLoad = true;\n\n _this._.events._rotateGlobe({\n pageX: 0,\n pageY: 0\n }, {\n x: 0.0001,\n y: 0.0001\n });\n\n _this._.rendererWrapper.updateSize();\n\n setTimeout(function () {\n _this.setCenter(_this.options.initialView, false, true);\n\n _this._setInitialCameraPositionTarget();\n\n _this._.events._onZoom();\n\n _this._.loadingScreen.end();\n }, 100);\n };\n\n this.setCenter = function (latLngZoom, ignoreZoom, accountForHeight) {\n if (!_this._.wasInitialized) return false;\n var rotLat = (90 - (latLngZoom.lat || 0)) * (Math.PI / 180);\n var rotLng = (latLngZoom.lng || 0) * (Math.PI / 180);\n\n _this.planet.rotation.set(rotLat, rotLng, 0);\n\n _this._.events._matchPlanetsLODToPlanet();\n\n if (latLngZoom.zoom != null && ignoreZoom != true) {\n _this.zoom = latLngZoom.zoom;\n\n var center = _this.getCenter(true);\n\n _this._.cameras.orbit.camera.position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.orbit.camera.position.y -= center.height;\n _this._.cameras.firstPerson.controls.getObject().position.y = -(40000000 / _this.projection.radiusScale / Math.pow(2, _this.zoom));\n if (accountForHeight) _this._.cameras.firstPerson.controls.getObject().position.y -= center.height;\n }\n\n _this._.events._refreshFrontGroupRotation();\n\n return true;\n };\n\n this.getCenterXYZ = function (raycasted) {\n if (raycasted) {\n _this._.raycaster.set(new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, _this.planetCenter.y, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 1, 0));\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[0].point.y += _this.planetCenter.y;\n return intersects[0].point;\n }\n\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0);\n } else {\n var centerPoint = {\n x: _this.planetCenter.x,\n y: _this.planetCenter.y,\n z: _this.planetCenter.z\n };\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n centerPoint = _this.projection.rotatePoint3D(centerPoint, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n return new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](centerPoint.x, centerPoint.y, centerPoint.z);\n }\n };\n\n this.getCenter = function (raycasted) {\n var centerXYZ = _this.getCenterXYZ(raycasted);\n\n if (raycasted) {\n var center = JSON.parse(JSON.stringify(centerXYZ));\n center = _this.projection.rotatePoint3D(center, {\n x: -_this.planet.rotation.x,\n y: 0,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: -_this.planet.rotation.y,\n z: 0\n });\n center = _this.projection.rotatePoint3D(center, {\n x: 0,\n y: 0,\n z: -_this.planet.rotation.z\n });\n center = _this.projection.vector3ToLatLng(center);\n center.height = (centerXYZ.length() - _this.planet.position.y) / _this.projection.radiusScale;\n return center;\n }\n\n return _this.projection.vector3ToLatLng(centerXYZ);\n };\n\n this.getCenterElevation = function () {\n return (_this.getCenterXYZ(true).length() - _this.planet.position.y) / _this.projection.radiusScale;\n };\n\n this.getCenterElevationRaw = function () {\n var elev = _this.getCenterXYZ(true).length();\n\n if (elev <= 0.1 && elev >= -0.1) return;\n return elev;\n };\n\n this.getElevationAtLngLat = function (lng, lat) {\n var v = _this.projection.lonLatToVector3(lng, lat, 100000 * _this.options.exaggeration);\n\n var tempObj = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n tempObj.position.set(0, -_this.planetCenter.y, 0);\n tempObj.rotation.set(_this.planet.rotation.x, _this.planet.rotation.y, _this.planet.rotation.z);\n var geometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](200, 32, 32);\n var material = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: 0xffff00\n });\n var tempObj2 = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](geometry, material);\n tempObj2.position.set(v.x, v.y, v.z);\n tempObj.add(tempObj2);\n tempObj.updateMatrixWorld();\n var vector = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\n vector.setFromMatrixPosition(tempObj2.matrixWorld);\n\n _this._.raycaster.set(vector, new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -_this.planetCenter.y, 0).normalize());\n\n var planeArr = [];\n\n for (var i = 0; i < _this._.tiledWorld.tilesDrawn.length; i++) {\n if (!_this._.tiledWorld.tilesDrawn[i].isLODTile) planeArr.push(_this._.tiledWorld.tilesDrawn[i].t);\n }\n\n var intersects = _this._.raycaster.intersectObjects(planeArr);\n\n if (intersects.length > 0) {\n intersects[intersects.length - 1].point.y += _this.planetCenter.y;\n return (intersects[intersects.length - 1].point.length() - _this.planet.position.y) / _this.projection.radiusScale;\n }\n\n return 0;\n };\n\n this.getCenterTile = function () {\n var centerll = _this.getCenter();\n\n return _this.projection.latLngZ2TileXYZ(centerll.lat, centerll.lng, _this.zoom);\n };\n\n this.getCameras = function () {\n return {\n camera: _this._.cameras.camera,\n isFirstPerson: _this._.cameras.isFirstPerson,\n firstPerson: _this._.cameras.firstPerson,\n orbit: _this._.cameras.orbit\n };\n };\n\n this._setInitialCameraPositionTarget = function () {\n var o = _this._.cameras.orbit;\n var cam = o.camera;\n var con = o.controls;\n var pos = cam.position;\n var tar = con.target;\n var position = {\n x: pos.x,\n y: pos.y,\n z: pos.z\n };\n var target = {\n x: tar.x,\n y: tar.y,\n z: tar.z\n };\n\n if (_this.options.initialCamera) {\n var iC = _this.options.initialCamera;\n\n if (iC.position) {\n position = {\n x: iC.position.x || position.x,\n y: iC.position.y || position.y,\n z: iC.position.z || position.z\n };\n }\n\n if (iC.target) {\n target = {\n x: iC.target.x || target.x,\n y: iC.target.y || target.y,\n z: iC.target.z || target.z\n };\n }\n\n _this.setCameraPositionTarget(position, target);\n }\n };\n\n this.setCameraPositionTarget = function (position, target) {\n if (position) {\n _this._.cameras.orbit.camera.position.set(position.x || 9, position.y || 0, position.z || 0);\n }\n\n if (target) {\n _this._.cameras.orbit.controls.target.x = target.x || 0;\n _this._.cameras.orbit.controls.target.y = target.y || 0;\n _this._.cameras.orbit.controls.target.z = target.z || 0;\n }\n\n _this._.cameras.orbit.controls.update();\n };\n\n this.getContainer = function () {\n return _this._.container;\n };\n\n this.invalidateSize = function () {\n if (_this._.wasInitialized) {\n _this._.renderer.setSize(_this._.sceneContainer.offsetWidth, _this._.sceneContainer.offsetHeight);\n\n _this._.cameras.updateSize();\n }\n };\n\n var sceneContainer = document.getElementById(containerId).appendChild(document.createElement('div'));\n sceneContainer.id = '_lithosphere_scene';\n sceneContainer.style.width = '100%';\n sceneContainer.style.height = '100%';\n this._ = {\n containerId: containerId,\n container: document.getElementById(containerId),\n sceneContainer: sceneContainer,\n wasInitialized: false,\n rendererWrapper: null,\n renderer: null,\n cameras: null,\n tiledWorld: null,\n events: null,\n maxZoom: 0,\n minNativeZoom: 0,\n loader: new three__WEBPACK_IMPORTED_MODULE_1__[\"TextureLoader\"](),\n raycaster: new three__WEBPACK_IMPORTED_MODULE_1__[\"Raycaster\"](),\n updateEveryNthRender: 1,\n counters: {\n update: 0,\n frame: 0\n },\n lastCameraWasFirst: false,\n firstUpdate: true,\n firstLoad: false,\n loadingScreen: null,\n renderOnlyWhenOpen: true,\n zCutOff: 3,\n firstViewOverride: null,\n mouseIsInScene: false\n };\n this._.container.style.position = 'relative';\n this.scene = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.scenesLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]()];\n this.sceneBack = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.sceneFront = new three__WEBPACK_IMPORTED_MODULE_1__[\"Scene\"]();\n this.planet = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n this.planetsLOD = [new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"](), new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]()];\n this.frontGroup = new three__WEBPACK_IMPORTED_MODULE_1__[\"Object3D\"]();\n var defaultOptions = {\n loadingScreen: true,\n tileMapResource: null,\n customParsers: {},\n radiusOfTiles: 4,\n useLOD: true,\n LOD: [{\n radiusOfTiles: 4,\n zoomsUp: 3\n }, {\n radiusOfTiles: 2,\n zoomsUp: 7\n }, {\n radiusOfTiles: 2,\n zoomsUp: 11\n }],\n tileResolution: 32,\n trueTileResolution: 256,\n showAxes: false,\n wireframeMode: false,\n exaggeration: 1,\n renderOnlyWhenOpen: true,\n targetYOffset: 0,\n highlightColor: 'yellow',\n activeColor: 'red'\n };\n options = options || {};\n this.options = __assign(__assign({}, defaultOptions), options);\n\n this._init();\n }\n\n LithoSphere.prototype._init = function () {\n this._.rendererWrapper = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Renderer\"](this._.sceneContainer);\n this._.renderer = this._.rendererWrapper.renderer;\n\n if (this._.renderer) {\n this._.wasInitialized = true;\n } else return false;\n\n this.projection = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Projection\"](this.options.majorRadius, this.options.minorRadius, this.options.tileMapResource, this.options.trueTileResolution, this.options.radiusCutoff);\n this._.cameras = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Cameras\"](this._.container, this._.sceneContainer, this.scene, this.projection);\n this.layers = new _layers__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this);\n this.addLayer = this.layers.addLayer;\n this.removeLayer = this.layers.removeLayer;\n this.toggleLayer = this.layers.toggleLayer;\n this.orderLayers = this.layers.orderLayers;\n this.setLayerOpacity = this.layers.setLayerOpacity;\n this.setLayerFilterEffect = this.layers.setLayerFilterEffect;\n this.setLayerSpecificOptions = this.layers.setLayerSpecificOptions;\n this.getLayerByName = this.layers.getLayerByName;\n this.hasLayer = this.layers.hasLayer;\n this._.tiledWorld = new _core__WEBPACK_IMPORTED_MODULE_0__[\"TiledWorld\"](this);\n this.zoom = 10;\n this.trueZoom = this.zoom;\n this.mouse = {\n lat: null,\n lng: null,\n elev: null\n };\n this.planetCenter = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, -(this.projection.radii.major / this.projection.radiusScale), 0);\n this.planet.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.scene.add(this.planet);\n this.scenesLOD[0].add(this.planetsLOD[0]);\n this.scenesLOD[1].add(this.planetsLOD[1]);\n this.scenesLOD[2].add(this.planetsLOD[2]);\n this.frontGroup.position.set(this.planetCenter.x, -this.planetCenter.y, this.planetCenter.z);\n this.sceneFront.add(this.frontGroup);\n this.scene.add(new three__WEBPACK_IMPORTED_MODULE_1__[\"AmbientLight\"](0xfefefe));\n\n if (this.options.starsphere) {\n var starsphereGeometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1000, 64, 64);\n var starsphereMaterial = new three__WEBPACK_IMPORTED_MODULE_1__[\"MeshBasicMaterial\"]({\n color: this.options.starsphere.color || 0xaaaaaa\n });\n if (this.options.starsphere.url) starsphereMaterial.map = this._.loader.load(this.options.starsphere.url);\n starsphereMaterial.opacity = 1;\n this.starsphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](starsphereGeometry, starsphereMaterial);\n this.sceneBack.add(this.starsphere);\n }\n\n if (this.options.atmosphere) {\n this.atmosphere = new three__WEBPACK_IMPORTED_MODULE_1__[\"Mesh\"](new three__WEBPACK_IMPORTED_MODULE_1__[\"SphereBufferGeometry\"](this.planetCenter.y * 1.5, 128, 128), _core__WEBPACK_IMPORTED_MODULE_0__[\"Shaders\"].atmosphere(this.options.atmosphere.color));\n this.sceneBack.add(this.atmosphere);\n }\n\n if (this.options.showAxes === true) {\n var materialx = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0xff0000\n });\n var geometryx = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0 * 2, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](this.planetCenter.y * 2, 0, 0)]);\n var linex = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryx, materialx);\n this.scene.add(linex);\n var materialy = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x00ff00\n });\n var geometryy = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, this.planetCenter.y * 2, 0)]);\n var liney = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryy, materialy);\n this.scene.add(liney);\n var materialz = new three__WEBPACK_IMPORTED_MODULE_1__[\"LineBasicMaterial\"]({\n color: 0x0000ff\n });\n var geometryz = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]().setFromPoints([new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"](0, 0, this.planetCenter.y * 2)]);\n var linez = new three__WEBPACK_IMPORTED_MODULE_1__[\"Line\"](geometryz, materialz);\n this.scene.add(linez);\n }\n\n this.controls = new _controls__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this);\n this.addControl = this.controls.addControl;\n this.removeControl = this.controls.removeControl;\n\n if (this.options.renderOnlyWhenOpen === false) {\n this._.renderOnlyWhenOpen = false;\n }\n\n this._.loadingScreen = new _secondary_loadingScreen__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this);\n this._.events = new _core__WEBPACK_IMPORTED_MODULE_0__[\"Events\"](this);\n this.setCenter(this.options.initialView);\n\n this._setInitialCameraPositionTarget();\n\n this._animate();\n\n return true;\n };\n\n LithoSphere.prototype._render = function () {\n this._.renderer.clear();\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.update = (this._.counters.update + 1) % this._.updateEveryNthRender;\n if (this._.counters.update === 0) this._update();\n if (!this._.cameras.isFirstPerson) this._.cameras.orbit.controls.update();\n this.layers.tile3d.forEach(function (tile3d) {\n tile3d.renderer.update();\n });\n\n this._.renderer.render(this.sceneBack, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[2], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[1], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scenesLOD[0], this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.scene, this._.cameras.camera);\n\n this._.renderer.clearDepth();\n\n this._.renderer.render(this.sceneFront, this._.cameras.camera);\n };\n\n LithoSphere.prototype._update = function () {\n if (!this._.wasInitialized) return;\n\n if (this._.renderOnlyWhenOpen) {\n var containerRect = this._.container.getBoundingClientRect();\n\n if (containerRect.width <= 0 || containerRect.height <= 0) return;\n }\n\n this._.counters.frame = (this._.counters.frame + 1) % 4;\n this.scene.rotation.x = 0;\n this.scene.position.y = 0;\n\n if (!this._.firstUpdate) {\n this._.tiledWorld.refreshTiles();\n }\n\n this._.events._checkDesiredZoom();\n\n this.controls._onUpdateEvent();\n\n if (this._.cameras.isFirstPerson) {\n this._.lastCameraWasFirst = true;\n this._.cameras.firstPerson.controls.getObject().position.y = this._.cameras.orbit.controls.target.y - this._.cameras.firstPerson.height / this.projection.radiusScale;\n\n var v2 = this._.cameras.update();\n\n this._.events._rotateGlobe(v2);\n\n this._.events._onMouseMove();\n\n this.controls._onFirstPersonUpdate();\n } else if (this._.lastCameraWasFirst) {\n this._.lastCameraWasFirst = false;\n\n this.controls._onOrbitalUpdate();\n }\n\n if (this._.firstUpdate) {\n if (this._.firstViewOverride != null) this.setCenter(this._.firstViewOverride);else this.setCenter(this.options.initialView, true);\n\n this._setInitialCameraPositionTarget();\n\n this._.firstUpdate = false;\n }\n };\n\n return LithoSphere;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LithoSphere);\n\n//# sourceURL=webpack://LithoSphere/./src/lithosphere.ts?"); /***/ }), @@ -2245,7 +2245,7 @@ eval("function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find mod /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var require;/**\n * Minified by jsDelivr using Terser v5.3.5.\n * Original file: /npm/geotiff@1.0.4/dist-browser/geotiff.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\nparcelRequire=function(e,t,r,n){var i,o=\"function\"==typeof parcelRequire&&parcelRequire,a=\"function\"==typeof require&&require;function s(r,n){if(!t[r]){if(!e[r]){var i=\"function\"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(r,!0);if(o)return o(r,!0);if( true&&\"string\"==typeof r)return __webpack_require__(\"./src/secondary/geotiff sync recursive\")(r);var u=new Error(\"Cannot find module '\"+r+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}f.resolve=function(t){return e[r][1][t]||t},f.cache={};var l=t[r]=new s.Module(r);e[r][0].call(l.exports,f,l,l.exports,this)}return t[r].exports;function f(e){return s(f.resolve(e))}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.exports={}},s.modules=e,s.cache=t,s.parent=o,s.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]};for(var u=0;u=0;--o){var a=this.tryEntries[o],s=a.completion;if(\"root\"===a.tryLoc)return i(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;T(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),p}},e}(\"object\"==typeof t?t.exports:{});try{regeneratorRuntime=n}catch(e){Function(\"r\",\"regeneratorRuntime = r\")(n)}},{}],PMvg:[function(e,t,r){t.exports=e(\"regenerator-runtime\")},{\"regenerator-runtime\":\"QVnC\"}],IxO8:[function(e,t,r){t.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},{}],OUZ9:[function(e,t,r){t.exports=function(e){if(Array.isArray(e))return e}},{}],vKPt:[function(e,t,r){t.exports=function(e,t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},{}],NVR6:[function(e,t,r){t.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>23&511;return a[r]+((8388607&t)>>s[r])},r.convertToNumber=function(e){const t=e>>10;return o[0]=u[f[t]+(1023&e)]+l[t],i[0]};const n=new ArrayBuffer(4),i=new Float32Array(n),o=new Uint32Array(n),a=new Uint32Array(512),s=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(a[0|e]=0,a[256|e]=32768,s[0|e]=24,s[256|e]=24):t<-14?(a[0|e]=1024>>-t-14,a[256|e]=1024>>-t-14|32768,s[0|e]=-t-1,s[256|e]=-t-1):t<=15?(a[0|e]=t+15<<10,a[256|e]=t+15<<10|32768,s[0|e]=13,s[256|e]=13):t<128?(a[0|e]=31744,a[256|e]=64512,s[0|e]=24,s[256|e]=24):(a[0|e]=31744,a[256|e]=64512,s[0|e]=13,s[256|e]=13)}const u=new Uint32Array(2048),l=new Uint32Array(64),f=new Uint32Array(64);u[0]=0;for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;0==(8388608&t);)r-=8388608,t<<=1;t&=-8388609,r+=947912704,u[e]=t|r}for(let e=1024;e<2048;++e)u[e]=939524096+(e-1024<<13);l[0]=0;for(let e=1;e<31;++e)l[e]=e<<23;l[31]=1199570944,l[32]=2147483648;for(let e=33;e<63;++e)l[e]=2147483648+(e-32<<23);l[63]=3347054592,f[0]=0;for(let e=1;e<64;++e)f[e]=32===e?0:1024},{}],G4sf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=function(e){if(e=Number(e),!Number.isFinite(e)||0===e)return e;const t=(0,n.roundToFloat16Bits)(e);return(0,n.convertToNumber)(t)};var n=e(\"./lib\")},{\"./lib\":\"GG94\"}],xQUP:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.ToInteger=function(e){return\"number\"!=typeof e&&(e=Number(e)),Number.isNaN(e)&&(e=0),Math.trunc(e)},r.defaultCompareFunction=function(e,t){const[r,n]=[Number.isNaN(e),Number.isNaN(t)];if(r&&n)return 0;if(r)return 1;if(n)return-1;if(et)return 1;if(0===e&&0===t){const[r,n]=[Object.is(e,0),Object.is(t,0)];if(!r&&n)return-1;if(r&&!n)return 1}return 0}},{}],iJ7y:[function(e,t,r){var n=arguments[3];Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var i=\"object\"==typeof n&&n&&n.Object===Object&&n,o=i;r.default=o},{}],ygki:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof self&&self&&self.Object===Object&&self,o=n.default||i||Function(\"return this\")();r.default=o},{\"./_freeGlobal.js\":\"iJ7y\"}],Oi8n:[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(\"./_root.js\")).default.Symbol;r.default=n},{\"./_root.js\":\"ygki\"}],InRc:[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(\"./_Symbol.js\"));var i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n.default?n.default.toStringTag:void 0;var u=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i};r.default=u},{\"./_Symbol.js\":\"Oi8n\"}],iwg4:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Object.prototype.toString;var i=function(e){return n.call(e)};r.default=i},{}],svpX:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_Symbol.js\")),i=a(e(\"./_getRawTag.js\")),o=a(e(\"./_objectToString.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=n.default?n.default.toStringTag:void 0;var u=function(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":s&&s in Object(e)?(0,i.default)(e):(0,o.default)(e)};r.default=u},{\"./_Symbol.js\":\"Oi8n\",\"./_getRawTag.js\":\"InRc\",\"./_objectToString.js\":\"iwg4\"}],UKR9:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return null!=e&&\"object\"==typeof e};r.default=n},{}],MYZg:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObjectLike.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){return(0,i.default)(e)&&\"[object ArrayBuffer]\"==(0,n.default)(e)};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObjectLike.js\":\"UKR9\"}],pmj6:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return function(t){return e(t)}};r.default=n},{}],oPFz:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof r&&r&&!r.nodeType&&r,o=i&&\"object\"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&n.default.process,s=function(){try{return o&&o.require&&o.require(\"util\").types||a&&a.binding&&a.binding(\"util\")}catch(e){}}();r.default=s},{\"./_freeGlobal.js\":\"iJ7y\"}],rXXV:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_baseIsArrayBuffer.js\")),i=a(e(\"./_baseUnary.js\")),o=a(e(\"./_nodeUtil.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=o.default&&o.default.isArrayBuffer,u=s?(0,i.default)(s):n.default;r.default=u},{\"./_baseIsArrayBuffer.js\":\"MYZg\",\"./_baseUnary.js\":\"pmj6\",\"./_nodeUtil.js\":\"oPFz\"}],XYHx:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.isDataView=function(e){return e instanceof DataView},r.isStringNumberKey=function(e){return\"string\"==typeof e&&e===(0,n.ToInteger)(e)+\"\"},Object.defineProperty(r,\"isArrayBuffer\",{enumerable:!0,get:function(){return i.default}});var n=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,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.createPrivateStorage=function(){const e=new WeakMap;return t=>{let r=e.get(t);return r||(r=Object.create(null),e.set(t,r),r)}}},{}],DTZk:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)};r.default=n},{}],tWvT:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObject.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){if(!(0,i.default)(e))return!1;var t=(0,n.default)(e);return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObject.js\":\"DTZk\"}],xFkS:[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(\"./_root.js\")).default[\"__core-js_shared__\"];r.default=n},{\"./_root.js\":\"ygki\"}],pULC:[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(\"./_coreJsData.js\"));var i=function(){var e=/[^.]+$/.exec(n.default&&n.default.keys&&n.default.keys.IE_PROTO||\"\");return e?\"Symbol(src)_1.\"+e:\"\"}();var o=function(e){return!!i&&i in e};r.default=o},{\"./_coreJsData.js\":\"xFkS\"}],UKJK:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Function.prototype.toString;var i=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"};r.default=i},{}],Zczf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=s(e(\"./isFunction.js\")),i=s(e(\"./_isMasked.js\")),o=s(e(\"./isObject.js\")),a=s(e(\"./_toSource.js\"));function s(e){return e&&e.__esModule?e:{default:e}}var u=/^\\[object .+?Constructor\\]$/,l=Function.prototype,f=Object.prototype,c=l.toString,h=f.hasOwnProperty,d=RegExp(\"^\"+c.call(h).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");var p=function(e){return!(!(0,o.default)(e)||(0,i.default)(e))&&((0,n.default)(e)?d:u).test((0,a.default)(e))};r.default=p},{\"./isFunction.js\":\"tWvT\",\"./_isMasked.js\":\"pULC\",\"./isObject.js\":\"DTZk\",\"./_toSource.js\":\"UKJK\"}],ZVQn:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e,t){return null==e?void 0:e[t]};r.default=n},{}],tx41:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseIsNative.js\")),i=o(e(\"./_getValue.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e,t){var r=(0,i.default)(e,t);return(0,n.default)(r)?r:void 0};r.default=a},{\"./_baseIsNative.js\":\"Zczf\",\"./_getValue.js\":\"ZVQn\"}],YsDH:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=(0,function(e){return e&&e.__esModule?e:{default:e}}(e(\"./_getNative.js\")).default)(Object,\"create\");r.default=n},{\"./_getNative.js\":\"tx41\"}],sJnX:[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(\"./_nativeCreate.js\"));var i=function(){this.__data__=n.default?(0,n.default)(null):{},this.size=0};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],c9sB:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};r.default=n},{}],zYTU:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;if(n.default){var r=t[e];return\"__lodash_hash_undefined__\"===r?void 0:r}return i.call(t,e)?t[e]:void 0};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],ZFwF:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;return n.default?void 0!==t[e]:i.call(t,e)};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],i3LK:[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(\"./_nativeCreate.js\"));var i=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n.default&&void 0===t?\"__lodash_hash_undefined__\":t,this};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],tE4I:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_hashClear.js\")),i=u(e(\"./_hashDelete.js\")),o=u(e(\"./_hashGet.js\")),a=u(e(\"./_hashHas.js\")),s=u(e(\"./_hashSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],GGNI:[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(\"./_assocIndexOf.js\"));var i=function(e,t){var r=this.__data__,i=(0,n.default)(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],UlXa:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_listCacheClear.js\")),i=u(e(\"./_listCacheDelete.js\")),o=u(e(\"./_listCacheGet.js\")),a=u(e(\"./_listCacheHas.js\")),s=u(e(\"./_listCacheSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tf(t)&&function(e){return\"function\"==typeof e&&v.has(e)}(e)?Reflect.apply(e,l(t).target,r):Reflect.apply(e,t,r)},p={get(e,t){let r=null;if(u.isTypedArrayIndexedPropertyWritable||(e=l(r=e).target),(0,i.isStringNumberKey)(t))return Reflect.has(e,t)?(0,s.convertToNumber)(Reflect.get(e,t)):void 0;{const n=null!==r&&Reflect.has(r,t)?Reflect.get(r,t):Reflect.get(e,t);if(\"function\"!=typeof n)return n;let i=l(n).proxy;return void 0===i&&(i=l(n).proxy=new Proxy(n,d)),i}},set(e,t,r){let n=null;return u.isTypedArrayIndexedPropertyWritable||(e=l(n=e).target),(0,i.isStringNumberKey)(t)?Reflect.set(e,t,(0,s.roundToFloat16Bits)(r)):null===n||Reflect.has(e,t)&&!Object.isFrozen(n)?Reflect.set(e,t,r):Reflect.set(n,t,r)}};u.isTypedArrayIndexedPropertyWritable||(p.getPrototypeOf=e=>Reflect.getPrototypeOf(l(e).target),p.setPrototypeOf=(e,t)=>Reflect.setPrototypeOf(l(e).target,t),p.defineProperty=(e,t,r)=>{const n=l(e).target;return!Reflect.has(n,t)||Object.isFrozen(e)?Reflect.defineProperty(e,t,r):Reflect.defineProperty(n,t,r)},p.deleteProperty=(e,t)=>{const r=l(e).target;return Reflect.has(e,t)?Reflect.deleteProperty(e,t):Reflect.deleteProperty(r,t)},p.has=(e,t)=>Reflect.has(e,t)||Reflect.has(l(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 b extends Uint16Array{constructor(e,t,r){if(f(e))super(l(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,r);break;default:super(...arguments)}else{const t=Reflect.has(e,\"length\")||void 0===e[Symbol.iterator]?e:[...e],r=t.length;super(r);for(let e=0;et(r(e),r(n)))),l(this).proxy}slice(...e){let t;c(this);try{t=super.slice(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).slice(...e)}return new b(t.buffer)}subarray(...e){let t;c(this);try{t=super.subarray(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).subarray(...e)}return new b(t.buffer,t.byteOffset,t.length)}indexOf(e,...t){c(this);const r=this.length;let i=(0,n.ToInteger)(t[0]);i<0&&(i+=r)<0&&(i=0);for(let t=i,n=r;t=0?i=i0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error(\"Possible EventEmitter memory leak detected. \"+a.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");s.name=\"MaxListenersExceededWarning\",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function h(){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 d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error(\"Unhandled error.\"+(a?\" (\"+a.message+\")\":\"\"));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if(\"function\"==typeof u)o(u,this,t);else{var l=u.length,f=y(u,l);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);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):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],ExO1:[function(e,t,r){t.exports=e(\"events\").EventEmitter},{events:\"FRpO\"}],yh9p:[function(e,t,r){\"use strict\";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=l(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,c=s>0?a-4:a;for(r=0;r>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+\"==\")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\")),o.join(\"\")};for(var n=[],i=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",s=0,u=a.length;s0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=e.indexOf(\"=\");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],o=t;o>1,f=-7,c=r?i-1:0,h=r?-1:1,d=e[t+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*u-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*b}},{}],REa7:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return\"[object Array]\"==n.call(e)}},{}],dskh:[function(e,t,r){var n=arguments[3],i=e(\"base64-js\"),o=e(\"ieee754\"),a=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 u(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(u()=u())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+u().toString(16)+\" bytes\");return 0|e}function w(e){return+e!=e&&(e=0),f.alloc(+e)}function _(e,t){if(f.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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return Q(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return ee(e).length;default:if(n)return Q(e).length;t=(\"\"+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return F(this,t,r);case\"utf8\":case\"utf-8\":return A(this,t,r);case\"ascii\":return L(this,t,r);case\"latin1\":case\"binary\":return N(this,t,r);case\"base64\":return M(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return U(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function x(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:O(e,t,r,n,i);if(\"number\"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):O(e,[t],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function O(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;hi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError(\"Invalid hex string\");n>o/2&&(n=o/2);for(var a=0;a239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return D(n)}r.Buffer=f,r.SlowBuffer=w,r.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:s(),r.kMaxLength=u(),f.poolSize=8192,f._augment=function(e){return e.__proto__=f.prototype,e},f.from=function(e,t,r){return c(null,e,t,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,\"undefined\"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(e,t,r){return d(null,e,t,r)},f.allocUnsafe=function(e){return p(null,e)},f.allocUnsafeSlow=function(e){return p(null,e)},f.isBuffer=function(e){return!(null==e||!e._isBuffer)},f.compare=function(e,t){if(!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError(\"Arguments must be Buffers\");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString(\"hex\",0,t).match(/.{2}/g).join(\" \"),this.length>t&&(e+=\" ... \")),\"\"},f.prototype.compare=function(e,t,r,n,i){if(!f.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return T(this,e,t,r);case\"utf8\":case\"utf-8\":return E(this,e,t,r);case\"ascii\":return C(this,e,t,r);case\"latin1\":case\"binary\":return P(this,e,t,r);case\"base64\":return j(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return R(this,e,t,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function D(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);for(var r=\"\",n=0;nn)&&(r=n);for(var i=\"\",o=t;or)throw new RangeError(\"Trying to access beyond buffer length\")}function G(e,t,r,n,i,o){if(!f.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 z(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function H(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function W(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function q(e,t,r,n,i){return i||W(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function K(e,t,r,n,i){return i||W(e,0,r,8),o.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},f.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},f.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]},f.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])},f.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},f.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},f.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},f.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]},f.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):H(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):H(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function ee(e){return i.toByteArray(Y(e))}function te(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e){return e!=e}},{\"base64-js\":\"yh9p\",ieee754:\"JgNJ\",isarray:\"REa7\",buffer:\"dskh\"}],VCcH:[function(e,t,r){\"use strict\";function n(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 i(e){for(var t=1;t0?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,r=\"\"+t.data;t=t.next;)r+=e+t.data;return r}},{key:\"concat\",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:\"consume\",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:\"_getBuffer\",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:\"dskh\",util:\"rDCW\"}],pBGv:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error(\"setTimeout has not been defined\")}function s(){throw new Error(\"clearTimeout has not been defined\")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function l(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}!function(){try{n=\"function\"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i=\"function\"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var f,c=[],h=!1,d=-1;function p(){h&&f&&(h=!1,f.length?c=f.concat(c):d=-1,c.length&&b())}function b(){if(!h){var e=u(p);h=!0;for(var t=c.length;t;){for(f=c,c=[];++d1)for(var r=1;r2?\"one of \".concat(t,\" \").concat(e.slice(0,r-1).join(\", \"),\", or \")+e[r-1]:2===r?\"one of \".concat(t,\" \").concat(e[0],\" or \").concat(e[1]):\"of \".concat(t,\" \").concat(e[0])}return\"of \".concat(t,\" \").concat(String(e))}o(\"ERR_INVALID_OPT_VALUE\",(function(e,t){return'The value \"'+t+'\" is invalid for option \"'+e+'\"'}),TypeError),o(\"ERR_INVALID_ARG_TYPE\",(function(e,t,r){var i,o;if(\"string\"==typeof t&&function(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}(t,\"not \")?(i=\"must not be\",t=t.replace(/^not /,\"\")):i=\"must be\",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e,\" argument\"))o=\"The \".concat(e,\" \").concat(i,\" \").concat(a(t,\"type\"));else{var s=function(e,t,r){return\"number\"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,\".\")?\"property\":\"argument\";o='The \"'.concat(e,'\" ').concat(s,\" \").concat(i,\" \").concat(a(t,\"type\"))}return o+\". Received type \".concat(n(r))}),TypeError),o(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),o(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(e){return\"The \"+e+\" method is not implemented\"})),o(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),o(\"ERR_STREAM_DESTROYED\",(function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"})),o(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),o(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),o(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),o(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),o(\"ERR_UNKNOWN_ENCODING\",(function(e){return\"Unknown encoding: \"+e}),TypeError),o(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=i},{}],TWVJ:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:\"highWaterMark\",o);return Math.floor(o)}return e.objectMode?16:16384}}},{\"../../../errors\":\"Yj9o\"}],Bm0n:[function(e,t,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],yM1o:[function(e,t,r){var n=arguments[3];function i(e,t){if(o(\"noDeprecation\"))return e;var r=!1;return function(){if(!r){if(o(\"throwDeprecation\"))throw new Error(t);o(\"traceDeprecation\")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}function o(e){try{if(!n.localStorage)return!1}catch(e){return!1}var t=n.localStorage[e];return null!=t&&\"true\"===String(t).toLowerCase()}t.exports=i},{}],WSyY:[function(e,t,r){e(\"process\");var n,i=arguments[3],o=e(\"process\");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){K(t,e)}}t.exports=P,P.WritableState=C;var s={deprecate:e(\"util-deprecate\")},u=e(\"./internal/streams/stream\"),l=e(\"buffer\").Buffer,f=i.Uint8Array||function(){};function c(e){return l.from(e)}function h(e){return l.isBuffer(e)||e instanceof f}var d,p=e(\"./internal/streams/destroy\"),b=e(\"./internal/streams/state\"),y=b.getHighWaterMark,v=e(\"../errors\").codes,g=v.ERR_INVALID_ARG_TYPE,m=v.ERR_METHOD_NOT_IMPLEMENTED,w=v.ERR_MULTIPLE_CALLBACK,_=v.ERR_STREAM_CANNOT_PIPE,k=v.ERR_STREAM_DESTROYED,x=v.ERR_STREAM_NULL_VALUES,S=v.ERR_STREAM_WRITE_AFTER_END,O=v.ERR_UNKNOWN_ENCODING,T=p.errorOrDestroy;function E(){}function C(t,r,i){n=n||e(\"./_stream_duplex\"),t=t||{},\"boolean\"!=typeof i&&(i=r instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=y(this,t,\"writableHighWaterMark\",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){N(r,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 a(this)}function P(t){var r=this instanceof(n=n||e(\"./_stream_duplex\"));if(!r&&!d.call(P,this))return new P(t);this._writableState=new C(t,this,r),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 j(e,t){var r=new S;T(e,r),o.nextTick(t,r)}function R(e,t,r,n){var i;return null===r?i=new x:\"string\"==typeof r||t.objectMode||(i=new g(\"chunk\",[\"string\",\"Buffer\"],r)),!i||(T(e,i),o.nextTick(n,i),!1)}function M(e,t,r){return e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=l.from(t,r)),t}function A(e,t,r,n,i,o){if(!r){var a=M(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 O(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,r){r(new m(\"_write()\"))},P.prototype._writev=null,P.prototype.end=function(e,t,r){var n=this._writableState;return\"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||q(this,n,r),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,r){e(\"process\");var n=e(\"process\"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var o=e(\"./_stream_readable\"),a=e(\"./_stream_writable\");e(\"inherits\")(f,o);for(var s=i(a.prototype),u=0;u>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\":\"Wugr\"}],mrEY:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,o){if(\"function\"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(\"string\"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=f(t)),n)a.endEmitted?T(e,new O):M(e,a,t,!0);else if(a.ended)T(e,new x);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):B(e,a)):M(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.length=I?e=I:(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=D(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function N(e,t){if(h(\"onEofChunk\"),!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,t.sync?F(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U(e)))}}function F(e){var t=e._readableState;h(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h(\"emitReadable\",t.flowing),t.emittedReadable=!0,o.nextTick(U,e))}function U(e){var t=e._readableState;h(\"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,V(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(G,e,t))}function G(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){h(\"readable nexttick read 0\"),e.read(0)}function q(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(K,e,t))}function K(e,t){h(\"resume\",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(\"resume\"),V(e),t.flowing&&!t.reading&&e.read(0)}function V(e){var t=e._readableState;for(h(\"flow\",t.flowing);t.flowing&&null!==e.read(););}function Y(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function Z(e){var t=e._readableState;h(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(J,t,e))}function J(e,t){if(h(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Q(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return h(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?Z(this):F(this),null;if(0===(e=L(e,t))&&t.ended)return 0===t.length&&Z(this),null;var n,i=t.needReadable;return h(\"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),r!==e&&t.ended&&Z(this)),null!==n&&this.emit(\"data\",n),n},j.prototype._read=function(e){T(this,new S(\"_read()\"))},j.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,h(\"pipe count=%d opts=%j\",n.pipesCount,t);var i=t&&!1===t.end||e===o.stdout||e===o.stderr?b:s;function s(){h(\"onend\"),e.end()}n.endEmitted?o.nextTick(i):r.once(\"end\",i),e.on(\"unpipe\",(function t(i,o){h(\"onunpipe\"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,h(\"cleanup\"),e.removeListener(\"close\",d),e.removeListener(\"finish\",p),e.removeListener(\"drain\",u),e.removeListener(\"error\",c),e.removeListener(\"unpipe\",t),r.removeListener(\"end\",s),r.removeListener(\"end\",b),r.removeListener(\"data\",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=z(r);e.on(\"drain\",u);var l=!1;function f(t){h(\"ondata\");var i=e.write(t);h(\"dest.write\",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Q(n.pipes,e))&&!l&&(h(\"false write response, pause\",n.awaitDrain),n.awaitDrain++),r.pause())}function c(t){h(\"onerror\",t),b(),e.removeListener(\"error\",c),0===a(e,\"error\")&&T(e,t)}function d(){e.removeListener(\"finish\",p),b()}function p(){h(\"onfinish\"),e.removeListener(\"close\",d),b()}function b(){h(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",f),C(e,\"error\",c),e.once(\"close\",d),e.once(\"finish\",p),e.emit(\"pipe\",r),n.flowing||(h(\"pipe resume\"),r.resume()),e},j.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;o0,!1!==n.flowing&&this.resume()):\"readable\"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,h(\"on readable\",n.length,n.reading),n.length?F(this):n.reading||o.nextTick(W,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return\"readable\"===e&&o.nextTick(H,this),r},j.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==e&&void 0!==e||o.nextTick(H,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(h(\"resume\"),e.flowing=!e.readableListening,q(this,e)),e.paused=!1,this},j.prototype.pause=function(){return h(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(h(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on(\"end\",(function(){if(h(\"wrapped end\"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on(\"data\",(function(i){h(\"wrapped data\"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!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 o=0;o0,(function(e){n||(n=e),e&&a.forEach(l),o||(a.forEach(l),i(n))}))}));return t.reduce(f)}},{\"../../../errors\":\"Yj9o\",\"./end-of-stream\":\"mrEY\"}],tzeh:[function(e,t,r){(r=t.exports=e(\"./lib/_stream_readable.js\")).Stream=r,r.Readable=r,r.Writable=e(\"./lib/_stream_writable.js\"),r.Duplex=e(\"./lib/_stream_duplex.js\"),r.Transform=e(\"./lib/_stream_transform.js\"),r.PassThrough=e(\"./lib/_stream_passthrough.js\"),r.finished=e(\"./lib/internal/streams/end-of-stream.js\"),r.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,r){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,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],gfUn:[function(e,t,r){e(\"process\");var n=e(\"process\"),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case\"%s\":return String(n[r++]);case\"%d\":return Number(n[r++]);case\"%j\":try{return JSON.stringify(n[r++])}catch(e){return\"[Circular]\"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?\"\u001b[\"+u.colors[r][0]+\"m\"+e+\"\u001b[\"+u.colors[r][1]+\"m\":e}function f(e,t){return e}function c(e,t,n){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return m(i)||(i=c(e,i,n)),i}var o=h(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),S(t)&&(a.indexOf(\"message\")>=0||a.indexOf(\"description\")>=0))return d(t);if(0===a.length){if(O(t)){var u=t.name?\": \"+t.name:\"\";return e.stylize(\"[Function\"+u+\"]\",\"special\")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),\"regexp\");if(x(t))return e.stylize(Date.prototype.toString.call(t),\"date\");if(S(t))return d(t)}var l,f=\"\",y=!1,v=[\"{\",\"}\"];return b(t)&&(y=!0,v=[\"[\",\"]\"]),O(t)&&(f=\" [Function\"+(t.name?\": \"+t.name:\"\")+\"]\"),_(t)&&(f=\" \"+RegExp.prototype.toString.call(t)),x(t)&&(f=\" \"+Date.prototype.toUTCString.call(t)),S(t)&&(f=\" \"+d(t)),0!==a.length||y&&0!=t.length?n<0?_(t)?e.stylize(RegExp.prototype.toString.call(t),\"regexp\"):e.stylize(\"[Object]\",\"special\"):(e.seen.push(t),l=y?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60?r[0]+(\"\"===t?\"\":t+\"\\n \")+\" \"+e.join(\",\\n \")+\" \"+r[1]:r[0]+t+\" \"+e.join(\", \")+\" \"+r[1]}(l,f,v)):v[0]+f+v[1]}function h(e,t){if(w(t))return e.stylize(\"undefined\",\"undefined\");if(m(t)){var r=\"'\"+JSON.stringify(t).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return e.stylize(r,\"string\")}return g(t)?e.stylize(\"\"+t,\"number\"):y(t)?e.stylize(\"\"+t,\"boolean\"):v(t)?e.stylize(\"null\",\"null\"):void 0}function d(e){return\"[\"+Error.prototype.toString.call(e)+\"]\"}function p(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize(\"[Getter/Setter]\",\"special\"):e.stylize(\"[Getter]\",\"special\"):u.set&&(s=e.stylize(\"[Setter]\",\"special\")),j(n,i)||(a=\"[\"+i+\"]\"),s||(e.seen.indexOf(u.value)<0?(s=v(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf(\"\\n\")>-1&&(s=o?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\")),w(a)){if(o&&i.match(/^\\d+$/))return s;(a=JSON.stringify(\"\"+i)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,\"name\")):(a=a.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),a=e.stylize(a,\"string\"))}return a+\": \"+s}function b(e){return Array.isArray(e)}function y(e){return\"boolean\"==typeof e}function v(e){return null===e}function g(e){return\"number\"==typeof e}function m(e){return\"string\"==typeof e}function w(e){return void 0===e}function _(e){return k(e)&&\"[object RegExp]\"===T(e)}function k(e){return\"object\"==typeof e&&null!==e}function x(e){return k(e)&&\"[object Date]\"===T(e)}function S(e){return k(e)&&(\"[object Error]\"===T(e)||e instanceof Error)}function O(e){return\"function\"==typeof e}function T(e){return Object.prototype.toString.call(e)}function E(e){return e<10?\"0\"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(w(a)&&(a=\"\"),e=e.toUpperCase(),!s[e])if(new RegExp(\"\\\\b\"+e+\"\\\\b\",\"i\").test(a)){var t=n.pid;s[e]=function(){var n=r.format.apply(r,arguments);console.error(\"%s %d: %s\",e,t,n)}}else s[e]=function(){};return s[e]},r.inspect=u,u.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]},u.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},r.isArray=b,r.isBoolean=y,r.isNull=v,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=m,r.isSymbol=function(e){return\"symbol\"==typeof e},r.isUndefined=w,r.isRegExp=_,r.isObject=k,r.isDate=x,r.isError=S,r.isFunction=O,r.isPrimitive=function(e){return null===e||\"boolean\"==typeof e||\"number\"==typeof e||\"string\"==typeof e||\"symbol\"==typeof e||void 0===e},r.isBuffer=e(\"./support/isBuffer\");var C=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];function P(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(\":\");return[e.getDate(),C[e.getMonth()],t].join(\" \")}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log(\"%s - %s\",P(),r.format.apply(r,arguments))},r.inherits=e(\"inherits\"),r._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R=\"undefined\"!=typeof Symbol?Symbol(\"util.promisify.custom\"):void 0;function M(e,t){if(!e){var r=new Error(\"Promise was rejected with a falsy value\");r.reason=e,e=r}return t(e)}r.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,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o\".charCodeAt(0),a=\"-\".charCodeAt(0),s=\"/\".charCodeAt(0),u=\"!\".charCodeAt(0),l=\"'\".charCodeAt(0),f='\"'.charCodeAt(0);function c(){for(var t=[];e[r];)if(e.charCodeAt(r)==i){if(e.charCodeAt(r+1)===s)return(r=e.indexOf(\">\",r))+1&&(r+=1),t;if(e.charCodeAt(r+1)===u){if(e.charCodeAt(r+2)==a){for(;-1!==r&&(e.charCodeAt(r)!==o||e.charCodeAt(r-1)!=a||e.charCodeAt(r-2)!=a||-1==r);)r=e.indexOf(\">\",r+1);-1===r&&(r=e.length)}else for(r+=2;e.charCodeAt(r)!==o&&e[r];)r++;r++;continue}var n=b();t.push(n)}else{var l=h();l.trim().length>0&&t.push(l),r++}return t}function h(){var t=r;return-2==(r=e.indexOf(\"<\",r)-1)&&(r=e.length),e.slice(t,r+1)}function d(){for(var t=r;-1===\"\\n\\t>/= \".indexOf(e[r])&&e[r];)r++;return e.slice(t,r)}var p=t.noChildNodes||[\"img\",\"br\",\"input\",\"meta\",\"link\"];function b(){r++;const t=d(),n={};let i=[];for(;e.charCodeAt(r)!==o&&e[r];){var a=e.charCodeAt(r);if(a>64&&a<91||a>96&&a<123){for(var u=d(),h=e.charCodeAt(r);h&&h!==l&&h!==f&&!(h>64&&h<91||h>96&&h<123)&&h!==o;)r++,h=e.charCodeAt(r);if(h===l||h===f){var b=y();if(-1===r)return{tagName:t,attributes:n,children:i}}else b=null,r--;n[u]=b}r++}if(e.charCodeAt(r-1)!==s)if(\"script\"==t){var v=r+1;r=e.indexOf(\"<\\/script>\",r),i=[e.slice(v,r-1)],r+=9}else\"style\"==t?(v=r+1,r=e.indexOf(\"\",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?"); +eval("var require;/**\r\n * Minified by jsDelivr using Terser v5.3.5.\r\n * Original file: /npm/geotiff@1.0.4/dist-browser/geotiff.js\r\n *\r\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\r\n */\r\nparcelRequire=function(e,t,r,n){var i,o=\"function\"==typeof parcelRequire&&parcelRequire,a=\"function\"==typeof require&&require;function s(r,n){if(!t[r]){if(!e[r]){var i=\"function\"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(r,!0);if(o)return o(r,!0);if( true&&\"string\"==typeof r)return __webpack_require__(\"./src/secondary/geotiff sync recursive\")(r);var u=new Error(\"Cannot find module '\"+r+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}f.resolve=function(t){return e[r][1][t]||t},f.cache={};var l=t[r]=new s.Module(r);e[r][0].call(l.exports,f,l,l.exports,this)}return t[r].exports;function f(e){return s(f.resolve(e))}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.exports={}},s.modules=e,s.cache=t,s.parent=o,s.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]};for(var u=0;u=0;--o){var a=this.tryEntries[o],s=a.completion;if(\"root\"===a.tryLoc)return i(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;T(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),p}},e}(\"object\"==typeof t?t.exports:{});try{regeneratorRuntime=n}catch(e){Function(\"r\",\"regeneratorRuntime = r\")(n)}},{}],PMvg:[function(e,t,r){t.exports=e(\"regenerator-runtime\")},{\"regenerator-runtime\":\"QVnC\"}],IxO8:[function(e,t,r){t.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},{}],OUZ9:[function(e,t,r){t.exports=function(e){if(Array.isArray(e))return e}},{}],vKPt:[function(e,t,r){t.exports=function(e,t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},{}],NVR6:[function(e,t,r){t.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>23&511;return a[r]+((8388607&t)>>s[r])},r.convertToNumber=function(e){const t=e>>10;return o[0]=u[f[t]+(1023&e)]+l[t],i[0]};const n=new ArrayBuffer(4),i=new Float32Array(n),o=new Uint32Array(n),a=new Uint32Array(512),s=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(a[0|e]=0,a[256|e]=32768,s[0|e]=24,s[256|e]=24):t<-14?(a[0|e]=1024>>-t-14,a[256|e]=1024>>-t-14|32768,s[0|e]=-t-1,s[256|e]=-t-1):t<=15?(a[0|e]=t+15<<10,a[256|e]=t+15<<10|32768,s[0|e]=13,s[256|e]=13):t<128?(a[0|e]=31744,a[256|e]=64512,s[0|e]=24,s[256|e]=24):(a[0|e]=31744,a[256|e]=64512,s[0|e]=13,s[256|e]=13)}const u=new Uint32Array(2048),l=new Uint32Array(64),f=new Uint32Array(64);u[0]=0;for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;0==(8388608&t);)r-=8388608,t<<=1;t&=-8388609,r+=947912704,u[e]=t|r}for(let e=1024;e<2048;++e)u[e]=939524096+(e-1024<<13);l[0]=0;for(let e=1;e<31;++e)l[e]=e<<23;l[31]=1199570944,l[32]=2147483648;for(let e=33;e<63;++e)l[e]=2147483648+(e-32<<23);l[63]=3347054592,f[0]=0;for(let e=1;e<64;++e)f[e]=32===e?0:1024},{}],G4sf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=function(e){if(e=Number(e),!Number.isFinite(e)||0===e)return e;const t=(0,n.roundToFloat16Bits)(e);return(0,n.convertToNumber)(t)};var n=e(\"./lib\")},{\"./lib\":\"GG94\"}],xQUP:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.ToInteger=function(e){return\"number\"!=typeof e&&(e=Number(e)),Number.isNaN(e)&&(e=0),Math.trunc(e)},r.defaultCompareFunction=function(e,t){const[r,n]=[Number.isNaN(e),Number.isNaN(t)];if(r&&n)return 0;if(r)return 1;if(n)return-1;if(et)return 1;if(0===e&&0===t){const[r,n]=[Object.is(e,0),Object.is(t,0)];if(!r&&n)return-1;if(r&&!n)return 1}return 0}},{}],iJ7y:[function(e,t,r){var n=arguments[3];Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var i=\"object\"==typeof n&&n&&n.Object===Object&&n,o=i;r.default=o},{}],ygki:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof self&&self&&self.Object===Object&&self,o=n.default||i||Function(\"return this\")();r.default=o},{\"./_freeGlobal.js\":\"iJ7y\"}],Oi8n:[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(\"./_root.js\")).default.Symbol;r.default=n},{\"./_root.js\":\"ygki\"}],InRc:[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(\"./_Symbol.js\"));var i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n.default?n.default.toStringTag:void 0;var u=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i};r.default=u},{\"./_Symbol.js\":\"Oi8n\"}],iwg4:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Object.prototype.toString;var i=function(e){return n.call(e)};r.default=i},{}],svpX:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_Symbol.js\")),i=a(e(\"./_getRawTag.js\")),o=a(e(\"./_objectToString.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=n.default?n.default.toStringTag:void 0;var u=function(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":s&&s in Object(e)?(0,i.default)(e):(0,o.default)(e)};r.default=u},{\"./_Symbol.js\":\"Oi8n\",\"./_getRawTag.js\":\"InRc\",\"./_objectToString.js\":\"iwg4\"}],UKR9:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return null!=e&&\"object\"==typeof e};r.default=n},{}],MYZg:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObjectLike.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){return(0,i.default)(e)&&\"[object ArrayBuffer]\"==(0,n.default)(e)};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObjectLike.js\":\"UKR9\"}],pmj6:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){return function(t){return e(t)}};r.default=n},{}],oPFz:[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(\"./_freeGlobal.js\"));var i=\"object\"==typeof r&&r&&!r.nodeType&&r,o=i&&\"object\"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&n.default.process,s=function(){try{return o&&o.require&&o.require(\"util\").types||a&&a.binding&&a.binding(\"util\")}catch(e){}}();r.default=s},{\"./_freeGlobal.js\":\"iJ7y\"}],rXXV:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=a(e(\"./_baseIsArrayBuffer.js\")),i=a(e(\"./_baseUnary.js\")),o=a(e(\"./_nodeUtil.js\"));function a(e){return e&&e.__esModule?e:{default:e}}var s=o.default&&o.default.isArrayBuffer,u=s?(0,i.default)(s):n.default;r.default=u},{\"./_baseIsArrayBuffer.js\":\"MYZg\",\"./_baseUnary.js\":\"pmj6\",\"./_nodeUtil.js\":\"oPFz\"}],XYHx:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.isDataView=function(e){return e instanceof DataView},r.isStringNumberKey=function(e){return\"string\"==typeof e&&e===(0,n.ToInteger)(e)+\"\"},Object.defineProperty(r,\"isArrayBuffer\",{enumerable:!0,get:function(){return i.default}});var n=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,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.createPrivateStorage=function(){const e=new WeakMap;return t=>{let r=e.get(t);return r||(r=Object.create(null),e.set(t,r),r)}}},{}],DTZk:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)};r.default=n},{}],tWvT:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseGetTag.js\")),i=o(e(\"./isObject.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){if(!(0,i.default)(e))return!1;var t=(0,n.default)(e);return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t};r.default=a},{\"./_baseGetTag.js\":\"svpX\",\"./isObject.js\":\"DTZk\"}],xFkS:[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(\"./_root.js\")).default[\"__core-js_shared__\"];r.default=n},{\"./_root.js\":\"ygki\"}],pULC:[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(\"./_coreJsData.js\"));var i=function(){var e=/[^.]+$/.exec(n.default&&n.default.keys&&n.default.keys.IE_PROTO||\"\");return e?\"Symbol(src)_1.\"+e:\"\"}();var o=function(e){return!!i&&i in e};r.default=o},{\"./_coreJsData.js\":\"xFkS\"}],UKJK:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=Function.prototype.toString;var i=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"};r.default=i},{}],Zczf:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=s(e(\"./isFunction.js\")),i=s(e(\"./_isMasked.js\")),o=s(e(\"./isObject.js\")),a=s(e(\"./_toSource.js\"));function s(e){return e&&e.__esModule?e:{default:e}}var u=/^\\[object .+?Constructor\\]$/,l=Function.prototype,f=Object.prototype,c=l.toString,h=f.hasOwnProperty,d=RegExp(\"^\"+c.call(h).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");var p=function(e){return!(!(0,o.default)(e)||(0,i.default)(e))&&((0,n.default)(e)?d:u).test((0,a.default)(e))};r.default=p},{\"./isFunction.js\":\"tWvT\",\"./_isMasked.js\":\"pULC\",\"./isObject.js\":\"DTZk\",\"./_toSource.js\":\"UKJK\"}],ZVQn:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e,t){return null==e?void 0:e[t]};r.default=n},{}],tx41:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=o(e(\"./_baseIsNative.js\")),i=o(e(\"./_getValue.js\"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e,t){var r=(0,i.default)(e,t);return(0,n.default)(r)?r:void 0};r.default=a},{\"./_baseIsNative.js\":\"Zczf\",\"./_getValue.js\":\"ZVQn\"}],YsDH:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=(0,function(e){return e&&e.__esModule?e:{default:e}}(e(\"./_getNative.js\")).default)(Object,\"create\");r.default=n},{\"./_getNative.js\":\"tx41\"}],sJnX:[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(\"./_nativeCreate.js\"));var i=function(){this.__data__=n.default?(0,n.default)(null):{},this.size=0};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],c9sB:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};r.default=n},{}],zYTU:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;if(n.default){var r=t[e];return\"__lodash_hash_undefined__\"===r?void 0:r}return i.call(t,e)?t[e]:void 0};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],ZFwF:[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(\"./_nativeCreate.js\"));var i=Object.prototype.hasOwnProperty;var o=function(e){var t=this.__data__;return n.default?void 0!==t[e]:i.call(t,e)};r.default=o},{\"./_nativeCreate.js\":\"YsDH\"}],i3LK:[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(\"./_nativeCreate.js\"));var i=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n.default&&void 0===t?\"__lodash_hash_undefined__\":t,this};r.default=i},{\"./_nativeCreate.js\":\"YsDH\"}],tE4I:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_hashClear.js\")),i=u(e(\"./_hashDelete.js\")),o=u(e(\"./_hashGet.js\")),a=u(e(\"./_hashHas.js\")),s=u(e(\"./_hashSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],GGNI:[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(\"./_assocIndexOf.js\"));var i=function(e,t){var r=this.__data__,i=(0,n.default)(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};r.default=i},{\"./_assocIndexOf.js\":\"Hp84\"}],UlXa:[function(e,t,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0}),r.default=void 0;var n=u(e(\"./_listCacheClear.js\")),i=u(e(\"./_listCacheDelete.js\")),o=u(e(\"./_listCacheGet.js\")),a=u(e(\"./_listCacheHas.js\")),s=u(e(\"./_listCacheSet.js\"));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tf(t)&&function(e){return\"function\"==typeof e&&v.has(e)}(e)?Reflect.apply(e,l(t).target,r):Reflect.apply(e,t,r)},p={get(e,t){let r=null;if(u.isTypedArrayIndexedPropertyWritable||(e=l(r=e).target),(0,i.isStringNumberKey)(t))return Reflect.has(e,t)?(0,s.convertToNumber)(Reflect.get(e,t)):void 0;{const n=null!==r&&Reflect.has(r,t)?Reflect.get(r,t):Reflect.get(e,t);if(\"function\"!=typeof n)return n;let i=l(n).proxy;return void 0===i&&(i=l(n).proxy=new Proxy(n,d)),i}},set(e,t,r){let n=null;return u.isTypedArrayIndexedPropertyWritable||(e=l(n=e).target),(0,i.isStringNumberKey)(t)?Reflect.set(e,t,(0,s.roundToFloat16Bits)(r)):null===n||Reflect.has(e,t)&&!Object.isFrozen(n)?Reflect.set(e,t,r):Reflect.set(n,t,r)}};u.isTypedArrayIndexedPropertyWritable||(p.getPrototypeOf=e=>Reflect.getPrototypeOf(l(e).target),p.setPrototypeOf=(e,t)=>Reflect.setPrototypeOf(l(e).target,t),p.defineProperty=(e,t,r)=>{const n=l(e).target;return!Reflect.has(n,t)||Object.isFrozen(e)?Reflect.defineProperty(e,t,r):Reflect.defineProperty(n,t,r)},p.deleteProperty=(e,t)=>{const r=l(e).target;return Reflect.has(e,t)?Reflect.deleteProperty(e,t):Reflect.deleteProperty(r,t)},p.has=(e,t)=>Reflect.has(e,t)||Reflect.has(l(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 b extends Uint16Array{constructor(e,t,r){if(f(e))super(l(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,r);break;default:super(...arguments)}else{const t=Reflect.has(e,\"length\")||void 0===e[Symbol.iterator]?e:[...e],r=t.length;super(r);for(let e=0;et(r(e),r(n)))),l(this).proxy}slice(...e){let t;c(this);try{t=super.slice(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).slice(...e)}return new b(t.buffer)}subarray(...e){let t;c(this);try{t=super.subarray(...e)}catch(r){if(!(r instanceof TypeError))throw r;t=new Uint16Array(this.buffer,this.byteOffset,this.length).subarray(...e)}return new b(t.buffer,t.byteOffset,t.length)}indexOf(e,...t){c(this);const r=this.length;let i=(0,n.ToInteger)(t[0]);i<0&&(i+=r)<0&&(i=0);for(let t=i,n=r;t=0?i=i0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error(\"Possible EventEmitter memory leak detected. \"+a.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");s.name=\"MaxListenersExceededWarning\",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function h(){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 d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error(\"Unhandled error.\"+(a?\" (\"+a.message+\")\":\"\"));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if(\"function\"==typeof u)o(u,this,t);else{var l=u.length,f=y(u,l);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);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):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],ExO1:[function(e,t,r){t.exports=e(\"events\").EventEmitter},{events:\"FRpO\"}],yh9p:[function(e,t,r){\"use strict\";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=l(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,c=s>0?a-4:a;for(r=0;r>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+\"==\")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\")),o.join(\"\")};for(var n=[],i=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",s=0,u=a.length;s0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=e.indexOf(\"=\");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],o=t;o>1,f=-7,c=r?i-1:0,h=r?-1:1,d=e[t+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*u-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*b}},{}],REa7:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return\"[object Array]\"==n.call(e)}},{}],dskh:[function(e,t,r){var n=arguments[3],i=e(\"base64-js\"),o=e(\"ieee754\"),a=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 u(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(u()=u())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+u().toString(16)+\" bytes\");return 0|e}function w(e){return+e!=e&&(e=0),f.alloc(+e)}function _(e,t){if(f.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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return Q(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return ee(e).length;default:if(n)return Q(e).length;t=(\"\"+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return F(this,t,r);case\"utf8\":case\"utf-8\":return A(this,t,r);case\"ascii\":return L(this,t,r);case\"latin1\":case\"binary\":return N(this,t,r);case\"base64\":return M(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return U(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function x(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:O(e,t,r,n,i);if(\"number\"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):O(e,[t],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function O(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;hi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError(\"Invalid hex string\");n>o/2&&(n=o/2);for(var a=0;a239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return D(n)}r.Buffer=f,r.SlowBuffer=w,r.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:s(),r.kMaxLength=u(),f.poolSize=8192,f._augment=function(e){return e.__proto__=f.prototype,e},f.from=function(e,t,r){return c(null,e,t,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,\"undefined\"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(e,t,r){return d(null,e,t,r)},f.allocUnsafe=function(e){return p(null,e)},f.allocUnsafeSlow=function(e){return p(null,e)},f.isBuffer=function(e){return!(null==e||!e._isBuffer)},f.compare=function(e,t){if(!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError(\"Arguments must be Buffers\");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString(\"hex\",0,t).match(/.{2}/g).join(\" \"),this.length>t&&(e+=\" ... \")),\"\"},f.prototype.compare=function(e,t,r,n,i){if(!f.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return T(this,e,t,r);case\"utf8\":case\"utf-8\":return E(this,e,t,r);case\"ascii\":return C(this,e,t,r);case\"latin1\":case\"binary\":return P(this,e,t,r);case\"base64\":return j(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return R(this,e,t,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function D(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);for(var r=\"\",n=0;nn)&&(r=n);for(var i=\"\",o=t;or)throw new RangeError(\"Trying to access beyond buffer length\")}function G(e,t,r,n,i,o){if(!f.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 z(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function H(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function W(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function q(e,t,r,n,i){return i||W(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function K(e,t,r,n,i){return i||W(e,0,r,8),o.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},f.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},f.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]},f.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])},f.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},f.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},f.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},f.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]},f.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):H(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):H(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function ee(e){return i.toByteArray(Y(e))}function te(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e){return e!=e}},{\"base64-js\":\"yh9p\",ieee754:\"JgNJ\",isarray:\"REa7\",buffer:\"dskh\"}],VCcH:[function(e,t,r){\"use strict\";function n(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 i(e){for(var t=1;t0?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,r=\"\"+t.data;t=t.next;)r+=e+t.data;return r}},{key:\"concat\",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:\"consume\",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:\"_getBuffer\",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:\"dskh\",util:\"rDCW\"}],pBGv:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error(\"setTimeout has not been defined\")}function s(){throw new Error(\"clearTimeout has not been defined\")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function l(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}!function(){try{n=\"function\"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i=\"function\"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var f,c=[],h=!1,d=-1;function p(){h&&f&&(h=!1,f.length?c=f.concat(c):d=-1,c.length&&b())}function b(){if(!h){var e=u(p);h=!0;for(var t=c.length;t;){for(f=c,c=[];++d1)for(var r=1;r2?\"one of \".concat(t,\" \").concat(e.slice(0,r-1).join(\", \"),\", or \")+e[r-1]:2===r?\"one of \".concat(t,\" \").concat(e[0],\" or \").concat(e[1]):\"of \".concat(t,\" \").concat(e[0])}return\"of \".concat(t,\" \").concat(String(e))}o(\"ERR_INVALID_OPT_VALUE\",(function(e,t){return'The value \"'+t+'\" is invalid for option \"'+e+'\"'}),TypeError),o(\"ERR_INVALID_ARG_TYPE\",(function(e,t,r){var i,o;if(\"string\"==typeof t&&function(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}(t,\"not \")?(i=\"must not be\",t=t.replace(/^not /,\"\")):i=\"must be\",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e,\" argument\"))o=\"The \".concat(e,\" \").concat(i,\" \").concat(a(t,\"type\"));else{var s=function(e,t,r){return\"number\"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,\".\")?\"property\":\"argument\";o='The \"'.concat(e,'\" ').concat(s,\" \").concat(i,\" \").concat(a(t,\"type\"))}return o+\". Received type \".concat(n(r))}),TypeError),o(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),o(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(e){return\"The \"+e+\" method is not implemented\"})),o(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),o(\"ERR_STREAM_DESTROYED\",(function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"})),o(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),o(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),o(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),o(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),o(\"ERR_UNKNOWN_ENCODING\",(function(e){return\"Unknown encoding: \"+e}),TypeError),o(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=i},{}],TWVJ:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:\"highWaterMark\",o);return Math.floor(o)}return e.objectMode?16:16384}}},{\"../../../errors\":\"Yj9o\"}],Bm0n:[function(e,t,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],yM1o:[function(e,t,r){var n=arguments[3];function i(e,t){if(o(\"noDeprecation\"))return e;var r=!1;return function(){if(!r){if(o(\"throwDeprecation\"))throw new Error(t);o(\"traceDeprecation\")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}function o(e){try{if(!n.localStorage)return!1}catch(e){return!1}var t=n.localStorage[e];return null!=t&&\"true\"===String(t).toLowerCase()}t.exports=i},{}],WSyY:[function(e,t,r){e(\"process\");var n,i=arguments[3],o=e(\"process\");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){K(t,e)}}t.exports=P,P.WritableState=C;var s={deprecate:e(\"util-deprecate\")},u=e(\"./internal/streams/stream\"),l=e(\"buffer\").Buffer,f=i.Uint8Array||function(){};function c(e){return l.from(e)}function h(e){return l.isBuffer(e)||e instanceof f}var d,p=e(\"./internal/streams/destroy\"),b=e(\"./internal/streams/state\"),y=b.getHighWaterMark,v=e(\"../errors\").codes,g=v.ERR_INVALID_ARG_TYPE,m=v.ERR_METHOD_NOT_IMPLEMENTED,w=v.ERR_MULTIPLE_CALLBACK,_=v.ERR_STREAM_CANNOT_PIPE,k=v.ERR_STREAM_DESTROYED,x=v.ERR_STREAM_NULL_VALUES,S=v.ERR_STREAM_WRITE_AFTER_END,O=v.ERR_UNKNOWN_ENCODING,T=p.errorOrDestroy;function E(){}function C(t,r,i){n=n||e(\"./_stream_duplex\"),t=t||{},\"boolean\"!=typeof i&&(i=r instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=y(this,t,\"writableHighWaterMark\",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){N(r,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 a(this)}function P(t){var r=this instanceof(n=n||e(\"./_stream_duplex\"));if(!r&&!d.call(P,this))return new P(t);this._writableState=new C(t,this,r),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 j(e,t){var r=new S;T(e,r),o.nextTick(t,r)}function R(e,t,r,n){var i;return null===r?i=new x:\"string\"==typeof r||t.objectMode||(i=new g(\"chunk\",[\"string\",\"Buffer\"],r)),!i||(T(e,i),o.nextTick(n,i),!1)}function M(e,t,r){return e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=l.from(t,r)),t}function A(e,t,r,n,i,o){if(!r){var a=M(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 O(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,r){r(new m(\"_write()\"))},P.prototype._writev=null,P.prototype.end=function(e,t,r){var n=this._writableState;return\"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||q(this,n,r),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,r){e(\"process\");var n=e(\"process\"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var o=e(\"./_stream_readable\"),a=e(\"./_stream_writable\");e(\"inherits\")(f,o);for(var s=i(a.prototype),u=0;u>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\":\"Wugr\"}],mrEY:[function(e,t,r){\"use strict\";var n=e(\"../../../errors\").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,o){if(\"function\"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(\"string\"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=f(t)),n)a.endEmitted?T(e,new O):M(e,a,t,!0);else if(a.ended)T(e,new x);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):B(e,a)):M(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.length=I?e=I:(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=D(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function N(e,t){if(h(\"onEofChunk\"),!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,t.sync?F(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U(e)))}}function F(e){var t=e._readableState;h(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h(\"emitReadable\",t.flowing),t.emittedReadable=!0,o.nextTick(U,e))}function U(e){var t=e._readableState;h(\"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,V(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(G,e,t))}function G(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){h(\"readable nexttick read 0\"),e.read(0)}function q(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(K,e,t))}function K(e,t){h(\"resume\",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(\"resume\"),V(e),t.flowing&&!t.reading&&e.read(0)}function V(e){var t=e._readableState;for(h(\"flow\",t.flowing);t.flowing&&null!==e.read(););}function Y(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function Z(e){var t=e._readableState;h(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(J,t,e))}function J(e,t){if(h(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Q(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return h(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?Z(this):F(this),null;if(0===(e=L(e,t))&&t.ended)return 0===t.length&&Z(this),null;var n,i=t.needReadable;return h(\"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),r!==e&&t.ended&&Z(this)),null!==n&&this.emit(\"data\",n),n},j.prototype._read=function(e){T(this,new S(\"_read()\"))},j.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,h(\"pipe count=%d opts=%j\",n.pipesCount,t);var i=t&&!1===t.end||e===o.stdout||e===o.stderr?b:s;function s(){h(\"onend\"),e.end()}n.endEmitted?o.nextTick(i):r.once(\"end\",i),e.on(\"unpipe\",(function t(i,o){h(\"onunpipe\"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,h(\"cleanup\"),e.removeListener(\"close\",d),e.removeListener(\"finish\",p),e.removeListener(\"drain\",u),e.removeListener(\"error\",c),e.removeListener(\"unpipe\",t),r.removeListener(\"end\",s),r.removeListener(\"end\",b),r.removeListener(\"data\",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=z(r);e.on(\"drain\",u);var l=!1;function f(t){h(\"ondata\");var i=e.write(t);h(\"dest.write\",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Q(n.pipes,e))&&!l&&(h(\"false write response, pause\",n.awaitDrain),n.awaitDrain++),r.pause())}function c(t){h(\"onerror\",t),b(),e.removeListener(\"error\",c),0===a(e,\"error\")&&T(e,t)}function d(){e.removeListener(\"finish\",p),b()}function p(){h(\"onfinish\"),e.removeListener(\"close\",d),b()}function b(){h(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",f),C(e,\"error\",c),e.once(\"close\",d),e.once(\"finish\",p),e.emit(\"pipe\",r),n.flowing||(h(\"pipe resume\"),r.resume()),e},j.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;o0,!1!==n.flowing&&this.resume()):\"readable\"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,h(\"on readable\",n.length,n.reading),n.length?F(this):n.reading||o.nextTick(W,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return\"readable\"===e&&o.nextTick(H,this),r},j.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==e&&void 0!==e||o.nextTick(H,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(h(\"resume\"),e.flowing=!e.readableListening,q(this,e)),e.paused=!1,this},j.prototype.pause=function(){return h(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(h(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on(\"end\",(function(){if(h(\"wrapped end\"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on(\"data\",(function(i){h(\"wrapped data\"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!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 o=0;o0,(function(e){n||(n=e),e&&a.forEach(l),o||(a.forEach(l),i(n))}))}));return t.reduce(f)}},{\"../../../errors\":\"Yj9o\",\"./end-of-stream\":\"mrEY\"}],tzeh:[function(e,t,r){(r=t.exports=e(\"./lib/_stream_readable.js\")).Stream=r,r.Readable=r,r.Writable=e(\"./lib/_stream_writable.js\"),r.Duplex=e(\"./lib/_stream_duplex.js\"),r.Transform=e(\"./lib/_stream_transform.js\"),r.PassThrough=e(\"./lib/_stream_passthrough.js\"),r.finished=e(\"./lib/internal/streams/end-of-stream.js\"),r.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,r){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,r){\"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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],gfUn:[function(e,t,r){e(\"process\");var n=e(\"process\"),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case\"%s\":return String(n[r++]);case\"%d\":return Number(n[r++]);case\"%j\":try{return JSON.stringify(n[r++])}catch(e){return\"[Circular]\"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?\"\u001b[\"+u.colors[r][0]+\"m\"+e+\"\u001b[\"+u.colors[r][1]+\"m\":e}function f(e,t){return e}function c(e,t,n){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return m(i)||(i=c(e,i,n)),i}var o=h(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),S(t)&&(a.indexOf(\"message\")>=0||a.indexOf(\"description\")>=0))return d(t);if(0===a.length){if(O(t)){var u=t.name?\": \"+t.name:\"\";return e.stylize(\"[Function\"+u+\"]\",\"special\")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),\"regexp\");if(x(t))return e.stylize(Date.prototype.toString.call(t),\"date\");if(S(t))return d(t)}var l,f=\"\",y=!1,v=[\"{\",\"}\"];return b(t)&&(y=!0,v=[\"[\",\"]\"]),O(t)&&(f=\" [Function\"+(t.name?\": \"+t.name:\"\")+\"]\"),_(t)&&(f=\" \"+RegExp.prototype.toString.call(t)),x(t)&&(f=\" \"+Date.prototype.toUTCString.call(t)),S(t)&&(f=\" \"+d(t)),0!==a.length||y&&0!=t.length?n<0?_(t)?e.stylize(RegExp.prototype.toString.call(t),\"regexp\"):e.stylize(\"[Object]\",\"special\"):(e.seen.push(t),l=y?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60?r[0]+(\"\"===t?\"\":t+\"\\n \")+\" \"+e.join(\",\\n \")+\" \"+r[1]:r[0]+t+\" \"+e.join(\", \")+\" \"+r[1]}(l,f,v)):v[0]+f+v[1]}function h(e,t){if(w(t))return e.stylize(\"undefined\",\"undefined\");if(m(t)){var r=\"'\"+JSON.stringify(t).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return e.stylize(r,\"string\")}return g(t)?e.stylize(\"\"+t,\"number\"):y(t)?e.stylize(\"\"+t,\"boolean\"):v(t)?e.stylize(\"null\",\"null\"):void 0}function d(e){return\"[\"+Error.prototype.toString.call(e)+\"]\"}function p(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize(\"[Getter/Setter]\",\"special\"):e.stylize(\"[Getter]\",\"special\"):u.set&&(s=e.stylize(\"[Setter]\",\"special\")),j(n,i)||(a=\"[\"+i+\"]\"),s||(e.seen.indexOf(u.value)<0?(s=v(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf(\"\\n\")>-1&&(s=o?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\")),w(a)){if(o&&i.match(/^\\d+$/))return s;(a=JSON.stringify(\"\"+i)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,\"name\")):(a=a.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),a=e.stylize(a,\"string\"))}return a+\": \"+s}function b(e){return Array.isArray(e)}function y(e){return\"boolean\"==typeof e}function v(e){return null===e}function g(e){return\"number\"==typeof e}function m(e){return\"string\"==typeof e}function w(e){return void 0===e}function _(e){return k(e)&&\"[object RegExp]\"===T(e)}function k(e){return\"object\"==typeof e&&null!==e}function x(e){return k(e)&&\"[object Date]\"===T(e)}function S(e){return k(e)&&(\"[object Error]\"===T(e)||e instanceof Error)}function O(e){return\"function\"==typeof e}function T(e){return Object.prototype.toString.call(e)}function E(e){return e<10?\"0\"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(w(a)&&(a=\"\"),e=e.toUpperCase(),!s[e])if(new RegExp(\"\\\\b\"+e+\"\\\\b\",\"i\").test(a)){var t=n.pid;s[e]=function(){var n=r.format.apply(r,arguments);console.error(\"%s %d: %s\",e,t,n)}}else s[e]=function(){};return s[e]},r.inspect=u,u.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]},u.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},r.isArray=b,r.isBoolean=y,r.isNull=v,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=m,r.isSymbol=function(e){return\"symbol\"==typeof e},r.isUndefined=w,r.isRegExp=_,r.isObject=k,r.isDate=x,r.isError=S,r.isFunction=O,r.isPrimitive=function(e){return null===e||\"boolean\"==typeof e||\"number\"==typeof e||\"string\"==typeof e||\"symbol\"==typeof e||void 0===e},r.isBuffer=e(\"./support/isBuffer\");var C=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];function P(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(\":\");return[e.getDate(),C[e.getMonth()],t].join(\" \")}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log(\"%s - %s\",P(),r.format.apply(r,arguments))},r.inherits=e(\"inherits\"),r._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R=\"undefined\"!=typeof Symbol?Symbol(\"util.promisify.custom\"):void 0;function M(e,t){if(!e){var r=new Error(\"Promise was rejected with a falsy value\");r.reason=e,e=r}return t(e)}r.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,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o\".charCodeAt(0),a=\"-\".charCodeAt(0),s=\"/\".charCodeAt(0),u=\"!\".charCodeAt(0),l=\"'\".charCodeAt(0),f='\"'.charCodeAt(0);function c(){for(var t=[];e[r];)if(e.charCodeAt(r)==i){if(e.charCodeAt(r+1)===s)return(r=e.indexOf(\">\",r))+1&&(r+=1),t;if(e.charCodeAt(r+1)===u){if(e.charCodeAt(r+2)==a){for(;-1!==r&&(e.charCodeAt(r)!==o||e.charCodeAt(r-1)!=a||e.charCodeAt(r-2)!=a||-1==r);)r=e.indexOf(\">\",r+1);-1===r&&(r=e.length)}else for(r+=2;e.charCodeAt(r)!==o&&e[r];)r++;r++;continue}var n=b();t.push(n)}else{var l=h();l.trim().length>0&&t.push(l),r++}return t}function h(){var t=r;return-2==(r=e.indexOf(\"<\",r)-1)&&(r=e.length),e.slice(t,r+1)}function d(){for(var t=r;-1===\"\\n\\t>/= \".indexOf(e[r])&&e[r];)r++;return e.slice(t,r)}var p=t.noChildNodes||[\"img\",\"br\",\"input\",\"meta\",\"link\"];function b(){r++;const t=d(),n={};let i=[];for(;e.charCodeAt(r)!==o&&e[r];){var a=e.charCodeAt(r);if(a>64&&a<91||a>96&&a<123){for(var u=d(),h=e.charCodeAt(r);h&&h!==l&&h!==f&&!(h>64&&h<91||h>96&&h<123)&&h!==o;)r++,h=e.charCodeAt(r);if(h===l||h===f){var b=y();if(-1===r)return{tagName:t,attributes:n,children:i}}else b=null,r--;n[u]=b}r++}if(e.charCodeAt(r-1)!==s)if(\"script\"==t){var v=r+1;r=e.indexOf(\"<\\/script>\",r),i=[e.slice(v,r-1)],r+=9}else\"style\"==t?(v=r+1,r=e.indexOf(\"\",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\");\r\n//# sourceMappingURL=/sm/6b05ec3e6aee27214397dcd933f0a1a0def04511045c0ced378787b04765ef87.map\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/geotiff/geotiff.js?"); /***/ }), @@ -2280,7 +2280,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _loa /***/ (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 (parameters === undefined) parameters = {};\n\n if (id && this.spriteMaterials.hasOwnProperty(id + \"_\" + JSON.stringify(parameters)) && forceNewMaterial !== true) {\n return this.spriteMaterials[id + \"_\" + JSON.stringify(parameters)];\n } else {\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 * Math.ceil(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 texture.anisotropy = 0;\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.wrapT = three__WEBPACK_IMPORTED_MODULE_0__[\"ClampToEdgeWrapping\"];\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 + \"_\" + JSON.stringify(parameters)] = 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?"); +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, options, forceNewMaterial) {\n if (options === void 0) {\n options = {};\n }\n\n var sprite = new three__WEBPACK_IMPORTED_MODULE_0__[\"Sprite\"](Sprites.makeMarkerMaterial(parameters, id, options, 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, options, forceNewMaterial) {\n if (parameters === undefined) parameters = {};\n\n if (id && this.spriteMaterials.hasOwnProperty(id + \"_\" + JSON.stringify(parameters)) && forceNewMaterial !== true) {\n return this.spriteMaterials[id + \"_\" + JSON.stringify(parameters)];\n } else {\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 ctx = canvas.getContext('2d');\n ctx.lineWidth = strokeWeight * Math.ceil(radius / 8);\n\n if (options.annotation === true) {\n var text = options.name || '';\n var fontXOffset = 8;\n var fontSize = parameters.fontSize || '16px';\n fontSize = parseInt(fontSize.replace('px', '')) * 1.1;\n ctx.font = fontSize + \"pt sans-serif\";\n var heightInnerOverflow = 10;\n var heightOuterOverflow = fontSize / 3.5;\n var textSize = {\n width: ctx.measureText(text).width + fontXOffset * 2,\n height: fontSize + heightInnerOverflow + heightOuterOverflow\n };\n canvas.width = textSize.width;\n canvas.height = textSize.height;\n parameters.width = canvas.width / 6;\n parameters.height = canvas.height / 6;\n ctx.font = fontSize + \"pt sans-serif\";\n var canvasX = 0;\n ctx.fillStyle = strokeColor;\n ctx.fillRect(0, heightOuterOverflow / 2, textSize.width, textSize.height - heightOuterOverflow);\n ctx.fillStyle = fillColor;\n ctx.fillText(text, canvasX + fontXOffset, fontSize + heightOuterOverflow / 2 + heightInnerOverflow / 2);\n } else {\n var width = radius * 2;\n var height = radius * 2;\n canvas.width = width;\n canvas.height = height;\n ctx.beginPath();\n ctx.arc(canvas.width / 2, canvas.height / 2, radius - strokeWeight * (radius / 12), 0, 2 * Math.PI, false);\n\n if (typeof fillColor === 'object') {\n ctx.fillStyle = 'rgba(' + fillColor.r + ',' + fillColor.g + ',' + fillColor.b + ',' + fillColor.a + ')';\n } else {\n ctx.fillStyle = fillColor;\n }\n\n ctx.fill();\n\n if (typeof strokeColor === 'object') {\n ctx.strokeStyle = 'rgba(' + strokeColor.r + ',' + strokeColor.g + ',' + strokeColor.b + ',' + strokeColor.a + ')';\n } else {\n ctx.strokeStyle = strokeColor;\n }\n\n ctx.stroke();\n }\n\n var texture = new three__WEBPACK_IMPORTED_MODULE_0__[\"Texture\"](canvas);\n texture.needsUpdate = true;\n texture.anisotropy = 0;\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\n texture.wrapT = three__WEBPACK_IMPORTED_MODULE_0__[\"ClampToEdgeWrapping\"];\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 + \"_\" + JSON.stringify(parameters)] = spriteMaterial;\n }\n\n return spriteMaterial;\n }\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Sprites);\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/sprites.ts?"); /***/ }), @@ -2292,7 +2292,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var thre /***/ (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 isInExtentEN: function (xyz, bb, proj, margin) {\n if (margin === void 0) {\n margin = 0.0000001;\n }\n\n if (!bb) return true;\n var minE = bb[0],\n minN = bb[1],\n maxE = bb[2],\n maxN = bb[3];\n\n var _a = proj.tileXYZ2NwSe(xyz, proj.trueTileResolution, true),\n min = _a.min,\n max = _a.max;\n\n return max.x > minE + margin && min.x < maxE - margin && max.y > minN + margin && min.y < maxN - margin;\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?"); +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 isInExtentEN: function (xyz, bb, proj, margin) {\n if (margin === void 0) {\n margin = 0.0000001;\n }\n\n if (!bb) return true;\n var minE = bb[0],\n minN = bb[1],\n maxE = bb[2],\n maxN = bb[3];\n\n var _a = proj.tileXYZ2NwSe(xyz, proj.trueTileResolution, true),\n min = _a.min,\n max = _a.max;\n\n return max.x > minE + margin && min.x < maxE - margin && max.y > minN + margin && min.y < maxN - margin;\n },\n isInZoomRange: function (minZoom, maxZoom, zoom) {\n if (minZoom != null || maxZoom != null) {\n minZoom = minZoom || 0;\n maxZoom = maxZoom || Infinity;\n if (zoom >= minZoom && zoom <= maxZoom) return true;else return false;\n }\n\n return true;\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?"); /***/ }), diff --git a/public/examples/demo.html b/public/examples/demo.html index 6868222..2165e7c 100644 --- a/public/examples/demo.html +++ b/public/examples/demo.html @@ -40,7 +40,7 @@ lat: -4.667975771815966, zoom: 16, }, - majorRadius: 3396190, + majorRadius: 33961900, loadingScreen: true, // default true customParsers: { All500: (tilePath, layerObj) => { diff --git a/public/examples/example.html b/public/examples/example.html index 2eadbe0..8554882 100644 --- a/public/examples/example.html +++ b/public/examples/example.html @@ -41,12 +41,20 @@ lat: -4.673226, zoom: 16, }, +<<<<<<< HEAD + /* +======= */ +>>>>>>> 90bbf33b0d5f6410ae5d18b3355fd7b41cf045f2 initialView: { lng: 137.3650974531451, lat: -4.71480304282526, zoom: 16, }, +<<<<<<< HEAD + */ +======= +>>>>>>> 90bbf33b0d5f6410ae5d18b3355fd7b41cf045f2 initialCamera: { position: { x: 274.50893509606396, @@ -165,9 +173,11 @@ ], noDataValue: 0, //opt (number) - no data dem value //unused }) - Litho.setLayerFilterEffect('HiRISE', 'blendCode', 1) + //Litho.setLayerFilterEffect('HiRISE', 'blendCode', 1) //Litho.options.radiusOfTiles = 10 + //Litho.orderLayers(['Aeolis', 'HiRISE']) + Litho.addLayer('tile3d', { name: '3dTileExample', order: 3, @@ -295,7 +305,84 @@ } ) - /* + Litho.addLayer( + 'clamped', + { + name: 'ClampedAnnotation', + on: true, + geojson: { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + geometry: { + type: 'Point', + coordinates: [137.358048, -4.673226], + }, + properties: { + annotation: true, + name: 'Sample Text', + style: { + color: 'rgb(0, 0, 0)', + fillColor: 'rgb(255, 255, 255)', + fillOpacity: 1, + weight: 2, + fontSize: '54px', + rotation: 0, + minZoom: 15, + maxZoom: 16, + }, + }, + }, + ], + }, + opacity: 1, + style: { + // Prefer feature[f].properties.style values + letPropertiesStyleOverride: true, + }, + }, + ) + + Litho.addLayer( + 'vector', + { + name: 'vectorAnnotation', + on: true, + geojson: { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + geometry: { + type: 'Point', + coordinates: [137.348048, -4.673226], + }, + properties: { + annotation: true, + name: 'Sample Sprite Text', + style: { + color: 'rgb(40, 20, 20)', + fillColor: 'rgb(0, 255, 255)', + fillOpacity: 1, + weight: 2, + fontSize: '18px', + elevOffset: 100, + minZoom: 12, + maxZoom: 14, + }, + }, + }, + ], + }, + opacity: 1, + style: { + // Prefer feature[f].properties.style values + letPropertiesStyleOverride: true, + }, + }, + ) + Litho.addLayer('clamped', { name: 'clampedCCam', order: 5, @@ -312,6 +399,8 @@ color: 'black', weight: 2, radius: 4, + minZoom: 14, + maxZoom: 16 }, point: {}, line: {}, @@ -321,8 +410,6 @@ }, }, opacity: 1, - minZoom: 11, - maxZoom: 18, boundingBox: [ 137.3250006349, -4.72500217818315, @@ -332,7 +419,6 @@ //preDrawn?: boolean //override all clamped tiles with pre drawn tiles //data?: { {z}: { {x}: { {y}: { pre_drawn_tile_canvas_data } }}} if preDrawn, use these tiles. }) - */ Litho.addLayer('clamped', { name: 'clampedPoly', @@ -391,8 +477,6 @@ }, }, opacity: 1, - minZoom: 11, - maxZoom: 18, boundingBox: [ 137.3250006349, -4.72500217818315, @@ -403,6 +487,51 @@ //data?: { {z}: { {x}: { {y}: { pre_drawn_tile_canvas_data } }}} if preDrawn, use these tiles. }) + Litho.addLayer('clamped', { + name: 'clampedTraverse', + order: [ + 'styledFeatures', + 'clampedTraverse', + 'clampedPoly', + 'clampedWaypoints', + 'clampedCCam', + ], + on: true, + // GeoJSON or path to geojson + geojsonPath: + ' https://miplmmgis.jpl.nasa.gov/Missions/MSL/Layers/Traverse/MSL_traverse3D_sol1508.json', + style: { + default: { + color: 'white', + weight: 5, + }, + }, + opacity: 1, + boundingBox: [ + 137.3250006349, + -4.72500217818315, + 137.42500036372522, + -4.62500251269999, + ], + //preDrawn?: boolean //override all clamped tiles with pre drawn tiles + //data?: { {z}: { {x}: { {y}: { pre_drawn_tile_canvas_data } }}} if preDrawn, use these tiles. + }) + + /* + setTimeout(() => { + // Reverse the order of our layers + Litho.orderLayers([ + 'styledFeatures', + 'clampedTraverse', + 'clampedPoly', + 'clampedWaypoints', + 'clampedCCam', + //'Aeolis', + //'HiRISE', + ]) + }, 15000) + */ + Litho.addLayer('vector', { name: 'vectorLine', order: 1, diff --git a/public/examples/juno_test.html b/public/examples/juno_test.html new file mode 100644 index 0000000..12f48e8 --- /dev/null +++ b/public/examples/juno_test.html @@ -0,0 +1,89 @@ + + + + + + LithoSphere Demo + + + + + +
+ + + + diff --git a/public/index.html b/public/index.html index d199db4..1c443c3 100644 --- a/public/index.html +++ b/public/index.html @@ -161,6 +161,14 @@
Possible Issues
+
+ junoTest +
Testing large planetary radii.
+
+
Sample Data Not Provided
+
Test
+
+
diff --git a/src/core/cameras.ts b/src/core/cameras.ts index 5084a3a..6675389 100644 --- a/src/core/cameras.ts +++ b/src/core/cameras.ts @@ -59,7 +59,7 @@ export default class Camera { camera: null, controls: null, near: 0.1, - far: 15000000000, + far: 150000000000, } this.firstPerson = { camera: null, @@ -92,7 +92,7 @@ export default class Camera { ) // Maybe fix: This upside down camera is a bug that works. this.orbit.camera.up = new Vector3(0, -1, 0) - this.orbit.camera.position.set(0, -10000000 / projection.radiusScale, 0) + this.orbit.camera.position.set(0, -10000000 * projection.radiusScale, 0) // Orbit Controls this.orbit.controls = new OrbitControls( @@ -124,7 +124,7 @@ export default class Camera { this.firstPerson.controls.getObject().rotation.set(Math.PI, Math.PI, 0) this.firstPerson.controls .getObject() - .position.set(0, 10000000 / projection.radiusScale, 0) + .position.set(0, 10000000 * projection.radiusScale, 0) scene.add(this.firstPerson.controls.getObject()) if (this.isFirstPerson) { @@ -345,13 +345,13 @@ export default class Camera { this.firstPerson.camera.updateProjectionMatrix() } - setNearFarPlane = (farther, near, far, keepNear): void => { + setNearFarPlane = (scalar = 1, farther, near, far, keepNear): void => { if (keepNear === true) this._.keepNear = true if (keepNear === false) this._.keepNear = false if (farther) { if (!this._.keepNear) - this.orbit.camera.near = this.orbit.near * 10000 + this.orbit.camera.near = (this.orbit.near * 10000) / scalar //Cameras.orbit.camera.far = Cameras.orbit.far / 100 } else { if (!this._.keepNear) this.orbit.camera.near = this.orbit.near diff --git a/src/core/events.ts b/src/core/events.ts index d52af21..133e6f5 100644 --- a/src/core/events.ts +++ b/src/core/events.ts @@ -7,6 +7,7 @@ import Utils from '../utils' interface Private { mouseXY: { x: number; y: number } prevMouseXY: { x: number; y: number } + oldPrevMouseXY: { x: number; y: number } containerXY: { x: number; y: number } lastZoomDelta: number desiredZoom: number @@ -17,6 +18,8 @@ interface Private { // Frames to wait between zoomend and zoom tile generation zoomWait: number highlightTimeout: any + rotationDampingInterval: any + panned: boolean } export default class Events { @@ -36,12 +39,15 @@ export default class Events { this._ = { mouseXY: { x: null, y: null }, prevMouseXY: { x: null, y: null }, + oldPrevMouseXY: { x: null, y: null }, containerXY: { x: null, y: null }, lastZoomDelta: 1, desiredZoom: null, zoomedSince: 0, zoomWait: 30, highlightTimeout: null, + rotationDampingInterval: null, + panned: false, } this._init() @@ -104,11 +110,14 @@ export default class Events { //window.addEventListener('resize', updateGlobeCenterPos, false) } - _rotateGlobe = (e: any, prevXY?): void => { + _rotateGlobe = (e: any, prevXY?, fromDamping?: boolean): void => { if (prevXY) { this._.prevMouseXY.x = prevXY.x this._.prevMouseXY.y = prevXY.y + } else if (!fromDamping) { + this._.panned = true } + if (!e) return if (!e.pageX && e.touches) e.pageX = Utils.arrayAverage(e.touches, 'pageX') @@ -130,7 +139,7 @@ export default class Events { const rotSpeed = Utils.getRadiansPerPixel(this.p.trueZoom) * 0.5 * - (this.p._.marsRadius / this.p.projection.radii.major) + (3396190 / this.p.projection.radii.major) let pixelDif = 0 //Find vectors perpendicular to Cameras.camera forward vector @@ -172,6 +181,10 @@ export default class Events { this._rotateAroundArbAxis(cpY, rotSpeed * pixelDif) } + //Update oldPrevMouseXY + this._.oldPrevMouseXY.x = this._.prevMouseXY.x + this._.oldPrevMouseXY.y = this._.prevMouseXY.y + //Update prevMouseXY this._.prevMouseXY.x = e.pageX this._.prevMouseXY.y = e.pageY @@ -210,6 +223,7 @@ export default class Events { } private _rotateGlobe_MouseDown = (e): void => { + clearInterval(this._.rotationDampingInterval) //if (e.which === 3 || e.button === 2) { //Right click if (e.which === 1 || e.button === 0) { //Left click @@ -271,13 +285,43 @@ export default class Events { 'touchend', this._rotateGlobe_MouseUp ) + + if (this._.panned) { + // Basic damping + clearInterval(this._.rotationDampingInterval) + const dif = { + x: this._.oldPrevMouseXY.x - this._.prevMouseXY.x, + y: this._.oldPrevMouseXY.y - this._.prevMouseXY.y, + } + let difs = [] + while (dif.x > 2 || dif.x < -2 || dif.y > 2 || dif.y < -2) { + const xSize = dif.x / 3 + const ySize = dif.y / 3 + dif.x -= xSize + dif.y -= ySize + difs.push({ + x: dif.x, + y: dif.y, + }) + } + difs.reverse() + this._.rotationDampingInterval = setInterval(() => { + if (difs.length > 0) + this._rotateGlobe({ pageX: 0, pageY: 0 }, difs.pop(), true) + else clearInterval(this._.rotationDampingInterval) + }, 50) + } + this._.panned = false } //This sets the zoom to the desired zoom if zoomedSince is high enough _checkDesiredZoom(): void { this._.zoomedSince++ if (this._.desiredZoom != null) { - this.p._.cameras.setNearFarPlane(this._.desiredZoom < 14) + this.p._.cameras.setNearFarPlane( + this.p.projection.radiusScale, + this._.desiredZoom < 14 + ) if (this._.zoomedSince > this._.zoomWait) { if (this._.desiredZoom >= this.p._.minNativeZoom) this._setZoom(this._.desiredZoom) @@ -313,12 +357,20 @@ export default class Events { //Calculate what the zoom should be //Inverse of ( 4000 / Math.pow( 2, Globe_.zoom + 1) ) //4000/ 2^(z+1) // (thanks wolfram alpha inverse function calculator) - const nf = 8 - (this.p.projection.radiusScale.toString().length - 1) + + const nf = + 8 - (parseInt(this.p.projection.radiusScale).toString().length - 1) + let rf = + Math.max(parseInt(this.p.planetCenter.y).toString().length - 7, 0) + + (this.p.options.zoomLevelShift || 0) + // Hacky way since zoom per radius functions aren't perfect + if (Math.abs(this.p.planetCenter.y) > 30000000) rf += 1 + const dZoom = Math.ceil( (nf * Math.log(2) - Math.log(zoomDist / Math.pow(5, nf - 1))) / Math.log(2) - ) + 1 + ) + rf this._.desiredZoom = dZoom @@ -598,9 +650,8 @@ export default class Events { //Find the elevation //Just distance to intersection from center of planet then rescaled then - radius intersectedLL.height = - savedIntersectionPoint.length() * - this.p.projection.radiusScale - - this.p.projection.radii.major + (savedIntersectionPoint.length() - this.p.planet.position.y) / + this.p.projection.radiusScale this._updateMouseCoords( intersectedLL.lng, @@ -871,6 +922,41 @@ export default class Events { this.activeFeature = null } + _setMissingElevation(mesh) { + // @ts-ignore + if (mesh.noElevation != null) { + const height = + this.p.getElevationAtLngLat( + mesh.noElevation.lng, + mesh.noElevation.lat + ) || false + + if (height) { + const v = this.p.projection.lonLatToVector3( + mesh.noElevation.lng, + mesh.noElevation.lat, + (height || 0) + + (mesh.noElevation.elevOffset || 0) * + this.p.options.exaggeration + ) + + mesh.position.set(v.x, v.y, v.z) + // @ts-ignore + delete mesh.noElevation + } + } + + if ( + Utils.isInZoomRange( + mesh.style?.minZoom, + mesh.style?.maxZoom, + this.p.zoom + ) + ) + mesh.visible = true + else mesh.visible = false + } + // Changes certain vector sizes based on distance to camera _attenuate() { const zoomDist = this.p._.cameras.camera.position.distanceTo( @@ -886,12 +972,18 @@ export default class Events { if (mesh instanceof Sprite) { mesh.scale.set( // @ts-ignore - attenuationFactor * mesh.style.radius, + attenuationFactor * + // @ts-ignore + (mesh.style.width || mesh.style.radius), // @ts-ignore - attenuationFactor * mesh.style.radius, + attenuationFactor * + // @ts-ignore + (mesh.style.height || mesh.style.radius), // @ts-ignore attenuationFactor * mesh.style.radius ) + + this._setMissingElevation(mesh) } }) } @@ -905,24 +997,36 @@ export default class Events { if (mesh instanceof Sprite) { mesh.scale.set( // @ts-ignore - attenuationFactor * mesh.style.radius, + attenuationFactor * + // @ts-ignore + (mesh.style.width || mesh.style.radius), // @ts-ignore - attenuationFactor * mesh.style.radius, + attenuationFactor * + // @ts-ignore + (mesh.style.height || mesh.style.radius), // @ts-ignore attenuationFactor * mesh.style.radius ) + + this._setMissingElevation(mesh) } }) } else { if (child instanceof Sprite) { child.scale.set( // @ts-ignore - attenuationFactor * mesh.style.radius, + attenuationFactor * + // @ts-ignore + (mesh.style.width || mesh.style.radius), // @ts-ignore - attenuationFactor * mesh.style.radius, + attenuationFactor * + // @ts-ignore + (mesh.style.height || mesh.style.radius), // @ts-ignore attenuationFactor * mesh.style.radius ) + + this._setMissingElevation(child) } } }) diff --git a/src/core/projection.ts b/src/core/projection.ts index dbb84c7..f47e55e 100644 --- a/src/core/projection.ts +++ b/src/core/projection.ts @@ -17,6 +17,7 @@ enum RadiusE { export default class Projection { _: Private baseRadius: number + radiusCutoff: number radiusScale: number radii: Radii tileMapResource: TileMapResource @@ -31,8 +32,13 @@ export default class Projection { majorRadius?: number, minorRadius?: number, tileMapResource?: TileMapResource, - trueTileResolution?: number + trueTileResolution?: number, + radiusCutoff?: number ) { + // Experimental: Some radii are too big and we need to scale everything down to support them, + // this is that cutoff in m + this.radiusCutoff = radiusCutoff || Infinity + this._reset() this.setRadius(majorRadius, RadiusE.Major) @@ -72,17 +78,35 @@ export default class Projection { ? `EPSG:${tmr.epsg}` : tmr.crsCode, tmr.proj, - { - // @ts-ignore - origin: [parseFloat(tmr.origin[0]), parseFloat(tmr.origin[1])], - resolutions: this.res, - bounds: [ - // @ts-ignore - [parseFloat(tmr.bounds[0]), parseFloat(tmr.bounds[1])], - // @ts-ignore - [parseFloat(tmr.bounds[2]), parseFloat(tmr.bounds[3])], - ], - }, + tmr.origin != null + ? { + origin: [ + // @ts-ignore + parseFloat(tmr.origin[0]), + // @ts-ignore + parseFloat(tmr.origin[1]), + ], + resolutions: this.res, + bounds: [ + [ + // @ts-ignore + parseFloat(tmr.bounds[0]), + // @ts-ignore + parseFloat(tmr.bounds[1]), + ], + [ + // @ts-ignore + parseFloat(tmr.bounds[2]), + // @ts-ignore + parseFloat(tmr.bounds[3]), + ], + ], + } + : { + origin: [0, 0], + resolutions: this.res, + bounds: [0, 0, 0, 0], + }, // @ts-ignore parseFloat(this.radii.major) ) @@ -110,9 +134,11 @@ export default class Projection { } setRadius = (radius: number, which: RadiusE = RadiusE.Major): void => { - if (which.toLowerCase() == 'major') + if (which.toLowerCase() == 'major') { this.radii.major = radius || this.baseRadius - else if (which.toLowerCase() == 'minor') + if (this.radii.major > this.radiusCutoff) + this.radiusScale = this.radii.major / this.radiusCutoff + } else if (which.toLowerCase() == 'minor') this.radii.minor = radius || this.radii.major || this.baseRadius } @@ -289,16 +315,11 @@ export default class Projection { const phi = lat * (Math.PI / 180) const theta = (lon - 180) * (Math.PI / 180) - const x = - ((this.radii.major + height) / this.radiusScale) * - Math.cos(phi) * - Math.sin(theta) - const y = - (-(this.radii.major + height) / this.radiusScale) * Math.sin(phi) - const z = - (-(this.radii.major + height) / this.radiusScale) * - Math.cos(phi) * - Math.cos(theta) + const h = this.radii.major / this.radiusScale + height + + const x = h * Math.cos(phi) * Math.sin(theta) + const y = -h * Math.sin(phi) + const z = -h * Math.cos(phi) * Math.cos(theta) return { x: x, y: y, z: z } } diff --git a/src/generalTypes.d.ts b/src/generalTypes.d.ts index 74f91a1..cfd4128 100644 --- a/src/generalTypes.d.ts +++ b/src/generalTypes.d.ts @@ -92,6 +92,8 @@ export interface Options { loadingScreen?: boolean majorRadius?: number minorRadius?: number + radiusCutoff?: number + zoomLevelShift?: number // Specifies map projection tileMapResource?: TileMapResource customParsers?: any diff --git a/src/layers/clamped.ts b/src/layers/clamped.ts index f66ca24..a257b9a 100644 --- a/src/layers/clamped.ts +++ b/src/layers/clamped.ts @@ -47,10 +47,8 @@ export default class ClampedLayerer { layerObj.hasOwnProperty('name') && layerObj.hasOwnProperty('on') && ((layerObj.preDrawn === true && layerObj.hasOwnProperty('data')) || - ((layerObj.hasOwnProperty('geojsonPath') || - layerObj.hasOwnProperty('geojson')) && - layerObj.hasOwnProperty('minZoom') && - layerObj.hasOwnProperty('maxZoom'))) + layerObj.hasOwnProperty('geojsonPath') || + layerObj.hasOwnProperty('geojson')) ) { if ( layerObj.hasOwnProperty('geojsonPath') && @@ -102,6 +100,27 @@ export default class ClampedLayerer { return false } + orderLayers = (ordering: string[]): boolean => { + let missingCount = 0 + + // remember that a higher number for order means it's on top + this.p.clamped.forEach((layer) => { + const newOrder = ordering.indexOf(layer.name) + if (newOrder >= 0) { + layer.order = this.p.clamped.length - newOrder + } else { + // Place layers missing from the ordering array after + layer.order = + this.p.clamped.length - ordering.length - missingCount + missingCount++ + } + }) + + this.p.clamped.sort((a, b) => a.order - b.order) + + return true + } + setOpacity = (name: string, opacity: number): boolean => { if (!this.p.p._.wasInitialized) return false @@ -194,6 +213,16 @@ export default class ClampedLayerer { for (const f of c.geojson.features) { const style = this.p.getFeatureStyle(c, f) + // Skip feature if outside zoom range + if ( + !Utils.isInZoomRange( + style.minZoom != null ? style.minZoom : c.minZoom, + style.maxZoom != null ? style.maxZoom : c.maxZoom, + this.p.p.zoom + ) + ) + continue + let doesFeatureOverlapTile = false if ( style.fillColor.substring(0, 3).toLowerCase() != 'rgb' @@ -457,45 +486,75 @@ export default class ClampedLayerer { // @ts-ignore const canvasY = parseInt((tileXYZ.y - xyz.y) * canvas.height) - // Bearing is a triangle indicating direction - if (c.style?.bearing) { - const unit = c.style.bearing.angleUnit || 'deg' - const bearingProp = - c.style.bearing.angleProp || false - - let yaw = 0 - if (bearingProp !== false) { - yaw = parseFloat( - Utils.getIn(f.properties, bearingProp, 0) - ) - if (unit === 'deg') { - yaw = yaw * (Math.PI / 180) - } + // If Annotation + if (f.properties.annotation === true) { + let text = f.properties.name || '' + const fontXOffset = 10 + let fontSize = style.fontSize || '16px' + fontSize = + parseInt(fontSize.replace('px', '')) * 1.2 + ctx.font = `${fontSize}pt sans-serif` + const heightOverflow = 2 + const textSize = { + width: + ctx.measureText(text).width + + fontXOffset * 2, + height: fontSize + heightOverflow, } - yaw += Math.PI - - const startingPoint = Utils.rotatePoint( - { - x: canvasX, - y: - canvasY + - style.radius + - ctx.lineWidth - - 2, - }, - [canvasX, canvasY], - yaw - 45 * (Math.PI / 180) + + const rotAngle = + (-(style.rotation || 0) * Math.PI) / 180 + ctx.translate(canvasX, canvasY) + ctx.rotate(rotAngle) + ctx.translate(-canvasX, -canvasY) + + // Background rect + ctx.fillStyle = style.color + ctx.fillRect( + canvasX, + canvasY - textSize.height + heightOverflow / 2, + textSize.width, + textSize.height ) - const indicator = [ - Utils.rotatePoint( - { - x: canvasX, - y: canvasY + style.radius * 2, - }, - [canvasX, canvasY], - yaw - ), - Utils.rotatePoint( + + // Text + ctx.fillStyle = style.fillColor + ctx.fillText(text, canvasX + fontXOffset, canvasY) + + // Anchor Indicator + const anchorRadius = 6 + ctx.lineWidth = anchorRadius + ctx.beginPath() + ctx.arc(canvasX, canvasY, 8, 0, 2 * Math.PI, false) + ctx.fill() + ctx.stroke() + + ctx.translate(canvasX, canvasY) + ctx.rotate(-rotAngle) + ctx.translate(-canvasX, -canvasY) + } else { + // Bearing is a triangle indicating direction + if (c.style?.bearing) { + const unit = c.style.bearing.angleUnit || 'deg' + const bearingProp = + c.style.bearing.angleProp || false + + let yaw = 0 + if (bearingProp !== false) { + yaw = parseFloat( + Utils.getIn( + f.properties, + bearingProp, + 0 + ) + ) + if (unit === 'deg') { + yaw = yaw * (Math.PI / 180) + } + } + yaw += Math.PI + + const startingPoint = Utils.rotatePoint( { x: canvasX, y: @@ -505,39 +564,61 @@ export default class ClampedLayerer { 2, }, [canvasX, canvasY], - yaw + 45 * (Math.PI / 180) - ), - startingPoint, - ] + yaw - 45 * (Math.PI / 180) + ) + const indicator = [ + Utils.rotatePoint( + { + x: canvasX, + y: canvasY + style.radius * 2, + }, + [canvasX, canvasY], + yaw + ), + Utils.rotatePoint( + { + x: canvasX, + y: + canvasY + + style.radius + + ctx.lineWidth - + 2, + }, + [canvasX, canvasY], + yaw + 45 * (Math.PI / 180) + ), + startingPoint, + ] + + ctx.fillStyle = c.style.bearing.color || 'red' + ctx.lineWidth = (1 / scaleFactor) * 1 + + ctx.beginPath() + ctx.moveTo(startingPoint.x, startingPoint.y) + indicator.forEach((ind) => { + ctx.lineTo(ind.x, ind.y) + }) + ctx.closePath() + ctx.fill() + ctx.stroke() - ctx.fillStyle = c.style.bearing.color || 'red' - ctx.lineWidth = (1 / scaleFactor) * 1 + ctx.fillStyle = style.fillColor + ctx.lineWidth = + style.weight * ((1 / scaleFactor) * 1) + } ctx.beginPath() - ctx.moveTo(startingPoint.x, startingPoint.y) - indicator.forEach((ind) => { - ctx.lineTo(ind.x, ind.y) - }) - ctx.closePath() + ctx.arc( + canvasX, + canvasY, + style.radius, + 0, + 2 * Math.PI, + false + ) ctx.fill() ctx.stroke() - - ctx.fillStyle = style.fillColor - ctx.lineWidth = - style.weight * ((1 / scaleFactor) * 1) } - - ctx.beginPath() - ctx.arc( - canvasX, - canvasY, - style.radius, - 0, - 2 * Math.PI, - false - ) - ctx.fill() - ctx.stroke() if ( canvasX >= 0 && canvasX < canvas.width && diff --git a/src/layers/index.ts b/src/layers/index.ts index 2e87f13..f1735de 100644 --- a/src/layers/index.ts +++ b/src/layers/index.ts @@ -22,7 +22,6 @@ export default class Layers { _: Private // parent p: any - baseStyle: any tile3d: any tile: any clamped: any @@ -33,13 +32,6 @@ export default class Layers { constructor(parent: any) { this.p = parent - this.baseStyle = { - fillColor: 'rgb(0,0,0)', - fillOpacity: 0.4, - color: 'rgb(255,255,255)', - weight: 2, - radius: 6, - } this._ = { layerers: { tile3d: new Tile3dLayerer(this), @@ -89,6 +81,15 @@ export default class Layers { layerObj._type = type + if (layerObj.order?.length != null) { + layerObj.order = this.getDesiredOrder( + layerObj.name, + type, + layerObj.order + ) + } + if (layerObj.order == null) layerObj.order = this.all[type].length + if (this._.layerers[type]) this._.layerers[type].add(layerObj, callback) else console.warn(`Cannot add unknown layer type ${type}.`) } @@ -122,6 +123,88 @@ export default class Layers { return true } + // Takes an array of layer names and does its best to order them + // Layer names that come first are on top of all later layers + // Ultimately only clamped and tile layers get ordered and clamped layers + // are always on top of tile layers + // Clamped and tile layers not listed go to the bottom + orderLayers = (ordering: string[]): boolean => { + const orderingTyped = {} + + ordering.forEach((name) => { + const layer = this.getLayerByName(name) + if (layer && layer._type) { + if (orderingTyped[layer._type] == null) + orderingTyped[layer._type] = [] + orderingTyped[layer._type].push(name) + } + }) + + let hit = false + for (const type in orderingTyped) { + if (typeof this._.layerers[type].orderLayers === 'function') { + this._.layerers[type].orderLayers(orderingTyped[type]) + hit = true + } + } + + // A more expensive option so make sure it's needed + if (hit) { + this.p._.tiledWorld.removeAllTiles() + } + + return true + } + + private getDesiredOrder = ( + name: string, + type: string, + ordering: string[] + ): number => { + const orderingTyped = {} + + ordering.forEach((layerName, idx) => { + const layer = this.getLayerByName(layerName) + if (layer && layer._type) { + if (orderingTyped[layer._type] == null) + orderingTyped[layer._type] = [] + orderingTyped[layer._type].push({ + name: layer.name, + order: layer.order, + index: idx, + }) + } + }) + + if (orderingTyped[type]) { + const index = ordering.indexOf(name) + let desiredOrder = 0 + for (let i = 0; i < orderingTyped[type].length; i++) { + if (index > orderingTyped[type][i].index) { + if (i == orderingTyped[type].length - 1) + desiredOrder = orderingTyped[type][i].index + 1 + else + desiredOrder = + (orderingTyped[type][i].order + + orderingTyped[type][i + 1].order) / + 2 + return desiredOrder + } + } + + // Then we have a lower index (higher order) than everything else + if (orderingTyped[type].length > 0) + return orderingTyped[type][0].order + 1 + } + + // Default to index position + if (ordering.includes(name)) + return ordering.length - ordering.indexOf(name) - 1 + + // Should never get here if functions are used properly + return 0 + } + setLayerOpacity = (name: string, opacity: number): boolean => { let foundMatch = false @@ -214,6 +297,20 @@ export default class Layers { return lowest } + getLayerByName = (layerName: string): any => { + for (const type in this.all) { + for (let i = 0; i < this.all[type].length; i++) { + if (this.all[type][i].name === layerName) + return this.all[type][i] + } + } + return null + } + + hasLayer = (layerName: string): boolean => { + return this.getLayerByName(layerName) != null + } + private getFeatureStyleProp = (value: any, feature: any) => { if (value != null && typeof value === 'string' && value.includes('=')) { let propValue = null @@ -228,27 +325,42 @@ export default class Layers { } } - getLayerByName = (layerName: string): any => { - for (const type in this.all) { - for (let i = 0; i < this.all[type].length; i++) { - if (this.all[type][i].name === layerName) - return this.all[type][i] - } + private getBaseStyle = ( + feature?: any, + type?: string, + geomType?: string + ) => { + const baseStyle: any = { + fillColor: 'rgb(0,0,0)', + fillOpacity: 0.4, + color: 'rgb(255,255,255)', + weight: 2, + radius: 6, } - return null - } - hasLayer = (layerName: string): boolean => { - return this.getLayerByName(layerName) != null + if (feature?.properties?.annotation === true) { + baseStyle.fontSize = '16px' + baseStyle.rotation = 0 + baseStyle.fillOpacity = 1 + } + if (type === 'vector' && geomType === 'point') { + baseStyle.elevOffset = 20 + } + if (type === 'vector' || type === 'clamped') { + baseStyle.minZoom = null + baseStyle.maxZoom = null + } + + return baseStyle } // Computes a feature's style given it layer styling configuration // Does fancy things like letting you set style from properties and by properties getFeatureStyle = (layer: any, feature: any, isStrokeless?: boolean) => { // Set as base - const style = JSON.parse(JSON.stringify(this.baseStyle)) + const geomType = feature.geometry.type.toLowerCase() + const style = this.getBaseStyle(feature, layer._type, geomType) if (layer.style) { - const geomType = feature.geometry.type.toLowerCase() for (const key in style) { // Set as default if (layer.style.default && layer.style.default[key] != null) { diff --git a/src/layers/tile.ts b/src/layers/tile.ts index 3b8ebff..a608de3 100644 --- a/src/layers/tile.ts +++ b/src/layers/tile.ts @@ -66,6 +66,27 @@ export default class TileLayerer { return false } + orderLayers = (ordering: string[]): boolean => { + let missingCount = 0 + + // remember that a higher number for order means it's on top + this.p.tile.forEach((layer) => { + const newOrder = ordering.indexOf(layer.name) + if (newOrder >= 0) { + layer.order = this.p.tile.length - newOrder + } else { + // Place layers missing from the ordering array after + layer.order = + this.p.tile.length - ordering.length - missingCount + missingCount++ + } + }) + + this.p.tile.sort((a, b) => a.order - b.order) + + return true + } + setOpacity = (name: string, opacity: number): boolean => { if (!this.p.p._.wasInitialized) return false diff --git a/src/layers/vector.ts b/src/layers/vector.ts index 6846ab7..ae7cd1d 100644 --- a/src/layers/vector.ts +++ b/src/layers/vector.ts @@ -15,17 +15,9 @@ import Sprites from '../secondary/sprites' export default class VectorLayerer { // parent p: any - baseStyle: any constructor(parent: any) { this.p = parent - this.baseStyle = { - fillColor: 'rgb(255,255,255)', - fillOpacity: 0.4, - color: 'rgb(0,0,0)', - weight: 2, - radius: 6, - } } add = (layerObj: any, callback?: Function): void => { @@ -203,9 +195,16 @@ export default class VectorLayerer { let g = feature.geometry.coordinates const style = this.p.getFeatureStyle(layerObj, feature) + const options: any = {} + if (feature?.properties?.annotation === true) { + options.annotation = true + options.name = feature?.properties?.name + } + const sprite = Sprites.makeMarkerSprite( style, layerObj.name, + options, forceNewMaterial ) let i0 = 0 @@ -215,11 +214,24 @@ export default class VectorLayerer { i1 = 0 } if (typeof g[0] == 'number') g = [g] + const height = + g[0][2] || + this.p.p.getElevationAtLngLat(g[0][i0], g[0][i1]) || + false const v = this.p.p.projection.lonLatToVector3( g[0][i0], g[0][i1], - (g[0][2] || 0) * this.p.p.options.exaggeration + (height || 0) * this.p.p.options.exaggeration ) + + if (height === false) + // @ts-ignore + sprite.noElevation = { + lng: g[0][i0], + lat: g[0][i1], + elevOffset: style.elevOffset, + } + sprite.position.set(v.x, v.y, v.z) sprite.renderOrder = layerObj.index if (layerObj.on == false) { diff --git a/src/lithosphere.ts b/src/lithosphere.ts index f1180d1..de26563 100644 --- a/src/lithosphere.ts +++ b/src/lithosphere.ts @@ -58,9 +58,6 @@ interface Private { zCutOff: number firstViewOverride: any mouseIsInScene: boolean - // Was developed for Mars initially and sometimes we scale against it for other bodies - // (for stuff like pan speed) - marsRadius: number } export default class LithoSphere { @@ -72,6 +69,7 @@ export default class LithoSphere { addLayer: Function removeLayer: Function toggleLayer: Function + orderLayers: Function setLayerOpacity: Function setLayerFilterEffect: Function setLayerSpecificOptions: Function @@ -130,7 +128,6 @@ export default class LithoSphere { zCutOff: 3, firstViewOverride: null, mouseIsInScene: false, - marsRadius: 3396190, } this._.container.style.position = 'relative' @@ -185,7 +182,8 @@ export default class LithoSphere { this.options.majorRadius, this.options.minorRadius, this.options.tileMapResource, - this.options.trueTileResolution + this.options.trueTileResolution, + this.options.radiusCutoff // Experimental ) // Camera(s) @@ -202,6 +200,7 @@ export default class LithoSphere { this.addLayer = this.layers.addLayer this.removeLayer = this.layers.removeLayer this.toggleLayer = this.layers.toggleLayer + this.orderLayers = this.layers.orderLayers this.setLayerOpacity = this.layers.setLayerOpacity this.setLayerFilterEffect = this.layers.setLayerFilterEffect this.setLayerSpecificOptions = this.layers.setLayerSpecificOptions @@ -556,8 +555,8 @@ export default class LithoSphere { }) center = this.projection.vector3ToLatLng(center) center.height = - centerXYZ.length() * this.projection.radiusScale - - this.projection.radii.major + (centerXYZ.length() - this.planet.position.y) / + this.projection.radiusScale return center } return this.projection.vector3ToLatLng(centerXYZ) @@ -565,8 +564,8 @@ export default class LithoSphere { getCenterElevation = (): number => { return ( - this.getCenterXYZ(true).length() * this.projection.radiusScale - - this.projection.radii.major + (this.getCenterXYZ(true).length() - this.planet.position.y) / + this.projection.radiusScale ) } @@ -618,9 +617,9 @@ export default class LithoSphere { if (intersects.length > 0) { intersects[intersects.length - 1].point.y += this.planetCenter.y return ( - intersects[intersects.length - 1].point.length() * - this.projection.radiusScale - - this.projection.radii.major + (intersects[intersects.length - 1].point.length() - + this.planet.position.y) / + this.projection.radiusScale ) } return 0 diff --git a/src/secondary/sprites.ts b/src/secondary/sprites.ts index 1be9b8b..6068955 100644 --- a/src/secondary/sprites.ts +++ b/src/secondary/sprites.ts @@ -9,19 +9,36 @@ import { const Sprites = { //id -> spriteMaterial spriteMaterials: {}, - makeMarkerSprite: function (parameters, id, forceNewMaterial?: boolean) { + makeMarkerSprite: function ( + parameters, + id, + options = {}, + forceNewMaterial?: boolean + ) { const sprite = new Sprite( - Sprites.makeMarkerMaterial(parameters, id, forceNewMaterial) + Sprites.makeMarkerMaterial( + parameters, + id, + options, + forceNewMaterial + ) ) // @ts-ignore sprite.style = sprite.style || {} + // @ts-ignore sprite.style.radius = parameters.hasOwnProperty('radius') ? parameters['radius'] : 32 + return sprite }, - makeMarkerMaterial: function (parameters, id, forceNewMaterial?: boolean) { + makeMarkerMaterial: function ( + parameters, + id, + options, + forceNewMaterial?: boolean + ) { if (parameters === undefined) parameters = {} if ( id && @@ -61,54 +78,105 @@ const Sprites = { : { r: 0, g: 0, b: 0, a: 1.0 } const canvas = document.createElement('canvas') - const context = canvas.getContext('2d') - const width = radius * 2 - const height = radius * 2 - canvas.width = width - canvas.height = height - - context.beginPath() - context.arc( - canvas.width / 2, - canvas.height / 2, - radius - strokeWeight * (radius / 12), - 0, - 2 * Math.PI, - false - ) - //fill color - if (typeof fillColor === 'object') { - context.fillStyle = - 'rgba(' + - fillColor.r + - ',' + - fillColor.g + - ',' + - fillColor.b + - ',' + - fillColor.a + - ')' + const ctx = canvas.getContext('2d') + + ctx.lineWidth = strokeWeight * Math.ceil(radius / 8) + + if (options.annotation === true) { + let text = options.name || '' + + const fontXOffset = 8 + let fontSize = parameters.fontSize || '16px' + fontSize = parseInt(fontSize.replace('px', '')) * 1.1 + ctx.font = `${fontSize}pt sans-serif` + + const heightInnerOverflow = 10 + // For chars the extend under the line. Like p + const heightOuterOverflow = fontSize / 3.5 + + const textSize = { + width: ctx.measureText(text).width + fontXOffset * 2, + height: + fontSize + heightInnerOverflow + heightOuterOverflow, + } + + canvas.width = textSize.width + canvas.height = textSize.height + + // Important to propogate these through for attenuation to work + parameters.width = canvas.width / 6 + parameters.height = canvas.height / 6 + + // Again because setting width and height resets it; but we + // needed it before to compute width and height + ctx.font = `${fontSize}pt sans-serif` + + const canvasX = 0 + + // Background rect + ctx.fillStyle = strokeColor + ctx.fillRect( + 0, + heightOuterOverflow / 2, + textSize.width, + textSize.height - heightOuterOverflow + ) + + // Text + ctx.fillStyle = fillColor + ctx.fillText( + text, + canvasX + fontXOffset, + fontSize + heightOuterOverflow / 2 + heightInnerOverflow / 2 + ) } else { - context.fillStyle = fillColor + const width = radius * 2 + const height = radius * 2 + canvas.width = width + canvas.height = height + + ctx.beginPath() + ctx.arc( + canvas.width / 2, + canvas.height / 2, + radius - strokeWeight * (radius / 12), + 0, + 2 * Math.PI, + false + ) + //fill color + if (typeof fillColor === 'object') { + ctx.fillStyle = + 'rgba(' + + fillColor.r + + ',' + + fillColor.g + + ',' + + fillColor.b + + ',' + + fillColor.a + + ')' + } else { + ctx.fillStyle = fillColor + } + ctx.fill() + // border color + if (typeof strokeColor === 'object') { + ctx.strokeStyle = + 'rgba(' + + strokeColor.r + + ',' + + strokeColor.g + + ',' + + strokeColor.b + + ',' + + strokeColor.a + + ')' + } else { + ctx.strokeStyle = strokeColor + } + ctx.stroke() } - context.fill() - context.lineWidth = strokeWeight * Math.ceil(radius / 8) - // border color - if (typeof strokeColor === 'object') { - context.strokeStyle = - 'rgba(' + - strokeColor.r + - ',' + - strokeColor.g + - ',' + - strokeColor.b + - ',' + - strokeColor.a + - ')' - } else { - context.strokeStyle = strokeColor - } - context.stroke() // canvas contents will be used for a texture const texture = new Texture(canvas) @@ -136,85 +204,6 @@ const Sprites = { return spriteMaterial } }, - makeTextSprite: function (message, parameters) { - if (parameters === undefined) parameters = {} - - const fontface = parameters.hasOwnProperty('fontface') - ? parameters['fontface'] - : 'Arial' - - const fontsize = parameters.hasOwnProperty('fontsize') - ? parameters['fontsize'] - : 18 - - const strokeWeight = parameters.hasOwnProperty('strokeWeight') - ? parameters['strokeWeight'] - : 4 - - const strokeColor = parameters.hasOwnProperty('strokeColor') - ? parameters['strokeColor'] - : { r: 0, g: 0, b: 0, a: 1.0 } - - const fontColor = parameters.hasOwnProperty('fontColor') - ? parameters['fontColor'] - : { r: 255, g: 255, b: 255, a: 1.0 } - - const canvas = document.createElement('canvas') - const context = canvas.getContext('2d') - const width = 1024 - const height = 64 - canvas.width = width - canvas.height = height - context.font = 'Bold ' + fontsize + 'px ' + fontface - - // get size data (height depends only on font size) - // TODO - //const metrics = context.measureText(message) - //const textWidth = metrics.width - // background color - - // border color - context.strokeStyle = - 'rgba(' + - strokeColor.r + - ',' + - strokeColor.g + - ',' + - strokeColor.b + - ',' + - strokeColor.a + - ')' - - context.lineWidth = strokeWeight - - //text color - context.fillStyle = - 'rgba(' + - fontColor.r + - ',' + - fontColor.g + - ',' + - fontColor.b + - ',' + - fontColor.a + - ')' - context.textAlign = 'left' - context.strokeText( - message, - width / 2 + fontsize, - height - fontsize / 1.8 - ) - context.fillText(message, width / 2 + fontsize, height - fontsize / 1.8) - - // canvas contents will be used for a texture - const texture = new Texture(canvas) - texture.needsUpdate = true - - const spriteMaterial = new SpriteMaterial({ map: texture }) - const sprite = new Sprite(spriteMaterial) - sprite.scale.set(64, 4, 1) - return sprite - }, } export default Sprites diff --git a/src/utils/index.ts b/src/utils/index.ts index f56e167..c47537a 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -109,9 +109,31 @@ const Utils = { isInExtentEN: function (xyz: XYZ, bb, proj, margin = 0.0000001): boolean { if (!bb) return true const [minE, minN, maxE, maxN] = bb - const { min, max } = proj.tileXYZ2NwSe(xyz, proj.trueTileResolution, true) - return max.x > minE + margin && min.x < maxE - margin - && max.y > minN + margin && min.y < maxN - margin + const { min, max } = proj.tileXYZ2NwSe( + xyz, + proj.trueTileResolution, + true + ) + return ( + max.x > minE + margin && + min.x < maxE - margin && + max.y > minN + margin && + min.y < maxN - margin + ) + }, + // Simple function to check whether we're inside a zoom range + isInZoomRange: function ( + minZoom: number, + maxZoom: number, + zoom: number + ): boolean { + if (minZoom != null || maxZoom != null) { + minZoom = minZoom || 0 + maxZoom = maxZoom || Infinity + if (zoom >= minZoom && zoom <= maxZoom) return true + else return false + } + return true }, //Return a clone of the object to avoid pass by reference issues clone: function (obj: any): any {