@deck.gl/geo-layers 8.6.5 → 8.7.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +6922 -3752
- package/dist/es5/great-circle-layer/great-circle-layer.js +1 -1
- package/dist/es5/h3-layers/h3-cluster-layer.js +3 -3
- package/dist/es5/h3-layers/h3-cluster-layer.js.map +1 -1
- package/dist/es5/h3-layers/h3-hexagon-layer.js +10 -9
- package/dist/es5/h3-layers/h3-hexagon-layer.js.map +1 -1
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/mesh-layer/mesh-layer-vertex.glsl.js +1 -1
- package/dist/es5/mesh-layer/mesh-layer.js +5 -10
- package/dist/es5/mesh-layer/mesh-layer.js.map +1 -1
- package/dist/es5/mvt-layer/coordinate-transform.js +4 -4
- package/dist/es5/mvt-layer/coordinate-transform.js.map +1 -1
- package/dist/es5/mvt-layer/find-index-binary.js +1 -1
- package/dist/es5/mvt-layer/find-index-binary.js.map +1 -1
- package/dist/es5/mvt-layer/mvt-layer.js +12 -12
- package/dist/es5/mvt-layer/mvt-layer.js.map +1 -1
- package/dist/es5/s2-layer/s2-layer.js +2 -2
- package/dist/es5/s2-layer/s2-layer.js.map +1 -1
- package/dist/es5/s2-layer/s2-utils.js.map +1 -1
- package/dist/es5/terrain-layer/terrain-layer.js +2 -2
- package/dist/es5/terrain-layer/terrain-layer.js.map +1 -1
- package/dist/es5/tile-3d-layer/tile-3d-layer.js +11 -9
- package/dist/es5/tile-3d-layer/tile-3d-layer.js.map +1 -1
- package/dist/es5/tile-layer/tile-2d-header.js +35 -35
- package/dist/es5/tile-layer/tile-2d-header.js.map +1 -1
- package/dist/es5/tile-layer/tile-2d-traversal.js +13 -13
- package/dist/es5/tile-layer/tile-2d-traversal.js.map +1 -1
- package/dist/es5/tile-layer/tile-layer.js +20 -22
- package/dist/es5/tile-layer/tile-layer.js.map +1 -1
- package/dist/es5/tile-layer/tileset-2d.js +215 -141
- package/dist/es5/tile-layer/tileset-2d.js.map +1 -1
- package/dist/es5/tile-layer/utils.js.map +1 -1
- package/dist/es5/trips-layer/trips-layer.js +2 -2
- package/dist/es5/trips-layer/trips-layer.js.map +1 -1
- package/dist/esm/h3-layers/h3-hexagon-layer.js +2 -1
- package/dist/esm/h3-layers/h3-hexagon-layer.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/mesh-layer/mesh-layer-vertex.glsl.js +1 -1
- package/dist/esm/mesh-layer/mesh-layer-vertex.glsl.js.map +1 -1
- package/dist/esm/mesh-layer/mesh-layer.js +2 -8
- package/dist/esm/mesh-layer/mesh-layer.js.map +1 -1
- package/dist/esm/mvt-layer/coordinate-transform.js +1 -1
- package/dist/esm/mvt-layer/coordinate-transform.js.map +1 -1
- package/dist/esm/mvt-layer/mvt-layer.js +1 -1
- package/dist/esm/mvt-layer/mvt-layer.js.map +1 -1
- package/dist/esm/s2-layer/s2-utils.js.map +1 -1
- package/dist/esm/tile-3d-layer/tile-3d-layer.js +2 -1
- package/dist/esm/tile-3d-layer/tile-3d-layer.js.map +1 -1
- package/dist/esm/tile-layer/tile-2d-traversal.js.map +1 -1
- package/dist/esm/tile-layer/tile-layer.js +2 -8
- package/dist/esm/tile-layer/tile-layer.js.map +1 -1
- package/dist/esm/tile-layer/tileset-2d.js +85 -79
- package/dist/esm/tile-layer/tileset-2d.js.map +1 -1
- package/dist.min.js +2 -2
- package/package.json +12 -12
- package/src/h3-layers/h3-hexagon-layer.js +2 -1
- package/src/{index.js → index.ts} +0 -0
- package/src/mesh-layer/mesh-layer-vertex.glsl.js +24 -23
- package/src/mesh-layer/mesh-layer.js +5 -4
- package/src/mvt-layer/coordinate-transform.js +1 -1
- package/src/mvt-layer/mvt-layer.js +1 -1
- package/src/s2-layer/s2-utils.js +7 -1
- package/src/tile-3d-layer/tile-3d-layer.js +12 -9
- package/src/tile-layer/tile-2d-traversal.js +17 -3
- package/src/tile-layer/tile-layer.js +2 -6
- package/src/tile-layer/tileset-2d.js +103 -90
package/dist.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("deck"),require("h3"),require("luma")):"function"==typeof define&&define.amd?define(["deck","h3","luma"],t):"object"==typeof exports?exports.deck=t(require("deck"),require("h3"),require("luma")):e.deck=t(e.deck,e.h3,e.luma)}(window,(function(e,t,r){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=70)}([function(e,t){e.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}},function(e,t,r){e.exports=r(101)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},function(e,t){function r(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},function(e,t,r){var n=r(
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("deck"),require("h3"),require("luma")):"function"==typeof define&&define.amd?define(["deck","h3","luma"],t):"object"==typeof exports?exports.deck=t(require("deck"),require("h3"),require("luma")):e.deck=t(e.deck,e.h3,e.luma)}(window,(function(e,t,r){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=70)}([function(e,t){e.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}},function(e,t,r){e.exports=r(101)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},function(e,t){function r(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},function(e,t,r){var n=r(50);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},function(e,t,r){var n=r(80),i=r(81),a=r(82);e.exports=function(e){return n(e)||i(e)||a()}},function(t,r){t.exports=e},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t,r){var n=r(77),i=r(78),a=r(79);e.exports=function(e,t){return n(e)||i(e,t)||a()}},function(e,t,r){var n=r(9),i=r(13);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?i(e):t}},,function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){e.exports=r(110)},function(e,t,r){var n=r(102);function i(t,r,a){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,r){var i=n(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(r):a.value}},i(t,r,a||t)}e.exports=i},function(e,t,r){var n=r(98),i=r(99),a=r(56),o=r(100);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(51);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(38).default,i=r(83);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,r){e.exports=t},,function(e,t,r){var n=r(88),i=r(89),a=r(90),o=r(91);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n,i,a;
|
|
2
2
|
/**
|
|
3
3
|
* @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
|
4
4
|
* Released under the Apache License, Version 2.0
|
|
5
5
|
* see: https://github.com/dcodeIO/long.js for details
|
|
6
|
-
*/i=[],void 0===(a="function"==typeof(n=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},n={};function i(e,t){var i,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=n[e])?a:(i=o(e,(0|e)<0?-1:0,!0),s&&(n[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(a=r[e])?a:(i=o(e,e<0?-1:0,!1),s&&(r[e]=i),i)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?y:p;if(t){if(e<0)return y;if(e>=f)return w}else{if(e<=-h)return x;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return p;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var i=a(s(r,8)),o=p,c=0;c<e.length;c+=8){var l=Math.min(8,e.length-c),f=parseInt(e.substring(c,c+l),r);if(l<8){var h=a(s(r,l));o=o.mul(h).add(a(f))}else o=(o=o.mul(i)).add(a(f))}return o.unsigned=t,o}function c(t){return t instanceof e?t:"number"==typeof t?a(t):"string"==typeof t?u(t):o(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=c;var l=4294967296,f=l*l,h=f/2,d=i(1<<24),p=i(0);e.ZERO=p;var y=i(0,!0);e.UZERO=y;var v=i(1);e.ONE=v;var g=i(1,!0);e.UONE=g;var m=i(-1);e.NEG_ONE=m;var b=o(-1,2147483647,!1);e.MAX_VALUE=b;var w=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=w;var x=o(0,-2147483648,!1);e.MIN_VALUE=x;var _=e.prototype;return _.toInt=function(){return this.unsigned?this.low>>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(x)){var t=a(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(s(e,6),this.unsigned),o=this,u="";;){var c=o.div(i),l=(o.sub(c.mul(i)).toInt()>>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},_.isZero=function(){return 0===this.high&&0===this.low},_.isNegative=function(){return!this.unsigned&&this.high<0},_.isPositive=function(){return this.unsigned||this.high>=0},_.isOdd=function(){return 1==(1&this.low)},_.isEven=function(){return 0==(1&this.low)},_.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(v)},_.neg=_.negate,_.add=function(e){t(e)||(e=c(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,p=0;return d+=(p+=a+(65535&e.low))>>>16,h+=(d+=i+l)>>>16,f+=(h+=n+u)>>>16,f+=r+s,o((d&=65535)<<16|(p&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},_.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return p;if(t(e)||(e=c(e)),e.isZero())return p;if(this.eq(x))return e.isOdd()?x:p;if(e.eq(x))return this.isOdd()?x:p;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,y=0,v=0,g=0,m=0;return g+=(m+=s*h)>>>16,v+=(g+=i*h)>>>16,g&=65535,v+=(g+=s*f)>>>16,y+=(v+=n*h)>>>16,v&=65535,y+=(v+=i*f)>>>16,v&=65535,y+=(v+=s*l)>>>16,y+=r*h+n*f+i*l+s*u,o((g&=65535)<<16|(m&=65535),(y&=65535)<<16|(v&=65535),this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?y:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return g;i=y}else{if(this.eq(x))return e.eq(v)||e.eq(m)?x:e.eq(x)?v:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?v:m:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(x))return this.unsigned?y:p;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=p}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(r),f=l.mul(e);f.isNegative()||f.gt(n);)f=(l=a(r-=u,this.unsigned)).mul(e);l.isZero()&&(l=v),i=i.add(l),n=n.sub(f)}return i},_.div=_.divide,_.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.not=function(){return o(~this.low,~this.high,this.unsigned)},_.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},_.shl=_.shiftLeft,_.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?n.apply(t,i):n)||(e.exports=a)},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t){e.exports=r},function(e,t,r){var n=r(109);e.exports=function(e){return function(){return new n(e.apply(this,arguments))}}},function(e,t){e.exports=function(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,r){var n=r(95),i=r(96),a=r(57),o=r(97);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},,function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.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},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,function(e,t,r){"use strict";var n=r(28);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("undefined"!=typeof window&&"object"===(0,i.default)(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===(0,i.default)(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":(0,i.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;if(r&&r.indexOf("Electron")>=0)return!0;return!1};var i=n(r(10))},function(e,t){},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";e.exports=i;var n=r(112);function i(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function o(e){return e.type===i.Bytes?e.readVarint()+e.pos:e.pos+1}function s(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function u(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function c(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function l(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function f(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function h(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function d(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function p(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function y(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function v(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function g(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function m(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function b(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function w(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=m(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=w(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=m(this.buf,this.pos)+4294967296*m(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=m(this.buf,this.pos)+4294967296*w(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return s(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&a?function(e,t,r){return a.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){var n="",i=t;for(;i<r;){var a,o,s,u=e[i],c=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)<=127&&(c=null):3===l?(a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&((c=(15&u)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==i.Bytes)return e.push(this.readVarint(t));var r=o(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==i.Bytes)return e.push(this.readSVarint());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==i.Bytes)return e.push(this.readBoolean());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==i.Bytes)return e.push(this.readFloat());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==i.Bytes)return e.push(this.readDouble());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed32());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed32());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed64());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed64());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===i.Varint)for(;this.buf[this.pos++]>127;);else if(t===i.Bytes)this.pos=this.readVarint()+this.pos;else if(t===i.Fixed32)this.pos+=4;else{if(t!==i.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){var r=(7&e)<<4;if(t.buf[t.pos++]|=r|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a<t.length;a++){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&u(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),n.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),n.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&u(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,i.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,c,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,l,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,y,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,v,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g,t)},writeBytesField:function(e,t){this.writeTag(e,i.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,i.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,i.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,i.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},,,,,,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(53);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(56);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){e.exports=function(e){this.wrapped=e}},function(e,t,r){"use strict";var n=r(28);Object.defineProperty(t,"__esModule",{value:!0}),t.console=t.process=t.document=t.global=t.window=t.self=void 0;var i=n(r(10)),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,i.default)(process))&&process},o=a.self||a.window||a.global;t.self=o;var s=a.window||a.self||a.global;t.window=s;var u=a.global||a.self||a.window;t.global=u;var c=a.document||{};t.document=c;var l=a.process||{};t.process=l;var f=console;t.console=f},function(e,t,r){"use strict";var n=r(28);Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,t.isBrowserMainThread=function(){return o()&&"undefined"!=typeof document};var i=n(r(10)),a=n(r(42));function o(){return!("object"===("undefined"==typeof process?"undefined":(0,i.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,a.default)()}},function(e,t,r){var n=r(52),i=r(84);function a(t,r,o){return i()?(e.exports=a=Reflect.construct,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=a=function(e,t,r){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return r&&n(a,r.prototype),a},e.exports.default=e.exports,e.exports.__esModule=!0),a.apply(null,arguments)}e.exports=a,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(85),i=r(86),a=r(54),o=r(87);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(92),i=r(93),a=r(54),o=r(94);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(103),i=r(104),a=r(105),o=r(107);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(51);function i(){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}}function a(t,r,o){return i()?e.exports=a=Reflect.construct:e.exports=a=function(e,t,r){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return r&&n(a,r.prototype),a},a.apply(null,arguments)}e.exports=a},function(e,t,r){var n=r(113),i=("undefined"==typeof window?global:window).deck||{};if(!i.LineLayer)throw new Error("@deck.gl/layers is not found");e.exports=Object.assign(i,n)},,,,,,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(53);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(55);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(55);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(56);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function s(e,t,r,n){var i=t&&t.prototype instanceof l?t:l,a=Object.create(i.prototype),o=new _(n||[]);return a._invoke=function(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return O()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=b(o,r);if(s){if(s===c)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(e,r,o),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function l(){}function f(){}function h(){}var d={};d[i]=function(){return this};var p=Object.getPrototypeOf,y=p&&p(p(k([])));y&&y!==t&&r.call(y,i)&&(d=y);var v=h.prototype=l.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function m(e){var t;this._invoke=function(n,i){function a(){return new Promise((function(t,a){!function t(n,i,a,o){var s=u(e[n],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then((function(e){t("next",e,a,o)}),(function(e){t("throw",e,a,o)})):Promise.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return t("throw",e,a,o)}))}o(s.arg)}(n,i,t,a)}))}return t=t?t.then(a,a):a()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,c;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function k(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=v.constructor=h,h.constructor=f,h[o]=f.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,o in e||(e[o]="GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},g(m.prototype),m.prototype[a]=function(){return this},e.AsyncIterator=m,e.async=function(t,r,n,i){var a=new m(s(t,r,n,i));return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(v),v[o]="Generator",v[i]=function(){return this},v.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=k,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),c}},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;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:k(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){var n=r(5);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(106);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t,r){var n=r(59);function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,u=s instanceof n;Promise.resolve(u?s.wrapped:s).then((function(e){u?i("return"===t?"return":"next",e):a(o.done?"return":"normal",e)}),(function(e){i("throw",e)}))}catch(e){a("throw",e)}}function a(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise((function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},e.exports=i},function(e,t,r){"use strict";var n=r(28),i=r(10);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"self",{enumerable:!0,get:function(){return a.self}}),Object.defineProperty(t,"window",{enumerable:!0,get:function(){return a.window}}),Object.defineProperty(t,"global",{enumerable:!0,get:function(){return a.global}}),Object.defineProperty(t,"document",{enumerable:!0,get:function(){return a.document}}),Object.defineProperty(t,"process",{enumerable:!0,get:function(){return a.process}}),Object.defineProperty(t,"console",{enumerable:!0,get:function(){return a.console}}),Object.defineProperty(t,"isBrowser",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"isBrowserMainThread",{enumerable:!0,get:function(){return o.isBrowserMainThread}}),Object.defineProperty(t,"getBrowser",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"isMobile",{enumerable:!0,get:function(){return s.isMobile}}),Object.defineProperty(t,"isElectron",{enumerable:!0,get:function(){return u.default}});var a=r(60),o=l(r(61)),s=l(r(111)),u=n(r(42));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}},function(e,t,r){"use strict";var n=r(28);Object.defineProperty(t,"__esModule",{value:!0}),t.isMobile=function(){return void 0!==i.window.orientation},t.default=function(e){if(!e&&!(0,a.default)())return"Node";if((0,o.default)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},r=e||t.userAgent||"";if(r.indexOf("Edge")>-1)return"Edge";var n=-1!==r.indexOf("MSIE "),s=-1!==r.indexOf("Trident/");if(n||s)return"IE";if(i.window.chrome)return"Chrome";if(i.window.safari)return"Safari";if(i.window.mozInnerScreenX)return"Firefox";return"Unknown"};var i=r(60),a=n(r(61)),o=n(r(42))},function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*y}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"dirname",(function(){return Vl})),r.d(n,"join",(function(){return zl}));var i={};r.r(i),r.d(i,"decode",(function(){return uy})),r.d(i,"encode",(function(){return ly}));var a={};r.r(a),r.d(a,"decode",(function(){return my})),r.d(a,"encode",(function(){return wy}));var o={};r.r(o),r.d(o,"decode",(function(){return ky})),r.d(o,"encode",(function(){return Ty}));var s={};r.r(s),r.d(s,"decode",(function(){return Py})),r.d(s,"encode",(function(){return jy}));var u=r(2),c=r.n(u),l=r(6),f=r.n(l),h=r(11),d=r.n(h),p=r(5),y=r.n(p),v=r(7);function g(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var m=function(e){f()(r,e);var t=g(r);function r(){return c()(this,r),t.apply(this,arguments)}return r}(v.ArcLayer);m.layerName="GreatCircleLayer",m.defaultProps={getHeight:{type:"accessor",value:0},greatCircle:!0};var b=r(3),w=r.n(b),x=r(0),_=r.n(x),k=r(9),O=r.n(k),T=r(27),S=r.n(T),A=180/Math.PI;function E(e,t,r){var n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function P(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function M(e){return[P(e[0]),P(e[1])]}function j(e,t){var r=O()(t,2),n=r[0],i=r[1];switch(e){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function I(e,t,r,n){if(0===n){1===r&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);var i=t[0];t[0]=t[1],t[1]=i}}function L(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){var t=e.padEnd(16,"0");return S.a.fromString(t,16)}(e)}return function(e){for(var t=S.a.fromString(e,!0,10).toString(2);t.length<64;)t="0"+t;for(var r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=S.a.fromString(n,!0,2).toString(10),s=S.a.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}(e.toString())}function R(e){return function(e){for(var t,r,n,i,a,o,s=e.face,u=e.ij,c=e.level,l=[[0,0],[0,1],[1,1],[1,0],[0,0]],f=Math.max(1,Math.ceil(100*Math.pow(2,-c))),h=new Float64Array(4*f*2+2),d=0,p=0,y=0;y<4;y++)for(var v=l[y].slice(0),g=l[y+1],m=(g[0]-v[0])/f,b=(g[1]-v[1])/f,w=0;w<f;w++){v[0]+=m,v[1]+=b;var x=j(s,M(E(u,c,v))),_=(t=x,r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,r=O()(t,3),n=r[0],i=r[1],a=r[2],o=Math.atan2(a,Math.sqrt(n*n+i*i)),[Math.atan2(i,n)*A,o*A]);Math.abs(_[1])>89.999&&(_[0]=p);var k=_[0]-p;_[0]+=k>180?-360:k<-180?360:0,h[d++]=_[0],h[d++]=_[1],p=_[0]}return h[d++]=h[0],h[d++]=h[1],h}(function(e){for(var t,r=e.split("/"),n=parseInt(r[0],10),i=r[1],a=i.length,o=[0,0],s=a-1;s>=0;s--){t=a-s;var u=i[s],c=0,l=0;"1"===u?l=1:"2"===u?(c=1,l=1):"3"===u&&(c=1);var f=Math.pow(2,t-1);I(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(n%2==1){var h=o[0];o[0]=o[1],o[1]=h}return{face:n,ij:o,level:t}}(L(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}function D(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 N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F=N(N({},v.PolygonLayer.defaultProps),{},{getS2Token:{type:"accessor",value:function(e){return e.token}}}),B=function(e){f()(r,e);var t=C(r);function r(){return c()(this,r),t.apply(this,arguments)}return w()(r,[{key:"renderLayers",value:function(){var e=this.props,t=e.data,r=e.getS2Token,n=this.props,i=n.elevationScale,a=n.extruded,o=n.wireframe,s=n.filled,u=n.stroked,c=n.lineWidthUnits,l=n.lineWidthScale,f=n.lineWidthMinPixels,h=n.lineWidthMaxPixels,d=n.lineJointRounded,p=n.lineMiterLimit,y=n.lineDashJustified,g=n.getElevation,m=n.getFillColor,b=n.getLineColor,w=n.getLineWidth,x=n.getLineDashArray,_=this.props,k=_.updateTriggers,O=_.material;return new(this.getSubLayerClass("cell",v.PolygonLayer))({filled:s,wireframe:o,extruded:a,elevationScale:i,stroked:u,lineWidthUnits:c,lineWidthScale:l,lineWidthMinPixels:f,lineWidthMaxPixels:h,lineJointRounded:d,lineMiterLimit:p,lineDashJustified:y,material:O,getElevation:g,getFillColor:m,getLineColor:b,getLineWidth:w,getLineDashArray:x},this.getSubLayerProps({id:"cell",updateTriggers:{getElevation:k.getElevation,getFillColor:k.getFillColor,getLineColor:k.getLineColor,getLineWidth:k.getLineWidth,getLineDashArray:k.getLineDashArray}}),{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return R(r(e,t))}})}}]),r}(v.CompositeLayer);B.layerName="S2Layer",B.defaultProps=F;var U=r(1),V=r.n(U),z=r(4),q=r.n(z),G=function(){function e(t){var r=t.x,n=t.y,i=t.z;c()(this,e),this.x=r,this.y=n,this.z=i,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}var t;return w()(e,[{key:"_loadData",value:(t=q()(V.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getData,n=t.requestScheduler,i=t.onLoad,a=t.onError,o=this.x,s=this.y,u=this.z,c=this.bbox,l=this._loaderId,this._abortController=new AbortController,f=this._abortController.signal,e.next=7,n.scheduleRequest(this,(function(e){return e.isSelected?1:-1}));case 7:if(h=e.sent){e.next=11;break}return this._isCancelled=!0,e.abrupt("return");case 11:if(!this._isCancelled){e.next=14;break}return h.done(),e.abrupt("return");case 14:return d=null,e.prev=15,e.next=18,r({x:o,y:s,z:u,bbox:c,signal:f});case 18:d=e.sent,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(15),p=e.t0||!0;case 24:return e.prev=24,h.done(),e.finish(24);case 27:if(l===this._loaderId){e.next=29;break}return e.abrupt("return");case 29:if(this._loader=void 0,this.content=d,!this._isCancelled||d){e.next=34;break}return this._isLoaded=!1,e.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,p?a(p,this):i(this);case 37:case"end":return e.stop()}}),e,this,[[15,21,24,27]])}))),function(e){return t.apply(this,arguments)})},{key:"loadData",value:function(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){this.isLoaded||(this._isCancelled=!0,this._abortController.abort())}},{key:"data",get:function(){var e=this;return this.isLoading?this._loader.then((function(){return e.data})):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var e=this.content?this.content.byteLength:0;return Number.isFinite(e)||v.log.error("byteLength not defined in tile data")(),e}}]),e}(),H=r(8),W=r.n(H),Z=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),X=r(22),Q=r.n(X),K=r(21),J=r.n(K),Y=r(18),$=r.n(Y),ee=r(16),te=r.n(ee),re=r(19),ne=r.n(re),ie=r(20),ae=r.n(ie),oe=r(13),se=r.n(oe);r(35),r(62),r(63);function ue(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var ce=1/Math.PI*180,le=1/180*Math.PI,fe={};function he(e){return Math.round(e/fe.EPSILON)*fe.EPSILON}function de(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.precision,n=void 0===r?fe.precision||4:r;return e=he(e),"".concat(parseFloat(e.toPrecision(n)))}function pe(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ye(e,t,r){if(pe(e)){r=r||((i=e).clone?i.clone():new Array(i.length));for(var n=0;n<r.length&&n<e.length;++n)r[n]=t(e[n],n,r);return r}var i;return t(e)}function ve(e){return function(e,t){return ye(e,(function(e){return e*le}),t)}(e)}function ge(e){return me(e)}function me(e,t){return ye(e,(function(e){return e*ce}),t)}function be(e,t,r){return ye(e,(function(e){return Math.max(t,Math.min(r,e))}))}function we(e,t,r){return pe(e)?e.map((function(e,n){return we(e,t[n],r)})):r*t+(1-r)*e}function xe(e,t,r){var n=fe.EPSILON;r&&(fe.EPSILON=r);try{if(e===t)return!0;if(pe(e)&&pe(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;++i)if(!xe(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):!(!Number.isFinite(e)||!Number.isFinite(t))&&Math.abs(e-t)<=fe.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{fe.EPSILON=n}}function _e(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=se()(e);if(t){var i=se()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ae()(this,r)}}fe.EPSILON=1e-12,fe.debug=!1,fe.precision=4,fe.printTypes=!1,fe.printDegrees=!1,fe.printRowMajor=!0;var ke=function(e){ne()(r,e);var t=_e(r);function r(){return $()(this,r),t.apply(this,arguments)}return te()(r,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)this[r]=e[r+t];return this.check()}},{key:"to",value:function(e){return e===this?this:pe(e)?this.toArray(e):this.toObject(e)}},{key:"toTarget",value:function(e){return e?this.to(e):this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)e[t+r]=this[r];return e}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(fe)}},{key:"formatString",value:function(e){for(var t="",r=0;r<this.ELEMENTS;++r)t+=(r>0?", ":"")+de(this[r],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(!xe(this[t],e[t]))return!1;return!0}},{key:"exactEquals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}},{key:"negate",value:function(){for(var e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}},{key:"lerp",value:function(e,t,r){void 0===r&&(r=t,t=e,e=this);for(var n=0;n<this.ELEMENTS;++n){var i=e[n];this[n]=i+r*(t[n]-i)}return this.check()}},{key:"min",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}},{key:"max",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}},{key:"clamp",value:function(e,t){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),t[r]);return this.check()}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]+=a[o];return this.check()}},{key:"subtract",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]-=a[o];return this.check()}},{key:"scale",value:function(e){if(Array.isArray(e))return this.multiply(e);for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}},{key:"addScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}},{key:"subScalar",value:function(e){return this.addScalar(-e)}},{key:"multiplyScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"divideScalar",value:function(e){return this.scale(1/e)}},{key:"clampScalar",value:function(e,t){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),t);return this.check()}},{key:"multiplyByScalar",value:function(e){return this.scale(e)}},{key:"check",value:function(){if(fe.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var e=this.length===this.ELEMENTS,t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}},{key:"ELEMENTS",get:function(){return ue(!1),0}},{key:"elements",get:function(){return this}}]),r}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array));function Oe(e,t){if(e.length!==t)return!1;for(var r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Te(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function Se(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(fe.debug&&!Oe(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}var Ae={};function Ee(e,t){Ae[e]||(Ae[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}function Pe(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=se()(e);if(t){var i=se()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ae()(this,r)}}var Me=function(e){ne()(r,e);var t=Pe(r);function r(){return $()(this,r),t.apply(this,arguments)}return te()(r,[{key:"copy",value:function(e){return ue(!1),this}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(e){return Math.sqrt(this.distanceSquared(e))}},{key:"distanceSquared",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r){var n=this[r]-e[r];t+=n*n}return Te(t)}},{key:"dot",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r)t+=this[r]*e[r];return Te(t)}},{key:"normalize",value:function(){var e=this.magnitude();if(0!==e)for(var t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}},{key:"multiply",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]*=a[o];return this.check()}},{key:"divide",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]/=a[o];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(e){return this.distance(e)}},{key:"distanceToSquared",value:function(e){return this.distanceSquared(e)}},{key:"getComponent",value:function(e){return ue(e>=0&&e<this.ELEMENTS,"index is out of range"),Te(this[e])}},{key:"setComponent",value:function(e,t){return ue(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}},{key:"addVectors",value:function(e,t){return this.copy(e).add(t)}},{key:"subVectors",value:function(e,t){return this.copy(e).subtract(t)}},{key:"multiplyVectors",value:function(e,t){return this.copy(e).multiply(t)}},{key:"addScaledVector",value:function(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}},{key:"ELEMENTS",get:function(){return ue(!1),0}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=Te(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=Te(e)}}]),r}(ke),je="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function Ie(){var e=new je(3);return je!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Le(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function Re(e,t,r){var n=new je(3);return n[0]=e,n[1]=t,n[2]=r,n}function Ce(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function De(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function Ne(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function Fe(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Be,Ue=Le;Be=Ie();function Ve(e,t,r){var n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function ze(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function qe(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=se()(e);if(t){var i=se()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ae()(this,r)}}var Ge=[0,0,0],He={},We=function(e){ne()(r,e);var t=qe(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return $()(this,r),e=t.call(this,-0,-0,-0),1===arguments.length&&pe(n)?e.copy(n):(fe.debug&&(Te(n),Te(i),Te(a)),e[0]=n,e[1]=i,e[2]=a),e}return te()(r,null,[{key:"ZERO",get:function(){return He.ZERO=He.ZERO||Object.freeze(new r(0,0,0,0))}}]),te()(r,[{key:"set",value:function(e,t,r){return this[0]=e,this[1]=t,this[2]=r,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}},{key:"fromObject",value:function(e){return fe.debug&&(Te(e.x),Te(e.y),Te(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}},{key:"angle",value:function(e){return r=e,n=(t=this)[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=Math.sqrt(n*n+i*i+a*a)*Math.sqrt(o*o+s*s+u*u),l=c&&Ce(t,r)/c,Math.acos(Math.min(Math.max(l,-1),1));var t,r,n,i,a,o,s,u,c,l}},{key:"cross",value:function(e){return De(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t,r,n,i,a,o,s=e.radians,u=e.origin;return t=this,n=void 0===u?Ge:u,i=s,o=[],(a=[])[0]=(r=this)[0]-n[0],a[1]=r[1]-n[1],a[2]=r[2]-n[2],o[0]=a[0],o[1]=a[1]*Math.cos(i)-a[2]*Math.sin(i),o[2]=a[1]*Math.sin(i)+a[2]*Math.cos(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],this.check()}},{key:"rotateY",value:function(e){var t,r,n,i,a,o,s=e.radians,u=e.origin;return t=this,n=void 0===u?Ge:u,i=s,o=[],(a=[])[0]=(r=this)[0]-n[0],a[1]=r[1]-n[1],a[2]=r[2]-n[2],o[0]=a[2]*Math.sin(i)+a[0]*Math.cos(i),o[1]=a[1],o[2]=a[2]*Math.cos(i)-a[0]*Math.sin(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],this.check()}},{key:"rotateZ",value:function(e){var t,r,n,i,a,o,s=e.radians,u=e.origin;return t=this,n=void 0===u?Ge:u,i=s,o=[],(a=[])[0]=(r=this)[0]-n[0],a[1]=r[1]-n[1],a[2]=r[2]-n[2],o[0]=a[0]*Math.cos(i)-a[1]*Math.sin(i),o[1]=a[0]*Math.sin(i)+a[1]*Math.cos(i),o[2]=a[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return Ne(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return ze(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return Fe(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){var t,r,n,i,a;return t=this,n=e,i=(r=this)[0],a=r[1],t[0]=n[0]*i+n[2]*a,t[1]=n[1]*i+n[3]*a,t[2]=r[2],this.check()}},{key:"transformByQuaternion",value:function(e){var t,r,n,i,a,o,s,u,c,l,f,h,d,p,y,v,g;return t=this,r=this,i=(n=e)[0],a=n[1],o=n[2],s=n[3],u=r[0],c=r[1],l=r[2],p=a*(d=i*c-a*u)-o*(h=o*u-i*l),y=o*(f=a*l-o*c)-i*d,v=i*h-a*f,f*=g=2*s,h*=g,d*=g,p*=2,y*=2,v*=2,t[0]=u+f+p,t[1]=c+h+y,t[2]=l+d+v,this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=Te(e)}}]),r}(Me),Ze=new We,Xe=new We,Qe=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Q()(this,e),n=n||Ze.copy(t).add(r).scale(.5),this.center=new We(n),this.halfDiagonal=new We(r).subtract(this.center),this.minimum=new We(t),this.maximum=new We(r)}return J()(e,[{key:"clone",value:function(){return new e(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}},{key:"transform",value:function(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}},{key:"intersectPlane",value:function(e){var t=this.halfDiagonal,r=Xe.from(e.normal),n=t.x*Math.abs(r.x)+t.y*Math.abs(r.y)+t.z*Math.abs(r.z),i=this.center.dot(r)+e.distance;return i-n>0?Z.INSIDE:i+n<0?Z.OUTSIDE:Z.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t,r=Ze.from(e).subtract(this.center),n=this.halfDiagonal,i=0;return(t=Math.abs(r.x)-n.x)>0&&(i+=t*t),(t=Math.abs(r.y)-n.y)>0&&(i+=t*t),(t=Math.abs(r.z)-n.z)>0&&(i+=t*t),i}}]),e}();function Ke(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],p=t[12],y=t[13],v=t[14],g=t[15],m=r*s-n*o,b=r*u-i*o,w=r*c-a*o,x=n*u-i*s,_=n*c-a*s,k=i*c-a*u,O=l*y-f*p,T=l*v-h*p,S=l*g-d*p,A=f*v-h*y,E=f*g-d*y,P=h*g-d*v,M=m*P-b*E+w*A+x*S-_*T+k*O;return M?(M=1/M,e[0]=(s*P-u*E+c*A)*M,e[1]=(i*E-n*P-a*A)*M,e[2]=(y*k-v*_+g*x)*M,e[3]=(h*_-f*k-d*x)*M,e[4]=(u*S-o*P-c*T)*M,e[5]=(r*P-i*S+a*T)*M,e[6]=(v*w-p*k-g*b)*M,e[7]=(l*k-h*w+d*b)*M,e[8]=(o*E-s*S+c*O)*M,e[9]=(n*S-r*E-a*O)*M,e[10]=(p*_-y*w+g*m)*M,e[11]=(f*w-l*_-d*m)*M,e[12]=(s*T-o*A-u*O)*M,e[13]=(r*A-n*T+i*O)*M,e[14]=(y*b-p*x-v*m)*M,e[15]=(l*x-f*b+h*m)*M,e):null}function Je(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],y=t[12],v=t[13],g=t[14],m=t[15],b=r[0],w=r[1],x=r[2],_=r[3];return e[0]=b*n+w*s+x*f+_*y,e[1]=b*i+w*u+x*h+_*v,e[2]=b*a+w*c+x*d+_*g,e[3]=b*o+w*l+x*p+_*m,b=r[4],w=r[5],x=r[6],_=r[7],e[4]=b*n+w*s+x*f+_*y,e[5]=b*i+w*u+x*h+_*v,e[6]=b*a+w*c+x*d+_*g,e[7]=b*o+w*l+x*p+_*m,b=r[8],w=r[9],x=r[10],_=r[11],e[8]=b*n+w*s+x*f+_*y,e[9]=b*i+w*u+x*h+_*v,e[10]=b*a+w*c+x*d+_*g,e[11]=b*o+w*l+x*p+_*m,b=r[12],w=r[13],x=r[14],_=r[15],e[12]=b*n+w*s+x*f+_*y,e[13]=b*i+w*u+x*h+_*v,e[14]=b*a+w*c+x*d+_*g,e[15]=b*o+w*l+x*p+_*m,e}function Ye(e,t,r){var n,i,a,o,s,u,c,l,f,h,d,p,y=r[0],v=r[1],g=r[2];return t===e?(e[12]=t[0]*y+t[4]*v+t[8]*g+t[12],e[13]=t[1]*y+t[5]*v+t[9]*g+t[13],e[14]=t[2]*y+t[6]*v+t[10]*g+t[14],e[15]=t[3]*y+t[7]*v+t[11]*g+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=p,e[12]=n*y+s*v+f*g+t[12],e[13]=i*y+u*v+h*g+t[13],e[14]=a*y+c*v+d*g+t[14],e[15]=o*y+l*v+p*g+t[15]),e}function $e(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function et(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+h*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=h*i-u*n,e}function tt(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+h*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=h*i-u*n,e}function rt(e,t){var r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.hypot(r,n,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(u,c,l),e}function nt(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e}function it(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p=t[0],y=t[1],v=t[2],g=n[0],m=n[1],b=n[2],w=r[0],x=r[1],_=r[2];return Math.abs(p-w)<1e-6&&Math.abs(y-x)<1e-6&&Math.abs(v-_)<1e-6?function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}(e):(l=p-w,f=y-x,h=v-_,i=m*(h*=d=1/Math.hypot(l,f,h))-b*(f*=d),a=b*(l*=d)-g*h,o=g*f-m*l,(d=Math.hypot(i,a,o))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),s=f*o-h*a,u=h*i-l*o,c=l*a-f*i,(d=Math.hypot(s,u,c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=a,e[5]=u,e[6]=f,e[7]=0,e[8]=o,e[9]=c,e[10]=h,e[11]=0,e[12]=-(i*p+a*y+o*v),e[13]=-(s*p+u*y+c*v),e[14]=-(l*p+f*y+h*v),e[15]=1,e)}var at=new We,ot=new We,st=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Q()(this,e),this.radius=-0,this.center=new We,this.fromCenterRadius(t,r)}return J()(e,[{key:"fromCenterRadius",value:function(e,t){return this.center.from(e),this.radius=t,this}},{key:"fromCornerPoints",value:function(e,t){return t=at.from(t),this.center=(new We).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}},{key:"clone",value:function(){return new e(this.center,this.radius)}},{key:"union",value:function(e){var t=this.center,r=this.radius,n=e.center,i=e.radius,a=at.copy(n).subtract(t),o=a.magnitude();if(r>=o+i)return this.clone();if(i>=o+r)return e.clone();var s=.5*(r+o+i);return ot.copy(a).scale((-r+s)/o).add(t),this.center.copy(ot),this.radius=s,this}},{key:"expand",value:function(e){var t=(e=at.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}},{key:"transform",value:function(e){this.center.transform(e);var t=rt(at,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(e){var t=this.distanceTo(e);return t*t}},{key:"distanceTo",value:function(e){var t=(e=at.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}},{key:"intersectPlane",value:function(e){var t=this.center,r=this.radius,n=e.normal.dot(t)+e.distance;return n<-r?Z.OUTSIDE:n<r?Z.INTERSECTING:Z.INSIDE}}]),e}(),ut=r(26),ct=r.n(ut);function lt(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=se()(e);if(t){var i=se()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ae()(this,r)}}var ft=function(e){ne()(r,e);var t=lt(r);function r(){return $()(this,r),t.apply(this,arguments)}return te()(r,[{key:"toString",value:function(){var e="[";if(fe.printRowMajor){e+="row-major:";for(var t=0;t<this.RANK;++t)for(var r=0;r<this.RANK;++r)e+=" ".concat(this[r*this.RANK+t])}else{e+="column-major:";for(var n=0;n<this.ELEMENTS;++n)e+=" ".concat(this[n])}return e+="]"}},{key:"getElementIndex",value:function(e,t){return t*this.RANK+e}},{key:"getElement",value:function(e,t){return this[t*this.RANK+e]}},{key:"setElement",value:function(e,t,r){return this[t*this.RANK+e]=Te(r),this}},{key:"getColumn",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=e*this.RANK,n=0;n<this.RANK;++n)t[n]=this[r+n];return t}},{key:"setColumn",value:function(e,t){for(var r=e*this.RANK,n=0;n<this.RANK;++n)this[r+n]=t[n];return this}},{key:"ELEMENTS",get:function(){return ue(!1),0}},{key:"RANK",get:function(){return ue(!1),0}}]),r}(ke);function ht(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=r[0],d=r[1],p=r[2],y=r[3],v=r[4],g=r[5],m=r[6],b=r[7],w=r[8];return e[0]=h*n+d*o+p*c,e[1]=h*i+d*s+p*l,e[2]=h*a+d*u+p*f,e[3]=y*n+v*o+g*c,e[4]=y*i+v*s+g*l,e[5]=y*a+v*u+g*f,e[6]=m*n+b*o+w*c,e[7]=m*i+b*s+w*l,e[8]=m*a+b*u+w*f,e}function dt(e,t,r){var n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function pt(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function yt(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}!function(){var e,t=(e=new je(2),je!=Float32Array&&(e[0]=0,e[1]=0),e)}();function vt(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=se()(e);if(t){var i=se()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ae()(this,r)}}var gt=Object.freeze([1,0,0,0,1,0,0,0,1]),mt=Object.freeze([0,0,0,0,0,0,0,0,0]),bt=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),wt={},xt=function(e){ne()(r,e);var t=vt(r);function r(e){var n;return $()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):n.identity(),n}return te()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return bt}}],[{key:"IDENTITY",get:function(){return wt.IDENTITY=wt.IDENTITY||Object.freeze(new r(gt)),wt.IDENTITY}},{key:"ZERO",get:function(){return wt.ZERO=wt.ZERO||Object.freeze(new r(mt)),wt.ZERO}}]),te()(r,[{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}},{key:"set",value:function(e,t,r,n,i,a,o,s,u){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this.check()}},{key:"setRowMajor",value:function(e,t,r,n,i,a,o,s,u){return this[0]=e,this[1]=n,this[2]=o,this[3]=t,this[4]=i,this[5]=s,this[6]=r,this[7]=a,this[8]=u,this.check()}},{key:"determinant",value:function(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s);var e,t,r,n,i,a,o,s,u,c}},{key:"identity",value:function(){return this.copy(gt)}},{key:"fromQuaternion",value:function(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,d=i*s,p=i*u,y=a*o,v=a*s,g=a*u;e[0]=1-f-p,e[3]=l-g,e[6]=h+v,e[1]=l+g,e[4]=1-c-p,e[7]=d-y,e[2]=h-v,e[5]=d+y,e[8]=1-c-f}(this,e),this.check()}},{key:"transpose",value:function(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]}(this,this),this.check()}},{key:"invert",value:function(){var e,t,r,n,i,a,o,s,u,c,l,f,h,d,p;return e=this,r=(t=this)[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],(p=r*(f=l*o-s*c)+n*(h=-l*a+s*u)+i*(d=c*a-o*u))&&(p=1/p,e[0]=f*p,e[1]=(-l*n+i*c)*p,e[2]=(s*n-i*o)*p,e[3]=h*p,e[4]=(l*r-i*u)*p,e[5]=(-s*r+i*a)*p,e[6]=d*p,e[7]=(-c*r+n*u)*p,e[8]=(o*r-n*a)*p),this.check()}},{key:"multiplyLeft",value:function(e){return ht(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return ht(this,this,e),this.check()}},{key:"rotate",value:function(e){var t,r,n,i,a,o,s,u,c,l,f,h,d,p;return t=this,n=e,i=(r=this)[0],a=r[1],o=r[2],s=r[3],u=r[4],c=r[5],l=r[6],f=r[7],h=r[8],d=Math.sin(n),p=Math.cos(n),t[0]=p*i+d*s,t[1]=p*a+d*u,t[2]=p*o+d*c,t[3]=p*s-d*i,t[4]=p*u-d*a,t[5]=p*c-d*o,t[6]=l,t[7]=f,t[8]=h,this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?dt(this,this,e):dt(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){var t,r,n,i,a,o,s,u,c,l,f,h,d,p;return t=this,n=e,i=(r=this)[0],a=r[1],o=r[2],s=r[3],u=r[4],c=r[5],l=r[6],f=r[7],h=r[8],d=n[0],p=n[1],t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=u,t[5]=c,t[6]=d*i+p*s+l,t[7]=d*a+p*u+f,t[8]=d*o+p*c+h,this.check()}},{key:"transform",value:function(e,t){switch(e.length){case 2:t=pt(t||[-0,-0],e,this);break;case 3:t=Fe(t||[-0,-0,-0],e,this);break;case 4:r=t||[-0,-0,-0,-0],i=this,a=(n=e)[0],o=n[1],s=n[2],r[0]=i[0]*a+i[3]*o+i[6]*s,r[1]=i[1]*a+i[4]*o+i[7]*s,r[2]=i[2]*a+i[5]*o+i[8]*s,r[3]=n[3],t=r;break;default:throw new Error("Illegal vector")}var r,n,i,a,o,s;return Se(t,e.length),t}},{key:"transformVector",value:function(e,t){return Ee("Matrix3.transformVector"),this.transform(e,t)}},{key:"transformVector2",value:function(e,t){return Ee("Matrix3.transformVector"),this.transform(e,t)}},{key:"transformVector3",value:function(e,t){return Ee("Matrix3.transformVector"),this.transform(e,t)}}]),r}(ft);function _t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function kt(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function Ot(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function Tt(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function St(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-u*a;return e[0]=l*c+d*-o+f*-u-h*-s,e[1]=f*c+d*-s+h*-o-l*-u,e[2]=h*c+d*-u+l*-s-f*-o,e[3]=t[3],e}!function(){var e,t=(e=new je(4),je!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e)}();function At(){var e=new je(4);return je!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Et(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Pt(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function Mt(e,t,r,n){var i,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=r[0],p=r[1],y=r[2],v=r[3];return(a=c*d+l*p+f*y+h*v)<0&&(a=-a,d=-d,p=-p,y=-y,v=-v),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,u=Math.sin(n*i)/o):(s=1-n,u=n),e[0]=s*c+u*d,e[1]=s*l+u*p,e[2]=s*f+u*y,e[3]=s*h+u*v,e}function jt(e,t){var r,n=t[0]+t[4]+t[8];if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[3*i+i]-t[3*a+a]-t[3*o+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[3*a+o]-t[3*o+a])*r,e[a]=(t[3*a+i]+t[3*i+a])*r,e[o]=(t[3*o+i]+t[3*i+o])*r}return e}var It,Lt,Rt,Ct,Dt,Nt,Ft,Bt=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},Ut=_t,Vt=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},zt=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e},qt=kt,Gt=Ot,Ht=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e},Wt=(It=Ie(),Lt=Re(1,0,0),Rt=Re(0,1,0),function(e,t,r){var n=Ce(t,r);return n<-.999999?(De(It,Lt,t),Ue(It)<1e-6&&De(It,Rt,t),function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a}(It,It),Et(e,It,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(De(It,t,r),e[0]=It[0],e[1]=It[1],e[2]=It[2],e[3]=1+n,Ht(e,e))});Ct=At(),Dt=At(),Nt=new je(9),je!=Float32Array&&(Nt[1]=0,Nt[2]=0,Nt[3]=0,Nt[5]=0,Nt[6]=0,Nt[7]=0),Nt[0]=1,Nt[4]=1,Nt[8]=1,Ft=Nt;function Zt(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=se()(e);if(t){var i=se()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ae()(this,r)}}var Xt=[0,0,0,1],Qt=function(e){ne()(r,e);var t=Zt(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return $()(this,r),e=t.call(this,-0,-0,-0,-0),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,a,o),e}return te()(r,[{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}},{key:"set",value:function(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}},{key:"fromMatrix3",value:function(e){return jt(this,e),this.check()}},{key:"identity",value:function(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}},{key:"fromAxisRotation",value:function(e,t){return Et(this,e,t),this.check()}},{key:"setAxisAngle",value:function(e,t){return this.fromAxisRotation(e,t)}},{key:"len",value:function(){return qt(this)}},{key:"lengthSquared",value:function(){return Gt(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return Vt(this,e)}},{key:"rotationTo",value:function(e,t){return Wt(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return Bt(this,this,e),this.check()}},{key:"calculateW",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2];e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s}(this,this),this.check()}},{key:"lerp",value:function(e,t,r){return zt(this,e,t,r),this.check()}},{key:"multiplyRight",value:function(e,t){return ue(!t),Pt(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e,t){return ue(!t),Pt(this,e,this),this.check()}},{key:"normalize",value:function(){var e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}},{key:"rotateX",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return Ut(this,this,e),this.check()}},{key:"slerp",value:function(e,t,r){switch(arguments.length){case 1:var n=arguments[0],i=n.start;e=void 0===i?Xt:i,t=n.target,r=n.ratio;break;case 2:var a=Array.prototype.slice.call(arguments);t=a[0],r=a[1],e=this}return Mt(this,e,t,r),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return St(t,e,this),Se(t,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(e,t){return this.setAxisAngle(e,t)}},{key:"premultiply",value:function(e,t){return this.multiplyLeft(e,t)}},{key:"multiply",value:function(e,t){return this.multiplyRight(e,t)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=Te(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=Te(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=Te(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=Te(e)}}]),r}(ke),Kt=new We,Jt=new We,Yt=new We,$t=new We,er=new We,tr=new We,rr=new We,nr=0,ir=1,ar=2,or=3,sr=4,ur=5,cr=6,lr=7,fr=8,hr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];Q()(this,e),this.center=(new We).from(t),this.halfAxes=new xt(r)}return J()(e,[{key:"fromCenterHalfSizeQuaternion",value:function(e,t,r){var n=new Qt(r),i=(new xt).fromQuaternion(n);return i[0]=i[0]*t[0],i[1]=i[1]*t[0],i[2]=i[2]*t[0],i[3]=i[3]*t[1],i[4]=i[4]*t[1],i[5]=i[5]*t[1],i[6]=i[6]*t[2],i[7]=i[7]*t[2],i[8]=i[8]*t[2],this.center=(new We).from(e),this.halfAxes=i,this}},{key:"clone",value:function(){return new e(this.center,this.halfAxes)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}},{key:"getBoundingSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new st,t=this.halfAxes,r=t.getColumn(0,Yt),n=t.getColumn(1,$t),i=t.getColumn(2,er),a=Kt.copy(r).add(n).add(i);return e.center.copy(this.center),e.radius=a.magnitude(),e}},{key:"intersectPlane",value:function(e){var t=this.center,r=e.normal,n=this.halfAxes,i=r.x,a=r.y,o=r.z,s=Math.abs(i*n[nr]+a*n[ir]+o*n[ar])+Math.abs(i*n[or]+a*n[sr]+o*n[ur])+Math.abs(i*n[cr]+a*n[lr]+o*n[fr]),u=r.dot(t)+e.distance;return u<=-s?Z.OUTSIDE:u>=s?Z.INSIDE:Z.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t=Jt.from(e).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,Yt),i=r.getColumn(1,$t),a=r.getColumn(2,er),o=n.magnitude(),s=i.magnitude(),u=a.magnitude();n.normalize(),i.normalize(),a.normalize();var c,l=0;return(c=Math.abs(t.dot(n))-o)>0&&(l+=c*c),(c=Math.abs(t.dot(i))-s)>0&&(l+=c*c),(c=Math.abs(t.dot(a))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=this.center,o=this.halfAxes,s=o.getColumn(0,Yt),u=o.getColumn(1,$t),c=o.getColumn(2,er),l=tr.copy(s).add(u).add(c).add(a),f=rr.copy(l).subtract(e),h=t.dot(f);return n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).add(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).subtract(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).subtract(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).add(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).add(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).subtract(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).subtract(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),r[0]=n,r[1]=i,r}},{key:"transform",value:function(e){this.center.transformAsPoint(e);var t=this.halfAxes.getColumn(0,Yt);t.transformAsPoint(e);var r=this.halfAxes.getColumn(1,$t);r.transformAsPoint(e);var n=this.halfAxes.getColumn(2,er);return n.transformAsPoint(e),this.halfAxes=new xt([].concat(ct()(t),ct()(r),ct()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}},{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new We(e).len(),new We(t).len(),new We(r).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new We(e).normalize(),i=new We(t).normalize(),a=new We(r).normalize();return(new Qt).fromMatrix3(new xt([].concat(ct()(n),ct()(i),ct()(a))))}}]),e}(),dr=new We,pr=new We,yr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Q()(this,e),this.normal=new We,this.distance=-0,this.fromNormalDistance(t,r)}return J()(e,[{key:"fromNormalDistance",value:function(e,t){return ue(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}},{key:"fromPointNormal",value:function(e,t){e=dr.from(e),this.normal.from(t).normalize();var r=-this.normal.dot(e);return this.distance=r,this}},{key:"fromCoefficients",value:function(e,t,r,n){return this.normal.set(e,t,r),ue(xe(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(t){return new e(this.normal,this.distance)}},{key:"equals",value:function(e){return xe(this.distance,e.distance)&&xe(this.normal,e.normal)}},{key:"getPointDistance",value:function(e){return this.normal.dot(e)+this.distance}},{key:"transform",value:function(e){var t=pr.copy(this.normal).transformAsVector(e).normalize(),r=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(r,t)}},{key:"projectPointOntoPlane",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];e=dr.from(e);var r=this.getPointDistance(e),n=pr.copy(this.normal).scale(r);return e.subtract(n).to(t)}}]),e}();function vr(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return gr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gr(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function gr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var mr=[new We([1,0,0]),new We([0,1,0]),new We([0,0,1])],br=new We,wr=new We,xr=(new yr(new We(1,0,0),0),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Q()(this,e),this.planes=t,ue(this.planes.every((function(e){return e instanceof yr})))}return J()(e,null,[{key:"MASK_OUTSIDE",get:function(){return 4294967295}},{key:"MASK_INSIDE",get:function(){return 0}},{key:"MASK_INDETERMINATE",get:function(){return 2147483647}}]),J()(e,[{key:"fromBoundingSphere",value:function(e){this.planes.length=2*mr.length;var t,r=e.center,n=e.radius,i=0,a=vr(mr);try{for(a.s();!(t=a.n()).done;){var o=t.value,s=this.planes[i],u=this.planes[i+1];s||(s=this.planes[i]=new yr),u||(u=this.planes[i+1]=new yr);var c=br.copy(o).scale(-n).add(r);o.dot(c);s.fromPointNormal(c,o);var l=br.copy(o).scale(n).add(r),f=wr.copy(o).negate();f.dot(l);u.fromPointNormal(l,f),i+=2}}catch(e){a.e(e)}finally{a.f()}return this}},{key:"computeVisibility",value:function(e){ue(e);var t,r=Z.INSIDE,n=vr(this.planes);try{for(n.s();!(t=n.n()).done;){var i=t.value;switch(e.intersectPlane(i)){case Z.OUTSIDE:return Z.OUTSIDE;case Z.INTERSECTING:r=Z.INTERSECTING}}}catch(e){n.e(e)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(t,r){if(ue(t,"boundingVolume is required."),ue(Number.isFinite(r),"parentPlaneMask is required."),r===e.MASK_OUTSIDE||r===e.MASK_INSIDE)return r;for(var n=e.MASK_INSIDE,i=this.planes,a=0;a<this.planes.length;++a){var o=a<31?1<<a:0;if(!(a<31&&0==(r&o))){var s=i[a],u=t.intersectPlane(s);if(u===Z.OUTSIDE)return e.MASK_OUTSIDE;u===Z.INTERSECTING&&(n|=o)}}return n}}]),e}()),_r=(r(36),r(64)),kr=r.n(_r);function Or(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=se()(e);if(t){var i=se()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ae()(this,r)}}var Tr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Sr=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Ar=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),Er={},Pr=function(e){ne()(r,e);var t=Or(r);function r(e){var n;return $()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):n.identity(),n}return te()(r,[{key:"INDICES",get:function(){return Ar}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}}],[{key:"IDENTITY",get:function(){return Er.IDENTITY=Er.IDENTITY||Object.freeze(new r(Tr)),Er.IDENTITY}},{key:"ZERO",get:function(){return Er.ZERO=Er.ZERO||Object.freeze(new r(Sr)),Er.ZERO}}]),te()(r,[{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}},{key:"set",value:function(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,y){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=p,this[15]=y,this.check()}},{key:"setRowMajor",value:function(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,y){return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=r,this[9]=o,this[10]=l,this[11]=p,this[12]=n,this[13]=s,this[14]=f,this[15]=y,this.check()}},{key:"toRowMajor",value:function(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}},{key:"identity",value:function(){return this.copy(Tr)}},{key:"fromQuaternion",value:function(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,d=i*s,p=i*u,y=a*o,v=a*s,g=a*u;e[0]=1-f-p,e[1]=l+g,e[2]=h-v,e[3]=0,e[4]=l-g,e[5]=1-c-p,e[6]=d+y,e[7]=0,e[8]=h+v,e[9]=d-y,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,a=e.top,o=e.near,s=e.far;return s===1/0?r._computeInfinitePerspectiveOffCenter(this,t,n,i,a,o):function(e,t,r,n,i,a,o){var s=1/(r-t),u=1/(i-n),c=1/(a-o);e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0}(this,t,n,i,a,o,s),this.check()}},{key:"lookAt",value:function(e,t,r){if(1===arguments.length){var n=e;e=n.eye,t=n.center,r=n.up}return it(this,e,t=t||[0,0,0],r=r||[0,1,0]),this.check()}},{key:"ortho",value:function(e){var t=e.left,r=e.right,n=e.bottom,i=e.top,a=e.near,o=void 0===a?.1:a,s=e.far;return function(e,t,r,n,i,a,o){var s=1/(t-r),u=1/(n-i),c=1/(a-o);e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1}(this,t,r,n,i,o,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(e){var t=e.fovy,n=void 0===t?45*Math.PI/180:t,i=e.aspect,a=void 0===i?1:i,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(n>2*Math.PI)throw Error("radians");var h=n/2,d=s*Math.tan(h),p=d*a;return(new r).ortho({left:-p,right:p,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,r=void 0===t?void 0:t,n=e.fov,i=void 0===n?45*Math.PI/180:n,a=e.aspect,o=void 0===a?1:a,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;if((r=r||i)>2*Math.PI)throw Error("radians");return nt(this,r,o,u,l),this.check()}},{key:"determinant",value:function(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],p=e[13],y=e[14],v=e[15],(t*o-r*a)*(f*v-h*y)-(t*s-n*a)*(l*v-h*p)+(t*u-i*a)*(l*y-f*p)+(r*s-n*o)*(c*v-h*d)-(r*u-i*o)*(c*y-f*d)+(n*u-i*s)*(c*p-l*d);var e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,y,v}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*n,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*n,e[7]=this[9]*i,e[8]=this[10]*a,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return Ke(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return Je(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return Je(this,this,e),this.check()}},{key:"rotateX",value:function(e){return et(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],h=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-h*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+h*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return tt(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=kr()(e,3),r=t[0],n=t[1],i=t[2];return this.rotateX(r).rotateY(n).rotateZ(i)}},{key:"rotateAxis",value:function(e,t){return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,y,v,g,m,b,w,x,_,k,O,T,S,A,E=n[0],P=n[1],M=n[2],j=Math.hypot(E,P,M);j<1e-6||(E*=j=1/j,P*=j,M*=j,i=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],u=t[1],c=t[2],l=t[3],f=t[4],h=t[5],d=t[6],p=t[7],y=t[8],v=t[9],g=t[10],m=t[11],b=E*E*o+a,w=P*E*o+M*i,x=M*E*o-P*i,_=E*P*o-M*i,k=P*P*o+a,O=M*P*o+E*i,T=E*M*o+P*i,S=P*M*o-E*i,A=M*M*o+a,e[0]=s*b+f*w+y*x,e[1]=u*b+h*w+v*x,e[2]=c*b+d*w+g*x,e[3]=l*b+p*w+m*x,e[4]=s*_+f*k+y*O,e[5]=u*_+h*k+v*O,e[6]=c*_+d*k+g*O,e[7]=l*_+p*k+m*O,e[8]=s*T+f*S+y*A,e[9]=u*T+h*S+v*A,e[10]=c*T+d*S+g*A,e[11]=l*T+p*S+m*A,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?$e(this,this,e):$e(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return Ye(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(Se(t=Tt(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){switch(e.length){case 2:t=yt(t||[-0,-0],e,this);break;case 3:t=Ne(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Se(t,e.length),t}},{key:"transformAsVector",value:function(e,t){switch(e.length){case 2:t=Ve(t||[-0,-0],e,this);break;case 3:t=ze(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Se(t,e.length),t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,r){return this.identity().translate([e,t,r])}},{key:"transformPoint",value:function(e,t){return Ee("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return Ee("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return Ee("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(e,t,r,n,i,a){var o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=c,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=l,e[15]=0,e}}]),r}(ft);new We,new We,new We,new We,new We;new We,new We,new We,new We,new We,new We,new We,new We,new We,new We,new We,new We,Math.PI;var Mr=.1,jr=1e-12,Ir=1e-15,Lr=1e-20,Rr=(Math.PI,Math.PI,Math.PI,Math.PI,new xt),Cr=new xt,Dr=new xt,Nr=new xt,Fr=new xt;function Br(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Lr,n=10,i=0,a=0,o=Cr,s=Dr;o.identity(),s.copy(e);for(var u=r*Ur(s);a<n&&qr(s)>u;)Gr(s,Nr),Fr.copy(Nr).transpose(),s.multiplyRight(Nr),s.multiplyLeft(Fr),o.multiplyRight(Nr),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function Ur(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}var Vr=[1,0,0],zr=[2,2,1];function qr(e){for(var t=0,r=0;r<3;++r){var n=e[Rr.getElementIndex(zr[r],Vr[r])];t+=2*n*n}return Math.sqrt(t)}function Gr(e,t){for(var r=Ir,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[Rr.getElementIndex(zr[a],Vr[a])]);o>n&&(i=a,n=o)}var s=Vr[i],u=zr[i],c=1,l=0;if(Math.abs(e[Rr.getElementIndex(u,s)])>r){var f,h=(e[Rr.getElementIndex(u,u)]-e[Rr.getElementIndex(s,s)])/2/e[Rr.getElementIndex(u,s)];l=(f=h<0?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)))*(c=1/Math.sqrt(1+f*f))}return xt.IDENTITY.to(t),t[Rr.getElementIndex(s,s)]=t[Rr.getElementIndex(u,u)]=c,t[Rr.getElementIndex(u,s)]=l,t[Rr.getElementIndex(s,u)]=-l,t}function Hr(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Wr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wr(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Wr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Zr=new We,Xr=new We,Qr=new We,Kr=new We,Jr=new We,Yr=new xt,$r={diagonal:new xt,unitary:new xt};r(32);var en=r(17),tn=r.n(en);r(65),r(66);Math.log2;function rn(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var nn=Math.PI,an=nn/4,on=nn/180;function sn(e){var t=tn()(e,2),r=t[0],n=t[1];rn(Number.isFinite(r)),rn(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=n*on;return[512*(r*on+nn)/(2*nn),512*(nn+Math.log(Math.tan(an+.5*i)))/(2*nn)]}Math.PI;function un(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return cn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function cn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ln=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],fn=ln.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),hn=fn.concat([[.25,.5],[.75,.5]]),dn=function(){function e(t,r,n){c()(this,e),this.x=t,this.y=r,this.z=n}return w()(e,[{key:"update",value:function(e){var t=e.viewport,r=e.cullingVolume,n=e.elevationBounds,i=e.minZ,a=e.maxZ,o=e.bounds,s=e.offset,u=e.project,c=this.getBoundingVolume(n,s,u);if(o&&!this.insideBounds(o))return!1;if(r.computeVisibility(c)<0)return!1;if(!this.childVisible){var l=this.z;if(l<a&&l>=i){var f=c.distanceTo(t.cameraPosition)*t.scale/t.height;l+=Math.floor(Math.log2(f))}if(l>=a)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var h,d=un(this.children);try{for(d.s();!(h=d.n()).done;){h.value.update(e)}}catch(e){d.e(e)}finally{d.f()}return!0}},{key:"getSelected",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&e.push(this),this._children){var t,r=un(this._children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.getSelected(e)}}catch(e){r.e(e)}finally{r.f()}}return e}},{key:"insideBounds",value:function(e){var t=O()(e,4),r=t[0],n=t[1],i=t[2],a=t[3],o=512/Math.pow(2,this.z);return this.x*o<i&&this.y*o<a&&(this.x+1)*o>r&&(this.y+1)*o>n}},{key:"getBoundingVolume",value:function(e,t,r){if(r){var n,i=[],a=un(this.z<1?hn:this.z<2?fn:ln);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=bn(this.x+o[0],this.y+o[1],this.z);s[2]=e[0],i.push(r(s)),e[0]!==e[1]&&(s[2]=e[1],i.push(r(s)))}}catch(e){a.e(e)}finally{a.f()}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hr;if(!e||0===e.length)return t.halfAxes=new xt([0,0,0,0,0,0,0,0,0]),t.center=new We,t;var r,n=e.length,i=new We(0,0,0),a=Hr(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i.add(o)}}catch(e){a.e(e)}finally{a.f()}var s=1/n;i.multiplyByScalar(s);var u,c=0,l=0,f=0,h=0,d=0,p=0,y=Hr(e);try{for(y.s();!(u=y.n()).done;){var v=u.value,g=Zr.copy(v).subtract(i);c+=g.x*g.x,l+=g.x*g.y,f+=g.x*g.z,h+=g.y*g.y,d+=g.y*g.z,p+=g.z*g.z}}catch(e){y.e(e)}finally{y.f()}c*=s,l*=s,f*=s,h*=s,d*=s,p*=s;var m=Yr;m[0]=c,m[1]=l,m[2]=f,m[3]=l,m[4]=h,m[5]=d,m[6]=f,m[7]=d,m[8]=p;var b,w=Br(m,$r),x=w.unitary,_=t.halfAxes.copy(x),k=_.getColumn(0,Qr),O=_.getColumn(1,Kr),T=_.getColumn(2,Jr),S=-Number.MAX_VALUE,A=-Number.MAX_VALUE,E=-Number.MAX_VALUE,P=Number.MAX_VALUE,M=Number.MAX_VALUE,j=Number.MAX_VALUE,I=Hr(e);try{for(I.s();!(b=I.n()).done;){var L=b.value;Zr.copy(L),S=Math.max(Zr.dot(k),S),A=Math.max(Zr.dot(O),A),E=Math.max(Zr.dot(T),E),P=Math.min(Zr.dot(k),P),M=Math.min(Zr.dot(O),M),j=Math.min(Zr.dot(T),j)}}catch(e){I.e(e)}finally{I.f()}k=k.multiplyByScalar(.5*(P+S)),O=O.multiplyByScalar(.5*(M+A)),T=T.multiplyByScalar(.5*(j+E)),t.center.copy(k).add(O).add(T);var R=Xr.set(S-P,A-M,E-j).multiplyByScalar(.5),C=new xt([R[0],0,0,0,R[1],0,0,0,R[2]]);return t.halfAxes.multiplyRight(C),t}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*t,l=512-(this.y+1)*u;return new Qe([c,l,e[0]],[c+u,l+u,e[1]])}},{key:"children",get:function(){if(!this._children){var t=2*this.x,r=2*this.y,n=this.z+1;this._children=[new e(t,r,n),new e(t,r+1,n),new e(t+1,r,n),new e(t+1,r+1,n)]}return this._children}}]),e}();var pn=[-1/0,-1/0,1/0,1/0],yn={type:"url",value:null,validate:function(e,t){return t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))},equals:function(e,t){if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;var r=e.length;if(r!==t.length)return!1;for(var n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function vn(e,t){var r=[t.transformPoint([e[0],e[1]]),t.transformPoint([e[2],e[1]]),t.transformPoint([e[0],e[3]]),t.transformPoint([e[2],e[3]])];return[Math.min.apply(Math,W()(r.map((function(e){return e[0]})))),Math.min.apply(Math,W()(r.map((function(e){return e[1]})))),Math.max.apply(Math,W()(r.map((function(e){return e[0]})))),Math.max.apply(Math,W()(r.map((function(e){return e[1]}))))]}function gn(e,t){if(!e||!e.length)return null;Array.isArray(e)&&(e=e[Math.abs(t.x+t.y)%e.length]);var r=t.x,n=t.y,i=t.z;return e.replace("{x}",r).replace("{y}",n).replace("{z}",i).replace("{-y}",Math.pow(2,i)-n-1)}function mn(e,t){return 512*Math.pow(2,e)/t}function bn(e,t,r){var n=mn(r,512),i=e/n*360-180,a=Math.PI-2*Math.PI*t/n;return[i,180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)))]}function wn(e,t,r,n){var i=mn(r,n);return[e/i*512,t/i*512]}function xn(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(e.isGeospatial){var a=bn(t,r,n),o=O()(a,2),s=o[0],u=o[1],c=bn(t+1,r+1,n),l=O()(c,2),f=l[0],h=l[1];return{west:s,north:u,east:f,south:h}}var d=wn(t,r,n,i),p=O()(d,2),y=p[0],v=p[1],g=wn(t+1,r+1,n,i),m=O()(g,2),b=m[0],w=m[1];return{left:y,top:v,right:b,bottom:w}}function _n(e,t,r,n,i){for(var a=function(e,t,r){return r?vn(e,r).map((function(e){return e*t/512})):e.map((function(e){return e*t/512}))}(function(e,t,r){var n;if(t&&2===t.length){var i=O()(t,2),a=i[0],o=i[1],s=e.getBounds({z:a}),u=e.getBounds({z:o});n=[Math.min(s[0],u[0]),Math.min(s[1],u[1]),Math.max(s[2],u[2]),Math.max(s[3],u[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}(e,null,n),mn(t,r),i),o=O()(a,4),s=o[0],u=o[1],c=o[2],l=o[3],f=[],h=Math.floor(s);h<c;h++)for(var d=Math.floor(u);d<l;d++)f.push({x:h,y:d,z:t});return f}function kn(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.extent,o=e.tileSize,s=void 0===o?512:o,u=e.modelMatrix,c=e.modelMatrixInverse,l=e.zoomOffset,f=void 0===l?0:l,h=t.isGeospatial?Math.round(t.zoom+Math.log2(512/s))+f:Math.ceil(t.zoom)+f;if(Number.isFinite(n)&&h<n){if(!a)return[];h=n}Number.isFinite(r)&&h>r&&(h=r);var d=a;return u&&c&&a&&!t.isGeospatial&&(d=vn(a,u)),t.isGeospatial?function(e,t,r,n){var i=e.resolution?e.projectPosition:null,a=Object.values(e.getFrustumPlanes()).map((function(e){var t=e.normal,r=e.distance;return new yr(t.clone().negate(),r)})),o=new xr(a),s=e.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,c=r&&r[1]*s||0,l=e.pitch<=60?t:0;if(n){var f=n,h=O()(f,4),d=h[0],p=h[1],y=h[2],v=sn([d,h[3]]),g=sn([y,p]);n=[v[0],512-v[1],g[0],512-g[1]]}var m=new dn(0,0,0),b={viewport:e,project:i,cullingVolume:o,elevationBounds:[u,c],minZ:l,maxZ:t,bounds:n,offset:0};if(m.update(b),e.subViewports&&e.subViewports.length>1){for(b.offset=-1;m.update(b)&&!(--b.offset<-3););for(b.offset=1;m.update(b)&&!(++b.offset>3););}return m.getSelected()}(t,h,i,a):_n(t,h,s,d||pn,c)}function On(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tn(){var e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){var t=process.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var Sn=function(){function e(t,r){c()(this,e),this.name=t,this.type=r,this.sampleSize=1,this.reset()}return w()(e,[{key:"setSampleSize",value:function(e){return this.sampleSize=e,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(e){return this._count+=e,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(e){return this._count-=e,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Tn(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Tn()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}},{key:"_checkSampling",value:function(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}]),e}(),An=function(){function e(t){var r=t.id,n=t.stats;c()(this,e),this.id=r,this.stats={},this._initializeStats(n),Object.seal(this)}return w()(e,[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach((function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}})),e}},{key:"_initializeStats",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){return e._getOrCreate(t)}))}},{key:"_getOrCreate",value:function(e){if(!e||!e.name)return null;var t=e.name,r=e.type;return this.stats[t]||(this.stats[t]=e instanceof Sn?e:new Sn(t,r)),this.stats[t]}},{key:"size",get:function(){return Object.keys(this.stats).length}}]),e}();function En(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 Pn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?En(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):En(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Mn={id:"request-scheduler",throttleRequests:!0,maxRequests:6},jn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c()(this,e),On(this,"props",void 0),On(this,"stats",void 0),On(this,"activeRequestCount",0),On(this,"requestQueue",[]),On(this,"requestMap",new Map),On(this,"deferredUpdate",null),this.props=Pn(Pn({},Mn),t),this.stats=new An({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}return w()(e,[{key:"scheduleRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(e))return this.requestMap.get(e);var r={handle:e,priority:0,getPriority:t},n=new Promise((function(e){return r.resolve=e,r}));return this.requestQueue.push(r),this.requestMap.set(e,n),this._issueNewRequests(),n}},{key:"_issueRequest",value:function(e){var t=this,r=e.handle,n=e.resolve,i=!1,a=function(){i||(i=!0,t.requestMap.delete(r),t.activeRequestCount--,t._issueNewRequests())};return this.activeRequestCount++,n?n({done:a}):Promise.resolve({done:a})}},{key:"_issueNewRequests",value:function(){var e=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return e._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this._updateAllRequests();for(var t=0;t<e;++t){var r=this.requestQueue.shift();r&&this._issueRequest(r)}}}},{key:"_updateAllRequests",value:function(){for(var e=this.requestQueue,t=0;t<e.length;++t){var r=e[t];this._updateRequest(r)||(e.splice(t,1),this.requestMap.delete(r.handle),t--)}e.sort((function(e,t){return e.priority-t.priority}))}},{key:"_updateRequest",value:function(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}]),e}(),In={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global};function Ln(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Rn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}(In.global||In.self||In.window).mathgl={config:fe};var Cn=function(){function e(t){var r=this;c()(this,e),this.opts=t,this.onTileLoad=function(e){r.opts.onTileLoad(e),r.opts.maxCacheByteSize&&(r._cacheByteSize+=e.byteLength,r._resizeCache())},this._requestScheduler=new jn({maxRequests:t.maxRequests,throttleRequests:t.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this.setOptions(t)}return w()(e,[{key:"setOptions",value:function(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}},{key:"finalize",value:function(){var e,t=Ln(this._cache.values());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.isLoading&&r.abort()}}catch(e){t.e(e)}finally{t.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var e,t=Ln(this._cache.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value,n=this._cache.get(r);this._selectedTiles.includes(n)?n.setNeedsReload():this._cache.delete(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"update",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.zRange,i=r.modelMatrix,a=new Pr(i),o=!a.equals(this._modelMatrix);if(!e.equals(this._viewport)||o){o&&(this._modelMatrixInverse=i&&a.clone().invert(),this._modelMatrix=i&&a),this._viewport=e;var s=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:n,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map((function(e){return t._getTile(e,!0)})),this._dirty&&this._rebuildTree()}var u=this.updateTileStates();return this._dirty&&this._resizeCache(),u&&this._frameNumber++,this._frameNumber}},{key:"getTileIndices",value:function(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.modelMatrix,o=e.modelMatrixInverse,s=this.opts;return kn({viewport:t,maxZoom:r,minZoom:n,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:a,modelMatrixInverse:o,zoomOffset:s.zoomOffset})}},{key:"getTileMetadata",value:function(e){var t=e.x,r=e.y,n=e.z,i=this.opts.tileSize;return{bbox:xn(this._viewport,t,r,n,i)}}},{key:"getParentIndex",value:function(e){return e.x=Math.floor(e.x/2),e.y=Math.floor(e.y/2),e.z-=1,e}},{key:"updateTileStates",value:function(){this._updateTileStates(this.selectedTiles);var e,t=this.opts.maxRequests,r=[],n=0,i=!1,a=Ln(this._cache.values());try{for(a.s();!(e=a.n()).done;){var o=e.value,s=Boolean(1&o.state);o.isVisible!==s&&(i=!0,o.isVisible=s),o.isSelected=5===o.state,o.isLoading&&(n++,o.isSelected||r.push(o))}}catch(e){a.e(e)}finally{a.f()}if(t>0)for(;n>t&&r.length>0;){r.shift().abort(),n--}return i}},{key:"_rebuildTree",value:function(){var e,t=this._cache,r=Ln(t.values());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.parent=null,n.children.length=0}}catch(e){r.e(e)}finally{r.f()}var i,a=Ln(t.values());try{for(a.s();!(i=a.n()).done;){var o=i.value,s=this._getNearestAncestor(o.x,o.y,o.z);o.parent=s,s&&s.children.push(o)}}catch(e){a.e(e)}finally{a.f()}}},{key:"_updateTileStates",value:function(e){var t,r=this._cache,n=this.opts.refinementStrategy||"best-available",i=Ln(r.values());try{for(i.s();!(t=i.n()).done;){t.value.state=0}}catch(e){i.e(e)}finally{i.f()}var a,o=Ln(e);try{for(o.s();!(a=o.n()).done;){a.value.state=5}}catch(e){o.e(e)}finally{o.f()}if("never"!==n){var s,u=Ln(e);try{for(u.s();!(s=u.n()).done;){Nn(s.value,n)}}catch(e){u.e(e)}finally{u.f()}var c,l=Ln(e);try{for(l.s();!(c=l.n()).done;){var f=c.value;Dn(f)&&Fn(f)}}catch(e){l.e(e)}finally{l.f()}}}},{key:"_resizeCache",value:function(){var e=this._cache,t=this.opts,r=t.maxCacheSize||(t.maxCacheByteSize?1/0:5*this.selectedTiles.length),n=t.maxCacheByteSize||1/0;if(e.size>r||this._cacheByteSize>n){var i,a=Ln(e);try{for(a.s();!(i=a.n()).done;){var o=O()(i.value,2),s=o[0],u=o[1];if(u.isVisible||(this._cacheByteSize-=t.maxCacheByteSize?u.byteLength:0,e.delete(s),this.opts.onTileUnload(u)),e.size<=r&&this._cacheByteSize<=n)break}}catch(e){a.e(e)}finally{a.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((function(e,t){return e.z-t.z})),this._dirty=!1)}},{key:"_getTile",value:function(e,t){var r=e.x,n=e.y,i=e.z,a="".concat(r,",").concat(n,",").concat(i),o=this._cache.get(a),s=!1;return!o&&t?(o=new G({x:r,y:n,z:i}),Object.assign(o,this.getTileMetadata(o)),s=!0,this._cache.set(a,o),this._dirty=!0):o&&o.needsReload&&(s=!0),s&&o.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),o}},{key:"_getNearestAncestor",value:function(e,t,r){for(var n=this._minZoom,i=void 0===n?0:n,a={x:e,y:t,z:r};a.z>i;){a=this.getParentIndex(a);var o=this._getTile(a);if(o)return o}return null}},{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return this._selectedTiles.every((function(e){return e.isLoaded}))}}]),e}();function Dn(e){for(var t=e;t;){if(!1&t.state)return!0;if(t.isLoaded)return!1;t=t.parent}return!0}function Nn(e,t){for(var r,n=3;r=e.parent;){if(e.isLoaded&&(n=4,"best-available"===t))return;r.state=Math.max(r.state,n),e=r}}function Fn(e){var t,r=Ln(e.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.state=Math.max(n.state,3),n.isLoaded||Fn(n)}}catch(e){r.e(e)}finally{r.f()}}function Bn(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 Un(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bn(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vn(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var zn={data:[],dataComparator:yn.equals,renderSubLayers:{type:"function",value:function(e){return new v.GeoJsonLayer(e)},compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:function(e){},compare:!1},onTileUnload:{type:"function",value:function(e){},compare:!1},onTileError:{type:"function",value:function(e){return console.error(e)},compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0},qn=function(e){f()(r,e);var t=Vn(r);function r(){return c()(this,r),t.apply(this,arguments)}return w()(r,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var e;null===(e=this.state.tileset)||void 0===e||e.finalize()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=e.changeFlags,n=this.state.tileset,i=r.propsOrDataChanged||r.updateTriggersChanged,a=r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData);n?i&&(n.setOptions(this._getTilesetOptions(t)),a?n.reloadAll():this.state.tileset.tiles.forEach((function(e){e.layers=null}))):(n=new Cn(this._getTilesetOptions(t)),this.setState({tileset:n})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(e){var t=e.tileSize,r=e.maxCacheSize,n=e.maxCacheByteSize,i=e.refinementStrategy,a=e.extent;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:t,refinementStrategy:i,extent:a,maxRequests:e.maxRequests,zoomOffset:e.zoomOffset,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var e=this.state.tileset,t=this.props,r=t.zRange,n=t.modelMatrix,i=e.update(this.context.viewport,{zRange:r,modelMatrix:n}),a=e.isLoaded,o=this.state.isLoaded!==a,s=this.state.frameNumber!==i;a&&(o||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=a}},{key:"_onViewportLoad",value:function(){var e=this.state.tileset,t=this.props.onViewportLoad;t&&t(e.selectedTiles)}},{key:"_onTileLoad",value:function(e){this.props.onTileLoad(e),e.layers=null,e.isVisible&&this.setNeedsUpdate()}},{key:"_onTileError",value:function(e,t){this.props.onTileError(e),t.layers=null,t.isVisible&&this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(e){this.props.onTileUnload(e)}},{key:"getTileData",value:function(e){var t=this.props,r=t.data,n=t.getTileData,i=t.fetch,a=e.signal;return e.url=gn(r,e),n?n(e):e.url?i(e.url,{propName:"data",layer:this,signal:a}):null}},{key:"renderSubLayers",value:function(e){return this.props.renderSubLayers(e)}},{key:"getSubLayerPropsByTile",value:function(e){return null}},{key:"getPickingInfo",value:function(e){var t=e.info,r=e.sourceLayer;return t.tile=r.props.tile,t}},{key:"_updateAutoHighlight",value:function(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}},{key:"renderLayers",value:function(){var e=this;return this.state.tileset.tiles.map((function(t){var r=e.getSubLayerPropsByTile(t);if(t.isLoaded||t.content)if(t.layers)r&&t.layers[0]&&Object.keys(r).some((function(e){return t.layers[0].props[e]!==r[e]}))&&(t.layers=t.layers.map((function(e){return e.clone(r)})));else{var n=e.renderSubLayers(Un(Un({},e.props),{},{id:"".concat(e.id,"-").concat(t.x,"-").concat(t.y,"-").concat(t.z),data:t.content,_offset:0,tile:t}));t.layers=Object(v._flatten)(n,Boolean).map((function(e){return e.clone(Un({tile:t},r))}))}else;return t.layers}))}},{key:"filterSubLayer",value:function(e){return e.layer.props.tile.isVisible}},{key:"isLoaded",get:function(){return this.state.tileset.selectedTiles.every((function(e){return e.isLoaded&&e.layers&&e.layers.every((function(e){return e.isLoaded}))}))}}]),r}(v.CompositeLayer);qn.layerName="TileLayer",qn.defaultProps=zn;var Gn=r(15),Hn=r.n(Gn);function Wn(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 Zn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wn(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xn(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var Qn=function(e){f()(r,e);var t=Xn(r);function r(){return c()(this,r),t.apply(this,arguments)}return w()(r,[{key:"getShaders",value:function(){var e=Hn()(y()(r.prototype),"getShaders",this).call(this);return e.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nvarying float vTime;\n","fs:#main-start":"if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"if(fadeTrail) {\n color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n"},e}},{key:"initializeState",value:function(e){Hn()(y()(r.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(e){var t=this.props,n=t.fadeTrail,i=t.trailLength,a=t.currentTime;e.uniforms=Zn(Zn({},e.uniforms),{},{fadeTrail:n,trailLength:i,currentTime:a}),Hn()(y()(r.prototype),"draw",this).call(this,e)}}]),r}(v.PathLayer);Qn.layerName="TripsLayer",Qn.defaultProps={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:null}};var Kn=r(23);function Jn(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Yn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Yn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $n(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}function ei(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 ti(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ei(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ei(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ri=ti(ti({},v.PolygonLayer.defaultProps),{},{getHexagons:{type:"accessor",value:function(e){return e.hexagons}}}),ni=function(e){f()(r,e);var t=$n(r);function r(){return c()(this,r),t.apply(this,arguments)}return w()(r,[{key:"updateState",value:function(e){var t=e.props,r=(e.oldProps,e.changeFlags);if(r.dataChanged||r.updateTriggers&&r.updateTriggers.getHexagons){var n,i=t.data,a=t.getHexagons,o=[],s=Object(v.createIterable)(i),u=s.iterable,c=s.objectInfo,l=Jn(u);try{for(l.s();!(n=l.n()).done;){var f=n.value;c.index++;var h,d=a(f,c),p=Jn(Object(Kn.h3SetToMultiPolygon)(d,!0));try{for(p.s();!(h=p.n()).done;){var y=h.value;o.push(this.getSubLayerRow({polygon:y},f,c.index))}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}this.setState({polygons:o})}}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,r=e.extruded,n=e.wireframe,i=e.filled,a=e.stroked,o=e.lineWidthScale,s=e.lineWidthMinPixels,u=e.lineWidthMaxPixels,c=e.lineJointRounded,l=e.lineMiterLimit,f=e.lineDashJustified,h=e.material,d=e.getFillColor,p=e.getLineColor,y=e.getLineWidth,g=e.getLineDashArray,m=e.getElevation,b=e.transitions,w=e.updateTriggers;return new(this.getSubLayerClass("cluster-region",v.PolygonLayer))({filled:i,wireframe:n,extruded:r,elevationScale:t,stroked:a,lineWidthScale:o,lineWidthMinPixels:s,lineWidthMaxPixels:u,lineJointRounded:c,lineMiterLimit:l,lineDashJustified:f,material:h,transitions:b,getFillColor:this.getSubLayerAccessor(d),getLineColor:this.getSubLayerAccessor(p),getLineWidth:this.getSubLayerAccessor(y),getLineDashArray:this.getSubLayerAccessor(g),getElevation:this.getSubLayerAccessor(m)},this.getSubLayerProps({id:"cluster-region",updateTriggers:w}),{data:this.state.polygons,getPolygon:function(e){return e.polygon}})}}]),r}(v.CompositeLayer);ni.defaultProps=ri,ni.layerName="H3ClusterLayer";var ii=r(10),ai=r.n(ii);function oi(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}function si(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 ui(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?si(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):si(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ci(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return li(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return li(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function li(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fi(e,t){t=void 0===t?e[0][0]:t;var r,n=ci(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=i[0]-t;a>180?i[0]-=360:a<-180&&(i[0]+=360)}}catch(e){n.e(e)}finally{n.f()}}function hi(e,t,r){var n=Object(Kn.h3ToGeo)(e),i=O()(n,2),a=i[0],o=i[1],s=t.length;fi(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c<u;c++)t[c][0]=we(o,t[c][0],r),t[c][1]=we(a,t[c][1],r)}function di(e,t,r){var n=e(t,r),i=Object(Kn.h3ToGeo)(n),a=O()(i,2),o=a[0];return[a[1],o]}function pi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,n=Object(Kn.h3ToGeoBoundary)(e,!0);if(1!==t?hi(e,n,t):fi(n),r){var i,a=new Float64Array(2*n.length),o=0,s=ci(n);try{for(s.s();!(i=s.n()).done;){var u=i.value;a[o++]=u[0],a[o++]=u[1]}}catch(e){s.e(e)}finally{s.f()}return a}return n}var yi=ui(ui({},v.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(e){return e.hexagon}},extruded:!0});delete yi.getLineDashArray;var vi=function(e){f()(r,e);var t=oi(r);function r(){return c()(this,r),t.apply(this,arguments)}return w()(r,[{key:"shouldUpdateState",value:function(e){var t=e.changeFlags;return this._shouldUseHighPrecision()?t.propsOrDataChanged:t.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=(e.oldProps,e.changeFlags);if(!0!==t.highPrecision&&(r.dataChanged||r.updateTriggers&&r.updateTriggers.getHexagon)){var n=this._calculateH3DataProps(t);this.setState(n)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(e){var t,r=-1,n=!1,i=!1,a=Object(v.createIterable)(e.data),o=a.iterable,s=a.objectInfo,u=ci(o);try{for(u.s();!(t=u.n()).done;){var c=t.value;s.index++;var l=e.getHexagon(c,s),f=Object(Kn.h3GetResolution)(l);if(r<0){if(r=f,!e.highPrecision)break}else if(r!==f){i=!0;break}if(Object(Kn.h3IsPentagon)(l)){n=!0;break}}}catch(e){u.e(e)}finally{u.f()}return{resolution:r,edgeLengthKM:r>=0?Object(Kn.edgeLength)(r,Kn.UNITS.km):0,hasMultipleRes:i,hasPentagon:n}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var e=this.state,t=e.resolution,r=e.hasPentagon,n=e.hasMultipleRes;return this.context.viewport.resolution||n||r||t>=0&&t<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,r=t.resolution,n=t.edgeLengthKM,i=t.centerHex;if(!(r<0)){var a=this.props.centerHexagon||Object(Kn.geoToH3)(e.latitude,e.longitude,r);if(i!==a){if(i){var o=Object(Kn.h3Distance)(i,a);if(o>=0&&o*n<10)return}var s=e.distanceScales.unitsPerMeter,u=pi(a),c=Object(Kn.h3ToGeo)(a),l=O()(c,2),f=l[0],h=l[1],d=e.projectFlat([h,f]),p=O()(d,2),y=p[0],v=p[1];u=u.map((function(t){var r=e.projectFlat(t);return[(r[0]-y)/s[0],(r[1]-v)/s[1]]})),this.setState({centerHex:a,vertices:u})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,r=e.material,n=e.coverage,i=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getFillColor,d=e.getElevation,p=e.getLineColor,y=e.getLineWidth,v=e.transitions,g=e.updateTriggers;return{elevationScale:t,extruded:i,coverage:n,wireframe:a,stroked:o,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:r,getElevation:d,getFillColor:h,getLineColor:p,getLineWidth:y,transitions:v,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,r=e.getHexagon,n=e.updateTriggers,i=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",v.PolygonLayer),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===ai()(e)?ui(ui({},e),{},{coverage:t}):{getHexagon:e,coverage:t}}(n.getHexagon,i),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(e,t){return pi(r(e,t),i,!0)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,r=e.getHexagon,n=e.updateTriggers,i=this.getSubLayerClass("hexagon-cell",v.ColumnLayer),a=this._getForwardProps();return a.updateTriggers.getPosition=n.getHexagon,new i(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:di.bind(null,r)})}}]),r}(v.CompositeLayer);vi.defaultProps=yi,vi.layerName="H3HexagonLayer";var gi=r(29),mi=r(12),bi=r.n(mi);function wi(){return!("object"===("undefined"==typeof process?"undefined":ai()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===ai()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===ai()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":ai()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}var xi=wi();function _i(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var ki=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";c()(this,e),this.storage=_i(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return w()(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function Oi(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));var a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var Ti={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function Si(e){return"string"==typeof e?Ti[e.toUpperCase()]||Ti.WHITE:e}function Ai(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ei(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ei(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pi(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=Ai(i);try{var o=function(){var n=t.value;"function"==typeof e[n]&&(r.find((function(e){return n===e}))||(e[n]=e[n].bind(e)))};for(a.s();!(t=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}function Mi(e,t){if(!e)throw new Error(t||"Assertion failed")}var ji={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":ai()(process))&&process},Ii=ji.window||ji.self||ji.global,Li=ji.process||{};console;function Ri(){var e;if(xi&&Ii.performance)e=Ii.performance.now();else if(Li.hrtime){var t=Li.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var Ci={debug:xi&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Di={enabled:!0,level:0};function Ni(){}var Fi={},Bi={once:!0};function Ui(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}var Vi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=t.id;c()(this,e),this.id=r,this.VERSION="8.6.5",this._startTs=Ri(),this._deltaTs=Ri(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new ki("__probe-".concat(this.id,"__"),Di),this.userData={},this.timeStamp("".concat(this.id," started")),Pi(this),Object.seal(this)}return w()(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Ri()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Ri()-this._deltaTs).toPrecision(10))}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"assert",value:function(e,t){Mi(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Ci.warn,arguments,Bi)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Ci.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,Ci.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Ci.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){return this._getLogFunction(e,t,Ci.debug||Ci.info,arguments,Bi)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Ni,r&&[r],{tag:Ui(t)}):Ni}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,i=e.image,a=e.message,o=void 0===a?"":a,s=e.scale,u=void 0===s?1:s;return this._shouldLog(t||n)?xi?function(e){var t=e.image,r=e.message,n=void 0===r?"":r,i=e.scale,a=void 0===i?1:i;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=Oi(o,n,a);(e=console).log.apply(e,W()(t))},o.src=t,Ni}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,W()(Oi(t,n,a))),Ni}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,W()(Oi(c,n,a)))},c.src=t.toDataURL(),Ni}return Ni}({image:i,message:o,scale:u}):function(e){var t=e.image,n=(e.message,e.scale),i=void 0===n?1:n,a=null;try{a=r(108)}catch(e){}if(a)return function(){return a(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(e){return console.log(e)}))};return Ni}({image:i,message:o,scale:u}):Ni}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(_()({},e,t))}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||Ni)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=qi({logLevel:e,message:t,opts:r}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||Ni)}},{key:"withGroup",value:function(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=zi(e)}},{key:"_getLogFunction",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(e)){var a;i=qi({logLevel:e,message:t,args:n,opts:i}),Mi(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Ri();var o=i.tag||i.message;if(i.once){if(Fi[o])return Ni;Fi[o]=Ri()}return t=Gi(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(W()(i.args)))}return Ni}},{key:"level",set:function(e){this.setLevel(e)},get:function(){return this.getLevel()}},{key:"priority",set:function(e){this.level=e},get:function(){return this.level}}]),e}();function zi(e){if(!e)return 0;var t;switch(ai()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Mi(Number.isFinite(t)&&t>=0),t}function qi(e){var t=e.logLevel,r=e.message;e.logLevel=zi(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(e.args=n,ai()(t)){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var i=ai()(e.message);return Mi("string"===i||"object"===i),Object.assign(e,e.opts)}function Gi(e,t,r){if("string"==typeof t){var n=r.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),i=t,a=r.color,o=r.background,xi||"string"!=typeof i||(a&&(a=Si(a),i="[".concat(a,"m").concat(i,"[39m")),o&&(a=Si(o),i="[".concat(o+10,"m").concat(i,"[49m"))),t=i}var i,a,o,s;return t}Vi.VERSION="8.6.5";var Hi=new Vi({id:"luma.gl"});function Wi(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function Zi(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version)))}function Xi(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function Qi(e){return Wi(Zi(e),"Invalid WebGLRenderingContext"),e}function Ki(e){return Wi(Xi(e),"Requires WebGL2"),e}var Ji=r(14),Yi={};function $i(e,t){var r;Yi[e]=!0,void 0!==t&&(r=t,Ji.global.console&&Ji.global.console.error&&Ji.global.console.error(r))}var ea=function e(t){var r=t.gl;this.ext=t,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(t.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new e.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};(ea.VertexAttrib=function(e){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var ta,ra=function(e){var t=this;this.gl=e,function(e){var t=e.getError;e.getError=function(){var r;do{0!==(r=t.apply(e))&&(Yi[r]=!0)}while(0!==r);for(r in Yi)if(Yi[r])return delete Yi[r],parseInt(r,10);return 0}}(e);var r=this.original={getParameter:e.getParameter,enableVertexAttribArray:e.enableVertexAttribArray,disableVertexAttribArray:e.disableVertexAttribArray,bindBuffer:e.bindBuffer,getVertexAttrib:e.getVertexAttrib,vertexAttribPointer:e.vertexAttribPointer};e.getParameter=function(e){return e===t.VERTEX_ARRAY_BINDING_OES?t.currentVertexArrayObject===t.defaultVertexArrayObject?null:t.currentVertexArrayObject:r.getParameter.apply(this,arguments)},e.enableVertexAttribArray=function(e){var n=t.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,e);var i=n.attribs[e];return i.enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},e.disableVertexAttribArray=function(e){var n=t.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,e);var i=n.attribs[e];return i.enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},e.bindBuffer=function(e,n){switch(e){case 34962:t.currentArrayBuffer=n;break;case 34963:t.currentVertexArrayObject.elementArrayBuffer=n}return r.bindBuffer.apply(this,arguments)},e.getVertexAttrib=function(e,n){var i=t.currentVertexArrayObject,a=i.attribs[e];switch(n){case 34975:return a.buffer;case 34338:return a.enabled;case 34339:return a.size;case 34340:return a.stride;case 34341:return a.type;case 34922:return a.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},e.vertexAttribPointer=function(e,n,i,a,o,s){var u=t.currentVertexArrayObject;u.maxAttrib=Math.max(u.maxAttrib,e);var c=u.attribs[e];return c.buffer=t.currentArrayBuffer,c.size=n,c.type=i,c.normalized=a,c.stride=o,c.offset=s,c.recache(),r.vertexAttribPointer.apply(this,arguments)},e.instrumentExtension&&e.instrumentExtension(this,"OES_vertex_array_object"),e.canvas&&e.canvas.addEventListener("webglcontextrestored",(function(){var e;e="OESVertexArrayObject emulation library context restored",Ji.global.console&&Ji.global.console.log&&Ji.global.console.log(e),t.reset_()}),!0),this.reset_()};ra.prototype.VERTEX_ARRAY_BINDING_OES=34229,ra.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var e=0;e<this.vertexArrayObjects.length;++e)this.vertexArrayObjects.isAlive=!1;var t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new ea(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},ra.prototype.createVertexArrayOES=function(){var e=new ea(this);return this.vertexArrayObjects.push(e),e},ra.prototype.deleteVertexArrayOES=function(e){e.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(e),1),this.currentVertexArrayObject===e&&this.bindVertexArrayOES(null)},ra.prototype.isVertexArrayOES=function(e){return!!(e&&e instanceof ea&&e.hasBeenBound&&e.ext===this)},ra.prototype.bindVertexArrayOES=function(e){var t=this.gl;if(!e||e.isAlive){var r=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=e||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(n!==i){n&&i.elementArrayBuffer===n.elementArrayBuffer||r.bindBuffer.call(t,34963,i.elementArrayBuffer);for(var a=this.currentArrayBuffer,o=Math.max(n?n.maxAttrib:0,i.maxAttrib),s=0;s<=o;s++){var u=i.attribs[s],c=n?n.attribs[s]:null;if(n&&u.enabled===c.enabled||(u.enabled?r.enableVertexAttribArray.call(t,s):r.disableVertexAttribArray.call(t,s)),u.enabled){var l=!1;n&&u.buffer===c.buffer||(a!==u.buffer&&(r.bindBuffer.call(t,34962,u.buffer),a=u.buffer),l=!0),(l||u.cached!==c.cached)&&r.vertexAttribPointer.call(t,s,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==a&&r.bindBuffer.call(t,34962,this.currentArrayBuffer)}}else $i(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var na,ia=function(e){return Xi(e)?void 0:0},aa=(ta={},_()(ta,3074,(function(e){return Xi(e)?void 0:36064})),_()(ta,35723,(function(e){return Xi(e)?void 0:4352})),_()(ta,35977,ia),_()(ta,32937,ia),_()(ta,36795,(function(e,t){var r=Xi(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0})),_()(ta,37445,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),_()(ta,37446,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),_()(ta,34047,(function(e,t){var r=e.luma.extensions.EXT_texture_filter_anisotropic;return r?t(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),_()(ta,32883,ia),_()(ta,35071,ia),_()(ta,37447,ia),_()(ta,36063,(function(e,t){if(!Xi(e)){var r=e.getExtension("WEBGL_draw_buffers");return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),_()(ta,35379,ia),_()(ta,35374,ia),_()(ta,35377,ia),_()(ta,34852,(function(e){if(!Xi(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}})),_()(ta,36203,(function(e){return e.getExtension("OES_element_index")?2147483647:65535})),_()(ta,33001,(function(e){return e.getExtension("OES_element_index")?16777216:65535})),_()(ta,33e3,(function(e){return 16777216})),_()(ta,37157,ia),_()(ta,35373,ia),_()(ta,35657,ia),_()(ta,36183,ia),_()(ta,37137,ia),_()(ta,34045,ia),_()(ta,35978,ia),_()(ta,35979,ia),_()(ta,35968,ia),_()(ta,35376,ia),_()(ta,35375,ia),_()(ta,35659,ia),_()(ta,37154,ia),_()(ta,35371,ia),_()(ta,35658,ia),_()(ta,35076,ia),_()(ta,35077,ia),_()(ta,35380,ia),ta);var oa,sa,ua,ca=(na={},_()(na,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Wi(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),_()(na,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Wi(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),_()(na,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Wi(!1)}}),_()(na,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Wi(!1)},deleteQuery:function(){Wi(!1)},beginQuery:function(){Wi(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),na),la={readBuffer:function(e,t,r){Xi(e)&&t(r)},getVertexAttrib:function(e,t,r,n){var i,a=function(e,t){return{webgl2:Xi(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(n){case 35069:i=!!o&&void 0;break;case 35070:i=o||s?void 0:0}return void 0!==i?i:t(r,n)},getProgramParameter:function(e,t,r,n){if(!Xi(e))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return t(r,n)},getInternalformatParameter:function(e,t,r,n,i){if(!Xi(e))switch(i){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(r,n,i)},getTexParameter:function(e,t,r,n){switch(n){case 34046:var i=e.luma.extensions.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(r,n)},getParameter:function(e,t,r){var n=aa[r],i="function"==typeof n?n(e,t,r):n;return void 0!==i?i:t(r)},hint:function(e,t,r,n){return t(r,n)}};function fa(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ha(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ha(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function ha(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function da(e,t){var r=t.extension,n=t.target,i=t.target2,a=ca[r];Wi(a);for(var o=a.meta,s=(void 0===o?{}:o).suffix,u=void 0===s?"":s,c=e.getExtension(r),l=function(){var t=h[f],r="".concat(t).concat(u),o=null;"meta"===t||"function"==typeof e[t]||(c&&"function"==typeof c[r]?o=function(){return c[r].apply(c,arguments)}:"function"==typeof a[t]&&(o=a[t].bind(n))),o&&(n[t]=o,i[t]=o)},f=0,h=Object.keys(a);f<h.length;f++)l()}("undefined"!=typeof global?global:window).polyfillContext=function(e){e.luma=e.luma||{};var t=e.luma;return t.polyfilled||(!function(e){if("function"!=typeof e.createVertexArray){var t=e.getSupportedExtensions;e.getSupportedExtensions=function(){var e=t.call(this)||[];return e.indexOf("OES_vertex_array_object")<0&&e.push("OES_vertex_array_object"),e};var r=e.getExtension;e.getExtension=function(t){var n=r.call(this,t);return n||("OES_vertex_array_object"!==t?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new ra(this)),this.__OESVertexArrayObject))}}}(e),function(e){e.luma.extensions={};var t,r=fa(e.getSupportedExtensions()||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.luma[n]=e.getExtension(n)}}catch(e){r.e(e)}finally{r.f()}}(e),function(e,t){var r,n=fa(Object.getOwnPropertyNames(t));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&da(e,{extension:i,target:e.luma,target2:e})}}catch(e){n.e(e)}finally{n.f()}}(e,ca),function(e,t){var r=t.target,n=t.target2;Object.keys(la).forEach((function(t){if("function"==typeof la[t]){var i=e[t]?e[t].bind(e):function(){},a=la[t].bind(null,e,i);r[t]=a,n[t]=a}}))}(e,{target:t,target2:e}),t.polyfilled=!0),e};var pa=(oa={},_()(oa,3042,!1),_()(oa,32773,new Float32Array([0,0,0,0])),_()(oa,32777,32774),_()(oa,34877,32774),_()(oa,32969,1),_()(oa,32968,0),_()(oa,32971,1),_()(oa,32970,0),_()(oa,3106,new Float32Array([0,0,0,0])),_()(oa,3107,[!0,!0,!0,!0]),_()(oa,2884,!1),_()(oa,2885,1029),_()(oa,2929,!1),_()(oa,2931,1),_()(oa,2932,513),_()(oa,2928,new Float32Array([0,1])),_()(oa,2930,!0),_()(oa,3024,!0),_()(oa,36006,null),_()(oa,2886,2305),_()(oa,33170,4352),_()(oa,2849,1),_()(oa,32823,!1),_()(oa,32824,0),_()(oa,10752,0),_()(oa,32938,1),_()(oa,32939,!1),_()(oa,3089,!1),_()(oa,3088,new Int32Array([0,0,1024,1024])),_()(oa,2960,!1),_()(oa,2961,0),_()(oa,2968,4294967295),_()(oa,36005,4294967295),_()(oa,2962,519),_()(oa,2967,0),_()(oa,2963,4294967295),_()(oa,34816,519),_()(oa,36003,0),_()(oa,36004,4294967295),_()(oa,2964,7680),_()(oa,2965,7680),_()(oa,2966,7680),_()(oa,34817,7680),_()(oa,34818,7680),_()(oa,34819,7680),_()(oa,2978,[0,0,1024,1024]),_()(oa,3333,4),_()(oa,3317,4),_()(oa,37440,!1),_()(oa,37441,!1),_()(oa,37443,37444),_()(oa,35723,4352),_()(oa,36010,null),_()(oa,35977,!1),_()(oa,3330,0),_()(oa,3332,0),_()(oa,3331,0),_()(oa,3314,0),_()(oa,32878,0),_()(oa,3316,0),_()(oa,3315,0),_()(oa,32877,0),oa),ya=function(e,t,r){return t?e.enable(r):e.disable(r)},va=function(e,t,r){return e.hint(r,t)},ga=function(e,t,r){return e.pixelStorei(r,t)};function ma(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var ba=(sa={},_()(sa,3042,ya),_()(sa,32773,(function(e,t){return e.blendColor.apply(e,W()(t))})),_()(sa,32777,"blendEquation"),_()(sa,34877,"blendEquation"),_()(sa,32969,"blendFunc"),_()(sa,32968,"blendFunc"),_()(sa,32971,"blendFunc"),_()(sa,32970,"blendFunc"),_()(sa,3106,(function(e,t){return e.clearColor.apply(e,W()(t))})),_()(sa,3107,(function(e,t){return e.colorMask.apply(e,W()(t))})),_()(sa,2884,ya),_()(sa,2885,(function(e,t){return e.cullFace(t)})),_()(sa,2929,ya),_()(sa,2931,(function(e,t){return e.clearDepth(t)})),_()(sa,2932,(function(e,t){return e.depthFunc(t)})),_()(sa,2928,(function(e,t){return e.depthRange.apply(e,W()(t))})),_()(sa,2930,(function(e,t){return e.depthMask(t)})),_()(sa,3024,ya),_()(sa,35723,va),_()(sa,36006,(function(e,t){var r=Xi(e)?36009:36160;return e.bindFramebuffer(r,t)})),_()(sa,2886,(function(e,t){return e.frontFace(t)})),_()(sa,33170,va),_()(sa,2849,(function(e,t){return e.lineWidth(t)})),_()(sa,32823,ya),_()(sa,32824,"polygonOffset"),_()(sa,10752,"polygonOffset"),_()(sa,35977,ya),_()(sa,32938,"sampleCoverage"),_()(sa,32939,"sampleCoverage"),_()(sa,3089,ya),_()(sa,3088,(function(e,t){return e.scissor.apply(e,W()(t))})),_()(sa,2960,ya),_()(sa,2961,(function(e,t){return e.clearStencil(t)})),_()(sa,2968,(function(e,t){return e.stencilMaskSeparate(1028,t)})),_()(sa,36005,(function(e,t){return e.stencilMaskSeparate(1029,t)})),_()(sa,2962,"stencilFuncFront"),_()(sa,2967,"stencilFuncFront"),_()(sa,2963,"stencilFuncFront"),_()(sa,34816,"stencilFuncBack"),_()(sa,36003,"stencilFuncBack"),_()(sa,36004,"stencilFuncBack"),_()(sa,2964,"stencilOpFront"),_()(sa,2965,"stencilOpFront"),_()(sa,2966,"stencilOpFront"),_()(sa,34817,"stencilOpBack"),_()(sa,34818,"stencilOpBack"),_()(sa,34819,"stencilOpBack"),_()(sa,2978,(function(e,t){return e.viewport.apply(e,W()(t))})),_()(sa,3333,ga),_()(sa,3317,ga),_()(sa,37440,ga),_()(sa,37441,ga),_()(sa,37443,ga),_()(sa,3330,ga),_()(sa,3332,ga),_()(sa,3331,ga),_()(sa,36010,(function(e,t){return e.bindFramebuffer(36008,t)})),_()(sa,3314,ga),_()(sa,32878,ga),_()(sa,3316,ga),_()(sa,3315,ga),_()(sa,32877,ga),_()(sa,"framebuffer",(function(e,t){var r=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,r)})),_()(sa,"blend",(function(e,t){return t?e.enable(3042):e.disable(3042)})),_()(sa,"blendColor",(function(e,t){return e.blendColor.apply(e,W()(t))})),_()(sa,"blendEquation",(function(e,t){t=ma(t)?t:[t,t],e.blendEquationSeparate.apply(e,W()(t))})),_()(sa,"blendFunc",(function(e,t){t=ma(t)&&2===t.length?[].concat(W()(t),W()(t)):t,e.blendFuncSeparate.apply(e,W()(t))})),_()(sa,"clearColor",(function(e,t){return e.clearColor.apply(e,W()(t))})),_()(sa,"clearDepth",(function(e,t){return e.clearDepth(t)})),_()(sa,"clearStencil",(function(e,t){return e.clearStencil(t)})),_()(sa,"colorMask",(function(e,t){return e.colorMask.apply(e,W()(t))})),_()(sa,"cull",(function(e,t){return t?e.enable(2884):e.disable(2884)})),_()(sa,"cullFace",(function(e,t){return e.cullFace(t)})),_()(sa,"depthTest",(function(e,t){return t?e.enable(2929):e.disable(2929)})),_()(sa,"depthFunc",(function(e,t){return e.depthFunc(t)})),_()(sa,"depthMask",(function(e,t){return e.depthMask(t)})),_()(sa,"depthRange",(function(e,t){return e.depthRange.apply(e,W()(t))})),_()(sa,"dither",(function(e,t){return t?e.enable(3024):e.disable(3024)})),_()(sa,"derivativeHint",(function(e,t){e.hint(35723,t)})),_()(sa,"frontFace",(function(e,t){return e.frontFace(t)})),_()(sa,"mipmapHint",(function(e,t){return e.hint(33170,t)})),_()(sa,"lineWidth",(function(e,t){return e.lineWidth(t)})),_()(sa,"polygonOffsetFill",(function(e,t){return t?e.enable(32823):e.disable(32823)})),_()(sa,"polygonOffset",(function(e,t){return e.polygonOffset.apply(e,W()(t))})),_()(sa,"sampleCoverage",(function(e,t){return e.sampleCoverage.apply(e,W()(t))})),_()(sa,"scissorTest",(function(e,t){return t?e.enable(3089):e.disable(3089)})),_()(sa,"scissor",(function(e,t){return e.scissor.apply(e,W()(t))})),_()(sa,"stencilTest",(function(e,t){return t?e.enable(2960):e.disable(2960)})),_()(sa,"stencilMask",(function(e,t){var r=t=ma(t)?t:[t,t],n=O()(r,2),i=n[0],a=n[1];e.stencilMaskSeparate(1028,i),e.stencilMaskSeparate(1029,a)})),_()(sa,"stencilFunc",(function(e,t){var r=t=ma(t)&&3===t.length?[].concat(W()(t),W()(t)):t,n=O()(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5];e.stencilFuncSeparate(1028,i,a,o),e.stencilFuncSeparate(1029,s,u,c)})),_()(sa,"stencilOp",(function(e,t){var r=t=ma(t)&&3===t.length?[].concat(W()(t),W()(t)):t,n=O()(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5];e.stencilOpSeparate(1028,i,a,o),e.stencilOpSeparate(1029,s,u,c)})),_()(sa,"viewport",(function(e,t){return e.viewport.apply(e,W()(t))})),sa);function wa(e,t,r){return void 0!==t[e]?t[e]:r[e]}var xa={blendEquation:function(e,t,r){return e.blendEquationSeparate(wa(32777,t,r),wa(34877,t,r))},blendFunc:function(e,t,r){return e.blendFuncSeparate(wa(32969,t,r),wa(32968,t,r),wa(32971,t,r),wa(32970,t,r))},polygonOffset:function(e,t,r){return e.polygonOffset(wa(32824,t,r),wa(10752,t,r))},sampleCoverage:function(e,t,r){return e.sampleCoverage(wa(32938,t,r),wa(32939,t,r))},stencilFuncFront:function(e,t,r){return e.stencilFuncSeparate(1028,wa(2962,t,r),wa(2967,t,r),wa(2963,t,r))},stencilFuncBack:function(e,t,r){return e.stencilFuncSeparate(1029,wa(34816,t,r),wa(36003,t,r),wa(36004,t,r))},stencilOpFront:function(e,t,r){return e.stencilOpSeparate(1028,wa(2964,t,r),wa(2965,t,r),wa(2966,t,r))},stencilOpBack:function(e,t,r){return e.stencilOpSeparate(1029,wa(34817,t,r),wa(34818,t,r),wa(34819,t,r))}},_a={enable:function(e,t){return e(_()({},t,!0))},disable:function(e,t){return e(_()({},t,!1))},pixelStorei:function(e,t,r){return e(_()({},t,r))},hint:function(e,t,r){return e(_()({},t,r))},bindFramebuffer:function(e,t,r){var n;switch(t){case 36160:return e((n={},_()(n,36006,r),_()(n,36010,r),n));case 36009:return e(_()({},36006,r));case 36008:return e(_()({},36010,r));default:return null}},blendColor:function(e,t,r,n,i){return e(_()({},32773,new Float32Array([t,r,n,i])))},blendEquation:function(e,t){var r;return e((r={},_()(r,32777,t),_()(r,34877,t),r))},blendEquationSeparate:function(e,t,r){var n;return e((n={},_()(n,32777,t),_()(n,34877,r),n))},blendFunc:function(e,t,r){var n;return e((n={},_()(n,32969,t),_()(n,32968,r),_()(n,32971,t),_()(n,32970,r),n))},blendFuncSeparate:function(e,t,r,n,i){var a;return e((a={},_()(a,32969,t),_()(a,32968,r),_()(a,32971,n),_()(a,32970,i),a))},clearColor:function(e,t,r,n,i){return e(_()({},3106,new Float32Array([t,r,n,i])))},clearDepth:function(e,t){return e(_()({},2931,t))},clearStencil:function(e,t){return e(_()({},2961,t))},colorMask:function(e,t,r,n,i){return e(_()({},3107,[t,r,n,i]))},cullFace:function(e,t){return e(_()({},2885,t))},depthFunc:function(e,t){return e(_()({},2932,t))},depthRange:function(e,t,r){return e(_()({},2928,new Float32Array([t,r])))},depthMask:function(e,t){return e(_()({},2930,t))},frontFace:function(e,t){return e(_()({},2886,t))},lineWidth:function(e,t){return e(_()({},2849,t))},polygonOffset:function(e,t,r){var n;return e((n={},_()(n,32824,t),_()(n,10752,r),n))},sampleCoverage:function(e,t,r){var n;return e((n={},_()(n,32938,t),_()(n,32939,r),n))},scissor:function(e,t,r,n,i){return e(_()({},3088,new Int32Array([t,r,n,i])))},stencilMask:function(e,t){var r;return e((r={},_()(r,2968,t),_()(r,36005,t),r))},stencilMaskSeparate:function(e,t,r){return e(_()({},1028===t?2968:36005,r))},stencilFunc:function(e,t,r,n){var i;return e((i={},_()(i,2962,t),_()(i,2967,r),_()(i,2963,n),_()(i,34816,t),_()(i,36003,r),_()(i,36004,n),i))},stencilFuncSeparate:function(e,t,r,n,i){var a;return e((a={},_()(a,1028===t?2962:34816,r),_()(a,1028===t?2967:36003,n),_()(a,1028===t?2963:36004,i),a))},stencilOp:function(e,t,r,n){var i;return e((i={},_()(i,2964,t),_()(i,2965,r),_()(i,2966,n),_()(i,34817,t),_()(i,34818,r),_()(i,34819,n),i))},stencilOpSeparate:function(e,t,r,n,i){var a;return e((a={},_()(a,1028===t?2964:34817,r),_()(a,1028===t?2965:34818,n),_()(a,1028===t?2966:34819,i),a))},viewport:function(e,t,r,n,i){return e(_()({},2978,[t,r,n,i]))}},ka=function(e,t){return e.isEnabled(t)},Oa=(ua={},_()(ua,3042,ka),_()(ua,2884,ka),_()(ua,2929,ka),_()(ua,3024,ka),_()(ua,32823,ka),_()(ua,32926,ka),_()(ua,32928,ka),_()(ua,3089,ka),_()(ua,2960,ka),_()(ua,35977,ka),ua);function Ta(e){for(var t in e)return!1;return!0}function Sa(e,t){if(e===t)return!0;var r=Array.isArray(e)||ArrayBuffer.isView(e),n=Array.isArray(t)||ArrayBuffer.isView(t);if(r&&n&&e.length===t.length){for(var i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}return!1}function Aa(e,t){var r=e[t].bind(e);e[t]=function(){var t=arguments.length<=0?void 0:arguments[0];return t in e.state.cache&&e.state.enable?e.state.cache[t]:r.apply(void 0,arguments)},Object.defineProperty(e[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function Ea(e,t,r){var n=e[t].bind(e);e[t]=function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];var o=r.apply(void 0,[e.state._updateCache].concat(i)),s=o.valueChanged,u=o.oldValue;return s&&n.apply(void 0,i),u},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}function Pa(e){var t=e.useProgram.bind(e);e.useProgram=function(r){e.state.program!==r&&(t(r),e.state.program=r)}}var Ma=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.copyState,i=void 0!==n&&n,a=r.log,o=void 0===a?function(){}:a;c()(this,e),this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=i?Da(t):Object.assign({},pa),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return w()(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Wi(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Ca(this.gl,e),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,r=!1,n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in e){Wi(void 0!==i);var a=e[i],o=this.cache[i];Sa(a,o)||(r=!0,t=o,!n||i in n||(n[i]=o),this.cache[i]=a)}return{valueChanged:r,oldValue:t}}}]),e}();function ja(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.enable,n=void 0===r||r,i=t.copyState;if(Wi(void 0!==i),!e.state){var a="undefined"!=typeof global?global:window,o=a.polyfillContext;for(var s in o&&o(e),e.state=new Ma(e,{copyState:i}),Pa(e),_a){var u=_a[s];Ea(e,s,u)}Aa(e,"getParameter"),Aa(e,"isEnabled")}return e.state.enable=n,e}function Ia(e){Wi(e.state),e.state.pop()}function La(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ra(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ra(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ra(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ca(e,t){if(Wi(Zi(e),"setParameters requires a WebGL context"),!Ta(t)){var r={};for(var n in t){var i=Number(n),a=ba[n];a&&("string"==typeof a?r[a]=!0:a(e,t[n],i))}var o=e.state&&e.state.cache;if(o)for(var s in r){(0,xa[s])(e,t,o)}}}function Da(e,t){if("number"==typeof(t=t||pa)){var r=t,n=Oa[r];return n?n(e,r):e.getParameter(r)}var i,a={},o=La(Array.isArray(t)?t:Object.keys(t));try{for(o.s();!(i=o.n()).done;){var s=i.value,u=Oa[s];a[s]=u?u(e,Number(s)):e.getParameter(Number(s))}}catch(e){o.e(e)}finally{o.f()}return a}function Na(e,t,r){if(Ta(t))return r(e);var n,i=t.nocatch,a=void 0===i||i;if(function(e){e.state||ja(e,{copyState:!1}),e.state.push()}(e),Ca(e,t),a)n=r(e),Ia(e);else try{n=r(e)}finally{Ia(e)}return n}var Fa=Object(Ji.isBrowser)();var Ba=new(function(){function e(){c()(this,e),this.stats=new Map}return w()(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new An({id:e})),this.stats.get(e)}}]),e}());if(Ji.global.luma&&"8.5.10"!==Ji.global.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(Ji.global.luma.VERSION," vs ").concat("8.5.10"));Ji.global.luma||(Object(Ji.isBrowser)()&&Hi.log(1,"luma.gl ".concat("8.5.10"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),Ji.global.luma=Ji.global.luma||{VERSION:"8.5.10",version:"8.5.10",log:Hi,stats:Ba,globals:{modules:{},nodeIO:{}}});Ji.global.luma;function Ua(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function Va(e,t){if("string"!=typeof t)return t;var r=Number(t);if(!isNaN(r))return r;var n=e[t=t.replace(/^.*\./,"")];return Ua(void 0!==n,"Accessing undefined constant GL.".concat(t)),n}function za(e,t){for(var r in t=Number(t),e)if(e[r]===t)return"GL.".concat(r);return String(t)}var qa={};function Ga(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";qa[e]=qa[e]||1;var t=qa[e]++;return"".concat(e,"-").concat(t)}function Ha(e){return Ua("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function Wa(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Za(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Za(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Za(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Xa="Resource subclass must define virtual methods",Qa=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c()(this,e),Qi(t);var n=r.id,i=r.userData,a=void 0===i?{}:i;this.gl=t,this.gl2=t,this.id=n||Ga(this.constructor.name),this.userData=a,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return w()(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.deleteChildren,r=void 0!==t&&t,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&r&&n.filter(Boolean).forEach((function(e){return e.delete()})),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ua(e=Va(this.gl,e));var r=this.constructor.PARAMETERS||{},n=r[e];if(n){var i=Xi(this.gl),a=(!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension));if(!a){var o=n.webgl1,s="webgl2"in n?n.webgl2:n.webgl1,u=i?s:o;return u}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.parameters,n=t.keys,i=this.constructor.PARAMETERS||{},a=Xi(this.gl),o={},s=r||Object.keys(i),u=Wa(s);try{for(u.s();!(e=u.n()).done;){var c=e.value,l=i[c],f=l&&(!("webgl2"in l)||a)&&(!("extension"in l)||this.gl.getExtension(l.extension));if(f){var h=n?za(this.gl,c):c;o[h]=this.getParameter(c,t),n&&"GLenum"===l.type&&(o[h]=za(this.gl,o[h]))}}}catch(e){u.e(e)}finally{u.f()}return o}},{key:"setParameter",value:function(e,t){Ua(e=Va(this.gl,e));var r=(this.constructor.PARAMETERS||{})[e];if(r){var n=Xi(this.gl);if(!((!("webgl2"in r)||n)&&(!("extension"in r)||this.gl.getExtension(r.extension))))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=Va(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,r){return function(e,t,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(e);n.forEach((function(e){a.methodName||(a[e]=function(){throw Hi.removed("Calling removed method ".concat(t,".").concat(e,": "),i)(),new Error(e)})}))}(this,e,t,r)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(Xa)}},{key:"_deleteHandle",value:function(){throw new Error(Xa)}},{key:"_bindHandle",value:function(e){throw new Error(Xa)}},{key:"_getOptsFromHandle",value:function(){throw new Error(Xa)}},{key:"_getParameter",value:function(e,t){throw new Error(Xa)}},{key:"_setParameter",value:function(e,t){throw new Error(Xa)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=Ba.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;Ba.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,r=Ba.get("Memory Usage");r.get("GPU Memory").addCount(e),r.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=Ba.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}(),Ka=r(69),Ja=r.n(Ka);function Ya(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function $a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.clamped,n=void 0===r||r;switch(e){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function eo(e){var t=e.data,r=e.width,n=e.height,i=e.bytesPerPixel,a=void 0===i?4:i,o=e.temp,s=r*a;o=o||new Uint8Array(s);for(var u=0;u<n/2;++u){var c=u*s,l=(n-u-1)*s;o.set(t.subarray(c,c+s)),t.copyWithin(c,l,l+s),t.set(o,l)}}function to(e){for(var t=e.data,r=e.width,n=e.height,i=Math.round(r/2),a=Math.round(n/2),o=new Uint8Array(i*a*4),s=0;s<a;s++)for(var u=0;u<i;u++)for(var c=0;c<4;c++)o[4*(s*i+u)+c]=t[4*(2*s*r+2*u)+c];return{data:o,width:i,height:a}}function ro(e,t,r){var n=r.removedProps,i=void 0===n?{}:n,a=r.deprecatedProps,o=void 0===a?{}:a,s=r.replacedProps,u=void 0===s?{}:s;for(var c in i)if(c in t){var l=i[c]?"".concat(e,".").concat(i[c]):"N/A";Hi.removed("".concat(e,".").concat(c),l)()}for(var f in o)if(f in t){var h=o[f];Hi.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(h))()}var d=null;for(var p in u)if(p in t){var y=u[p];Hi.deprecated("".concat(e,".").concat(p),"".concat(e,".").concat(y))(),(d=d||Object.assign({},t))[y]=t[p],delete d[p]}return d||t}var no={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},io={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},ao=function(){function e(){var t=this;c()(this,e);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];n.forEach((function(e){return t._assign(e)})),Object.freeze(this)}return w()(e,null,[{key:"getBytesPerElement",value:function(e){return $a(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return Ua(e.size),$a(e.type||5126).BYTES_PER_ELEMENT*e.size}},{key:"resolve",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ja()(e,[no].concat(r))}}]),w()(e,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"_assign",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=ro("Accessor",e,io)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof e.index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}();function oo(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var so,uo,co,lo={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},fo={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:lo},ho={removedProps:lo},po=function(e){f()(r,e);var t=oo(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c()(this,r),(n=t.call(this,e,i)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=i.target||(n.gl.webgl2?36662:34962),n.initialize(i),Object.seal(bi()(n)),n}return w()(r,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ao.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ao.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=ro("Buffer",e,fo),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=ro("Buffer",e,ho))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ao(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,r=t.data,n=t.offset,i=void 0===n?0:n,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Ua(r);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(Ki(this.gl),this.gl.bufferSubData(this.target,i,r,o,s)):this.gl.bufferSubData(u,i,r),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(r),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,r=e.readOffset,n=void 0===r?0:r,i=e.writeOffset,a=void 0===i?0:i,o=e.size,s=this.gl;return Ki(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,n,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,r=void 0===t?null:t,n=e.srcByteOffset,i=void 0===n?0:n,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;Ki(this.gl);var c,l,f=$a(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(i),d=o;r?c=(l=r.length)-d:l=d+(c=Math.min(h,u||h));var p=Math.min(h,c);return Ua((u=u||p)<=p),r=r||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,r,o,u),this.gl.bindBuffer(36662,null),r}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?this.target:t,n=e.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===r||35982===r?void 0!==s?this.gl.bindBufferRange(r,i,this.handle,o,s):(Ua(0===o),this.gl.bindBufferBase(r,i,this.handle)):this.gl.bindBuffer(r,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?this.target:t,n=e.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=35345===r||35982===r;return a?this.gl.bindBufferBase(r,i,null):this.gl.bindBuffer(r,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.byteLength+t;Ua(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.usage),this.gl.bufferSubData(n,t,e),this.gl.bindBuffer(n,null),this.debugData=e.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);var i=Ya(e);return Ua(i),this.setAccessor(new ao(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Ua(e>=0),this._trackDeallocatedMemory();var r=e;0===e&&(r=new Float32Array(0));var n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/$a(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new ao(this.accessor,{type:Ya(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return Hi.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return Hi.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ao(this.accessor,e),this}},{key:"type",get:function(){return Hi.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return Hi.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),r}(Qa),yo=(so={},_()(so,6407,{dataFormat:6407,types:[5121,33635]}),_()(so,6408,{dataFormat:6408,types:[5121,32819,32820]}),_()(so,6406,{dataFormat:6406,types:[5121]}),_()(so,6409,{dataFormat:6409,types:[5121]}),_()(so,6410,{dataFormat:6410,types:[5121]}),_()(so,33326,{dataFormat:6403,types:[5126],gl2:!0}),_()(so,33328,{dataFormat:33319,types:[5126],gl2:!0}),_()(so,34837,{dataFormat:6407,types:[5126],gl2:!0}),_()(so,34836,{dataFormat:6408,types:[5126],gl2:!0}),so),vo=(uo={},_()(uo,6403,1),_()(uo,36244,1),_()(uo,33319,2),_()(uo,33320,2),_()(uo,6407,3),_()(uo,36248,3),_()(uo,6408,4),_()(uo,36249,4),_()(uo,6402,1),_()(uo,34041,1),_()(uo,6406,1),_()(uo,6409,1),_()(uo,6410,2),uo),go=(co={},_()(co,5126,4),_()(co,5125,4),_()(co,5124,4),_()(co,5123,2),_()(co,5122,2),_()(co,5131,2),_()(co,5120,1),_()(co,5121,1),co);function mo(e,t){var r=yo[t];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=Xi(e)&&r.gl2||r.gl1;return"string"==typeof n?e.getExtension(n):n}function bo(e,t){var r=yo[t];switch(r&&r.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}function wo(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return xo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xo(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function xo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _o(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var ko=[9729,9728],Oo=Ji.global.WebGLBuffer||function(){},To=function(e){f()(r,e);var t=_o(r);function r(e,n){var i;c()(this,r);var a=n.id,o=void 0===a?Ga("texture"):a,s=n.handle,u=n.target;return(i=t.call(this,e,{id:o,handle:s})).target=u,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return w()(r,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.format,n=t.linearFiltering,i=!0;return r&&(i=(i=i&&mo(e,r))&&(!n||bo(e,r))),i}}]),w()(r,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.data;if(r instanceof Promise)return r.then((function(r){return e.initialize(Object.assign({},t,{pixels:r,data:r}))})),this;var n="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement;if(n&&r.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,r.addEventListener("loadeddata",(function(){return e.initialize(t)})),this;var i=t.pixels,a=void 0===i?null:i,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,p=t.pixelStore,y=void 0===p?{}:p,v=t.textureUnit,g=void 0===v?void 0:v;r||(r=a);var m=t.width,b=t.height,w=t.dataFormat,x=t.type,_=t.compressed,k=void 0!==_&&_,O=t.mipmaps,T=void 0===O||O,S=t.depth,A=void 0===S?0:S,E=this._deduceParameters({format:s,type:x,dataFormat:w,compressed:k,data:r,width:m,height:b});return m=E.width,b=E.height,k=E.compressed,w=E.dataFormat,x=E.type,this.width=m,this.height=b,this.depth=A,this.format=s,this.type=x,this.dataFormat=w,this.border=c,this.textureUnit=g,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),T&&this._isNPOT()&&(Hi.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),T=!1,this._updateForNPOT(d)),this.mipmaps=T,this.setImageData({data:r,width:m,height:b,depth:A,format:s,type:x,dataFormat:w,border:c,mipmaps:T,parameters:y,compressed:k}),T&&this.generateMipmap(),this.setParameters(d),f&&(this.data=r),n&&(this._video={video:r,parameters:d,lastTime:r.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?r.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var e=this._video,t=e.video,r=e.parameters;if(e.lastTime===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}},{key:"resize",value:function(e){var t=e.height,r=e.width,n=e.mipmaps,i=void 0!==n&&n;return r!==this.width||t!==this.height?this.initialize({width:r,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(Hi.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Na(this.gl,t,(function(){e.gl.generateMipmap(e.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,r=void 0===t?this.target:t,n=e.pixels,i=void 0===n?null:n,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,f=e.offset,h=void 0===f?0:f,d=e.parameters,p=void 0===d?{}:d,y=e.data,v=void 0===y?null:y,g=e.type,m=void 0===g?this.type:g,b=e.width,w=void 0===b?this.width:b,x=e.height,_=void 0===x?this.height:x,k=e.dataFormat,T=void 0===k?this.dataFormat:k,S=e.compressed,A=void 0!==S&&S;v||(v=i);var E=this._deduceParameters({format:u,type:m,dataFormat:T,compressed:A,data:v,width:w,height:_});m=E.type,T=E.dataFormat,A=E.compressed,w=E.width,_=E.height;var P=this.gl;P.bindTexture(this.target,this.handle);var M,j,I=this._getDataType({data:v,compressed:A});if(v=I.data,M=I.dataType,Na(this.gl,p,(function(){switch(M){case"null":P.texImage2D(r,o,u,w,_,l,T,m,v);break;case"typed-array":P.texImage2D(r,o,u,w,_,l,T,m,v,h);break;case"buffer":(j=Ki(P)).bindBuffer(35052,v.handle||v),j.texImage2D(r,o,u,w,_,l,T,m,h),j.bindBuffer(35052,null);break;case"browser-object":Xi(P)?P.texImage2D(r,o,u,w,_,l,T,m,v):P.texImage2D(r,o,u,T,m,v);break;case"compressed":var e,t=wo(v.entries());try{for(t.s();!(e=t.n()).done;){var n=O()(e.value,2),i=n[0],a=n[1];P.compressedTexImage2D(r,i,a.format,a.width,a.height,l,a.data)}}catch(e){t.e(e)}finally{t.f()}break;default:Ua(!1,"Unknown image data type")}})),v&&v.byteLength)this._trackAllocatedMemory(v.byteLength,"Texture");else{var L=vo[this.dataFormat]||4,R=go[this.type]||1;this._trackAllocatedMemory(this.width*this.height*L*R,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,r=e.target,n=void 0===r?this.target:r,i=e.pixels,a=void 0===i?null:i,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,l=e.y,f=void 0===l?0:l,h=e.width,d=void 0===h?this.width:h,p=e.height,y=void 0===p?this.height:p,v=e.level,g=void 0===v?0:v,m=e.format,b=void 0===m?this.format:m,w=e.type,x=void 0===w?this.type:w,_=e.dataFormat,k=void 0===_?this.dataFormat:_,O=e.compressed,T=void 0!==O&&O,S=e.offset,A=void 0===S?0:S,E=e.border,P=(void 0===E&&this.border,e.parameters),M=void 0===P?{}:P,j=this._deduceParameters({format:b,type:x,dataFormat:k,compressed:T,data:s,width:d,height:y});if(x=j.type,k=j.dataFormat,T=j.compressed,d=j.width,y=j.height,Ua(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var I=s;s=I.data,d=I.shape[0],y=I.shape[1]}s instanceof po&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Na(this.gl,M,(function(){if(T)t.gl.compressedTexSubImage2D(n,g,c,f,d,y,b,s);else if(null===s)t.gl.texSubImage2D(n,g,c,f,d,y,k,x,null);else if(ArrayBuffer.isView(s))t.gl.texSubImage2D(n,g,c,f,d,y,k,x,s,A);else if(s instanceof Oo){var e=Ki(t.gl);e.bindBuffer(35052,s),e.texSubImage2D(n,g,c,f,d,y,k,x,A),e.bindBuffer(35052,null)}else if(Xi(t.gl)){Ki(t.gl).texSubImage2D(n,g,c,f,d,y,k,x,s)}else t.gl.texSubImage2D(n,g,c,f,k,x,s)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Hi.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,r=e.compressed;return void 0!==r&&r?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof po?{data:t.handle,dataType:"buffer"}:t instanceof Oo?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,r=e.data,n=e.width,i=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=yo[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(r,n,i);return{dataFormat:a,type:o,compressed:s,width:n=c.width,height:i=c.height,format:t,data:r}}},{key:"_deduceImageSize",value:function(e,t,r){var n;return Ua(n="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:r}:{width:t>=0?t:1,height:r>=0?r:1},"Could not deduced texture size"),Ua(void 0===t||n.width===t,"Deduced texture width does not match supplied width"),Ua(void 0===r||n.height===r,"Deduced texture height does not match supplied height"),n}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Ua(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Xi(this.gl)&&(!(!this.width||!this.height)&&(!Ha(this.width)||!Ha(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===ko.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),r}(Qa),So="";function Ao(e,t){return Ua("string"==typeof e),e=So+e,new Promise((function(r,n){try{var i=new Image;i.onload=function(){return r(i)},i.onerror=function(){return n(new Error("Could not load image ".concat(e,".")))},i.crossOrigin=t&&t.crossOrigin||"anonymous",i.src=e}catch(e){n(e)}}))}function Eo(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var Po,Mo=function(e){f()(r,e);var t=Eo(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c()(this,r),Qi(e),(i instanceof Promise||"string"==typeof i)&&(i={data:i}),"string"==typeof i.data&&(i=Object.assign({},i,{data:Ao(i.data)})),(n=t.call(this,e,Object.assign({},i,{target:3553}))).initialize(i),Object.seal(bi()(n)),n}return w()(r,null,[{key:"isSupported",value:function(e,t){return To.isSupported(e,t)}}]),r}(To),jo="EXT_color_buffer_float",Io=(Po={},_()(Po,33189,{bpp:2}),_()(Po,33190,{gl2:!0,bpp:3}),_()(Po,36012,{gl2:!0,bpp:4}),_()(Po,36168,{bpp:1}),_()(Po,34041,{bpp:4}),_()(Po,35056,{gl2:!0,bpp:4}),_()(Po,36013,{gl2:!0,bpp:5}),_()(Po,32854,{bpp:2}),_()(Po,36194,{bpp:2}),_()(Po,32855,{bpp:2}),_()(Po,33321,{gl2:!0,bpp:1}),_()(Po,33330,{gl2:!0,bpp:1}),_()(Po,33329,{gl2:!0,bpp:1}),_()(Po,33332,{gl2:!0,bpp:2}),_()(Po,33331,{gl2:!0,bpp:2}),_()(Po,33334,{gl2:!0,bpp:4}),_()(Po,33333,{gl2:!0,bpp:4}),_()(Po,33323,{gl2:!0,bpp:2}),_()(Po,33336,{gl2:!0,bpp:2}),_()(Po,33335,{gl2:!0,bpp:2}),_()(Po,33338,{gl2:!0,bpp:4}),_()(Po,33337,{gl2:!0,bpp:4}),_()(Po,33340,{gl2:!0,bpp:8}),_()(Po,33339,{gl2:!0,bpp:8}),_()(Po,32849,{gl2:!0,bpp:3}),_()(Po,32856,{gl2:!0,bpp:4}),_()(Po,32857,{gl2:!0,bpp:4}),_()(Po,36220,{gl2:!0,bpp:4}),_()(Po,36238,{gl2:!0,bpp:4}),_()(Po,36975,{gl2:!0,bpp:4}),_()(Po,36214,{gl2:!0,bpp:8}),_()(Po,36232,{gl2:!0,bpp:8}),_()(Po,36226,{gl2:!0,bpp:16}),_()(Po,36208,{gl2:!0,bpp:16}),_()(Po,33325,{gl2:jo,bpp:2}),_()(Po,33327,{gl2:jo,bpp:4}),_()(Po,34842,{gl2:jo,bpp:8}),_()(Po,33326,{gl2:jo,bpp:4}),_()(Po,33328,{gl2:jo,bpp:8}),_()(Po,34836,{gl2:jo,bpp:16}),_()(Po,35898,{gl2:jo,bpp:4}),Po);function Lo(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}function Ro(e,t,r){var n=r[t];if(!n)return!1;var i=Xi(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}var Co=function(e){f()(r,e);var t=Lo(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c()(this,r),(n=t.call(this,e,i)).initialize(i),Object.seal(bi()(n)),n}return w()(r,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},r=t.format;return!r||Ro(e,r,Io)}},{key:"getSamplesForFormat",value:function(e,t){var r=t.format;return e.getInternalformatParameter(36161,r,32937)}}]),w()(r,[{key:"initialize",value:function(e){var t=e.format,r=e.width,n=void 0===r?1:r,i=e.height,a=void 0===i?1:i,o=e.samples,s=void 0===o?0:o;return Ua(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Xi(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,n,a):this.gl.renderbufferStorage(36161,t,n,a),this.format=t,this.width=n,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Io[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,r=e.height;return t!==this.width||r!==this.height?this.initialize({width:t,height:r,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),r}(Qa);function Do(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.framebuffer,n=void 0===r?null:r,i=t.color,a=void 0===i?null:i,o=t.depth,s=void 0===o?null:o,u=t.stencil,c=void 0===u?null:u,l={};n&&(l.framebuffer=n);var f=0;a&&(f|=16384,!0!==a&&(l.clearColor=a)),s&&(f|=256,!0!==s&&(l.clearDepth=s)),c&&(f|=1024,!0!==s&&(l.clearStencil=s)),Ua(0!==f,"clear: bad arguments"),Na(e,l,(function(){e.clear(f)}))}function No(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.framebuffer,n=void 0===r?null:r,i=t.buffer,a=void 0===i?6144:i,o=t.drawBuffer,s=void 0===o?0:o,u=t.value,c=void 0===u?[0,0,0,0]:u;Ki(e),Na(e,{framebuffer:n},(function(){switch(a){case 6144:switch(c.constructor){case Int32Array:e.clearBufferiv(a,s,c);break;case Uint32Array:e.clearBufferuiv(a,s,c);break;case Float32Array:default:e.clearBufferfv(a,s,c)}break;case 6145:e.clearBufferfv(6145,0,[c]);break;case 6146:e.clearBufferiv(6146,0,[c]);break;case 34041:var t=O()(c,2),r=t[0],n=t[1];e.clearBufferfi(34041,0,r,n);break;default:Ua(!1,"clear: bad arguments")}}))}function Fo(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Ua(!1),0}}function Bo(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var Uo=[34069,34070,34071,34072,34073,34074],Vo=function(e){f()(n,e);var t,r=Bo(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c()(this,n),Qi(e),(t=r.call(this,e,Object.assign({},i,{target:34067}))).initialize(i),Object.seal(bi()(t)),t}return w()(n,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.mipmaps,n=void 0===r||r,i=t.parameters,a=void 0===i?{}:i;return this.opts=t,this.setCubeMapImageData(t).then((function(){e.loaded=!0,n&&e.generateMipmap(t),e.setParameters(a)})),this}},{key:"subImage",value:function(e){var t=e.face,r=e.data,n=e.x,i=void 0===n?0:n,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:r,x:i,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:(t=q()(V.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,y=this;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.width,n=t.height,i=t.pixels,a=t.data,o=t.border,s=void 0===o?0:o,u=t.format,c=void 0===u?6408:u,l=t.type,f=void 0===l?5121:l,h=this.gl,d=i||a,e.next=5,Promise.all(Uo.map((function(e){var t=d[e];return Promise.all(Array.isArray(t)?t:[t])})));case 5:p=e.sent,this.bind(),Uo.forEach((function(e,t){p[t].length>1&&!1!==y.opts.mipmaps&&Hi.warn("".concat(y.id," has mipmap and multiple LODs."))(),p[t].forEach((function(t,i){r&&n?h.texImage2D(e,i,c,r,n,s,c,f,t):h.texImage2D(e,i,c,c,f,t)}))})),this.unbind();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setImageDataForFace",value:function(e){var t=this,r=e.face,n=e.width,i=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,p=a||o;return this.bind(),p instanceof Promise?p.then((function(n){return t.setImageDataForFace(Object.assign({},e,{face:r,data:n,pixels:n}))})):this.width||this.height?d.texImage2D(r,0,l,n,i,u,l,h,p):d.texImage2D(r,0,l,l,h,p),this}}]),n}(To);Vo.FACES=Uo;function zo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.sourceX,n=void 0===r?0:r,i=t.sourceY,a=void 0===i?0:i,o=t.sourceFormat,s=void 0===o?6408:o,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,f=void 0===l?null:l,h=t.sourceWidth,d=t.sourceHeight,p=t.sourceType,y=Go(e),v=y.framebuffer,g=y.deleteFramebuffer;Ua(v);var m=v.gl,b=v.handle,w=v.attachments;h=h||v.width,d=d||v.height,36064===c&&null===b&&(c=1028),Ua(w[c]),f=Ho(f,p=p||w[c].type,s,h,d),p=p||Ya(f);var x=m.bindFramebuffer(36160,b);return m.readPixels(n,a,h,d,s,p,f),m.bindFramebuffer(36160,x||null),g&&v.delete(),f}function qo(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.sourceAttachment,n=void 0===r?36064:r,i=t.targetMaxHeight,a=void 0===i?Number.MAX_SAFE_INTEGER:i,o=zo(e,{sourceAttachment:n}),s=e.width,u=e.height;u>a;){var c=to({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}eo({data:o,width:s,height:u});var l=document.createElement("canvas");l.width=s,l.height=u;var f=l.getContext("2d"),h=f.createImageData(s,u);return h.data.set(o),f.putImageData(h,0,0),l.toDataURL()}function Go(e){return e instanceof Qo?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,n=t.gl,i=t.width,a=t.height,o=t.id,new Qo(n,Object.assign({},r,{id:"framebuffer-for-".concat(o),width:i,height:a,attachments:_()({},36064,t)}))),deleteFramebuffer:!0};var t,r,n,i,a,o}function Ho(e,t,r,n,i){return e||new($a(t=t||5121,{clamped:!1}))(n*i*Fo(r))}function Wo(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Zo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zo(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Zo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xo(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var Qo=function(e){f()(r,e);var t=Xo(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c()(this,r),(n=t.call(this,e,i)).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.ownResources=[],n.initialize(i),Object.seal(bi()(n)),n}return w()(r,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=Ki(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=Ki(this.gl);return e.getParameter(e.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.colorBufferFloat,n=t.colorBufferHalfFloat,i=!0;return r&&(i=Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("WEBGL_color_buffer_float")||e.getExtension("OES_texture_float"))),n&&(i=i&&Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new r(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),w()(r,[{key:"initialize",value:function(e){var t=e.width,r=void 0===t?1:t,n=e.height,i=void 0===n?1:n,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,p=void 0===d||d,y=e.readBuffer,v=void 0===y?void 0:y,g=e.drawBuffers,m=void 0===g?void 0:g;if(Ua(r>=0&&i>=0,"Width and height need to be integers"),this.width=r,this.height=i,o)for(var b in o){var w=o[b];(Array.isArray(w)?w[0]:w).resize({width:r,height:i})}else o=this._createDefaultAttachments(u,l,h,r,i);this.update({clearAttachments:!0,attachments:o,readBuffer:v,drawBuffers:m}),o&&p&&this.checkStatus()}},{key:"delete",value:function(){var e,t=Wo(this.ownResources);try{for(t.s();!(e=t.n()).done;){e.value.delete()}}catch(e){t.e(e)}finally{t.f()}return Hn()(y()(r.prototype),"delete",this).call(this),this}},{key:"update",value:function(e){var t=e.attachments,r=void 0===t?{}:t,n=e.readBuffer,i=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(r,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return n&&this._setReadBuffer(n),i&&this._setDrawBuffers(i),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,r=e.height;if(null===this.handle)return Ua(void 0===t&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var n in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),t!==this.width&&r!==this.height&&Hi.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(r))(),this.attachments)this.attachments[n].resize({width:t,height:r});return this.width=t,this.height=r,this}},{key:"attach",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clearAttachments,i=void 0!==n&&n,a=r.resizeAttachments,o=void 0===a||a,s={};i&&Object.keys(this.attachments).forEach((function(e){s[e]=null})),Object.assign(s,e);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){Ua(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof Co)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=O()(f,3),p=d[0],y=d[1],v=void 0===y?0:y,g=d[2],m=void 0===g?0:g;h=p,this._attachTexture({attachment:l,texture:p,layer:v,level:m})}else this._attachTexture({attachment:l,texture:h,layer:0,level:0});else this._unattach(l);o&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter((function(e){return!t.attachments[e]})).forEach((function(e){delete t.attachments[e]}))}},{key:"checkStatus",value:function(){this.gl;var e=this.getStatus();if(36053!==e)throw new Error(function(e){return(Qo.STATUS||{})[e]||"Framebuffer error ".concat(e)}(e));return this}},{key:"getStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),r=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),r}},{key:"clear",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.color,n=t.depth,i=t.stencil,a=t.drawBuffers,o=void 0===a?[]:a,s=this.gl.bindFramebuffer(36160,this.handle);return(r||n||i)&&Do(this.gl,{color:r,depth:n,stencil:i}),o.forEach((function(t,r){No(e.gl,{drawBuffer:r,value:t})})),this.gl.bindFramebuffer(36160,s||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Hi.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Hi.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Hi.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Hi.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Hi.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Hi.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,r=void 0===t?[]:t,n=e.x,i=void 0===n?0:n,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=Ki(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===i&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,r):c.invalidateFramebuffer(36008,r,i,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,r){var n=this._getAttachmentParameterFallback(t);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),r&&n>1e3&&(n=za(this.gl,n)),n}},{key:"getAttachmentParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},a=Wo(n);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=r?za(this.gl,o):o;i[s]=this.getAttachmentParameter(t,o,r)}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Object.keys(this.attachments),r={},n=0,i=t;n<i.length;n++){var a=i[n],o=Number(a),s=e?za(this.gl,o):o;r[s]=this.getAttachmentParameters(o,e)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(qo(this),"luma-debug-texture"),this}},{key:"log",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>Hi.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var r=qo(this,{targetMaxHeight:100});return Hi.image({logLevel:e,message:t,image:r},t)(),this}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?36160:t;return this.gl.bindFramebuffer(r,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?36160:t;return this.gl.bindFramebuffer(r,null),this}},{key:"_createDefaultAttachments",value:function(e,t,r,n,i){var a,o=null;e&&((o=o||{})[36064]=new Mo(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(a={},_()(a,10241,9729),_()(a,10240,9729),_()(a,10242,33071),_()(a,10243,33071),a)}),this.ownResources.push(o[36064]));return t&&r?((o=o||{})[33306]=new Co(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new Co(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(o[36096])):r&&Ua(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof Co?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,r=void 0===t?36064:t,n=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,r,36161,n.handle),this.attachments[r]=n}},{key:"_attachTexture",value:function(e){var t=e.attachment,r=void 0===t?36064:t,n=e.texture,i=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:Ki(o).framebufferTextureLayer(36160,r,n.target,a,i);break;case 34067:var s=function(e){return e<34069?e+34069:e}(i);o.framebufferTexture2D(36160,r,s,n.handle,a);break;case 3553:o.framebufferTexture2D(36160,r,3553,n.handle,a);break;default:Ua(!1,"Illegal texture type")}o.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(e){var t,r=Xi(t=this.gl)?t:null;r?r.readBuffer(e):Ua(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,r=Ki(t);if(r)r.drawBuffers(e);else{var n=t.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(e):Ua(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=function(e){for(var t in e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},bs)void 0===e.luma.caps[t]&&(e.luma.caps[t]=ks(e,t));return e.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}}]),r}(Qa);var Ko;Qo.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var Jo="WEBGL2",Yo="VERTEX_ARRAY_OBJECT",$o="TIMER_QUERY",es="INSTANCED_RENDERING",ts="MULTIPLE_RENDER_TARGETS",rs="ELEMENT_INDEX_UINT32",ns="BLEND_EQUATION_MINMAX",is="FLOAT_BLEND",as="COLOR_ENCODING_SRGB",os="TEXTURE_DEPTH",ss="TEXTURE_FLOAT",us="TEXTURE_HALF_FLOAT",cs="TEXTURE_FILTER_LINEAR_FLOAT",ls="TEXTURE_FILTER_LINEAR_HALF_FLOAT",fs="TEXTURE_FILTER_ANISOTROPIC",hs="COLOR_ATTACHMENT_RGBA32F",ds="COLOR_ATTACHMENT_FLOAT",ps="COLOR_ATTACHMENT_HALF_FLOAT",ys="GLSL_FRAG_DATA",vs="GLSL_FRAG_DEPTH",gs="GLSL_DERIVATIVES",ms="GLSL_TEXTURE_LOD";var bs=(Ko={},_()(Ko,Jo,[!1,!0]),_()(Ko,Yo,["OES_vertex_array_object",!0]),_()(Ko,$o,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),_()(Ko,es,["ANGLE_instanced_arrays",!0]),_()(Ko,ts,["WEBGL_draw_buffers",!0]),_()(Ko,rs,["OES_element_index_uint",!0]),_()(Ko,ns,["EXT_blend_minmax",!0]),_()(Ko,is,["EXT_float_blend"]),_()(Ko,as,["EXT_sRGB",!0]),_()(Ko,os,["WEBGL_depth_texture",!0]),_()(Ko,ss,["OES_texture_float",!0]),_()(Ko,us,["OES_texture_half_float",!0]),_()(Ko,cs,["OES_texture_float_linear"]),_()(Ko,ls,["OES_texture_half_float_linear"]),_()(Ko,fs,["EXT_texture_filter_anisotropic"]),_()(Ko,hs,[function(e){var t=new Mo(e,{format:6408,type:5126,dataFormat:6408}),r=new Qo(e,{id:"test-framebuffer",check:!1,attachments:_()({},36064,t)}),n=r.getStatus();return t.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),_()(Ko,ds,[!1,"EXT_color_buffer_float"]),_()(Ko,ps,["EXT_color_buffer_half_float"]),_()(Ko,ys,["WEBGL_draw_buffers",!0]),_()(Ko,vs,["EXT_frag_depth",!0]),_()(Ko,gs,["OES_standard_derivatives",!0]),_()(Ko,ms,["EXT_shader_texture_lod",!0]),Ko);function ws(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return xs(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xs(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function xs(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _s(e,t){return function(e,t){return(t=Array.isArray(t)?t:[t]).every((function(t){return ks(e,t)}))}(e,t)}function ks(e,t){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},void 0===e.luma.caps[t]&&(e.luma.caps[t]=function(e,t){var r,n=bs[t];Ua(n,t);var i=Xi(e)&&n[1]||n[0];if("function"==typeof i)r=i(e);else if(Array.isArray(i)){r=!0;var a,o=ws(i);try{for(o.s();!(a=o.n()).done;){var s=a.value;r=r&&Boolean(e.getExtension(s))}}catch(e){o.e(e)}finally{o.f()}}else"string"==typeof i?r=Boolean(e.getExtension(i)):"boolean"==typeof i?r=i:Ua(!1);return r}(e,t)),e.luma.caps[t]||Hi.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}function Os(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 Ts(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Os(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Os(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ss=function(){function e(t,r){var n=r.attributes,i=r.material,a=r.pbrDebug,o=r.imageBasedLightingEnvironment,s=r.lights,u=r.useTangents;c()(this,e),this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},_s(t,ms)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],o&&(this.uniforms.u_DiffuseEnvSampler=o.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=o.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=o.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),a&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(o,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),i&&this.parseMaterial(i)}return w()(e,[{key:"defineIfPresent",value:function(e,t){e&&(this.defines[t]=1)}},{key:"parseTexture",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},a=e.texture.source.image,o={};a.compressed?(r=a,o=_()({},this.gl.TEXTURE_MIN_FILTER,a.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):r={data:a};var s=new Mo(this.gl,Ts({id:e.name||e.id,parameters:Ts(Ts({},i),o),pixelStore:_()({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},r));this.uniforms[t]=s,this.defineIfPresent(n,n),this.generatedTextures.push(s)}},{key:"parsePbrMetallicRoughness",value:function(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var t=e.metallicFactor,r=void 0===t?1:t,n=e.roughnessFactor,i=void 0===n?1:n;this.uniforms.u_MetallicRoughnessValues=[r,i]}},{key:"parseMaterial",value:function(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,r=void 0===t?1:t;this.uniforms.u_NormalScale=r}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var n=e.occlusionTexture.strength,i=void 0===n?1:n;this.uniforms.u_OcclusionStrength=i}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(Hi.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}]),e}();function As(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 Es(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?As(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):As(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ps(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var Ms=function(e){f()(r,e);var t=Ps(r);function r(){return c()(this,r),t.apply(this,arguments)}return w()(r,[{key:"getShaders",value:function(){var e=Hn()(y()(r.prototype),"getShaders",this).call(this);return e.modules.push(gi.pbr),Es(Es({},e),{},{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool u_pickFeatureIds;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n vec2 uv = fract(texCoords) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n\n geometry.uv = uv;\n geometry.uv = texCoords;\n\n if (u_pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * normals);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){var e=this.props.featureIds;Hn()(y()(r.prototype),"initializeState",this).call(this),e&&this.state.attributeManager.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps,i=e.changeFlags;Hn()(y()(r.prototype),"updateState",this).call(this,{props:t,oldProps:n,changeFlags:i}),t.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(t.pbrMaterial)}},{key:"draw",value:function(e){var t=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,u_pickFeatureIds:Boolean(t)}),Hn()(y()(r.prototype),"draw",this).call(this,e))}},{key:"getModel",value:function(e){var t,r=this.props,n=r.id,i=r.pbrMaterial,a=this.parseMaterial(i,e),o=this.getShaders();return(t=e.attributes).COLOR_0||t.colors||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),t.uvRegions||(t.uvRegions={constant:!0,value:new Float32Array([0,0,1,1])}),new gi.Model(this.context.gl,Es(Es({},this.getShaders()),{},{id:n,geometry:e,defines:Es(Es({},o.defines),null==a?void 0:a.defines),parameters:null==a?void 0:a.parameters,isInstanced:!0}))}},{key:"updatePbrMaterialUniforms",value:function(e){var t=this.state.model;if(t){var r=this.props.mesh,n=this.parseMaterial(e,r);t.setUniforms(n.uniforms)}}},{key:"parseMaterial",value:function(e,t){var r=Boolean(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return new Ss(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:Es({unlit:r},e),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(e){for(var t=this.props.featureIds,r=new Uint8ClampedArray(t.length*e.size),n=[],i=0;i<t.length;i++)this.encodePickingColor(t[i],n),r[3*i]=n[0],r[3*i+1]=n[1],r[3*i+2]=n[2];e.value=r}}]),r}(v.SimpleMeshLayer);Ms.layerName="_MeshLayer",Ms.defaultProps={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}};var js=function(e){return"boolean"==typeof e},Is=function(e){return"function"==typeof e},Ls=function(e){return null!==e&&"object"===ai()(e)},Rs=function(e){return Ls(e)&&e.constructor==={}.constructor},Cs=function(e){return e&&"function"==typeof e[Symbol.iterator]},Ds=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},Ns=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},Fs=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},Bs=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||Ls(e)&&Is(e.tee)&&Is(e.cancel)&&Is(e.getReader)}(e)||function(e){return Ls(e)&&Is(e.read)&&Is(e.pipe)&&js(e.readable)}(e)};function Us(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function Vs(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 zs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vs(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qs(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function Gs(e){var t,r,n;return Us(e,"null loader"),Us(qs(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=zs(zs({},e=e[0]),{},{options:zs(zs({},e.options),n)})),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(r=e)&&void 0!==r&&r.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var Hs={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Ws=Hs.global||Hs.self||Hs.window||{},Zs="object"!==("undefined"==typeof process?"undefined":ai()(process))||"[object process]"!==String(process)||process.browser,Xs="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Qs=(Xs&&parseFloat(Xs[1]),""),Ks={};function Js(e){for(var t in Ks)if(e.startsWith(t)){var r=Ks[t];e=e.replace(t,r)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(Qs).concat(e)),e}var Ys=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,$s=/^([-\w.]+\/[-\w.+]+)/;function eu(e){var t=$s.exec(e);return t?t[1]:e}function tu(e){var t=Ys.exec(e);return t?t[1]:""}var ru=/\?.*/;function nu(e){if(Ns(e)){var t=au(e.url||"");return{url:t,type:eu(e.headers.get("content-type")||"")||tu(t)}}return Fs(e)?{url:au(e.name||""),type:e.type||""}:"string"==typeof e?{url:au(e),type:tu(e)}:{url:"",type:""}}function iu(e){return Ns(e)?e.headers["content-length"]||-1:Fs(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer?e.byteLength:ArrayBuffer.isView(e)?e.byteLength:-1}function au(e){return e.replace(ru,"")}function ou(e){return su.apply(this,arguments)}function su(){return(su=q()(V.a.mark((function e(t){var r,n,i,a,o,s,u;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Ns(t)){e.next=2;break}return e.abrupt("return",t);case 2:return r={},(n=iu(t))>=0&&(r["content-length"]=String(n)),i=nu(t),a=i.url,(o=i.type)&&(r["content-type"]=o),e.next=9,hu(t);case 9:return(s=e.sent)&&(r["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t)),u=new Response(t,{headers:r}),Object.defineProperty(u,"url",{value:a}),e.abrupt("return",u);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function uu(e){return cu.apply(this,arguments)}function cu(){return(cu=q()(V.a.mark((function e(t){var r;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,lu(t);case 3:throw r=e.sent,new Error(r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lu(e){return fu.apply(this,arguments)}function fu(){return(fu=q()(V.a.mark((function e(t){var r,n,i;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): "),e.prev=1,n=t.headers.get("Content-Type"),i=t.statusText,!n.includes("application/json")){e.next=11;break}return e.t0=i,e.t1=" ",e.next=9,t.text();case 9:e.t2=e.sent,i=e.t0+=e.t1.concat.call(e.t1,e.t2);case 11:r=(r+=i).length>60?"".concat(r.slice(60),"..."):r,e.next=17;break;case 15:e.prev=15,e.t3=e.catch(1);case 17:return e.abrupt("return",r);case 18:case"end":return e.stop()}}),e,null,[[1,15]])})))).apply(this,arguments)}function hu(e){return du.apply(this,arguments)}function du(){return(du=q()(V.a.mark((function e(t){var r,n,i,a;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=5,"string"!=typeof t){e.next=3;break}return e.abrupt("return","data:,".concat(t.slice(0,r)));case 3:if(!(t instanceof Blob)){e.next=8;break}return n=t.slice(0,5),e.next=7,new Promise((function(e){var t=new FileReader;t.onload=function(t){var r;return e(null==t?void 0:null===(r=t.target)||void 0===r?void 0:r.result)},t.readAsDataURL(n)}));case 7:return e.abrupt("return",e.sent);case 8:if(!(t instanceof ArrayBuffer)){e.next=12;break}return i=t.slice(0,r),a=pu(i),e.abrupt("return","data:base64,".concat(a));case 12:return e.abrupt("return",null);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pu(e){for(var t="",r=new Uint8Array(e),n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function yu(e,t){return vu.apply(this,arguments)}function vu(){return(vu=q()(V.a.mark((function e(t,r){var n;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=7;break}return t=Js(t),n=r,null!=r&&r.fetch&&"function"!=typeof(null==r?void 0:r.fetch)&&(n=r.fetch),e.next=6,fetch(t,n);case 6:return e.abrupt("return",e.sent);case 7:return e.next=9,ou(t);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var gu=new Vi({id:"loaders.gl"}),mu=function(){function e(){c()(this,e)}return w()(e,[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}]),e}(),bu={fetch:null,mimeType:void 0,nothrow:!1,log:new(function(){function e(){c()(this,e),On(this,"console",void 0),this.console=console}return w()(e,[{key:"log",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.log).bind.apply(e,[this.console].concat(r))}},{key:"info",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.info).bind.apply(e,[this.console].concat(r))}},{key:"warn",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.warn).bind.apply(e,[this.console].concat(r))}},{key:"error",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.error).bind.apply(e,[this.console].concat(r))}}]),e}()),CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},wu={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function xu(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _u(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function _u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ku(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 Ou(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ku(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ku(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tu(){Ws.loaders=Ws.loaders||{};var e=Ws.loaders;return e._state=e._state||{},e._state}var Su=function(){var e=Tu();return e.globalOptions=e.globalOptions||Ou({},bu),e.globalOptions};function Au(e,t,r,n){return r=r||[],function(e,t){Pu(e,null,bu,wu,t);var r,n=xu(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=e&&e[i.id]||{},o=i.options&&i.options[i.id]||{},s=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};Pu(a,i.id,o,s,t)}}catch(e){n.e(e)}finally{n.f()}}(e,r=Array.isArray(r)?r:[r]),ju(t,e,n)}function Eu(e,t){var r=Su(),n=e||r;return"function"==typeof n.fetch?n.fetch:Ls(n.fetch)?function(e){return yu(e,n)}:null!=t&&t.fetch?null==t?void 0:t.fetch:yu}function Pu(e,t,r,n,i){var a=t||"Top level",o=t?"".concat(t,"."):"";for(var s in e){var u=!t&&Ls(e[s]);if(!(s in r||"baseUri"===s&&!t||"workerUrl"===s&&t))if(s in n)gu.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var c=Mu(s,i);gu.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(c))()}}}function Mu(e,t){var r,n=e.toLowerCase(),i="",a=xu(t);try{for(a.s();!(r=a.n()).done;){var o=r.value;for(var s in o.options){if(e===s)return"Did you mean '".concat(o.id,".").concat(s,"'?");var u=s.toLowerCase();(n.startsWith(u)||u.startsWith(n))&&(i=i||"Did you mean '".concat(o.id,".").concat(s,"'?"))}}}catch(e){a.e(e)}finally{a.f()}return i}function ju(e,t,r){var n=Ou({},e.options||{});return function(e,t){!t||"baseUri"in e||(e.baseUri=t)}(n,r),null===n.log&&(n.log=new mu),Iu(n,Su()),Iu(n,t),n}function Iu(e,t){for(var r in t)if(r in t){var n=t[r];Rs(n)&&Rs(e[r])?e[r]=Ou(Ou({},e[r]),t[r]):e[r]=t[r]}}function Lu(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}function Ru(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.0.8";Lu(e,"no worker provided");var r=e.version;return!(!t||!r)}var Cu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Du=Cu.global||Cu.self||Cu.window||{},Nu="object"!==("undefined"==typeof process?"undefined":ai()(process))||"[object process]"!==String(process)||process.browser,Fu="function"==typeof importScripts,Bu="undefined"!=typeof window&&void 0!==window.orientation,Uu="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Vu=(Uu&&parseFloat(Uu[1]),new Map);function zu(e){Lu(e.source&&!e.url||!e.source&&e.url);var t=Vu.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return qu((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),Vu.set(e.url,t)),e.source&&(t=qu(e.source),Vu.set(e.source,t))),Lu(t),t}function qu(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function Gu(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}var Hu=function(){},Wu=function(){function e(t){c()(this,e),On(this,"name",void 0),On(this,"source",void 0),On(this,"url",void 0),On(this,"terminated",!1),On(this,"worker",void 0),On(this,"onMessage",void 0),On(this,"onError",void 0),On(this,"_loadableURL","");var r=t.name,n=t.source,i=t.url;Lu(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=Hu,this.onError=function(e){return console.log(e)},this.worker=this._createBrowserWorker()}return w()(e,null,[{key:"isSupported",value:function(){return"undefined"!=typeof Worker}}]),w()(e,[{key:"destroy",value:function(){this.onMessage=Hu,this.onError=Hu,this.worker.terminate(),this.terminated=!0}},{key:"postMessage",value:function(e,t){t=t||function e(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||new Set;if(t){if(Gu(t))i.add(t);else if(Gu(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(r&&"object"===ai()(t))for(var a in t)e(t[a],r,i)}else;return void 0===n?Array.from(i):[]}(e),this.worker.postMessage(e,t)}},{key:"_getErrorFromErrorEvent",value:function(e){var t="Failed to load ";return t+="worker ".concat(this.name,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=zu({source:this.source,url:this.url});var t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=function(t){t.data?e.onMessage(t.data):e.onError(new Error("No data received"))},t.onerror=function(t){e.onError(e._getErrorFromErrorEvent(t)),e.terminated=!0},t.onmessageerror=function(e){return console.error(e)},t}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}}]),e}(),Zu=function(){function e(t,r){var n=this;c()(this,e),On(this,"name",void 0),On(this,"workerThread",void 0),On(this,"isRunning",void 0),On(this,"result",void 0),On(this,"_resolve",void 0),On(this,"_reject",void 0),this.name=t,this.workerThread=r,this.isRunning=!0,this._resolve=function(){},this._reject=function(){},this.result=new Promise((function(e,t){n._resolve=e,n._reject=t}))}return w()(e,[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){Lu(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){Lu(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}();function Xu(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 Qu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xu(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ku=function(){function e(t){c()(this,e),On(this,"name","unnamed"),On(this,"source",void 0),On(this,"url",void 0),On(this,"maxConcurrency",1),On(this,"maxMobileConcurrency",1),On(this,"onDebug",(function(){})),On(this,"reuseWorkers",!0),On(this,"props",{}),On(this,"jobQueue",[]),On(this,"idleQueue",[]),On(this,"count",0),On(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}var t,r;return w()(e,[{key:"destroy",value:function(){this.idleQueue.forEach((function(e){return e.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=Qu(Qu({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}},{key:"startJob",value:(r=q()(V.a.mark((function e(t){var r,n,i,a=this,o=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:function(e,t,r){return e.done(r)},n=o.length>2&&void 0!==o[2]?o[2]:function(e,t){return e.error(t)},i=new Promise((function(e){return a.jobQueue.push({name:t,onMessage:r,onError:n,onStart:e}),a})),this._startQueuedJob(),e.next=6,i;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_startQueuedJob",value:(t=q()(V.a.mark((function e(){var t,r,n;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.jobQueue.length){e.next=2;break}return e.abrupt("return");case 2:if(t=this._getAvailableWorker()){e.next=5;break}return e.abrupt("return");case 5:if(!(r=this.jobQueue.shift())){e.next=18;break}return this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length}),n=new Zu(r.name,t),t.onMessage=function(e){return r.onMessage(n,e.type,e.payload)},t.onError=function(e){return r.onError(n,e)},r.onStart(n),e.prev=12,e.next=15,n.result;case 15:return e.prev=15,this.returnWorkerToQueue(t),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[12,,15,18]])}))),function(){return t.apply(this,arguments)})},{key:"returnWorkerToQueue",value:function(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;var e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new Wu({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return Bu?this.maxMobileConcurrency:this.maxConcurrency}}]),e}();function Ju(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Yu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yu(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Yu(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $u(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 ec(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$u(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tc={maxConcurrency:3,maxMobileConcurrency:1,onDebug:function(){},reuseWorkers:!0},rc=function(){function e(t){c()(this,e),On(this,"props",void 0),On(this,"workerPools",new Map),this.props=ec({},tc),this.setProps(t),this.workerPools=new Map}return w()(e,null,[{key:"isSupported",value:function(){return Wu.isSupported()}},{key:"getWorkerFarm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}}]),w()(e,[{key:"destroy",value:function(){var e,t=Ju(this.workerPools.values());try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}}},{key:"setProps",value:function(e){this.props=ec(ec({},this.props),e);var t,r=Ju(this.workerPools.values());try{for(r.s();!(t=r.n()).done;){t.value.setProps(this._getWorkerPoolProps())}}catch(e){r.e(e)}finally{r.f()}}},{key:"getWorkerPool",value:function(e){var t=e.name,r=e.source,n=e.url,i=this.workerPools.get(t);return i||((i=new Ku({name:t,source:r,url:n})).setProps(this._getWorkerPoolProps()),this.workerPools.set(t,i)),i}},{key:"_getWorkerPoolProps",value:function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}]),e}();On(rc,"_workerFarm",void 0);function nc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t[e.id]||{},n="".concat(e.id,"-worker.js"),i=r.workerUrl;if("test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){var a=e.version;"latest"===a&&(a="latest");var o=a?"@".concat(a):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(o,"/dist/").concat(n)}return Lu(i),i}function ic(e,t){return!!rc.isSupported()&&(e.worker&&(null==t?void 0:t.worker))}function ac(e,t,r,n,i){return oc.apply(this,arguments)}function oc(){return(oc=q()(V.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.id,s=nc(t,n),u=rc.getWorkerFarm(n),c=u.getWorkerPool({name:o,url:s}),n=JSON.parse(JSON.stringify(n)),e.next=7,c.startJob("process-on-worker",sc.bind(null,a));case 7:return(l=e.sent).postMessage("process",{input:r,options:n}),e.next=11,l.result;case 11:return f=e.sent,e.next=14,f.result;case 14:return e.abrupt("return",e.sent);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sc(e,t,r,n){return uc.apply(this,arguments)}function uc(){return(uc=q()(V.a.mark((function e(t,r,n,i){var a,o,s,u,c;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n,e.next="done"===e.t0?3:"error"===e.t0?5:"process"===e.t0?7:20;break;case 3:return r.done(i),e.abrupt("break",21);case 5:return r.error(i.error),e.abrupt("break",21);case 7:return a=i.id,o=i.input,s=i.options,e.prev=8,e.next=11,t(o,s);case 11:u=e.sent,r.postMessage("done",{id:a,result:u}),e.next=19;break;case 15:e.prev=15,e.t1=e.catch(8),c=e.t1 instanceof Error?e.t1.message:"unknown error",r.postMessage("error",{id:a,error:c});case 19:return e.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(n));case 21:case"end":return e.stop()}}),e,null,[[8,15]])})))).apply(this,arguments)}var cc=r(31),lc=r.n(cc),fc=r(43);function hc(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return dc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function dc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pc(e){if(fc.toArrayBuffer&&(e=fc.toArrayBuffer(e)),e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){var t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"===ai()(e)&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function yc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=t.map((function(e){return e instanceof ArrayBuffer?new Uint8Array(e):e})),a=i.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(a),s=0,u=hc(i);try{for(u.s();!(n=u.n()).done;){var c=n.value;o.set(c,s),s+=c.byteLength}}catch(e){u.e(e)}finally{u.f()}return o.buffer}function vc(e,t,r){var n=void 0!==r?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function gc(e){return mc.apply(this,arguments)}function mc(){return(mc=q()(V.a.mark((function e(t){var r,n,i,a,o,s,u,c;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=!0,i=!1,e.prev=3,o=lc()(t);case 5:return e.next=7,o.next();case 7:return s=e.sent,n=s.done,e.next=11,s.value;case 11:if(u=e.sent,n){e.next=18;break}c=u,r.push(c);case 15:n=!0,e.next=5;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(3),i=!0,a=e.t0;case 24:if(e.prev=24,e.prev=25,n||null==o.return){e.next=29;break}return e.next=29,o.return();case 29:if(e.prev=29,!i){e.next=32;break}throw a;case 32:return e.finish(29);case 33:return e.finish(24);case 34:return e.abrupt("return",yc.apply(void 0,r));case 35:case"end":return e.stop()}}),e,null,[[3,20,24,34],[25,,29,33]])})))).apply(this,arguments)}var bc=V.a.mark(wc);function wc(e,t){var r,n,i,a,o;return V.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=(null==t?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;case 3:if(!(n<e.length)){s.next=11;break}return a=Math.min(e.length-n,r),o=e.slice(n,n+a),n+=a,s.next=9,i.encode(o);case 9:s.next=3;break;case 11:case"end":return s.stop()}}),bc)}var xc=V.a.mark(_c);function _c(e){var t,r,n,i,a,o,s,u=arguments;return V.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:t=u.length>1&&void 0!==u[1]?u[1]:{},r=t.chunkSize,n=void 0===r?262144:r,i=0;case 3:if(!(i<e.byteLength)){c.next=14;break}return a=Math.min(e.byteLength-i,n),o=new ArrayBuffer(a),s=new Uint8Array(e,i,a),new Uint8Array(o).set(s),i+=a,c.next=12,o;case 12:c.next=3;break;case 14:case"end":return c.stop()}}),xc)}var kc=r(25),Oc=r.n(kc),Tc=r(30),Sc=r.n(Tc);function Ac(){return(Ac=Sc()(V.a.mark((function e(t,r){var n,i,a,o;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(null==r?void 0:r.chunkSize)||1048576,i=0;case 2:if(!(i<t.size)){e.next=12;break}return a=i+n,e.next=6,Oc()(t.slice(i,a).arrayBuffer());case 6:return o=e.sent,i=a,e.next=10,o;case 10:e.next=2;break;case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ec(e,t){return Zs?function(e,t){return Pc.apply(this,arguments)}(e,t):function(e,t){return Mc.apply(this,arguments)}(e,t)}function Pc(){return(Pc=Sc()(V.a.mark((function e(t,r){var n,i,a,o,s,u;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.getReader(),e.prev=1;case 2:return a=i||n.read(),null!=r&&r._streamReadAhead&&(i=n.read()),e.next=7,Oc()(a);case 7:if(o=e.sent,s=o.done,u=o.value,!s){e.next=12;break}return e.abrupt("return");case 12:return e.next=14,pc(u);case 14:e.next=2;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),n.releaseLock();case 21:case"end":return e.stop()}}),e,null,[[1,18]])})))).apply(this,arguments)}function Mc(){return(Mc=Sc()(V.a.mark((function e(t,r){var n,i,a,o,s,u,c;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!0,i=!1,e.prev=2,o=lc()(t);case 4:return e.next=6,Oc()(o.next());case 6:return s=e.sent,n=s.done,e.next=10,Oc()(s.value);case 10:if(u=e.sent,n){e.next=18;break}return c=u,e.next=15,pc(c);case 15:n=!0,e.next=4;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(2),i=!0,a=e.t0;case 24:if(e.prev=24,e.prev=25,n||null==o.return){e.next=29;break}return e.next=29,Oc()(o.return());case 29:if(e.prev=29,!i){e.next=32;break}throw a;case 32:return e.finish(29);case 33:return e.finish(24);case 34:case"end":return e.stop()}}),e,null,[[2,20,24,34],[25,,29,33]])})))).apply(this,arguments)}function jc(e,t){if("string"==typeof e)return wc(e,t);if(e instanceof ArrayBuffer)return _c(e,t);if(Fs(e))return function(e,t){return Ac.apply(this,arguments)}(e,t);if(Bs(e))return Ec(e,t);if(Ns(e))return Ec(e.body,t);throw new Error("makeIterator")}var Ic="Cannot convert supplied data type";function Lc(e,t,r){if(t.text&&"string"==typeof e)return e;var n;if((n=e)&&"object"===ai()(n)&&n.isBuffer&&(e=e.buffer),e instanceof ArrayBuffer){var i=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);var a=e.buffer,o=e.byteLength||e.length;return 0===e.byteOffset&&o===a.byteLength||(a=a.slice(e.byteOffset,e.byteOffset+o)),a}throw new Error(Ic)}function Rc(e,t,r){return Cc.apply(this,arguments)}function Cc(){return(Cc=q()(V.a.mark((function e(t,r,n){var i,a;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=3;break}return e.abrupt("return",Lc(t,r));case 3:if(!Fs(t)){e.next=7;break}return e.next=6,ou(t);case 6:t=e.sent;case 7:if(!Ns(t)){e.next=21;break}return a=t,e.next=11,uu(a);case 11:if(!r.binary){e.next=17;break}return e.next=14,a.arrayBuffer();case 14:e.t0=e.sent,e.next=20;break;case 17:return e.next=19,a.text();case 19:e.t0=e.sent;case 20:return e.abrupt("return",e.t0);case 21:if(Bs(t)&&(t=jc(t,n)),!Cs(t)&&!Ds(t)){e.next=24;break}return e.abrupt("return",gc(t));case 24:throw new Error(Ic);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Dc(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 Nc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dc(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Fc(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(r)return r;var n=Nc({fetch:Eu(t,e)},e);return Array.isArray(n.loaders)||(n.loaders=null),n}function Bc(e,t){if(!t&&e&&!Array.isArray(e))return e;var r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){var n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[].concat(W()(r),W()(n)):n}return r&&r.length?r:null}var Uc=function(){var e=Tu();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Vc(){return Uc()}function zc(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 qc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zc(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gc(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Hc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Hc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Wc=/\.([^.]+)$/;function Zc(e){return Xc.apply(this,arguments)}function Xc(){return(Xc=q()(V.a.mark((function e(t){var r,n,i,a,o=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:[],n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,Jc(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(a=Qc(t,r,qc(qc({},n),{},{nothrow:!0}),i))){e.next=8;break}return e.abrupt("return",a);case 8:if(!Fs(t)){e.next=13;break}return e.next=11,t.slice(0,10).arrayBuffer();case 11:t=e.sent,a=Qc(t,r,n,i);case 13:if(a||null!=n&&n.nothrow){e.next=15;break}throw new Error(Yc(t));case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!Jc(e))return null;if(t&&!Array.isArray(t))return Gs(t);var i,a=[];(t&&(a=a.concat(t)),null!=r&&r.ignoreRegisteredLoaders)||(i=a).push.apply(i,W()(Vc()));$c(a);var o=Kc(e,a,r,n);if(!(o||null!=r&&r.nothrow))throw new Error(Yc(e));return o}function Kc(e,t,r,n){var i=nu(e),a=i.url,o=i.type,s=a||(null==n?void 0:n.url),u=null;return null!=r&&r.mimeType&&(u=el(t,null==r?void 0:r.mimeType)),u=(u=(u=(u=u||function(e,t){var r=t&&Wc.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();var r,n=Gc(e);try{for(n.s();!(r=n.n()).done;){var i,a=r.value,o=Gc(a.extensions);try{for(o.s();!(i=o.n()).done;){if(i.value.toLowerCase()===t)return a}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}return null}(e,n):null}(t,s))||el(t,o))||function(e,t){if(!t)return null;var r,n=Gc(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if("string"==typeof t){if(tl(t,i))return i}else if(ArrayBuffer.isView(t)){if(rl(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer){if(rl(t,0,i))return i}}}catch(e){n.e(e)}finally{n.f()}return null}(t,e))||el(t,null==r?void 0:r.fallbackMimeType)}function Jc(e){return!(e instanceof Response&&204===e.status)}function Yc(e){var t=nu(e),r=t.url,n=t.type,i="No valid loader found";return e&&(i+=' data: "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return nl(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return nl(e,r,t)}return""}(e),'", contentType: "').concat(n,'"')),r&&(i+=" url: ".concat(r)),i}function $c(e){var t,r=Gc(e);try{for(r.s();!(t=r.n()).done;){Gs(t.value)}}catch(e){r.e(e)}finally{r.f()}}function el(e,t){var r,n=Gc(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(i.mimeTypes&&i.mimeTypes.includes(t))return i;if(t==="application/x.".concat(i.id))return i}}catch(e){n.e(e)}finally{n.f()}return null}function tl(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some((function(t){return e.startsWith(t)}))}function rl(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some((function(n){return function(e,t,r,n){if(n instanceof ArrayBuffer)return function(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;for(var n=new Uint8Array(e),i=new Uint8Array(t),a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}(n,e,n.byteLength);switch(ai()(n)){case"function":return n(e,r);case"string":var i=nl(e,t,n.length);return n===i;default:return!1}}(e,t,r,n)}))}function nl(e,t,r){if(e.byteLength<t+r)return"";for(var n=new DataView(e),i="",a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function il(e,t,r,n){return al.apply(this,arguments)}function al(){return(al=q()(V.a.mark((function e(t,r,n,i){var a,o,s,u;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Lu(!i||"object"===ai()(i)),!r||Array.isArray(r)||qs(r)||(i=void 0,n=r,r=void 0),e.next=4,t;case 4:return t=e.sent,n=n||{},a=nu(t),o=a.url,s=Bc(r,i),e.next=11,Zc(t,s,n);case 11:if(u=e.sent){e.next=14;break}return e.abrupt("return",null);case 14:return n=Au(n,u,s,o),i=Fc({url:o,parse:il,loaders:s},n,i),e.next=18,ol(u,t,n,i);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ol(e,t,r,n){return sl.apply(this,arguments)}function sl(){return(sl=q()(V.a.mark((function e(t,r,n,i){return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ru(t),e.next=3,Rc(r,t,n);case 3:if(r=e.sent,!t.parseTextSync||"string"!=typeof r){e.next=7;break}return n.dataType="text",e.abrupt("return",t.parseTextSync(r,n,i,t));case 7:if(!ic(t,n)){e.next=11;break}return e.next=10,ac(t,r,n,i,il);case 10:return e.abrupt("return",e.sent);case 11:if(!t.parseText||"string"!=typeof r){e.next=15;break}return e.next=14,t.parseText(r,n,i,t);case 14:return e.abrupt("return",e.sent);case 15:if(!t.parse){e.next=19;break}return e.next=18,t.parse(r,n,i,t);case 18:return e.abrupt("return",e.sent);case 19:throw Lu(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"));case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ul(e,t,r,n){return cl.apply(this,arguments)}function cl(){return(cl=q()(V.a.mark((function e(t,r,n,i){var a,o;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(r)||qs(r)||(void 0,n=r,r=void 0),a=Eu(n),o=t,"string"!=typeof t){e.next=7;break}return e.next=6,a(t);case 6:o=e.sent;case 7:if(!Fs(t)){e.next=11;break}return e.next=10,a(t);case 10:o=e.sent;case 11:return e.next=13,il(o,r,n);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ll=r(67),fl=r.n(ll),hl=r(68),dl=r.n(hl),pl=r(44),yl=r.n(pl),vl=(Math.max(6378137,6378137,6356752.314245179),function(e){return e}),gl=new We;function ml(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vl;return pe(e)?(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]):"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z),t}function bl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gl;return ml(e,t,fe._cartographicRadians?vl:ve)}function wl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vl;return pe(t)?(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]):"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]),t}function xl(e,t){return wl(e,t,fe._cartographicRadians?vl:ge)}var _l=new We,kl=new We,Ol=new We;var Tl=new We,Sl={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Al={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},El={east:new We,north:new We,up:new We,west:new We,south:new We,down:new We},Pl=new We,Ml=new We,jl=new We;function Il(e,t,r,n,i,a){var o,s,u,c=Sl[t]&&Sl[t][r];ue(c&&(!n||n===c));var l=Tl.copy(i);if(xe(l.x,0,1e-14)&&xe(l.y,0,1e-14)){var f=Math.sign(l.z);o=Pl.fromArray(Al[t]),"east"!==t&&"west"!==t&&o.scale(f),s=Ml.fromArray(Al[r]),"east"!==r&&"west"!==r&&s.scale(f),u=jl.fromArray(Al[n]),"east"!==n&&"west"!==n&&u.scale(f)}else{var h=El.up,d=El.east,p=El.north;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,h),p.copy(h).cross(d);var y=El.west,v=El.south;El.down.copy(h).scale(-1),y.copy(d).scale(-1),v.copy(p).scale(-1),o=El[t],s=El[r],u=El[n]}return a[0]=o.x,a[1]=o.y,a[2]=o.z,a[3]=0,a[4]=s.x,a[5]=s.y,a[6]=s.z,a[7]=0,a[8]=u.x,a[9]=u.y,a[10]=u.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var Ll,Rl=new We,Cl=new We,Dl=new We,Nl=new We,Fl=new We,Bl=new We,Ul=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;dl()(this,e),ue(t>=0),ue(r>=0),ue(n>=0),this.radii=new We(t,r,n),this.radiiSquared=new We(t*t,r*r,n*n),this.radiiToTheFourth=new We(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new We(0===t?0:1/t,0===r?0:1/r,0===n?0:1/n),this.oneOverRadiiSquared=new We(0===t?0:1/(t*t),0===r?0:1/(r*r),0===n?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.centerToleranceSquared=Mr,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return yl()(e,null,[{key:"WGS84",get:function(){return Ll=Ll||new e(6378137,6378137,6356752.314245179)}}]),yl()(e,[{key:"equals",value:function(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=Cl,n=Dl,i=fl()(e,3),a=i[2];this.geodeticSurfaceNormalCartographic(e,r),n.copy(this.radiiSquared).scale(r);var o=Math.sqrt(r.dot(n));return n.scale(1/o),r.scale(a),n.add(r),n.to(t)}},{key:"cartesianToCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Bl.from(e);var r=this.scaleToGeodeticSurface(Bl,Nl);if(r){var n=this.geodeticSurfaceNormal(r,Cl),i=Fl;i.copy(Bl).subtract(r);var a=Math.atan2(n.y,n.x),o=Math.asin(n.z),s=Math.sign(Ce(i,Bl))*Le(i);return xl([a,o,s],t)}}},{key:"eastNorthUpToFixedFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Pr;return Il(this,"east","north","up",e,t)}},{key:"localFrameToFixedFrame",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Pr;return Il(this,e,t,r,n,i)}},{key:"geocentricSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Rl.from(e).normalize().to(t)}},{key:"geodeticSurfaceNormalCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=bl(e),n=r[0],i=r[1],a=Math.cos(i);return Rl.set(a*Math.cos(n),a*Math.sin(n),Math.sin(i)).normalize(),Rl.to(t)}},{key:"geodeticSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Rl.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}},{key:"scaleToGeodeticSurface",value:function(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new We,n=t.oneOverRadii,i=t.oneOverRadiiSquared,a=t.centerToleranceSquared;_l.from(e);var o=e.x,s=e.y,u=e.z,c=n.x,l=n.y,f=n.z,h=o*o*c*c,d=s*s*l*l,p=u*u*f*f,y=h+d+p,v=Math.sqrt(1/y);if(Number.isFinite(v)){var g=kl;if(g.copy(e).scale(v),y<a)return g.to(r);var m=i.x,b=i.y,w=i.z,x=Ol;x.set(g.x*m*2,g.y*b*2,g.z*w*2);var _,k,O,T,S=(1-v)*e.len()/(.5*x.len()),A=0;do{var E=(_=1/(1+(S-=A)*m))*_,P=(k=1/(1+S*b))*k,M=(O=1/(1+S*w))*O,j=E*_,I=P*k,L=M*O,R=h*j*m+d*I*b+p*L*w,C=-2*R;A=(T=h*E+d*P+p*M-1)/C}while(Math.abs(T)>jr);return _l.scale([_,k,O]).to(r)}}(e,this,t)}},{key:"scaleToGeocentricSurface",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Nl.from(e);var r=Nl.x,n=Nl.y,i=Nl.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*a.x+n*n*a.y+i*i*a.z);return Nl.multiplyScalar(o).to(t)}},{key:"transformPositionToScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Nl.from(e).scale(this.oneOverRadii).to(t)}},{key:"transformPositionFromScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Nl.from(e).scale(this.radii).to(t)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];ue(xe(this.radii.x,this.radii.y,Ir)),ue(this.radii.z>0),Nl.from(e);var n=Nl.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Nl.set(0,0,n).to(r)}}]),e}();function Vl(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(0,t):""}function zl(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="/";return(t=t.map((function(e,r){return r&&(e=e.replace(new RegExp("^".concat(n)),"")),r!==t.length-1&&(e=e.replace(new RegExp("".concat(n,"$")),"")),e}))).join(n)}r(58);var ql=function e(t,r,n){c()(this,e),this.item=t,this.previous=r,this.next=n},Gl=function(){function e(){c()(this,e),this.head=null,this.tail=null,this._length=0}return w()(e,[{key:"add",value:function(e){var t=new ql(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}},{key:"remove",value:function(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}},{key:"splice",value:function(e,t){e!==t&&(this.remove(t),this._insert(e,t))}},{key:"_insert",value:function(e,t){var r=e.next;e.next=t,this.tail===e?this.tail=t:r.previous=t,t.next=r,t.previous=e,++this._length}},{key:"length",get:function(){return this._length}}]),e}();function Hl(e){return null!=e}var Wl=function(){function e(){c()(this,e),On(this,"_list",void 0),On(this,"_sentinel",void 0),On(this,"_trimTiles",void 0),this._list=new Gl,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return w()(e,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(e){var t=e._cacheNode;Hl(t)&&this._list.splice(this._sentinel,t)}},{key:"add",value:function(e,t,r){Hl(t._cacheNode)||(t._cacheNode=this._list.add(t),r&&r(e,t))}},{key:"unloadTile",value:function(e,t,r){var n=t._cacheNode;Hl(n)&&(this._list.remove(n),t._cacheNode=void 0,r&&r(e,t))}},{key:"unloadTiles",value:function(e,t){var r=this._trimTiles;this._trimTiles=!1;for(var n=this._list,i=1024*e.maximumMemoryUsage*1024,a=this._sentinel,o=n.head;o!==a&&(e.gpuMemoryUsageInBytes>i||r);){var s=o.item;o=o.next,this.unloadTile(e,s,t)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),e}();var Zl=new We,Xl=new We,Ql=new xr([new yr,new yr,new yr,new yr,new yr,new yr]);function Kl(e,t){var r=e.cameraDirection,n=e.cameraUp,i=e.height,a=e.distanceScales.metersPerUnit,o=[e.longitude,e.latitude,0],s=Ul.WGS84.cartographicToCartesian(o,new We),u=Ul.WGS84.eastNorthUpToFixedFrame(s),c=e.unprojectPosition(e.cameraPosition),l=Ul.WGS84.cartographicToCartesian(c,new We),f=new We(u.transformAsVector(new We(r).scale(a))).normalize(),h=new We(u.transformAsVector(new We(n).scale(a))).normalize();return function(e,t){var r=e.getFrustumPlanes(),n=0;for(var i in r){var a=r[i],o=a.normal.dot(e.center);Xl.copy(a.normal).scale(a.distance-o).add(e.center);var s=e.unprojectPosition(Xl),u=Ul.WGS84.cartographicToCartesian(s,new We);Ql.planes[n++].fromPointNormal(u,Zl.copy(t).subtract(u))}}(e,s),{camera:{position:l,direction:f,up:h},viewport:e,height:i,cullingVolume:Ql,frameNumber:t,sseDenominator:1.15}}var Jl=new We;function Yl(e){var t=e.halfAxes,r=e.radius,n=e.width,i=e.height;if(t){var a=function(e){e.getColumn(0,Jl);var t=e.getColumn(1),r=e.getColumn(2);return Jl.add(t).add(r).len()}(t);return Math.log2(6356752.314245179/a)}return r?Math.log2(6356752.314245179/r):i&&n?(Math.log2(6378137/n)+Math.log2(6378137/i))/2:1}var $l=0,ef=1,tf=3,rf=4,nf=5,af=1,of=2,sf="empty",uf="scenegraph",cf="pointcloud",lf="mesh",ff="I3S",hf="TILES3D",df="geometricError",pf=1;function yf(e){return null!=e}var vf=new We,gf=new We,mf=new We;function bf(e,t,r){if(Us(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,r){var n=new We(e[0],e[1],e[2]);t.transform(n,n);var i=[];if(10===e.length){var a=e.slice(3,6),o=new Qt;o.fromArray(e,6);var s=new We([1,0,0]),u=new We([0,1,0]),c=new We([0,0,1]);s.transformByQuaternion(o),s.scale(a[0]),u.transformByQuaternion(o),u.scale(a[1]),c.transformByQuaternion(o),c.scale(a[2]),i=[].concat(W()(s.toArray()),W()(u.toArray()),W()(c.toArray()))}else i=[].concat(W()(e.slice(3,6)),W()(e.slice(6,9)),W()(e.slice(9,12)));var l=t.transformAsVector(i.slice(0,3)),f=t.transformAsVector(i.slice(3,6)),h=t.transformAsVector(i.slice(6,9)),d=new xt([l[0],l[1],l[2],f[0],f[1],f[2],h[0],h[1],h[2]]);if(yf(r))return r.center=n,r.halfAxes=d,r;return new hr(n,d)}(e.box,t,r);if(e.region){var n=O()(e.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5],l=Ul.WGS84.cartographicToCartesian([me(i),me(s),u],gf),f=Ul.WGS84.cartographicToCartesian([me(o),me(a),c],mf),h=(new We).addVectors(l,f).multiplyScalar(.5),d=(new We).subVectors(l,f).len()/2;return wf([h[0],h[1],h[2],d],new Pr)}if(e.sphere)return wf(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function wf(e,t,r){var n=new We(e[0],e[1],e[2]);t.transform(n,n);var i=t.getScale(vf),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return yf(r)?(r.center=n,r.radius=o,r):new st(n,o)}new We,new We,new Pr,new We,new We,new We;function xf(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){var r=e.dynamicScreenSpaceErrorComputedDensity,n=e.dynamicScreenSpaceErrorFactor;return function(e,t){var r=e*t;return 1-Math.exp(-r*r)}(t,r)*n}return 0}var _f=Math.PI/2;function kf(e){var t=O()(e,3),r=t[0],n=t[1],i=t[2],a=ve(r),o=ve(n),s=1+i/6378137,u=s*Math.cos(o);return[r=u*Math.cos(a),n=u*Math.sin(a),i=s*Math.sin(o)]}function Of(e,t){var r=O()(e,3),n=r[0],i=r[1],a=r[2],o=void 0===a?0:a,s=O()(t,3),u=s[0],c=s[1],l=s[2],f=kf([u,c,void 0===l?0:l]),h=kf([n,i,o]),d=h[0]-f[0],p=h[1]-f[1],y=h[2]-f[2];return d*d+p*p+y*y}function Tf(e,t){var r=t.viewport,n=e.header.mbs[1],i=[e.header.mbs[0],n,e.header.mbs[2]],a=e.header.mbs[3]/6378137,o=Of(r.unprojectPosition(r.cameraPosition),i)-a*a;return o<=0?170141175e30:function(e){return e.viewport.projectionMatrix[5]}(t)*a/Math.sqrt(o)*300}var Sf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;c()(this,e),this._array=new Array(t),this._map=new Map,this._length=t}return w()(e,[{key:"get",value:function(e){return Us(e<this._array.length),this._array[e]}},{key:"set",value:function(e,t){Us(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}},{key:"delete",value:function(e){var t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(e){if(!this._map.has(e)){var t=this.length++;this._array[t]=e,this._map.set(e,t)}}},{key:"pop",value:function(){var e=this._array[--this.length];return this._map.delete(e),e}},{key:"reserve",value:function(e){Us(e>=0),e>this._array.length&&(this._array.length=e)}},{key:"resize",value:function(e){Us(e>=0),this.length=e}},{key:"trim",value:function(e){null==e&&(e=this.length),this._array.length=e}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(e){return this._map.has(e)}},{key:"length",get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},{key:"values",get:function(){return this._array}}]),e}();function Af(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ef(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ef(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ef(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pf(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 Mf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pf(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var jf={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},If=function(){function e(t){c()(this,e),On(this,"options",void 0),On(this,"root",void 0),On(this,"requestedTiles",void 0),On(this,"selectedTiles",void 0),On(this,"emptyTiles",void 0),On(this,"_traversalStack",void 0),On(this,"_emptyTraversalStack",void 0),On(this,"_frameNumber",void 0),this.options=Mf(Mf({},jf),t),this._traversalStack=new Sf,this._emptyTraversalStack=new Sf,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return w()(e,[{key:"traverse",value:function(e,t,r){this.root=e,this.options=Mf(Mf({},this.options),r),this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(e,t){var r=this._traversalStack;for(e._selectionDepth=1,r.push(e);r.length>0;){var n=r.pop(),i=!1;this.canTraverse(n,t)&&(this.updateChildTiles(n,t),i=this.updateAndPushChildren(n,t,r,n.hasRenderContent?n._selectionDepth+1:n._selectionDepth));var a=n.parent,o=Boolean(!a||a._shouldRefine),s=!i;n.hasRenderContent?n.refine===af?(this.loadTile(n,t),this.selectTile(n,t)):n.refine===of&&(this.loadTile(n,t),s&&this.selectTile(n,t)):(this.emptyTiles[n.id]=n,this.loadTile(n,t),s&&this.selectTile(n,t)),this.touchTile(n,t),n._shouldRefine=i&&o}this.options.onTraversalEnd(t)}},{key:"updateChildTiles",value:function(e,t){var r,n=Af(e.children);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.updateTile(i,t)}}catch(e){n.e(e)}finally{n.f()}return!0}},{key:"updateAndPushChildren",value:function(e,t,r,n){var i=this.options,a=i.loadSiblings,o=i.skipLevelOfDetail,s=e.children;s.sort(this.compareDistanceToCamera.bind(this));var u,c=e.refine===of&&e.hasRenderContent&&!o,l=!1,f=!0,h=Af(s);try{for(h.s();!(u=h.n()).done;){var d=u.value;if(d._selectionDepth=n,d.isVisibleAndInRequestVolume?(r.find(d)&&r.delete(d),r.push(d),l=!0):(c||a)&&(this.loadTile(d,t),this.touchTile(d,t)),c){var p=void 0;if(p=!!d._inRequestVolume&&(d.hasRenderContent?d.contentAvailable:this.executeEmptyTraversal(d,t)),!(f=f&&p))return!1}}}catch(e){h.e(e)}finally{h.f()}return l||(f=!1),f}},{key:"updateTile",value:function(e,t){this.updateTileVisibility(e,t)}},{key:"selectTile",value:function(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}},{key:"loadTile",value:function(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}},{key:"touchTile",value:function(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}},{key:"canTraverse",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!e.hasChildren&&(e.hasTilesetContent?!e.contentExpired:!(!n&&!e.isVisibleAndInRequestVolume)&&this.shouldRefine(e,t,r))}},{key:"shouldLoadTile",value:function(e){return e.hasUnloadedContent||e.contentExpired}},{key:"shouldSelectTile",value:function(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(e,t,r){var n=e._screenSpaceError;return r&&(n=e.getScreenSpaceError(t,!0)),n>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(e,t){var r=[];if(this.options.viewportTraversersMap)for(var n in this.options.viewportTraversersMap){this.options.viewportTraversersMap[n]===t.viewport.id&&r.push(n)}else r.push(t.viewport.id);e.updateVisibility(t,r)}},{key:"compareDistanceToCamera",value:function(e,t){return e._distanceToCamera-t._distanceToCamera}},{key:"anyChildrenVisible",value:function(e,t){var r,n=!1,i=Af(e.children);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.updateVisibility(t),n=n||a.isVisibleAndInRequestVolume}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"executeEmptyTraversal",value:function(e,t){var r=!0,n=this._emptyTraversalStack;for(n.push(e);n.length>0&&r;){var i=n.pop();if(this.updateTile(i,t),i.isVisibleAndInRequestVolume||this.loadTile(i,t),this.touchTile(i,t),!i.hasRenderContent&&this.canTraverse(i,t,!1,!0)){var a,o=Af(i.children);try{for(o.s();!(a=o.n()).done;){var s=a.value;n.find(s)&&n.delete(s),n.push(s)}}catch(e){o.e(e)}finally{o.f()}}else i.contentAvailable||(r=!1)}return r}}]),e}();function Lf(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 Rf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lf(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Cf=new We;var Df=function(){function e(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";c()(this,e),On(this,"tileset",void 0),On(this,"header",void 0),On(this,"id",void 0),On(this,"url",void 0),On(this,"parent",void 0),On(this,"refine",void 0),On(this,"type",void 0),On(this,"contentUrl",void 0),On(this,"lodMetricType",void 0),On(this,"lodMetricValue",void 0),On(this,"boundingVolume",void 0),On(this,"content",void 0),On(this,"contentState",void 0),On(this,"gpuMemoryUsageInBytes",void 0),On(this,"children",void 0),On(this,"depth",void 0),On(this,"viewportIds",void 0),On(this,"transform",void 0),On(this,"userData",void 0),On(this,"computedTransform",void 0),On(this,"hasEmptyContent",void 0),On(this,"hasTilesetContent",void 0),On(this,"traverser",void 0),On(this,"_cacheNode",void 0),On(this,"_frameNumber",void 0),On(this,"_lodJudge",void 0),On(this,"_expireDate",void 0),On(this,"_expiredContent",void 0),On(this,"_shouldRefine",void 0),On(this,"_distanceToCamera",void 0),On(this,"_centerZDepth",void 0),On(this,"_screenSpaceError",void 0),On(this,"_visibilityPlaneMask",void 0),On(this,"_visible",void 0),On(this,"_inRequestVolume",void 0),On(this,"_stackLength",void 0),On(this,"_selectionDepth",void 0),On(this,"_touchedFrame",void 0),On(this,"_visitedFrame",void 0),On(this,"_selectedFrame",void 0),On(this,"_requestedFrame",void 0),On(this,"_priority",void 0),On(this,"_contentBoundingVolume",void 0),On(this,"_viewerRequestVolume",void 0),On(this,"_initialTransform",void 0),this.header=r,this.tileset=t,this.id=i||r.id,this.url=r.url,this.parent=n,this.refine=this._getRefine(r.refine),this.type=r.type,this.contentUrl=r.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=$l,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new If({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new Pr,this.transform=new Pr,this._initializeLodMetric(r),this._initializeTransforms(r),this._initializeBoundingVolumes(r),this._initializeContent(r),this._initializeRenderingState(r),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}var t;return w()(e,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return null===this.header}},{key:"getScreenSpaceError",value:function(e,t){switch(this.tileset.type){case ff:return Tf(this,e);case hf:return function(e,t,r){var n=e.tileset,i=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=r?i:e.lodMetricValue;if(0===a)return 0;var o=Math.max(e._distanceToCamera,1e-7),s=t.height,u=t.sseDenominator,c=a*s*(n.options.viewDistanceScale||1)/(o*u);return c-=xf(n,o)}(this,e,t);default:throw new Error("Unsupported tileset type")}}},{key:"_getPriority",value:function(){var e=this.tileset._traverser,t=e.options.skipLevelOfDetail,r=this.refine===af||t;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===$l)return-1;var n=this.parent,i=n&&(!r||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,a=e.root?e.root._screenSpaceError:0;return Math.max(a-i,0)}},{key:"loadContent",value:(t=q()(V.a.mark((function e(){var t,r,n,i;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.hasEmptyContent){e.next=2;break}return e.abrupt("return",!1);case 2:if(!this.content){e.next=4;break}return e.abrupt("return",!0);case 4:return this.contentExpired&&(this._expireDate=null),this.contentState=ef,e.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(t=e.sent){e.next=13;break}return this.contentState=$l,e.abrupt("return",!1);case 13:return e.prev=13,r=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,i=Rf(Rf({},this.tileset.loadOptions),{},_()({},n.id,Rf(Rf({},this.tileset.loadOptions[n.id]),{},{isTileset:"json"===this.type},this._getLoaderSpecificOptions(n.id)))),e.next=19,ul(r,n,i);case 19:if(this.content=e.sent,!this.tileset.options.contentLoader){e.next=23;break}return e.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=tf,this._onContentLoaded(),e.abrupt("return",!0);case 29:throw e.prev=29,e.t0=e.catch(13),this.contentState=nf,e.t0;case 33:return e.prev=33,t.done(),e.finish(33);case 36:case"end":return e.stop()}}),e,this,[[13,29,33,36]])}))),function(){return t.apply(this,arguments)})},{key:"unloadContent",value:function(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=$l,!0}},{key:"updateVisibility",value:function(e,t){if(this._frameNumber!==e.frameNumber){var r=this.parent,n=r?r._visibilityPlaneMask:xr.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var i=r?r.computedTransform:this.tileset.modelMatrix;this._updateTransform(i)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,n),this._visible=this._visibilityPlaneMask!==xr.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}}},{key:"visibility",value:function(e,t){var r=e.cullingVolume,n=this.boundingVolume;return r.computeVisibilityWithPlaneMask(n,t)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(e){var t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(e){var t=e.camera,r=this.boundingVolume;return Cf.subVectors(r.center,t.position),t.direction.dot(Cf)}},{key:"insideViewerRequestVolume",value:function(e){var t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}},{key:"updateExpiration",value:function(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){var e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=rf,this._expiredContent=this.content)}}},{key:"_initializeLodMetric",value:function(e){"lodMetricType"in e?this.lodMetricType=e.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}},{key:"_initializeTransforms",value:function(e){this.transform=e.transform?new Pr(e.transform):new Pr;var t=this.parent,r=this.tileset,n=t&&t.computedTransform?t.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new Pr(n).multiplyRight(this.transform);var i=t&&t._initialTransform?t._initialTransform.clone():new Pr;this._initialTransform=new Pr(i).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}},{key:"_initializeContent",value:function(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=$l,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=xr.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}},{key:"_getRefine",value:function(e){return e||this.parent&&this.parent.refine||of}},{key:"_isTileset",value:function(){return-1!==this.contentUrl.indexOf(".json")}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}},{key:"_updateBoundingVolume",value:function(e){this.boundingVolume=bf(e.boundingVolume,this.computedTransform,this.boundingVolume);var t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=bf(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=bf(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Pr,t=e.clone().multiplyRight(this.transform),r=!t.equals(this.computedTransform);r&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(e){switch(e){case"i3s":return Rf(Rf({},this.tileset.options.i3s),{},{tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(t=this.tileset.tileset).asset&&t.asset.gltfUpAxis||"Y"}}var t}},{key:"selected",get:function(){return this._selectedFrame===this.tileset._frameNumber}},{key:"isVisible",get:function(){return this._visible}},{key:"isVisibleAndInRequestVolume",get:function(){return this._visible&&this._inRequestVolume}},{key:"hasRenderContent",get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent}},{key:"hasChildren",get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0}},{key:"contentReady",get:function(){return this.contentState===tf||this.hasEmptyContent}},{key:"contentAvailable",get:function(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}},{key:"hasUnloadedContent",get:function(){return this.hasRenderContent&&this.contentUnloaded}},{key:"contentUnloaded",get:function(){return this.contentState===$l}},{key:"contentExpired",get:function(){return this.contentState===rf}},{key:"contentFailed",get:function(){return this.contentState===nf}},{key:"extras",get:function(){return this.header.extras}}]),e}();function Nf(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var Ff=function(e){f()(r,e);var t=Nf(r);function r(){return c()(this,r),t.apply(this,arguments)}return w()(r,[{key:"compareDistanceToCamera",value:function(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}},{key:"updateTileVisibility",value:function(e,t){if(Hn()(y()(r.prototype),"updateTileVisibility",this).call(this,e,t),e.isVisibleAndInRequestVolume){var n=e.children.length>0;if(e.hasTilesetContent&&n){var i=e.children[0];return this.updateTileVisibility(i,t),void(e._visible=i._visible)}if(this.meetsScreenSpaceErrorEarly(e,t))e._visible=!1;else{var a=e.refine===of,o=e._optimChildrenWithinParent===pf;a&&o&&n&&!this.anyChildrenVisible(e,t)&&(e._visible=!1)}}}},{key:"meetsScreenSpaceErrorEarly",value:function(e,t){var r=e.parent;return!(!r||r.hasTilesetContent||r.refine!==af)&&!this.shouldRefine(e,t,!0)}}]),r}(If),Bf="REQUESTED",Uf="COMPLETED",Vf="ERROR",zf=function(){function e(){c()(this,e),On(this,"_statusMap",void 0),this._statusMap={}}return w()(e,[{key:"add",value:function(e,t,r,n){var i=this;this._statusMap[t]||(this._statusMap[t]={request:e,callback:r,key:t,frameState:n,status:Bf},e().then((function(e){i._statusMap[t].status=Uf,i._statusMap[t].callback(e,n)})).catch((function(e){i._statusMap[t].status=Vf,r(e)})))}},{key:"update",value:function(e,t){this._statusMap[e]&&(this._statusMap[e].frameState=t)}},{key:"find",value:function(e){return this._statusMap[e]}}]),e}();function qf(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 Gf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qf(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Hf(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Wf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wf(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Wf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Zf(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var Xf=function(e){f()(n,e);var t,r=Zf(n);function n(e){var t;return c()(this,n),t=r.call(this,e),On(bi()(t),"_tileManager",void 0),t._tileManager=new zf,t}return w()(n,[{key:"shouldRefine",value:function(e,t){return e._lodJudge=function(e,t){var r=t.viewport,n=r.metersPerPixel,i=e.header.mbs[1],a=e.header.mbs[0],o=e.header.mbs[2],s=e.header.mbs[3],u=r.height,c=r.width,l=r.latitude,f=r.longitude,h=[f,l],d=[a,i,o],p=[f,i],y=[a,l],v=Math.sqrt(u*u+c*c)*n[0],g=.5*u+s/6378137,m=.5*c+s/6378137;if(Of(h,d)>v+s/6378137)return"OUT";if(Of(h,p)>g)return"OUT";if(Of(h,y)>m)return"OUT";if(0===e.lodMetricValue)return"DIG";var b=Tf(e,t);return(b*=_f)<.5?"OUT":!e.header.children||b<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}(e,t),"DIG"===e._lodJudge}},{key:"updateChildTiles",value:function(e,t){var r,n=this,i=e.header.children||[],a=e.children,o=e.tileset,s=Hf(i);try{var u=function(){var i=r.value,s="".concat(i.id,"-").concat(t.viewport.id),u=a&&a.find((function(e){return e.id===s}));if(u)u&&n.updateTile(u,t);else{var c=function(){return n._loadTile(i.id,o)};n._tileManager.find(s)?n._tileManager.update(s,t):(o.tileset.nodePages&&(c=function(){return o.tileset.nodePagesTile.formTileFromNodePages(i.id)}),n._tileManager.add(c,s,(function(t){return n._onTileLoad(t,e,s)}),t))}};for(s.s();!(r=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}return!1}},{key:"_loadTile",value:(t=q()(V.a.mark((function e(t,r){var n,i,a;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.loader,i=r.getTileUrl("".concat(r.url,"/nodes/").concat(t)),a=Gf(Gf({},r.loadOptions),{},{i3s:Gf(Gf({},r.loadOptions.i3s),{},{isTileHeader:!0,loadContent:!1})}),e.next=5,ul(i,n,a);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})},{key:"_onTileLoad",value:function(e,t,r){var n=new Df(t.tileset,e,t,r);t.children.push(n);var i=this._tileManager.find(n.id).frameState;this.updateTile(n,i),this._frameNumber===i.frameNumber&&this.executeTraversal(n,i)}}]),n}(If);function Qf(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Kf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kf(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Kf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Jf(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 Yf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jf(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $f={description:"",ellipsoid:Ul.WGS84,modelMatrix:new Pr,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(e){return e},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},eh=function(){function e(t,r){c()(this,e),On(this,"options",void 0),On(this,"loadOptions",void 0),On(this,"type",void 0),On(this,"tileset",void 0),On(this,"loader",void 0),On(this,"url",void 0),On(this,"basePath",void 0),On(this,"modelMatrix",void 0),On(this,"ellipsoid",void 0),On(this,"lodMetricType",void 0),On(this,"lodMetricValue",void 0),On(this,"refine",void 0),On(this,"root",void 0),On(this,"roots",void 0),On(this,"asset",void 0),On(this,"description",void 0),On(this,"properties",void 0),On(this,"extras",void 0),On(this,"attributions",void 0),On(this,"credits",void 0),On(this,"stats",void 0),On(this,"traverseCounter",void 0),On(this,"geometricError",void 0),On(this,"selectedTiles",void 0),On(this,"cartographicCenter",void 0),On(this,"cartesianCenter",void 0),On(this,"zoom",void 0),On(this,"boundingVolume",void 0),On(this,"gpuMemoryUsageInBytes",void 0),On(this,"dynamicScreenSpaceErrorComputedDensity",void 0),On(this,"_traverser",void 0),On(this,"_cache",void 0),On(this,"_requestScheduler",void 0),On(this,"_frameNumber",void 0),On(this,"_queryParamsString",void 0),On(this,"_queryParams",void 0),On(this,"_extensionsUsed",void 0),On(this,"_tiles",void 0),On(this,"_pendingCount",void 0),On(this,"lastUpdatedVieports",void 0),On(this,"_requestedTiles",void 0),On(this,"_emptyTiles",void 0),On(this,"frameStateData",void 0),On(this,"maximumMemoryUsage",void 0),Us(t),this.options=Yf(Yf({},$f),r),this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||n.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new Wl,this._requestScheduler=new jn({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new An({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this._initializeTileSet(t)}var t;return w()(e,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return 0===this._pendingCount&&0!==this._frameNumber}},{key:"setProps",value:function(e){this.options=Yf(Yf({},this.options),e)}},{key:"setOptions",value:function(e){this.options=Yf(Yf({},this.options),e)}},{key:"getTileUrl",value:function(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}},{key:"hasExtension",value:function(e){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(e)>-1)}},{key:"update",value:function(e){if((!("loadTiles"in this.options)||this.options.loadTiles)&&!(this.traverseCounter>0)){!e&&this.lastUpdatedVieports?e=this.lastUpdatedVieports:this.lastUpdatedVieports=e,e instanceof Array||(e=[e]),this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;var t,r=[],n=Qf(e);try{for(n.s();!(t=n.n()).done;){var i=t.value.id;this._needTraverse(i)?r.push(i):this.traverseCounter--}}catch(e){n.e(e)}finally{n.f()}var a,o=Qf(e);try{for(o.s();!(a=o.n()).done;){var s=a.value,u=s.id;if(this.roots[u]||(this.roots[u]=this._initializeTileHeaders(this.tileset,null)),r.includes(u)){var c=Kl(s,this._frameNumber);this._traverser.traverse(this.roots[u],c,this.options)}}}catch(e){o.e(e)}finally{o.f()}}}},{key:"_needTraverse",value:function(e){var t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}},{key:"_onTraversalEnd",value:function(e){var t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var r=this.frameStateData[t],n=Object.values(this._traverser.selectedTiles);r.selectedTiles=n,r._requestedTiles=Object.values(this._traverser.requestedTiles),r._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}},{key:"_updateTiles",value:function(){for(var e in this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[],this.frameStateData){var t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);var r,n=Qf(this.selectedTiles);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._tiles[i.id]=i}}catch(e){n.e(e)}finally{n.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(e,t){if(e.length!==t.length)return!0;var r=new Set(e.map((function(e){return e.id}))),n=new Set(t.map((function(e){return e.id}))),i=e.filter((function(e){return!n.has(e.id)})).length>0;return i=i||t.filter((function(e){return!r.has(e.id)})).length>0}},{key:"_loadTiles",value:function(){var e,t=Qf(this._requestedTiles);try{for(t.s();!(e=t.n()).done;){var r=e.value;r.contentUnloaded&&this._loadTile(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,(function(e,t){return e._unloadTile(t)}))}},{key:"_updateStats",value:function(){var e,t=0,r=0,n=Qf(this.selectedTiles);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.contentAvailable&&i.content&&(t++,i.content.pointCount&&(r+=i.content.pointCount))}}catch(e){n.e(e)}finally{n.f()}this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=t,this.stats.get("Points").count=r}},{key:"_initializeTileSet",value:function(e){this.root=this._initializeTileHeaders(e,null),this.type===hf&&this._initializeCesiumTileset(e),this.type===ff&&this._initializeI3STileset(),this._calculateViewProps()}},{key:"_calculateViewProps",value:function(){var e=this.root;Us(e);var t=e.boundingVolume.center;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new We,void(this.zoom=1);this.cartographicCenter=Ul.WGS84.cartesianToCartographic(t,new We),this.cartesianCenter=t,this.zoom=Yl(e.boundingVolume)}},{key:"_initializeStats",value:function(){this.stats.get("Tiles In Tileset(s)"),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points","memory"),this.stats.get("Tile Memory Use","memory")}},{key:"_initializeTileHeaders",value:function(e,t){var r=new Df(this,e.root,t);if(t&&(t.children.push(r),r.depth=t.depth+1),this.type===hf){var n=[];for(n.push(r);n.length>0;){var i=n.pop();this.stats.get("Tiles In Tileset(s)").incrementCount();var a,o=Qf(i.header.children||[]);try{for(o.s();!(a=o.n()).done;){var s=a.value,u=new Df(this,s,i);i.children.push(u),u.depth=i.depth+1,n.push(u)}}catch(e){o.e(e)}finally{o.f()}}}return r}},{key:"_initializeTraverser",value:function(){var e;switch(this.type){case hf:e=Ff;break;case ff:e=Xf;break;default:e=If}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(e){this._destroySubtree(e)}},{key:"_loadTile",value:(t=q()(V.a.mark((function e(t){var r;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this._onStartTileLoading(),e.next=4,t.loadContent();case 4:r=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),this._onTileLoadError(t,e.t0);case 10:return e.prev=10,this._onEndTileLoading(),this._onTileLoad(t,r),e.finish(10);case 14:case"end":return e.stop()}}),e,this,[[0,7,10,14]])}))),function(e){return t.apply(this,arguments)})},{key:"_onTileLoadError",value:function(e,t){this.stats.get("Failed Tile Loads").incrementCount();var r=t.message||t.toString(),n=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(r)),this.options.onTileError(e,r,n)}},{key:"_onTileLoad",value:function(e,t){t&&(e&&e.content&&function(e,t){Us(e),Us(t);var r=t.rtcCenter,n=t.gltfUpAxis,i=e.computedTransform,a=e.boundingVolume.center,o=new Pr(i);switch(r&&o.translate(r),n){case"Z":break;case"Y":var s=(new Pr).rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=(new Pr).rotateY(-Math.PI/2);o=o.multiplyRight(u)}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);var c=new We(a);t.cartesianModelMatrix=o,t.cartesianOrigin=c;var l=Ul.WGS84.cartesianToCartographic(c,new We),f=Ul.WGS84.eastNorthUpToFixedFrame(c).invert();t.cartographicModelMatrix=f.multiplyRight(o),t.cartographicOrigin=l,t.modelMatrix=t.cartographicModelMatrix}(e,e.content),this._addTileToCache(e),this.options.onTileLoad(e))}},{key:"_onStartTileLoading",value:function(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}},{key:"_onEndTileLoading",value:function(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}},{key:"_addTileToCache",value:function(e){this._cache.add(this,e,(function(t){return t._updateCacheStats(e)}))}},{key:"_updateCacheStats",value:function(e){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(e){this.gpuMemoryUsageInBytes-=e.content&&e.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}},{key:"_destroy",value:function(){var e=[];for(this.root&&e.push(this.root);e.length>0;){var t,r=e.pop(),n=Qf(r.children);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.push(i)}}catch(e){n.e(e)}finally{n.f()}this._destroyTile(r)}this.root=null}},{key:"_destroySubtree",value:function(e){var t=e,r=[];for(r.push(t);r.length>0;){var n,i=Qf((e=r.pop()).children);try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(a)}}catch(e){i.e(e)}finally{i.f()}e!==t&&this._destroyTile(e)}t.children=[]}},{key:"_destroyTile",value:function(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}},{key:"_initializeCesiumTileset",value:function(e){if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed,this.extras=e.extras}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}},{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"frameNumber",get:function(){return this._frameNumber}},{key:"queryParams",get:function(){return this._queryParamsString||(this._queryParamsString=function(e){for(var t=[],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];t.push("".concat(i,"=").concat(e[i]))}switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}}]),e}();var th={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect"};Object.keys(th);function rh(e,t,r){Us(e instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function nh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=new DataView(e);return"".concat(String.fromCharCode(r.getUint8(t+0))).concat(String.fromCharCode(r.getUint8(t+1))).concat(String.fromCharCode(r.getUint8(t+2))).concat(String.fromCharCode(r.getUint8(t+3)))}var ih={name:"Draco",id:"draco",module:"draco",version:"3.0.8",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":ai()(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function ah(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length,c=0;c<u;c+=3){var l=s[c],f=s[c+1],h=s[c+2];t=l<t?l:t,r=f<r?f:r,n=h<n?h:n,i=l>i?l:i,a=f>a?f:a,o=h>o?h:o}return[[t,r,n],[i,a,o]]}function oh(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return sh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function sh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var uh,ch,lh,fh,hh=function(){function e(t,r){c()(this,e),On(this,"fields",void 0),On(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(t)),function(e){var t,r={},n=oh(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;r[i.name]&&console.warn("Schema: duplicated field name",i.name,i),r[i.name]=!0}}catch(e){n.e(e)}finally{n.f()}}(t),this.fields=t,this.metadata=r||new Map}return w()(e,[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(var t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}},{key:"select",value:function(){for(var t=Object.create(null),r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];for(var a=0,o=n;a<o.length;a++){var s=o[a];t[s]=!0}var u=this.fields.filter((function(e){return t[e.name]}));return new e(u,this.metadata)}},{key:"selectAt",value:function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=n.map((function(e){return t.fields[e]})).filter(Boolean);return new e(a,this.metadata)}},{key:"assign",value:function(t){var r,n=this.metadata;if(t instanceof e){var i=t;r=i.fields,n=dh(dh(new Map,this.metadata),i.metadata)}else r=t;var a,o=Object.create(null),s=oh(this.fields);try{for(s.s();!(a=s.n()).done;){var u=a.value;o[u.name]=u}}catch(e){s.e(e)}finally{s.f()}var c,l=oh(r);try{for(l.s();!(c=l.n()).done;){var f=c.value;o[f.name]=f}}catch(e){l.e(e)}finally{l.f()}return new e(Object.values(o),n)}}]),e}();function dh(e,t){return new Map([].concat(W()(e||new Map),W()(t||new Map)))}function ph(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}!function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"}(uh||(uh={}));var yh=function(){function e(){c()(this,e)}return w()(e,[{key:"compareTo",value:function(e){return this===e}},{key:"typeId",get:function(){return uh.NONE}}],[{key:"isNull",value:function(e){return e&&e.typeId===uh.Null}},{key:"isInt",value:function(e){return e&&e.typeId===uh.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===uh.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===uh.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===uh.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===uh.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===uh.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===uh.Date}},{key:"isTime",value:function(e){return e&&e.typeId===uh.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===uh.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===uh.Interval}},{key:"isList",value:function(e){return e&&e.typeId===uh.List}},{key:"isStruct",value:function(e){return e&&e.typeId===uh.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===uh.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===uh.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===uh.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===uh.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===uh.Dictionary}}]),e}();ch=Symbol.toStringTag;var vh=function(e){f()(r,e);var t=ph(r);function r(e,n){var i;return c()(this,r),i=t.call(this),On(bi()(i),"isSigned",void 0),On(bi()(i),"bitWidth",void 0),i.isSigned=e,i.bitWidth=n,i}return w()(r,[{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}},{key:"typeId",get:function(){return uh.Int}},{key:ch,get:function(){return"Int"}}]),r}(yh),gh=function(e){f()(r,e);var t=ph(r);function r(){return c()(this,r),t.call(this,!0,8)}return r}(vh),mh=function(e){f()(r,e);var t=ph(r);function r(){return c()(this,r),t.call(this,!0,16)}return r}(vh),bh=function(e){f()(r,e);var t=ph(r);function r(){return c()(this,r),t.call(this,!0,32)}return r}(vh),wh=function(e){f()(r,e);var t=ph(r);function r(){return c()(this,r),t.call(this,!1,8)}return r}(vh),xh=function(e){f()(r,e);var t=ph(r);function r(){return c()(this,r),t.call(this,!1,16)}return r}(vh),_h=function(e){f()(r,e);var t=ph(r);function r(){return c()(this,r),t.call(this,!1,32)}return r}(vh),kh=32,Oh=64;lh=Symbol.toStringTag;var Th=function(e){f()(r,e);var t=ph(r);function r(e){var n;return c()(this,r),n=t.call(this),On(bi()(n),"precision",void 0),n.precision=e,n}return w()(r,[{key:"toString",value:function(){return"Float".concat(this.precision)}},{key:"typeId",get:function(){return uh.Float}},{key:lh,get:function(){return"Float"}}]),r}(yh),Sh=function(e){f()(r,e);var t=ph(r);function r(){return c()(this,r),t.call(this,kh)}return r}(Th),Ah=function(e){f()(r,e);var t=ph(r);function r(){return c()(this,r),t.call(this,Oh)}return r}(Th);Symbol.toStringTag;Symbol.toStringTag;Symbol.toStringTag;Symbol.toStringTag;fh=Symbol.toStringTag;var Eh=function(e){f()(r,e);var t=ph(r);function r(e,n){var i;return c()(this,r),i=t.call(this),On(bi()(i),"listSize",void 0),On(bi()(i),"children",void 0),i.listSize=e,i.children=[n],i}return w()(r,[{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}},{key:"typeId",get:function(){return uh.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:fh,get:function(){return"FixedSizeList"}}]),r}(yh);var Ph=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;c()(this,e),On(this,"name",void 0),On(this,"type",void 0),On(this,"nullable",void 0),On(this,"metadata",void 0),this.name=t,this.type=r,this.nullable=n,this.metadata=i}return w()(e,[{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}},{key:"typeId",get:function(){return this.type&&this.type.typeId}}]),e}();function Mh(e,t,r){var n=Ih(t.metadata),i=[],a=function(e){var t={};for(var r in e){var n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(var o in e){var s=jh(o,e[o],a[o]);i.push(s)}if(r){var u=jh("indices",r);i.push(u)}return new hh(i,n)}function jh(e,t,r){var n=r?Ih(r.metadata):void 0,i=function(e){switch(e.constructor){case Int8Array:return new gh;case Uint8Array:return new wh;case Int16Array:return new mh;case Uint16Array:return new xh;case Int32Array:return new bh;case Uint32Array:return new _h;case Float32Array:return new Sh;case Float64Array:return new Ah;default:throw new Error("array type not supported")}}(t.value);return new Ph(e,new Eh(t.size,new Ph("value",i)),!1,n)}function Ih(e){var t=new Map;for(var r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}function Lh(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Rh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Rh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ch(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 Dh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ch(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ch(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Nh={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Fh={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Bh=function(){function e(t){c()(this,e),On(this,"draco",void 0),On(this,"decoder",void 0),On(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return w()(e,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);var n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var a;switch(n){case this.draco.TRIANGULAR_MESH:a=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:a=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!a.ok()||!i.ptr){var o="DRACO decompression failed: ".concat(a.error_msg());throw new Error(o)}var s=this._getDracoLoaderData(i,n,t),u=this._getMeshData(i,s,t),c=ah(u.attributes),l=Mh(u.attributes,s,u.indices),f=Dh(Dh({loader:"draco",loaderData:s,header:{vertexCount:i.num_points(),boundingBox:c}},u),{},{schema:l});return f}finally{this.draco.destroy(r),i&&this.draco.destroy(i)}}},{key:"_getDracoLoaderData",value:function(e,t,r){var n=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,r);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:i}}},{key:"_getDracoAttributes",value:function(e,t){for(var r={},n=0;n<e.num_attributes();n++){var i=this.decoder.GetAttribute(e,n),a=this._getAttributeMetadata(e,n);r[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:n,metadata:a};var o=this._getQuantizationTransform(i,t);o&&(r[i.unique_id()].quantization_transform=o);var s=this._getOctahedronTransform(i,t);s&&(r[i.unique_id()].octahedron_transform=s)}return r}},{key:"_getMeshData",value:function(e,t,r){var n=this._getMeshAttributes(t,e,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:n}}},{key:"_getMeshAttributes",value:function(e,t,r){for(var n={},i=0,a=Object.values(e.attributes);i<a.length;i++){var o=a[i],s=this._deduceAttributeName(o,r);o.name=s;var u=this._getAttributeValues(t,o),c=u.value,l=u.size;n[s]={value:c,size:l,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}return n}},{key:"_getTriangleListIndices",value:function(e){var t=3*e.num_faces(),r=4*t,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(e,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,t).slice()}finally{this.draco._free(n)}}},{key:"_getTriangleStripIndices",value:function(e){var t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}(t)}finally{this.draco.destroy(t)}}},{key:"_getAttributeValues",value:function(e,t){var r,n=Fh[t.data_type],i=t.num_components,a=e.num_points()*i,o=a*n.BYTES_PER_ELEMENT,s=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}(this.draco,n),u=this.draco._malloc(o);try{var c=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,c,s,o,u),r=new n(this.draco.HEAPF32.buffer,u,a).slice()}finally{this.draco._free(u)}return{value:r,size:i}}},{key:"_deduceAttributeName",value:function(e,t){for(var r=e.unique_id,n=0,i=Object.entries(t.extraAttributes||{});n<i.length;n++){var a=O()(i[n],2),o=a[0];if(a[1]===r)return o}var s=e.attribute_type;for(var u in Nh){if(this.draco[u]===s)return Nh[u]}var c=t.attributeNameEntry||"name";return e.metadata[c]?e.metadata[c].string:"CUSTOM_ATTRIBUTE_".concat(r)}},{key:"_getTopLevelMetadata",value:function(e){var t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}},{key:"_getAttributeMetadata",value:function(e,t){var r=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(r)}},{key:"_getDracoMetadata",value:function(e){if(!e||!e.ptr)return{};for(var t={},r=this.metadataQuerier.NumEntries(e),n=0;n<r;n++){var i=this.metadataQuerier.GetEntryName(e,n);t[i]=this._getDracoMetadataField(e,i)}return t}},{key:"_getDracoMetadataField",value:function(e,t){var r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,r);var n=function(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:n}}finally{this.draco.destroy(r)}}},{key:"_disableAttributeTransforms",value:function(e){var t,r=e.quantizedAttributes,n=void 0===r?[]:r,i=e.octahedronAttributes,a=void 0===i?[]:i,o=Lh([].concat(W()(n),W()(a)));try{for(o.s();!(t=o.n()).done;){var s=t.value;this.decoder.SkipAttributeTransform(this.draco[s])}}catch(e){o.e(e)}finally{o.f()}}},{key:"_getQuantizationTransform",value:function(e,t){var r=this,n=t.quantizedAttributes,i=void 0===n?[]:n,a=e.attribute_type();if(i.map((function(e){return r.decoder[e]})).includes(a)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map((function(e){return o.min_value(e)}))}}finally{this.draco.destroy(o)}}return null}},{key:"_getOctahedronTransform",value:function(e,t){var r=this,n=t.octahedronAttributes,i=void 0===n?[]:n,a=e.attribute_type();if(i.map((function(e){return r.decoder[e]})).includes(a)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}]),e}();var Uh=r(33),Vh={};function zh(e){return qh.apply(this,arguments)}function qh(){return(qh=q()(V.a.mark((function e(t){var r,n,i=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:null,n=i.length>2&&void 0!==i[2]?i[2]:{},r&&(t=Gh(t,r,n)),Vh[t]=Vh[t]||Hh(t),e.next=6,Vh[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gh(e,t,r){if(e.startsWith("http"))return e;var n=r.modules||{};return n[e]?n[e]:Nu?r.CDN?(Lu(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.0.8","/dist/libs/").concat(e)):Fu?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function Hh(e){return Wh.apply(this,arguments)}function Wh(){return(Wh=q()(V.a.mark((function e(t){var r,n,i;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=7;break}return e.next=3,fetch(t);case 3:return r=e.sent,e.next=6,r.arrayBuffer();case 6:return e.abrupt("return",e.sent);case 7:if(Nu){e.next=14;break}if(e.t0=Uh.requireFromFile,!e.t0){e.next=13;break}return e.next=12,Uh.requireFromFile(t);case 12:e.t0=e.sent;case 13:return e.abrupt("return",e.t0);case 14:if(!Fu){e.next=16;break}return e.abrupt("return",importScripts(t));case 16:return e.next=18,fetch(t);case 18:return n=e.sent,e.next=21,n.text();case 21:return i=e.sent,e.abrupt("return",Zh(i,t));case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zh(e,t){if(!Nu)return Uh.requireFromString&&Uh.requireFromString(e,t);if(Fu)return eval.call(Du,e),null;var r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch(t){r.text=e}return document.body.appendChild(r),null}function Xh(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 Qh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xh(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Kh,Jh="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Yh="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),$h="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");function ed(e){return td.apply(this,arguments)}function td(){return(td=q()(V.a.mark((function e(t){var r;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modules||{},Kh=r.draco3d?Kh||r.draco3d.createDecoderModule({}).then((function(e){return{draco:e}})):Kh||rd(t),e.next=4,Kh;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rd(e){return nd.apply(this,arguments)}function nd(){return(nd=q()(V.a.mark((function e(t){var r,n,i,a;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.draco&&t.draco.decoderType,e.next="js"===e.t0?3:(e.t0,7);break;case 3:return e.next=5,zh(Jh,"draco",t);case 5:return r=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,zh(Yh,"draco",t);case 10:return e.t2=e.sent,e.next=13,zh($h,"draco",t);case 13:return e.t3=e.sent,e.t4=[e.t2,e.t3],e.next=17,e.t1.all.call(e.t1,e.t4);case 17:i=e.sent,a=O()(i,2),r=a[0],n=a[1];case 21:return r=r||globalThis.DracoDecoderModule,e.next=24,id(r,n);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function id(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(Qh(Qh({},r),{},{onModuleLoaded:function(e){return t({draco:e})}}))}))}function ad(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 od(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ad(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ad(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var sd=od(od({},ih),{},{parse:function(e,t){return ud.apply(this,arguments)}});function ud(){return(ud=q()(V.a.mark((function e(t,r){var n,i,a;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ed(r);case 2:return n=e.sent,i=n.draco,a=new Bh(i),e.prev=5,e.abrupt("return",a.parseSync(t,null==r?void 0:r.draco));case 7:return e.prev=7,a.destroy(),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[5,,7,10]])})))).apply(this,arguments)}var cd,ld=(cd={},_()(cd,5130,Float64Array),_()(cd,5126,Float32Array),_()(cd,5123,Uint16Array),_()(cd,5125,Uint32Array),_()(cd,5121,Uint8Array),_()(cd,5120,Int8Array),_()(cd,5122,Int16Array),_()(cd,5124,Int32Array),cd),fd={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},hd=function(){function e(){c()(this,e)}return w()(e,null,[{key:"fromTypedArray",value:function(e){for(var t in e=ArrayBuffer.isView(e)?e.constructor:e,ld){if(ld[t]===e)return t}throw new Error("Failed to convert GL type")}},{key:"fromName",value:function(e){var t=fd[e];if(!t)throw new Error("Failed to convert GL type");return t}},{key:"getArrayType",value:function(e){switch(e){case 33635:case 32819:case 32820:return Uint16Array;default:var t=ld[e];if(!t)throw new Error("Failed to convert GL type");return t}}},{key:"getByteSize",value:function(t){return e.getArrayType(t).BYTES_PER_ELEMENT}},{key:"validate",value:function(t){return Boolean(e.getArrayType(t))}},{key:"createTypedArray",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;void 0===i&&(i=(r.byteLength-n)/e.getByteSize(t));var a=e.getArrayType(t);return new a(r,n,i)}}]),e}(),dd=function(){function e(t,r){c()(this,e),this.json=t,this.buffer=r,this.featuresLength=0,this._cachedTypedArrays={}}return w()(e,[{key:"getExtension",value:function(e){return this.json.extensions&&this.json.extensions[e]}},{key:"hasProperty",value:function(e){return Boolean(this.json[e])}},{key:"getGlobalProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5125,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.json[e];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(e,t,r,1,n.byteOffset):n}},{key:"getPropertyArray",value:function(e,t,r){var n=this.json[e];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(t=hd.fromName(n.componentType)),this._getTypedArrayFromBinary(e,t,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(e,t,n)}},{key:"getProperty",value:function(e,t,r,n,i){var a=this.json[e];if(!a)return a;var o=this.getPropertyArray(e,t,r);if(1===r)return o[n];for(var s=0;s<r;++s)i[s]=o[r*n+s];return i}},{key:"_getTypedArrayFromBinary",value:function(e,t,r,n,i){var a=this._cachedTypedArrays,o=a[e];return o||(o=hd.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+i,n*r),a[e]=o),o}},{key:"_getTypedArrayFromArray",value:function(e,t,r){var n=this._cachedTypedArrays,i=n[e];return i||(i=hd.createTypedArray(t,r),n[e]=i),i}}]),e}(),pd={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},yd={SCALAR:function(e,t){return e[t]},VEC2:function(e,t){return[e[2*t+0],e[2*t+1]]},VEC3:function(e,t){return[e[3*t+0],e[3*t+1],e[3*t+2]]},VEC4:function(e,t){return[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]]},MAT2:function(e,t){return[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]]},MAT3:function(e,t){return[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]]},MAT4:function(e,t){return[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]}},vd={SCALAR:function(e,t,r){t[r]=e},VEC2:function(e,t,r){t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:function(e,t,r){t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:function(e,t,r){t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:function(e,t,r){t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:function(e,t,r){t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:function(e,t,r){t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};var gd=function(e){return void 0!==e};function md(e,t,r){if(!t)return null;var n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?function(e,t){var r,n,i,a,o=e.instancesLength,s=e.classes,u=e.classIds,c=e.parentCounts,l=e.parentIds,f=o;gd(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,5123),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,o));if(gd(c))for(gd(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,5123),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,o)),a=new Uint16Array(o),f=0,r=0;r<o;++r)a[r]=f,f+=c[r];gd(l)&&gd(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,5123),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,f));var h=s.length;for(r=0;r<h;++r){var d=s[r].length,p=s[r].instances,y=getBinaryProperties(d,p,t);s[r].instances=combine(y,p)}var v=new Array(h).fill(0),g=new Uint16Array(o);for(r=0;r<o;++r)n=u[r],g[r]=v[n],++v[n];var m={classes:s,classIds:u,classIndexes:g,parentCounts:c,parentIndexes:a,parentIds:l};return function(e){for(var t=e.classIds.length,r=0;r<t;++r)wd(e,r,stack)}(m),m}(n,r):null}function bd(e,t,r){if(e){var n=e.parentCounts;return e.parentIds?r(e,t):n>0?function(e,t,r){var n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);var c=++marker,l=scratchStack;l.length=0,l.push(t);for(;l.length>0;)if(t=l.pop(),u[t]!==c){u[t]=c;var f=r(e,t);if(gd(f))return f;for(var h=i[t],d=o[t],p=0;p<h;++p){var y=a[d+p];y!==t&&l.push(y)}}return null}(e,t,r):function(e,t,r){var n=!0;for(;n;){var i=r(e,t);if(gd(i))return i;var a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}(e,t,r)}}function wd(e,t,r){var n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,o=e.classIds.length;if(gd(i)){assert(t<o,"Parent index ".concat(t," exceeds the total number of instances: ").concat(o)),assert(-1===r.indexOf(t),"Circular dependency detected in the batch table hierarchy."),r.push(t);for(var s=gd(n)?n[t]:1,u=gd(n)?a[t]:t,c=0;c<s;++c){var l=i[u+c];l!==t&&wd(e,l,r)}r.pop(t)}}function xd(e){return null!=e}var _d=function(e,t){return e},kd={HIERARCHY:!0,extensions:!0,extras:!0},Od=function(){function e(t,r,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(var o in c()(this,e),Us(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={},this.json)kd[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),a["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=md(this,this.json,this.binary))}return w()(e,[{key:"getExtension",value:function(e){return this.json&&this.json.extensions&&this.json.extensions[e]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(e,t){return this._checkBatchId(e),Us("string"==typeof t,t),!!this._hierarchy&&xd(bd(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return e.classes[n].name===t})))}},{key:"isExactClass",value:function(e,t){return Us("string"==typeof t,t),this.getExactClassName(e)===t}},{key:"getExactClassName",value:function(e){if(this._checkBatchId(e),this._hierarchy){var t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}},{key:"hasProperty",value:function(e,t){return this._checkBatchId(e),Us("string"==typeof t,t),xd(this._properties[t])||this._hasPropertyInHierarchy(e,t)}},{key:"getPropertyNames",value:function(e,t){var r;this._checkBatchId(e),(t=xd(t)?t:[]).length=0;var n=Object.keys(this._properties);return(r=t).push.apply(r,W()(n)),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}},{key:"getProperty",value:function(e,t){if(this._checkBatchId(e),Us("string"==typeof t,t),this._binaryProperties){var r=this._binaryProperties[t];if(xd(r))return this._getBinaryProperty(r,e)}var n=this._properties[t];if(xd(n))return _d(n[e]);if(this._hierarchy){var i=this._getHierarchyProperty(e,t);if(xd(i))return i}}},{key:"setProperty",value:function(e,t,r){var n=this.featureCount;if(this._checkBatchId(e),Us("string"==typeof t,t),this._binaryProperties){var i=this._binaryProperties[t];if(i)return void this._setBinaryProperty(i,e,r)}if(!this._hierarchy||!this._setHierarchyProperty(this,e,t,r)){var a=this._properties[t];xd(a)||(this._properties[t]=new Array(n),a=this._properties[t]),a[e]=_d(r)}}},{key:"_checkBatchId",value:function(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(e,t){return e.unpack(e.typedArray,t)}},{key:"_setBinaryProperty",value:function(e,t,r){e.pack(r,e.typedArray,t)}},{key:"_initializeBinaryProperties",value:function(){var e=null;for(var t in this._properties){var r=this._properties[t],n=this._initializeBinaryProperty(t,r);n&&((e=e||{})[t]=n)}return e}},{key:"_initializeBinaryProperty",value:function(e,t){if("byteOffset"in t){var r=t;Us(this.binary,"Property ".concat(e," requires a batch table binary.")),Us(r.type,"Property ".concat(e," requires a type."));var n=function(e,t,r,n){var i=e.componentType;Us(e.componentType);var a="string"==typeof i?hd.fromName(i):i,o=pd[e.type],s=yd[e.type],u=vd[e.type];return r+=e.byteOffset,{values:hd.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}(r,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}},{key:"_hasPropertyInHierarchy",value:function(e,t){if(!this._hierarchy)return!1;var r=bd(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return xd(e.classes[n].instances[t])}));return xd(r)}},{key:"_getPropertyNamesInHierarchy",value:function(e,t){bd(this._hierarchy,e,(function(e,r){var n=e.classIds[r],i=e.classes[n].instances;for(var a in i)i.hasOwnProperty(a)&&-1===t.indexOf(a)&&t.push(a)}))}},{key:"_getHierarchyProperty",value:function(e,t){var r=this;return bd(this._hierarchy,e,(function(e,n){var i=e.classIds[n],a=e.classes[i],o=e.classIndexes[n],s=a.instances[t];return xd(s)?xd(s.typedArray)?r._getBinaryProperty(s,o):_d(s[o]):null}))}},{key:"_setHierarchyProperty",value:function(e,t,r,n){var i=this,a=bd(this._hierarchy,t,(function(e,a){var o=e.classIds[a],s=e.classes[o],u=e.classIndexes[a],c=s.instances[r];return!!xd(c)&&(Us(a===t,'Inherited property "'.concat(r,'" is read-only.')),xd(c.typedArray)?i._setBinaryProperty(c,u,n):c[u]=_d(n),!0)}));return xd(a)}}]),e}();function Td(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return r}function Sd(e,t,r){var n,i=new DataView(t);e.header=e.header||{};var a=i.getUint32(r,!0);r+=4;var o=i.getUint32(r,!0);r+=4;var s=i.getUint32(r,!0);r+=4;var u=i.getUint32(r,!0);return r+=4,s>=570425344?(r-=8,n=a,s=o,u=0,a=0,o=0,console.warn("b3dm tile in legacy format.")):u>=570425344&&(r-=4,n=s,s=a,u=o,a=0,o=0,console.warn("b3dm tile in legacy format.")),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=n,r}function Ad(e,t,r,n){return r=function(e,t,r,n){var i=e.header,a=i.featureTableJsonByteLength,o=i.featureTableBinaryByteLength,s=i.batchLength;if(e.featureTableJson={BATCH_LENGTH:s||0},a>0){var u=rh(t,r,a);e.featureTableJson=JSON.parse(u)}return r+=a,e.featureTableBinary=new Uint8Array(t,r,o),r+=o}(e,t,r),r=function(e,t,r,n){var i=e.header,a=i.batchTableJsonByteLength,o=i.batchTableBinaryByteLength;if(a>0){var s=rh(t,r,a);e.batchTableJson=JSON.parse(s),r+=a,o>0&&(e.batchTableBinary=new Uint8Array(t,r,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=o)}return r}(e,t,r)}function Ed(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=e>>11&31,n=e>>5&63,i=31&e;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}function Pd(e,t,r){if(!(t||e&&e.batchIds&&r))return null;var n=e.batchIds,i=e.isRGB565,a=e.pointCount;if(n&&r){for(var o=new Uint8ClampedArray(3*a),s=0;s<a;s++){var u=n[s],c=r.getProperty(u,"dimensions").map((function(e){return 255*e}));o[3*s]=c[0],o[3*s+1]=c[1],o[3*s+2]=c[2]}return{type:5121,value:o,size:3,normalized:!0}}if(i){for(var l=new Uint8ClampedArray(3*a),f=0;f<a;f++){var h=Ed(t[f]);l[3*f]=h[0],l[3*f+1]=h[1],l[3*f+2]=h[2]}return{type:5121,value:l,size:3,normalized:!0}}return t&&t.length===3*a?{type:5121,value:t,size:3,normalized:!0}:{type:5121,value:t,size:4,normalized:!0}}function Md(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=se()(e);if(t){var i=se()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ae()(this,r)}}var jd=function(e){ne()(r,e);var t=Md(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return $()(this,r),e=t.call(this,2),pe(n)&&1===arguments.length?e.copy(n):(fe.debug&&(Te(n),Te(i)),e[0]=n,e[1]=i),e}return te()(r,[{key:"set",value:function(e,t){return this[0]=e,this[1]=t,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this.check()}},{key:"fromObject",value:function(e){return fe.debug&&(Te(e.x),Te(e.y)),this[0]=e.x,this[1]=e.y,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return yt(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return Ve(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return pt(this,this,e),this.check()}},{key:"transformByMatrix2x3",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5]}(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i}(this,this,e),this.check()}},{key:"ELEMENTS",get:function(){return 2}}]),r}(Me);function Id(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new jd,new We,new jd,new jd,new Uint8Array(1);function Ld(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return be(e,0,t)/t*2-1}function Rd(e){return e<0?-1:1}function Cd(e,t,r,n){if(Id(n),e<0||e>r||t<0||t>r)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(r));if(n.x=Ld(e,r),n.y=Ld(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*Rd(i),n.y=(1-Math.abs(i))*Rd(n.y)}return n.normalize()}function Dd(e,t,r){return Cd(e,t,255,r)}var Nd=new We;function Fd(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){for(var r=new We,n=new Float32Array(3*e.pointCount),i=0;i<e.pointCount;i++)r.set(t[3*i],t[3*i+1],t[3*i+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,3*i);return n}(e,t)):{type:5123,value:t,size:3,normalized:!0}:t}function Bd(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 Ud(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bd(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vd(e,t,r,n,i){return zd.apply(this,arguments)}function zd(){return(zd=q()(V.a.mark((function e(t,r,n,i,a){var o,s,u;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Td(t,r,n),n=Sd(t,r,n),n=Ad(t,r,n),qd(t),o=Gd(t),s=o.featureTable,u=o.batchTable,e.next=7,Xd(t,s,u,i,a);case 7:return Hd(t,s,i),Wd(t,s,u),Zd(t,s),e.abrupt("return",n);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qd(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function Gd(e){var t=new dd(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",5126,3);var n=function(e,t){var r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",5123,1),e.batchIds)){var n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");var i=e.batchTableJson,a=e.batchTableBinary;r=new Od(i,a,n)}return r}(e,t);return{featureTable:t,batchTable:n}}function Hd(e,t,r){if(!e.attributes.positions)if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",5126,3);else if(t.hasProperty("POSITION_QUANTIZED")){var n=t.getPropertyArray("POSITION_QUANTIZED",5123,3);if(e.isQuantized=!0,e.quantizedRange=65535,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=Fd(e,n,r)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Wd(e,t,r){if(!e.attributes.colors){var n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",5121,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",5121,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",5123,1),e.isRGB565=!0),e.attributes.colors=Pd(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",5121,4))}function Zd(e,t){if(!e.attributes.normals){var r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",5126,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",5121,2),e.isOctEncoded16P=!0),e.attributes.normals=function(e,t){if(!t)return null;if(e.isOctEncoded16P){for(var r=new Float32Array(3*e.pointsLength),n=0;n<e.pointsLength;n++)Dd(t[2*n],t[2*n+1],Nd),Nd.toArray(r,3*n);return{type:5126,size:2,value:r}}return{type:5126,size:2,value:t}}(e,r)}}function Xd(e,t,r,n,i){return Qd.apply(this,arguments)}function Qd(){return(Qd=q()(V.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h,d;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((c=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"])&&(u=c.properties),!(l=r.getExtension("3DTILES_draco_point_compression"))){e.next=15;break}if(s=l.properties,f=l.byteOffset,h=l.byteLength,s&&Number.isFinite(f)&&h){e.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:o=t.featureTableBinary.slice(f,f+h),t.hasPositions=Number.isFinite(s.POSITION),t.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),t.hasNormals=Number.isFinite(s.NORMAL),t.hasBatchIds=Number.isFinite(s.BATCH_ID),t.isTranslucent=Number.isFinite(s.RGBA);case 15:if(o){e.next=17;break}return e.abrupt("return",!0);case 17:return d={buffer:o,properties:Ud(Ud({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},e.next=20,Kd(t,d,i,a);case 20:return e.abrupt("return",e.sent);case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kd(e,t,r,n){return Jd.apply(this,arguments)}function Jd(){return(Jd=q()(V.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,y,v,g,m,b;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.parse,delete(o=Ud(Ud({},n),{},{draco:Ud(Ud({},n.draco),{},{extraAttributes:r.batchTableProperties||{}})}))["3d-tiles"],e.next=5,a(r.buffer,sd,o);case 5:if(s=e.sent,u=s.attributes.POSITION&&s.attributes.POSITION.value,c=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,l=s.attributes.NORMAL&&s.attributes.NORMAL.value,f=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=u&&s.attributes.POSITION.value.quantization,d=l&&s.attributes.NORMAL.value.quantization,h&&(p=s.POSITION.data.quantization,y=p.range,t.quantizedVolumeScale=new We(y,y,y),t.quantizedVolumeOffset=new We(p.minValues),t.quantizedRange=(1<<p.quantizationBits)-1,t.isQuantizedDraco=!0),d&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0),v={},r.batchTableProperties)for(g=0,m=Object.keys(r.batchTableProperties);g<m.length;g++)b=m[g],s.attributes[b]&&s.attributes[b].value&&(v[b.toLowerCase()]=s.attributes[b].value);t.attributes=Ud({positions:u,colors:Pd(t,c),normals:l,batchIds:f},v);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yd(e,t){if(!e)throw new Error(t)}var $d={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},ep=$d.global||$d.self||$d.window,tp="object"!==("undefined"==typeof process?"undefined":ai()(process))||"[object process]"!==String(process)||process.browser,rp="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),np=(rp&&parseFloat(rp[1]),ep._parseImageNode),ip="undefined"!=typeof Image,ap="undefined"!=typeof ImageBitmap,op=Boolean(np),sp=!!tp||op;function up(e){var t=lp(e);if(!t)throw new Error("Not an image");return t}function cp(e){switch(up(e)){case"data":return e;case"image":case"imagebitmap":var t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function lp(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"===ai()(e)&&e.data&&e.width&&e.height?"data":null}var fp=/^data:image\/svg\+xml/,hp=/\.svg((\?|#).*)?$/;function dp(e){return e&&(fp.test(e)||hp.test(e))}function pp(e,t){if(dp(t)){var r=(new TextDecoder).decode(e);return"data:image/svg+xml;base64,".concat(btoa(r))}return yp(e,t)}function yp(e,t){if(dp(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function vp(e,t,r){return gp.apply(this,arguments)}function gp(){return(gp=q()(V.a.mark((function e(t,r,n){var i,a,o;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=pp(t,n),a=self.URL||self.webkitURL,o="string"!=typeof i&&a.createObjectURL(i),e.prev=3,e.next=6,mp(o||i,r);case 6:return e.abrupt("return",e.sent);case 7:return e.prev=7,o&&a.revokeObjectURL(o),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[3,,7,10]])})))).apply(this,arguments)}function mp(e,t){return bp.apply(this,arguments)}function bp(){return(bp=q()(V.a.mark((function e(t,r){var n;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=new Image).src=t,!(r.image&&r.image.decode&&n.decode)){e.next=6;break}return e.next=5,n.decode();case 5:return e.abrupt("return",n);case 6:return e.next=8,new Promise((function(e,r){try{n.onload=function(){return e(n)},n.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))}}catch(e){r(e)}}));case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var wp={},xp=!0;function _p(e,t,r){return kp.apply(this,arguments)}function kp(){return(kp=q()(V.a.mark((function e(t,r,n){var i,a,o;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!dp(n)){e.next=7;break}return e.next=3,vp(t,r,n);case 3:a=e.sent,i=a,e.next=8;break;case 7:i=yp(t,n);case 8:return o=r&&r.imagebitmap,e.next=11,Op(i,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Op(e){return Tp.apply(this,arguments)}function Tp(){return(Tp=q()(V.a.mark((function e(t){var r,n=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Sp(r=n.length>1&&void 0!==n[1]?n[1]:null)&&xp||(r=null),!r){e.next=13;break}return e.prev=3,e.next=6,createImageBitmap(t,r);case 6:return e.abrupt("return",e.sent);case 9:e.prev=9,e.t0=e.catch(3),console.warn(e.t0),xp=!1;case 13:return e.next=15,createImageBitmap(t);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,null,[[3,9]])})))).apply(this,arguments)}function Sp(e){for(var t in e||wp)return!1;return!0}function Ap(e){var t=Ep(e);return function(e){var t=Ep(e);if(!(t.byteLength>=24&&2303741511===t.getUint32(0,!1)))return null;return{mimeType:"image/png",width:t.getUint32(16,!1),height:t.getUint32(20,!1)}}(t)||function(e){var t=Ep(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,!1)&&255===t.getUint8(2)))return null;var r=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:r}}(),n=r.tableMarkers,i=r.sofMarkers,a=2;for(;a+9<t.byteLength;){var o=t.getUint16(a,!1);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,!1),width:t.getUint16(a+7,!1)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,!1)}return null}(t)||function(e){var t=Ep(e);if(!(t.byteLength>=10&&1195984440===t.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:t.getUint16(6,!0),height:t.getUint16(8,!0)}}(t)||function(e){var t=Ep(e);if(!(t.byteLength>=14&&16973===t.getUint16(0,!1)&&t.getUint32(2,!0)===t.byteLength))return null;return{mimeType:"image/bmp",width:t.getUint32(18,!0),height:t.getUint32(22,!0)}}(t)}function Ep(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function Pp(e,t){var r=(Ap(e)||{}).mimeType,n=ep._parseImageNode;return Yd(n),n(e,r,t)}function Mp(){return(Mp=q()(V.a.mark((function e(t,r,n){var i,a,o,s,u;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=(r=r||{}).image||{},a=i.type||"auto",o=(n||{}).url,s=jp(a),e.t0=s,e.next="imagebitmap"===e.t0?8:"image"===e.t0?12:"data"===e.t0?16:20;break;case 8:return e.next=10,_p(t,r,o);case 10:return u=e.sent,e.abrupt("break",21);case 12:return e.next=14,vp(t,r,o);case 14:return u=e.sent,e.abrupt("break",21);case 16:return e.next=18,Pp(t,r);case 18:return u=e.sent,e.abrupt("break",21);case 20:Yd(!1);case 21:return"data"===a&&(u=cp(u)),e.abrupt("return",u);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jp(e){switch(e){case"auto":case"data":return function(){if(ap)return"imagebitmap";if(ip)return"image";if(sp)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return ap||ip||sp;case"imagebitmap":return ap;case"image":return ip;case"data":return sp;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var Ip={id:"image",module:"images",name:"Images",version:"3.0.8",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(e,t,r){return Mp.apply(this,arguments)},tests:[function(e){return Boolean(Ap(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}};function Lp(e,t,r){if(e.byteLength<=t+r)return"";for(var n=new DataView(e),i="",a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function Rp(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return Lp(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return Lp(e,r,t)}return""}(e),'"'))}}function Cp(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function Dp(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;var r=t.baseUri||t.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return r.substr(0,r.lastIndexOf("/")+1)+e}function Np(e,t,r){var n=e.bufferViews[r];Cp(n);var i=t[n.buffer];Cp(i);var a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}function Fp(e,t){return Us(e>=0),Us(t>0),e+(t-1)&~(t-1)}function Bp(e,t,r){var n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{var i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+Fp(n.byteLength,4)}var Up=["SCALAR","VEC2","VEC3","VEC4"],Vp=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],zp=new Map(Vp),qp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Gp={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Hp={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Wp(e){return Up[e-1]||Up[0]}function Zp(e){var t=zp.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Xp(e,t){var r=Hp[e.componentType],n=qp[e.type],i=Gp[e.componentType],a=e.count*n,o=e.count*n*i;return Cp(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function Qp(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Kp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kp(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Kp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Jp(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 Yp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jp(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $p={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},ey=function(){function e(t){c()(this,e),On(this,"gltf",void 0),On(this,"sourceBuffers",void 0),On(this,"byteLength",void 0),this.gltf=t||{json:Yp({},$p),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}return w()(e,[{key:"getApplicationData",value:function(e){return this.json[e]}},{key:"getExtraData",value:function(e){return(this.json.extras||{})[e]}},{key:"getExtension",value:function(e){var t=this.getUsedExtensions().find((function(t){return t===e})),r=this.json.extensions||{};return t?r[e]||!0:null}},{key:"getRequiredExtension",value:function(e){return this.getRequiredExtensions().find((function(t){return t===e}))?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(e,t){return(e.extensions||{})[t]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,t){if("object"===ai()(t))return t;var r=this.json[e]&&this.json[e][t];if(!r)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return r}},{key:"getTypedArrayForBufferView",value:function(e){var t=(e=this.getBufferView(e)).buffer,r=this.gltf.buffers[t];Cp(r);var n=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=Xp(e,t),i=n.ArrayType,a=n.length;return new i(r,t.byteOffset+e.byteOffset,a)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(r,n,t.byteLength)}},{key:"addApplicationData",value:function(e,t){return this.json[e]=t,this}},{key:"addExtraData",value:function(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}},{key:"addObjectExtension",value:function(e,t,r){return e.extensions=e.extensions||{},e.extensions[t]=r,this.registerUsedExtension(t),this}},{key:"setObjectExtension",value:function(e,t,r){(e.extensions||{})[t]=r}},{key:"removeObjectExtension",value:function(e,t){var r=e.extensions||{},n=r[t];return delete r[t],n}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Cp(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}},{key:"addRequiredExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Cp(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(t){return t===e}))||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(t){return t===e}))||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var t=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var t=e.meshIndex,r=e.matrix;this.json.nodes=this.json.nodes||[];var n={mesh:t};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var t=e.attributes,r=e.indices,n=e.material,i=e.mode,a=void 0===i?4:i,o={primitives:[{attributes:this._addAttributes(t),mode:a}]};if(r){var s=this._addIndices(r);o.primitives[0].indices=s}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}},{key:"addImage",value:function(e,t){var r=Ap(e),n=t||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}},{key:"addBufferView",value:function(e){var t=e.byteLength;Cp(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Fp(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,t){var r={bufferView:e,type:Wp(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},r=this.addBufferView(e),n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));var i={size:t.size,componentType:Zp(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,t))}},{key:"addTexture",value:function(e){var t={source:e.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(t),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,t;this.gltf.buffers=[];var r,n=this.byteLength,i=new ArrayBuffer(n),a=new Uint8Array(i),o=0,s=Qp(this.sourceBuffers||[]);try{for(s.s();!(r=s.n()).done;){o=Bp(r.value,a,o)}}catch(e){s.e(e)}finally{s.f()}null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}},{key:"_removeStringFromArray",value:function(e,t){for(var r=!0;r;){var n=e.indexOf(t);n>-1?e.splice(n,1):r=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};for(var r in e){var n=e[r],i=this._getGltfAttributeName(r),a=this.addBinaryBuffer(n.value,n);t[i]=a}return t}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}},{key:"_getAccessorMinMax",value:function(e,t){var r={min:null,max:null};if(e.length<t)return r;r.min=[],r.max=[];var n,i=Qp(e.subarray(0,t));try{for(i.s();!(n=i.n()).done;){var a=n.value;r.min.push(a),r.max.push(a)}}catch(e){i.e(e)}finally{i.f()}for(var o=t;o<e.length;o+=t)for(var s=0;s<t;s++)r.min[0+s]=Math.min(r.min[0+s],e[o+s]),r.max[0+s]=Math.max(r.max[0+s],e[o+s]);return r}},{key:"json",get:function(){return this.gltf.json}}]),e}();function ty(e){var t={};for(var r in e){var n=e[r];if("indices"!==r){var i=ry(n);t[r]=i}}return t}function ry(e){var t=function(e){var t=e,r=1,n=0;e&&e.value&&(t=e.value,r=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return null;if(Array.isArray(e))return new t(e);if(r&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/r);return{buffer:t,size:r,count:n}}(e),r=t.buffer,n=t.size;return{value:r,size:n,byteOffset:0,count:t.count,type:Wp(n),componentType:Zp(r)}}function ny(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 iy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ny(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ny(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ay=V.a.mark(yy);function oy(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return sy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sy(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function sy(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uy(e,t,r){return cy.apply(this,arguments)}function cy(){return(cy=q()(V.a.mark((function e(t,r,n){var i,a,o,s,u,c;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r&&null!==(i=r.gltf)&&void 0!==i&&i.decompressMeshes){e.next=2;break}return e.abrupt("return");case 2:a=new ey(t),o=[],s=oy(yy(a));try{for(s.s();!(u=s.n()).done;)c=u.value,a.getObjectExtension(c,"KHR_draco_mesh_compression")&&o.push(fy(a,c,r,n))}catch(e){s.e(e)}finally{s.f()}return e.next=8,Promise.all(o);case 8:a.removeExtension("KHR_draco_mesh_compression");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ly(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ey(e),i=oy(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value;dy(a,r),n.addRequiredExtension("KHR_draco_mesh_compression")}}catch(e){i.e(e)}finally{i.f()}}function fy(e,t,r,n){return hy.apply(this,arguments)}function hy(){return(hy=q()(V.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,y,v,g,m;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.getObjectExtension(r,"KHR_draco_mesh_compression")){e.next=3;break}return e.abrupt("return");case 3:return o=t.getTypedArrayForBufferView(a.bufferView),s=vc(o.buffer,o.byteOffset),u=i.parse,delete(c=iy({},n))["3d-tiles"],e.next=10,u(s,sd,c,i);case 10:for(l=e.sent,f=ty(l.attributes),h=0,d=Object.entries(f);h<d.length;h++)p=O()(d[h],2),y=p[0],v=p[1],y in r.attributes&&(g=r.attributes[y],null!=(m=t.getAccessor(g))&&m.min&&null!=m&&m.max&&(v.min=m.min,v.max=m.max));r.attributes=f,l.indices&&(r.indices=ry(l.indices)),py(r);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dy(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var o=i.DracoWriter.encodeSync({attributes:e}),s=null==a?void 0:null===(r=a.parseSync)||void 0===r?void 0:r.call(a,{attributes:e}),u=i._addFauxAttributes(s.attributes),c=i.addBufferView(o),l={primitives:[{attributes:u,mode:n,extensions:_()({},"KHR_draco_mesh_compression",{bufferView:c,attributes:u})}]};return l}function py(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function yy(e){var t,r,n,i,a,o;return V.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:t=oy(e.json.meshes||[]),s.prev=1,t.s();case 3:if((r=t.n()).done){s.next=24;break}n=r.value,i=oy(n.primitives),s.prev=6,i.s();case 8:if((a=i.n()).done){s.next=14;break}return o=a.value,s.next=12,o;case 12:s.next=8;break;case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(6),i.e(s.t0);case 19:return s.prev=19,i.f(),s.finish(19);case 22:s.next=3;break;case 24:s.next=29;break;case 26:s.prev=26,s.t1=s.catch(1),t.e(s.t1);case 29:return s.prev=29,t.f(),s.finish(29);case 32:case"end":return s.stop()}}),ay,null,[[1,26,29,32],[6,16,19,22]])}function vy(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return gy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gy(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function gy(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function my(e){return by.apply(this,arguments)}function by(){return(by=q()(V.a.mark((function e(t){var r,n,i,a,o;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new ey(t),n=r.json,r.removeExtension("KHR_materials_unlit"),i=vy(n.materials||[]);try{for(i.s();!(a=i.n()).done;)o=a.value,o.extensions&&o.extensions.KHR_materials_unlit&&(o.unlit=!0),r.removeObjectExtension(o,"KHR_materials_unlit")}catch(e){i.e(e)}finally{i.f()}case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wy(e){var t=new ey(e),r=t.json;if(t.materials){var n,i=vy(r.materials||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.unlit&&(delete a.unlit,t.addObjectExtension(a,"KHR_materials_unlit",{}),t.addExtension("KHR_materials_unlit"))}}catch(e){i.e(e)}finally{i.f()}}}function xy(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _y(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function _y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ky(e){return Oy.apply(this,arguments)}function Oy(){return(Oy=q()(V.a.mark((function e(t){var r,n,i,a,o,s,u;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new ey(t),n=r.json,(i=r.getExtension("KHR_lights_punctual"))&&(r.json.lights=i.lights,r.removeExtension("KHR_lights_punctual")),a=xy(n.nodes||[]);try{for(a.s();!(o=a.n()).done;)s=o.value,(u=r.getObjectExtension(s,"KHR_lights_punctual"))&&(s.light=u.light),r.removeObjectExtension(s,"KHR_lights_punctual")}catch(e){a.e(e)}finally{a.f()}case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ty(e){return Sy.apply(this,arguments)}function Sy(){return(Sy=q()(V.a.mark((function e(t){var r,n,i,a,o,s,u;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new ey(t),(n=r.json).lights&&(Cp(!(i=r.addExtension("KHR_lights_punctual")).lights),i.lights=n.lights,delete n.lights),r.json.lights){a=xy(r.json.lights);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.node,r.addObjectExtension(u,"KHR_lights_punctual",s)}catch(e){a.e(e)}finally{a.f()}delete r.json.lights}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ay(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ey(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ey(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ey(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Py(e){return My.apply(this,arguments)}function My(){return(My=q()(V.a.mark((function e(t){var r,n,i,a,o,s,u,c;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new ey(t),n=r.json,i=r.getExtension("KHR_techniques_webgl")){a=Ly(i,r),o=Ay(n.materials||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,(c=r.getObjectExtension(u,"KHR_techniques_webgl"))&&(u.technique=Object.assign({},c,a[c.technique]),u.technique.values=Ry(u.technique,r)),r.removeObjectExtension(u,"KHR_techniques_webgl")}catch(e){o.e(e)}finally{o.f()}r.removeExtension("KHR_techniques_webgl")}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jy(e,t){return Iy.apply(this,arguments)}function Iy(){return(Iy=q()(V.a.mark((function e(t,r){return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ly(e,t){var r=e.programs,n=void 0===r?[]:r,i=e.shaders,a=void 0===i?[]:i,o=e.techniques,s=void 0===o?[]:o,u=new TextDecoder;return a.forEach((function(e){if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=u.decode(t.getTypedArrayForBufferView(e.bufferView))})),n.forEach((function(e){e.fragmentShader=a[e.fragmentShader],e.vertexShader=a[e.vertexShader]})),s.forEach((function(e){e.program=n[e.program]})),s}function Ry(e,t){var r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((function(t){!e.uniforms[t].value||t in r||(r[t]=e.uniforms[t].value)})),Object.keys(r).forEach((function(e){"object"===ai()(r[e])&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))})),r}var Cy={KHR_draco_mesh_compression:i,KHR_materials_unlit:a,KHR_lights_punctual:o,KHR_techniques_webgl:s};function Dy(e){return Ny.apply(this,arguments)}function Ny(){return(Ny=q()(V.a.mark((function e(t){var r,n,i,a,o,s,u=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2?u[2]:void 0,e.t0=V.a.keys(Cy);case 3:if((e.t1=e.t0()).done){e.next=13;break}if(i=e.t1.value,o=(null==r?void 0:null===(a=r.gltf)||void 0===a?void 0:a.excludeExtensions)||{},i in o&&!o[i]){e.next=11;break}return s=Cy[i],e.next=11,s.decode(t,r,n);case 11:e.next=3;break;case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fy(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return By(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return By(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function By(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Uy(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Vy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vy(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Vy(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var zy,qy={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Gy={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Hy=function(){function e(t){c()(this,e),this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}return w()(e,[{key:"normalize",value:function(e,t){this.json=e.json;var r=e.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(r.asset.version))}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(r),this._convertTopLevelObjectsToArrays(r),function(e){var t,r=new ey(e),n=r.json,i=Fy(n.images||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=r.removeObjectExtension(a,"KHR_binary_glTF");o&&Object.assign(a,o)}}catch(e){i.e(e)}finally{i.f()}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,r.removeExtension("KHR_binary_glTF")}(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var t in qy)this._convertTopLevelObjectToArray(e,t)}},{key:"_convertTopLevelObjectToArray",value:function(e,t){var r=e[t];if(r&&!Array.isArray(r))for(var n in e[t]=[],r){var i=r[n];i.id=i.id||n;var a=e[t].length;e[t].push(i),this.idToIndexMap[t][n]=a}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var t in qy)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var r,n=Uy(e.textures);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._convertTextureIds(i)}}catch(e){n.e(e)}finally{n.f()}var a,o=Uy(e.meshes);try{for(o.s();!(a=o.n()).done;){var s=a.value;this._convertMeshIds(s)}}catch(e){o.e(e)}finally{o.f()}var u,c=Uy(e.nodes);try{for(c.s();!(u=c.n()).done;){var l=u.value;this._convertNodeIds(l)}}catch(e){c.e(e)}finally{c.f()}var f,h=Uy(e.scenes);try{for(h.s();!(f=h.n()).done;){var d=f.value;this._convertSceneIds(d)}}catch(e){h.e(e)}finally{h.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var t,r=Uy(e.primitives);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.attributes,a=n.indices,o=n.material;for(var s in i)i[s]=this._convertIdToIndex(i[s],"accessor");a&&(n.indices=this._convertIdToIndex(a,"accessor")),o&&(n.material=this._convertIdToIndex(o,"material"))}}catch(e){r.e(e)}finally{r.f()}}},{key:"_convertNodeIds",value:function(e){var t=this;e.children&&(e.children=e.children.map((function(e){return t._convertIdToIndex(e,"node")}))),e.meshes&&(e.meshes=e.meshes.map((function(e){return t._convertIdToIndex(e,"mesh")})))}},{key:"_convertSceneIds",value:function(e){var t=this;e.nodes&&(e.nodes=e.nodes.map((function(e){return t._convertIdToIndex(e,"node")})))}},{key:"_convertIdsToIndices",value:function(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);var r,n=Uy(e[t]);try{for(n.s();!(r=n.n()).done;){var i=r.value;for(var a in i){var o=i[a],s=this._convertIdToIndex(o,a);i[a]=s}}}catch(e){n.e(e)}finally{n.f()}}},{key:"_convertIdToIndex",value:function(e,t){var r=Gy[t];if(r in this.idToIndexMap){var n=this.idToIndexMap[r][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}},{key:"_updateObjects",value:function(e){var t,r=Uy(this.json.buffers);try{for(r.s();!(t=r.n()).done;){delete t.value.type}}catch(e){r.e(e)}finally{r.f()}}},{key:"_updateMaterial",value:function(e){var t,r=Uy(e.materials);try{var n=function(){var r=t.value;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var n=r.values&&r.values.tex,i=e.textures.findIndex((function(e){return e.id===n}));-1!==i&&(r.pbrMetallicRoughness.baseColorTexture={index:i})};for(r.s();!(t=r.n()).done;)n()}catch(e){r.e(e)}finally{r.f()}}}]),e}();function Wy(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new Hy).normalize(e,t)}function Zy(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 Xy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zy(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Qy={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ky={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Jy={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Yy={magFilter:Jy.TEXTURE_MAG_FILTER,minFilter:Jy.TEXTURE_MIN_FILTER,wrapS:Jy.TEXTURE_WRAP_S,wrapT:Jy.TEXTURE_WRAP_T},$y=(zy={},_()(zy,Jy.TEXTURE_MAG_FILTER,Jy.LINEAR),_()(zy,Jy.TEXTURE_MIN_FILTER,Jy.NEAREST_MIPMAP_LINEAR),_()(zy,Jy.TEXTURE_WRAP_S,Jy.REPEAT),_()(zy,Jy.TEXTURE_WRAP_,Jy.REPEAT),zy);var ev=function(){function e(){c()(this,e)}return w()(e,[{key:"postProcess",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.json,n=e.buffers,i=void 0===n?[]:n,a=e.images,o=void 0===a?[]:a,s=e.baseUri,u=void 0===s?"":s;return Cp(r),this.baseUri=u,this.json=r,this.buffers=i,this.images=o,this._resolveTree(this.json,t),this.json}},{key:"_resolveTree",value:function(e){var t=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.bufferViews&&(e.bufferViews=e.bufferViews.map((function(e,r){return t._resolveBufferView(e,r)}))),e.images&&(e.images=e.images.map((function(e,r){return t._resolveImage(e,r)}))),e.samplers&&(e.samplers=e.samplers.map((function(e,r){return t._resolveSampler(e,r)}))),e.textures&&(e.textures=e.textures.map((function(e,r){return t._resolveTexture(e,r)}))),e.accessors&&(e.accessors=e.accessors.map((function(e,r){return t._resolveAccessor(e,r)}))),e.materials&&(e.materials=e.materials.map((function(e,r){return t._resolveMaterial(e,r)}))),e.meshes&&(e.meshes=e.meshes.map((function(e,r){return t._resolveMesh(e,r)}))),e.nodes&&(e.nodes=e.nodes.map((function(e,r){return t._resolveNode(e,r)}))),e.skins&&(e.skins=e.skins.map((function(e,r){return t._resolveSkin(e,r)}))),e.scenes&&(e.scenes=e.scenes.map((function(e,r){return t._resolveScene(e,r)}))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,t){if("object"===ai()(t))return t;var r=this.json[e]&&this.json[e][t];return r||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),r}},{key:"_resolveScene",value:function(e,t){var r=this;return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((function(e){return r.getNode(e)})),e}},{key:"_resolveNode",value:function(e,t){var r=this;return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((function(e){return r.getNode(e)}))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((function(e,t){var n=r.getMesh(t);return e.id=n.id,e.primitives=e.primitives.concat(n.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,t){var r=this;return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((function(e){var t=(e=Xy({},e)).attributes;for(var n in e.attributes={},t)e.attributes[n]=r.getAccessor(t[n]);return void 0!==e.indices&&(e.indices=r.getAccessor(e.indices)),void 0!==e.material&&(e.material=r.getMaterial(e.material)),e}))),e}},{key:"_resolveMaterial",value:function(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture=Xy({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=Xy({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=Xy({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=Xy({},e.pbrMetallicRoughness);var r=e.pbrMetallicRoughness;r.baseColorTexture&&(r.baseColorTexture=Xy({},r.baseColorTexture),r.baseColorTexture.texture=this.getTexture(r.baseColorTexture.index)),r.metallicRoughnessTexture&&(r.metallicRoughnessTexture=Xy({},r.metallicRoughnessTexture),r.metallicRoughnessTexture.texture=this.getTexture(r.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,t){var r,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(r=e.componentType,Ky[r]),e.components=(n=e.type,Qy[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var i=e.bufferView.buffer,a=Xp(e,e.bufferView),o=a.ArrayType,s=a.byteLength,u=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,c=i.arrayBuffer.slice(u,u+s);e.value=new o(c)}return e}},{key:"_resolveTexture",value:function(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):$y,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,t){for(var r in e.id=e.id||"sampler-".concat(t),e.parameters={},e){var n=this._enumSamplerParameter(r);void 0!==n&&(e.parameters[n]=e[r])}return e}},{key:"_enumSamplerParameter",value:function(e){return Yy[e]}},{key:"_resolveImage",value:function(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));var r=this.images[t];return r&&(e.image=r),e}},{key:"_resolveBufferView",value:function(e,t){e.id=e.id||"bufferView-".concat(t);var r=e.buffer;e.buffer=this.buffers[r];var n=this.buffers[r].arrayBuffer,i=this.buffers[r].byteOffset||0;return"byteOffset"in e&&(i+=e.byteOffset),e.data=new Uint8Array(n,i,e.byteLength),e}},{key:"_resolveCamera",value:function(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}]),e}();function tv(e,t){return(new ev).postProcess(e,t)}function rv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}function nv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new DataView(e),i=r.magic,a=void 0===i?1735152710:i,o=n.getUint32(t,!1);return o===a||1735152710===o}function iv(e,t,r){Us(e.header.byteLength>20);var n=t.getUint32(r+0,!0),i=t.getUint32(r+4,!0);return r+=8,Us(0===i),ov(e,t,r,n),r+=n,r+=sv(e,t,r,e.header.byteLength)}function av(e,t,r,n){return Us(e.header.byteLength>20),function(e,t,r,n){for(;r+8<=e.header.byteLength;){var i=t.getUint32(r+0,!0),a=t.getUint32(r+4,!0);switch(r+=8,a){case 1313821514:ov(e,t,r,i);break;case 5130562:sv(e,t,r,i);break;case 0:n.strict||ov(e,t,r,i);break;case 1:n.strict||sv(e,t,r,i)}r+=Fp(i,4)}}(e,t,r,n),r+e.header.byteLength}function ov(e,t,r,n){var i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),Fp(n,4)}function sv(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),Fp(n,4)}function uv(e,t){return cv.apply(this,arguments)}function cv(){return(cv=q()(V.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=d.length>2&&void 0!==d[2]?d[2]:0,i=d.length>3?d[3]:void 0,a=d.length>4?d[4]:void 0,lv(t,r,n,i),Wy(t,{normalize:null==i?void 0:null===(o=i.gltf)||void 0===o?void 0:o.normalize}),l=[],null==i||null===(s=i.gltf)||void 0===s||!s.loadBuffers||!t.json.buffers){e.next=9;break}return e.next=9,fv(t,i,a);case 9:return null!=i&&null!==(u=i.gltf)&&void 0!==u&&u.loadImages&&(f=dv(t,i,a),l.push(f)),h=Dy(t,i,a),l.push(h),e.next=14,Promise.all(l);case 14:return e.abrupt("return",null!=i&&null!==(c=i.gltf)&&void 0!==c&&c.postProcess?tv(t,i):t);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lv(e,t,r,n){(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!nv(t,r,n))&&(t=(new TextDecoder).decode(t));if("string"==typeof t)e.json=Rp(t);else if(t instanceof ArrayBuffer){var i={};r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],new DataView(t)),i=rv(n,r+0),a=n.getUint32(r+4,!0),o=n.getUint32(r+8,!0);switch(Object.assign(e,{header:{byteOffset:r,byteLength:o,hasBinChunk:!1},type:i,version:a,json:{},binChunks:[]}),r+=12,e.version){case 1:return iv(e,n,r);case 2:return av(e,n,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}(i,t,r,n.glb),Cp("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else Cp(!1,"GLTF: must be ArrayBuffer or string");var a=e.json.buffers||[];if(e.buffers=new Array(a.length).fill(null),e._glb&&e._glb.header.hasBinChunk){var o=e._glb.binChunks;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}var s=e.json.images||[];e.images=new Array(s.length).fill({})}function fv(e,t,r){return hv.apply(this,arguments)}function hv(){return(hv=q()(V.a.mark((function e(t,r,n){var i,a,o,s,u,c,l;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0;case 1:if(!(i<t.json.buffers.length)){e.next=18;break}if(!(a=t.json.buffers[i]).uri){e.next=15;break}return Cp(n.fetch),u=Dp(a.uri,r),e.next=9,null==n?void 0:null===(o=n.fetch)||void 0===o?void 0:o.call(n,u);case 9:return c=e.sent,e.next=12,null==c?void 0:null===(s=c.arrayBuffer)||void 0===s?void 0:s.call(c);case 12:l=e.sent,t.buffers[i]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete a.uri;case 15:++i,e.next=1;break;case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dv(e,t,r){return pv.apply(this,arguments)}function pv(){return(pv=q()(V.a.mark((function e(t,r,n){var i,a,o;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=t.json.images||[],a=[],o=0;o<i.length;++o)a.push(yv(t,i[o],o,r,n));return e.next=5,Promise.all(a);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yv(e,t,r,n,i){return vv.apply(this,arguments)}function vv(){return(vv=q()(V.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a.fetch,s=a.parse,!r.uri){e.next=9;break}return c=Dp(r.uri,i),e.next=5,o(c);case 5:return l=e.sent,e.next=8,l.arrayBuffer();case 8:u=e.sent;case 9:return Number.isFinite(r.bufferView)&&(f=Np(t.json,t.buffers,r.bufferView),u=vc(f.buffer,f.byteOffset,f.byteLength)),Cp(u,"glTF image has no data"),e.next=13,s(u,Ip,{},a);case 13:h=e.sent,t.images[n]=h;case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gv(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 mv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gv(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bv={name:"glTF",id:"gltf",module:"gltf",version:"3.0.8",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(e){return wv.apply(this,arguments)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};function wv(){return(wv=q()(V.a.mark((function e(t){var r,n,i,a,o,s=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2?s[2]:void 0,(r=mv(mv({},bv.options),r)).gltf=mv(mv({},bv.options.gltf),r.gltf),i=r.byteOffset,a=void 0===i?0:i,o={},e.next=8,uv(o,t,a,r,n);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var xv=0,_v=1;function kv(e,t,r,n){e.rotateYtoZ=!0;var i=e.byteOffset+e.byteLength-r;if(0===i)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=vc(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4==0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}function Ov(e,t,r,n){return Tv.apply(this,arguments)}function Tv(){return(Tv=q()(V.a.mark((function e(t,r,n,i){var a,o,s;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n["3d-tiles"]||{},Sv(t,r,n),!a.loadGLTF){e.next=16;break}if(o=i.parse,s=i.fetch,!t.gltfUrl){e.next=9;break}return e.next=7,s(t.gltfUrl,n);case 7:t.gltfArrayBuffer=e.sent,t.gltfByteOffset=0;case 9:if(!t.gltfArrayBuffer){e.next=16;break}return e.next=12,o(t.gltfArrayBuffer,bv,n,i);case 12:t.gltf=e.sent,delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sv(e,t,r){switch(t){case xv:var n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),i=(new TextDecoder).decode(n);e.gltfUrl=i.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case _v:break;default:throw new Error("b3dm: Illegal glTF format field")}}function Av(e,t,r,n,i){return Ev.apply(this,arguments)}function Ev(){return(Ev=q()(V.a.mark((function e(t,r,n,i,a){var o,s;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Pv(t,r,n,i,a),e.next=3,Ov(t,_v,i,a);case 3:return(s=null==t?void 0:null===(o=t.gltf)||void 0===o?void 0:o.extensions)&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pv(e,t,r,n,i){r=kv(e,t,r=Ad(e,t,r=Sd(e,t,r=Td(e,t,r))),n);var a=new dd(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),r}function Mv(e,t,r,n,i){return jv.apply(this,arguments)}function jv(){return(jv=q()(V.a.mark((function e(t,r,n,i,a){return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Iv(t,r,n,i,a),e.next=3,Ov(t,t.gltfFormat,i,a);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Iv(e,t,r,n,i){if(r=Td(e,t,r),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));r=Sd(e,t,r);var a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r=kv(e,t,r=Ad(e,t,r+=4),n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new dd(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3);new Od(e.batchTableJson,e.batchTableBinary,s);return function(e,t,r,n){for(var i=[new Array(n),e._batchTable][0],a=new We,o=(new We,new We,new We,new xt),s=new Qt,u=new We,c={},l=new Pr,f=[],h=[],d=new We,p=new We,y=0;y<n;y++){var v=void 0;if(t.hasProperty("POSITION"))v=t.getProperty("POSITION",5126,3,y,a);else if(t.hasProperty("POSITION_QUANTIZED")){v=t.getProperty("POSITION_QUANTIZED",5123,3,y,a);var g=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3,d);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var m=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3,p);if(!m)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var b=0;b<3;b++)v[b]=v[b]/65535*m[b]+g[b]}if(!v)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(v),c.translation=a,e.normalUp=t.getProperty("NORMAL_UP",5126,3,y,f),e.normalRight=t.getProperty("NORMAL_RIGHT",5126,3,y,h);if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",5123,2,f),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",5123,2,h),e.octNormalUp){if(!e.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}e.eastNorthUp?(Ul.WGS84.eastNorthUpToFixedFrame(a,l),l.getRotationMatrix3(o)):o.identity()}!1,s.fromMatrix3(o),c.rotation=s,u.set(1,1,1);var w=t.getProperty("SCALE",5126,1,y);Number.isFinite(w)&&u.multiplyByScalar(w);var x=t.getProperty("SCALE_NON_UNIFORM",5126,3,y,f);x&&u.scale(x),c.scale=u;var _=t.getProperty("BATCH_ID",5123,1,y);void 0===_&&(_=y);var k=(new Pr).fromQuaternion(c.rotation);l.identity(),l.translate(c.translation),l.multiplyRight(k),l.scale(c.scale);var O=l.clone();i[y]={modelMatrix:O,batchId:_}}e.instances=i}(e,o,0,s),r}function Lv(e,t,r,n,i,a){return Rv.apply(this,arguments)}function Rv(){return(Rv=q()(V.a.mark((function e(t,r,n,i,a,o){var s,u;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Td(t,r,n),s=new DataView(r),t.tilesLength=s.getUint32(n,!0),n+=4,t.tiles=[];case 5:if(!(t.tiles.length<t.tilesLength&&t.byteLength-n>12)){e.next=13;break}return u={},t.tiles.push(u),e.next=10,o(r,n,i,a,u);case 10:n=e.sent,e.next=5;break;case 13:return e.abrupt("return",n);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cv(e){return Dv.apply(this,arguments)}function Dv(){return(Dv=q()(V.a.mark((function e(t){var r,n,i,a,o=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[1]:0,n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,(a=o.length>4&&void 0!==o[4]?o[4]:{}).byteOffset=r,a.type=nh(t,r),e.t0=a.type,e.next=e.t0===th.COMPOSITE?9:e.t0===th.BATCHED_3D_MODEL?12:e.t0===th.INSTANCED_3D_MODEL?15:e.t0===th.POINT_CLOUD?18:21;break;case 9:return e.next=11,Lv(a,t,r,n,i,Cv);case 11:return e.abrupt("return",e.sent);case 12:return e.next=14,Av(a,t,r,n,i);case 14:return e.abrupt("return",e.sent);case 15:return e.next=17,Mv(a,t,r,n,i);case 17:return e.abrupt("return",e.sent);case 18:return e.next=20,Vd(a,t,r,n,i);case 20:return e.abrupt("return",e.sent);case 21:throw new Error("3DTileLoader: unknown type ".concat(a.type));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nv(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Fv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fv(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Fv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bv(e,t){if(e.content){var r=e.content.uri||e.content.url;e.contentUrl="".concat(t.basePath,"/").concat(r)}return e.id=e.contentUrl,e.lodMetricType=df,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=function(e){if(!e.contentUrl)return sf;var t=e.contentUrl.split(".").pop();switch(t){case"pnts":return cf;case"i3dm":case"b3dm":return uf;default:return t}}(e),e.refine=function(e){switch(e){case"REPLACE":case"replace":return of;case"ADD":case"add":return af;default:return e}}(e.refine),e}function Uv(e){var t=e.basePath,r=Bv(e.root,e),n=[];for(n.push(r);n.length>0;){var i,a=Nv(n.pop().children||[]);try{for(a.s();!(i=a.n()).done;){var o=i.value;Bv(o,{basePath:t}),n.push(o)}}catch(e){a.e(e)}finally{a.f()}}return r}var Vv={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.0.8",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(e,t,r){return Zv.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function zv(e){return n.dirname(e.url)}function qv(e,t,r){return Gv.apply(this,arguments)}function Gv(){return(Gv=q()(V.a.mark((function e(t,r,n){var i;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={content:{featureIds:null}},0,e.next=4,Cv(t,0,r,n,i.content);case 4:return e.abrupt("return",i.content);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Hv(e,t,r){return Wv.apply(this,arguments)}function Wv(){return(Wv=q()(V.a.mark((function e(t,r,n){var i;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(i=JSON.parse((new TextDecoder).decode(t))).loader=r.loader||Vv,i.url=n.url,i.basePath=zv(i),i.root=Uv(i),i.type=hf,i.lodMetricType=df,i.lodMetricValue=i.root.lodMetricValue,e.abrupt("return",i);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zv(){return(Zv=q()(V.a.mark((function e(t,r,n){var i;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r["3d-tiles"]||{},!("auto"===i.isTileset?n.url&&-1!==n.url.indexOf(".json"):i.isTileset)){e.next=8;break}return e.next=5,Hv(t,r,n);case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,qv(t,r,n);case 10:t=e.sent;case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xv(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 Qv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xv(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Kv(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var Jv=[0],Yv={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:Vv,onTilesetLoad:{type:"function",value:function(e){},compare:!1},onTileLoad:{type:"function",value:function(e){},compare:!1},onTileUnload:{type:"function",value:function(e){},compare:!1},onTileError:{type:"function",value:function(e,t,r){},compare:!1},_getMeshColor:{type:"function",value:function(e){return[255,255,255]},compare:!1}},$v=function(e){f()(n,e);var t,r=Kv(n);function n(){return c()(this,n),r.apply(this,arguments)}return w()(n,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&v.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,n=e.changeFlags;if(t.data&&t.data!==r.data&&this._loadTileset(t.data),n.viewportChanged){var i=this.state.activeViewports;Object.keys(i).length&&(this._updateTileset(i),this.state.lastUpdatedViewports=i,this.state.activeViewports={})}if(n.propsChanged){var a=this.state.layerMap;for(var o in a)a[o].needsUpdate=!0}}},{key:"activateViewport",value:function(e){var t=this.state,r=t.activeViewports,n=t.lastUpdatedViewports;this.internalState.viewport=e,r[e.id]=e;var i=null==n?void 0:n[e.id];i&&e.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(e){var t=e.info,r=e.sourceLayer,n=this.state.layerMap,i=r&&r.id;if(i){var a=i.substring(this.id.length+1),o=a.substring(a.indexOf("-")+1);t.object=n[o]&&n[o].tile}return t}},{key:"filterSubLayer",value:function(e){var t=e.layer,r=e.viewport,n=t.props.tile,i=r.id;return n.selected&&n.viewportIds.includes(i)}},{key:"_updateAutoHighlight",value:function(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}},{key:"_loadTileset",value:(t=q()(V.a.mark((function e(t){var r,n,i,a,o,s,u;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.props.loadOptions,n=void 0===r?{}:r,i=this.props.loader||this.props.loaders,Array.isArray(i)&&(i=i[0]),a={loadOptions:Qv({},n)},!i.preload){e.next=10;break}return e.next=7,i.preload(t,n);case 7:(o=e.sent).headers&&(a.loadOptions.fetch=Qv(Qv({},a.loadOptions.fetch),{},{headers:o.headers})),Object.assign(a,o);case 10:return e.next=12,ul(t,i,a.loadOptions);case 12:s=e.sent,u=new eh(s,Qv({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileLoadFail:this.props.onTileError},a)),this.setState({tileset3d:u,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(u);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_onTileLoad",value:function(e){var t=this.state.lastUpdatedViewports;this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}},{key:"_updateTileset",value:function(e){var t=this.state.tileset3d,r=this.context.timeline,n=Object.keys(e).length;if(r&&n&&t){var i=t.update(Object.values(e));this.state.frameNumber!==i&&this.setState({frameNumber:i})}}},{key:"_getSubLayer",value:function(e,t){if(!e.content)return null;switch(e.type){case cf:return this._makePointCloudLayer(e,t);case uf:return this._make3DModelLayer(e,t);case lf:return this._makeSimpleMeshLayer(e,t);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(e.content.type))}}},{key:"_makePointCloudLayer",value:function(e,t){var r=e.content,n=r.attributes,i=r.pointCount,a=r.constantRGBA,o=r.cartographicOrigin,s=r.modelMatrix,u=n.positions,c=n.normals,l=n.colors;if(!u)return null;var f=t&&t.props.data||{header:{vertexCount:i},attributes:{POSITION:u,NORMAL:c,COLOR_0:l}},h=this.props,d=h.pointSize,p=h.getPointColor;return new(this.getSubLayerClass("pointcloud",v.PointCloudLayer))({pointSize:d},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(e.id),tile:e,data:f,coordinateSystem:v.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:o,modelMatrix:s,getColor:a||p,_offset:0})}},{key:"_make3DModelLayer",value:function(e){var t=e.content,r=t.gltf,n=t.instances,i=t.cartographicOrigin,a=t.modelMatrix;return new(this.getSubLayerClass("scenegraph",v.ScenegraphLayer))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(e.id),tile:e,data:n||Jv,scenegraph:r,coordinateSystem:v.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:i,modelMatrix:a,getTransformMatrix:function(e){return e.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(e,t){var r=e.content,n=r.attributes,i=r.indices,a=r.modelMatrix,o=r.cartographicOrigin,s=r.material,u=r.featureIds,c=this.props._getMeshColor,l=t&&t.props.mesh||new gi.Geometry({drawMode:4,attributes:eg(n),indices:i});return new(this.getSubLayerClass("mesh",Ms))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:l,data:Jv,getColor:c(e),pbrMaterial:s,modelMatrix:a,coordinateOrigin:o,coordinateSystem:v.COORDINATE_SYSTEM.METER_OFFSETS,featureIds:u,_offset:0})}},{key:"renderLayers",value:function(){var e=this,t=this.state,r=t.tileset3d,n=t.layerMap;return r?r.tiles.map((function(t){var r=n[t.id]=n[t.id]||{tile:t},i=r.layer;return t.selected&&(i?r.needsUpdate&&(i=e._getSubLayer(t,i),r.needsUpdate=!1):i=e._getSubLayer(t)),r.layer=i,i})).filter(Boolean):null}},{key:"isLoaded",get:function(){var e=this.state.tileset3d;return e&&e.isLoaded()}}]),n}(v.CompositeLayer);function eg(e){var t={};return t.positions=Qv(Qv({},e.positions),{},{value:new Float32Array(e.positions.value)}),e.normals&&(t.normals=e.normals),e.texCoords&&(t.texCoords=e.texCoords),e.colors&&(t.colors=e.colors),e.uvRegions&&(t.uvRegions=e.uvRegions),t}$v.layerName="Tile3DLayer",$v.defaultProps=Yv;var tg={name:"Terrain",id:"terrain",module:"terrain",version:"3.0.8",worker:!0,extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};function rg(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}function ng(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 ig(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ng(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ng(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ag=[1],og=ig(ig({},qn.defaultProps),{},{elevationData:yn,texture:ig(ig({},yn),{},{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:{type:"string",value:null},wireframe:!1,material:!0,loaders:[tg]});function sg(e){return Array.isArray(e)?e.join(";"):e}var ug=function(e){f()(r,e);var t=rg(r);function r(){return c()(this,r),t.apply(this,arguments)}return w()(r,[{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,n=t.elevationData!==r.elevationData;if(n){var i=t.elevationData,a=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:a})}var o=n||t.meshMaxError!==r.meshMaxError||t.elevationDecoder!==r.elevationDecoder||t.bounds!==r.bounds;if(!this.state.isTiled&&o){var s=this.loadTerrain(t);this.setState({terrain:s})}t.workerUrl&&v.log.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(e){var t,r=e.elevationData,n=e.bounds,i=e.elevationDecoder,a=e.meshMaxError,o=e.signal;if(!r)return null;var s=this.getLoadOptions();return s=ig(ig({},s),{},{terrain:ig(ig({skirtHeight:this.state.isTiled?2*a:0},null===(t=s)||void 0===t?void 0:t.terrain),{},{bounds:n,meshMaxError:a,elevationDecoder:i})}),(0,this.props.fetch)(r,{propName:"elevationData",layer:this,loadOptions:s,signal:o})}},{key:"getTiledTerrainData",value:function(e){var t=this.props,r=t.elevationData,n=t.fetch,i=t.texture,a=t.elevationDecoder,o=t.meshMaxError,s=this.context.viewport,u=gn(r,e),c=gn(i,e),l=e.bbox,f=e.signal,h=s.isGeospatial?s.projectFlat([l.west,l.south]):[l.left,l.bottom],d=s.isGeospatial?s.projectFlat([l.east,l.north]):[l.right,l.top],p=[h[0],h[1],d[0],d[1]],y=this.loadTerrain({elevationData:u,bounds:p,elevationDecoder:a,meshMaxError:o,signal:f}),v=c?n(c,{propName:"texture",layer:this,loaders:[],signal:f}).catch((function(e){return null})):Promise.resolve(null);return Promise.all([y,v])}},{key:"renderSubLayers",value:function(e){var t=this.getSubLayerClass("mesh",v.SimpleMeshLayer),r=e.data,n=e.color;if(!r)return null;var i=O()(r,2),a=i[0],o=i[1];return new t(e,{data:ag,mesh:a,texture:o,_instanced:!1,coordinateSystem:v.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(e){return[0,0,0]},getColor:n})}},{key:"onViewportLoad",value:function(e){if(e){var t=this.state.zRange,r=e.map((function(e){return e.content})).filter(Boolean).map((function(e){return e[0].header.boundingBox.map((function(e){return e[2]}))}));if(0!==r.length){var n=Math.min.apply(Math,W()(r.map((function(e){return e[0]})))),i=Math.max.apply(Math,W()(r.map((function(e){return e[1]}))));(!t||n<t[0]||i>t[1])&&this.setState({zRange:[n,i]})}}}},{key:"renderLayers",value:function(){var e=this.props,t=e.color,r=e.material,n=e.elevationData,i=e.texture,a=e.wireframe,o=e.meshMaxError,s=e.elevationDecoder,u=e.tileSize,c=e.maxZoom,l=e.minZoom,f=e.extent,h=e.maxRequests,d=e.onTileLoad,p=e.onTileUnload,y=e.onTileError,g=e.maxCacheSize,m=e.maxCacheByteSize,b=e.refinementStrategy;return this.state.isTiled?new qn(this.getSubLayerProps({id:"tiles"}),{wireframe:a,color:t,material:r,getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:sg(n),texture:sg(i),meshMaxError:o,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:u,maxZoom:c,minZoom:l,extent:f,maxRequests:h,onTileLoad:d,onTileUnload:p,onTileError:y,maxCacheSize:g,maxCacheByteSize:m,refinementStrategy:b}):new(this.getSubLayerClass("mesh",v.SimpleMeshLayer))(this.getSubLayerProps({id:"mesh"}),{data:ag,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(e){return[0,0,0]},getColor:t,material:r,wireframe:a})}}]),r}(v.CompositeLayer);ug.layerName="TerrainLayer",ug.defaultProps=og;var cg=function(){function e(t,r,n,i,a){c()(this,e),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,t.readFields(fg,this,r)}return w()(e,null,[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),w()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,a=0,o=0,s=[];e.pos<r;){if(i<=0){var u=e.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)a+=e.readSVarint(),o+=e.readSVarint(),1===n&&(t&&s.push(t),t=[]),t.push([a,o]);else{if(7!==n)throw new Error("unknown command ".concat(n));t&&t.push(t[0].slice())}}return t&&s.push(t),s}},{key:"bbox",value:function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,u=1/0,c=-1/0;e.pos<t;){if(n<=0){var l=e.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=e.readSVarint())<u&&(u=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command ".concat(r))}return[o,u,s,c]}},{key:"_toGeoJSON",value:function(t){var r,n,i=this.loadGeometry(),a=e.types[this.type];switch(this.type){case 1:var o=[];for(r=0;r<i.length;r++)o[r]=i[r][0];t(i=o,this);break;case 2:for(r=0;r<i.length;r++)t(i[r],this);break;case 3:for(i=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],a=0;a<t;a++){var o=lg(e[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[e[a]]):r.push(e[a]))}r&&i.push(r);return i}(i),r=0;r<i.length;r++)for(n=0;n<i[r].length;n++)t(i[r][n],this)}1===i.length?i=i[0]:a="Multi".concat(a);var s={type:"Feature",geometry:{type:a,coordinates:i},properties:this.properties};return null!==this.id&&(s.id=this.id),s}},{key:"toGeoJSON",value:function(e){if("function"==typeof e)return this._toGeoJSON(e);var t=e.x,r=e.y,n=e.z,i=this.extent*Math.pow(2,n),a=this.extent*t,o=this.extent*r;return this._toGeoJSON((function(e){for(var t=0;t<e.length;t++){var r=e[t];r[0]=360*(r[0]+a)/i-180;var n=180-360*(r[1]+o)/i;r[1]=360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}}))}}]),e}();function lg(e){for(var t,r,n=0,i=0,a=e.length-1;i<e.length;a=i++)t=e[i],n+=((r=e[a])[0]-t[0])*(t[1]+r[1]);return n}function fg(e,t,r){1===e?t.id=r.readVarint():2===e?function(e,t){var r=e.readVarint()+e.pos;for(;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos)}var hg=function(){function e(t,r){c()(this,e),this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(dg,this,r),this.length=this._features.length}return w()(e,[{key:"feature",value:function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new cg(this._pbf,t,this.extent,this._keys,this._values)}}]),e}();function dg(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){var t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}var pg=function e(t,r){c()(this,e),this.layers=t.readFields(yg,{},r)};function yg(e,t,r){if(3===e){var n=new hg(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}function vg(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.start,n=void 0===r?0:r,i=t.end,a=void 0===i?e.length:i,o=t.size||2,s=0,u=n,c=a-o;u<a;u+=o)s+=(e[u]-e[c])*(e[u+1]+e[c+1]),c=u;return s/2}function gg(e,t,r,n){r=r||2;var i,a,o,s,u,c,l,f=t&&t.length,h=f?t[0]*r:e.length,d=mg(e,0,h,r,!0,n&&n[0]),p=[];if(!d||d.next===d.prev)return p;if(f&&(d=function(e,t,r,n,i){var a,o,s,u,c,l=[];for(a=0,o=t.length;a<o;a++)s=t[a]*n,u=a<o-1?t[a+1]*n:e.length,(c=mg(e,s,u,n,!1,i&&i[a+1]))===c.next&&(c.steiner=!0),l.push(Pg(c));for(l.sort(Tg),a=0;a<l.length;a++)Sg(l[a],r),r=bg(r,r.next);return r}(e,t,d,r,n)),e.length>80*r){s=a=e[0],u=o=e[1];for(var y=r;y<h;y+=r)(c=e[y])<s&&(s=c),(l=e[y+1])<u&&(u=l),c>a&&(a=c),l>o&&(o=l);i=0!==(i=Math.max(a-s,o-u))?1/i:0}return wg(d,p,r,s,u,i),p}function mg(e,t,r,n,i,a){var o,s;if(void 0===a&&(a=vg(e,{start:t,end:r,size:n})),i===a<0)for(o=t;o<r;o+=n)s=Bg(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=Bg(o,e[o],e[o+1],s);return s&&Lg(s,s.next)&&(Ug(s),s=s.next),s}function bg(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!Lg(n,n.next)&&0!==Ig(n.prev,n,n.next))n=n.next;else{if(Ug(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function wg(e,t,r,n,i,a,o){if(e){!o&&a&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=Eg(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,u,c=1;do{for(i=e,e=null,u=null,n=0;i;){for(n++,o=i,a=0,r=0;r<c&&(a++,o=o.nextZ);r++);for(s=c;a>0||s>0&&o;)0!==a&&(0===s||!o||i.z<=o.z)?(t=i,i=i.nextZ,a--):(t=o,o=o.nextZ,s--),u?u.nextZ=t:e=t,t.prevZ=u,u=t;i=o}u.nextZ=null,c*=2}while(n>1)}(i)}(e,n,i,a);for(var s,u,c=e;e.prev!==e.next;)if(s=e.prev,u=e.next,a?_g(e,n,i,a):xg(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),Ug(e),e=u.next,c=u.next;else if((e=u)===c){o?1===o?wg(e=kg(bg(e),t,r),t,r,n,i,a,2):2===o&&Og(e,t,r,n,i,a):wg(bg(e),t,r,n,i,a,1);break}}}function xg(e){var t=e.prev,r=e,n=e.next;if(Ig(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Mg(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Ig(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function _g(e,t,r,n){var i=e.prev,a=e,o=e.next;if(Ig(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=Eg(s,u,t,r,n),h=Eg(c,l,t,r,n),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&Mg(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Ig(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&Mg(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ig(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&Mg(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Ig(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&Mg(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ig(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function kg(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!Lg(i,a)&&Rg(i,n,n.next,a)&&Ng(i,a)&&Ng(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),Ug(n),Ug(n.next),n=e=a),n=n.next}while(n!==e);return bg(n)}function Og(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&jg(o,s)){var u=Fg(o,s);return o=bg(o,o.next),u=bg(u,u.next),wg(o,t,r,n,i,a),void wg(u,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function Tg(e,t){return e.x-t.x}function Sg(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)return r;var u,c=r,l=r.x,f=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=l&&i!==n.x&&Mg(a<f?i:o,a,l,f,a<f?o:i,a,n.x,n.y)&&(u=Math.abs(a-n.y)/(i-n.x),Ng(n,e)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&Ag(r,n)))&&(r=n,h=u)),n=n.next}while(n!==c);return r}(e,t)){var r=Fg(t,e);bg(t,t.next),bg(r,r.next)}}function Ag(e,t){return Ig(e.prev,e,t.prev)<0&&Ig(t.next,e,e.next)<0}function Eg(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Pg(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function Mg(e,t,r,n,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function jg(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Rg(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Ng(e,t)&&Ng(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Ig(e.prev,e,t.prev)||Ig(e,t.prev,t))||Lg(e,t)&&Ig(e.prev,e,e.next)>0&&Ig(t.prev,t,t.next)>0)}function Ig(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Lg(e,t){return e.x===t.x&&e.y===t.y}function Rg(e,t,r,n){var i=Dg(Ig(e,t,r)),a=Dg(Ig(e,t,n)),o=Dg(Ig(r,n,e)),s=Dg(Ig(r,n,t));return i!==a&&o!==s||(!(0!==i||!Cg(e,r,t))||(!(0!==a||!Cg(e,n,t))||(!(0!==o||!Cg(r,e,n))||!(0!==s||!Cg(r,t,n)))))}function Cg(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Dg(e){return e>0?1:e<0?-1:0}function Ng(e,t){return Ig(e.prev,e,e.next)<0?Ig(e,t,e.next)>=0&&Ig(e,e.prev,t)>=0:Ig(e,t,e.prev)<0||Ig(e,e.next,t)<0}function Fg(e,t){var r=new Vg(e.i,e.x,e.y),n=new Vg(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Bg(e,t,r,n){var i=new Vg(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ug(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Vg(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var zg,qg,Gg,Hg,Wg,Zg,Xg;function Qg(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Kg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Kg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Jg=function(){function e(t,r,n,i,a,o){c()(this,e),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,this._firstPassData=o,t.readFields($g,this,r)}return w()(e,null,[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),w()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry,zg=e.readVarint()+e.pos,qg=1,Hg=0,Wg=0,Zg=0,Xg=0;for(var t=[],r=[];e.pos<zg;)if(Hg<=0&&(Gg=e.readVarint(),qg=7&Gg,Hg=Gg>>3),Hg--,1===qg||2===qg)Wg+=e.readSVarint(),Zg+=e.readSVarint(),1===qg&&t.push(Xg),r.push(Wg,Zg),Xg+=2;else{if(7!==qg)throw new Error("unknown command ".concat(qg));if(Xg>0){var n=t[t.length-1];r.push(r[n],r[n+1]),Xg+=2}}return{data:r,lines:t}}},{key:"_toBinaryCoordinates",value:function(t){var r=this.loadGeometry();t(r.data,this);switch(this.type){case 1:this._firstPassData.pointFeaturesCount++,this._firstPassData.pointPositionsCount+=r.lines.length;break;case 2:this._firstPassData.lineFeaturesCount++,this._firstPassData.linePathsCount+=r.lines.length,this._firstPassData.linePositionsCount+=r.data.length/2;break;case 3:var n=Yg(r);this._firstPassData.polygonFeaturesCount++,this._firstPassData.polygonObjectsCount+=n.lines.length;var i,a=Qg(n.lines);try{for(a.s();!(i=a.n()).done;){var o=i.value;this._firstPassData.polygonRingsCount+=o.length}}catch(e){a.e(e)}finally{a.f()}this._firstPassData.polygonPositionsCount+=n.data.length/2,r=n}r.type=e.types[this.type],r.lines.length>1&&(r.type="Multi".concat(r.type));var s={type:"Feature",geometry:r,properties:this.properties};return null!==this.id&&(s.id=this.id),s}},{key:"toBinaryCoordinates",value:function(e){if("function"==typeof e)return this._toBinaryCoordinates(e);var t=e.x,r=e.y,n=e.z,i=this.extent*Math.pow(2,n),a=this.extent*t,o=this.extent*r;return this._toBinaryCoordinates((function(e){for(var t=0,r=e.length;t<r;t+=2){e[t]=360*(e[t]+a)/i-180;var n=180-360*(e[t+1]+o)/i;e[t+1]=360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}}))}}]),e}();function Yg(e){var t=e.lines.length;if(t<=1)return{data:e.data,areas:[[vg(e.data)]],lines:[e.lines]};for(var r,n,i,a,o,s=[],u=[],c=0,l=0;l<t;l++){a=e.lines[l]-c,o=e.lines[l+1]-c||e.data.length;var f=vg(e.data.slice(a,o));if(0!==f)void 0===i&&(i=f<0),i===f<0?(n&&(s.push(r),u.push(n)),n=[a],r=[f]):(r.push(f),n.push(a));else{var h=e.data.slice(0,a),d=e.data.slice(o);e.data=h.concat(d),c+=o-a}}return r&&s.push(r),n&&u.push(n),{areas:s,lines:u,data:e.data}}function $g(e,t,r){1===e?t.id=r.readVarint():2===e?function(e,t){var r=e.readVarint()+e.pos;for(;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos)}var em=function(){function e(t,r){c()(this,e),this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(tm,this,r),this.length=this._features.length}return w()(e,[{key:"feature",value:function(e,t){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var r=this._pbf.readVarint()+this._pbf.pos;return new Jg(this._pbf,r,this.extent,this._keys,this._values,t)}}]),e}();function tm(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){var t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}var rm=function e(t,r){c()(this,e),this.layers=t.readFields(nm,{},r)};function nm(e,t,r){if(3===e){var n=new em(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}function im(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 am(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?im(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):im(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function om(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return sm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sm(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function sm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function um(e){var t,r,n={},i=om(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;if(a.properties)for(var o in a.properties){var s=n[o];if(s||void 0===s){var u=a.properties[o];n[o]=(r=u,Number.isFinite(r))}}}}catch(e){i.e(e)}finally{i.f()}return Object.keys(n).filter((function(e){return n[e]}))}function cm(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.pointPositionsCount,i=t.pointFeaturesCount,a=t.linePositionsCount,o=t.linePathsCount,s=t.lineFeaturesCount,u=t.polygonPositionsCount,c=t.polygonObjectsCount,l=t.polygonRingsCount,f=t.polygonFeaturesCount,h=r.numericPropKeys,d=r.PositionDataType,p=void 0===d?Float32Array:d,y=(e[0]&&"id"in e[0]),v=2,g=e.length>65535?Uint32Array:Uint16Array,m={positions:new p(n*v),globalFeatureIds:new g(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},b={pathIndices:a>65535?new Uint32Array(o+1):new Uint16Array(o+1),positions:new p(a*v),globalFeatureIds:new g(a),featureIds:s>65535?new Uint32Array(a):new Uint16Array(a),numericProps:{},properties:[],fields:[]},w={polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new p(u*v),triangles:[],globalFeatureIds:new g(u),featureIds:f>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]},x=0,_=[m,b,w];x<_.length;x++){var k,O=_[x],T=om(h);try{for(T.s();!(k=T.n()).done;){var S=k.value;O.numericProps[S]=new Float32Array(O.positions.length/v)}}catch(e){T.e(e)}finally{T.f()}}b.pathIndices[o]=a,w.polygonIndices[c]=u,w.primitivePolygonIndices[l]=u;var A,E={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},P=om(e);try{for(P.s();!(A=P.n()).done;){var M=A.value,j=M.geometry,I=M.properties||{};switch(j.type){case"Point":case"MultiPoint":lm(j,m,E,v,I),m.properties.push(vm(I,h)),y&&m.fields.push({id:M.id}),E.pointFeature++;break;case"LineString":case"MultiLineString":fm(j,b,E,v,I),b.properties.push(vm(I,h)),y&&b.fields.push({id:M.id}),E.lineFeature++;break;case"Polygon":case"MultiPolygon":hm(j,w,E,v,I),w.properties.push(vm(I,h)),y&&w.fields.push({id:M.id}),E.polygonFeature++;break;default:throw new Error("Invalid geometry type")}E.feature++}}catch(e){P.e(e)}finally{P.f()}return pm(m,b,w,v)}function lm(e,t,r,n,i){t.positions.set(e.data,r.pointPosition*n);var a=e.data.length/n;ym(t,i,r.pointPosition,a),t.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+a),t.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+a),r.pointPosition+=a}function fm(e,t,r,n,i){t.positions.set(e.data,r.linePosition*n);var a=e.data.length/n;ym(t,i,r.linePosition,a),t.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+a),t.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+a);for(var o=0,s=e.lines.length;o<s;++o){var u=e.lines[o],c=o===s-1?e.data.length:e.lines[o+1];t.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-u)/n}}function hm(e,t,r,n,i){t.positions.set(e.data,r.polygonPosition*n);var a=e.data.length/n;ym(t,i,r.polygonPosition,a),t.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+a),t.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+a);for(var o=0,s=e.lines.length;o<s;++o){var u=r.polygonPosition;t.polygonIndices[r.polygonObject++]=u;for(var c=e.areas[o],l=e.lines[o],f=e.lines[o+1],h=0,d=l.length;h<d;++h){var p=l[h],y=h===d-1?void 0===f?e.data.length:f[0]:l[h+1];t.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(y-p)/n}dm(t,c,l,{startPosition:u,endPosition:r.polygonPosition,coordLength:n})}}function dm(e,t,r,n){for(var i=n.startPosition,a=n.endPosition,o=n.coordLength,s=i*o,u=a*o,c=e.positions.subarray(s,u),l=r[0],f=gg(c,r.slice(1).map((function(e){return(e-l)/o})),o,t),h=0,d=f.length;h<d;++h)e.triangles.push(i+f[h])}function pm(e,t,r,n){var i={points:am(am({},e),{},{positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1}}),lines:am(am({},t),{},{pathIndices:{value:t.pathIndices,size:1},positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1}}),polygons:am(am({},r),{},{polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},positions:{value:r.positions,size:n},triangles:{value:new Uint32Array(r.triangles),size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1}})};for(var a in i)for(var o in i[a].numericProps)i[a].numericProps[o]={value:i[a].numericProps[o],size:1};return i}function ym(e,t,r,n){for(var i in e.numericProps)i in t&&e.numericProps[i].fill(t[i],r,r+n)}function vm(e,t){var r={};for(var n in e)t.includes(n)||(r[n]=e[n]);return r}var gm=r(45),mm=r.n(gm);function bm(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 wm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bm(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xm(e,t){var r="binary"===(t=function(e){var t="wgs84"===(e=wm(wm({},e),{},{mvt:e.mvt||{},gis:e.gis||{}})).coordinates,r=e.tileIndex,n=r&&Number.isFinite(r.x)&&Number.isFinite(r.y)&&Number.isFinite(r.z);if(t&&!n)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property. Check documentation.");return e}(t)).gis.format,n=[],i={pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength>0){var a=r?new rm(new mm.a(e)):new pg(new mm.a(e)),o=t.mvt;(Array.isArray(o.layers)?o.layers:Object.keys(a.layers)).forEach((function(e){var t=a.layers[e],s=wm(wm({},o),{},{layerName:e});if(t)for(var u=0;u<t.length;u++){var c=t.feature(u,i),l=r?km(c,s):_m(c,s);n.push(l)}}))}if(r){var s=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return cm(e,t,{numericPropKeys:r.numericPropKeys||um(e),PositionDataType:r.PositionDataType||Float32Array})}(n,i,t.gis);return s.byteLength=e.byteLength,s}return n}function _m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.toGeoJSON("wgs84"===t.coordinates?t.tileIndex:Om);return t.layerProperty&&(r.properties[t.layerProperty]=t.layerName),r}function km(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.toBinaryCoordinates("wgs84"===t.coordinates?t.tileIndex:Tm);return t.layerProperty&&(r.properties[t.layerProperty]=t.layerName),r}function Om(e,t){for(var r=t.extent,n=0;n<e.length;n++){var i=e[n];i[0]/=r,i[1]/=r}}function Tm(e,t){for(var r=t.extent,n=0,i=e.length;n<i;++n)e[n]/=r}function Sm(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 Am(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sm(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Em,Pm={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.0.8",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{coordinates:"local",layerProperty:"layerName",layers:null,tileIndex:null}}};Am(Am({},Pm),{},{parse:(Em=q()(V.a.mark((function e(t,r){return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",xm(t,r));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return Em.apply(this,arguments)}),parseSync:xm,binary:!0});function Mm(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 jm(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Im(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Im(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Im(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lm(e,t){var r=null==t?void 0:t.globalFeatureId;return void 0!==r?function(e,t){var r,n=jm(Dm(e));try{for(n.s();!(r=n.n()).done;){for(var i=r.value,a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];if(u!==o){if(t===i.globalFeatureIds.value[a])return Nm(i,a,s);a=s,o=u}}if(t===i.globalFeatureIds.value[a])return Nm(i,a,i.featureIds.value.length)}}catch(e){n.e(e)}finally{n.f()}throw new Error("featureId:".concat(t," not found"))}(e,r):Rm(e,null==t?void 0:t.type)}function Rm(e,t){return function(e){var t,r=[],n=jm(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(0!==i.featureIds.value.length){for(var a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];u!==o&&(r.push(Nm(i,a,s)),a=s,o=u)}r.push(Nm(i,a,i.featureIds.value.length))}}}catch(e){n.e(e)}finally{n.f()}return r}(Dm(e,t))}function Cm(e,t,r){switch(e.type){case"Point":return function(e,t,r){var n=Fm(e.positions,t,r);if(n.length>1)return{type:"MultiPoint",coordinates:n};return{type:"Point",coordinates:n[0]}}(e,t,r);case"LineString":return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=e.positions,i=e.pathIndices.value.filter((function(e){return e>=t&&e<=r})),a=i.length>2;if(!a){var o=Fm(n,i[0],i[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<i.length-1;u++){var c=Fm(n,i[u],i[u+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}(e,t,r);case"Polygon":return function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=t.positions,a=t.polygonIndices.value.filter((function(e){return e>=r&&e<=n})),o=t.primitivePolygonIndices.value.filter((function(e){return e>=r&&e<=n})),s=a.length>2;if(!s){for(var u=[],c=0;c<o.length-1;c++){var l=o[c],f=o[c+1],h=Fm(i,l,f);u.push(h)}return{type:"Polygon",coordinates:u}}for(var d=[],p=0;p<a.length-1;p++){var y=a[p],v=a[p+1],g=e(t,y,v).coordinates;d.push(g)}return{type:"MultiPolygon",coordinates:d}}(e,t,r);default:var n=e;throw new Error("Unsupported geometry type: ".concat(null==n?void 0:n.type))}}function Dm(e,t){if(!Boolean(e.points||e.lines||e.polygons))return e.type=t||function(e){if(e.pathIndices)return"LineString";if(e.polygonIndices)return"Polygon";return"Point"}(e),[e];var r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function Nm(e,t,r){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mm(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({type:"Feature",geometry:Cm(e,t,r),properties:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(arguments.length>2&&arguments[2],Object.assign({},e.properties[e.featureIds.value[t]]));for(var n in e.numericProps)r[n]=e.numericProps[n].value[t];return r}(e,t,r)},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;arguments.length>2&&arguments[2];return e.fields&&e.fields[e.featureIds.value[t]]}(e,t,r))}function Fm(e,t,r){t=t||0,r=r||e.value.length/e.size;for(var n=[],i=t;i<r;i++){for(var a=Array(),o=i*e.size;o<(i+1)*e.size;o++)a.push(Number(e.value[o]));n.push(a)}return n}function Bm(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 Um(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bm(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Vm={Point:zm,MultiPoint:function(e,t,r){return qm(e,t,r)},LineString:Gm,MultiLineString:function(e,t,r){return e.map((function(e){return Gm(e,t,r)}))},Polygon:Hm,MultiPolygon:function(e,t,r){return e.map((function(e){return Hm(e,t,r)}))}};function zm(e,t,r){var n=O()(e,2),i=n[0],a=n[1],o=O()(t,2),s=o[0],u=o[1],c=we(s[0],u[0],i),l=we(s[1],u[1],a);return r.unprojectFlat([c,l])}function qm(e,t,r){return e.map((function(e){return zm(e,t,r)}))}function Gm(e,t,r){return qm(e,t,r)}function Hm(e,t,r){return e.map((function(e){return qm(e,t,r)}))}function Wm(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Zm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zm(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Zm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Xm=["points","lines","polygons"];function Qm(e,t,r,n){var i=e.featureIds.value;if(!i.length)return-1;var a=0,o=i[i.length-1]+1;if(n){var s=function(e,t){if(!e.__layers){for(var r={},n=e.properties,i=0;i<n.length;i++){var a=n[i].layerName;a&&(r[a]?r[a][1]=i:r[a]=[i,i])}e.__layers=r}return e.__layers[t]}(e,n);if(!s)return-1;a=s[0],o=s[1]+1}var u=-1;if(t in e.numericProps){var c=e.numericProps[t].value.findIndex((function(e,t){return e===r&&i[t]>=a&&i[t]<o}));return c>=0?e.globalFeatureIds.value[c]:-1}return(u=t?Km(e.properties,(function(e){return e[t]===r}),a,o):Km(e.fields,(function(e){return e.id===r}),a,o))>=0?function(e,t){if(!e.__ids){for(var r=[],n=e.featureIds.value,i=e.globalFeatureIds.value,a=0;a<n.length;a++)r[n[a]]=i[a];e.__ids=r}return e.__ids[t]}(e,u):-1}function Km(e,t,r,n){for(var i=r;i<n;i++)if(t(e[i],i))return i;return-1}function Jm(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ym(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ym(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ym(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}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 eb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$m(Object(r),!0).forEach((function(t){_()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tb(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=y()(e);if(t){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var rb={uniqueIdProperty:{type:"string",value:""},highlightedFeatureId:null,loaders:[Pm],binary:!0},nb=function(e){f()(n,e);var t,r=tb(n);function n(){return c()(this,n),r.apply(this,arguments)}return w()(n,[{key:"initializeState",value:function(){Hn()(y()(n.prototype),"initializeState",this).call(this),this.setState({data:null,tileJSON:null})}},{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,i=e.context,a=e.changeFlags;a.dataChanged&&this._updateTileData(),this.state.data&&(Hn()(y()(n.prototype),"updateState",this).call(this,{props:t,oldProps:r,context:i,changeFlags:a}),this._setWGS84PropertyForTiles());var o=t.highlightColor;o!==r.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}},{key:"_updateTileData",value:(t=q()(V.a.mark((function e(){var t,r,n,i,a;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props.data,r=null,"string"!=typeof t||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)){e.next=18;break}return n=this.props,i=n.onDataLoad,a=n.fetch,this.setState({data:null,tileJSON:null}),e.prev=5,e.next=8,a(t,{propName:"data",layer:this,loaders:[]});case 8:r=e.sent,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(5),this.raiseError(e.t0,"loading TileJSON"),t=null;case 15:i&&i(r),e.next=19;break;case 18:t.tilejson&&(r=t);case 19:r&&(t=r.tiles),this.setState({data:t,tileJSON:r});case 21:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_getTilesetOptions",value:function(e){var t=Hn()(y()(n.prototype),"_getTilesetOptions",this).call(this,e),r=this.state.tileJSON;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>e.minZoom&&(t.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(e.maxZoom)||r.maxzoom<e.maxZoom)&&(t.maxZoom=r.maxzoom)),t}},{key:"renderLayers",value:function(){return this.state.data?Hn()(y()(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(e){var t,r=gn(this.state.data,e);if(!r)return Promise.reject("Invalid URL");var n=this.getLoadOptions(),i=this.props,a=i.binary,o=i.fetch,s=e.signal,u=e.x,c=e.y,l=e.z;return o(r,{propName:"data",layer:this,loadOptions:n=eb(eb({},n),{},{mimeType:"application/x-protobuf",mvt:eb(eb({},null===(t=n)||void 0===t?void 0:t.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:{x:u,y:c,z:l}}),gis:a?{format:"binary"}:{}}),signal:s})}},{key:"renderSubLayers",value:function(e){var t=e.tile,r=Math.pow(2,t.z),i=512/r,a=-i,o=512*t.x/r,s=512*(1-t.y/r),u=(new Pr).scale([i,a,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=u,e.coordinateOrigin=[o,s,0],e.coordinateSystem=v.COORDINATE_SYSTEM.CARTESIAN,e.extensions=[].concat(W()(e.extensions||[]),[new v.ClipExtension]));var c=Hn()(y()(n.prototype),"renderSubLayers",this).call(this,e);return!this.props.binary||c instanceof v.GeoJsonLayer||v.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),c}},{key:"_updateAutoHighlight",value:function(e){var t,r,n=this.props.uniqueIdProperty,i=this.state,a=i.hoveredFeatureId,o=i.hoveredFeatureLayerName,s=e.object;s&&(t=ib(s,n),r=ab(s));var u=this.props.highlightColor;"function"==typeof u&&(u=u(e)),a===t&&o===r||this.setState({highlightColor:u,hoveredFeatureId:t,hoveredFeatureLayerName:r})}},{key:"getPickingInfo",value:function(e){var t=Hn()(y()(n.prototype),"getPickingInfo",this).call(this,e),r=this.context.viewport.resolution;if(this.props.binary&&-1!==t.index){var i=e.sourceLayer.props.data;t.object=Lm(i,{globalFeatureId:t.index})}return t.object&&!r&&(t.object=sb(t.object,t.tile.bbox,this.context.viewport)),t}},{key:"getSubLayerPropsByTile",value:function(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(e){var t=this.state,r=t.hoveredFeatureId,n=t.hoveredFeatureLayerName,i=this.props,a=i.uniqueIdProperty,o=i.highlightedFeatureId,s=i.binary,u=e.content,c=ob(o);if(!(ob(r)||c))return-1;var l=c?o:r;return Array.isArray(u)?u.findIndex((function(e){var t=ib(e,a)===l,r=c||ab(e)===n;return t&&r})):u&&s?function(e,t,r,n){var i,a=Wm(Xm);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e[o]&&Qm(e[o],t,r,n);if(s>=0)return s}}catch(e){a.e(e)}finally{a.f()}return-1}(u,a,l,c?"":n):-1}},{key:"_pickObjects",value:function(e){var t=this.context,r=t.deck,n=t.viewport,i=n.width,a=n.height,o=n.x,s=n.y,u=[this.id];return r.pickObjects({x:o,y:s,width:i,height:a,layerIds:u,maxObjects:e})}},{key:"getRenderedFeatures",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this._pickObjects(t),n=new Set,i=[],a=Jm(r);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=ib(o.object,this.props.uniqueIdProperty);void 0===s?i.push(o.object):n.has(s)||(n.add(s),i.push(o.object))}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"_setWGS84PropertyForTiles",value:function(){var e=this;this.state.tileset.selectedTiles.forEach((function(t){t.hasOwnProperty("dataInWGS84")||Object.defineProperty(t,"dataInWGS84",{get:function(){if(!t.content)return null;if(e.props.binary&&Array.isArray(t.content)&&!t.content.length)return[];if(void 0===t._contentWGS84){var r=e.props.binary?Lm(t.content):t.content;t._contentWGS84=r.map((function(r){return sb(r,t.bbox,e.context.viewport)}))}return t._contentWGS84}})}))}},{key:"isLoaded",get:function(){return this.state.data&&this.state.tileset&&Hn()(y()(n.prototype),"isLoaded",this)}}]),n}(qn);function ib(e,t){return t?e.properties[t]:"id"in e?e.id:void 0}function ab(e){var t;return(null===(t=e.properties)||void 0===t?void 0:t.layerName)||null}function ob(e){return null!=e&&""!==e}function sb(e,t,r){var n=eb(eb({},e),{},{geometry:{type:e.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){return function(e,t,r){var n=[r.projectFlat([t.west,t.north]),r.projectFlat([t.east,t.south])];return Um(Um({},e),{},{coordinates:Vm[e.type](e.coordinates,n,r)})}(e.geometry,t,r).coordinates}}),n}nb.layerName="MVTLayer",nb.defaultProps=rb,r.d(t,"GreatCircleLayer",(function(){return m})),r.d(t,"S2Layer",(function(){return B})),r.d(t,"TileLayer",(function(){return qn})),r.d(t,"TripsLayer",(function(){return Qn})),r.d(t,"H3ClusterLayer",(function(){return ni})),r.d(t,"H3HexagonLayer",(function(){return vi})),r.d(t,"Tile3DLayer",(function(){return $v})),r.d(t,"TerrainLayer",(function(){return ug})),r.d(t,"MVTLayer",(function(){return nb}))}])}));
|
|
6
|
+
*/i=[],void 0===(a="function"==typeof(n=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},n={};function i(e,t){var i,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=n[e])?a:(i=o(e,(0|e)<0?-1:0,!0),s&&(n[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(a=r[e])?a:(i=o(e,e<0?-1:0,!1),s&&(r[e]=i),i)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?y:p;if(t){if(e<0)return y;if(e>=f)return A}else{if(e<=-h)return B;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return p;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var i=a(s(r,8)),o=p,c=0;c<e.length;c+=8){var l=Math.min(8,e.length-c),f=parseInt(e.substring(c,c+l),r);if(l<8){var h=a(s(r,l));o=o.mul(h).add(a(f))}else o=(o=o.mul(i)).add(a(f))}return o.unsigned=t,o}function c(t){return t instanceof e?t:"number"==typeof t?a(t):"string"==typeof t?u(t):o(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=c;var l=4294967296,f=l*l,h=f/2,d=i(1<<24),p=i(0);e.ZERO=p;var y=i(0,!0);e.UZERO=y;var v=i(1);e.ONE=v;var g=i(1,!0);e.UONE=g;var m=i(-1);e.NEG_ONE=m;var b=o(-1,2147483647,!1);e.MAX_VALUE=b;var A=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=A;var B=o(0,-2147483648,!1);e.MIN_VALUE=B;var w=e.prototype;return w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(B)){var t=a(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(s(e,6),this.unsigned),o=this,u="";;){var c=o.div(i),l=(o.sub(c.mul(i)).toInt()>>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(B)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},w.isZero=function(){return 0===this.high&&0===this.low},w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(B)?B:this.not().add(v)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,p=0;return d+=(p+=a+(65535&e.low))>>>16,h+=(d+=i+l)>>>16,f+=(h+=n+u)>>>16,f+=r+s,o((d&=65535)<<16|(p&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return p;if(t(e)||(e=c(e)),e.isZero())return p;if(this.eq(B))return e.isOdd()?B:p;if(e.eq(B))return this.isOdd()?B:p;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,y=0,v=0,g=0,m=0;return g+=(m+=s*h)>>>16,v+=(g+=i*h)>>>16,g&=65535,v+=(g+=s*f)>>>16,y+=(v+=n*h)>>>16,v&=65535,y+=(v+=i*f)>>>16,v&=65535,y+=(v+=s*l)>>>16,y+=r*h+n*f+i*l+s*u,o((g&=65535)<<16|(m&=65535),(y&=65535)<<16|(v&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?y:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return g;i=y}else{if(this.eq(B))return e.eq(v)||e.eq(m)?B:e.eq(B)?v:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?v:m:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(B))return this.unsigned?y:p;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=p}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(r),f=l.mul(e);f.isNegative()||f.gt(n);)f=(l=a(r-=u,this.unsigned)).mul(e);l.isZero()&&(l=v),i=i.add(l),n=n.sub(f)}return i},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?n.apply(t,i):n)||(e.exports=a)},function(e,t,r){var n=r(58);e.exports=function(e){return new n(e)}},,function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t){e.exports=r},function(e,t,r){var n=r(109);e.exports=function(e){return function(){return new n(e.apply(this,arguments))}}},function(e,t){e.exports=function(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,r){var n=r(95),i=r(96),a=r(56),o=r(97);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},,function(e,t){},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.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},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t,r){"use strict";var n=r(30);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("undefined"!=typeof window&&"object"===(0,i.default)(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===(0,i.default)(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":(0,i.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;if(r&&r.indexOf("Electron")>=0)return!0;return!1};var i=n(r(9))},function(e,t){},function(e,t,r){"use strict";e.exports=i;var n=r(112);function i(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function o(e){return e.type===i.Bytes?e.readVarint()+e.pos:e.pos+1}function s(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function u(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function c(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function l(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function f(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function h(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function d(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function p(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function y(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function v(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function g(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function m(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function b(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function A(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=m(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=A(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=m(this.buf,this.pos)+4294967296*m(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=m(this.buf,this.pos)+4294967296*A(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return s(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&a?function(e,t,r){return a.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){var n="",i=t;for(;i<r;){var a,o,s,u=e[i],c=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)<=127&&(c=null):3===l?(a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&((c=(15&u)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==i.Bytes)return e.push(this.readVarint(t));var r=o(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==i.Bytes)return e.push(this.readSVarint());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==i.Bytes)return e.push(this.readBoolean());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==i.Bytes)return e.push(this.readFloat());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==i.Bytes)return e.push(this.readDouble());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed32());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed32());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed64());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed64());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===i.Varint)for(;this.buf[this.pos++]>127;);else if(t===i.Bytes)this.pos=this.readVarint()+this.pos;else if(t===i.Fixed32)this.pos+=4;else{if(t!==i.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){var r=(7&e)<<4;if(t.buf[t.pos++]|=r|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a<t.length;a++){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&u(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),n.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),n.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&u(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,i.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,c,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,l,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,y,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,v,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g,t)},writeBytesField:function(e,t){this.writeTag(e,i.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,i.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,i.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,i.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},,,,,,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(52);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(55);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){e.exports=function(e){this.wrapped=e}},function(e,t,r){"use strict";var n=r(30);Object.defineProperty(t,"__esModule",{value:!0}),t.console=t.process=t.document=t.global=t.window=t.self=void 0;var i=n(r(9)),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,i.default)(process))&&process},o=a.self||a.window||a.global;t.self=o;var s=a.window||a.self||a.global;t.window=s;var u=a.global||a.self||a.window;t.global=u;var c=a.document||{};t.document=c;var l=a.process||{};t.process=l;var f=console;t.console=f},function(e,t,r){"use strict";var n=r(30);Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,t.isBrowserMainThread=function(){return o()&&"undefined"!=typeof document};var i=n(r(9)),a=n(r(42));function o(){return!("object"===("undefined"==typeof process?"undefined":(0,i.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,a.default)()}},function(e,t,r){var n=r(51),i=r(84);function a(t,r,o){return i()?(e.exports=a=Reflect.construct,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=a=function(e,t,r){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return r&&n(a,r.prototype),a},e.exports.default=e.exports,e.exports.__esModule=!0),a.apply(null,arguments)}e.exports=a,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(85),i=r(86),a=r(53),o=r(87);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(92),i=r(93),a=r(53),o=r(94);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(103),i=r(104),a=r(105),o=r(107);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(50);function i(){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}}function a(t,r,o){return i()?e.exports=a=Reflect.construct:e.exports=a=function(e,t,r){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return r&&n(a,r.prototype),a},a.apply(null,arguments)}e.exports=a},function(e,t,r){var n=r(113),i=globalThis.deck||{};if(!i.LineLayer)throw new Error("@deck.gl/layers is not found");e.exports=Object.assign(i,n)},,,,,,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(52);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(54);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(54);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(55);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function s(e,t,r,n){var i=t&&t.prototype instanceof l?t:l,a=Object.create(i.prototype),o=new w(n||[]);return a._invoke=function(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return _()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=b(o,r);if(s){if(s===c)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(e,r,o),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function l(){}function f(){}function h(){}var d={};d[i]=function(){return this};var p=Object.getPrototypeOf,y=p&&p(p(x([])));y&&y!==t&&r.call(y,i)&&(d=y);var v=h.prototype=l.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function m(e){var t;this._invoke=function(n,i){function a(){return new Promise((function(t,a){!function t(n,i,a,o){var s=u(e[n],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then((function(e){t("next",e,a,o)}),(function(e){t("throw",e,a,o)})):Promise.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return t("throw",e,a,o)}))}o(s.arg)}(n,i,t,a)}))}return t=t?t.then(a,a):a()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,c;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function B(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function x(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:_}}function _(){return{value:void 0,done:!0}}return f.prototype=v.constructor=h,h.constructor=f,h[o]=f.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,o in e||(e[o]="GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},g(m.prototype),m.prototype[a]=function(){return this},e.AsyncIterator=m,e.async=function(t,r,n,i){var a=new m(s(t,r,n,i));return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(v),v[o]="Generator",v[i]=function(){return this},v.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=x,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(B),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),B(r),c}},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;B(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){var n=r(5);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(106);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t,r){var n=r(58);function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,u=s instanceof n;Promise.resolve(u?s.wrapped:s).then((function(e){u?i("return"===t?"return":"next",e):a(o.done?"return":"normal",e)}),(function(e){i("throw",e)}))}catch(e){a("throw",e)}}function a(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise((function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},e.exports=i},function(e,t,r){"use strict";var n=r(30),i=r(9);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"self",{enumerable:!0,get:function(){return a.self}}),Object.defineProperty(t,"window",{enumerable:!0,get:function(){return a.window}}),Object.defineProperty(t,"global",{enumerable:!0,get:function(){return a.global}}),Object.defineProperty(t,"document",{enumerable:!0,get:function(){return a.document}}),Object.defineProperty(t,"process",{enumerable:!0,get:function(){return a.process}}),Object.defineProperty(t,"console",{enumerable:!0,get:function(){return a.console}}),Object.defineProperty(t,"isBrowser",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"isBrowserMainThread",{enumerable:!0,get:function(){return o.isBrowserMainThread}}),Object.defineProperty(t,"getBrowser",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"isMobile",{enumerable:!0,get:function(){return s.isMobile}}),Object.defineProperty(t,"isElectron",{enumerable:!0,get:function(){return u.default}});var a=r(59),o=l(r(60)),s=l(r(111)),u=n(r(42));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}},function(e,t,r){"use strict";var n=r(30);Object.defineProperty(t,"__esModule",{value:!0}),t.isMobile=function(){return void 0!==i.window.orientation},t.default=function(e){if(!e&&!(0,a.default)())return"Node";if((0,o.default)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},r=e||t.userAgent||"";if(r.indexOf("Edge")>-1)return"Edge";var n=-1!==r.indexOf("MSIE "),s=-1!==r.indexOf("Trident/");if(n||s)return"IE";if(i.window.chrome)return"Chrome";if(i.window.safari)return"Safari";if(i.window.mozInnerScreenX)return"Firefox";return"Unknown"};var i=r(59),a=n(r(60)),o=n(r(42))},function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*y}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"filename",(function(){return Nc})),r.d(n,"dirname",(function(){return Hc})),r.d(n,"join",(function(){return Jc}));var i={};r.r(i),r.d(i,"name",(function(){return av})),r.d(i,"preprocess",(function(){return ov})),r.d(i,"decode",(function(){return sv}));var a={};r.r(a),r.d(a,"name",(function(){return vv})),r.d(a,"preprocess",(function(){return gv}));var o={};r.r(o),r.d(o,"name",(function(){return Av})),r.d(o,"preprocess",(function(){return Bv}));var s={};r.r(s),r.d(s,"name",(function(){return Sv})),r.d(s,"preprocess",(function(){return kv})),r.d(s,"decode",(function(){return Mv})),r.d(s,"encode",(function(){return Pv}));var u={};r.r(u),r.d(u,"name",(function(){return Nv})),r.d(u,"decode",(function(){return Hv})),r.d(u,"encode",(function(){return Vv}));var c={};r.r(c),r.d(c,"name",(function(){return Xv})),r.d(c,"decode",(function(){return qv})),r.d(c,"encode",(function(){return Zv}));var l={};r.r(l),r.d(l,"name",(function(){return eg})),r.d(l,"decode",(function(){return tg})),r.d(l,"encode",(function(){return ng}));var f=r(2),h=r.n(f),d=r(6),p=r.n(d),y=r(11),v=r.n(y),g=r(5),m=r.n(g),b=r(8);function A(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var B=function(e){p()(r,e);var t=A(r);function r(){return h()(this,r),t.apply(this,arguments)}return r}(b.ArcLayer);B.layerName="GreatCircleLayer",B.defaultProps={getHeight:{type:"accessor",value:0},greatCircle:!0};var w=r(3),x=r.n(w),_=r(0),C=r.n(_),O=r(10),E=r.n(O),T=r(27),S=r.n(T),k=180/Math.PI;function M(e,t,r){var n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function I(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function P(e){return[I(e[0]),I(e[1])]}function R(e,t){var r=E()(t,2),n=r[0],i=r[1];switch(e){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function D(e,t,r,n){if(0===n){1===r&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);var i=t[0];t[0]=t[1],t[1]=i}}function F(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){var t=e.padEnd(16,"0");return S.a.fromString(t,16)}(e)}return function(e){for(var t=S.a.fromString(e,!0,10).toString(2);t.length<64;)t="0"+t;for(var r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=S.a.fromString(n,!0,2).toString(10),s=S.a.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}(e.toString())}function j(e){return function(e){for(var t,r,n,i,a,o,s=e.face,u=e.ij,c=e.level,l=[[0,0],[0,1],[1,1],[1,0],[0,0]],f=Math.max(1,Math.ceil(100*Math.pow(2,-c))),h=new Float64Array(4*f*2+2),d=0,p=0,y=0;y<4;y++)for(var v=l[y].slice(0),g=l[y+1],m=(g[0]-v[0])/f,b=(g[1]-v[1])/f,A=0;A<f;A++){v[0]+=m,v[1]+=b;var B=R(s,P(M(u,c,v))),w=(t=B,r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,r=E()(t,3),n=r[0],i=r[1],a=r[2],o=Math.atan2(a,Math.sqrt(n*n+i*i)),[Math.atan2(i,n)*k,o*k]);Math.abs(w[1])>89.999&&(w[0]=p);var x=w[0]-p;w[0]+=x>180?-360:x<-180?360:0,h[d++]=w[0],h[d++]=w[1],p=w[0]}return h[d++]=h[0],h[d++]=h[1],h}(function(e){for(var t,r=e.split("/"),n=parseInt(r[0],10),i=r[1],a=i.length,o=[0,0],s=a-1;s>=0;s--){t=a-s;var u=i[s],c=0,l=0;"1"===u?l=1:"2"===u?(c=1,l=1):"3"===u&&(c=1);var f=Math.pow(2,t-1);D(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(n%2==1){var h=o[0];o[0]=o[1],o[1]=h}return{face:n,ij:o,level:t}}(F(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}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 U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=U(U({},b.PolygonLayer.defaultProps),{},{getS2Token:{type:"accessor",value:function(e){return e.token}}}),H=function(e){p()(r,e);var t=L(r);function r(){return h()(this,r),t.apply(this,arguments)}return x()(r,[{key:"renderLayers",value:function(){var e=this.props,t=e.data,r=e.getS2Token,n=this.props,i=n.elevationScale,a=n.extruded,o=n.wireframe,s=n.filled,u=n.stroked,c=n.lineWidthUnits,l=n.lineWidthScale,f=n.lineWidthMinPixels,h=n.lineWidthMaxPixels,d=n.lineJointRounded,p=n.lineMiterLimit,y=n.lineDashJustified,v=n.getElevation,g=n.getFillColor,m=n.getLineColor,A=n.getLineWidth,B=n.getLineDashArray,w=this.props,x=w.updateTriggers,_=w.material;return new(this.getSubLayerClass("cell",b.PolygonLayer))({filled:s,wireframe:o,extruded:a,elevationScale:i,stroked:u,lineWidthUnits:c,lineWidthScale:l,lineWidthMinPixels:f,lineWidthMaxPixels:h,lineJointRounded:d,lineMiterLimit:p,lineDashJustified:y,material:_,getElevation:v,getFillColor:g,getLineColor:m,getLineWidth:A,getLineDashArray:B},this.getSubLayerProps({id:"cell",updateTriggers:{getElevation:x.getElevation,getFillColor:x.getFillColor,getLineColor:x.getLineColor,getLineWidth:x.getLineWidth,getLineDashArray:x.getLineDashArray}}),{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return j(r(e,t))}})}}]),r}(b.CompositeLayer);H.layerName="S2Layer",H.defaultProps=N;var J=r(4),V=r.n(J),z=r(1),K=r.n(z),Q=function(){function e(t){var r=t.x,n=t.y,i=t.z;h()(this,e),this.x=r,this.y=n,this.z=i,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}var t;return x()(e,[{key:"data",get:function(){var e=this;return this.isLoading?this._loader.then((function(){return e.data})):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var e=this.content?this.content.byteLength:0;return Number.isFinite(e)||b.log.error("byteLength not defined in tile data")(),e}},{key:"_loadData",value:(t=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getData,n=t.requestScheduler,i=t.onLoad,a=t.onError,o=this.x,s=this.y,u=this.z,c=this.bbox,l=this._loaderId,this._abortController=new AbortController,f=this._abortController.signal,e.next=7,n.scheduleRequest(this,(function(e){return e.isSelected?1:-1}));case 7:if(h=e.sent){e.next=11;break}return this._isCancelled=!0,e.abrupt("return");case 11:if(!this._isCancelled){e.next=14;break}return h.done(),e.abrupt("return");case 14:return d=null,e.prev=15,e.next=18,r({x:o,y:s,z:u,bbox:c,signal:f});case 18:d=e.sent,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(15),p=e.t0||!0;case 24:return e.prev=24,h.done(),e.finish(24);case 27:if(l===this._loaderId){e.next=29;break}return e.abrupt("return");case 29:if(this._loader=void 0,this.content=d,!this._isCancelled||d){e.next=34;break}return this._isLoaded=!1,e.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,p?a(p,this):i(this);case 37:case"end":return e.stop()}}),e,this,[[15,21,24,27]])}))),function(e){return t.apply(this,arguments)})},{key:"loadData",value:function(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){this.isLoaded||(this._isCancelled=!0,this._abortController.abort())}}]),e}(),X=r(7),q=r.n(X),W=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Z=r(22),Y=r.n(Z),$=r(23),ee=r.n($),te=r(18),re=r.n(te),ne=r(19),ie=r.n(ne),ae=r(20),oe=r.n(ae),se=r(21),ue=r.n(se),ce=r(14),le=r.n(ce);r(38),r(61),r(62);function fe(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var he=1/Math.PI*180,de=1/180*Math.PI,pe={};function ye(e){return Math.round(e/pe.EPSILON)*pe.EPSILON}function ve(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.precision,n=void 0===r?pe.precision||4:r;return e=ye(e),"".concat(parseFloat(e.toPrecision(n)))}function ge(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function me(e,t,r){if(ge(e)){r=r||((i=e).clone?i.clone():new Array(i.length));for(var n=0;n<r.length&&n<e.length;++n)r[n]=t(e[n],n,r);return r}var i;return t(e)}function be(e){return function(e,t){return me(e,(function(e){return e*de}),t)}(e)}function Ae(e){return Be(e)}function Be(e,t){return me(e,(function(e){return e*he}),t)}function we(e,t,r){return me(e,(function(e){return Math.max(t,Math.min(r,e))}))}function xe(e,t,r){return ge(e)?e.map((function(e,n){return xe(e,t[n],r)})):r*t+(1-r)*e}function _e(e,t,r){var n=pe.EPSILON;r&&(pe.EPSILON=r);try{if(e===t)return!0;if(ge(e)&&ge(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;++i)if(!_e(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):!(!Number.isFinite(e)||!Number.isFinite(t))&&Math.abs(e-t)<=pe.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{pe.EPSILON=n}}function Ce(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=le()(e);if(t){var i=le()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ue()(this,r)}}pe.EPSILON=1e-12,pe.debug=!1,pe.precision=4,pe.printTypes=!1,pe.printDegrees=!1,pe.printRowMajor=!0;var Oe=function(e){oe()(r,e);var t=Ce(r);function r(){return re()(this,r),t.apply(this,arguments)}return ie()(r,[{key:"ELEMENTS",get:function(){return fe(!1),0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)this[r]=e[r+t];return this.check()}},{key:"to",value:function(e){return e===this?this:ge(e)?this.toArray(e):this.toObject(e)}},{key:"toTarget",value:function(e){return e?this.to(e):this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)e[t+r]=this[r];return e}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(pe)}},{key:"formatString",value:function(e){for(var t="",r=0;r<this.ELEMENTS;++r)t+=(r>0?", ":"")+ve(this[r],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(!_e(this[t],e[t]))return!1;return!0}},{key:"exactEquals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}},{key:"negate",value:function(){for(var e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}},{key:"lerp",value:function(e,t,r){void 0===r&&(r=t,t=e,e=this);for(var n=0;n<this.ELEMENTS;++n){var i=e[n];this[n]=i+r*(t[n]-i)}return this.check()}},{key:"min",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}},{key:"max",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}},{key:"clamp",value:function(e,t){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),t[r]);return this.check()}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]+=a[o];return this.check()}},{key:"subtract",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]-=a[o];return this.check()}},{key:"scale",value:function(e){if(Array.isArray(e))return this.multiply(e);for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}},{key:"addScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}},{key:"subScalar",value:function(e){return this.addScalar(-e)}},{key:"multiplyScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"divideScalar",value:function(e){return this.scale(1/e)}},{key:"clampScalar",value:function(e,t){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),t);return this.check()}},{key:"multiplyByScalar",value:function(e){return this.scale(e)}},{key:"elements",get:function(){return this}},{key:"check",value:function(){if(pe.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var e=this.length===this.ELEMENTS,t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}]),r}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array));function Ee(e,t){if(e.length!==t)return!1;for(var r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Te(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function Se(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(pe.debug&&!Ee(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}var ke={};function Me(e,t){ke[e]||(ke[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}function Ie(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=le()(e);if(t){var i=le()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ue()(this,r)}}var Pe=function(e){oe()(r,e);var t=Ie(r);function r(){return re()(this,r),t.apply(this,arguments)}return ie()(r,[{key:"ELEMENTS",get:function(){return fe(!1),0}},{key:"copy",value:function(e){return fe(!1),this}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=Te(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=Te(e)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(e){return Math.sqrt(this.distanceSquared(e))}},{key:"distanceSquared",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r){var n=this[r]-e[r];t+=n*n}return Te(t)}},{key:"dot",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r)t+=this[r]*e[r];return Te(t)}},{key:"normalize",value:function(){var e=this.magnitude();if(0!==e)for(var t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}},{key:"multiply",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]*=a[o];return this.check()}},{key:"divide",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]/=a[o];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(e){return this.distance(e)}},{key:"distanceToSquared",value:function(e){return this.distanceSquared(e)}},{key:"getComponent",value:function(e){return fe(e>=0&&e<this.ELEMENTS,"index is out of range"),Te(this[e])}},{key:"setComponent",value:function(e,t){return fe(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}},{key:"addVectors",value:function(e,t){return this.copy(e).add(t)}},{key:"subVectors",value:function(e,t){return this.copy(e).subtract(t)}},{key:"multiplyVectors",value:function(e,t){return this.copy(e).multiply(t)}},{key:"addScaledVector",value:function(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}]),r}(Oe),Re="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function De(){var e=new Re(3);return Re!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Fe(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function je(e,t,r){var n=new Re(3);return n[0]=e,n[1]=t,n[2]=r,n}function Le(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ge(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function Ue(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function Ne(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var He,Je=Fe;He=De();function Ve(e,t,r){var n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function ze(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function Ke(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=le()(e);if(t){var i=le()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ue()(this,r)}}var Qe=[0,0,0],Xe={},qe=function(e){oe()(r,e);var t=Ke(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return re()(this,r),e=t.call(this,-0,-0,-0),1===arguments.length&&ge(n)?e.copy(n):(pe.debug&&(Te(n),Te(i),Te(a)),e[0]=n,e[1]=i,e[2]=a),e}return ie()(r,[{key:"set",value:function(e,t,r){return this[0]=e,this[1]=t,this[2]=r,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}},{key:"fromObject",value:function(e){return pe.debug&&(Te(e.x),Te(e.y),Te(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=Te(e)}},{key:"angle",value:function(e){return r=e,n=(t=this)[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=Math.sqrt(n*n+i*i+a*a)*Math.sqrt(o*o+s*s+u*u),l=c&&Le(t,r)/c,Math.acos(Math.min(Math.max(l,-1),1));var t,r,n,i,a,o,s,u,c,l}},{key:"cross",value:function(e){return Ge(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t,r,n,i,a,o,s=e.radians,u=e.origin;return t=this,n=void 0===u?Qe:u,i=s,o=[],(a=[])[0]=(r=this)[0]-n[0],a[1]=r[1]-n[1],a[2]=r[2]-n[2],o[0]=a[0],o[1]=a[1]*Math.cos(i)-a[2]*Math.sin(i),o[2]=a[1]*Math.sin(i)+a[2]*Math.cos(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],this.check()}},{key:"rotateY",value:function(e){var t,r,n,i,a,o,s=e.radians,u=e.origin;return t=this,n=void 0===u?Qe:u,i=s,o=[],(a=[])[0]=(r=this)[0]-n[0],a[1]=r[1]-n[1],a[2]=r[2]-n[2],o[0]=a[2]*Math.sin(i)+a[0]*Math.cos(i),o[1]=a[1],o[2]=a[2]*Math.cos(i)-a[0]*Math.sin(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],this.check()}},{key:"rotateZ",value:function(e){var t,r,n,i,a,o,s=e.radians,u=e.origin;return t=this,n=void 0===u?Qe:u,i=s,o=[],(a=[])[0]=(r=this)[0]-n[0],a[1]=r[1]-n[1],a[2]=r[2]-n[2],o[0]=a[0]*Math.cos(i)-a[1]*Math.sin(i),o[1]=a[0]*Math.sin(i)+a[1]*Math.cos(i),o[2]=a[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return Ue(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return ze(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return Ne(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){var t,r,n,i,a;return t=this,n=e,i=(r=this)[0],a=r[1],t[0]=n[0]*i+n[2]*a,t[1]=n[1]*i+n[3]*a,t[2]=r[2],this.check()}},{key:"transformByQuaternion",value:function(e){var t,r,n,i,a,o,s,u,c,l,f,h,d,p,y,v,g;return t=this,r=this,i=(n=e)[0],a=n[1],o=n[2],s=n[3],u=r[0],c=r[1],l=r[2],p=a*(d=i*c-a*u)-o*(h=o*u-i*l),y=o*(f=a*l-o*c)-i*d,v=i*h-a*f,f*=g=2*s,h*=g,d*=g,p*=2,y*=2,v*=2,t[0]=u+f+p,t[1]=c+h+y,t[2]=l+d+v,this.check()}}],[{key:"ZERO",get:function(){return Xe.ZERO=Xe.ZERO||Object.freeze(new r(0,0,0,0))}}]),r}(Pe),We=new qe,Ze=new qe,Ye=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Y()(this,e),n=n||We.copy(t).add(r).scale(.5),this.center=new qe(n),this.halfDiagonal=new qe(r).subtract(this.center),this.minimum=new qe(t),this.maximum=new qe(r)}return ee()(e,[{key:"clone",value:function(){return new e(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}},{key:"transform",value:function(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}},{key:"intersectPlane",value:function(e){var t=this.halfDiagonal,r=Ze.from(e.normal),n=t.x*Math.abs(r.x)+t.y*Math.abs(r.y)+t.z*Math.abs(r.z),i=this.center.dot(r)+e.distance;return i-n>0?W.INSIDE:i+n<0?W.OUTSIDE:W.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t,r=We.from(e).subtract(this.center),n=this.halfDiagonal,i=0;return(t=Math.abs(r.x)-n.x)>0&&(i+=t*t),(t=Math.abs(r.y)-n.y)>0&&(i+=t*t),(t=Math.abs(r.z)-n.z)>0&&(i+=t*t),i}}]),e}();function $e(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],p=t[12],y=t[13],v=t[14],g=t[15],m=r*s-n*o,b=r*u-i*o,A=r*c-a*o,B=n*u-i*s,w=n*c-a*s,x=i*c-a*u,_=l*y-f*p,C=l*v-h*p,O=l*g-d*p,E=f*v-h*y,T=f*g-d*y,S=h*g-d*v,k=m*S-b*T+A*E+B*O-w*C+x*_;return k?(k=1/k,e[0]=(s*S-u*T+c*E)*k,e[1]=(i*T-n*S-a*E)*k,e[2]=(y*x-v*w+g*B)*k,e[3]=(h*w-f*x-d*B)*k,e[4]=(u*O-o*S-c*C)*k,e[5]=(r*S-i*O+a*C)*k,e[6]=(v*A-p*x-g*b)*k,e[7]=(l*x-h*A+d*b)*k,e[8]=(o*T-s*O+c*_)*k,e[9]=(n*O-r*T-a*_)*k,e[10]=(p*w-y*A+g*m)*k,e[11]=(f*A-l*w-d*m)*k,e[12]=(s*C-o*E-u*_)*k,e[13]=(r*E-n*C+i*_)*k,e[14]=(y*b-p*B-v*m)*k,e[15]=(l*B-f*b+h*m)*k,e):null}function et(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],y=t[12],v=t[13],g=t[14],m=t[15],b=r[0],A=r[1],B=r[2],w=r[3];return e[0]=b*n+A*s+B*f+w*y,e[1]=b*i+A*u+B*h+w*v,e[2]=b*a+A*c+B*d+w*g,e[3]=b*o+A*l+B*p+w*m,b=r[4],A=r[5],B=r[6],w=r[7],e[4]=b*n+A*s+B*f+w*y,e[5]=b*i+A*u+B*h+w*v,e[6]=b*a+A*c+B*d+w*g,e[7]=b*o+A*l+B*p+w*m,b=r[8],A=r[9],B=r[10],w=r[11],e[8]=b*n+A*s+B*f+w*y,e[9]=b*i+A*u+B*h+w*v,e[10]=b*a+A*c+B*d+w*g,e[11]=b*o+A*l+B*p+w*m,b=r[12],A=r[13],B=r[14],w=r[15],e[12]=b*n+A*s+B*f+w*y,e[13]=b*i+A*u+B*h+w*v,e[14]=b*a+A*c+B*d+w*g,e[15]=b*o+A*l+B*p+w*m,e}function tt(e,t,r){var n,i,a,o,s,u,c,l,f,h,d,p,y=r[0],v=r[1],g=r[2];return t===e?(e[12]=t[0]*y+t[4]*v+t[8]*g+t[12],e[13]=t[1]*y+t[5]*v+t[9]*g+t[13],e[14]=t[2]*y+t[6]*v+t[10]*g+t[14],e[15]=t[3]*y+t[7]*v+t[11]*g+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=p,e[12]=n*y+s*v+f*g+t[12],e[13]=i*y+u*v+h*g+t[13],e[14]=a*y+c*v+d*g+t[14],e[15]=o*y+l*v+p*g+t[15]),e}function rt(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function nt(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+h*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=h*i-u*n,e}function it(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+h*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=h*i-u*n,e}function at(e,t){var r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.hypot(r,n,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(u,c,l),e}function ot(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e}function st(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p=t[0],y=t[1],v=t[2],g=n[0],m=n[1],b=n[2],A=r[0],B=r[1],w=r[2];return Math.abs(p-A)<1e-6&&Math.abs(y-B)<1e-6&&Math.abs(v-w)<1e-6?function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}(e):(l=p-A,f=y-B,h=v-w,i=m*(h*=d=1/Math.hypot(l,f,h))-b*(f*=d),a=b*(l*=d)-g*h,o=g*f-m*l,(d=Math.hypot(i,a,o))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),s=f*o-h*a,u=h*i-l*o,c=l*a-f*i,(d=Math.hypot(s,u,c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=a,e[5]=u,e[6]=f,e[7]=0,e[8]=o,e[9]=c,e[10]=h,e[11]=0,e[12]=-(i*p+a*y+o*v),e[13]=-(s*p+u*y+c*v),e[14]=-(l*p+f*y+h*v),e[15]=1,e)}var ut=new qe,ct=new qe,lt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Y()(this,e),this.radius=-0,this.center=new qe,this.fromCenterRadius(t,r)}return ee()(e,[{key:"fromCenterRadius",value:function(e,t){return this.center.from(e),this.radius=t,this}},{key:"fromCornerPoints",value:function(e,t){return t=ut.from(t),this.center=(new qe).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}},{key:"clone",value:function(){return new e(this.center,this.radius)}},{key:"union",value:function(e){var t=this.center,r=this.radius,n=e.center,i=e.radius,a=ut.copy(n).subtract(t),o=a.magnitude();if(r>=o+i)return this.clone();if(i>=o+r)return e.clone();var s=.5*(r+o+i);return ct.copy(a).scale((-r+s)/o).add(t),this.center.copy(ct),this.radius=s,this}},{key:"expand",value:function(e){var t=(e=ut.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}},{key:"transform",value:function(e){this.center.transform(e);var t=at(ut,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(e){var t=this.distanceTo(e);return t*t}},{key:"distanceTo",value:function(e){var t=(e=ut.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}},{key:"intersectPlane",value:function(e){var t=this.center,r=this.radius,n=e.normal.dot(t)+e.distance;return n<-r?W.OUTSIDE:n<r?W.INTERSECTING:W.INSIDE}}]),e}(),ft=r(26),ht=r.n(ft);function dt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=le()(e);if(t){var i=le()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ue()(this,r)}}var pt=function(e){oe()(r,e);var t=dt(r);function r(){return re()(this,r),t.apply(this,arguments)}return ie()(r,[{key:"ELEMENTS",get:function(){return fe(!1),0}},{key:"RANK",get:function(){return fe(!1),0}},{key:"toString",value:function(){var e="[";if(pe.printRowMajor){e+="row-major:";for(var t=0;t<this.RANK;++t)for(var r=0;r<this.RANK;++r)e+=" ".concat(this[r*this.RANK+t])}else{e+="column-major:";for(var n=0;n<this.ELEMENTS;++n)e+=" ".concat(this[n])}return e+="]"}},{key:"getElementIndex",value:function(e,t){return t*this.RANK+e}},{key:"getElement",value:function(e,t){return this[t*this.RANK+e]}},{key:"setElement",value:function(e,t,r){return this[t*this.RANK+e]=Te(r),this}},{key:"getColumn",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=e*this.RANK,n=0;n<this.RANK;++n)t[n]=this[r+n];return t}},{key:"setColumn",value:function(e,t){for(var r=e*this.RANK,n=0;n<this.RANK;++n)this[r+n]=t[n];return this}}]),r}(Oe);function yt(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=r[0],d=r[1],p=r[2],y=r[3],v=r[4],g=r[5],m=r[6],b=r[7],A=r[8];return e[0]=h*n+d*o+p*c,e[1]=h*i+d*s+p*l,e[2]=h*a+d*u+p*f,e[3]=y*n+v*o+g*c,e[4]=y*i+v*s+g*l,e[5]=y*a+v*u+g*f,e[6]=m*n+b*o+A*c,e[7]=m*i+b*s+A*l,e[8]=m*a+b*u+A*f,e}function vt(e,t,r){var n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function gt(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function mt(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}!function(){var e,t=(e=new Re(2),Re!=Float32Array&&(e[0]=0,e[1]=0),e)}();function bt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=le()(e);if(t){var i=le()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ue()(this,r)}}var At=Object.freeze([1,0,0,0,1,0,0,0,1]),Bt=Object.freeze([0,0,0,0,0,0,0,0,0]),wt=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),xt={},_t=function(e){oe()(r,e);var t=bt(r);function r(e){var n;return re()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):n.identity(),n}return ie()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return wt}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}},{key:"set",value:function(e,t,r,n,i,a,o,s,u){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this.check()}},{key:"setRowMajor",value:function(e,t,r,n,i,a,o,s,u){return this[0]=e,this[1]=n,this[2]=o,this[3]=t,this[4]=i,this[5]=s,this[6]=r,this[7]=a,this[8]=u,this.check()}},{key:"determinant",value:function(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s);var e,t,r,n,i,a,o,s,u,c}},{key:"identity",value:function(){return this.copy(At)}},{key:"fromQuaternion",value:function(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,d=i*s,p=i*u,y=a*o,v=a*s,g=a*u;e[0]=1-f-p,e[3]=l-g,e[6]=h+v,e[1]=l+g,e[4]=1-c-p,e[7]=d-y,e[2]=h-v,e[5]=d+y,e[8]=1-c-f}(this,e),this.check()}},{key:"transpose",value:function(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]}(this,this),this.check()}},{key:"invert",value:function(){var e,t,r,n,i,a,o,s,u,c,l,f,h,d,p;return e=this,r=(t=this)[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],(p=r*(f=l*o-s*c)+n*(h=-l*a+s*u)+i*(d=c*a-o*u))&&(p=1/p,e[0]=f*p,e[1]=(-l*n+i*c)*p,e[2]=(s*n-i*o)*p,e[3]=h*p,e[4]=(l*r-i*u)*p,e[5]=(-s*r+i*a)*p,e[6]=d*p,e[7]=(-c*r+n*u)*p,e[8]=(o*r-n*a)*p),this.check()}},{key:"multiplyLeft",value:function(e){return yt(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return yt(this,this,e),this.check()}},{key:"rotate",value:function(e){var t,r,n,i,a,o,s,u,c,l,f,h,d,p;return t=this,n=e,i=(r=this)[0],a=r[1],o=r[2],s=r[3],u=r[4],c=r[5],l=r[6],f=r[7],h=r[8],d=Math.sin(n),p=Math.cos(n),t[0]=p*i+d*s,t[1]=p*a+d*u,t[2]=p*o+d*c,t[3]=p*s-d*i,t[4]=p*u-d*a,t[5]=p*c-d*o,t[6]=l,t[7]=f,t[8]=h,this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?vt(this,this,e):vt(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){var t,r,n,i,a,o,s,u,c,l,f,h,d,p;return t=this,n=e,i=(r=this)[0],a=r[1],o=r[2],s=r[3],u=r[4],c=r[5],l=r[6],f=r[7],h=r[8],d=n[0],p=n[1],t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=u,t[5]=c,t[6]=d*i+p*s+l,t[7]=d*a+p*u+f,t[8]=d*o+p*c+h,this.check()}},{key:"transform",value:function(e,t){switch(e.length){case 2:t=gt(t||[-0,-0],e,this);break;case 3:t=Ne(t||[-0,-0,-0],e,this);break;case 4:r=t||[-0,-0,-0,-0],i=this,a=(n=e)[0],o=n[1],s=n[2],r[0]=i[0]*a+i[3]*o+i[6]*s,r[1]=i[1]*a+i[4]*o+i[7]*s,r[2]=i[2]*a+i[5]*o+i[8]*s,r[3]=n[3],t=r;break;default:throw new Error("Illegal vector")}var r,n,i,a,o,s;return Se(t,e.length),t}},{key:"transformVector",value:function(e,t){return Me("Matrix3.transformVector"),this.transform(e,t)}},{key:"transformVector2",value:function(e,t){return Me("Matrix3.transformVector"),this.transform(e,t)}},{key:"transformVector3",value:function(e,t){return Me("Matrix3.transformVector"),this.transform(e,t)}}],[{key:"IDENTITY",get:function(){return xt.IDENTITY=xt.IDENTITY||Object.freeze(new r(At)),xt.IDENTITY}},{key:"ZERO",get:function(){return xt.ZERO=xt.ZERO||Object.freeze(new r(Bt)),xt.ZERO}}]),r}(pt);function Ct(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Ot(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function Et(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function Tt(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function St(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-u*a;return e[0]=l*c+d*-o+f*-u-h*-s,e[1]=f*c+d*-s+h*-o-l*-u,e[2]=h*c+d*-u+l*-s-f*-o,e[3]=t[3],e}!function(){var e,t=(e=new Re(4),Re!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e)}();function kt(){var e=new Re(4);return Re!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Mt(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function It(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function Pt(e,t,r,n){var i,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=r[0],p=r[1],y=r[2],v=r[3];return(a=c*d+l*p+f*y+h*v)<0&&(a=-a,d=-d,p=-p,y=-y,v=-v),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,u=Math.sin(n*i)/o):(s=1-n,u=n),e[0]=s*c+u*d,e[1]=s*l+u*p,e[2]=s*f+u*y,e[3]=s*h+u*v,e}function Rt(e,t){var r,n=t[0]+t[4]+t[8];if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[3*i+i]-t[3*a+a]-t[3*o+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[3*a+o]-t[3*o+a])*r,e[a]=(t[3*a+i]+t[3*i+a])*r,e[o]=(t[3*o+i]+t[3*i+o])*r}return e}var Dt,Ft,jt,Lt,Gt,Ut,Nt,Ht=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},Jt=Ct,Vt=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},zt=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e},Kt=Ot,Qt=Et,Xt=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e},qt=(Dt=De(),Ft=je(1,0,0),jt=je(0,1,0),function(e,t,r){var n=Le(t,r);return n<-.999999?(Ge(Dt,Ft,t),Je(Dt)<1e-6&&Ge(Dt,jt,t),function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a}(Dt,Dt),Mt(e,Dt,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Ge(Dt,t,r),e[0]=Dt[0],e[1]=Dt[1],e[2]=Dt[2],e[3]=1+n,Xt(e,e))});Lt=kt(),Gt=kt(),Ut=new Re(9),Re!=Float32Array&&(Ut[1]=0,Ut[2]=0,Ut[3]=0,Ut[5]=0,Ut[6]=0,Ut[7]=0),Ut[0]=1,Ut[4]=1,Ut[8]=1,Nt=Ut;function Wt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=le()(e);if(t){var i=le()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ue()(this,r)}}var Zt=[0,0,0,1],Yt=function(e){oe()(r,e);var t=Wt(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return re()(this,r),e=t.call(this,-0,-0,-0,-0),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,a,o),e}return ie()(r,[{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}},{key:"set",value:function(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}},{key:"fromMatrix3",value:function(e){return Rt(this,e),this.check()}},{key:"identity",value:function(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}},{key:"fromAxisRotation",value:function(e,t){return Mt(this,e,t),this.check()}},{key:"setAxisAngle",value:function(e,t){return this.fromAxisRotation(e,t)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=Te(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=Te(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=Te(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=Te(e)}},{key:"len",value:function(){return Kt(this)}},{key:"lengthSquared",value:function(){return Qt(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return Vt(this,e)}},{key:"rotationTo",value:function(e,t){return qt(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return Ht(this,this,e),this.check()}},{key:"calculateW",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2];e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s}(this,this),this.check()}},{key:"lerp",value:function(e,t,r){return zt(this,e,t,r),this.check()}},{key:"multiplyRight",value:function(e,t){return fe(!t),It(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e,t){return fe(!t),It(this,e,this),this.check()}},{key:"normalize",value:function(){var e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}},{key:"rotateX",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return Jt(this,this,e),this.check()}},{key:"slerp",value:function(e,t,r){switch(arguments.length){case 1:var n=arguments[0],i=n.start;e=void 0===i?Zt:i,t=n.target,r=n.ratio;break;case 2:var a=Array.prototype.slice.call(arguments);t=a[0],r=a[1],e=this}return Pt(this,e,t,r),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return St(t,e,this),Se(t,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(e,t){return this.setAxisAngle(e,t)}},{key:"premultiply",value:function(e,t){return this.multiplyLeft(e,t)}},{key:"multiply",value:function(e,t){return this.multiplyRight(e,t)}}]),r}(Oe),$t=new qe,er=new qe,tr=new qe,rr=new qe,nr=new qe,ir=new qe,ar=new qe,or=0,sr=1,ur=2,cr=3,lr=4,fr=5,hr=6,dr=7,pr=8,yr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];Y()(this,e),this.center=(new qe).from(t),this.halfAxes=new _t(r)}return ee()(e,[{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new qe(e).len(),new qe(t).len(),new qe(r).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new qe(e).normalize(),i=new qe(t).normalize(),a=new qe(r).normalize();return(new Yt).fromMatrix3(new _t([].concat(ht()(n),ht()(i),ht()(a))))}},{key:"fromCenterHalfSizeQuaternion",value:function(e,t,r){var n=new Yt(r),i=(new _t).fromQuaternion(n);return i[0]=i[0]*t[0],i[1]=i[1]*t[0],i[2]=i[2]*t[0],i[3]=i[3]*t[1],i[4]=i[4]*t[1],i[5]=i[5]*t[1],i[6]=i[6]*t[2],i[7]=i[7]*t[2],i[8]=i[8]*t[2],this.center=(new qe).from(e),this.halfAxes=i,this}},{key:"clone",value:function(){return new e(this.center,this.halfAxes)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}},{key:"getBoundingSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new lt,t=this.halfAxes,r=t.getColumn(0,tr),n=t.getColumn(1,rr),i=t.getColumn(2,nr),a=$t.copy(r).add(n).add(i);return e.center.copy(this.center),e.radius=a.magnitude(),e}},{key:"intersectPlane",value:function(e){var t=this.center,r=e.normal,n=this.halfAxes,i=r.x,a=r.y,o=r.z,s=Math.abs(i*n[or]+a*n[sr]+o*n[ur])+Math.abs(i*n[cr]+a*n[lr]+o*n[fr])+Math.abs(i*n[hr]+a*n[dr]+o*n[pr]),u=r.dot(t)+e.distance;return u<=-s?W.OUTSIDE:u>=s?W.INSIDE:W.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t=er.from(e).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,tr),i=r.getColumn(1,rr),a=r.getColumn(2,nr),o=n.magnitude(),s=i.magnitude(),u=a.magnitude();n.normalize(),i.normalize(),a.normalize();var c,l=0;return(c=Math.abs(t.dot(n))-o)>0&&(l+=c*c),(c=Math.abs(t.dot(i))-s)>0&&(l+=c*c),(c=Math.abs(t.dot(a))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=this.center,o=this.halfAxes,s=o.getColumn(0,tr),u=o.getColumn(1,rr),c=o.getColumn(2,nr),l=ir.copy(s).add(u).add(c).add(a),f=ar.copy(l).subtract(e),h=t.dot(f);return n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).add(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).subtract(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).subtract(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).add(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).add(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).subtract(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).subtract(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),r[0]=n,r[1]=i,r}},{key:"transform",value:function(e){this.center.transformAsPoint(e);var t=this.halfAxes.getColumn(0,tr);t.transformAsPoint(e);var r=this.halfAxes.getColumn(1,rr);r.transformAsPoint(e);var n=this.halfAxes.getColumn(2,nr);return n.transformAsPoint(e),this.halfAxes=new _t([].concat(ht()(t),ht()(r),ht()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),e}(),vr=new qe,gr=new qe,mr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Y()(this,e),this.normal=new qe,this.distance=-0,this.fromNormalDistance(t,r)}return ee()(e,[{key:"fromNormalDistance",value:function(e,t){return fe(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}},{key:"fromPointNormal",value:function(e,t){e=vr.from(e),this.normal.from(t).normalize();var r=-this.normal.dot(e);return this.distance=r,this}},{key:"fromCoefficients",value:function(e,t,r,n){return this.normal.set(e,t,r),fe(_e(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(t){return new e(this.normal,this.distance)}},{key:"equals",value:function(e){return _e(this.distance,e.distance)&&_e(this.normal,e.normal)}},{key:"getPointDistance",value:function(e){return this.normal.dot(e)+this.distance}},{key:"transform",value:function(e){var t=gr.copy(this.normal).transformAsVector(e).normalize(),r=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(r,t)}},{key:"projectPointOntoPlane",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];e=vr.from(e);var r=this.getPointDistance(e),n=gr.copy(this.normal).scale(r);return e.subtract(n).to(t)}}]),e}();function br(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ar(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ar(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Br=[new qe([1,0,0]),new qe([0,1,0]),new qe([0,0,1])],wr=new qe,xr=new qe,_r=(new mr(new qe(1,0,0),0),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Y()(this,e),this.planes=t,fe(this.planes.every((function(e){return e instanceof mr})))}return ee()(e,[{key:"fromBoundingSphere",value:function(e){this.planes.length=2*Br.length;var t,r=e.center,n=e.radius,i=0,a=br(Br);try{for(a.s();!(t=a.n()).done;){var o=t.value,s=this.planes[i],u=this.planes[i+1];s||(s=this.planes[i]=new mr),u||(u=this.planes[i+1]=new mr);var c=wr.copy(o).scale(-n).add(r);o.dot(c);s.fromPointNormal(c,o);var l=wr.copy(o).scale(n).add(r),f=xr.copy(o).negate();f.dot(l);u.fromPointNormal(l,f),i+=2}}catch(e){a.e(e)}finally{a.f()}return this}},{key:"computeVisibility",value:function(e){fe(e);var t,r=W.INSIDE,n=br(this.planes);try{for(n.s();!(t=n.n()).done;){var i=t.value;switch(e.intersectPlane(i)){case W.OUTSIDE:return W.OUTSIDE;case W.INTERSECTING:r=W.INTERSECTING}}}catch(e){n.e(e)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(t,r){if(fe(t,"boundingVolume is required."),fe(Number.isFinite(r),"parentPlaneMask is required."),r===e.MASK_OUTSIDE||r===e.MASK_INSIDE)return r;for(var n=e.MASK_INSIDE,i=this.planes,a=0;a<this.planes.length;++a){var o=a<31?1<<a:0;if(!(a<31&&0==(r&o))){var s=i[a],u=t.intersectPlane(s);if(u===W.OUTSIDE)return e.MASK_OUTSIDE;u===W.INTERSECTING&&(n|=o)}}return n}}],[{key:"MASK_OUTSIDE",get:function(){return 4294967295}},{key:"MASK_INSIDE",get:function(){return 0}},{key:"MASK_INDETERMINATE",get:function(){return 2147483647}}]),e}()),Cr=(r(39),r(63)),Or=r.n(Cr);function Er(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=le()(e);if(t){var i=le()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ue()(this,r)}}var Tr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Sr=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),kr=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),Mr={},Ir=function(e){oe()(r,e);var t=Er(r);function r(e){var n;return re()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):n.identity(),n}return ie()(r,[{key:"INDICES",get:function(){return kr}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}},{key:"set",value:function(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,y){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=p,this[15]=y,this.check()}},{key:"setRowMajor",value:function(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,y){return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=r,this[9]=o,this[10]=l,this[11]=p,this[12]=n,this[13]=s,this[14]=f,this[15]=y,this.check()}},{key:"toRowMajor",value:function(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}},{key:"identity",value:function(){return this.copy(Tr)}},{key:"fromQuaternion",value:function(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,d=i*s,p=i*u,y=a*o,v=a*s,g=a*u;e[0]=1-f-p,e[1]=l+g,e[2]=h-v,e[3]=0,e[4]=l-g,e[5]=1-c-p,e[6]=d+y,e[7]=0,e[8]=h+v,e[9]=d-y,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,a=e.top,o=e.near,s=e.far;return s===1/0?r._computeInfinitePerspectiveOffCenter(this,t,n,i,a,o):function(e,t,r,n,i,a,o){var s=1/(r-t),u=1/(i-n),c=1/(a-o);e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0}(this,t,n,i,a,o,s),this.check()}},{key:"lookAt",value:function(e,t,r){if(1===arguments.length){var n=e;e=n.eye,t=n.center,r=n.up}return st(this,e,t=t||[0,0,0],r=r||[0,1,0]),this.check()}},{key:"ortho",value:function(e){var t=e.left,r=e.right,n=e.bottom,i=e.top,a=e.near,o=void 0===a?.1:a,s=e.far;return function(e,t,r,n,i,a,o){var s=1/(t-r),u=1/(n-i),c=1/(a-o);e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1}(this,t,r,n,i,o,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(e){var t=e.fovy,n=void 0===t?45*Math.PI/180:t,i=e.aspect,a=void 0===i?1:i,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(n>2*Math.PI)throw Error("radians");var h=n/2,d=s*Math.tan(h),p=d*a;return(new r).ortho({left:-p,right:p,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,r=void 0===t?void 0:t,n=e.fov,i=void 0===n?45*Math.PI/180:n,a=e.aspect,o=void 0===a?1:a,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;if((r=r||i)>2*Math.PI)throw Error("radians");return ot(this,r,o,u,l),this.check()}},{key:"determinant",value:function(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],p=e[13],y=e[14],v=e[15],(t*o-r*a)*(f*v-h*y)-(t*s-n*a)*(l*v-h*p)+(t*u-i*a)*(l*y-f*p)+(r*s-n*o)*(c*v-h*d)-(r*u-i*o)*(c*y-f*d)+(n*u-i*s)*(c*p-l*d);var e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,y,v}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*n,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*n,e[7]=this[9]*i,e[8]=this[10]*a,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return $e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return et(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return et(this,this,e),this.check()}},{key:"rotateX",value:function(e){return nt(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],h=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-h*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+h*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return it(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Or()(e,3),r=t[0],n=t[1],i=t[2];return this.rotateX(r).rotateY(n).rotateZ(i)}},{key:"rotateAxis",value:function(e,t){return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,y,v,g,m,b,A,B,w,x,_,C,O,E,T=n[0],S=n[1],k=n[2],M=Math.hypot(T,S,k);M<1e-6||(T*=M=1/M,S*=M,k*=M,i=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],u=t[1],c=t[2],l=t[3],f=t[4],h=t[5],d=t[6],p=t[7],y=t[8],v=t[9],g=t[10],m=t[11],b=T*T*o+a,A=S*T*o+k*i,B=k*T*o-S*i,w=T*S*o-k*i,x=S*S*o+a,_=k*S*o+T*i,C=T*k*o+S*i,O=S*k*o-T*i,E=k*k*o+a,e[0]=s*b+f*A+y*B,e[1]=u*b+h*A+v*B,e[2]=c*b+d*A+g*B,e[3]=l*b+p*A+m*B,e[4]=s*w+f*x+y*_,e[5]=u*w+h*x+v*_,e[6]=c*w+d*x+g*_,e[7]=l*w+p*x+m*_,e[8]=s*C+f*O+y*E,e[9]=u*C+h*O+v*E,e[10]=c*C+d*O+g*E,e[11]=l*C+p*O+m*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?rt(this,this,e):rt(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return tt(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(Se(t=Tt(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){switch(e.length){case 2:t=mt(t||[-0,-0],e,this);break;case 3:t=Ue(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Se(t,e.length),t}},{key:"transformAsVector",value:function(e,t){switch(e.length){case 2:t=Ve(t||[-0,-0],e,this);break;case 3:t=ze(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Se(t,e.length),t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,r){return this.identity().translate([e,t,r])}},{key:"transformPoint",value:function(e,t){return Me("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return Me("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return Me("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}],[{key:"IDENTITY",get:function(){return Mr.IDENTITY=Mr.IDENTITY||Object.freeze(new r(Tr)),Mr.IDENTITY}},{key:"ZERO",get:function(){return Mr.ZERO=Mr.ZERO||Object.freeze(new r(Sr)),Mr.ZERO}},{key:"_computeInfinitePerspectiveOffCenter",value:function(e,t,r,n,i,a){var o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=c,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=l,e[15]=0,e}}]),r}(pt);new qe,new qe,new qe,new qe,new qe;new qe,new qe,new qe,new qe,new qe,new qe,new qe,new qe,new qe,new qe,new qe,new qe,Math.PI;var Pr=.1,Rr=1e-12,Dr=1e-15,Fr=1e-20,jr=(Math.PI,Math.PI,Math.PI,Math.PI,new _t),Lr=new _t,Gr=new _t,Ur=new _t,Nr=new _t;function Hr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Fr,n=10,i=0,a=0,o=Lr,s=Gr;o.identity(),s.copy(e);for(var u=r*Jr(s);a<n&&Kr(s)>u;)Qr(s,Ur),Nr.copy(Ur).transpose(),s.multiplyRight(Ur),s.multiplyLeft(Nr),o.multiplyRight(Ur),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function Jr(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}var Vr=[1,0,0],zr=[2,2,1];function Kr(e){for(var t=0,r=0;r<3;++r){var n=e[jr.getElementIndex(zr[r],Vr[r])];t+=2*n*n}return Math.sqrt(t)}function Qr(e,t){for(var r=Dr,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[jr.getElementIndex(zr[a],Vr[a])]);o>n&&(i=a,n=o)}var s=Vr[i],u=zr[i],c=1,l=0;if(Math.abs(e[jr.getElementIndex(u,s)])>r){var f,h=(e[jr.getElementIndex(u,u)]-e[jr.getElementIndex(s,s)])/2/e[jr.getElementIndex(u,s)];l=(f=h<0?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)))*(c=1/Math.sqrt(1+f*f))}return _t.IDENTITY.to(t),t[jr.getElementIndex(s,s)]=t[jr.getElementIndex(u,u)]=c,t[jr.getElementIndex(u,s)]=l,t[jr.getElementIndex(s,u)]=-l,t}function Xr(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return qr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qr(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function qr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Wr=new qe,Zr=new qe,Yr=new qe,$r=new qe,en=new qe,tn=new _t,rn={diagonal:new _t,unitary:new _t};r(34);var nn=r(17),an=r.n(nn);r(64),r(65);Math.log2;function on(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var sn=Math.PI,un=sn/4,cn=sn/180;function ln(e){var t=an()(e,2),r=t[0],n=t[1];on(Number.isFinite(r)),on(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=n*cn;return[512*(r*cn+sn)/(2*sn),512*(sn+Math.log(Math.tan(un+.5*i)))/(2*sn)]}Math.PI;function fn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return hn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function hn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var dn=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],pn=dn.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),yn=pn.concat([[.25,.5],[.75,.5]]),vn=function(){function e(t,r,n){h()(this,e),this.x=t,this.y=r,this.z=n}return x()(e,[{key:"children",get:function(){if(!this._children){var t=2*this.x,r=2*this.y,n=this.z+1;this._children=[new e(t,r,n),new e(t,r+1,n),new e(t+1,r,n),new e(t+1,r+1,n)]}return this._children}},{key:"update",value:function(e){var t=e.viewport,r=e.cullingVolume,n=e.elevationBounds,i=e.minZ,a=e.maxZ,o=e.bounds,s=e.offset,u=e.project,c=this.getBoundingVolume(n,s,u);if(o&&!this.insideBounds(o))return!1;if(r.computeVisibility(c)<0)return!1;if(!this.childVisible){var l=this.z;if(l<a&&l>=i){var f=c.distanceTo(t.cameraPosition)*t.scale/t.height;l+=Math.floor(Math.log2(f))}if(l>=a)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var h,d=fn(this.children);try{for(d.s();!(h=d.n()).done;){h.value.update(e)}}catch(e){d.e(e)}finally{d.f()}return!0}},{key:"getSelected",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&e.push(this),this._children){var t,r=fn(this._children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.getSelected(e)}}catch(e){r.e(e)}finally{r.f()}}return e}},{key:"insideBounds",value:function(e){var t=E()(e,4),r=t[0],n=t[1],i=t[2],a=t[3],o=512/Math.pow(2,this.z);return this.x*o<i&&this.y*o<a&&(this.x+1)*o>r&&(this.y+1)*o>n}},{key:"getBoundingVolume",value:function(e,t,r){if(r){var n,i=[],a=fn(this.z<1?yn:this.z<2?pn:dn);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=wn(this.x+o[0],this.y+o[1],this.z);s[2]=e[0],i.push(r(s)),e[0]!==e[1]&&(s[2]=e[1],i.push(r(s)))}}catch(e){a.e(e)}finally{a.f()}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new yr;if(!e||0===e.length)return t.halfAxes=new _t([0,0,0,0,0,0,0,0,0]),t.center=new qe,t;var r,n=e.length,i=new qe(0,0,0),a=Xr(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i.add(o)}}catch(e){a.e(e)}finally{a.f()}var s=1/n;i.multiplyByScalar(s);var u,c=0,l=0,f=0,h=0,d=0,p=0,y=Xr(e);try{for(y.s();!(u=y.n()).done;){var v=u.value,g=Wr.copy(v).subtract(i);c+=g.x*g.x,l+=g.x*g.y,f+=g.x*g.z,h+=g.y*g.y,d+=g.y*g.z,p+=g.z*g.z}}catch(e){y.e(e)}finally{y.f()}c*=s,l*=s,f*=s,h*=s,d*=s,p*=s;var m=tn;m[0]=c,m[1]=l,m[2]=f,m[3]=l,m[4]=h,m[5]=d,m[6]=f,m[7]=d,m[8]=p;var b,A=Hr(m,rn),B=A.unitary,w=t.halfAxes.copy(B),x=w.getColumn(0,Yr),_=w.getColumn(1,$r),C=w.getColumn(2,en),O=-Number.MAX_VALUE,E=-Number.MAX_VALUE,T=-Number.MAX_VALUE,S=Number.MAX_VALUE,k=Number.MAX_VALUE,M=Number.MAX_VALUE,I=Xr(e);try{for(I.s();!(b=I.n()).done;){var P=b.value;Wr.copy(P),O=Math.max(Wr.dot(x),O),E=Math.max(Wr.dot(_),E),T=Math.max(Wr.dot(C),T),S=Math.min(Wr.dot(x),S),k=Math.min(Wr.dot(_),k),M=Math.min(Wr.dot(C),M)}}catch(e){I.e(e)}finally{I.f()}x=x.multiplyByScalar(.5*(S+O)),_=_.multiplyByScalar(.5*(k+E)),C=C.multiplyByScalar(.5*(M+T)),t.center.copy(x).add(_).add(C);var R=Zr.set(O-S,E-k,T-M).multiplyByScalar(.5),D=new _t([R[0],0,0,0,R[1],0,0,0,R[2]]);return t.halfAxes.multiplyRight(D),t}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*t,l=512-(this.y+1)*u;return new Ye([c,l,e[0]],[c+u,l+u,e[1]])}}]),e}();var gn=[-1/0,-1/0,1/0,1/0],mn={type:"url",value:null,validate:function(e,t){return t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))},equals:function(e,t){if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;var r=e.length;if(r!==t.length)return!1;for(var n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function bn(e,t){var r=[t.transformPoint([e[0],e[1]]),t.transformPoint([e[2],e[1]]),t.transformPoint([e[0],e[3]]),t.transformPoint([e[2],e[3]])];return[Math.min.apply(Math,q()(r.map((function(e){return e[0]})))),Math.min.apply(Math,q()(r.map((function(e){return e[1]})))),Math.max.apply(Math,q()(r.map((function(e){return e[0]})))),Math.max.apply(Math,q()(r.map((function(e){return e[1]}))))]}function An(e,t){if(!e||!e.length)return null;Array.isArray(e)&&(e=e[Math.abs(t.x+t.y)%e.length]);var r=t.x,n=t.y,i=t.z;return e.replace("{x}",r).replace("{y}",n).replace("{z}",i).replace("{-y}",Math.pow(2,i)-n-1)}function Bn(e,t){return 512*Math.pow(2,e)/t}function wn(e,t,r){var n=Bn(r,512),i=e/n*360-180,a=Math.PI-2*Math.PI*t/n;return[i,180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)))]}function xn(e,t,r,n){var i=Bn(r,n);return[e/i*512,t/i*512]}function _n(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(e.isGeospatial){var a=wn(t,r,n),o=E()(a,2),s=o[0],u=o[1],c=wn(t+1,r+1,n),l=E()(c,2),f=l[0],h=l[1];return{west:s,north:u,east:f,south:h}}var d=xn(t,r,n,i),p=E()(d,2),y=p[0],v=p[1],g=xn(t+1,r+1,n,i),m=E()(g,2),b=m[0],A=m[1];return{left:y,top:v,right:b,bottom:A}}function Cn(e,t,r,n,i){for(var a=function(e,t,r){return r?bn(e,r).map((function(e){return e*t/512})):e.map((function(e){return e*t/512}))}(function(e,t,r){var n;if(t&&2===t.length){var i=E()(t,2),a=i[0],o=i[1],s=e.getBounds({z:a}),u=e.getBounds({z:o});n=[Math.min(s[0],u[0]),Math.min(s[1],u[1]),Math.max(s[2],u[2]),Math.max(s[3],u[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}(e,null,n),Bn(t,r),i),o=E()(a,4),s=o[0],u=o[1],c=o[2],l=o[3],f=[],h=Math.floor(s);h<c;h++)for(var d=Math.floor(u);d<l;d++)f.push({x:h,y:d,z:t});return f}function On(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.extent,o=e.tileSize,s=void 0===o?512:o,u=e.modelMatrix,c=e.modelMatrixInverse,l=e.zoomOffset,f=void 0===l?0:l,h=t.isGeospatial?Math.round(t.zoom+Math.log2(512/s))+f:Math.ceil(t.zoom)+f;if(Number.isFinite(n)&&h<n){if(!a)return[];h=n}Number.isFinite(r)&&h>r&&(h=r);var d=a;return u&&c&&a&&!t.isGeospatial&&(d=bn(a,u)),t.isGeospatial?function(e,t,r,n){var i=e.resolution?e.projectPosition:null,a=Object.values(e.getFrustumPlanes()).map((function(e){var t=e.normal,r=e.distance;return new mr(t.clone().negate(),r)})),o=new _r(a),s=e.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,c=r&&r[1]*s||0,l=e.pitch<=60?t:0;if(n){var f=n,h=E()(f,4),d=h[0],p=h[1],y=h[2],v=ln([d,h[3]]),g=ln([y,p]);n=[v[0],512-v[1],g[0],512-g[1]]}var m=new vn(0,0,0),b={viewport:e,project:i,cullingVolume:o,elevationBounds:[u,c],minZ:l,maxZ:t,bounds:n,offset:0};if(m.update(b),e.subViewports&&e.subViewports.length>1){for(b.offset=-1;m.update(b)&&!(--b.offset<-3););for(b.offset=1;m.update(b)&&!(++b.offset>3););}return m.getSelected()}(t,h,i,a):Cn(t,h,s,d||gn,c)}function En(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tn(){var e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){var t=process.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var Sn=function(){function e(t,r){h()(this,e),this.name=t,this.type=r,this.sampleSize=1,this.reset()}return x()(e,[{key:"setSampleSize",value:function(e){return this.sampleSize=e,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(e){return this._count+=e,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(e){return this._count-=e,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Tn(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Tn()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}},{key:"_checkSampling",value:function(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}]),e}(),kn=function(){function e(t){var r=t.id,n=t.stats;h()(this,e),this.id=r,this.stats={},this._initializeStats(n),Object.seal(this)}return x()(e,[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach((function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}})),e}},{key:"_initializeStats",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){return e._getOrCreate(t)}))}},{key:"_getOrCreate",value:function(e){if(!e||!e.name)return null;var t=e.name,r=e.type;return this.stats[t]||(this.stats[t]=e instanceof Sn?e:new Sn(t,r)),this.stats[t]}}]),e}();function Mn(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 In(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mn(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pn,Rn={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Dn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h()(this,e),En(this,"props",void 0),En(this,"stats",void 0),En(this,"activeRequestCount",0),En(this,"requestQueue",[]),En(this,"requestMap",new Map),En(this,"deferredUpdate",null),this.props=In(In({},Rn),t),this.stats=new kn({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}return x()(e,[{key:"scheduleRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(e))return this.requestMap.get(e);var r={handle:e,priority:0,getPriority:t},n=new Promise((function(e){return r.resolve=e,r}));return this.requestQueue.push(r),this.requestMap.set(e,n),this._issueNewRequests(),n}},{key:"_issueRequest",value:function(e){var t=this,r=e.handle,n=e.resolve,i=!1,a=function(){i||(i=!0,t.requestMap.delete(r),t.activeRequestCount--,t._issueNewRequests())};return this.activeRequestCount++,n?n({done:a}):Promise.resolve({done:a})}},{key:"_issueNewRequests",value:function(){var e=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return e._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this._updateAllRequests();for(var t=0;t<e;++t){var r=this.requestQueue.shift();r&&this._issueRequest(r)}}}},{key:"_updateAllRequests",value:function(){for(var e=this.requestQueue,t=0;t<e.length;++t){var r=e[t];this._updateRequest(r)||(e.splice(t,1),this.requestMap.delete(r.handle),t--)}e.sort((function(e,t){return e.priority-t.priority}))}},{key:"_updateRequest",value:function(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}]),e}();function Fn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return jn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ln=(Pn={},C()(Pn,"best-available",(function(e){var t,r=Fn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Fn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&!Un(a)&&Nn(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Fn(e);try{for(s.s();!(o=s.n()).done;){var u=o.value;u.isVisible=Boolean(2&u.state)}}catch(e){s.e(e)}finally{s.f()}})),C()(Pn,"no-overlap",(function(e){var t,r=Fn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Fn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&Un(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Fn(Array.from(e).sort((function(e,t){return e.z-t.z})));try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.isVisible=Boolean(2&u.state),u.isVisible||1&u.state){var c,l=Fn(u.children);try{for(l.s();!(c=l.n()).done;){c.value.state=1}}catch(e){l.e(e)}finally{l.f()}}else u.isSelected&&Nn(u)}}catch(e){s.e(e)}finally{s.f()}})),C()(Pn,"never",(function(){})),Pn),Gn=function(){function e(t){var r=this;h()(this,e),this.opts=t,this.onTileLoad=function(e){r.opts.onTileLoad(e),r.opts.maxCacheByteSize&&(r._cacheByteSize+=e.byteLength,r._resizeCache())},this._requestScheduler=new Dn({maxRequests:t.maxRequests,throttleRequests:t.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this.setOptions(t)}return x()(e,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return this._selectedTiles.every((function(e){return e.isLoaded}))}},{key:"setOptions",value:function(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}},{key:"finalize",value:function(){var e,t=Fn(this._cache.values());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.isLoading&&r.abort()}}catch(e){t.e(e)}finally{t.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var e,t=Fn(this._cache.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value,n=this._cache.get(r);this._selectedTiles.includes(n)?n.setNeedsReload():this._cache.delete(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"update",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.zRange,i=r.modelMatrix,a=new Ir(i),o=!a.equals(this._modelMatrix);if(!e.equals(this._viewport)||o){o&&(this._modelMatrixInverse=i&&a.clone().invert(),this._modelMatrix=i&&a),this._viewport=e;var s=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:n,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map((function(e){return t._getTile(e,!0)})),this._dirty&&this._rebuildTree()}var u=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),u&&this._frameNumber++,this._frameNumber}},{key:"getTileIndices",value:function(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.modelMatrix,o=e.modelMatrixInverse,s=this.opts;return On({viewport:t,maxZoom:r,minZoom:n,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:a,modelMatrixInverse:o,zoomOffset:s.zoomOffset})}},{key:"getTileMetadata",value:function(e){var t=e.x,r=e.y,n=e.z,i=this.opts.tileSize;return{bbox:_n(this._viewport,t,r,n,i)}}},{key:"getParentIndex",value:function(e){return e.x=Math.floor(e.x/2),e.y=Math.floor(e.y/2),e.z-=1,e}},{key:"updateTileStates",value:function(){var e,t=this.opts.refinementStrategy||"best-available",r=new Array(this._cache.size),n=0,i=Fn(this._cache.values());try{for(i.s();!(e=i.n()).done;){var a=e.value;r[n++]=a.isVisible,a.isSelected=!1,a.isVisible=!1}}catch(e){i.e(e)}finally{i.f()}var o,s=Fn(this._selectedTiles);try{for(s.s();!(o=s.n()).done;){var u=o.value;u.isSelected=!0,u.isVisible=!0}}catch(e){s.e(e)}finally{s.f()}("function"==typeof t?t:Ln[t])(Array.from(this._cache.values())),n=0;var c,l=Fn(this._cache.values());try{for(l.s();!(c=l.n()).done;){var f=c.value;if(r[n++]!==f.isVisible)return!0}}catch(e){l.e(e)}finally{l.f()}return!1}},{key:"_pruneRequests",value:function(){var e,t=this.opts.maxRequests,r=[],n=0,i=Fn(this._cache.values());try{for(i.s();!(e=i.n()).done;){var a=e.value;a.isLoading&&(n++,a.isSelected||a.isVisible||r.push(a))}}catch(e){i.e(e)}finally{i.f()}for(;t>0&&n>t&&r.length>0;){r.shift().abort(),n--}}},{key:"_rebuildTree",value:function(){var e,t=this._cache,r=Fn(t.values());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.parent=null,n.children.length=0}}catch(e){r.e(e)}finally{r.f()}var i,a=Fn(t.values());try{for(a.s();!(i=a.n()).done;){var o=i.value,s=this._getNearestAncestor(o.x,o.y,o.z);o.parent=s,s&&s.children.push(o)}}catch(e){a.e(e)}finally{a.f()}}},{key:"_resizeCache",value:function(){var e=this._cache,t=this.opts,r=t.maxCacheSize||(t.maxCacheByteSize?1/0:5*this.selectedTiles.length),n=t.maxCacheByteSize||1/0;if(e.size>r||this._cacheByteSize>n){var i,a=Fn(e);try{for(a.s();!(i=a.n()).done;){var o=E()(i.value,2),s=o[0],u=o[1];if(u.isVisible||(this._cacheByteSize-=t.maxCacheByteSize?u.byteLength:0,e.delete(s),this.opts.onTileUnload(u)),e.size<=r&&this._cacheByteSize<=n)break}}catch(e){a.e(e)}finally{a.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((function(e,t){return e.z-t.z})),this._dirty=!1)}},{key:"_getTile",value:function(e,t){var r=e.x,n=e.y,i=e.z,a="".concat(r,",").concat(n,",").concat(i),o=this._cache.get(a),s=!1;return!o&&t?(o=new Q({x:r,y:n,z:i}),Object.assign(o,this.getTileMetadata(o)),s=!0,this._cache.set(a,o),this._dirty=!0):o&&o.needsReload&&(s=!0),s&&o.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),o}},{key:"_getNearestAncestor",value:function(e,t,r){for(var n=this._minZoom,i=void 0===n?0:n,a={x:e,y:t,z:r};a.z>i;){a=this.getParentIndex(a);var o=this._getTile(a);if(o)return o}return null}}]),e}();function Un(e){for(;e;){if(e.isLoaded||e.content)return e.state|=2,!0;e=e.parent}return!1}function Nn(e){var t,r=Fn(e.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.isLoaded||n.content?n.state|=2:Nn(n)}}catch(e){r.e(e)}finally{r.f()}}function Hn(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 Jn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hn(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vn(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var zn={data:[],dataComparator:mn.equals,renderSubLayers:{type:"function",value:function(e){return new b.GeoJsonLayer(e)},compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:function(e){},compare:!1},onTileUnload:{type:"function",value:function(e){},compare:!1},onTileError:{type:"function",value:function(e){return console.error(e)},compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0},Kn=function(e){p()(r,e);var t=Vn(r);function r(){return h()(this,r),t.apply(this,arguments)}return x()(r,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var e;null===(e=this.state.tileset)||void 0===e||e.finalize()}},{key:"isLoaded",get:function(){return this.state.tileset.selectedTiles.every((function(e){return e.isLoaded&&e.layers&&e.layers.every((function(e){return e.isLoaded}))}))}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=e.changeFlags,n=this.state.tileset,i=r.propsOrDataChanged||r.updateTriggersChanged,a=r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData);n?i&&(n.setOptions(this._getTilesetOptions(t)),a?n.reloadAll():this.state.tileset.tiles.forEach((function(e){e.layers=null}))):(n=new Gn(this._getTilesetOptions(t)),this.setState({tileset:n})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(e){var t=e.tileSize,r=e.maxCacheSize,n=e.maxCacheByteSize,i=e.refinementStrategy,a=e.extent;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:t,refinementStrategy:i,extent:a,maxRequests:e.maxRequests,zoomOffset:e.zoomOffset,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var e=this.state.tileset,t=this.props,r=t.zRange,n=t.modelMatrix,i=e.update(this.context.viewport,{zRange:r,modelMatrix:n}),a=e.isLoaded,o=this.state.isLoaded!==a,s=this.state.frameNumber!==i;a&&(o||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=a}},{key:"_onViewportLoad",value:function(){var e=this.state.tileset,t=this.props.onViewportLoad;t&&t(e.selectedTiles)}},{key:"_onTileLoad",value:function(e){this.props.onTileLoad(e),e.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(e,t){this.props.onTileError(e),t.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(e){this.props.onTileUnload(e)}},{key:"getTileData",value:function(e){var t=this.props,r=t.data,n=t.getTileData,i=t.fetch,a=e.signal;return e.url=An(r,e),n?n(e):e.url?i(e.url,{propName:"data",layer:this,signal:a}):null}},{key:"renderSubLayers",value:function(e){return this.props.renderSubLayers(e)}},{key:"getSubLayerPropsByTile",value:function(e){return null}},{key:"getPickingInfo",value:function(e){var t=e.info,r=e.sourceLayer;return t.tile=r.props.tile,t}},{key:"_updateAutoHighlight",value:function(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}},{key:"renderLayers",value:function(){var e=this;return this.state.tileset.tiles.map((function(t){var r=e.getSubLayerPropsByTile(t);if(t.isLoaded||t.content)if(t.layers)r&&t.layers[0]&&Object.keys(r).some((function(e){return t.layers[0].props[e]!==r[e]}))&&(t.layers=t.layers.map((function(e){return e.clone(r)})));else{var n=e.renderSubLayers(Jn(Jn({},e.props),{},{id:"".concat(e.id,"-").concat(t.x,"-").concat(t.y,"-").concat(t.z),data:t.content,_offset:0,tile:t}));t.layers=Object(b._flatten)(n,Boolean).map((function(e){return e.clone(Jn({tile:t},r))}))}else;return t.layers}))}},{key:"filterSubLayer",value:function(e){return e.layer.props.tile.isVisible}}]),r}(b.CompositeLayer);Kn.layerName="TileLayer",Kn.defaultProps=zn;var Qn=r(16),Xn=r.n(Qn);function qn(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 Wn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qn(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Zn(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var Yn=function(e){p()(r,e);var t=Zn(r);function r(){return h()(this,r),t.apply(this,arguments)}return x()(r,[{key:"getShaders",value:function(){var e=Xn()(m()(r.prototype),"getShaders",this).call(this);return e.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nvarying float vTime;\n","fs:#main-start":"if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"if(fadeTrail) {\n color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n"},e}},{key:"initializeState",value:function(e){Xn()(m()(r.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(e){var t=this.props,n=t.fadeTrail,i=t.trailLength,a=t.currentTime;e.uniforms=Wn(Wn({},e.uniforms),{},{fadeTrail:n,trailLength:i,currentTime:a}),Xn()(m()(r.prototype),"draw",this).call(this,e)}}]),r}(b.PathLayer);Yn.layerName="TripsLayer",Yn.defaultProps={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:null}};var $n=r(24);function ei(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ti(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ti(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function ti(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ri(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}function ni(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 ii(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ni(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ni(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ai=ii(ii({},b.PolygonLayer.defaultProps),{},{getHexagons:{type:"accessor",value:function(e){return e.hexagons}}}),oi=function(e){p()(r,e);var t=ri(r);function r(){return h()(this,r),t.apply(this,arguments)}return x()(r,[{key:"updateState",value:function(e){var t=e.props,r=(e.oldProps,e.changeFlags);if(r.dataChanged||r.updateTriggers&&r.updateTriggers.getHexagons){var n,i=t.data,a=t.getHexagons,o=[],s=Object(b.createIterable)(i),u=s.iterable,c=s.objectInfo,l=ei(u);try{for(l.s();!(n=l.n()).done;){var f=n.value;c.index++;var h,d=a(f,c),p=ei(Object($n.h3SetToMultiPolygon)(d,!0));try{for(p.s();!(h=p.n()).done;){var y=h.value;o.push(this.getSubLayerRow({polygon:y},f,c.index))}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}this.setState({polygons:o})}}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,r=e.extruded,n=e.wireframe,i=e.filled,a=e.stroked,o=e.lineWidthScale,s=e.lineWidthMinPixels,u=e.lineWidthMaxPixels,c=e.lineJointRounded,l=e.lineMiterLimit,f=e.lineDashJustified,h=e.material,d=e.getFillColor,p=e.getLineColor,y=e.getLineWidth,v=e.getLineDashArray,g=e.getElevation,m=e.transitions,A=e.updateTriggers;return new(this.getSubLayerClass("cluster-region",b.PolygonLayer))({filled:i,wireframe:n,extruded:r,elevationScale:t,stroked:a,lineWidthScale:o,lineWidthMinPixels:s,lineWidthMaxPixels:u,lineJointRounded:c,lineMiterLimit:l,lineDashJustified:f,material:h,transitions:m,getFillColor:this.getSubLayerAccessor(d),getLineColor:this.getSubLayerAccessor(p),getLineWidth:this.getSubLayerAccessor(y),getLineDashArray:this.getSubLayerAccessor(v),getElevation:this.getSubLayerAccessor(g)},this.getSubLayerProps({id:"cluster-region",updateTriggers:A}),{data:this.state.polygons,getPolygon:function(e){return e.polygon}})}}]),r}(b.CompositeLayer);oi.defaultProps=ai,oi.layerName="H3ClusterLayer";var si=r(9),ui=r.n(si);function ci(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}function li(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 fi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?li(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):li(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hi(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return di(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return di(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function di(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pi(e,t){t=void 0===t?e[0][0]:t;var r,n=hi(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=i[0]-t;a>180?i[0]-=360:a<-180&&(i[0]+=360)}}catch(e){n.e(e)}finally{n.f()}}function yi(e,t,r){var n=Object($n.h3ToGeo)(e),i=E()(n,2),a=i[0],o=i[1],s=t.length;pi(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c<u;c++)t[c][0]=xe(o,t[c][0],r),t[c][1]=xe(a,t[c][1],r)}function vi(e,t,r){var n=e(t,r),i=Object($n.h3ToGeo)(n),a=E()(i,2),o=a[0];return[a[1],o]}function gi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,n=Object($n.h3ToGeoBoundary)(e,!0);if(1!==t?yi(e,n,t):pi(n),r){var i,a=new Float64Array(2*n.length),o=0,s=hi(n);try{for(s.s();!(i=s.n()).done;){var u=i.value;a[o++]=u[0],a[o++]=u[1]}}catch(e){s.e(e)}finally{s.f()}return a}return n}var mi=fi(fi({},b.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(e){return e.hexagon}},extruded:!0});delete mi.getLineDashArray;var bi=function(e){p()(r,e);var t=ci(r);function r(){return h()(this,r),t.apply(this,arguments)}return x()(r,[{key:"shouldUpdateState",value:function(e){var t=e.changeFlags;return this._shouldUseHighPrecision()?t.propsOrDataChanged:t.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=(e.oldProps,e.changeFlags);if(!0!==t.highPrecision&&(r.dataChanged||r.updateTriggers&&r.updateTriggers.getHexagon)){var n=this._calculateH3DataProps(t);this.setState(n)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(e){var t,r=-1,n=!1,i=!1,a=Object(b.createIterable)(e.data),o=a.iterable,s=a.objectInfo,u=hi(o);try{for(u.s();!(t=u.n()).done;){var c=t.value;s.index++;var l=e.getHexagon(c,s),f=Object($n.h3GetResolution)(l);if(r<0){if(r=f,!e.highPrecision)break}else if(r!==f){i=!0;break}if(Object($n.h3IsPentagon)(l)){n=!0;break}}}catch(e){u.e(e)}finally{u.f()}return{resolution:r,edgeLengthKM:r>=0?Object($n.edgeLength)(r,$n.UNITS.km):0,hasMultipleRes:i,hasPentagon:n}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var e=this.state,t=e.resolution,r=e.hasPentagon,n=e.hasMultipleRes;return this.context.viewport.resolution||n||r||t>=0&&t<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,r=t.resolution,n=t.edgeLengthKM,i=t.centerHex;if(!(r<0)){var a=this.props.centerHexagon||Object($n.geoToH3)(e.latitude,e.longitude,r);if(i!==a){if(i){var o=Object($n.h3Distance)(i,a);if(o>=0&&o*n<10)return}var s=e.distanceScales.unitsPerMeter,u=gi(a),c=Object($n.h3ToGeo)(a),l=E()(c,2),f=l[0],h=l[1],d=e.projectFlat([h,f]),p=E()(d,2),y=p[0],v=p[1];u=u.map((function(t){var r=e.projectFlat(t);return[(r[0]-y)/s[0],(r[1]-v)/s[1]]})),this.setState({centerHex:a,vertices:u})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,r=e.material,n=e.coverage,i=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getFillColor,d=e.getElevation,p=e.getLineColor,y=e.getLineWidth,v=e.transitions,g=e.updateTriggers;return{elevationScale:t,extruded:i,coverage:n,wireframe:a,stroked:o,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:r,getElevation:d,getFillColor:h,getLineColor:p,getLineWidth:y,transitions:v,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,r=e.getHexagon,n=e.updateTriggers,i=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",b.PolygonLayer),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===ui()(e)?fi(fi({},e),{},{coverage:t}):{getHexagon:e,coverage:t}}(n.getHexagon,i),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(e,t){return gi(r(e,t),i,!0)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,r=e.getHexagon,n=e.updateTriggers,i=this.getSubLayerClass("hexagon-cell",b.ColumnLayer),a=this._getForwardProps();return a.updateTriggers.getPosition=n.getHexagon,new i(a,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:vi.bind(null,r)})}}]),r}(b.CompositeLayer);bi.defaultProps=mi,bi.layerName="H3HexagonLayer";var Ai=r(31),Bi=r(13),wi=r.n(Bi);function xi(){return!("object"===("undefined"==typeof process?"undefined":ui()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===ui()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===ui()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":ui()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}var _i=xi();function Ci(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var Oi=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";h()(this,e),this.storage=Ci(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return x()(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function Ei(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));var a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var Ti={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function Si(e){return"string"==typeof e?Ti[e.toUpperCase()]||Ti.WHITE:e}function ki(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Mi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mi(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Mi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ii(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=ki(i);try{var o=function(){var n=t.value;"function"==typeof e[n]&&(r.find((function(e){return n===e}))||(e[n]=e[n].bind(e)))};for(a.s();!(t=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}function Pi(e,t){if(!e)throw new Error(t||"Assertion failed")}var Ri={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":ui()(process))&&process},Di=Ri.window||Ri.self||Ri.global,Fi=Ri.process||{};console;function ji(){var e;if(_i&&Di.performance)e=Di.performance.now();else if(Fi.hrtime){var t=Fi.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var Li={debug:_i&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Gi={enabled:!0,level:0};function Ui(){}var Ni={},Hi={once:!0};function Ji(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}var Vi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=t.id;h()(this,e),this.id=r,this.VERSION="8.7.0-alpha.7",this._startTs=ji(),this._deltaTs=ji(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Oi("__probe-".concat(this.id,"__"),Gi),this.userData={},this.timeStamp("".concat(this.id," started")),Ii(this),Object.seal(this)}return x()(e,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((ji()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((ji()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"assert",value:function(e,t){Pi(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Li.warn,arguments,Hi)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Li.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,Li.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Li.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){return this._getLogFunction(e,t,Li.debug||Li.info,arguments,Hi)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Ui,r&&[r],{tag:Ji(t)}):Ui}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,i=e.image,a=e.message,o=void 0===a?"":a,s=e.scale,u=void 0===s?1:s;return this._shouldLog(t||n)?_i?function(e){var t=e.image,r=e.message,n=void 0===r?"":r,i=e.scale,a=void 0===i?1:i;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=Ei(o,n,a);(e=console).log.apply(e,q()(t))},o.src=t,Ui}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,q()(Ei(t,n,a))),Ui}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,q()(Ei(c,n,a)))},c.src=t.toDataURL(),Ui}return Ui}({image:i,message:o,scale:u}):function(e){var t=e.image,n=(e.message,e.scale),i=void 0===n?1:n,a=null;try{a=r(108)}catch(e){}if(a)return function(){return a(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(e){return console.log(e)}))};return Ui}({image:i,message:o,scale:u}):Ui}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(C()({},e,t))}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||Ui)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=Ki({logLevel:e,message:t,opts:r}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||Ui)}},{key:"withGroup",value:function(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=zi(e)}},{key:"_getLogFunction",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(e)){var a;i=Ki({logLevel:e,message:t,args:n,opts:i}),Pi(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=ji();var o=i.tag||i.message;if(i.once){if(Ni[o])return Ui;Ni[o]=ji()}return t=Qi(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(q()(i.args)))}return Ui}}]),e}();function zi(e){if(!e)return 0;var t;switch(ui()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Pi(Number.isFinite(t)&&t>=0),t}function Ki(e){var t=e.logLevel,r=e.message;e.logLevel=zi(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(e.args=n,ui()(t)){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var i=ui()(e.message);return Pi("string"===i||"object"===i),Object.assign(e,e.opts)}function Qi(e,t,r){if("string"==typeof t){var n=r.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),i=t,a=r.color,o=r.background,_i||"string"!=typeof i||(a&&(a=Si(a),i="[".concat(a,"m").concat(i,"[39m")),o&&(a=Si(o),i="[".concat(o+10,"m").concat(i,"[49m"))),t=i}var i,a,o,s;return t}Vi.VERSION="8.7.0-alpha.7";var Xi=new Vi({id:"luma.gl"});function qi(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function Wi(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version)))}function Zi(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function Yi(e){return qi(Wi(e),"Invalid WebGLRenderingContext"),e}function $i(e){return qi(Zi(e),"Requires WebGL2"),e}var ea=r(15),ta={};function ra(e,t){var r;ta[e]=!0,void 0!==t&&(r=t,ea.global.console&&ea.global.console.error&&ea.global.console.error(r))}var na=function e(t){var r=t.gl;this.ext=t,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(t.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new e.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};(na.VertexAttrib=function(e){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var ia,aa=function(e){var t=this;this.gl=e,function(e){var t=e.getError;e.getError=function(){var r;do{0!==(r=t.apply(e))&&(ta[r]=!0)}while(0!==r);for(r in ta)if(ta[r])return delete ta[r],parseInt(r,10);return 0}}(e);var r=this.original={getParameter:e.getParameter,enableVertexAttribArray:e.enableVertexAttribArray,disableVertexAttribArray:e.disableVertexAttribArray,bindBuffer:e.bindBuffer,getVertexAttrib:e.getVertexAttrib,vertexAttribPointer:e.vertexAttribPointer};e.getParameter=function(e){return e===t.VERTEX_ARRAY_BINDING_OES?t.currentVertexArrayObject===t.defaultVertexArrayObject?null:t.currentVertexArrayObject:r.getParameter.apply(this,arguments)},e.enableVertexAttribArray=function(e){var n=t.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,e);var i=n.attribs[e];return i.enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},e.disableVertexAttribArray=function(e){var n=t.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,e);var i=n.attribs[e];return i.enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},e.bindBuffer=function(e,n){switch(e){case 34962:t.currentArrayBuffer=n;break;case 34963:t.currentVertexArrayObject.elementArrayBuffer=n}return r.bindBuffer.apply(this,arguments)},e.getVertexAttrib=function(e,n){var i=t.currentVertexArrayObject,a=i.attribs[e];switch(n){case 34975:return a.buffer;case 34338:return a.enabled;case 34339:return a.size;case 34340:return a.stride;case 34341:return a.type;case 34922:return a.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},e.vertexAttribPointer=function(e,n,i,a,o,s){var u=t.currentVertexArrayObject;u.maxAttrib=Math.max(u.maxAttrib,e);var c=u.attribs[e];return c.buffer=t.currentArrayBuffer,c.size=n,c.type=i,c.normalized=a,c.stride=o,c.offset=s,c.recache(),r.vertexAttribPointer.apply(this,arguments)},e.instrumentExtension&&e.instrumentExtension(this,"OES_vertex_array_object"),e.canvas&&e.canvas.addEventListener("webglcontextrestored",(function(){var e;e="OESVertexArrayObject emulation library context restored",ea.global.console&&ea.global.console.log&&ea.global.console.log(e),t.reset_()}),!0),this.reset_()};aa.prototype.VERTEX_ARRAY_BINDING_OES=34229,aa.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var e=0;e<this.vertexArrayObjects.length;++e)this.vertexArrayObjects.isAlive=!1;var t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new na(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},aa.prototype.createVertexArrayOES=function(){var e=new na(this);return this.vertexArrayObjects.push(e),e},aa.prototype.deleteVertexArrayOES=function(e){e.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(e),1),this.currentVertexArrayObject===e&&this.bindVertexArrayOES(null)},aa.prototype.isVertexArrayOES=function(e){return!!(e&&e instanceof na&&e.hasBeenBound&&e.ext===this)},aa.prototype.bindVertexArrayOES=function(e){var t=this.gl;if(!e||e.isAlive){var r=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=e||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(n!==i){n&&i.elementArrayBuffer===n.elementArrayBuffer||r.bindBuffer.call(t,34963,i.elementArrayBuffer);for(var a=this.currentArrayBuffer,o=Math.max(n?n.maxAttrib:0,i.maxAttrib),s=0;s<=o;s++){var u=i.attribs[s],c=n?n.attribs[s]:null;if(n&&u.enabled===c.enabled||(u.enabled?r.enableVertexAttribArray.call(t,s):r.disableVertexAttribArray.call(t,s)),u.enabled){var l=!1;n&&u.buffer===c.buffer||(a!==u.buffer&&(r.bindBuffer.call(t,34962,u.buffer),a=u.buffer),l=!0),(l||u.cached!==c.cached)&&r.vertexAttribPointer.call(t,s,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==a&&r.bindBuffer.call(t,34962,this.currentArrayBuffer)}}else ra(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var oa,sa=function(e){return Zi(e)?void 0:0},ua=(ia={},C()(ia,3074,(function(e){return Zi(e)?void 0:36064})),C()(ia,35723,(function(e){return Zi(e)?void 0:4352})),C()(ia,35977,sa),C()(ia,32937,sa),C()(ia,36795,(function(e,t){var r=Zi(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0})),C()(ia,37445,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),C()(ia,37446,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),C()(ia,34047,(function(e,t){var r=e.luma.extensions.EXT_texture_filter_anisotropic;return r?t(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),C()(ia,32883,sa),C()(ia,35071,sa),C()(ia,37447,sa),C()(ia,36063,(function(e,t){if(!Zi(e)){var r=e.getExtension("WEBGL_draw_buffers");return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),C()(ia,35379,sa),C()(ia,35374,sa),C()(ia,35377,sa),C()(ia,34852,(function(e){if(!Zi(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}})),C()(ia,36203,(function(e){return e.getExtension("OES_element_index")?2147483647:65535})),C()(ia,33001,(function(e){return e.getExtension("OES_element_index")?16777216:65535})),C()(ia,33e3,(function(e){return 16777216})),C()(ia,37157,sa),C()(ia,35373,sa),C()(ia,35657,sa),C()(ia,36183,sa),C()(ia,37137,sa),C()(ia,34045,sa),C()(ia,35978,sa),C()(ia,35979,sa),C()(ia,35968,sa),C()(ia,35376,sa),C()(ia,35375,sa),C()(ia,35659,sa),C()(ia,37154,sa),C()(ia,35371,sa),C()(ia,35658,sa),C()(ia,35076,sa),C()(ia,35077,sa),C()(ia,35380,sa),ia);var ca,la,fa,ha=(oa={},C()(oa,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){qi(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),C()(oa,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){qi(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),C()(oa,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){qi(!1)}}),C()(oa,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){qi(!1)},deleteQuery:function(){qi(!1)},beginQuery:function(){qi(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),oa),da={readBuffer:function(e,t,r){Zi(e)&&t(r)},getVertexAttrib:function(e,t,r,n){var i,a=function(e,t){return{webgl2:Zi(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(n){case 35069:i=!!o&&void 0;break;case 35070:i=o||s?void 0:0}return void 0!==i?i:t(r,n)},getProgramParameter:function(e,t,r,n){if(!Zi(e))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return t(r,n)},getInternalformatParameter:function(e,t,r,n,i){if(!Zi(e))switch(i){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(r,n,i)},getTexParameter:function(e,t,r,n){switch(n){case 34046:var i=e.luma.extensions.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(r,n)},getParameter:function(e,t,r){var n=ua[r],i="function"==typeof n?n(e,t,r):n;return void 0!==i?i:t(r)},hint:function(e,t,r,n){return t(r,n)}};function pa(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ya(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ya(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function ya(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function va(e,t){var r=t.extension,n=t.target,i=t.target2,a=ha[r];qi(a);for(var o=a.meta,s=(void 0===o?{}:o).suffix,u=void 0===s?"":s,c=e.getExtension(r),l=function(){var t=h[f],r="".concat(t).concat(u),o=null;"meta"===t||"function"==typeof e[t]||(c&&"function"==typeof c[r]?o=function(){return c[r].apply(c,arguments)}:"function"==typeof a[t]&&(o=a[t].bind(n))),o&&(n[t]=o,i[t]=o)},f=0,h=Object.keys(a);f<h.length;f++)l()}("undefined"!=typeof global?global:window).polyfillContext=function(e){e.luma=e.luma||{};var t=e.luma;return t.polyfilled||(!function(e){if("function"!=typeof e.createVertexArray){var t=e.getSupportedExtensions;e.getSupportedExtensions=function(){var e=t.call(this)||[];return e.indexOf("OES_vertex_array_object")<0&&e.push("OES_vertex_array_object"),e};var r=e.getExtension;e.getExtension=function(t){var n=r.call(this,t);return n||("OES_vertex_array_object"!==t?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new aa(this)),this.__OESVertexArrayObject))}}}(e),function(e){e.luma.extensions={};var t,r=pa(e.getSupportedExtensions()||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.luma[n]=e.getExtension(n)}}catch(e){r.e(e)}finally{r.f()}}(e),function(e,t){var r,n=pa(Object.getOwnPropertyNames(t));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&va(e,{extension:i,target:e.luma,target2:e})}}catch(e){n.e(e)}finally{n.f()}}(e,ha),function(e,t){var r=t.target,n=t.target2;Object.keys(da).forEach((function(t){if("function"==typeof da[t]){var i=e[t]?e[t].bind(e):function(){},a=da[t].bind(null,e,i);r[t]=a,n[t]=a}}))}(e,{target:t,target2:e}),t.polyfilled=!0),e};var ga=(ca={},C()(ca,3042,!1),C()(ca,32773,new Float32Array([0,0,0,0])),C()(ca,32777,32774),C()(ca,34877,32774),C()(ca,32969,1),C()(ca,32968,0),C()(ca,32971,1),C()(ca,32970,0),C()(ca,3106,new Float32Array([0,0,0,0])),C()(ca,3107,[!0,!0,!0,!0]),C()(ca,2884,!1),C()(ca,2885,1029),C()(ca,2929,!1),C()(ca,2931,1),C()(ca,2932,513),C()(ca,2928,new Float32Array([0,1])),C()(ca,2930,!0),C()(ca,3024,!0),C()(ca,36006,null),C()(ca,2886,2305),C()(ca,33170,4352),C()(ca,2849,1),C()(ca,32823,!1),C()(ca,32824,0),C()(ca,10752,0),C()(ca,32938,1),C()(ca,32939,!1),C()(ca,3089,!1),C()(ca,3088,new Int32Array([0,0,1024,1024])),C()(ca,2960,!1),C()(ca,2961,0),C()(ca,2968,4294967295),C()(ca,36005,4294967295),C()(ca,2962,519),C()(ca,2967,0),C()(ca,2963,4294967295),C()(ca,34816,519),C()(ca,36003,0),C()(ca,36004,4294967295),C()(ca,2964,7680),C()(ca,2965,7680),C()(ca,2966,7680),C()(ca,34817,7680),C()(ca,34818,7680),C()(ca,34819,7680),C()(ca,2978,[0,0,1024,1024]),C()(ca,3333,4),C()(ca,3317,4),C()(ca,37440,!1),C()(ca,37441,!1),C()(ca,37443,37444),C()(ca,35723,4352),C()(ca,36010,null),C()(ca,35977,!1),C()(ca,3330,0),C()(ca,3332,0),C()(ca,3331,0),C()(ca,3314,0),C()(ca,32878,0),C()(ca,3316,0),C()(ca,3315,0),C()(ca,32877,0),ca),ma=function(e,t,r){return t?e.enable(r):e.disable(r)},ba=function(e,t,r){return e.hint(r,t)},Aa=function(e,t,r){return e.pixelStorei(r,t)};function Ba(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var wa=(la={},C()(la,3042,ma),C()(la,32773,(function(e,t){return e.blendColor.apply(e,q()(t))})),C()(la,32777,"blendEquation"),C()(la,34877,"blendEquation"),C()(la,32969,"blendFunc"),C()(la,32968,"blendFunc"),C()(la,32971,"blendFunc"),C()(la,32970,"blendFunc"),C()(la,3106,(function(e,t){return e.clearColor.apply(e,q()(t))})),C()(la,3107,(function(e,t){return e.colorMask.apply(e,q()(t))})),C()(la,2884,ma),C()(la,2885,(function(e,t){return e.cullFace(t)})),C()(la,2929,ma),C()(la,2931,(function(e,t){return e.clearDepth(t)})),C()(la,2932,(function(e,t){return e.depthFunc(t)})),C()(la,2928,(function(e,t){return e.depthRange.apply(e,q()(t))})),C()(la,2930,(function(e,t){return e.depthMask(t)})),C()(la,3024,ma),C()(la,35723,ba),C()(la,36006,(function(e,t){var r=Zi(e)?36009:36160;return e.bindFramebuffer(r,t)})),C()(la,2886,(function(e,t){return e.frontFace(t)})),C()(la,33170,ba),C()(la,2849,(function(e,t){return e.lineWidth(t)})),C()(la,32823,ma),C()(la,32824,"polygonOffset"),C()(la,10752,"polygonOffset"),C()(la,35977,ma),C()(la,32938,"sampleCoverage"),C()(la,32939,"sampleCoverage"),C()(la,3089,ma),C()(la,3088,(function(e,t){return e.scissor.apply(e,q()(t))})),C()(la,2960,ma),C()(la,2961,(function(e,t){return e.clearStencil(t)})),C()(la,2968,(function(e,t){return e.stencilMaskSeparate(1028,t)})),C()(la,36005,(function(e,t){return e.stencilMaskSeparate(1029,t)})),C()(la,2962,"stencilFuncFront"),C()(la,2967,"stencilFuncFront"),C()(la,2963,"stencilFuncFront"),C()(la,34816,"stencilFuncBack"),C()(la,36003,"stencilFuncBack"),C()(la,36004,"stencilFuncBack"),C()(la,2964,"stencilOpFront"),C()(la,2965,"stencilOpFront"),C()(la,2966,"stencilOpFront"),C()(la,34817,"stencilOpBack"),C()(la,34818,"stencilOpBack"),C()(la,34819,"stencilOpBack"),C()(la,2978,(function(e,t){return e.viewport.apply(e,q()(t))})),C()(la,3333,Aa),C()(la,3317,Aa),C()(la,37440,Aa),C()(la,37441,Aa),C()(la,37443,Aa),C()(la,3330,Aa),C()(la,3332,Aa),C()(la,3331,Aa),C()(la,36010,(function(e,t){return e.bindFramebuffer(36008,t)})),C()(la,3314,Aa),C()(la,32878,Aa),C()(la,3316,Aa),C()(la,3315,Aa),C()(la,32877,Aa),C()(la,"framebuffer",(function(e,t){var r=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,r)})),C()(la,"blend",(function(e,t){return t?e.enable(3042):e.disable(3042)})),C()(la,"blendColor",(function(e,t){return e.blendColor.apply(e,q()(t))})),C()(la,"blendEquation",(function(e,t){t=Ba(t)?t:[t,t],e.blendEquationSeparate.apply(e,q()(t))})),C()(la,"blendFunc",(function(e,t){t=Ba(t)&&2===t.length?[].concat(q()(t),q()(t)):t,e.blendFuncSeparate.apply(e,q()(t))})),C()(la,"clearColor",(function(e,t){return e.clearColor.apply(e,q()(t))})),C()(la,"clearDepth",(function(e,t){return e.clearDepth(t)})),C()(la,"clearStencil",(function(e,t){return e.clearStencil(t)})),C()(la,"colorMask",(function(e,t){return e.colorMask.apply(e,q()(t))})),C()(la,"cull",(function(e,t){return t?e.enable(2884):e.disable(2884)})),C()(la,"cullFace",(function(e,t){return e.cullFace(t)})),C()(la,"depthTest",(function(e,t){return t?e.enable(2929):e.disable(2929)})),C()(la,"depthFunc",(function(e,t){return e.depthFunc(t)})),C()(la,"depthMask",(function(e,t){return e.depthMask(t)})),C()(la,"depthRange",(function(e,t){return e.depthRange.apply(e,q()(t))})),C()(la,"dither",(function(e,t){return t?e.enable(3024):e.disable(3024)})),C()(la,"derivativeHint",(function(e,t){e.hint(35723,t)})),C()(la,"frontFace",(function(e,t){return e.frontFace(t)})),C()(la,"mipmapHint",(function(e,t){return e.hint(33170,t)})),C()(la,"lineWidth",(function(e,t){return e.lineWidth(t)})),C()(la,"polygonOffsetFill",(function(e,t){return t?e.enable(32823):e.disable(32823)})),C()(la,"polygonOffset",(function(e,t){return e.polygonOffset.apply(e,q()(t))})),C()(la,"sampleCoverage",(function(e,t){return e.sampleCoverage.apply(e,q()(t))})),C()(la,"scissorTest",(function(e,t){return t?e.enable(3089):e.disable(3089)})),C()(la,"scissor",(function(e,t){return e.scissor.apply(e,q()(t))})),C()(la,"stencilTest",(function(e,t){return t?e.enable(2960):e.disable(2960)})),C()(la,"stencilMask",(function(e,t){var r=t=Ba(t)?t:[t,t],n=E()(r,2),i=n[0],a=n[1];e.stencilMaskSeparate(1028,i),e.stencilMaskSeparate(1029,a)})),C()(la,"stencilFunc",(function(e,t){var r=t=Ba(t)&&3===t.length?[].concat(q()(t),q()(t)):t,n=E()(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5];e.stencilFuncSeparate(1028,i,a,o),e.stencilFuncSeparate(1029,s,u,c)})),C()(la,"stencilOp",(function(e,t){var r=t=Ba(t)&&3===t.length?[].concat(q()(t),q()(t)):t,n=E()(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5];e.stencilOpSeparate(1028,i,a,o),e.stencilOpSeparate(1029,s,u,c)})),C()(la,"viewport",(function(e,t){return e.viewport.apply(e,q()(t))})),la);function xa(e,t,r){return void 0!==t[e]?t[e]:r[e]}var _a={blendEquation:function(e,t,r){return e.blendEquationSeparate(xa(32777,t,r),xa(34877,t,r))},blendFunc:function(e,t,r){return e.blendFuncSeparate(xa(32969,t,r),xa(32968,t,r),xa(32971,t,r),xa(32970,t,r))},polygonOffset:function(e,t,r){return e.polygonOffset(xa(32824,t,r),xa(10752,t,r))},sampleCoverage:function(e,t,r){return e.sampleCoverage(xa(32938,t,r),xa(32939,t,r))},stencilFuncFront:function(e,t,r){return e.stencilFuncSeparate(1028,xa(2962,t,r),xa(2967,t,r),xa(2963,t,r))},stencilFuncBack:function(e,t,r){return e.stencilFuncSeparate(1029,xa(34816,t,r),xa(36003,t,r),xa(36004,t,r))},stencilOpFront:function(e,t,r){return e.stencilOpSeparate(1028,xa(2964,t,r),xa(2965,t,r),xa(2966,t,r))},stencilOpBack:function(e,t,r){return e.stencilOpSeparate(1029,xa(34817,t,r),xa(34818,t,r),xa(34819,t,r))}},Ca={enable:function(e,t){return e(C()({},t,!0))},disable:function(e,t){return e(C()({},t,!1))},pixelStorei:function(e,t,r){return e(C()({},t,r))},hint:function(e,t,r){return e(C()({},t,r))},bindFramebuffer:function(e,t,r){var n;switch(t){case 36160:return e((n={},C()(n,36006,r),C()(n,36010,r),n));case 36009:return e(C()({},36006,r));case 36008:return e(C()({},36010,r));default:return null}},blendColor:function(e,t,r,n,i){return e(C()({},32773,new Float32Array([t,r,n,i])))},blendEquation:function(e,t){var r;return e((r={},C()(r,32777,t),C()(r,34877,t),r))},blendEquationSeparate:function(e,t,r){var n;return e((n={},C()(n,32777,t),C()(n,34877,r),n))},blendFunc:function(e,t,r){var n;return e((n={},C()(n,32969,t),C()(n,32968,r),C()(n,32971,t),C()(n,32970,r),n))},blendFuncSeparate:function(e,t,r,n,i){var a;return e((a={},C()(a,32969,t),C()(a,32968,r),C()(a,32971,n),C()(a,32970,i),a))},clearColor:function(e,t,r,n,i){return e(C()({},3106,new Float32Array([t,r,n,i])))},clearDepth:function(e,t){return e(C()({},2931,t))},clearStencil:function(e,t){return e(C()({},2961,t))},colorMask:function(e,t,r,n,i){return e(C()({},3107,[t,r,n,i]))},cullFace:function(e,t){return e(C()({},2885,t))},depthFunc:function(e,t){return e(C()({},2932,t))},depthRange:function(e,t,r){return e(C()({},2928,new Float32Array([t,r])))},depthMask:function(e,t){return e(C()({},2930,t))},frontFace:function(e,t){return e(C()({},2886,t))},lineWidth:function(e,t){return e(C()({},2849,t))},polygonOffset:function(e,t,r){var n;return e((n={},C()(n,32824,t),C()(n,10752,r),n))},sampleCoverage:function(e,t,r){var n;return e((n={},C()(n,32938,t),C()(n,32939,r),n))},scissor:function(e,t,r,n,i){return e(C()({},3088,new Int32Array([t,r,n,i])))},stencilMask:function(e,t){var r;return e((r={},C()(r,2968,t),C()(r,36005,t),r))},stencilMaskSeparate:function(e,t,r){return e(C()({},1028===t?2968:36005,r))},stencilFunc:function(e,t,r,n){var i;return e((i={},C()(i,2962,t),C()(i,2967,r),C()(i,2963,n),C()(i,34816,t),C()(i,36003,r),C()(i,36004,n),i))},stencilFuncSeparate:function(e,t,r,n,i){var a;return e((a={},C()(a,1028===t?2962:34816,r),C()(a,1028===t?2967:36003,n),C()(a,1028===t?2963:36004,i),a))},stencilOp:function(e,t,r,n){var i;return e((i={},C()(i,2964,t),C()(i,2965,r),C()(i,2966,n),C()(i,34817,t),C()(i,34818,r),C()(i,34819,n),i))},stencilOpSeparate:function(e,t,r,n,i){var a;return e((a={},C()(a,1028===t?2964:34817,r),C()(a,1028===t?2965:34818,n),C()(a,1028===t?2966:34819,i),a))},viewport:function(e,t,r,n,i){return e(C()({},2978,[t,r,n,i]))}},Oa=function(e,t){return e.isEnabled(t)},Ea=(fa={},C()(fa,3042,Oa),C()(fa,2884,Oa),C()(fa,2929,Oa),C()(fa,3024,Oa),C()(fa,32823,Oa),C()(fa,32926,Oa),C()(fa,32928,Oa),C()(fa,3089,Oa),C()(fa,2960,Oa),C()(fa,35977,Oa),fa);function Ta(e){for(var t in e)return!1;return!0}function Sa(e,t){if(e===t)return!0;var r=Array.isArray(e)||ArrayBuffer.isView(e),n=Array.isArray(t)||ArrayBuffer.isView(t);if(r&&n&&e.length===t.length){for(var i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}return!1}function ka(e,t){var r=e[t].bind(e);e[t]=function(){var t=arguments.length<=0?void 0:arguments[0];return t in e.state.cache&&e.state.enable?e.state.cache[t]:r.apply(void 0,arguments)},Object.defineProperty(e[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function Ma(e,t,r){var n=e[t].bind(e);e[t]=function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];var o=r.apply(void 0,[e.state._updateCache].concat(i)),s=o.valueChanged,u=o.oldValue;return s&&n.apply(void 0,i),u},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}function Ia(e){var t=e.useProgram.bind(e);e.useProgram=function(r){e.state.program!==r&&(t(r),e.state.program=r)}}var Pa=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.copyState,i=void 0!==n&&n,a=r.log,o=void 0===a?function(){}:a;h()(this,e),this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=i?Ga(t):Object.assign({},ga),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return x()(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){qi(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];La(this.gl,e),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,r=!1,n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in e){qi(void 0!==i);var a=e[i],o=this.cache[i];Sa(a,o)||(r=!0,t=o,!n||i in n||(n[i]=o),this.cache[i]=a)}return{valueChanged:r,oldValue:t}}}]),e}();function Ra(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.enable,n=void 0===r||r,i=t.copyState;if(qi(void 0!==i),!e.state){var a="undefined"!=typeof global?global:window,o=a.polyfillContext;for(var s in o&&o(e),e.state=new Pa(e,{copyState:i}),Ia(e),Ca){var u=Ca[s];Ma(e,s,u)}ka(e,"getParameter"),ka(e,"isEnabled")}return e.state.enable=n,e}function Da(e){qi(e.state),e.state.pop()}function Fa(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ja(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ja(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function ja(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function La(e,t){if(qi(Wi(e),"setParameters requires a WebGL context"),!Ta(t)){var r={};for(var n in t){var i=Number(n),a=wa[n];a&&("string"==typeof a?r[a]=!0:a(e,t[n],i))}var o=e.state&&e.state.cache;if(o)for(var s in r){(0,_a[s])(e,t,o)}}}function Ga(e,t){if("number"==typeof(t=t||ga)){var r=t,n=Ea[r];return n?n(e,r):e.getParameter(r)}var i,a={},o=Fa(Array.isArray(t)?t:Object.keys(t));try{for(o.s();!(i=o.n()).done;){var s=i.value,u=Ea[s];a[s]=u?u(e,Number(s)):e.getParameter(Number(s))}}catch(e){o.e(e)}finally{o.f()}return a}function Ua(e,t,r){if(Ta(t))return r(e);var n,i=t.nocatch,a=void 0===i||i;if(function(e){e.state||Ra(e,{copyState:!1}),e.state.push()}(e),La(e,t),a)n=r(e),Da(e);else try{n=r(e)}finally{Da(e)}return n}var Na=Object(ea.isBrowser)();var Ha=new(function(){function e(){h()(this,e),this.stats=new Map}return x()(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new kn({id:e})),this.stats.get(e)}}]),e}());if(ea.global.luma&&"8.5.10"!==ea.global.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(ea.global.luma.VERSION," vs ").concat("8.5.10"));ea.global.luma||(Object(ea.isBrowser)()&&Xi.log(1,"luma.gl ".concat("8.5.10"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),ea.global.luma=ea.global.luma||{VERSION:"8.5.10",version:"8.5.10",log:Xi,stats:Ha,globals:{modules:{},nodeIO:{}}});ea.global.luma;function Ja(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function Va(e,t){if("string"!=typeof t)return t;var r=Number(t);if(!isNaN(r))return r;var n=e[t=t.replace(/^.*\./,"")];return Ja(void 0!==n,"Accessing undefined constant GL.".concat(t)),n}function za(e,t){for(var r in t=Number(t),e)if(e[r]===t)return"GL.".concat(r);return String(t)}var Ka={};function Qa(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";Ka[e]=Ka[e]||1;var t=Ka[e]++;return"".concat(e,"-").concat(t)}function Xa(e){return Ja("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function qa(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Wa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wa(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Wa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Za="Resource subclass must define virtual methods",Ya=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h()(this,e),Yi(t);var n=r.id,i=r.userData,a=void 0===i?{}:i;this.gl=t,this.gl2=t,this.id=n||Qa(this.constructor.name),this.userData=a,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return x()(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"handle",get:function(){return this._handle}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.deleteChildren,r=void 0!==t&&t,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&r&&n.filter(Boolean).forEach((function(e){return e.delete()})),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ja(e=Va(this.gl,e));var r=this.constructor.PARAMETERS||{},n=r[e];if(n){var i=Zi(this.gl),a=(!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension));if(!a){var o=n.webgl1,s="webgl2"in n?n.webgl2:n.webgl1,u=i?s:o;return u}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.parameters,n=t.keys,i=this.constructor.PARAMETERS||{},a=Zi(this.gl),o={},s=r||Object.keys(i),u=qa(s);try{for(u.s();!(e=u.n()).done;){var c=e.value,l=i[c],f=l&&(!("webgl2"in l)||a)&&(!("extension"in l)||this.gl.getExtension(l.extension));if(f){var h=n?za(this.gl,c):c;o[h]=this.getParameter(c,t),n&&"GLenum"===l.type&&(o[h]=za(this.gl,o[h]))}}}catch(e){u.e(e)}finally{u.f()}return o}},{key:"setParameter",value:function(e,t){Ja(e=Va(this.gl,e));var r=(this.constructor.PARAMETERS||{})[e];if(r){var n=Zi(this.gl);if(!((!("webgl2"in r)||n)&&(!("extension"in r)||this.gl.getExtension(r.extension))))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=Va(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,r){return function(e,t,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(e);n.forEach((function(e){a.methodName||(a[e]=function(){throw Xi.removed("Calling removed method ".concat(t,".").concat(e,": "),i)(),new Error(e)})}))}(this,e,t,r)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(Za)}},{key:"_deleteHandle",value:function(){throw new Error(Za)}},{key:"_bindHandle",value:function(e){throw new Error(Za)}},{key:"_getOptsFromHandle",value:function(){throw new Error(Za)}},{key:"_getParameter",value:function(e,t){throw new Error(Za)}},{key:"_setParameter",value:function(e,t){throw new Error(Za)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=Ha.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;Ha.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,r=Ha.get("Memory Usage");r.get("GPU Memory").addCount(e),r.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=Ha.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),e}(),$a=r(69),eo=r.n($a);function to(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function ro(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.clamped,n=void 0===r||r;switch(e){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function no(e){var t=e.data,r=e.width,n=e.height,i=e.bytesPerPixel,a=void 0===i?4:i,o=e.temp,s=r*a;o=o||new Uint8Array(s);for(var u=0;u<n/2;++u){var c=u*s,l=(n-u-1)*s;o.set(t.subarray(c,c+s)),t.copyWithin(c,l,l+s),t.set(o,l)}}function io(e){for(var t=e.data,r=e.width,n=e.height,i=Math.round(r/2),a=Math.round(n/2),o=new Uint8Array(i*a*4),s=0;s<a;s++)for(var u=0;u<i;u++)for(var c=0;c<4;c++)o[4*(s*i+u)+c]=t[4*(2*s*r+2*u)+c];return{data:o,width:i,height:a}}function ao(e,t,r){var n=r.removedProps,i=void 0===n?{}:n,a=r.deprecatedProps,o=void 0===a?{}:a,s=r.replacedProps,u=void 0===s?{}:s;for(var c in i)if(c in t){var l=i[c]?"".concat(e,".").concat(i[c]):"N/A";Xi.removed("".concat(e,".").concat(c),l)()}for(var f in o)if(f in t){var h=o[f];Xi.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(h))()}var d=null;for(var p in u)if(p in t){var y=u[p];Xi.deprecated("".concat(e,".").concat(p),"".concat(e,".").concat(y))(),(d=d||Object.assign({},t))[y]=t[p],delete d[p]}return d||t}var oo={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},so={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},uo=function(){function e(){var t=this;h()(this,e);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];n.forEach((function(e){return t._assign(e)})),Object.freeze(this)}return x()(e,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}},{key:"_assign",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=ao("Accessor",e,so)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof e.index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}],[{key:"getBytesPerElement",value:function(e){return ro(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return Ja(e.size),ro(e.type||5126).BYTES_PER_ELEMENT*e.size}},{key:"resolve",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return eo()(e,[oo].concat(r))}}]),e}();function co(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var lo,fo,ho,po={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},yo={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:po},vo={removedProps:po},go=function(e){p()(r,e);var t=co(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,r),(n=t.call(this,e,i)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=i.target||(n.gl.webgl2?36662:34962),n.initialize(i),Object.seal(wi()(n)),n}return x()(r,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/uo.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/uo.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=ao("Buffer",e,yo),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=ao("Buffer",e,vo))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new uo(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,r=t.data,n=t.offset,i=void 0===n?0:n,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Ja(r);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?($i(this.gl),this.gl.bufferSubData(this.target,i,r,o,s)):this.gl.bufferSubData(u,i,r),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(r),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,r=e.readOffset,n=void 0===r?0:r,i=e.writeOffset,a=void 0===i?0:i,o=e.size,s=this.gl;return $i(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,n,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,r=void 0===t?null:t,n=e.srcByteOffset,i=void 0===n?0:n,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;$i(this.gl);var c,l,f=ro(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(i),d=o;r?c=(l=r.length)-d:l=d+(c=Math.min(h,u||h));var p=Math.min(h,c);return Ja((u=u||p)<=p),r=r||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,r,o,u),this.gl.bindBuffer(36662,null),r}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?this.target:t,n=e.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===r||35982===r?void 0!==s?this.gl.bindBufferRange(r,i,this.handle,o,s):(Ja(0===o),this.gl.bindBufferBase(r,i,this.handle)):this.gl.bindBuffer(r,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?this.target:t,n=e.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=35345===r||35982===r;return a?this.gl.bindBufferBase(r,i,null):this.gl.bindBuffer(r,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.byteLength+t;Ja(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.usage),this.gl.bufferSubData(n,t,e),this.gl.bindBuffer(n,null),this.debugData=e.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);var i=to(e);return Ja(i),this.setAccessor(new uo(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Ja(e>=0),this._trackDeallocatedMemory();var r=e;0===e&&(r=new Float32Array(0));var n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/ro(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new uo(this.accessor,{type:to(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"type",get:function(){return Xi.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return Xi.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(e){return Xi.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return Xi.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new uo(this.accessor,e),this}}]),r}(Ya),mo=(lo={},C()(lo,6407,{dataFormat:6407,types:[5121,33635]}),C()(lo,6408,{dataFormat:6408,types:[5121,32819,32820]}),C()(lo,6406,{dataFormat:6406,types:[5121]}),C()(lo,6409,{dataFormat:6409,types:[5121]}),C()(lo,6410,{dataFormat:6410,types:[5121]}),C()(lo,33326,{dataFormat:6403,types:[5126],gl2:!0}),C()(lo,33328,{dataFormat:33319,types:[5126],gl2:!0}),C()(lo,34837,{dataFormat:6407,types:[5126],gl2:!0}),C()(lo,34836,{dataFormat:6408,types:[5126],gl2:!0}),lo),bo=(fo={},C()(fo,6403,1),C()(fo,36244,1),C()(fo,33319,2),C()(fo,33320,2),C()(fo,6407,3),C()(fo,36248,3),C()(fo,6408,4),C()(fo,36249,4),C()(fo,6402,1),C()(fo,34041,1),C()(fo,6406,1),C()(fo,6409,1),C()(fo,6410,2),fo),Ao=(ho={},C()(ho,5126,4),C()(ho,5125,4),C()(ho,5124,4),C()(ho,5123,2),C()(ho,5122,2),C()(ho,5131,2),C()(ho,5120,1),C()(ho,5121,1),ho);function Bo(e,t){var r=mo[t];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=Zi(e)&&r.gl2||r.gl1;return"string"==typeof n?e.getExtension(n):n}function wo(e,t){var r=mo[t];switch(r&&r.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}function xo(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _o(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function _o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Co(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var Oo=[9729,9728],Eo=ea.global.WebGLBuffer||function(){},To=function(e){p()(r,e);var t=Co(r);function r(e,n){var i;h()(this,r);var a=n.id,o=void 0===a?Qa("texture"):a,s=n.handle,u=n.target;return(i=t.call(this,e,{id:o,handle:s})).target=u,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return x()(r,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.data;if(r instanceof Promise)return r.then((function(r){return e.initialize(Object.assign({},t,{pixels:r,data:r}))})),this;var n="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement;if(n&&r.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,r.addEventListener("loadeddata",(function(){return e.initialize(t)})),this;var i=t.pixels,a=void 0===i?null:i,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,p=t.pixelStore,y=void 0===p?{}:p,v=t.textureUnit,g=void 0===v?void 0:v;r||(r=a);var m=t.width,b=t.height,A=t.dataFormat,B=t.type,w=t.compressed,x=void 0!==w&&w,_=t.mipmaps,C=void 0===_||_,O=t.depth,E=void 0===O?0:O,T=this._deduceParameters({format:s,type:B,dataFormat:A,compressed:x,data:r,width:m,height:b});return m=T.width,b=T.height,x=T.compressed,A=T.dataFormat,B=T.type,this.width=m,this.height=b,this.depth=E,this.format=s,this.type=B,this.dataFormat=A,this.border=c,this.textureUnit=g,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),C&&this._isNPOT()&&(Xi.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),C=!1,this._updateForNPOT(d)),this.mipmaps=C,this.setImageData({data:r,width:m,height:b,depth:E,format:s,type:B,dataFormat:A,border:c,mipmaps:C,parameters:y,compressed:x}),C&&this.generateMipmap(),this.setParameters(d),f&&(this.data=r),n&&(this._video={video:r,parameters:d,lastTime:r.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?r.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var e=this._video,t=e.video,r=e.parameters;if(e.lastTime===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}},{key:"resize",value:function(e){var t=e.height,r=e.width,n=e.mipmaps,i=void 0!==n&&n;return r!==this.width||t!==this.height?this.initialize({width:r,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(Xi.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Ua(this.gl,t,(function(){e.gl.generateMipmap(e.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,r=void 0===t?this.target:t,n=e.pixels,i=void 0===n?null:n,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,f=e.offset,h=void 0===f?0:f,d=e.parameters,p=void 0===d?{}:d,y=e.data,v=void 0===y?null:y,g=e.type,m=void 0===g?this.type:g,b=e.width,A=void 0===b?this.width:b,B=e.height,w=void 0===B?this.height:B,x=e.dataFormat,_=void 0===x?this.dataFormat:x,C=e.compressed,O=void 0!==C&&C;v||(v=i);var T=this._deduceParameters({format:u,type:m,dataFormat:_,compressed:O,data:v,width:A,height:w});m=T.type,_=T.dataFormat,O=T.compressed,A=T.width,w=T.height;var S=this.gl;S.bindTexture(this.target,this.handle);var k,M,I=this._getDataType({data:v,compressed:O});if(v=I.data,k=I.dataType,Ua(this.gl,p,(function(){switch(k){case"null":S.texImage2D(r,o,u,A,w,l,_,m,v);break;case"typed-array":S.texImage2D(r,o,u,A,w,l,_,m,v,h);break;case"buffer":(M=$i(S)).bindBuffer(35052,v.handle||v),M.texImage2D(r,o,u,A,w,l,_,m,h),M.bindBuffer(35052,null);break;case"browser-object":Zi(S)?S.texImage2D(r,o,u,A,w,l,_,m,v):S.texImage2D(r,o,u,_,m,v);break;case"compressed":var e,t=xo(v.entries());try{for(t.s();!(e=t.n()).done;){var n=E()(e.value,2),i=n[0],a=n[1];S.compressedTexImage2D(r,i,a.format,a.width,a.height,l,a.data)}}catch(e){t.e(e)}finally{t.f()}break;default:Ja(!1,"Unknown image data type")}})),v&&v.byteLength)this._trackAllocatedMemory(v.byteLength,"Texture");else{var P=bo[this.dataFormat]||4,R=Ao[this.type]||1;this._trackAllocatedMemory(this.width*this.height*P*R,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,r=e.target,n=void 0===r?this.target:r,i=e.pixels,a=void 0===i?null:i,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,l=e.y,f=void 0===l?0:l,h=e.width,d=void 0===h?this.width:h,p=e.height,y=void 0===p?this.height:p,v=e.level,g=void 0===v?0:v,m=e.format,b=void 0===m?this.format:m,A=e.type,B=void 0===A?this.type:A,w=e.dataFormat,x=void 0===w?this.dataFormat:w,_=e.compressed,C=void 0!==_&&_,O=e.offset,E=void 0===O?0:O,T=e.border,S=(void 0===T&&this.border,e.parameters),k=void 0===S?{}:S,M=this._deduceParameters({format:b,type:B,dataFormat:x,compressed:C,data:s,width:d,height:y});if(B=M.type,x=M.dataFormat,C=M.compressed,d=M.width,y=M.height,Ja(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var I=s;s=I.data,d=I.shape[0],y=I.shape[1]}s instanceof go&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Ua(this.gl,k,(function(){if(C)t.gl.compressedTexSubImage2D(n,g,c,f,d,y,b,s);else if(null===s)t.gl.texSubImage2D(n,g,c,f,d,y,x,B,null);else if(ArrayBuffer.isView(s))t.gl.texSubImage2D(n,g,c,f,d,y,x,B,s,E);else if(s instanceof Eo){var e=$i(t.gl);e.bindBuffer(35052,s),e.texSubImage2D(n,g,c,f,d,y,x,B,E),e.bindBuffer(35052,null)}else if(Zi(t.gl)){$i(t.gl).texSubImage2D(n,g,c,f,d,y,x,B,s)}else t.gl.texSubImage2D(n,g,c,f,x,B,s)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Xi.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,r=e.compressed;return void 0!==r&&r?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof go?{data:t.handle,dataType:"buffer"}:t instanceof Eo?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,r=e.data,n=e.width,i=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=mo[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(r,n,i);return{dataFormat:a,type:o,compressed:s,width:n=c.width,height:i=c.height,format:t,data:r}}},{key:"_deduceImageSize",value:function(e,t,r){var n;return Ja(n="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:r}:{width:t>=0?t:1,height:r>=0?r:1},"Could not deduced texture size"),Ja(void 0===t||n.width===t,"Deduced texture width does not match supplied width"),Ja(void 0===r||n.height===r,"Deduced texture height does not match supplied height"),n}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Ja(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Zi(this.gl)&&(!(!this.width||!this.height)&&(!Xa(this.width)||!Xa(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===Oo.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.format,n=t.linearFiltering,i=!0;return r&&(i=(i=i&&Bo(e,r))&&(!n||wo(e,r))),i}}]),r}(Ya),So="";function ko(e,t){return Ja("string"==typeof e),e=So+e,new Promise((function(r,n){try{var i=new Image;i.onload=function(){return r(i)},i.onerror=function(){return n(new Error("Could not load image ".concat(e,".")))},i.crossOrigin=t&&t.crossOrigin||"anonymous",i.src=e}catch(e){n(e)}}))}function Mo(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var Io,Po=function(e){p()(r,e);var t=Mo(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,r),Yi(e),(i instanceof Promise||"string"==typeof i)&&(i={data:i}),"string"==typeof i.data&&(i=Object.assign({},i,{data:ko(i.data)})),(n=t.call(this,e,Object.assign({},i,{target:3553}))).initialize(i),Object.seal(wi()(n)),n}return x()(r,null,[{key:"isSupported",value:function(e,t){return To.isSupported(e,t)}}]),r}(To),Ro="EXT_color_buffer_float",Do=(Io={},C()(Io,33189,{bpp:2}),C()(Io,33190,{gl2:!0,bpp:3}),C()(Io,36012,{gl2:!0,bpp:4}),C()(Io,36168,{bpp:1}),C()(Io,34041,{bpp:4}),C()(Io,35056,{gl2:!0,bpp:4}),C()(Io,36013,{gl2:!0,bpp:5}),C()(Io,32854,{bpp:2}),C()(Io,36194,{bpp:2}),C()(Io,32855,{bpp:2}),C()(Io,33321,{gl2:!0,bpp:1}),C()(Io,33330,{gl2:!0,bpp:1}),C()(Io,33329,{gl2:!0,bpp:1}),C()(Io,33332,{gl2:!0,bpp:2}),C()(Io,33331,{gl2:!0,bpp:2}),C()(Io,33334,{gl2:!0,bpp:4}),C()(Io,33333,{gl2:!0,bpp:4}),C()(Io,33323,{gl2:!0,bpp:2}),C()(Io,33336,{gl2:!0,bpp:2}),C()(Io,33335,{gl2:!0,bpp:2}),C()(Io,33338,{gl2:!0,bpp:4}),C()(Io,33337,{gl2:!0,bpp:4}),C()(Io,33340,{gl2:!0,bpp:8}),C()(Io,33339,{gl2:!0,bpp:8}),C()(Io,32849,{gl2:!0,bpp:3}),C()(Io,32856,{gl2:!0,bpp:4}),C()(Io,32857,{gl2:!0,bpp:4}),C()(Io,36220,{gl2:!0,bpp:4}),C()(Io,36238,{gl2:!0,bpp:4}),C()(Io,36975,{gl2:!0,bpp:4}),C()(Io,36214,{gl2:!0,bpp:8}),C()(Io,36232,{gl2:!0,bpp:8}),C()(Io,36226,{gl2:!0,bpp:16}),C()(Io,36208,{gl2:!0,bpp:16}),C()(Io,33325,{gl2:Ro,bpp:2}),C()(Io,33327,{gl2:Ro,bpp:4}),C()(Io,34842,{gl2:Ro,bpp:8}),C()(Io,33326,{gl2:Ro,bpp:4}),C()(Io,33328,{gl2:Ro,bpp:8}),C()(Io,34836,{gl2:Ro,bpp:16}),C()(Io,35898,{gl2:Ro,bpp:4}),Io);function Fo(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}function jo(e,t,r){var n=r[t];if(!n)return!1;var i=Zi(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}var Lo=function(e){p()(r,e);var t=Fo(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,r),(n=t.call(this,e,i)).initialize(i),Object.seal(wi()(n)),n}return x()(r,[{key:"initialize",value:function(e){var t=e.format,r=e.width,n=void 0===r?1:r,i=e.height,a=void 0===i?1:i,o=e.samples,s=void 0===o?0:o;return Ja(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Zi(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,n,a):this.gl.renderbufferStorage(36161,t,n,a),this.format=t,this.width=n,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Do[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,r=e.height;return t!==this.width||r!==this.height?this.initialize({width:t,height:r,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},r=t.format;return!r||jo(e,r,Do)}},{key:"getSamplesForFormat",value:function(e,t){var r=t.format;return e.getInternalformatParameter(36161,r,32937)}}]),r}(Ya);function Go(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.framebuffer,n=void 0===r?null:r,i=t.color,a=void 0===i?null:i,o=t.depth,s=void 0===o?null:o,u=t.stencil,c=void 0===u?null:u,l={};n&&(l.framebuffer=n);var f=0;a&&(f|=16384,!0!==a&&(l.clearColor=a)),s&&(f|=256,!0!==s&&(l.clearDepth=s)),c&&(f|=1024,!0!==s&&(l.clearStencil=s)),Ja(0!==f,"clear: bad arguments"),Ua(e,l,(function(){e.clear(f)}))}function Uo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.framebuffer,n=void 0===r?null:r,i=t.buffer,a=void 0===i?6144:i,o=t.drawBuffer,s=void 0===o?0:o,u=t.value,c=void 0===u?[0,0,0,0]:u;$i(e),Ua(e,{framebuffer:n},(function(){switch(a){case 6144:switch(c.constructor){case Int32Array:e.clearBufferiv(a,s,c);break;case Uint32Array:e.clearBufferuiv(a,s,c);break;case Float32Array:default:e.clearBufferfv(a,s,c)}break;case 6145:e.clearBufferfv(6145,0,[c]);break;case 6146:e.clearBufferiv(6146,0,[c]);break;case 34041:var t=E()(c,2),r=t[0],n=t[1];e.clearBufferfi(34041,0,r,n);break;default:Ja(!1,"clear: bad arguments")}}))}function No(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Ja(!1),0}}function Ho(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var Jo=[34069,34070,34071,34072,34073,34074],Vo=function(e){p()(n,e);var t,r=Ho(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,n),Yi(e),(t=r.call(this,e,Object.assign({},i,{target:34067}))).initialize(i),Object.seal(wi()(t)),t}return x()(n,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.mipmaps,n=void 0===r||r,i=t.parameters,a=void 0===i?{}:i;return this.opts=t,this.setCubeMapImageData(t).then((function(){e.loaded=!0,n&&e.generateMipmap(t),e.setParameters(a)})),this}},{key:"subImage",value:function(e){var t=e.face,r=e.data,n=e.x,i=void 0===n?0:n,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:r,x:i,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:(t=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,y=this;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.width,n=t.height,i=t.pixels,a=t.data,o=t.border,s=void 0===o?0:o,u=t.format,c=void 0===u?6408:u,l=t.type,f=void 0===l?5121:l,h=this.gl,d=i||a,e.next=5,Promise.all(Jo.map((function(e){var t=d[e];return Promise.all(Array.isArray(t)?t:[t])})));case 5:p=e.sent,this.bind(),Jo.forEach((function(e,t){p[t].length>1&&!1!==y.opts.mipmaps&&Xi.warn("".concat(y.id," has mipmap and multiple LODs."))(),p[t].forEach((function(t,i){r&&n?h.texImage2D(e,i,c,r,n,s,c,f,t):h.texImage2D(e,i,c,c,f,t)}))})),this.unbind();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setImageDataForFace",value:function(e){var t=this,r=e.face,n=e.width,i=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,p=a||o;return this.bind(),p instanceof Promise?p.then((function(n){return t.setImageDataForFace(Object.assign({},e,{face:r,data:n,pixels:n}))})):this.width||this.height?d.texImage2D(r,0,l,n,i,u,l,h,p):d.texImage2D(r,0,l,l,h,p),this}}]),n}(To);Vo.FACES=Jo;function zo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.sourceX,n=void 0===r?0:r,i=t.sourceY,a=void 0===i?0:i,o=t.sourceFormat,s=void 0===o?6408:o,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,f=void 0===l?null:l,h=t.sourceWidth,d=t.sourceHeight,p=t.sourceType,y=Qo(e),v=y.framebuffer,g=y.deleteFramebuffer;Ja(v);var m=v.gl,b=v.handle,A=v.attachments;h=h||v.width,d=d||v.height,36064===c&&null===b&&(c=1028),Ja(A[c]),f=Xo(f,p=p||A[c].type,s,h,d),p=p||to(f);var B=m.bindFramebuffer(36160,b);return m.readPixels(n,a,h,d,s,p,f),m.bindFramebuffer(36160,B||null),g&&v.delete(),f}function Ko(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.sourceAttachment,n=void 0===r?36064:r,i=t.targetMaxHeight,a=void 0===i?Number.MAX_SAFE_INTEGER:i,o=zo(e,{sourceAttachment:n}),s=e.width,u=e.height;u>a;){var c=io({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}no({data:o,width:s,height:u});var l=document.createElement("canvas");l.width=s,l.height=u;var f=l.getContext("2d"),h=f.createImageData(s,u);return h.data.set(o),f.putImageData(h,0,0),l.toDataURL()}function Qo(e){return e instanceof Yo?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,n=t.gl,i=t.width,a=t.height,o=t.id,new Yo(n,Object.assign({},r,{id:"framebuffer-for-".concat(o),width:i,height:a,attachments:C()({},36064,t)}))),deleteFramebuffer:!0};var t,r,n,i,a,o}function Xo(e,t,r,n,i){return e||new(ro(t=t||5121,{clamped:!1}))(n*i*No(r))}function qo(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Wo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wo(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Wo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Zo(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var Yo=function(e){p()(r,e);var t=Zo(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,r),(n=t.call(this,e,i)).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.ownResources=[],n.initialize(i),Object.seal(wi()(n)),n}return x()(r,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=$i(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=$i(this.gl);return e.getParameter(e.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}},{key:"initialize",value:function(e){var t=e.width,r=void 0===t?1:t,n=e.height,i=void 0===n?1:n,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,p=void 0===d||d,y=e.readBuffer,v=void 0===y?void 0:y,g=e.drawBuffers,m=void 0===g?void 0:g;if(Ja(r>=0&&i>=0,"Width and height need to be integers"),this.width=r,this.height=i,o)for(var b in o){var A=o[b];(Array.isArray(A)?A[0]:A).resize({width:r,height:i})}else o=this._createDefaultAttachments(u,l,h,r,i);this.update({clearAttachments:!0,attachments:o,readBuffer:v,drawBuffers:m}),o&&p&&this.checkStatus()}},{key:"delete",value:function(){var e,t=qo(this.ownResources);try{for(t.s();!(e=t.n()).done;){e.value.delete()}}catch(e){t.e(e)}finally{t.f()}return Xn()(m()(r.prototype),"delete",this).call(this),this}},{key:"update",value:function(e){var t=e.attachments,r=void 0===t?{}:t,n=e.readBuffer,i=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(r,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return n&&this._setReadBuffer(n),i&&this._setDrawBuffers(i),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,r=e.height;if(null===this.handle)return Ja(void 0===t&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var n in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),t!==this.width&&r!==this.height&&Xi.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(r))(),this.attachments)this.attachments[n].resize({width:t,height:r});return this.width=t,this.height=r,this}},{key:"attach",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clearAttachments,i=void 0!==n&&n,a=r.resizeAttachments,o=void 0===a||a,s={};i&&Object.keys(this.attachments).forEach((function(e){s[e]=null})),Object.assign(s,e);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){Ja(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof Lo)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=E()(f,3),p=d[0],y=d[1],v=void 0===y?0:y,g=d[2],m=void 0===g?0:g;h=p,this._attachTexture({attachment:l,texture:p,layer:v,level:m})}else this._attachTexture({attachment:l,texture:h,layer:0,level:0});else this._unattach(l);o&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter((function(e){return!t.attachments[e]})).forEach((function(e){delete t.attachments[e]}))}},{key:"checkStatus",value:function(){this.gl;var e=this.getStatus();if(36053!==e)throw new Error(function(e){return(Yo.STATUS||{})[e]||"Framebuffer error ".concat(e)}(e));return this}},{key:"getStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),r=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),r}},{key:"clear",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.color,n=t.depth,i=t.stencil,a=t.drawBuffers,o=void 0===a?[]:a,s=this.gl.bindFramebuffer(36160,this.handle);return(r||n||i)&&Go(this.gl,{color:r,depth:n,stencil:i}),o.forEach((function(t,r){Uo(e.gl,{drawBuffer:r,value:t})})),this.gl.bindFramebuffer(36160,s||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Xi.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Xi.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Xi.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Xi.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Xi.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Xi.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,r=void 0===t?[]:t,n=e.x,i=void 0===n?0:n,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=$i(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===i&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,r):c.invalidateFramebuffer(36008,r,i,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,r){var n=this._getAttachmentParameterFallback(t);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),r&&n>1e3&&(n=za(this.gl,n)),n}},{key:"getAttachmentParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},a=qo(n);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=r?za(this.gl,o):o;i[s]=this.getAttachmentParameter(t,o,r)}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Object.keys(this.attachments),r={},n=0,i=t;n<i.length;n++){var a=i[n],o=Number(a),s=e?za(this.gl,o):o;r[s]=this.getAttachmentParameters(o,e)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(Ko(this),"luma-debug-texture"),this}},{key:"log",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>Xi.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var r=Ko(this,{targetMaxHeight:100});return Xi.image({logLevel:e,message:t,image:r},t)(),this}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?36160:t;return this.gl.bindFramebuffer(r,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?36160:t;return this.gl.bindFramebuffer(r,null),this}},{key:"_createDefaultAttachments",value:function(e,t,r,n,i){var a,o=null;e&&((o=o||{})[36064]=new Po(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(a={},C()(a,10241,9729),C()(a,10240,9729),C()(a,10242,33071),C()(a,10243,33071),a)}),this.ownResources.push(o[36064]));return t&&r?((o=o||{})[33306]=new Lo(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new Lo(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(o[36096])):r&&Ja(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof Lo?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,r=void 0===t?36064:t,n=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,r,36161,n.handle),this.attachments[r]=n}},{key:"_attachTexture",value:function(e){var t=e.attachment,r=void 0===t?36064:t,n=e.texture,i=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:$i(o).framebufferTextureLayer(36160,r,n.target,a,i);break;case 34067:var s=function(e){return e<34069?e+34069:e}(i);o.framebufferTexture2D(36160,r,s,n.handle,a);break;case 3553:o.framebufferTexture2D(36160,r,3553,n.handle,a);break;default:Ja(!1,"Illegal texture type")}o.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(e){var t,r=Zi(t=this.gl)?t:null;r?r.readBuffer(e):Ja(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,r=$i(t);if(r)r.drawBuffers(e);else{var n=t.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(e):Ja(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=function(e){for(var t in e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},ws)void 0===e.luma.caps[t]&&(e.luma.caps[t]=Os(e,t));return e.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.colorBufferFloat,n=t.colorBufferHalfFloat,i=!0;return r&&(i=Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("WEBGL_color_buffer_float")||e.getExtension("OES_texture_float"))),n&&(i=i&&Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new r(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),r}(Ya);var $o;Yo.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var es="WEBGL2",ts="VERTEX_ARRAY_OBJECT",rs="TIMER_QUERY",ns="INSTANCED_RENDERING",is="MULTIPLE_RENDER_TARGETS",as="ELEMENT_INDEX_UINT32",os="BLEND_EQUATION_MINMAX",ss="FLOAT_BLEND",us="COLOR_ENCODING_SRGB",cs="TEXTURE_DEPTH",ls="TEXTURE_FLOAT",fs="TEXTURE_HALF_FLOAT",hs="TEXTURE_FILTER_LINEAR_FLOAT",ds="TEXTURE_FILTER_LINEAR_HALF_FLOAT",ps="TEXTURE_FILTER_ANISOTROPIC",ys="COLOR_ATTACHMENT_RGBA32F",vs="COLOR_ATTACHMENT_FLOAT",gs="COLOR_ATTACHMENT_HALF_FLOAT",ms="GLSL_FRAG_DATA",bs="GLSL_FRAG_DEPTH",As="GLSL_DERIVATIVES",Bs="GLSL_TEXTURE_LOD";var ws=($o={},C()($o,es,[!1,!0]),C()($o,ts,["OES_vertex_array_object",!0]),C()($o,rs,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),C()($o,ns,["ANGLE_instanced_arrays",!0]),C()($o,is,["WEBGL_draw_buffers",!0]),C()($o,as,["OES_element_index_uint",!0]),C()($o,os,["EXT_blend_minmax",!0]),C()($o,ss,["EXT_float_blend"]),C()($o,us,["EXT_sRGB",!0]),C()($o,cs,["WEBGL_depth_texture",!0]),C()($o,ls,["OES_texture_float",!0]),C()($o,fs,["OES_texture_half_float",!0]),C()($o,hs,["OES_texture_float_linear"]),C()($o,ds,["OES_texture_half_float_linear"]),C()($o,ps,["EXT_texture_filter_anisotropic"]),C()($o,ys,[function(e){var t=new Po(e,{format:6408,type:5126,dataFormat:6408}),r=new Yo(e,{id:"test-framebuffer",check:!1,attachments:C()({},36064,t)}),n=r.getStatus();return t.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),C()($o,vs,[!1,"EXT_color_buffer_float"]),C()($o,gs,["EXT_color_buffer_half_float"]),C()($o,ms,["WEBGL_draw_buffers",!0]),C()($o,bs,["EXT_frag_depth",!0]),C()($o,As,["OES_standard_derivatives",!0]),C()($o,Bs,["EXT_shader_texture_lod",!0]),$o);function xs(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _s(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function _s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Cs(e,t){return function(e,t){return(t=Array.isArray(t)?t:[t]).every((function(t){return Os(e,t)}))}(e,t)}function Os(e,t){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},void 0===e.luma.caps[t]&&(e.luma.caps[t]=function(e,t){var r,n=ws[t];Ja(n,t);var i=Zi(e)&&n[1]||n[0];if("function"==typeof i)r=i(e);else if(Array.isArray(i)){r=!0;var a,o=xs(i);try{for(o.s();!(a=o.n()).done;){var s=a.value;r=r&&Boolean(e.getExtension(s))}}catch(e){o.e(e)}finally{o.f()}}else"string"==typeof i?r=Boolean(e.getExtension(i)):"boolean"==typeof i?r=i:Ja(!1);return r}(e,t)),e.luma.caps[t]||Xi.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}function Es(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 Ts(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Es(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Es(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ss=function(){function e(t,r){var n=r.attributes,i=r.material,a=r.pbrDebug,o=r.imageBasedLightingEnvironment,s=r.lights,u=r.useTangents;h()(this,e),this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},Cs(t,Bs)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],o&&(this.uniforms.u_DiffuseEnvSampler=o.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=o.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=o.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),a&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(o,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),i&&this.parseMaterial(i)}return x()(e,[{key:"defineIfPresent",value:function(e,t){e&&(this.defines[t]=1)}},{key:"parseTexture",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},a=e.texture.source.image,o={};a.compressed?(r=a,o=C()({},this.gl.TEXTURE_MIN_FILTER,a.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):r={data:a};var s=new Po(this.gl,Ts({id:e.name||e.id,parameters:Ts(Ts({},i),o),pixelStore:C()({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},r));this.uniforms[t]=s,this.defineIfPresent(n,n),this.generatedTextures.push(s)}},{key:"parsePbrMetallicRoughness",value:function(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var t=e.metallicFactor,r=void 0===t?1:t,n=e.roughnessFactor,i=void 0===n?1:n;this.uniforms.u_MetallicRoughnessValues=[r,i]}},{key:"parseMaterial",value:function(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,r=void 0===t?1:t;this.uniforms.u_NormalScale=r}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var n=e.occlusionTexture.strength,i=void 0===n?1:n;this.uniforms.u_OcclusionStrength=i}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(Xi.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}]),e}();function ks(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 Ms(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ks(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ks(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Is(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var Ps=function(e){p()(r,e);var t=Is(r);function r(){return h()(this,r),t.apply(this,arguments)}return x()(r,[{key:"getShaders",value:function(){var e=Xn()(m()(r.prototype),"getShaders",this).call(this);return e.modules.push(Ai.pbr),Ms(Ms({},e),{},{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool u_pickFeatureIds;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvec2 applyUVRegion(vec2 uv) {\n #ifdef HAS_UV_REGIONS\n return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n #else\n return uv;\n #endif\n}\n\nvoid main(void) {\n vec2 uv = applyUVRegion(texCoords);\n geometry.uv = uv;\n\n if (u_pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n geometry.normal = normals_commonspace;\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){var e=this.props.featureIds;Xn()(m()(r.prototype),"initializeState",this).call(this),e&&this.state.attributeManager.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps,i=e.changeFlags;Xn()(m()(r.prototype),"updateState",this).call(this,{props:t,oldProps:n,changeFlags:i}),t.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(t.pbrMaterial)}},{key:"draw",value:function(e){var t=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,u_pickFeatureIds:Boolean(t)}),Xn()(m()(r.prototype),"draw",this).call(this,e))}},{key:"getModel",value:function(e){var t,r=this.props,n=r.id,i=r.pbrMaterial,a=this.parseMaterial(i,e),o=this.getShaders();return(t=e.attributes).COLOR_0||t.colors||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),new Ai.Model(this.context.gl,Ms(Ms({},this.getShaders()),{},{id:n,geometry:e,defines:Ms(Ms(Ms({},o.defines),null==a?void 0:a.defines),{},{HAS_UV_REGIONS:e.attributes.uvRegions}),parameters:null==a?void 0:a.parameters,isInstanced:!0}))}},{key:"updatePbrMaterialUniforms",value:function(e){var t=this.state.model;if(t){var r=this.props.mesh,n=this.parseMaterial(e,r);t.setUniforms(n.uniforms)}}},{key:"parseMaterial",value:function(e,t){var r=Boolean(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return new Ss(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:Ms({unlit:r},e),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(e){for(var t=this.props.featureIds,r=new Uint8ClampedArray(t.length*e.size),n=[],i=0;i<t.length;i++)this.encodePickingColor(t[i],n),r[3*i]=n[0],r[3*i+1]=n[1],r[3*i+2]=n[2];e.value=r}}]),r}(b.SimpleMeshLayer);Ps.layerName="_MeshLayer",Ps.defaultProps={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}};var Rs=function(e){return"boolean"==typeof e},Ds=function(e){return"function"==typeof e},Fs=function(e){return null!==e&&"object"===ui()(e)},js=function(e){return Fs(e)&&e.constructor==={}.constructor},Ls=function(e){return e&&"function"==typeof e[Symbol.iterator]},Gs=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},Us=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},Ns=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},Hs=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||Fs(e)&&Ds(e.tee)&&Ds(e.cancel)&&Ds(e.getReader)}(e)||function(e){return Fs(e)&&Ds(e.read)&&Ds(e.pipe)&&Rs(e.readable)}(e)};function Js(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function Vs(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 zs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vs(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ks(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function Qs(e){var t,r,n;return Js(e,"null loader"),Js(Ks(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=zs(zs({},e=e[0]),{},{options:zs(zs({},e.options),n)})),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(r=e)&&void 0!==r&&r.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var Xs="",qs={};function Ws(e){for(var t in qs)if(e.startsWith(t)){var r=qs[t];e=e.replace(t,r)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(Xs).concat(e)),e}var Zs=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Ys=/^([-\w.]+\/[-\w.+]+)/;function $s(e){var t=Ys.exec(e);return t?t[1]:e}function eu(e){var t=Zs.exec(e);return t?t[1]:""}var tu=/\?.*/;function ru(e){if(Us(e)){var t=iu(e.url||"");return{url:t,type:$s(e.headers.get("content-type")||"")||eu(t)}}return Ns(e)?{url:iu(e.name||""),type:e.type||""}:"string"==typeof e?{url:iu(e),type:eu(e)}:{url:"",type:""}}function nu(e){return Us(e)?e.headers["content-length"]||-1:Ns(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer?e.byteLength:ArrayBuffer.isView(e)?e.byteLength:-1}function iu(e){return e.replace(tu,"")}function au(e){return ou.apply(this,arguments)}function ou(){return(ou=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Us(t)){e.next=2;break}return e.abrupt("return",t);case 2:return r={},(n=nu(t))>=0&&(r["content-length"]=String(n)),i=ru(t),a=i.url,(o=i.type)&&(r["content-type"]=o),e.next=9,fu(t);case 9:return(s=e.sent)&&(r["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t)),u=new Response(t,{headers:r}),Object.defineProperty(u,"url",{value:a}),e.abrupt("return",u);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function su(e){return uu.apply(this,arguments)}function uu(){return(uu=V()(K.a.mark((function e(t){var r;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,cu(t);case 3:throw r=e.sent,new Error(r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cu(e){return lu.apply(this,arguments)}function lu(){return(lu=V()(K.a.mark((function e(t){var r,n,i;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): "),e.prev=1,n=t.headers.get("Content-Type"),i=t.statusText,!n.includes("application/json")){e.next=11;break}return e.t0=i,e.t1=" ",e.next=9,t.text();case 9:e.t2=e.sent,i=e.t0+=e.t1.concat.call(e.t1,e.t2);case 11:r=(r+=i).length>60?"".concat(r.slice(60),"..."):r,e.next=17;break;case 15:e.prev=15,e.t3=e.catch(1);case 17:return e.abrupt("return",r);case 18:case"end":return e.stop()}}),e,null,[[1,15]])})))).apply(this,arguments)}function fu(e){return hu.apply(this,arguments)}function hu(){return(hu=V()(K.a.mark((function e(t){var r,n,i,a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=5,"string"!=typeof t){e.next=3;break}return e.abrupt("return","data:,".concat(t.slice(0,r)));case 3:if(!(t instanceof Blob)){e.next=8;break}return n=t.slice(0,5),e.next=7,new Promise((function(e){var t=new FileReader;t.onload=function(t){var r;return e(null==t?void 0:null===(r=t.target)||void 0===r?void 0:r.result)},t.readAsDataURL(n)}));case 7:return e.abrupt("return",e.sent);case 8:if(!(t instanceof ArrayBuffer)){e.next=12;break}return i=t.slice(0,r),a=du(i),e.abrupt("return","data:base64,".concat(a));case 12:return e.abrupt("return",null);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function du(e){for(var t="",r=new Uint8Array(e),n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function pu(e,t){return yu.apply(this,arguments)}function yu(){return(yu=V()(K.a.mark((function e(t,r){var n;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=7;break}return t=Ws(t),n=r,null!=r&&r.fetch&&"function"!=typeof(null==r?void 0:r.fetch)&&(n=r.fetch),e.next=6,fetch(t,n);case 6:return e.abrupt("return",e.sent);case 7:return e.next=9,au(t);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var vu=new Vi({id:"loaders.gl"}),gu=function(){function e(){h()(this,e)}return x()(e,[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}]),e}(),mu={fetch:null,mimeType:void 0,nothrow:!1,log:new(function(){function e(){h()(this,e),En(this,"console",void 0),this.console=console}return x()(e,[{key:"log",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.log).bind.apply(e,[this.console].concat(r))}},{key:"info",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.info).bind.apply(e,[this.console].concat(r))}},{key:"warn",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.warn).bind.apply(e,[this.console].concat(r))}},{key:"error",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.error).bind.apply(e,[this.console].concat(r))}}]),e}()),CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},bu={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function Au(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Bu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bu(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Bu(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function wu(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 xu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wu(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _u(){globalThis.loaders=globalThis.loaders||{};var e=globalThis.loaders;return e._state=e._state||{},e._state}var Cu=function(){var e=_u();return e.globalOptions=e.globalOptions||xu({},mu),e.globalOptions};function Ou(e,t,r,n){return r=r||[],function(e,t){Tu(e,null,mu,bu,t);var r,n=Au(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=e&&e[i.id]||{},o=i.options&&i.options[i.id]||{},s=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};Tu(a,i.id,o,s,t)}}catch(e){n.e(e)}finally{n.f()}}(e,r=Array.isArray(r)?r:[r]),ku(t,e,n)}function Eu(e,t){var r=Cu(),n=e||r;return"function"==typeof n.fetch?n.fetch:Fs(n.fetch)?function(e){return pu(e,n)}:null!=t&&t.fetch?null==t?void 0:t.fetch:pu}function Tu(e,t,r,n,i){var a=t||"Top level",o=t?"".concat(t,"."):"";for(var s in e){var u=!t&&Fs(e[s]);if(!(s in r||"baseUri"===s&&!t||"workerUrl"===s&&t))if(s in n)vu.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var c=Su(s,i);vu.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(c))()}}}function Su(e,t){var r,n=e.toLowerCase(),i="",a=Au(t);try{for(a.s();!(r=a.n()).done;){var o=r.value;for(var s in o.options){if(e===s)return"Did you mean '".concat(o.id,".").concat(s,"'?");var u=s.toLowerCase();(n.startsWith(u)||u.startsWith(n))&&(i=i||"Did you mean '".concat(o.id,".").concat(s,"'?"))}}}catch(e){a.e(e)}finally{a.f()}return i}function ku(e,t,r){var n=xu({},e.options||{});return function(e,t){!t||"baseUri"in e||(e.baseUri=t)}(n,r),null===n.log&&(n.log=new gu),Mu(n,Cu()),Mu(n,t),n}function Mu(e,t){for(var r in t)if(r in t){var n=t[r];js(n)&&js(e[r])?e[r]=xu(xu({},e[r]),t[r]):e[r]=t[r]}}function Iu(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}function Pu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.1.0";Iu(e,"no worker provided");var r=e.version;return!(!t||!r)}var Ru={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Du=Ru.global||Ru.self||Ru.window||{},Fu="object"!==("undefined"==typeof process?"undefined":ui()(process))||"[object process]"!==String(process)||process.browser,ju="function"==typeof importScripts,Lu="undefined"!=typeof window&&void 0!==window.orientation,Gu="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Uu=(Gu&&parseFloat(Gu[1]),new Map);function Nu(e){Iu(e.source&&!e.url||!e.source&&e.url);var t=Uu.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return Hu((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),Uu.set(e.url,t)),e.source&&(t=Hu(e.source),Uu.set(e.source,t))),Iu(t),t}function Hu(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function Ju(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}var Vu=function(){},zu=function(){function e(t){h()(this,e),En(this,"name",void 0),En(this,"source",void 0),En(this,"url",void 0),En(this,"terminated",!1),En(this,"worker",void 0),En(this,"onMessage",void 0),En(this,"onError",void 0),En(this,"_loadableURL","");var r=t.name,n=t.source,i=t.url;Iu(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=Vu,this.onError=function(e){return console.log(e)},this.worker=this._createBrowserWorker()}return x()(e,[{key:"destroy",value:function(){this.onMessage=Vu,this.onError=Vu,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,t){t=t||function e(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||new Set;if(t){if(Ju(t))i.add(t);else if(Ju(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(r&&"object"===ui()(t))for(var a in t)e(t[a],r,i)}else;return void 0===n?Array.from(i):[]}(e),this.worker.postMessage(e,t)}},{key:"_getErrorFromErrorEvent",value:function(e){var t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=Nu({source:this.source,url:this.url});var t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=function(t){t.data?e.onMessage(t.data):e.onError(new Error("No data received"))},t.onerror=function(t){e.onError(e._getErrorFromErrorEvent(t)),e.terminated=!0},t.onmessageerror=function(e){return console.error(e)},t}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker}}]),e}(),Ku=function(){function e(t,r){var n=this;h()(this,e),En(this,"name",void 0),En(this,"workerThread",void 0),En(this,"isRunning",void 0),En(this,"result",void 0),En(this,"_resolve",void 0),En(this,"_reject",void 0),this.name=t,this.workerThread=r,this.isRunning=!0,this._resolve=function(){},this._reject=function(){},this.result=new Promise((function(e,t){n._resolve=e,n._reject=t}))}return x()(e,[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){Iu(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){Iu(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}();function Qu(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 Xu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qu(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qu=function(){function e(t){h()(this,e),En(this,"name","unnamed"),En(this,"source",void 0),En(this,"url",void 0),En(this,"maxConcurrency",1),En(this,"maxMobileConcurrency",1),En(this,"onDebug",(function(){})),En(this,"reuseWorkers",!0),En(this,"props",{}),En(this,"jobQueue",[]),En(this,"idleQueue",[]),En(this,"count",0),En(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}var t,r;return x()(e,[{key:"destroy",value:function(){this.idleQueue.forEach((function(e){return e.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=Xu(Xu({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}},{key:"startJob",value:(r=V()(K.a.mark((function e(t){var r,n,i,a=this,o=arguments;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:function(e,t,r){return e.done(r)},n=o.length>2&&void 0!==o[2]?o[2]:function(e,t){return e.error(t)},i=new Promise((function(e){return a.jobQueue.push({name:t,onMessage:r,onError:n,onStart:e}),a})),this._startQueuedJob(),e.next=6,i;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_startQueuedJob",value:(t=V()(K.a.mark((function e(){var t,r,n;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.jobQueue.length){e.next=2;break}return e.abrupt("return");case 2:if(t=this._getAvailableWorker()){e.next=5;break}return e.abrupt("return");case 5:if(!(r=this.jobQueue.shift())){e.next=18;break}return this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length}),n=new Ku(r.name,t),t.onMessage=function(e){return r.onMessage(n,e.type,e.payload)},t.onError=function(e){return r.onError(n,e)},r.onStart(n),e.prev=12,e.next=15,n.result;case 15:return e.prev=15,this.returnWorkerToQueue(t),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[12,,15,18]])}))),function(){return t.apply(this,arguments)})},{key:"returnWorkerToQueue",value:function(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;var e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new zu({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return Lu?this.maxMobileConcurrency:this.maxConcurrency}}]),e}();function Wu(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Zu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zu(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Zu(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Yu(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 $u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yu(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ec={maxConcurrency:3,maxMobileConcurrency:1,onDebug:function(){},reuseWorkers:!0},tc=function(){function e(t){h()(this,e),En(this,"props",void 0),En(this,"workerPools",new Map),this.props=$u({},ec),this.setProps(t),this.workerPools=new Map}return x()(e,[{key:"destroy",value:function(){var e,t=Wu(this.workerPools.values());try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}}},{key:"setProps",value:function(e){this.props=$u($u({},this.props),e);var t,r=Wu(this.workerPools.values());try{for(r.s();!(t=r.n()).done;){t.value.setProps(this._getWorkerPoolProps())}}catch(e){r.e(e)}finally{r.f()}}},{key:"getWorkerPool",value:function(e){var t=e.name,r=e.source,n=e.url,i=this.workerPools.get(t);return i||((i=new qu({name:t,source:r,url:n})).setProps(this._getWorkerPoolProps()),this.workerPools.set(t,i)),i}},{key:"_getWorkerPoolProps",value:function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}],[{key:"isSupported",value:function(){return zu.isSupported()}},{key:"getWorkerFarm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}}]),e}();En(tc,"_workerFarm",void 0);function rc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t[e.id]||{},n="".concat(e.id,"-worker.js"),i=r.workerUrl;if(i||"compression"!==e.id||(i=t.workerUrl),"test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){var a=e.version;"latest"===a&&(a="beta");var o=a?"@".concat(a):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(o,"/dist/").concat(n)}return Iu(i),i}function nc(e,t){return!!tc.isSupported()&&(e.worker&&(null==t?void 0:t.worker))}function ic(e,t,r,n,i){return ac.apply(this,arguments)}function ac(){return(ac=V()(K.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.id,s=rc(t,n),u=tc.getWorkerFarm(n),c=u.getWorkerPool({name:o,url:s}),n=JSON.parse(JSON.stringify(n)),e.next=7,c.startJob("process-on-worker",oc.bind(null,a));case 7:return(l=e.sent).postMessage("process",{input:r,options:n}),e.next=11,l.result;case 11:return f=e.sent,e.next=14,f.result;case 14:return e.abrupt("return",e.sent);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oc(e,t,r,n){return sc.apply(this,arguments)}function sc(){return(sc=V()(K.a.mark((function e(t,r,n,i){var a,o,s,u,c;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n,e.next="done"===e.t0?3:"error"===e.t0?5:"process"===e.t0?7:20;break;case 3:return r.done(i),e.abrupt("break",21);case 5:return r.error(new Error(i.error)),e.abrupt("break",21);case 7:return a=i.id,o=i.input,s=i.options,e.prev=8,e.next=11,t(o,s);case 11:u=e.sent,r.postMessage("done",{id:a,result:u}),e.next=19;break;case 15:e.prev=15,e.t1=e.catch(8),c=e.t1 instanceof Error?e.t1.message:"unknown error",r.postMessage("error",{id:a,error:c});case 19:return e.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(n));case 21:case"end":return e.stop()}}),e,null,[[8,15]])})))).apply(this,arguments)}var uc=r(33),cc=r.n(uc);r(43);function lc(e){return e&&"object"===ui()(e)&&e.isBuffer}function fc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return hc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function hc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dc(e){if(lc(e))return lc(t=e)?new Uint8Array(t.buffer,t.byteOffset,t.length).slice().buffer:t;var t;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){var r=e;return(new TextEncoder).encode(r).buffer}if(e&&"object"===ui()(e)&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function pc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=t.map((function(e){return e instanceof ArrayBuffer?new Uint8Array(e):e})),a=i.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(a),s=0,u=fc(i);try{for(u.s();!(n=u.n()).done;){var c=n.value;o.set(c,s),s+=c.byteLength}}catch(e){u.e(e)}finally{u.f()}return o.buffer}function yc(e,t,r){var n=void 0!==r?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function vc(e){return gc.apply(this,arguments)}function gc(){return(gc=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=!1,i=!1,e.prev=3,o=cc()(t);case 5:return e.next=7,o.next();case 7:if(!(n=!(s=e.sent).done)){e.next=13;break}u=s.value,r.push(u);case 10:n=!1,e.next=5;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(3),i=!0,a=e.t0;case 19:if(e.prev=19,e.prev=20,!n||null==o.return){e.next=24;break}return e.next=24,o.return();case 24:if(e.prev=24,!i){e.next=27;break}throw a;case 27:return e.finish(24);case 28:return e.finish(19);case 29:return e.abrupt("return",pc.apply(void 0,r));case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var mc=K.a.mark(bc);function bc(e,t){var r,n,i,a,o;return K.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=(null==t?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;case 3:if(!(n<e.length)){s.next=11;break}return a=Math.min(e.length-n,r),o=e.slice(n,n+a),n+=a,s.next=9,i.encode(o);case 9:s.next=3;break;case 11:case"end":return s.stop()}}),mc)}var Ac=K.a.mark(Bc);function Bc(e){var t,r,n,i,a,o,s,u=arguments;return K.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:t=u.length>1&&void 0!==u[1]?u[1]:{},r=t.chunkSize,n=void 0===r?262144:r,i=0;case 3:if(!(i<e.byteLength)){c.next=14;break}return a=Math.min(e.byteLength-i,n),o=new ArrayBuffer(a),s=new Uint8Array(e,i,a),new Uint8Array(o).set(s),i+=a,c.next=12,o;case 12:c.next=3;break;case 14:case"end":return c.stop()}}),Ac)}var wc=r(28),xc=r.n(wc),_c=r(32),Cc=r.n(_c);function Oc(){return(Oc=Cc()(K.a.mark((function e(t,r){var n,i,a,o;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(null==r?void 0:r.chunkSize)||1048576,i=0;case 2:if(!(i<t.size)){e.next=12;break}return a=i+n,e.next=6,xc()(t.slice(i,a).arrayBuffer());case 6:return o=e.sent,i=a,e.next=10,o;case 10:e.next=2;break;case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof global&&global,"undefined"!=typeof document&&document;var Ec=Boolean("object"!==("undefined"==typeof process?"undefined":ui()(process))||"[object process]"!==String(process)||process.browser),Tc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Tc&&parseFloat(Tc[1]);function Sc(e,t){return Ec?function(e,t){return kc.apply(this,arguments)}(e,t):function(e,t){return Mc.apply(this,arguments)}(e,t)}function kc(){return(kc=Cc()(K.a.mark((function e(t,r){var n,i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.getReader(),e.prev=1;case 2:return a=i||n.read(),null!=r&&r._streamReadAhead&&(i=n.read()),e.next=7,xc()(a);case 7:if(o=e.sent,s=o.done,u=o.value,!s){e.next=12;break}return e.abrupt("return");case 12:return e.next=14,dc(u);case 14:e.next=2;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),n.releaseLock();case 21:case"end":return e.stop()}}),e,null,[[1,18]])})))).apply(this,arguments)}function Mc(){return(Mc=Cc()(K.a.mark((function e(t,r){var n,i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!1,i=!1,e.prev=2,o=cc()(t);case 4:return e.next=6,xc()(o.next());case 6:if(!(n=!(s=e.sent).done)){e.next=13;break}return u=s.value,e.next=10,dc(u);case 10:n=!1,e.next=4;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),i=!0,a=e.t0;case 19:if(e.prev=19,e.prev=20,!n||null==o.return){e.next=24;break}return e.next=24,xc()(o.return());case 24:if(e.prev=24,!i){e.next=27;break}throw a;case 27:return e.finish(24);case 28:return e.finish(19);case 29:case"end":return e.stop()}}),e,null,[[2,15,19,29],[20,,24,28]])})))).apply(this,arguments)}function Ic(e,t){if("string"==typeof e)return bc(e,t);if(e instanceof ArrayBuffer)return Bc(e,t);if(Ns(e))return function(e,t){return Oc.apply(this,arguments)}(e,t);if(Hs(e))return Sc(e,t);if(Us(e))return Sc(e.body,t);throw new Error("makeIterator")}var Pc="Cannot convert supplied data type";function Rc(e,t,r){if(t.text&&"string"==typeof e)return e;var n;if((n=e)&&"object"===ui()(n)&&n.isBuffer&&(e=e.buffer),e instanceof ArrayBuffer){var i=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);var a=e.buffer,o=e.byteLength||e.length;return 0===e.byteOffset&&o===a.byteLength||(a=a.slice(e.byteOffset,e.byteOffset+o)),a}throw new Error(Pc)}function Dc(e,t,r){return Fc.apply(this,arguments)}function Fc(){return(Fc=V()(K.a.mark((function e(t,r,n){var i,a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=3;break}return e.abrupt("return",Rc(t,r));case 3:if(!Ns(t)){e.next=7;break}return e.next=6,au(t);case 6:t=e.sent;case 7:if(!Us(t)){e.next=21;break}return a=t,e.next=11,su(a);case 11:if(!r.binary){e.next=17;break}return e.next=14,a.arrayBuffer();case 14:e.t0=e.sent,e.next=20;break;case 17:return e.next=19,a.text();case 19:e.t0=e.sent;case 20:return e.abrupt("return",e.t0);case 21:if(Hs(t)&&(t=Ic(t,n)),!Ls(t)&&!Gs(t)){e.next=24;break}return e.abrupt("return",vc(t));case 24:throw new Error(Pc);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jc(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 Lc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jc(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gc(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(r)return r;var n=Lc({fetch:Eu(t,e)},e);return Array.isArray(n.loaders)||(n.loaders=null),n}function Uc(e,t){if(!t&&e&&!Array.isArray(e))return e;var r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){var n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[].concat(q()(r),q()(n)):n}return r&&r.length?r:null}function Nc(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(t+1):""}function Hc(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(0,t):""}function Jc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="/";return(t=t.map((function(e,r){return r&&(e=e.replace(new RegExp("^".concat(n)),"")),r!==t.length-1&&(e=e.replace(new RegExp("".concat(n,"$")),"")),e}))).join(n)}r(37),r(57);var Vc=function(){var e=_u();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function zc(){return Vc()}function Kc(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 Qc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kc(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return qc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function qc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Wc=/\.([^.]+)$/;function Zc(e){return Yc.apply(this,arguments)}function Yc(){return(Yc=V()(K.a.mark((function e(t){var r,n,i,a,o=arguments;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:[],n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,tl(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(a=$c(t,r,Qc(Qc({},n),{},{nothrow:!0}),i))){e.next=8;break}return e.abrupt("return",a);case 8:if(!Ns(t)){e.next=13;break}return e.next=11,t.slice(0,10).arrayBuffer();case 11:t=e.sent,a=$c(t,r,n,i);case 13:if(a||null!=n&&n.nothrow){e.next=15;break}throw new Error(rl(t));case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!tl(e))return null;if(t&&!Array.isArray(t))return Qs(t);var i,a=[];(t&&(a=a.concat(t)),null!=r&&r.ignoreRegisteredLoaders)||(i=a).push.apply(i,q()(zc()));nl(a);var o=el(e,a,r,n);if(!(o||null!=r&&r.nothrow))throw new Error(rl(e));return o}function el(e,t,r,n){var i=ru(e),a=i.url,o=i.type,s=a||(null==n?void 0:n.url),u=null;return null!=r&&r.mimeType&&(u=il(t,null==r?void 0:r.mimeType)),u=(u=(u=(u=u||function(e,t){var r=t&&Wc.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();var r,n=Xc(e);try{for(n.s();!(r=n.n()).done;){var i,a=r.value,o=Xc(a.extensions);try{for(o.s();!(i=o.n()).done;){if(i.value.toLowerCase()===t)return a}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}return null}(e,n):null}(t,s))||il(t,o))||function(e,t){if(!t)return null;var r,n=Xc(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if("string"==typeof t){if(al(t,i))return i}else if(ArrayBuffer.isView(t)){if(ol(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer){if(ol(t,0,i))return i}}}catch(e){n.e(e)}finally{n.f()}return null}(t,e))||il(t,null==r?void 0:r.fallbackMimeType)}function tl(e){return!(e instanceof Response&&204===e.status)}function rl(e){var t=ru(e),r=t.url,i=t.type,a="No valid loader found (";a+=r?"".concat(n.filename(r),", "):"no url provided, ",a+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");var o=e?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return sl(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return sl(e,r,t)}return""}(e):"";return a+=o?' first bytes: "'.concat(o,'"'):"first bytes: not available",a+=")"}function nl(e){var t,r=Xc(e);try{for(r.s();!(t=r.n()).done;){Qs(t.value)}}catch(e){r.e(e)}finally{r.f()}}function il(e,t){var r,n=Xc(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(i.mimeTypes&&i.mimeTypes.includes(t))return i;if(t==="application/x.".concat(i.id))return i}}catch(e){n.e(e)}finally{n.f()}return null}function al(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some((function(t){return e.startsWith(t)}))}function ol(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some((function(n){return function(e,t,r,n){if(n instanceof ArrayBuffer)return function(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;for(var n=new Uint8Array(e),i=new Uint8Array(t),a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}(n,e,n.byteLength);switch(ui()(n)){case"function":return n(e,r);case"string":var i=sl(e,t,n.length);return n===i;default:return!1}}(e,t,r,n)}))}function sl(e,t,r){if(e.byteLength<t+r)return"";for(var n=new DataView(e),i="",a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function ul(e,t,r,n){return cl.apply(this,arguments)}function cl(){return(cl=V()(K.a.mark((function e(t,r,n,i){var a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Iu(!i||"object"===ui()(i)),!r||Array.isArray(r)||Ks(r)||(i=void 0,n=r,r=void 0),e.next=4,t;case 4:return t=e.sent,n=n||{},a=ru(t),o=a.url,s=Uc(r,i),e.next=11,Zc(t,s,n);case 11:if(u=e.sent){e.next=14;break}return e.abrupt("return",null);case 14:return n=Ou(n,u,s,o),i=Gc({url:o,parse:ul,loaders:s},n,i),e.next=18,ll(u,t,n,i);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ll(e,t,r,n){return fl.apply(this,arguments)}function fl(){return(fl=V()(K.a.mark((function e(t,r,n,i){return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Pu(t),e.next=3,Dc(r,t,n);case 3:if(r=e.sent,!t.parseTextSync||"string"!=typeof r){e.next=7;break}return n.dataType="text",e.abrupt("return",t.parseTextSync(r,n,i,t));case 7:if(!nc(t,n)){e.next=11;break}return e.next=10,ic(t,r,n,i,ul);case 10:return e.abrupt("return",e.sent);case 11:if(!t.parseText||"string"!=typeof r){e.next=15;break}return e.next=14,t.parseText(r,n,i,t);case 14:return e.abrupt("return",e.sent);case 15:if(!t.parse){e.next=19;break}return e.next=18,t.parse(r,n,i,t);case 18:return e.abrupt("return",e.sent);case 19:throw Iu(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"));case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hl(e,t,r,n){return dl.apply(this,arguments)}function dl(){return(dl=V()(K.a.mark((function e(t,r,n,i){var a,o;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(r)||Ks(r)||(void 0,n=r,r=void 0),a=Eu(n),o=t,"string"!=typeof t){e.next=7;break}return e.next=6,a(t);case 6:o=e.sent;case 7:if(!Ns(t)){e.next=11;break}return e.next=10,a(t);case 10:o=e.sent;case 11:return e.next=13,ul(o,r,n);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pl=r(66),yl=r.n(pl),vl=r(67),gl=r.n(vl),ml=r(68),bl=r.n(ml),Al=(Math.max(6378137,6378137,6356752.314245179),function(e){return e}),Bl=new qe;function wl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Al;return ge(e)?(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]):"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z),t}function xl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bl;return wl(e,t,pe._cartographicRadians?Al:be)}function _l(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Al;return ge(t)?(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]):"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]),t}function Cl(e,t){return _l(e,t,pe._cartographicRadians?Al:Ae)}var Ol=new qe,El=new qe,Tl=new qe;var Sl=new qe,kl={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Ml={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Il={east:new qe,north:new qe,up:new qe,west:new qe,south:new qe,down:new qe},Pl=new qe,Rl=new qe,Dl=new qe;function Fl(e,t,r,n,i,a){var o,s,u,c=kl[t]&&kl[t][r];fe(c&&(!n||n===c));var l=Sl.copy(i);if(_e(l.x,0,1e-14)&&_e(l.y,0,1e-14)){var f=Math.sign(l.z);o=Pl.fromArray(Ml[t]),"east"!==t&&"west"!==t&&o.scale(f),s=Rl.fromArray(Ml[r]),"east"!==r&&"west"!==r&&s.scale(f),u=Dl.fromArray(Ml[n]),"east"!==n&&"west"!==n&&u.scale(f)}else{var h=Il.up,d=Il.east,p=Il.north;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,h),p.copy(h).cross(d);var y=Il.west,v=Il.south;Il.down.copy(h).scale(-1),y.copy(d).scale(-1),v.copy(p).scale(-1),o=Il[t],s=Il[r],u=Il[n]}return a[0]=o.x,a[1]=o.y,a[2]=o.z,a[3]=0,a[4]=s.x,a[5]=s.y,a[6]=s.z,a[7]=0,a[8]=u.x,a[9]=u.y,a[10]=u.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var jl,Ll=new qe,Gl=new qe,Ul=new qe,Nl=new qe,Hl=new qe,Jl=new qe,Vl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;gl()(this,e),fe(t>=0),fe(r>=0),fe(n>=0),this.radii=new qe(t,r,n),this.radiiSquared=new qe(t*t,r*r,n*n),this.radiiToTheFourth=new qe(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new qe(0===t?0:1/t,0===r?0:1/r,0===n?0:1/n),this.oneOverRadiiSquared=new qe(0===t?0:1/(t*t),0===r?0:1/(r*r),0===n?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.centerToleranceSquared=Pr,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return bl()(e,[{key:"equals",value:function(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=Gl,n=Ul,i=yl()(e,3),a=i[2];this.geodeticSurfaceNormalCartographic(e,r),n.copy(this.radiiSquared).scale(r);var o=Math.sqrt(r.dot(n));return n.scale(1/o),r.scale(a),n.add(r),n.to(t)}},{key:"cartesianToCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Jl.from(e);var r=this.scaleToGeodeticSurface(Jl,Nl);if(r){var n=this.geodeticSurfaceNormal(r,Gl),i=Hl;i.copy(Jl).subtract(r);var a=Math.atan2(n.y,n.x),o=Math.asin(n.z),s=Math.sign(Le(i,Jl))*Fe(i);return Cl([a,o,s],t)}}},{key:"eastNorthUpToFixedFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ir;return Fl(this,"east","north","up",e,t)}},{key:"localFrameToFixedFrame",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Ir;return Fl(this,e,t,r,n,i)}},{key:"geocentricSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Ll.from(e).normalize().to(t)}},{key:"geodeticSurfaceNormalCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=xl(e),n=r[0],i=r[1],a=Math.cos(i);return Ll.set(a*Math.cos(n),a*Math.sin(n),Math.sin(i)).normalize(),Ll.to(t)}},{key:"geodeticSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Ll.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}},{key:"scaleToGeodeticSurface",value:function(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new qe,n=t.oneOverRadii,i=t.oneOverRadiiSquared,a=t.centerToleranceSquared;Ol.from(e);var o=e.x,s=e.y,u=e.z,c=n.x,l=n.y,f=n.z,h=o*o*c*c,d=s*s*l*l,p=u*u*f*f,y=h+d+p,v=Math.sqrt(1/y);if(Number.isFinite(v)){var g=El;if(g.copy(e).scale(v),y<a)return g.to(r);var m=i.x,b=i.y,A=i.z,B=Tl;B.set(g.x*m*2,g.y*b*2,g.z*A*2);var w,x,_,C,O=(1-v)*e.len()/(.5*B.len()),E=0;do{var T=(w=1/(1+(O-=E)*m))*w,S=(x=1/(1+O*b))*x,k=(_=1/(1+O*A))*_,M=T*w,I=S*x,P=k*_,R=h*M*m+d*I*b+p*P*A,D=-2*R;E=(C=h*T+d*S+p*k-1)/D}while(Math.abs(C)>Rr);return Ol.scale([w,x,_]).to(r)}}(e,this,t)}},{key:"scaleToGeocentricSurface",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Nl.from(e);var r=Nl.x,n=Nl.y,i=Nl.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*a.x+n*n*a.y+i*i*a.z);return Nl.multiplyScalar(o).to(t)}},{key:"transformPositionToScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Nl.from(e).scale(this.oneOverRadii).to(t)}},{key:"transformPositionFromScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Nl.from(e).scale(this.radii).to(t)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];fe(_e(this.radii.x,this.radii.y,Dr)),fe(this.radii.z>0),Nl.from(e);var n=Nl.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Nl.set(0,0,n).to(r)}}],[{key:"WGS84",get:function(){return jl=jl||new e(6378137,6378137,6356752.314245179)}}]),e}(),zl=function e(t,r,n){h()(this,e),En(this,"item",void 0),En(this,"previous",void 0),En(this,"next",void 0),this.item=t,this.previous=r,this.next=n},Kl=function(){function e(){h()(this,e),En(this,"head",null),En(this,"tail",null),En(this,"_length",0)}return x()(e,[{key:"length",get:function(){return this._length}},{key:"add",value:function(e){var t=new zl(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}},{key:"remove",value:function(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}},{key:"splice",value:function(e,t){e!==t&&(this.remove(t),this._insert(e,t))}},{key:"_insert",value:function(e,t){var r=e.next;e.next=t,this.tail===e?this.tail=t:r.previous=t,t.next=r,t.previous=e,++this._length}}]),e}();function Ql(e){return null!=e}var Xl=function(){function e(){h()(this,e),En(this,"_list",void 0),En(this,"_sentinel",void 0),En(this,"_trimTiles",void 0),this._list=new Kl,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return x()(e,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(e){var t=e._cacheNode;Ql(t)&&this._list.splice(this._sentinel,t)}},{key:"add",value:function(e,t,r){Ql(t._cacheNode)||(t._cacheNode=this._list.add(t),r&&r(e,t))}},{key:"unloadTile",value:function(e,t,r){var n=t._cacheNode;Ql(n)&&(this._list.remove(n),t._cacheNode=void 0,r&&r(e,t))}},{key:"unloadTiles",value:function(e,t){var r=this._trimTiles;this._trimTiles=!1;for(var n=this._list,i=1024*e.maximumMemoryUsage*1024,a=this._sentinel,o=n.head;o!==a&&(e.gpuMemoryUsageInBytes>i||r);){var s=o.item;o=o.next,this.unloadTile(e,s,t)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),e}();var ql=new qe,Wl=new qe,Zl=new _r([new mr,new mr,new mr,new mr,new mr,new mr]);function Yl(e,t){var r=e.cameraDirection,n=e.cameraUp,i=e.height,a=e.distanceScales.metersPerUnit,o=[e.longitude,e.latitude,0],s=Vl.WGS84.cartographicToCartesian(o,new qe),u=Vl.WGS84.eastNorthUpToFixedFrame(s),c=e.unprojectPosition(e.cameraPosition),l=Vl.WGS84.cartographicToCartesian(c,new qe),f=new qe(u.transformAsVector(new qe(r).scale(a))).normalize(),h=new qe(u.transformAsVector(new qe(n).scale(a))).normalize();return function(e,t){var r=e.getFrustumPlanes(),n=0;for(var i in r){var a=r[i],o=a.normal.dot(e.center);Wl.copy(a.normal).scale(a.distance-o).add(e.center);var s=e.unprojectPosition(Wl),u=Vl.WGS84.cartographicToCartesian(s,new qe);Zl.planes[n++].fromPointNormal(u,ql.copy(t).subtract(u))}}(e,s),{camera:{position:l,direction:f,up:h},viewport:e,height:i,cullingVolume:Zl,frameNumber:t,sseDenominator:1.15}}var $l=new qe;function ef(e){var t=e.halfAxes,r=e.radius,n=e.width,i=e.height;if(t){var a=function(e){e.getColumn(0,$l);var t=e.getColumn(1),r=e.getColumn(2);return $l.add(t).add(r).len()}(t);return Math.log2(6356752.314245179/a)}return r?Math.log2(6356752.314245179/r):i&&n?(Math.log2(6378137/n)+Math.log2(6378137/i))/2:1}var tf=0,rf=1,nf=3,af=4,of=5,sf=1,uf=2,cf="empty",lf="scenegraph",ff="pointcloud",hf="mesh",df="I3S",pf="TILES3D",yf="geometricError",vf=1;function gf(e){return null!=e}var mf=new qe,bf=new qe,Af=new qe;function Bf(e,t,r){if(Js(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,r){var n=new qe(e[0],e[1],e[2]);t.transform(n,n);var i=[];if(10===e.length){var a=e.slice(3,6),o=new Yt;o.fromArray(e,6);var s=new qe([1,0,0]),u=new qe([0,1,0]),c=new qe([0,0,1]);s.transformByQuaternion(o),s.scale(a[0]),u.transformByQuaternion(o),u.scale(a[1]),c.transformByQuaternion(o),c.scale(a[2]),i=[].concat(q()(s.toArray()),q()(u.toArray()),q()(c.toArray()))}else i=[].concat(q()(e.slice(3,6)),q()(e.slice(6,9)),q()(e.slice(9,12)));var l=t.transformAsVector(i.slice(0,3)),f=t.transformAsVector(i.slice(3,6)),h=t.transformAsVector(i.slice(6,9)),d=new _t([l[0],l[1],l[2],f[0],f[1],f[2],h[0],h[1],h[2]]);if(gf(r))return r.center=n,r.halfAxes=d,r;return new yr(n,d)}(e.box,t,r);if(e.region){var n=E()(e.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5],l=Vl.WGS84.cartographicToCartesian([Be(i),Be(s),u],bf),f=Vl.WGS84.cartographicToCartesian([Be(o),Be(a),c],Af),h=(new qe).addVectors(l,f).multiplyScalar(.5),d=(new qe).subVectors(l,f).len()/2;return wf([h[0],h[1],h[2],d],new Ir)}if(e.sphere)return wf(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function wf(e,t,r){var n=new qe(e[0],e[1],e[2]);t.transform(n,n);var i=t.getScale(mf),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return gf(r)?(r.center=n,r.radius=o,r):new lt(n,o)}new qe,new qe,new Ir,new qe,new qe,new qe;function xf(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){var r=e.dynamicScreenSpaceErrorComputedDensity,n=e.dynamicScreenSpaceErrorFactor;return function(e,t){var r=e*t;return 1-Math.exp(-r*r)}(t,r)*n}return 0}function _f(e,t){var r=t.viewport,n=new(0,r.constructor)({longitude:r.longitude,latitude:r.latitude,height:r.height,width:r.width,bearing:r.bearing,zoom:r.zoom,pitch:0}),i=e.header.mbs[1],a=e.header.mbs[0],o=e.header.mbs[2],s=e.header.mbs[3],u=q()(e.boundingVolume.center),c=n.unprojectPosition(n.cameraPosition),l=Vl.WGS84.cartographicToCartesian(c,new qe),f=new qe(l).subtract(u).normalize(),h=new Ir;Vl.WGS84.eastNorthUpToFixedFrame(u,h);var d=new Ir(h).invert(),p=new qe(l).transform(d),y=Math.sqrt(p[0]*p[0]+p[1]*p[1]),v=y*y/p[2],g=new qe([p[0],p[1],v]).transform(h),m=new qe(g).subtract(u).normalize(),b=f.cross(m).normalize().scale(s),A=new qe(u).add(b),B=Vl.WGS84.cartesianToCartographic(A),w=n.project([a,i,o]),x=n.project(B);return new qe(w).subtract(x).magnitude()}var Cf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;h()(this,e),En(this,"_map",new Map),En(this,"_array",void 0),En(this,"_length",void 0),this._array=new Array(t),this._length=t}return x()(e,[{key:"length",get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},{key:"values",get:function(){return this._array}},{key:"get",value:function(e){return Js(e<this._array.length),this._array[e]}},{key:"set",value:function(e,t){Js(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}},{key:"delete",value:function(e){var t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(e){if(!this._map.has(e)){var t=this.length++;this._array[t]=e,this._map.set(e,t)}}},{key:"pop",value:function(){var e=this._array[--this.length];return this._map.delete(e),e}},{key:"reserve",value:function(e){Js(e>=0),e>this._array.length&&(this._array.length=e)}},{key:"resize",value:function(e){Js(e>=0),this.length=e}},{key:"trim",value:function(e){null==e&&(e=this.length),this._array.length=e}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(e){return this._map.has(e)}}]),e}();function Of(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ef(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ef(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ef(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Tf(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 Sf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tf(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var kf={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Mf=function(){function e(t){h()(this,e),En(this,"options",void 0),En(this,"root",void 0),En(this,"requestedTiles",void 0),En(this,"selectedTiles",void 0),En(this,"emptyTiles",void 0),En(this,"_traversalStack",void 0),En(this,"_emptyTraversalStack",void 0),En(this,"_frameNumber",void 0),this.options=Sf(Sf({},kf),t),this._traversalStack=new Cf,this._emptyTraversalStack=new Cf,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return x()(e,[{key:"traverse",value:function(e,t,r){this.root=e,this.options=Sf(Sf({},this.options),r),this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(e,t){var r=this._traversalStack;for(e._selectionDepth=1,r.push(e);r.length>0;){var n=r.pop(),i=!1;this.canTraverse(n,t)&&(this.updateChildTiles(n,t),i=this.updateAndPushChildren(n,t,r,n.hasRenderContent?n._selectionDepth+1:n._selectionDepth));var a=n.parent,o=Boolean(!a||a._shouldRefine),s=!i;n.hasRenderContent?n.refine===sf?(this.loadTile(n,t),this.selectTile(n,t)):n.refine===uf&&(this.loadTile(n,t),s&&this.selectTile(n,t)):(this.emptyTiles[n.id]=n,this.loadTile(n,t),s&&this.selectTile(n,t)),this.touchTile(n,t),n._shouldRefine=i&&o}this.options.onTraversalEnd(t)}},{key:"updateChildTiles",value:function(e,t){var r,n=Of(e.children);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.updateTile(i,t)}}catch(e){n.e(e)}finally{n.f()}return!0}},{key:"updateAndPushChildren",value:function(e,t,r,n){var i=this.options,a=i.loadSiblings,o=i.skipLevelOfDetail,s=e.children;s.sort(this.compareDistanceToCamera.bind(this));var u,c=e.refine===uf&&e.hasRenderContent&&!o,l=!1,f=!0,h=Of(s);try{for(h.s();!(u=h.n()).done;){var d=u.value;if(d._selectionDepth=n,d.isVisibleAndInRequestVolume?(r.find(d)&&r.delete(d),r.push(d),l=!0):(c||a)&&(this.loadTile(d,t),this.touchTile(d,t)),c){var p=void 0;if(p=!!d._inRequestVolume&&(d.hasRenderContent?d.contentAvailable:this.executeEmptyTraversal(d,t)),!(f=f&&p))return!1}}}catch(e){h.e(e)}finally{h.f()}return l||(f=!1),f}},{key:"updateTile",value:function(e,t){this.updateTileVisibility(e,t)}},{key:"selectTile",value:function(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}},{key:"loadTile",value:function(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}},{key:"touchTile",value:function(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}},{key:"canTraverse",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!e.hasChildren&&(e.hasTilesetContent?!e.contentExpired:!(!n&&!e.isVisibleAndInRequestVolume)&&this.shouldRefine(e,t,r))}},{key:"shouldLoadTile",value:function(e){return e.hasUnloadedContent||e.contentExpired}},{key:"shouldSelectTile",value:function(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(e,t,r){var n=e._screenSpaceError;return r&&(n=e.getScreenSpaceError(t,!0)),n>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(e,t){var r=[];if(this.options.viewportTraversersMap)for(var n in this.options.viewportTraversersMap){this.options.viewportTraversersMap[n]===t.viewport.id&&r.push(n)}else r.push(t.viewport.id);e.updateVisibility(t,r)}},{key:"compareDistanceToCamera",value:function(e,t){return e._distanceToCamera-t._distanceToCamera}},{key:"anyChildrenVisible",value:function(e,t){var r,n=!1,i=Of(e.children);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.updateVisibility(t),n=n||a.isVisibleAndInRequestVolume}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"executeEmptyTraversal",value:function(e,t){var r=!0,n=this._emptyTraversalStack;for(n.push(e);n.length>0&&r;){var i=n.pop();if(this.updateTile(i,t),i.isVisibleAndInRequestVolume||this.loadTile(i,t),this.touchTile(i,t),!i.hasRenderContent&&this.canTraverse(i,t,!1,!0)){var a,o=Of(i.children);try{for(o.s();!(a=o.n()).done;){var s=a.value;n.find(s)&&n.delete(s),n.push(s)}}catch(e){o.e(e)}finally{o.f()}}else i.contentAvailable||(r=!1)}return r}}]),e}();function If(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 Pf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?If(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):If(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Rf=new qe;var Df=function(){function e(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";h()(this,e),En(this,"tileset",void 0),En(this,"header",void 0),En(this,"id",void 0),En(this,"url",void 0),En(this,"parent",void 0),En(this,"refine",void 0),En(this,"type",void 0),En(this,"contentUrl",void 0),En(this,"lodMetricType",void 0),En(this,"lodMetricValue",void 0),En(this,"boundingVolume",void 0),En(this,"content",void 0),En(this,"contentState",void 0),En(this,"gpuMemoryUsageInBytes",void 0),En(this,"children",void 0),En(this,"depth",void 0),En(this,"viewportIds",void 0),En(this,"transform",void 0),En(this,"extensions",void 0),En(this,"userData",void 0),En(this,"computedTransform",void 0),En(this,"hasEmptyContent",void 0),En(this,"hasTilesetContent",void 0),En(this,"traverser",void 0),En(this,"_cacheNode",void 0),En(this,"_frameNumber",void 0),En(this,"_lodJudge",void 0),En(this,"_expireDate",void 0),En(this,"_expiredContent",void 0),En(this,"_shouldRefine",void 0),En(this,"_distanceToCamera",void 0),En(this,"_centerZDepth",void 0),En(this,"_screenSpaceError",void 0),En(this,"_visibilityPlaneMask",void 0),En(this,"_visible",void 0),En(this,"_inRequestVolume",void 0),En(this,"_stackLength",void 0),En(this,"_selectionDepth",void 0),En(this,"_touchedFrame",void 0),En(this,"_visitedFrame",void 0),En(this,"_selectedFrame",void 0),En(this,"_requestedFrame",void 0),En(this,"_priority",void 0),En(this,"_contentBoundingVolume",void 0),En(this,"_viewerRequestVolume",void 0),En(this,"_initialTransform",void 0),this.header=r,this.tileset=t,this.id=i||r.id,this.url=r.url,this.parent=n,this.refine=this._getRefine(r.refine),this.type=r.type,this.contentUrl=r.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=tf,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new Mf({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new Ir,this.transform=new Ir,this._initializeLodMetric(r),this._initializeTransforms(r),this._initializeBoundingVolumes(r),this._initializeContent(r),this._initializeRenderingState(r),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}var t;return x()(e,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return null===this.header}},{key:"selected",get:function(){return this._selectedFrame===this.tileset._frameNumber}},{key:"isVisible",get:function(){return this._visible}},{key:"isVisibleAndInRequestVolume",get:function(){return this._visible&&this._inRequestVolume}},{key:"hasRenderContent",get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent}},{key:"hasChildren",get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0}},{key:"contentReady",get:function(){return this.contentState===nf||this.hasEmptyContent}},{key:"contentAvailable",get:function(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}},{key:"hasUnloadedContent",get:function(){return this.hasRenderContent&&this.contentUnloaded}},{key:"contentUnloaded",get:function(){return this.contentState===tf}},{key:"contentExpired",get:function(){return this.contentState===af}},{key:"contentFailed",get:function(){return this.contentState===of}},{key:"getScreenSpaceError",value:function(e,t){switch(this.tileset.type){case df:return _f(this,e);case pf:return function(e,t,r){var n=e.tileset,i=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=r?i:e.lodMetricValue;if(0===a)return 0;var o=Math.max(e._distanceToCamera,1e-7),s=t.height,u=t.sseDenominator,c=a*s*(n.options.viewDistanceScale||1)/(o*u);return c-=xf(n,o)}(this,e,t);default:throw new Error("Unsupported tileset type")}}},{key:"_getPriority",value:function(){var e=this.tileset._traverser,t=e.options.skipLevelOfDetail,r=this.refine===sf||t;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===tf)return-1;var n=this.parent,i=n&&(!r||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,a=e.root?e.root._screenSpaceError:0;return Math.max(a-i,0)}},{key:"loadContent",value:(t=V()(K.a.mark((function e(){var t,r,n,i;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.hasEmptyContent){e.next=2;break}return e.abrupt("return",!1);case 2:if(!this.content){e.next=4;break}return e.abrupt("return",!0);case 4:return this.contentExpired&&(this._expireDate=null),this.contentState=rf,e.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(t=e.sent){e.next=13;break}return this.contentState=tf,e.abrupt("return",!1);case 13:return e.prev=13,r=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,i=Pf(Pf({},this.tileset.loadOptions),{},C()({},n.id,Pf(Pf({},this.tileset.loadOptions[n.id]),{},{isTileset:"json"===this.type},this._getLoaderSpecificOptions(n.id)))),e.next=19,hl(r,n,i);case 19:if(this.content=e.sent,!this.tileset.options.contentLoader){e.next=23;break}return e.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=nf,this._onContentLoaded(),e.abrupt("return",!0);case 29:throw e.prev=29,e.t0=e.catch(13),this.contentState=of,e.t0;case 33:return e.prev=33,t.done(),e.finish(33);case 36:case"end":return e.stop()}}),e,this,[[13,29,33,36]])}))),function(){return t.apply(this,arguments)})},{key:"unloadContent",value:function(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=tf,!0}},{key:"updateVisibility",value:function(e,t){if(this._frameNumber!==e.frameNumber){var r=this.parent,n=r?r._visibilityPlaneMask:_r.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var i=r?r.computedTransform:this.tileset.modelMatrix;this._updateTransform(i)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,n),this._visible=this._visibilityPlaneMask!==_r.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}}},{key:"visibility",value:function(e,t){var r=e.cullingVolume,n=this.boundingVolume;return r.computeVisibilityWithPlaneMask(n,t)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(e){var t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(e){var t=e.camera,r=this.boundingVolume;return Rf.subVectors(r.center,t.position),t.direction.dot(Rf)}},{key:"insideViewerRequestVolume",value:function(e){var t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}},{key:"updateExpiration",value:function(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){var e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=af,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(e){"lodMetricType"in e?this.lodMetricType=e.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}},{key:"_initializeTransforms",value:function(e){this.transform=e.transform?new Ir(e.transform):new Ir;var t=this.parent,r=this.tileset,n=t&&t.computedTransform?t.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new Ir(n).multiplyRight(this.transform);var i=t&&t._initialTransform?t._initialTransform.clone():new Ir;this._initialTransform=new Ir(i).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}},{key:"_initializeContent",value:function(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=tf,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=_r.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}},{key:"_getRefine",value:function(e){return e||this.parent&&this.parent.refine||uf}},{key:"_isTileset",value:function(){return-1!==this.contentUrl.indexOf(".json")}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}},{key:"_updateBoundingVolume",value:function(e){this.boundingVolume=Bf(e.boundingVolume,this.computedTransform,this.boundingVolume);var t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=Bf(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=Bf(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ir,t=e.clone().multiplyRight(this.transform),r=!t.equals(this.computedTransform);r&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(e){switch(e){case"i3s":return Pf(Pf({},this.tileset.options.i3s),{},{tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(t=this.tileset.tileset).asset&&t.asset.gltfUpAxis||"Y"}}var t}}]),e}();function Ff(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var jf=function(e){p()(r,e);var t=Ff(r);function r(){return h()(this,r),t.apply(this,arguments)}return x()(r,[{key:"compareDistanceToCamera",value:function(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}},{key:"updateTileVisibility",value:function(e,t){if(Xn()(m()(r.prototype),"updateTileVisibility",this).call(this,e,t),e.isVisibleAndInRequestVolume){var n=e.children.length>0;if(e.hasTilesetContent&&n){var i=e.children[0];return this.updateTileVisibility(i,t),void(e._visible=i._visible)}if(this.meetsScreenSpaceErrorEarly(e,t))e._visible=!1;else{var a=e.refine===uf,o=e._optimChildrenWithinParent===vf;a&&o&&n&&!this.anyChildrenVisible(e,t)&&(e._visible=!1)}}}},{key:"meetsScreenSpaceErrorEarly",value:function(e,t){var r=e.parent;return!(!r||r.hasTilesetContent||r.refine!==sf)&&!this.shouldRefine(e,t,!0)}}]),r}(Mf),Lf="REQUESTED",Gf="COMPLETED",Uf="ERROR",Nf=function(){function e(){h()(this,e),En(this,"_statusMap",void 0),this._statusMap={}}return x()(e,[{key:"add",value:function(e,t,r,n){var i=this;this._statusMap[t]||(this._statusMap[t]={request:e,callback:r,key:t,frameState:n,status:Lf},e().then((function(e){i._statusMap[t].status=Gf,i._statusMap[t].callback(e,n)})).catch((function(e){i._statusMap[t].status=Uf,r(e)})))}},{key:"update",value:function(e,t){this._statusMap[e]&&(this._statusMap[e].frameState=t)}},{key:"find",value:function(e){return this._statusMap[e]}}]),e}();function Hf(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 Jf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hf(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vf(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return zf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zf(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function zf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Kf(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var Qf=function(e){p()(n,e);var t,r=Kf(n);function n(e){var t;return h()(this,n),t=r.call(this,e),En(wi()(t),"_tileManager",void 0),t._tileManager=new Nf,t}return x()(n,[{key:"shouldRefine",value:function(e,t){return e._lodJudge=function(e,t){if(0===e.lodMetricValue||isNaN(e.lodMetricValue))return"DIG";var r=2*_f(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}(e,t),"DIG"===e._lodJudge}},{key:"updateChildTiles",value:function(e,t){var r,n=this,i=e.header.children||[],a=e.children,o=e.tileset,s=Vf(i);try{var u=function(){var i=r.value,s="".concat(i.id,"-").concat(t.viewport.id),u=a&&a.find((function(e){return e.id===s}));if(u)u&&n.updateTile(u,t);else{var c=function(){return n._loadTile(i.id,o)};n._tileManager.find(s)?n._tileManager.update(s,t):(o.tileset.nodePages&&(c=function(){return o.tileset.nodePagesTile.formTileFromNodePages(i.id)}),n._tileManager.add(c,s,(function(t){return n._onTileLoad(t,e,s)}),t))}};for(s.s();!(r=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}return!1}},{key:"_loadTile",value:(t=V()(K.a.mark((function e(t,r){var n,i,a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.loader,i=r.getTileUrl("".concat(r.url,"/nodes/").concat(t)),a=Jf(Jf({},r.loadOptions),{},{i3s:Jf(Jf({},r.loadOptions.i3s),{},{isTileHeader:!0,loadContent:!1})}),e.next=5,hl(i,n,a);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})},{key:"_onTileLoad",value:function(e,t,r){var n=new Df(t.tileset,e,t,r);t.children.push(n);var i=this._tileManager.find(n.id).frameState;this.updateTile(n,i),this._frameNumber===i.frameNumber&&this.executeTraversal(n,i)}}]),n}(Mf);function Xf(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return qf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qf(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function qf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wf(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 Zf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wf(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Yf={description:"",ellipsoid:Vl.WGS84,modelMatrix:new Ir,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(e){return e},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},$f=function(){function e(t,r){h()(this,e),En(this,"options",void 0),En(this,"loadOptions",void 0),En(this,"type",void 0),En(this,"tileset",void 0),En(this,"loader",void 0),En(this,"url",void 0),En(this,"basePath",void 0),En(this,"modelMatrix",void 0),En(this,"ellipsoid",void 0),En(this,"lodMetricType",void 0),En(this,"lodMetricValue",void 0),En(this,"refine",void 0),En(this,"root",void 0),En(this,"roots",void 0),En(this,"asset",void 0),En(this,"description",void 0),En(this,"properties",void 0),En(this,"extras",void 0),En(this,"attributions",void 0),En(this,"credits",void 0),En(this,"stats",void 0),En(this,"traverseCounter",void 0),En(this,"geometricError",void 0),En(this,"selectedTiles",void 0),En(this,"cartographicCenter",void 0),En(this,"cartesianCenter",void 0),En(this,"zoom",void 0),En(this,"boundingVolume",void 0),En(this,"gpuMemoryUsageInBytes",void 0),En(this,"dynamicScreenSpaceErrorComputedDensity",void 0),En(this,"_traverser",void 0),En(this,"_cache",void 0),En(this,"_requestScheduler",void 0),En(this,"_frameNumber",void 0),En(this,"_queryParamsString",void 0),En(this,"_queryParams",void 0),En(this,"_extensionsUsed",void 0),En(this,"_tiles",void 0),En(this,"_pendingCount",void 0),En(this,"lastUpdatedVieports",void 0),En(this,"_requestedTiles",void 0),En(this,"_emptyTiles",void 0),En(this,"frameStateData",void 0),En(this,"maximumMemoryUsage",void 0),Js(t),this.options=Zf(Zf({},Yf),r),this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||n.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new Xl,this._requestScheduler=new Dn({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new kn({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this._initializeTileSet(t)}var t;return x()(e,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return 0===this._pendingCount&&0!==this._frameNumber}},{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"frameNumber",get:function(){return this._frameNumber}},{key:"queryParams",get:function(){return this._queryParamsString||(this._queryParamsString=function(e){for(var t=[],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];t.push("".concat(i,"=").concat(e[i]))}switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}},{key:"setProps",value:function(e){this.options=Zf(Zf({},this.options),e)}},{key:"setOptions",value:function(e){this.options=Zf(Zf({},this.options),e)}},{key:"getTileUrl",value:function(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}},{key:"hasExtension",value:function(e){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(e)>-1)}},{key:"update",value:function(e){if((!("loadTiles"in this.options)||this.options.loadTiles)&&!(this.traverseCounter>0)){!e&&this.lastUpdatedVieports?e=this.lastUpdatedVieports:this.lastUpdatedVieports=e,e instanceof Array||(e=[e]),this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;var t,r=[],n=Xf(e);try{for(n.s();!(t=n.n()).done;){var i=t.value.id;this._needTraverse(i)?r.push(i):this.traverseCounter--}}catch(e){n.e(e)}finally{n.f()}var a,o=Xf(e);try{for(o.s();!(a=o.n()).done;){var s=a.value,u=s.id;if(this.roots[u]||(this.roots[u]=this._initializeTileHeaders(this.tileset,null)),r.includes(u)){var c=Yl(s,this._frameNumber);this._traverser.traverse(this.roots[u],c,this.options)}}}catch(e){o.e(e)}finally{o.f()}}}},{key:"_needTraverse",value:function(e){var t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}},{key:"_onTraversalEnd",value:function(e){var t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var r=this.frameStateData[t],n=Object.values(this._traverser.selectedTiles);r.selectedTiles=n,r._requestedTiles=Object.values(this._traverser.requestedTiles),r._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}},{key:"_updateTiles",value:function(){for(var e in this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[],this.frameStateData){var t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);var r,n=Xf(this.selectedTiles);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._tiles[i.id]=i}}catch(e){n.e(e)}finally{n.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(e,t){if(e.length!==t.length)return!0;var r=new Set(e.map((function(e){return e.id}))),n=new Set(t.map((function(e){return e.id}))),i=e.filter((function(e){return!n.has(e.id)})).length>0;return i=i||t.filter((function(e){return!r.has(e.id)})).length>0}},{key:"_loadTiles",value:function(){var e,t=Xf(this._requestedTiles);try{for(t.s();!(e=t.n()).done;){var r=e.value;r.contentUnloaded&&this._loadTile(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,(function(e,t){return e._unloadTile(t)}))}},{key:"_updateStats",value:function(){var e,t=0,r=0,n=Xf(this.selectedTiles);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.contentAvailable&&i.content&&(t++,i.content.pointCount&&(r+=i.content.pointCount))}}catch(e){n.e(e)}finally{n.f()}this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=t,this.stats.get("Points").count=r}},{key:"_initializeTileSet",value:function(e){this.root=this._initializeTileHeaders(e,null),this.type===pf&&this._initializeCesiumTileset(e),this.type===df&&this._initializeI3STileset(),this._calculateViewProps()}},{key:"_calculateViewProps",value:function(){var e=this.root;Js(e);var t=e.boundingVolume.center;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new qe,void(this.zoom=1);this.cartographicCenter=Vl.WGS84.cartesianToCartographic(t,new qe),this.cartesianCenter=t,this.zoom=ef(e.boundingVolume)}},{key:"_initializeStats",value:function(){this.stats.get("Tiles In Tileset(s)"),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points","memory"),this.stats.get("Tile Memory Use","memory")}},{key:"_initializeTileHeaders",value:function(e,t){var r=new Df(this,e.root,t);if(t&&(t.children.push(r),r.depth=t.depth+1),this.type===pf){var n=[];for(n.push(r);n.length>0;){var i=n.pop();this.stats.get("Tiles In Tileset(s)").incrementCount();var a,o=Xf(i.header.children||[]);try{for(o.s();!(a=o.n()).done;){var s=a.value,u=new Df(this,s,i);i.children.push(u),u.depth=i.depth+1,n.push(u)}}catch(e){o.e(e)}finally{o.f()}}}return r}},{key:"_initializeTraverser",value:function(){var e;switch(this.type){case pf:e=jf;break;case df:e=Qf;break;default:e=Mf}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(e){this._destroySubtree(e)}},{key:"_loadTile",value:(t=V()(K.a.mark((function e(t){var r;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this._onStartTileLoading(),e.next=4,t.loadContent();case 4:r=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),this._onTileLoadError(t,e.t0);case 10:return e.prev=10,this._onEndTileLoading(),this._onTileLoad(t,r),e.finish(10);case 14:case"end":return e.stop()}}),e,this,[[0,7,10,14]])}))),function(e){return t.apply(this,arguments)})},{key:"_onTileLoadError",value:function(e,t){this.stats.get("Failed Tile Loads").incrementCount();var r=t.message||t.toString(),n=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(r)),this.options.onTileError(e,r,n)}},{key:"_onTileLoad",value:function(e,t){t&&(e&&e.content&&function(e,t){Js(e),Js(t);var r=t.rtcCenter,n=t.gltfUpAxis,i=e.computedTransform,a=e.boundingVolume.center,o=new Ir(i);switch(r&&o.translate(r),n){case"Z":break;case"Y":var s=(new Ir).rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=(new Ir).rotateY(-Math.PI/2);o=o.multiplyRight(u)}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);var c=new qe(a);t.cartesianModelMatrix=o,t.cartesianOrigin=c;var l=Vl.WGS84.cartesianToCartographic(c,new qe),f=Vl.WGS84.eastNorthUpToFixedFrame(c).invert();t.cartographicModelMatrix=f.multiplyRight(o),t.cartographicOrigin=l,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}(e,e.content),this._addTileToCache(e),this.options.onTileLoad(e))}},{key:"_onStartTileLoading",value:function(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}},{key:"_onEndTileLoading",value:function(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}},{key:"_addTileToCache",value:function(e){this._cache.add(this,e,(function(t){return t._updateCacheStats(e)}))}},{key:"_updateCacheStats",value:function(e){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(e){this.gpuMemoryUsageInBytes-=e.content&&e.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}},{key:"_destroy",value:function(){var e=[];for(this.root&&e.push(this.root);e.length>0;){var t,r=e.pop(),n=Xf(r.children);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.push(i)}}catch(e){n.e(e)}finally{n.f()}this._destroyTile(r)}this.root=null}},{key:"_destroySubtree",value:function(e){var t=e,r=[];for(r.push(t);r.length>0;){var n,i=Xf((e=r.pop()).children);try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(a)}}catch(e){i.e(e)}finally{i.f()}e!==t&&this._destroyTile(e)}t.children=[]}},{key:"_destroyTile",value:function(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}},{key:"_initializeCesiumTileset",value:function(e){if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed,this.extras=e.extras}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}]),e}();var eh={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(eh);function th(e,t,r){Js(e instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function rh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=new DataView(e);return"".concat(String.fromCharCode(r.getUint8(t+0))).concat(String.fromCharCode(r.getUint8(t+1))).concat(String.fromCharCode(r.getUint8(t+2))).concat(String.fromCharCode(r.getUint8(t+3)))}var nh={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:"3.1.0",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":ui()(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function ih(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length,c=0;c<u;c+=3){var l=s[c],f=s[c+1],h=s[c+2];t=l<t?l:t,r=f<r?f:r,n=h<n?h:n,i=l>i?l:i,a=f>a?f:a,o=h>o?h:o}return[[t,r,n],[i,a,o]]}function ah(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return oh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function oh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var sh=function(){function e(t,r){h()(this,e),En(this,"fields",void 0),En(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(t)),function(e){var t,r={},n=ah(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;r[i.name]&&console.warn("Schema: duplicated field name",i.name,i),r[i.name]=!0}}catch(e){n.e(e)}finally{n.f()}}(t),this.fields=t,this.metadata=r||new Map}return x()(e,[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(var t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}},{key:"select",value:function(){for(var t=Object.create(null),r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];for(var a=0,o=n;a<o.length;a++){var s=o[a];t[s]=!0}var u=this.fields.filter((function(e){return t[e.name]}));return new e(u,this.metadata)}},{key:"selectAt",value:function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=n.map((function(e){return t.fields[e]})).filter(Boolean);return new e(a,this.metadata)}},{key:"assign",value:function(t){var r,n=this.metadata;if(t instanceof e){var i=t;r=i.fields,n=uh(uh(new Map,this.metadata),i.metadata)}else r=t;var a,o=Object.create(null),s=ah(this.fields);try{for(s.s();!(a=s.n()).done;){var u=a.value;o[u.name]=u}}catch(e){s.e(e)}finally{s.f()}var c,l=ah(r);try{for(l.s();!(c=l.n()).done;){var f=c.value;o[f.name]=f}}catch(e){l.e(e)}finally{l.f()}return new e(Object.values(o),n)}}]),e}();function uh(e,t){return new Map([].concat(q()(e||new Map),q()(t||new Map)))}var ch,lh=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;h()(this,e),En(this,"name",void 0),En(this,"type",void 0),En(this,"nullable",void 0),En(this,"metadata",void 0),this.name=t,this.type=r,this.nullable=n,this.metadata=i}return x()(e,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),e}();function fh(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}!function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"}(ch||(ch={}));var hh=function(){function e(){h()(this,e)}return x()(e,[{key:"typeId",get:function(){return ch.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===ch.Null}},{key:"isInt",value:function(e){return e&&e.typeId===ch.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===ch.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===ch.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===ch.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===ch.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===ch.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===ch.Date}},{key:"isTime",value:function(e){return e&&e.typeId===ch.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===ch.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===ch.Interval}},{key:"isList",value:function(e){return e&&e.typeId===ch.List}},{key:"isStruct",value:function(e){return e&&e.typeId===ch.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===ch.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===ch.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===ch.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===ch.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===ch.Dictionary}}]),e}(),dh=(Symbol.toStringTag,Symbol.toStringTag,function(e,t){p()(n,e);var r=fh(n);function n(e,t){var i;return h()(this,n),i=r.call(this),En(wi()(i),"isSigned",void 0),En(wi()(i),"bitWidth",void 0),i.isSigned=e,i.bitWidth=t,i}return x()(n,[{key:"typeId",get:function(){return ch.Int}},{key:t,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(hh,Symbol.toStringTag)),ph=function(e){p()(r,e);var t=fh(r);function r(){return h()(this,r),t.call(this,!0,8)}return r}(dh),yh=function(e){p()(r,e);var t=fh(r);function r(){return h()(this,r),t.call(this,!0,16)}return r}(dh),vh=function(e){p()(r,e);var t=fh(r);function r(){return h()(this,r),t.call(this,!0,32)}return r}(dh),gh=function(e){p()(r,e);var t=fh(r);function r(){return h()(this,r),t.call(this,!1,8)}return r}(dh),mh=function(e){p()(r,e);var t=fh(r);function r(){return h()(this,r),t.call(this,!1,16)}return r}(dh),bh=function(e){p()(r,e);var t=fh(r);function r(){return h()(this,r),t.call(this,!1,32)}return r}(dh),Ah=32,Bh=64,wh=function(e,t){p()(n,e);var r=fh(n);function n(e){var t;return h()(this,n),t=r.call(this),En(wi()(t),"precision",void 0),t.precision=e,t}return x()(n,[{key:"typeId",get:function(){return ch.Float}},{key:t,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(hh,Symbol.toStringTag),xh=function(e){p()(r,e);var t=fh(r);function r(){return h()(this,r),t.call(this,Ah)}return r}(wh),_h=function(e){p()(r,e);var t=fh(r);function r(){return h()(this,r),t.call(this,Bh)}return r}(wh),Ch=(Symbol.toStringTag,Symbol.toStringTag,{DAY:0,MILLISECOND:1}),Oh=(Symbol.toStringTag,{SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9}),Eh=(Symbol.toStringTag,Symbol.toStringTag,{DAY_TIME:0,YEAR_MONTH:1}),Th=(Symbol.toStringTag,function(e,t){p()(n,e);var r=fh(n);function n(e,t){var i;return h()(this,n),i=r.call(this),En(wi()(i),"listSize",void 0),En(wi()(i),"children",void 0),i.listSize=e,i.children=[t],i}return x()(n,[{key:"typeId",get:function(){return ch.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:t,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(hh,Symbol.toStringTag));Symbol.toStringTag;function Sh(e,t,r){var n=function(e){switch(e.constructor){case Int8Array:return new ph;case Uint8Array:return new gh;case Int16Array:return new yh;case Uint16Array:return new mh;case Int32Array:return new vh;case Uint32Array:return new bh;case Float32Array:return new xh;case Float64Array:return new _h;default:throw new Error("array type not supported")}}(t.value),i=r||function(e){var t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new lh(e,new Th(t.size,new lh("value",n)),!1,i)}function kh(e,t,r){var n=Ih(t.metadata),i=[],a=function(e){var t={};for(var r in e){var n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(var o in e){var s=Mh(o,e[o],a[o]);i.push(s)}if(r){var u=Mh("indices",r);i.push(u)}return new sh(i,n)}function Mh(e,t,r){return Sh(e,t,r?Ih(r.metadata):void 0)}function Ih(e){var t=new Map;for(var r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}function Ph(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Rh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Rh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Dh(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 Fh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dh(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var jh={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Lh={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Gh=function(){function e(t){h()(this,e),En(this,"draco",void 0),En(this,"decoder",void 0),En(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return x()(e,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);var n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var a;switch(n){case this.draco.TRIANGULAR_MESH:a=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:a=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!a.ok()||!i.ptr){var o="DRACO decompression failed: ".concat(a.error_msg());throw new Error(o)}var s=this._getDracoLoaderData(i,n,t),u=this._getMeshData(i,s,t),c=ih(u.attributes),l=kh(u.attributes,s,u.indices),f=Fh(Fh({loader:"draco",loaderData:s,header:{vertexCount:i.num_points(),boundingBox:c}},u),{},{schema:l});return f}finally{this.draco.destroy(r),i&&this.draco.destroy(i)}}},{key:"_getDracoLoaderData",value:function(e,t,r){var n=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,r);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:i}}},{key:"_getDracoAttributes",value:function(e,t){for(var r={},n=0;n<e.num_attributes();n++){var i=this.decoder.GetAttribute(e,n),a=this._getAttributeMetadata(e,n);r[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:n,metadata:a};var o=this._getQuantizationTransform(i,t);o&&(r[i.unique_id()].quantization_transform=o);var s=this._getOctahedronTransform(i,t);s&&(r[i.unique_id()].octahedron_transform=s)}return r}},{key:"_getMeshData",value:function(e,t,r){var n=this._getMeshAttributes(t,e,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:n}}},{key:"_getMeshAttributes",value:function(e,t,r){for(var n={},i=0,a=Object.values(e.attributes);i<a.length;i++){var o=a[i],s=this._deduceAttributeName(o,r);o.name=s;var u=this._getAttributeValues(t,o),c=u.value,l=u.size;n[s]={value:c,size:l,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}return n}},{key:"_getTriangleListIndices",value:function(e){var t=3*e.num_faces(),r=4*t,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(e,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,t).slice()}finally{this.draco._free(n)}}},{key:"_getTriangleStripIndices",value:function(e){var t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}(t)}finally{this.draco.destroy(t)}}},{key:"_getAttributeValues",value:function(e,t){var r,n=Lh[t.data_type],i=t.num_components,a=e.num_points()*i,o=a*n.BYTES_PER_ELEMENT,s=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}(this.draco,n),u=this.draco._malloc(o);try{var c=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,c,s,o,u),r=new n(this.draco.HEAPF32.buffer,u,a).slice()}finally{this.draco._free(u)}return{value:r,size:i}}},{key:"_deduceAttributeName",value:function(e,t){for(var r=e.unique_id,n=0,i=Object.entries(t.extraAttributes||{});n<i.length;n++){var a=E()(i[n],2),o=a[0];if(a[1]===r)return o}var s=e.attribute_type;for(var u in jh){if(this.draco[u]===s)return jh[u]}var c=t.attributeNameEntry||"name";return e.metadata[c]?e.metadata[c].string:"CUSTOM_ATTRIBUTE_".concat(r)}},{key:"_getTopLevelMetadata",value:function(e){var t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}},{key:"_getAttributeMetadata",value:function(e,t){var r=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(r)}},{key:"_getDracoMetadata",value:function(e){if(!e||!e.ptr)return{};for(var t={},r=this.metadataQuerier.NumEntries(e),n=0;n<r;n++){var i=this.metadataQuerier.GetEntryName(e,n);t[i]=this._getDracoMetadataField(e,i)}return t}},{key:"_getDracoMetadataField",value:function(e,t){var r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,r);var n=function(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:n}}finally{this.draco.destroy(r)}}},{key:"_disableAttributeTransforms",value:function(e){var t,r=e.quantizedAttributes,n=void 0===r?[]:r,i=e.octahedronAttributes,a=void 0===i?[]:i,o=Ph([].concat(q()(n),q()(a)));try{for(o.s();!(t=o.n()).done;){var s=t.value;this.decoder.SkipAttributeTransform(this.draco[s])}}catch(e){o.e(e)}finally{o.f()}}},{key:"_getQuantizationTransform",value:function(e,t){var r=this,n=t.quantizedAttributes,i=void 0===n?[]:n,a=e.attribute_type();if(i.map((function(e){return r.decoder[e]})).includes(a)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map((function(e){return o.min_value(e)}))}}finally{this.draco.destroy(o)}}return null}},{key:"_getOctahedronTransform",value:function(e,t){var r=this,n=t.octahedronAttributes,i=void 0===n?[]:n,a=e.attribute_type();if(i.map((function(e){return r.decoder[e]})).includes(a)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}]),e}();var Uh=r(35),Nh={};function Hh(e){return Jh.apply(this,arguments)}function Jh(){return(Jh=V()(K.a.mark((function e(t){var r,n,i=arguments;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:null,n=i.length>2&&void 0!==i[2]?i[2]:{},r&&(t=Vh(t,r,n)),Nh[t]=Nh[t]||zh(t),e.next=6,Nh[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vh(e,t,r){if(e.startsWith("http"))return e;var n=r.modules||{};return n[e]?n[e]:Fu?r.CDN?(Iu(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.1.0","/dist/libs/").concat(e)):ju?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function zh(e){return Kh.apply(this,arguments)}function Kh(){return(Kh=V()(K.a.mark((function e(t){var r,n,i;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=7;break}return e.next=3,fetch(t);case 3:return r=e.sent,e.next=6,r.arrayBuffer();case 6:return e.abrupt("return",e.sent);case 7:if(Fu){e.next=14;break}if(e.t0=Uh.requireFromFile,!e.t0){e.next=13;break}return e.next=12,Uh.requireFromFile(t);case 12:e.t0=e.sent;case 13:return e.abrupt("return",e.t0);case 14:if(!ju){e.next=16;break}return e.abrupt("return",importScripts(t));case 16:return e.next=18,fetch(t);case 18:return n=e.sent,e.next=21,n.text();case 21:return i=e.sent,e.abrupt("return",Qh(i,t));case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qh(e,t){if(!Fu)return Uh.requireFromString&&Uh.requireFromString(e,t);if(ju)return eval.call(Du,e),null;var r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch(t){r.text=e}return document.body.appendChild(r),null}function Xh(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 qh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xh(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Wh,Zh="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Yh="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),$h="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");function ed(e){return td.apply(this,arguments)}function td(){return(td=V()(K.a.mark((function e(t){var r;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modules||{},Wh=r.draco3d?Wh||r.draco3d.createDecoderModule({}).then((function(e){return{draco:e}})):Wh||rd(t),e.next=4,Wh;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rd(e){return nd.apply(this,arguments)}function nd(){return(nd=V()(K.a.mark((function e(t){var r,n,i,a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.draco&&t.draco.decoderType,e.next="js"===e.t0?3:(e.t0,7);break;case 3:return e.next=5,Hh(Zh,"draco",t);case 5:return r=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,Hh(Yh,"draco",t);case 10:return e.t2=e.sent,e.next=13,Hh($h,"draco",t);case 13:return e.t3=e.sent,e.t4=[e.t2,e.t3],e.next=17,e.t1.all.call(e.t1,e.t4);case 17:i=e.sent,a=E()(i,2),r=a[0],n=a[1];case 21:return r=r||globalThis.DracoDecoderModule,e.next=24,id(r,n);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function id(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(qh(qh({},r),{},{onModuleLoaded:function(e){return t({draco:e})}}))}))}function ad(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 od(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ad(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ad(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var sd=od(od({},nh),{},{parse:function(e,t){return ud.apply(this,arguments)}});function ud(){return(ud=V()(K.a.mark((function e(t,r){var n,i,a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ed(r);case 2:return n=e.sent,i=n.draco,a=new Gh(i),e.prev=5,e.abrupt("return",a.parseSync(t,null==r?void 0:r.draco));case 7:return e.prev=7,a.destroy(),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[5,,7,10]])})))).apply(this,arguments)}var cd,ld=(cd={},C()(cd,5130,Float64Array),C()(cd,5126,Float32Array),C()(cd,5123,Uint16Array),C()(cd,5125,Uint32Array),C()(cd,5121,Uint8Array),C()(cd,5120,Int8Array),C()(cd,5122,Int16Array),C()(cd,5124,Int32Array),cd),fd={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},hd=function(){function e(){h()(this,e)}return x()(e,null,[{key:"fromTypedArray",value:function(e){for(var t in e=ArrayBuffer.isView(e)?e.constructor:e,ld){if(ld[t]===e)return t}throw new Error("Failed to convert GL type")}},{key:"fromName",value:function(e){var t=fd[e];if(!t)throw new Error("Failed to convert GL type");return t}},{key:"getArrayType",value:function(e){switch(e){case 33635:case 32819:case 32820:return Uint16Array;default:var t=ld[e];if(!t)throw new Error("Failed to convert GL type");return t}}},{key:"getByteSize",value:function(t){return e.getArrayType(t).BYTES_PER_ELEMENT}},{key:"validate",value:function(t){return Boolean(e.getArrayType(t))}},{key:"createTypedArray",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;void 0===i&&(i=(r.byteLength-n)/e.getByteSize(t));var a=e.getArrayType(t);return new a(r,n,i)}}]),e}(),dd=function(){function e(t,r){h()(this,e),En(this,"json",void 0),En(this,"buffer",void 0),En(this,"featuresLength",0),En(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=r}return x()(e,[{key:"getExtension",value:function(e){return this.json.extensions&&this.json.extensions[e]}},{key:"hasProperty",value:function(e){return Boolean(this.json[e])}},{key:"getGlobalProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5125,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.json[e];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(e,t,r,1,n.byteOffset):n}},{key:"getPropertyArray",value:function(e,t,r){var n=this.json[e];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(t=hd.fromName(n.componentType)),this._getTypedArrayFromBinary(e,t,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(e,t,n)}},{key:"getProperty",value:function(e,t,r,n,i){var a=this.json[e];if(!a)return a;var o=this.getPropertyArray(e,t,r);if(1===r)return o[n];for(var s=0;s<r;++s)i[s]=o[r*n+s];return i}},{key:"_getTypedArrayFromBinary",value:function(e,t,r,n,i){var a=this._cachedTypedArrays,o=a[e];return o||(o=hd.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+i,n*r),a[e]=o),o}},{key:"_getTypedArrayFromArray",value:function(e,t,r){var n=this._cachedTypedArrays,i=n[e];return i||(i=hd.createTypedArray(t,r),n[e]=i),i}}]),e}(),pd={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},yd={SCALAR:function(e,t){return e[t]},VEC2:function(e,t){return[e[2*t+0],e[2*t+1]]},VEC3:function(e,t){return[e[3*t+0],e[3*t+1],e[3*t+2]]},VEC4:function(e,t){return[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]]},MAT2:function(e,t){return[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]]},MAT3:function(e,t){return[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]]},MAT4:function(e,t){return[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]}},vd={SCALAR:function(e,t,r){t[r]=e},VEC2:function(e,t,r){t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:function(e,t,r){t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:function(e,t,r){t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:function(e,t,r){t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:function(e,t,r){t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:function(e,t,r){t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};var gd=function(e){return void 0!==e};function md(e,t,r){if(!t)return null;var n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?function(e,t){var r,n,i,a,o=e.instancesLength,s=e.classes,u=e.classIds,c=e.parentCounts,l=e.parentIds,f=o;gd(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,5123),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,o));if(gd(c))for(gd(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,5123),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,o)),a=new Uint16Array(o),f=0,r=0;r<o;++r)a[r]=f,f+=c[r];gd(l)&&gd(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,5123),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,f));var h=s.length;for(r=0;r<h;++r){var d=s[r].length,p=s[r].instances,y=getBinaryProperties(d,p,t);s[r].instances=combine(y,p)}var v=new Array(h).fill(0),g=new Uint16Array(o);for(r=0;r<o;++r)n=u[r],g[r]=v[n],++v[n];var m={classes:s,classIds:u,classIndexes:g,parentCounts:c,parentIndexes:a,parentIds:l};return function(e){for(var t=e.classIds.length,r=0;r<t;++r)Ad(e,r,stack)}(m),m}(n,r):null}function bd(e,t,r){if(e){var n=e.parentCounts;return e.parentIds?r(e,t):n>0?function(e,t,r){var n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);var c=++marker,l=scratchStack;l.length=0,l.push(t);for(;l.length>0;)if(t=l.pop(),u[t]!==c){u[t]=c;var f=r(e,t);if(gd(f))return f;for(var h=i[t],d=o[t],p=0;p<h;++p){var y=a[d+p];y!==t&&l.push(y)}}return null}(e,t,r):function(e,t,r){var n=!0;for(;n;){var i=r(e,t);if(gd(i))return i;var a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}(e,t,r)}}function Ad(e,t,r){var n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,o=e.classIds.length;if(gd(i)){assert(t<o,"Parent index ".concat(t," exceeds the total number of instances: ").concat(o)),assert(-1===r.indexOf(t),"Circular dependency detected in the batch table hierarchy."),r.push(t);for(var s=gd(n)?n[t]:1,u=gd(n)?a[t]:t,c=0;c<s;++c){var l=i[u+c];l!==t&&Ad(e,l,r)}r.pop(t)}}function Bd(e){return null!=e}var wd=function(e,t){return e},xd={HIERARCHY:!0,extensions:!0,extras:!0},_d=function(){function e(t,r,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(var o in h()(this,e),En(this,"json",void 0),En(this,"binary",void 0),En(this,"featureCount",void 0),En(this,"_extensions",void 0),En(this,"_properties",void 0),En(this,"_binaryProperties",void 0),En(this,"_hierarchy",void 0),Js(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={},this.json)xd[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),a["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=md(this,this.json,this.binary))}return x()(e,[{key:"getExtension",value:function(e){return this.json&&this.json.extensions&&this.json.extensions[e]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(e,t){return this._checkBatchId(e),Js("string"==typeof t,t),!!this._hierarchy&&Bd(bd(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return e.classes[n].name===t})))}},{key:"isExactClass",value:function(e,t){return Js("string"==typeof t,t),this.getExactClassName(e)===t}},{key:"getExactClassName",value:function(e){if(this._checkBatchId(e),this._hierarchy){var t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}},{key:"hasProperty",value:function(e,t){return this._checkBatchId(e),Js("string"==typeof t,t),Bd(this._properties[t])||this._hasPropertyInHierarchy(e,t)}},{key:"getPropertyNames",value:function(e,t){var r;this._checkBatchId(e),(t=Bd(t)?t:[]).length=0;var n=Object.keys(this._properties);return(r=t).push.apply(r,q()(n)),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}},{key:"getProperty",value:function(e,t){if(this._checkBatchId(e),Js("string"==typeof t,t),this._binaryProperties){var r=this._binaryProperties[t];if(Bd(r))return this._getBinaryProperty(r,e)}var n=this._properties[t];if(Bd(n))return wd(n[e]);if(this._hierarchy){var i=this._getHierarchyProperty(e,t);if(Bd(i))return i}}},{key:"setProperty",value:function(e,t,r){var n=this.featureCount;if(this._checkBatchId(e),Js("string"==typeof t,t),this._binaryProperties){var i=this._binaryProperties[t];if(i)return void this._setBinaryProperty(i,e,r)}if(!this._hierarchy||!this._setHierarchyProperty(this,e,t,r)){var a=this._properties[t];Bd(a)||(this._properties[t]=new Array(n),a=this._properties[t]),a[e]=wd(r)}}},{key:"_checkBatchId",value:function(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(e,t){return e.unpack(e.typedArray,t)}},{key:"_setBinaryProperty",value:function(e,t,r){e.pack(r,e.typedArray,t)}},{key:"_initializeBinaryProperties",value:function(){var e=null;for(var t in this._properties){var r=this._properties[t],n=this._initializeBinaryProperty(t,r);n&&((e=e||{})[t]=n)}return e}},{key:"_initializeBinaryProperty",value:function(e,t){if("byteOffset"in t){var r=t;Js(this.binary,"Property ".concat(e," requires a batch table binary.")),Js(r.type,"Property ".concat(e," requires a type."));var n=function(e,t,r,n){var i=e.componentType;Js(e.componentType);var a="string"==typeof i?hd.fromName(i):i,o=pd[e.type],s=yd[e.type],u=vd[e.type];return r+=e.byteOffset,{values:hd.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}(r,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}},{key:"_hasPropertyInHierarchy",value:function(e,t){if(!this._hierarchy)return!1;var r=bd(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return Bd(e.classes[n].instances[t])}));return Bd(r)}},{key:"_getPropertyNamesInHierarchy",value:function(e,t){bd(this._hierarchy,e,(function(e,r){var n=e.classIds[r],i=e.classes[n].instances;for(var a in i)i.hasOwnProperty(a)&&-1===t.indexOf(a)&&t.push(a)}))}},{key:"_getHierarchyProperty",value:function(e,t){var r=this;return bd(this._hierarchy,e,(function(e,n){var i=e.classIds[n],a=e.classes[i],o=e.classIndexes[n],s=a.instances[t];return Bd(s)?Bd(s.typedArray)?r._getBinaryProperty(s,o):wd(s[o]):null}))}},{key:"_setHierarchyProperty",value:function(e,t,r,n){var i=this,a=bd(this._hierarchy,t,(function(e,a){var o=e.classIds[a],s=e.classes[o],u=e.classIndexes[a],c=s.instances[r];return!!Bd(c)&&(Js(a===t,'Inherited property "'.concat(r,'" is read-only.')),Bd(c.typedArray)?i._setBinaryProperty(c,u,n):c[u]=wd(n),!0)}));return Bd(a)}}]),e}();function Cd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return r}function Od(e,t,r){var n,i=new DataView(t);e.header=e.header||{};var a=i.getUint32(r,!0);r+=4;var o=i.getUint32(r,!0);r+=4;var s=i.getUint32(r,!0);r+=4;var u=i.getUint32(r,!0);return r+=4,s>=570425344?(r-=8,n=a,s=o,u=0,a=0,o=0,console.warn("b3dm tile in legacy format.")):u>=570425344&&(r-=4,n=s,s=a,u=o,a=0,o=0,console.warn("b3dm tile in legacy format.")),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=n,r}function Ed(e,t,r,n){return r=function(e,t,r,n){var i=e.header,a=i.featureTableJsonByteLength,o=i.featureTableBinaryByteLength,s=i.batchLength;if(e.featureTableJson={BATCH_LENGTH:s||0},a>0){var u=th(t,r,a);e.featureTableJson=JSON.parse(u)}return r+=a,e.featureTableBinary=new Uint8Array(t,r,o),r+=o}(e,t,r),r=function(e,t,r,n){var i=e.header,a=i.batchTableJsonByteLength,o=i.batchTableBinaryByteLength;if(a>0){var s=th(t,r,a);e.batchTableJson=JSON.parse(s),r+=a,o>0&&(e.batchTableBinary=new Uint8Array(t,r,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=o)}return r}(e,t,r)}function Td(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=e>>11&31,n=e>>5&63,i=31&e;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}function Sd(e,t,r){if(!(t||e&&e.batchIds&&r))return null;var n=e.batchIds,i=e.isRGB565,a=e.pointCount;if(n&&r){for(var o=new Uint8ClampedArray(3*a),s=0;s<a;s++){var u=n[s],c=r.getProperty(u,"dimensions").map((function(e){return 255*e}));o[3*s]=c[0],o[3*s+1]=c[1],o[3*s+2]=c[2]}return{type:5121,value:o,size:3,normalized:!0}}if(i){for(var l=new Uint8ClampedArray(3*a),f=0;f<a;f++){var h=Td(t[f]);l[3*f]=h[0],l[3*f+1]=h[1],l[3*f+2]=h[2]}return{type:5121,value:l,size:3,normalized:!0}}return t&&t.length===3*a?{type:5121,value:t,size:3,normalized:!0}:{type:5121,value:t,size:4,normalized:!0}}function kd(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=le()(e);if(t){var i=le()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ue()(this,r)}}var Md=function(e){oe()(r,e);var t=kd(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return re()(this,r),e=t.call(this,2),ge(n)&&1===arguments.length?e.copy(n):(pe.debug&&(Te(n),Te(i)),e[0]=n,e[1]=i),e}return ie()(r,[{key:"set",value:function(e,t){return this[0]=e,this[1]=t,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this.check()}},{key:"fromObject",value:function(e){return pe.debug&&(Te(e.x),Te(e.y)),this[0]=e.x,this[1]=e.y,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return mt(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return Ve(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return gt(this,this,e),this.check()}},{key:"transformByMatrix2x3",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5]}(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i}(this,this,e),this.check()}}]),r}(Pe);function Id(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new Md,new qe,new Md,new Md,new Uint8Array(1);function Pd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return we(e,0,t)/t*2-1}function Rd(e){return e<0?-1:1}function Dd(e,t,r,n){if(Id(n),e<0||e>r||t<0||t>r)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(r));if(n.x=Pd(e,r),n.y=Pd(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*Rd(i),n.y=(1-Math.abs(i))*Rd(n.y)}return n.normalize()}function Fd(e,t,r){return Dd(e,t,255,r)}var jd=new qe;function Ld(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){for(var r=new qe,n=new Float32Array(3*e.pointCount),i=0;i<e.pointCount;i++)r.set(t[3*i],t[3*i+1],t[3*i+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,3*i);return n}(e,t)):{type:5123,value:t,size:3,normalized:!0}:t}function Gd(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 Ud(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gd(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Nd(e,t,r,n,i){return Hd.apply(this,arguments)}function Hd(){return(Hd=V()(K.a.mark((function e(t,r,n,i,a){var o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Cd(t,r,n),n=Od(t,r,n),n=Ed(t,r,n),Jd(t),o=Vd(t),s=o.featureTable,u=o.batchTable,e.next=7,Xd(t,s,u,i,a);case 7:return zd(t,s,i),Kd(t,s,u),Qd(t,s),e.abrupt("return",n);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jd(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function Vd(e){var t=new dd(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",5126,3);var n=function(e,t){var r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",5123,1),e.batchIds)){var n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");var i=e.batchTableJson,a=e.batchTableBinary;r=new _d(i,a,n)}return r}(e,t);return{featureTable:t,batchTable:n}}function zd(e,t,r){if(!e.attributes.positions)if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",5126,3);else if(t.hasProperty("POSITION_QUANTIZED")){var n=t.getPropertyArray("POSITION_QUANTIZED",5123,3);if(e.isQuantized=!0,e.quantizedRange=65535,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=Ld(e,n,r)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Kd(e,t,r){if(!e.attributes.colors){var n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",5121,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",5121,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",5123,1),e.isRGB565=!0),e.attributes.colors=Sd(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",5121,4))}function Qd(e,t){if(!e.attributes.normals){var r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",5126,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",5121,2),e.isOctEncoded16P=!0),e.attributes.normals=function(e,t){if(!t)return null;if(e.isOctEncoded16P){for(var r=new Float32Array(3*e.pointsLength),n=0;n<e.pointsLength;n++)Fd(t[2*n],t[2*n+1],jd),jd.toArray(r,3*n);return{type:5126,size:2,value:r}}return{type:5126,size:2,value:t}}(e,r)}}function Xd(e,t,r,n,i){return qd.apply(this,arguments)}function qd(){return(qd=V()(K.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h,d;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((c=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"])&&(u=c.properties),!(l=r.getExtension("3DTILES_draco_point_compression"))){e.next=15;break}if(s=l.properties,f=l.byteOffset,h=l.byteLength,s&&Number.isFinite(f)&&h){e.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:o=t.featureTableBinary.slice(f,f+h),t.hasPositions=Number.isFinite(s.POSITION),t.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),t.hasNormals=Number.isFinite(s.NORMAL),t.hasBatchIds=Number.isFinite(s.BATCH_ID),t.isTranslucent=Number.isFinite(s.RGBA);case 15:if(o){e.next=17;break}return e.abrupt("return",!0);case 17:return d={buffer:o,properties:Ud(Ud({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},e.next=20,Wd(t,d,i,a);case 20:return e.abrupt("return",e.sent);case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wd(e,t,r,n){return Zd.apply(this,arguments)}function Zd(){return(Zd=V()(K.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,y,v,g,m,b;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.parse,delete(o=Ud(Ud({},n),{},{draco:Ud(Ud({},n.draco),{},{extraAttributes:r.batchTableProperties||{}})}))["3d-tiles"],e.next=5,a(r.buffer,sd,o);case 5:if(s=e.sent,u=s.attributes.POSITION&&s.attributes.POSITION.value,c=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,l=s.attributes.NORMAL&&s.attributes.NORMAL.value,f=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=u&&s.attributes.POSITION.value.quantization,d=l&&s.attributes.NORMAL.value.quantization,h&&(p=s.POSITION.data.quantization,y=p.range,t.quantizedVolumeScale=new qe(y,y,y),t.quantizedVolumeOffset=new qe(p.minValues),t.quantizedRange=(1<<p.quantizationBits)-1,t.isQuantizedDraco=!0),d&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0),v={},r.batchTableProperties)for(g=0,m=Object.keys(r.batchTableProperties);g<m.length;g++)b=m[g],s.attributes[b]&&s.attributes[b].value&&(v[b.toLowerCase()]=s.attributes[b].value);t.attributes=Ud({positions:u,colors:Sd(t,c,void 0),normals:l,batchIds:f},v);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Yd,$d,ep="https://unpkg.com/@loaders.gl/textures@".concat("3.1.0","/dist/libs/basis_encoder.wasm"),tp="https://unpkg.com/@loaders.gl/textures@".concat("3.1.0","/dist/libs/basis_encoder.js");function rp(e){return np.apply(this,arguments)}function np(){return(np=V()(K.a.mark((function e(t){var r;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.modules||{}).basis){e.next=3;break}return e.abrupt("return",r.basis);case 3:return Yd=Yd||ip(t),e.next=6,Yd;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ip(e){return ap.apply(this,arguments)}function ap(){return(ap=V()(K.a.mark((function e(t){var r,n,i,a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,Hh("basis_transcoder.js","textures",t);case 5:return e.t1=e.sent,e.next=8,Hh("basis_transcoder.wasm","textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return i=e.sent,a=E()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,op(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function op(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(r).then((function(e){var r=e.BasisFile;(0,e.initializeBasis)(),t({BasisFile:r})}))}))}function sp(e){return up.apply(this,arguments)}function up(){return(up=V()(K.a.mark((function e(t){var r;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.modules||{}).basisEncoder){e.next=3;break}return e.abrupt("return",r.basisEncoder);case 3:return $d=$d||cp(t),e.next=6,$d;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cp(e){return lp.apply(this,arguments)}function lp(){return(lp=V()(K.a.mark((function e(t){var r,n,i,a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,Hh(tp,"textures",t);case 5:return e.t1=e.sent,e.next=8,Hh(ep,"textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return i=e.sent,a=E()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,fp(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fp(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(r).then((function(e){var r=e.BasisFile,n=e.KTX2File,i=e.initializeBasis,a=e.BasisEncoder;i(),t({BasisFile:r,KTX2File:n,BasisEncoder:a})}))}))}var hp={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};function dp(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return pp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pp(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var yp=["","WEBKIT_","MOZ_"],vp={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},gp=null;function mp(e){if(!gp){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,gp=new Set;var t,r=dp(yp);try{for(r.s();!(t=r.n()).done;){var n=t.value;for(var i in vp)if(e&&e.getExtension("".concat(n).concat(i))){var a=vp[i];gp.add(a)}}}catch(e){r.e(e)}finally{r.f()}}return gp}new Uint8Array([0]);var bp,Ap,Bp,wp,xp,_p,Cp,Op,Ep;(Ep=bp||(bp={}))[Ep.NONE=0]="NONE",Ep[Ep.BASISLZ=1]="BASISLZ",Ep[Ep.ZSTD=2]="ZSTD",Ep[Ep.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(Ap||(Ap={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Bp||(Bp={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(wp||(wp={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(xp||(xp={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(_p||(_p={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(Cp||(Cp={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Op||(Op={}));var Tp=[171,75,84,88,32,50,48,187,13,10,26,10];function Sp(e){var t=new Uint8Array(e);return!(t.byteLength<Tp.length||t[0]!==Tp[0]||t[1]!==Tp[1]||t[2]!==Tp[2]||t[3]!==Tp[3]||t[4]!==Tp[4]||t[5]!==Tp[5]||t[6]!==Tp[6]||t[7]!==Tp[7]||t[8]!==Tp[8]||t[9]!==Tp[9]||t[10]!==Tp[10]||t[11]!==Tp[11])}var kp={etc1:{basisFormat:0,compressed:!0,format:hp.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:hp.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:hp.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:hp.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:hp.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:hp.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function Mp(){return(Mp=V()(K.a.mark((function e(t,r){var n,i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("auto"!==r.basis.containerFormat){e.next=11;break}if(!Sp(t)){e.next=6;break}return e.next=4,sp(r);case 4:return n=e.sent,e.abrupt("return",Rp(n.KTX2File,t,r));case 6:return e.next=8,rp(r);case 8:return i=e.sent,a=i.BasisFile,e.abrupt("return",Ip(a,t,r));case 11:e.t0=r.basis.module,e.next="encoder"===e.t0?14:(e.t0,22);break;case 14:return e.next=16,sp(r);case 16:o=e.sent,e.t1=r.basis.containerFormat,e.next="ktx2"===e.t1?20:(e.t1,21);break;case 20:return e.abrupt("return",Rp(o.KTX2File,t,r));case 21:return e.abrupt("return",Ip(o.BasisFile,t,r));case 22:return e.next=24,rp(r);case 24:return s=e.sent,u=s.BasisFile,e.abrupt("return",Ip(u,t,r));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ip(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())return null;for(var i=n.getNumImages(),a=[],o=0;o<i;o++){for(var s=n.getNumLevels(o),u=[],c=0;c<s;c++)u.push(Pp(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function Pp(e,t,r,n){var i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),s=Fp(n,o),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,r,l),h=new Uint8Array(f);return e.transcodeImage(h,t,r,l,0,0)?{width:i,height:a,data:h,compressed:u,hasAlpha:o,format:c}:null}function Rp(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())return null;for(var i=n.getLevels(),a=[],o=0;o<i;o++){a.push(Dp(n,o,r));break}return a}finally{n.close(),n.delete()}}function Dp(e,t,r){var n=e.getImageLevelInfo(t,0,0),i=n.alphaFlag,a=n.height,o=n.width,s=Fp(r,i),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,0,0,l),h=new Uint8Array(f);return e.transcodeImage(h,t,0,0,l,0,-1,-1)?{width:o,height:a,data:h,compressed:u,alphaFlag:i,format:c}:null}function Fp(e,t){var r=e&&e.basis&&e.basis.format;return"auto"===r&&(r=jp()),"object"===ui()(r)&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),kp[r]}function jp(){var e=mp();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}function Lp(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 Gp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lp(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Up={name:"Basis",id:"basis",module:"textures",version:"3.1.0",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Np=Gp(Gp({},Up),{},{parse:function(e,t){return Mp.apply(this,arguments)}}),Hp=globalThis._parseImageNode,Jp="undefined"!=typeof Image,Vp="undefined"!=typeof ImageBitmap,zp=Boolean(Hp),Kp=!!Ec||zp;function Qp(e){var t=qp(e);if(!t)throw new Error("Not an image");return t}function Xp(e){switch(Qp(e)){case"data":return e;case"image":case"imagebitmap":var t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function qp(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"===ui()(e)&&e.data&&e.width&&e.height?"data":null}var Wp=/^data:image\/svg\+xml/,Zp=/\.svg((\?|#).*)?$/;function Yp(e){return e&&(Wp.test(e)||Zp.test(e))}function $p(e,t){if(Yp(t)){var r=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(r=unescape(encodeURIComponent(r)))}catch(e){throw new Error(e.message)}return"data:image/svg+xml;base64,".concat(btoa(r))}return ey(e,t)}function ey(e,t){if(Yp(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function ty(e,t,r){return ry.apply(this,arguments)}function ry(){return(ry=V()(K.a.mark((function e(t,r,n){var i,a,o;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=$p(t,n),a=self.URL||self.webkitURL,o="string"!=typeof i&&a.createObjectURL(i),e.prev=3,e.next=6,ny(o||i,r);case 6:return e.abrupt("return",e.sent);case 7:return e.prev=7,o&&a.revokeObjectURL(o),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[3,,7,10]])})))).apply(this,arguments)}function ny(e,t){return iy.apply(this,arguments)}function iy(){return(iy=V()(K.a.mark((function e(t,r){var n;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=new Image).src=t,!(r.image&&r.image.decode&&n.decode)){e.next=6;break}return e.next=5,n.decode();case 5:return e.abrupt("return",n);case 6:return e.next=8,new Promise((function(e,r){try{n.onload=function(){return e(n)},n.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))}}catch(e){r(e)}}));case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ay={},oy=!0;function sy(e,t,r){return uy.apply(this,arguments)}function uy(){return(uy=V()(K.a.mark((function e(t,r,n){var i,a,o;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Yp(n)){e.next=7;break}return e.next=3,ty(t,r,n);case 3:a=e.sent,i=a,e.next=8;break;case 7:i=ey(t,n);case 8:return o=r&&r.imagebitmap,e.next=11,cy(i,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cy(e){return ly.apply(this,arguments)}function ly(){return(ly=V()(K.a.mark((function e(t){var r,n=arguments;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!fy(r=n.length>1&&void 0!==n[1]?n[1]:null)&&oy||(r=null),!r){e.next=13;break}return e.prev=3,e.next=6,createImageBitmap(t,r);case 6:return e.abrupt("return",e.sent);case 9:e.prev=9,e.t0=e.catch(3),console.warn(e.t0),oy=!1;case 13:return e.next=15,createImageBitmap(t);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,null,[[3,9]])})))).apply(this,arguments)}function fy(e){for(var t in e||ay)return!1;return!0}function hy(e){var t=dy(e);return function(e){var t=dy(e);if(!(t.byteLength>=24&&2303741511===t.getUint32(0,!1)))return null;return{mimeType:"image/png",width:t.getUint32(16,!1),height:t.getUint32(20,!1)}}(t)||function(e){var t=dy(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,!1)&&255===t.getUint8(2)))return null;var r=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:r}}(),n=r.tableMarkers,i=r.sofMarkers,a=2;for(;a+9<t.byteLength;){var o=t.getUint16(a,!1);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,!1),width:t.getUint16(a+7,!1)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,!1)}return null}(t)||function(e){var t=dy(e);if(!(t.byteLength>=10&&1195984440===t.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:t.getUint16(6,!0),height:t.getUint16(8,!0)}}(t)||function(e){var t=dy(e);if(!(t.byteLength>=14&&16973===t.getUint16(0,!1)&&t.getUint32(2,!0)===t.byteLength))return null;return{mimeType:"image/bmp",width:t.getUint32(18,!0),height:t.getUint32(22,!0)}}(t)}function dy(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function py(e,t){return yy.apply(this,arguments)}function yy(){return(yy=V()(K.a.mark((function e(t,r){var n,i,a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=hy(t)||{},i=n.mimeType,Js(a=globalThis._parseImageNode),e.next=5,a(t,i);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vy(){return(vy=V()(K.a.mark((function e(t,r,n){var i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=(r=r||{}).image||{},a=i.type||"auto",o=(n||{}).url,s=gy(a),e.t0=s,e.next="imagebitmap"===e.t0?8:"image"===e.t0?12:"data"===e.t0?16:20;break;case 8:return e.next=10,sy(t,r,o);case 10:return u=e.sent,e.abrupt("break",21);case 12:return e.next=14,ty(t,r,o);case 14:return u=e.sent,e.abrupt("break",21);case 16:return e.next=18,py(t,r);case 18:return u=e.sent,e.abrupt("break",21);case 20:Js(!1);case 21:return"data"===a&&(u=Xp(u)),e.abrupt("return",u);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gy(e){switch(e){case"auto":case"data":return function(){if(Vp)return"imagebitmap";if(Jp)return"image";if(Kp)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return Vp||Jp||Kp;case"imagebitmap":return Vp;case"image":return Jp;case"data":return Kp;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var my={id:"image",module:"images",name:"Images",version:"3.1.0",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(e,t,r){return vy.apply(this,arguments)},tests:[function(e){return Boolean(hy(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}};function by(e,t,r){if(e.byteLength<=t+r)return"";for(var n=new DataView(e),i="",a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function Ay(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return by(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return by(e,r,t)}return""}(e),'"'))}}function By(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function wy(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;var r=t.baseUri||t.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return r.substr(0,r.lastIndexOf("/")+1)+e}function xy(e,t,r){var n=e.bufferViews[r];By(n);var i=t[n.buffer];By(i);var a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}function _y(e,t){return Js(e>=0),Js(t>0),e+(t-1)&~(t-1)}function Cy(e,t,r){var n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{var i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+_y(n.byteLength,4)}var Oy=["SCALAR","VEC2","VEC3","VEC4"],Ey=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ty=new Map(Ey),Sy={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ky={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},My={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Iy(e){return Oy[e-1]||Oy[0]}function Py(e){var t=Ty.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Ry(e,t){var r=My[e.componentType],n=Sy[e.type],i=ky[e.componentType],a=e.count*n,o=e.count*n*i;return By(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function Dy(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Fy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fy(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Fy(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jy(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 Ly(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jy(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Gy,Uy={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Ny=function(){function e(t){h()(this,e),En(this,"gltf",void 0),En(this,"sourceBuffers",void 0),En(this,"byteLength",void 0),this.gltf=t||{json:Ly({},Uy),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}return x()(e,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(e){return this.json[e]}},{key:"getExtraData",value:function(e){return(this.json.extras||{})[e]}},{key:"getExtension",value:function(e){var t=this.getUsedExtensions().find((function(t){return t===e})),r=this.json.extensions||{};return t?r[e]||!0:null}},{key:"getRequiredExtension",value:function(e){return this.getRequiredExtensions().find((function(t){return t===e}))?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(e,t){return(e.extensions||{})[t]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,t){if("object"===ui()(t))return t;var r=this.json[e]&&this.json[e][t];if(!r)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return r}},{key:"getTypedArrayForBufferView",value:function(e){var t=(e=this.getBufferView(e)).buffer,r=this.gltf.buffers[t];By(r);var n=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=Ry(e,t),i=n.ArrayType,a=n.length;return new i(r,t.byteOffset+e.byteOffset,a)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(r,n,t.byteLength)}},{key:"addApplicationData",value:function(e,t){return this.json[e]=t,this}},{key:"addExtraData",value:function(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}},{key:"addObjectExtension",value:function(e,t,r){return e.extensions=e.extensions||{},e.extensions[t]=r,this.registerUsedExtension(t),this}},{key:"setObjectExtension",value:function(e,t,r){(e.extensions||{})[t]=r}},{key:"removeObjectExtension",value:function(e,t){var r=e.extensions||{},n=r[t];return delete r[t],n}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return By(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}},{key:"addRequiredExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return By(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(t){return t===e}))||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(t){return t===e}))||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var t=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var t=e.meshIndex,r=e.matrix;this.json.nodes=this.json.nodes||[];var n={mesh:t};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var t=e.attributes,r=e.indices,n=e.material,i=e.mode,a=void 0===i?4:i,o={primitives:[{attributes:this._addAttributes(t),mode:a}]};if(r){var s=this._addIndices(r);o.primitives[0].indices=s}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}},{key:"addImage",value:function(e,t){var r=hy(e),n=t||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}},{key:"addBufferView",value:function(e){var t=e.byteLength;By(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=_y(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,t){var r={bufferView:e,type:Iy(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},r=this.addBufferView(e),n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));var i={size:t.size,componentType:Py(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,t))}},{key:"addTexture",value:function(e){var t={source:e.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(t),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,t;this.gltf.buffers=[];var r,n=this.byteLength,i=new ArrayBuffer(n),a=new Uint8Array(i),o=0,s=Dy(this.sourceBuffers||[]);try{for(s.s();!(r=s.n()).done;){o=Cy(r.value,a,o)}}catch(e){s.e(e)}finally{s.f()}null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}},{key:"_removeStringFromArray",value:function(e,t){for(var r=!0;r;){var n=e.indexOf(t);n>-1?e.splice(n,1):r=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};for(var r in e){var n=e[r],i=this._getGltfAttributeName(r),a=this.addBinaryBuffer(n.value,n);t[i]=a}return t}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}},{key:"_getAccessorMinMax",value:function(e,t){var r={min:null,max:null};if(e.length<t)return r;r.min=[],r.max=[];var n,i=Dy(e.subarray(0,t));try{for(i.s();!(n=i.n()).done;){var a=n.value;r.min.push(a),r.max.push(a)}}catch(e){i.e(e)}finally{i.f()}for(var o=t;o<e.length;o+=t)for(var s=0;s<t;s++)r.min[0+s]=Math.min(r.min[0+s],e[o+s]),r.max[0+s]=Math.max(r.max[0+s],e[o+s]);return r}}]),e}(),Hy="object"!==("undefined"==typeof WebAssembly?"undefined":ui()(WebAssembly)),Jy="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",Vy="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",zy=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Ky=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Qy={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Xy={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function qy(e,t,r,n,i){return Wy.apply(this,arguments)}function Wy(){return(Wy=V()(K.a.mark((function e(t,r,n,i,a){var o,s,u=arguments;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>5&&void 0!==u[5]?u[5]:"NONE",e.next=3,Zy();case 3:rv(s=e.sent,s.exports[Xy[a]],t,r,n,i,s.exports[Qy[o||"NONE"]]);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zy(){return Yy.apply(this,arguments)}function Yy(){return(Yy=V()(K.a.mark((function e(){return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Gy||(Gy=$y()),e.abrupt("return",Gy);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $y(){return ev.apply(this,arguments)}function ev(){return(ev=V()(K.a.mark((function e(){var t,r;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Jy,WebAssembly.validate(zy)&&(t=Vy,console.log("Warning: meshopt_decoder is using experimental SIMD support")),e.next=4,WebAssembly.instantiate(tv(t),{});case 4:return r=e.sent,e.next=7,r.instance.exports.__wasm_call_ctors();case 7:return e.abrupt("return",r.instance);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tv(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;++r){var n=e.charCodeAt(r);t[r]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}for(var i=0,a=0;a<e.length;++a)t[i++]=t[a]<60?Ky[t[a]]:64*(t[a]-60)+t[++a];return t.buffer.slice(0,i)}function rv(e,t,r,n,i,a,o){var s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);var h=t(c,n,i,l,a.length);if(0===h&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),0!==h)throw new Error("Malformed buffer data: ".concat(h))}function nv(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return iv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return iv(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function iv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var av="EXT_meshopt_compression";function ov(e){if(new Ny(e).getRequiredExtensions().includes("EXT_meshopt_compression")&&!Hy)throw new Error("gltf: Required extension ".concat("EXT_meshopt_compression"," not supported by browser"))}function sv(e,t){return uv.apply(this,arguments)}function uv(){return(uv=V()(K.a.mark((function e(t,r){var n,i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=new Ny(t),null!=r&&null!==(n=r.gltf)&&void 0!==n&&n.decompressMeshes){e.next=3;break}return e.abrupt("return");case 3:a=[],o=nv(t.json.bufferViews||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,a.push(cv(i,u))}catch(e){o.e(e)}finally{o.f()}return e.next=8,Promise.all(a);case 8:i.removeExtension("EXT_meshopt_compression");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cv(e,t){return lv.apply(this,arguments)}function lv(){return(lv=V()(K.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d,p,y;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.getObjectExtension(r,"EXT_meshopt_compression"))){e.next=9;break}return i=r.buffer,a=n.byteOffset,o=void 0===a?0:a,s=n.byteLength,u=void 0===s?0:s,c=n.byteStride,l=n.count,f=n.mode,h=n.filter,d=void 0===h?"NONE":h,p=new Uint8Array(i,o,u),y=new ArrayBuffer(l*c),e.next=8,qy(new Uint8Array(y),l,c,p,f,d);case 8:return e.abrupt("return",y);case 9:return e.abrupt("return",null);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fv=["image/png","image/jpeg","image/gif"],hv={};function dv(e){return void 0===hv[e]&&(hv[e]=function(e){switch(e){case"image/webp":return function(){if(!Ec)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch(e){return!1}}();case"image/svg":return Ec;default:if(!Ec){var t=globalThis._parseImageNode;return Boolean(t)&&fv.includes(e)}return!0}}(e)),hv[e]}function pv(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return yv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yv(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function yv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vv="EXT_texture_webp";function gv(e,t){var r=new Ny(e);if(dv("image/webp")){var n,i=pv(r.json.textures||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=r.getObjectExtension(a,"EXT_texture_webp");o&&(a.source=o.source),r.removeObjectExtension(a,"EXT_texture_webp")}}catch(e){i.e(e)}finally{i.f()}r.removeExtension("EXT_texture_webp")}else if(r.getRequiredExtensions().includes("EXT_texture_webp"))throw new Error("gltf: Required extension ".concat("EXT_texture_webp"," not supported by browser"))}function mv(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return bv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bv(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function bv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Av="KHR_texture_basisu";function Bv(e,t){var r,n=new Ny(e),i=mv(n.json.textures||[]);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=n.getObjectExtension(a,"KHR_texture_basisu");o&&(a.source=o.source),n.removeObjectExtension(a,"KHR_texture_basisu")}}catch(e){i.e(e)}finally{i.f()}n.removeExtension("KHR_texture_basisu")}function wv(e){var t={};for(var r in e){var n=e[r];if("indices"!==r){var i=xv(n);t[r]=i}}return t}function xv(e){var t=function(e){var t=e,r=1,n=0;e&&e.value&&(t=e.value,r=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return null;if(Array.isArray(e))return new t(e);if(r&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/r);return{buffer:t,size:r,count:n}}(e),r=t.buffer,n=t.size;return{value:r,size:n,byteOffset:0,count:t.count,type:Iy(n),componentType:Py(r)}}function _v(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 Cv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_v(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ov=K.a.mark(Lv);function Ev(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Tv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tv(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Tv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Sv="KHR_draco_mesh_compression";function kv(e,t,r){var n,i=new Ny(e),a=Ev(Lv(i));try{for(a.s();!(n=a.n()).done;){var o=n.value;i.getObjectExtension(o,"KHR_draco_mesh_compression")}}catch(e){a.e(e)}finally{a.f()}}function Mv(e,t,r){return Iv.apply(this,arguments)}function Iv(){return(Iv=V()(K.a.mark((function e(t,r,n){var i,a,o,s,u,c;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r&&null!==(i=r.gltf)&&void 0!==i&&i.decompressMeshes){e.next=2;break}return e.abrupt("return");case 2:a=new Ny(t),o=[],s=Ev(Lv(a));try{for(s.s();!(u=s.n()).done;)c=u.value,a.getObjectExtension(c,"KHR_draco_mesh_compression")&&o.push(Rv(a,c,r,n))}catch(e){s.e(e)}finally{s.f()}return e.next=8,Promise.all(o);case 8:a.removeExtension("KHR_draco_mesh_compression");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pv(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Ny(e),i=Ev(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value;Fv(a,r),n.addRequiredExtension("KHR_draco_mesh_compression")}}catch(e){i.e(e)}finally{i.f()}}function Rv(e,t,r,n){return Dv.apply(this,arguments)}function Dv(){return(Dv=V()(K.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,y,v,g,m;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.getObjectExtension(r,"KHR_draco_mesh_compression")){e.next=3;break}return e.abrupt("return");case 3:return o=t.getTypedArrayForBufferView(a.bufferView),s=yc(o.buffer,o.byteOffset),u=i.parse,delete(c=Cv({},n))["3d-tiles"],e.next=10,u(s,sd,c,i);case 10:for(l=e.sent,f=wv(l.attributes),h=0,d=Object.entries(f);h<d.length;h++)p=E()(d[h],2),y=p[0],v=p[1],y in r.attributes&&(g=r.attributes[y],null!=(m=t.getAccessor(g))&&m.min&&null!=m&&m.max&&(v.min=m.min,v.max=m.max));r.attributes=f,l.indices&&(r.indices=xv(l.indices)),jv(r);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fv(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var o=i.DracoWriter.encodeSync({attributes:e}),s=null==a?void 0:null===(r=a.parseSync)||void 0===r?void 0:r.call(a,{attributes:e}),u=i._addFauxAttributes(s.attributes),c=i.addBufferView(o),l={primitives:[{attributes:u,mode:n,extensions:C()({},"KHR_draco_mesh_compression",{bufferView:c,attributes:u})}]};return l}function jv(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function Lv(e){var t,r,n,i,a,o;return K.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:t=Ev(e.json.meshes||[]),s.prev=1,t.s();case 3:if((r=t.n()).done){s.next=24;break}n=r.value,i=Ev(n.primitives),s.prev=6,i.s();case 8:if((a=i.n()).done){s.next=14;break}return o=a.value,s.next=12,o;case 12:s.next=8;break;case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(6),i.e(s.t0);case 19:return s.prev=19,i.f(),s.finish(19);case 22:s.next=3;break;case 24:s.next=29;break;case 26:s.prev=26,s.t1=s.catch(1),t.e(s.t1);case 29:return s.prev=29,t.f(),s.finish(29);case 32:case"end":return s.stop()}}),Ov,null,[[1,26,29,32],[6,16,19,22]])}function Gv(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Uv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uv(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Uv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Nv="KHR_lights_punctual";function Hv(e){return Jv.apply(this,arguments)}function Jv(){return(Jv=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new Ny(t),n=r.json,(i=r.getExtension("KHR_lights_punctual"))&&(r.json.lights=i.lights,r.removeExtension("KHR_lights_punctual")),a=Gv(n.nodes||[]);try{for(a.s();!(o=a.n()).done;)s=o.value,(u=r.getObjectExtension(s,"KHR_lights_punctual"))&&(s.light=u.light),r.removeObjectExtension(s,"KHR_lights_punctual")}catch(e){a.e(e)}finally{a.f()}case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vv(e){return zv.apply(this,arguments)}function zv(){return(zv=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new Ny(t),(n=r.json).lights&&(By(!(i=r.addExtension("KHR_lights_punctual")).lights),i.lights=n.lights,delete n.lights),r.json.lights){a=Gv(r.json.lights);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.node,r.addObjectExtension(u,"KHR_lights_punctual",s)}catch(e){a.e(e)}finally{a.f()}delete r.json.lights}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kv(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Qv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qv(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Qv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Xv="KHR_materials_unlit";function qv(e){return Wv.apply(this,arguments)}function Wv(){return(Wv=V()(K.a.mark((function e(t){var r,n,i,a,o;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new Ny(t),n=r.json,r.removeExtension("KHR_materials_unlit"),i=Kv(n.materials||[]);try{for(i.s();!(a=i.n()).done;)o=a.value,o.extensions&&o.extensions.KHR_materials_unlit&&(o.unlit=!0),r.removeObjectExtension(o,"KHR_materials_unlit")}catch(e){i.e(e)}finally{i.f()}case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zv(e){var t=new Ny(e),r=t.json;if(t.materials){var n,i=Kv(r.materials||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.unlit&&(delete a.unlit,t.addObjectExtension(a,"KHR_materials_unlit",{}),t.addExtension("KHR_materials_unlit"))}}catch(e){i.e(e)}finally{i.f()}}}function Yv(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return $v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $v(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function $v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var eg="KHR_techniques_webgl";function tg(e){return rg.apply(this,arguments)}function rg(){return(rg=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u,c;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new Ny(t),n=r.json,i=r.getExtension("KHR_techniques_webgl")){a=ag(i,r),o=Yv(n.materials||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,(c=r.getObjectExtension(u,"KHR_techniques_webgl"))&&(u.technique=Object.assign({},c,a[c.technique]),u.technique.values=og(u.technique,r)),r.removeObjectExtension(u,"KHR_techniques_webgl")}catch(e){o.e(e)}finally{o.f()}r.removeExtension("KHR_techniques_webgl")}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ng(e,t){return ig.apply(this,arguments)}function ig(){return(ig=V()(K.a.mark((function e(t,r){return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ag(e,t){var r=e.programs,n=void 0===r?[]:r,i=e.shaders,a=void 0===i?[]:i,o=e.techniques,s=void 0===o?[]:o,u=new TextDecoder;return a.forEach((function(e){if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=u.decode(t.getTypedArrayForBufferView(e.bufferView))})),n.forEach((function(e){e.fragmentShader=a[e.fragmentShader],e.vertexShader=a[e.vertexShader]})),s.forEach((function(e){e.program=n[e.program]})),s}function og(e,t){var r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((function(t){!e.uniforms[t].value||t in r||(r[t]=e.uniforms[t].value)})),Object.keys(r).forEach((function(e){"object"===ui()(r[e])&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))})),r}function sg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ug(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ug(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function ug(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var cg=[i,a,o,s,u,c,l];function lg(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=cg.filter((function(e){return dg(e.name,r)})),a=sg(i);try{for(a.s();!(t=a.n()).done;){var o,s=t.value;null===(o=s.preprocess)||void 0===o||o.call(s,e,r,n)}}catch(e){a.e(e)}finally{a.f()}}function fg(e){return hg.apply(this,arguments)}function hg(){return(hg=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u,c=arguments;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=c.length>1&&void 0!==c[1]?c[1]:{},n=c.length>2?c[2]:void 0,i=cg.filter((function(e){return dg(e.name,r)})),a=sg(i),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=12;break}return s=o.value,e.next=10,null===(u=s.decode)||void 0===u?void 0:u.call(s,t,r,n);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),a.e(e.t0);case 17:return e.prev=17,a.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}function dg(e,t){var r,n=(null==t?void 0:null===(r=t.gltf)||void 0===r?void 0:r.excludeExtensions)||{};return!(e in n&&!n[e])}function pg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return yg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function yg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return gg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function gg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var mg,bg={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Ag={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Bg=function(){function e(){h()(this,e),En(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),En(this,"json",void 0)}return x()(e,[{key:"normalize",value:function(e,t){this.json=e.json;var r=e.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(r.asset.version))}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(r),this._convertTopLevelObjectsToArrays(r),function(e){var t,r=new Ny(e),n=r.json,i=pg(n.images||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=r.getObjectExtension(a,"KHR_binary_glTF");o&&Object.assign(a,o),r.removeObjectExtension(a,"KHR_binary_glTF")}}catch(e){i.e(e)}finally{i.f()}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,r.removeExtension("KHR_binary_glTF")}(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var t in bg)this._convertTopLevelObjectToArray(e,t)}},{key:"_convertTopLevelObjectToArray",value:function(e,t){var r=e[t];if(r&&!Array.isArray(r))for(var n in e[t]=[],r){var i=r[n];i.id=i.id||n;var a=e[t].length;e[t].push(i),this.idToIndexMap[t][n]=a}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var t in bg)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var r,n=vg(e.textures);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._convertTextureIds(i)}}catch(e){n.e(e)}finally{n.f()}var a,o=vg(e.meshes);try{for(o.s();!(a=o.n()).done;){var s=a.value;this._convertMeshIds(s)}}catch(e){o.e(e)}finally{o.f()}var u,c=vg(e.nodes);try{for(c.s();!(u=c.n()).done;){var l=u.value;this._convertNodeIds(l)}}catch(e){c.e(e)}finally{c.f()}var f,h=vg(e.scenes);try{for(h.s();!(f=h.n()).done;){var d=f.value;this._convertSceneIds(d)}}catch(e){h.e(e)}finally{h.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var t,r=vg(e.primitives);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.attributes,a=n.indices,o=n.material;for(var s in i)i[s]=this._convertIdToIndex(i[s],"accessor");a&&(n.indices=this._convertIdToIndex(a,"accessor")),o&&(n.material=this._convertIdToIndex(o,"material"))}}catch(e){r.e(e)}finally{r.f()}}},{key:"_convertNodeIds",value:function(e){var t=this;e.children&&(e.children=e.children.map((function(e){return t._convertIdToIndex(e,"node")}))),e.meshes&&(e.meshes=e.meshes.map((function(e){return t._convertIdToIndex(e,"mesh")})))}},{key:"_convertSceneIds",value:function(e){var t=this;e.nodes&&(e.nodes=e.nodes.map((function(e){return t._convertIdToIndex(e,"node")})))}},{key:"_convertIdsToIndices",value:function(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);var r,n=vg(e[t]);try{for(n.s();!(r=n.n()).done;){var i=r.value;for(var a in i){var o=i[a],s=this._convertIdToIndex(o,a);i[a]=s}}}catch(e){n.e(e)}finally{n.f()}}},{key:"_convertIdToIndex",value:function(e,t){var r=Ag[t];if(r in this.idToIndexMap){var n=this.idToIndexMap[r][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}},{key:"_updateObjects",value:function(e){var t,r=vg(this.json.buffers);try{for(r.s();!(t=r.n()).done;){delete t.value.type}}catch(e){r.e(e)}finally{r.f()}}},{key:"_updateMaterial",value:function(e){var t,r=vg(e.materials);try{var n=function(){var r=t.value;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var n=r.values&&r.values.tex,i=e.textures.findIndex((function(e){return e.id===n}));-1!==i&&(r.pbrMetallicRoughness.baseColorTexture={index:i})};for(r.s();!(t=r.n()).done;)n()}catch(e){r.e(e)}finally{r.f()}}}]),e}();function wg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new Bg).normalize(e,t)}function xg(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 _g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xg(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Cg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Og={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Eg=10240,Tg=10241,Sg=10242,kg=10243,Mg=10497,Ig=9729,Pg=9986,Rg={magFilter:Eg,minFilter:Tg,wrapS:Sg,wrapT:kg},Dg=(mg={},C()(mg,Eg,Ig),C()(mg,Tg,Pg),C()(mg,Sg,Mg),C()(mg,kg,Mg),mg);var Fg=function(){function e(){h()(this,e),En(this,"baseUri",""),En(this,"json",{}),En(this,"buffers",[]),En(this,"images",[])}return x()(e,[{key:"postProcess",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.json,n=e.buffers,i=void 0===n?[]:n,a=e.images,o=void 0===a?[]:a,s=e.baseUri,u=void 0===s?"":s;return By(r),this.baseUri=u,this.json=r,this.buffers=i,this.images=o,this._resolveTree(this.json,t),this.json}},{key:"_resolveTree",value:function(e){var t=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.bufferViews&&(e.bufferViews=e.bufferViews.map((function(e,r){return t._resolveBufferView(e,r)}))),e.images&&(e.images=e.images.map((function(e,r){return t._resolveImage(e,r)}))),e.samplers&&(e.samplers=e.samplers.map((function(e,r){return t._resolveSampler(e,r)}))),e.textures&&(e.textures=e.textures.map((function(e,r){return t._resolveTexture(e,r)}))),e.accessors&&(e.accessors=e.accessors.map((function(e,r){return t._resolveAccessor(e,r)}))),e.materials&&(e.materials=e.materials.map((function(e,r){return t._resolveMaterial(e,r)}))),e.meshes&&(e.meshes=e.meshes.map((function(e,r){return t._resolveMesh(e,r)}))),e.nodes&&(e.nodes=e.nodes.map((function(e,r){return t._resolveNode(e,r)}))),e.skins&&(e.skins=e.skins.map((function(e,r){return t._resolveSkin(e,r)}))),e.scenes&&(e.scenes=e.scenes.map((function(e,r){return t._resolveScene(e,r)}))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,t){if("object"===ui()(t))return t;var r=this.json[e]&&this.json[e][t];return r||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),r}},{key:"_resolveScene",value:function(e,t){var r=this;return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((function(e){return r.getNode(e)})),e}},{key:"_resolveNode",value:function(e,t){var r=this;return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((function(e){return r.getNode(e)}))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((function(e,t){var n=r.getMesh(t);return e.id=n.id,e.primitives=e.primitives.concat(n.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,t){var r=this;return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((function(e){var t=(e=_g({},e)).attributes;for(var n in e.attributes={},t)e.attributes[n]=r.getAccessor(t[n]);return void 0!==e.indices&&(e.indices=r.getAccessor(e.indices)),void 0!==e.material&&(e.material=r.getMaterial(e.material)),e}))),e}},{key:"_resolveMaterial",value:function(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture=_g({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=_g({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=_g({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=_g({},e.pbrMetallicRoughness);var r=e.pbrMetallicRoughness;r.baseColorTexture&&(r.baseColorTexture=_g({},r.baseColorTexture),r.baseColorTexture.texture=this.getTexture(r.baseColorTexture.index)),r.metallicRoughnessTexture&&(r.metallicRoughnessTexture=_g({},r.metallicRoughnessTexture),r.metallicRoughnessTexture.texture=this.getTexture(r.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,t){var r,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(r=e.componentType,Og[r]),e.components=(n=e.type,Cg[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var i=e.bufferView.buffer,a=Ry(e,e.bufferView),o=a.ArrayType,s=a.byteLength,u=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,c=i.arrayBuffer.slice(u,u+s);e.bufferView.byteStride&&(c=this._getValueFromInterleavedBuffer(i,u,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new o(c)}return e}},{key:"_getValueFromInterleavedBuffer",value:function(e,t,r,n,i){for(var a=new Uint8Array(i*n),o=0;o<i;o++){var s=t+o*r;a.set(new Uint8Array(e.arrayBuffer.slice(s,s+n)),o*n)}return a.buffer}},{key:"_resolveTexture",value:function(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):Dg,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,t){for(var r in e.id=e.id||"sampler-".concat(t),e.parameters={},e){var n=this._enumSamplerParameter(r);void 0!==n&&(e.parameters[n]=e[r])}return e}},{key:"_enumSamplerParameter",value:function(e){return Rg[e]}},{key:"_resolveImage",value:function(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));var r=this.images[t];return r&&(e.image=r),e}},{key:"_resolveBufferView",value:function(e,t){var r=e.buffer,n=_g(_g({id:"bufferView-".concat(t)},e),{},{buffer:this.buffers[r]}),i=this.buffers[r].arrayBuffer,a=this.buffers[r].byteOffset||0;return"byteOffset"in e&&(a+=e.byteOffset),n.data=new Uint8Array(i,a,e.byteLength),n}},{key:"_resolveCamera",value:function(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}]),e}();function jg(e,t){return(new Fg).postProcess(e,t)}function Lg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}function Gg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new DataView(e),i=r.magic,a=void 0===i?1735152710:i,o=n.getUint32(t,!1);return o===a||1735152710===o}function Ug(e,t,r){Js(e.header.byteLength>20);var n=t.getUint32(r+0,!0),i=t.getUint32(r+4,!0);return r+=8,Js(0===i),Hg(e,t,r,n),r+=n,r+=Jg(e,t,r,e.header.byteLength)}function Ng(e,t,r,n){return Js(e.header.byteLength>20),function(e,t,r,n){for(;r+8<=e.header.byteLength;){var i=t.getUint32(r+0,!0),a=t.getUint32(r+4,!0);switch(r+=8,a){case 1313821514:Hg(e,t,r,i);break;case 5130562:Jg(e,t,r,i);break;case 0:n.strict||Hg(e,t,r,i);break;case 1:n.strict||Jg(e,t,r,i)}r+=_y(i,4)}}(e,t,r,n),r+e.header.byteLength}function Hg(e,t,r,n){var i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),_y(n,4)}function Jg(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),_y(n,4)}function Vg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return zg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function zg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Kg(e,t){return Qg.apply(this,arguments)}function Qg(){return(Qg=V()(K.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d=arguments;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=d.length>2&&void 0!==d[2]?d[2]:0,i=d.length>3?d[3]:void 0,a=d.length>4?d[4]:void 0,Xg(t,r,n,i),wg(t,{normalize:null==i?void 0:null===(o=i.gltf)||void 0===o?void 0:o.normalize}),lg(t,i,a),l=[],null==i||null===(s=i.gltf)||void 0===s||!s.loadBuffers||!t.json.buffers){e.next=10;break}return e.next=10,qg(t,i,a);case 10:return null!=i&&null!==(u=i.gltf)&&void 0!==u&&u.loadImages&&(f=Zg(t,i,a),l.push(f)),h=fg(t,i,a),l.push(h),e.next=15,Promise.all(l);case 15:return e.abrupt("return",null!=i&&null!==(c=i.gltf)&&void 0!==c&&c.postProcess?jg(t,i):t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xg(e,t,r,n){(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Gg(t,r,n))&&(t=(new TextDecoder).decode(t));if("string"==typeof t)e.json=Ay(t);else if(t instanceof ArrayBuffer){var i={};r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],new DataView(t)),i=Lg(n,r+0),a=n.getUint32(r+4,!0),o=n.getUint32(r+8,!0);switch(Object.assign(e,{header:{byteOffset:r,byteLength:o,hasBinChunk:!1},type:i,version:a,json:{},binChunks:[]}),r+=12,e.version){case 1:return Ug(e,n,r);case 2:return Ng(e,n,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}(i,t,r,n.glb),By("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else By(!1,"GLTF: must be ArrayBuffer or string");var a=e.json.buffers||[];if(e.buffers=new Array(a.length).fill(null),e._glb&&e._glb.header.hasBinChunk){var o=e._glb.binChunks;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}var s=e.json.images||[];e.images=new Array(s.length).fill({})}function qg(e,t,r){return Wg.apply(this,arguments)}function Wg(){return(Wg=V()(K.a.mark((function e(t,r,n){var i,a,o,s,u,c,l,f;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.json.buffers||[],a=0;case 2:if(!(a<i.length)){e.next=19;break}if(!(o=i[a]).uri){e.next=16;break}return By(n.fetch),c=wy(o.uri,r),e.next=10,null==n?void 0:null===(s=n.fetch)||void 0===s?void 0:s.call(n,c);case 10:return l=e.sent,e.next=13,null==l?void 0:null===(u=l.arrayBuffer)||void 0===u?void 0:u.call(l);case 13:f=e.sent,t.buffers[a]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete o.uri;case 16:++a,e.next=2;break;case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zg(e,t,r){return Yg.apply(this,arguments)}function Yg(){return(Yg=V()(K.a.mark((function e(t,r,n){var i,a,o,s,u,c;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=$g(t),a=t.json.images||[],o=[],s=Vg(i);try{for(s.s();!(u=s.n()).done;)c=u.value,o.push(em(t,a[c],c,r,n))}catch(e){s.e(e)}finally{s.f()}return e.next=7,Promise.all(o);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $g(e){var t,r=new Set,n=Vg(e.json.textures||[]);try{for(n.s();!(t=n.n()).done;){var i=t.value;void 0!==i.source&&r.add(i.source)}}catch(e){n.e(e)}finally{n.f()}return Array.from(r).sort()}function em(e,t,r,n,i){return tm.apply(this,arguments)}function tm(){return(tm=V()(K.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a.fetch,s=a.parse,!r.uri){e.next=9;break}return c=wy(r.uri,i),e.next=5,o(c);case 5:return l=e.sent,e.next=8,l.arrayBuffer();case 8:u=e.sent;case 9:return Number.isFinite(r.bufferView)&&(f=xy(t.json,t.buffers,r.bufferView),u=yc(f.buffer,f.byteOffset,f.byteLength)),By(u,"glTF image has no data"),e.next=13,s(u,[my,Np],{mimeType:r.mimeType,basis:i.basis||{format:jp()}},a);case 13:(h=e.sent)&&h[0]&&(h={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h}),t.images=t.images||[],t.images[n]=h;case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rm(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 nm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rm(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var im={name:"glTF",id:"gltf",module:"gltf",version:"3.1.0",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(e){return am.apply(this,arguments)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};function am(){return(am=V()(K.a.mark((function e(t){var r,n,i,a,o,s=arguments;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2?s[2]:void 0,(r=nm(nm({},im.options),r)).gltf=nm(nm({},im.options.gltf),r.gltf),i=r.byteOffset,a=void 0===i?0:i,o={},e.next=8,Kg(o,t,a,r,n);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var om=0,sm=1;function um(e,t,r,n){e.rotateYtoZ=!0;var i=e.byteOffset+e.byteLength-r;if(0===i)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=yc(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4==0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}function cm(e,t,r,n){return lm.apply(this,arguments)}function lm(){return(lm=V()(K.a.mark((function e(t,r,n,i){var a,o,s;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n["3d-tiles"]||{},fm(t,r,n),!a.loadGLTF){e.next=16;break}if(o=i.parse,s=i.fetch,!t.gltfUrl){e.next=9;break}return e.next=7,s(t.gltfUrl,n);case 7:t.gltfArrayBuffer=e.sent,t.gltfByteOffset=0;case 9:if(!t.gltfArrayBuffer){e.next=16;break}return e.next=12,o(t.gltfArrayBuffer,im,n,i);case 12:t.gltf=e.sent,delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fm(e,t,r){switch(t){case om:var n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),i=(new TextDecoder).decode(n);e.gltfUrl=i.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case sm:break;default:throw new Error("b3dm: Illegal glTF format field")}}function hm(e,t,r,n,i){return dm.apply(this,arguments)}function dm(){return(dm=V()(K.a.mark((function e(t,r,n,i,a){var o,s;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=pm(t,r,n,i,a),e.next=3,cm(t,sm,i,a);case 3:return(s=null==t?void 0:null===(o=t.gltf)||void 0===o?void 0:o.extensions)&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pm(e,t,r,n,i){r=um(e,t,r=Ed(e,t,r=Od(e,t,r=Cd(e,t,r))),n);var a=new dd(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),r}function ym(e,t,r,n,i){return vm.apply(this,arguments)}function vm(){return(vm=V()(K.a.mark((function e(t,r,n,i,a){return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=gm(t,r,n,i,a),e.next=3,cm(t,t.gltfFormat,i,a);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gm(e,t,r,n,i){if(r=Cd(e,t,r),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));r=Od(e,t,r);var a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r=um(e,t,r=Ed(e,t,r+=4),n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new dd(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3);new _d(e.batchTableJson,e.batchTableBinary,s);return function(e,t,r,n){for(var i=[new Array(n),e._batchTable][0],a=new qe,o=(new qe,new qe,new qe,new _t),s=new Yt,u=new qe,c={},l=new Ir,f=[],h=[],d=new qe,p=new qe,y=0;y<n;y++){var v=void 0;if(t.hasProperty("POSITION"))v=t.getProperty("POSITION",5126,3,y,a);else if(t.hasProperty("POSITION_QUANTIZED")){v=t.getProperty("POSITION_QUANTIZED",5123,3,y,a);var g=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3,d);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var m=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3,p);if(!m)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var b=0;b<3;b++)v[b]=v[b]/65535*m[b]+g[b]}if(!v)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(v),c.translation=a,e.normalUp=t.getProperty("NORMAL_UP",5126,3,y,f),e.normalRight=t.getProperty("NORMAL_RIGHT",5126,3,y,h);if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",5123,2,f),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",5123,2,h),e.octNormalUp){if(!e.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}e.eastNorthUp?(Vl.WGS84.eastNorthUpToFixedFrame(a,l),l.getRotationMatrix3(o)):o.identity()}!1,s.fromMatrix3(o),c.rotation=s,u.set(1,1,1);var A=t.getProperty("SCALE",5126,1,y);Number.isFinite(A)&&u.multiplyByScalar(A);var B=t.getProperty("SCALE_NON_UNIFORM",5126,3,y,f);B&&u.scale(B),c.scale=u;var w=t.getProperty("BATCH_ID",5123,1,y);void 0===w&&(w=y);var x=(new Ir).fromQuaternion(c.rotation);l.identity(),l.translate(c.translation),l.multiplyRight(x),l.scale(c.scale);var _=l.clone();i[y]={modelMatrix:_,batchId:w}}e.instances=i}(e,o,0,s),r}function mm(e,t,r,n,i,a){return bm.apply(this,arguments)}function bm(){return(bm=V()(K.a.mark((function e(t,r,n,i,a,o){var s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Cd(t,r,n),s=new DataView(r),t.tilesLength=s.getUint32(n,!0),n+=4,t.tiles=[];case 5:if(!(t.tiles.length<t.tilesLength&&t.byteLength-n>12)){e.next=13;break}return u={},t.tiles.push(u),e.next=10,o(r,n,i,a,u);case 10:n=e.sent,e.next=5;break;case 13:return e.abrupt("return",n);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Am(e,t,r,n){return Bm.apply(this,arguments)}function Bm(){return(Bm=V()(K.a.mark((function e(t,r,n,i){var a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.rotateYtoZ=!0,t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",a=i.parse,e.next=5,a(r,im,n,i);case 5:t.gltf=e.sent;case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wm(e){return xm.apply(this,arguments)}function xm(){return(xm=V()(K.a.mark((function e(t){var r,n,i,a,o=arguments;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[1]:0,n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,(a=o.length>4&&void 0!==o[4]?o[4]:{}).byteOffset=r,a.type=rh(t,r),e.t0=a.type,e.next=e.t0===eh.COMPOSITE?9:e.t0===eh.BATCHED_3D_MODEL?12:e.t0===eh.GLTF?15:e.t0===eh.INSTANCED_3D_MODEL?18:e.t0===eh.POINT_CLOUD?21:24;break;case 9:return e.next=11,mm(a,t,r,n,i,wm);case 11:return e.abrupt("return",e.sent);case 12:return e.next=14,hm(a,t,r,n,i);case 14:return e.abrupt("return",e.sent);case 15:return e.next=17,Am(a,t,n,i);case 17:return e.abrupt("return",e.sent);case 18:return e.next=20,ym(a,t,r,n,i);case 20:return e.abrupt("return",e.sent);case 21:return e.next=23,Nd(a,t,r,n,i);case 23:return e.abrupt("return",e.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(a.type));case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _m(){return(_m=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1952609651===new Uint32Array(t.slice(0,4))[0]){e.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(1===new Uint32Array(t.slice(4,8))[0]){e.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(r=Em(t.slice(8,16)),n=new Uint8Array(t,24,r),i=new TextDecoder("utf8"),a=i.decode(n),o=JSON.parse(a),s=Em(t.slice(16,24)),u=new ArrayBuffer(0),s&&(u=t.slice(24+r)),!("bufferView"in o.tileAvailability)){e.next=18;break}return e.next=17,Cm(o,"tileAvailability",u);case 17:o.tileAvailability.explicitBitstream=e.sent;case 18:if(!("bufferView"in o.contentAvailability)){e.next=22;break}return e.next=21,Cm(o,"contentAvailability",u);case 21:o.contentAvailability.explicitBitstream=e.sent;case 22:if(!("bufferView"in o.childSubtreeAvailability)){e.next=26;break}return e.next=25,Cm(o,"childSubtreeAvailability",u);case 25:o.childSubtreeAvailability.explicitBitstream=e.sent;case 26:return e.abrupt("return",o);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cm(e,t,r){return Om.apply(this,arguments)}function Om(){return(Om=V()(K.a.mark((function e(t,r,n){var i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t[r].bufferView,a=t.bufferViews[i],!(o=t.buffers[a.buffer]).uri){e.next=11;break}return e.next=6,pu(o.uri);case 6:return s=e.sent,e.next=9,s.arrayBuffer();case 9:return u=e.sent,e.abrupt("return",new Uint8Array(u,a.byteOffset,a.byteLength));case 11:return e.abrupt("return",new Uint8Array(n,a.byteOffset,a.byteLength));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Em(e){var t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+Math.pow(2,32)*n}var Tm={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.1.0",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:function(e){return _m.apply(this,arguments)},options:{}},Sm={QUADTREE:4,OCTREE:8};function km(e,t){return Mm.apply(this,arguments)}function Mm(){return(Mm=V()(K.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d,p,y,v,g,m,b,A,B,w,x,_,C,O,E,T,S,k,M,I,P,R,D,F,j=arguments;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=j.length>2&&void 0!==j[2]?j[2]:{mortonIndex:0,x:0,y:0,z:0},i=j.length>3&&void 0!==j[3]?j[3]:0,a=j.length>4&&void 0!==j[4]?j[4]:0,o=j.length>5&&void 0!==j[5]?j[5]:{level:0,mortonIndex:0,x:0,y:0,z:0},s=r.subdivisionScheme,u=r.subtreeLevels,c=r.maximumLevel,l=r.contentUrlTemplate,f=r.subtreesUriTemplate,h=r.basePath,d={children:[],lodMetricValue:0,contentUrl:""},p=Sm[s],y=1&i,v=i>>1&1,g=i>>2&1,m=(Math.pow(p,a)-1)/(p-1),b=Rm(n.mortonIndex,i),A=m+b,B=Rm(n.x,y),w=Rm(n.y,v),x=Rm(n.z,g),_=!1,a+1>u&&(_=Im(t.childSubtreeAvailability,b)),C=Rm(o.x,B),O=Rm(o.y,w),E=Rm(o.z,x),T=a+o.level,!_){e.next=40;break}return S="".concat(h,"/").concat(f),k=Dm(S,T,C,O,E),e.next=27,hl(k,Tm);case 27:M=e.sent,t=M,o.mortonIndex=b,o.x=B,o.y=w,o.z=x,o.level=a,b=0,A=0,B=0,w=0,x=0,a=0;case 40:if(Im(t.tileAvailability,A)&&!(a>c)){e.next=43;break}return e.abrupt("return",d);case 43:Im(t.contentAvailability,A)&&(d.contentUrl=Dm(l,T,C,O,E)),I=a+1,P={mortonIndex:b,x:B,y:w,z:x},R=0;case 48:if(!(R<p)){e.next=56;break}return e.next=51,km(t,r,P,R,I,o);case 51:((D=e.sent).contentUrl||D.children.length)&&(F=Pm(D,T+1,r),d.children.push(F));case 53:R++,e.next=48;break;case 56:return e.abrupt("return",d);case 57:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Im(e,t){return"constant"in e?Boolean(e.constant):!!e.explicitBitstream&&(r=t,n=e.explicitBitstream,i=Math.floor(r/8),a=r%8,1==(n[i]>>a&1));var r,n,i,a}function Pm(e,t,r){var n=r.basePath,i=r.refine,a=r.getRefine,o=r.lodMetricType,s=r.getTileType,u=r.rootLodMetricValue,c=e.contentUrl&&e.contentUrl.replace("".concat(n,"/"),""),l=u/Math.pow(2,t);return{children:e.children,contentUrl:e.contentUrl,content:{uri:c},id:e.contentUrl,refine:a(i),type:s(e),lodMetricType:o,lodMetricValue:l}}function Rm(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function Dm(e,t,r,n,i){var a=function(e){var t={};for(var r in e)t["{".concat(r,"}")]=e[r];return t}({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,(function(e){return a[e]}))}function Fm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return jm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jm(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function jm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lm(e){if(!e.contentUrl)return cf;var t=e.contentUrl.split(".").pop();switch(t){case"pnts":return ff;case"i3dm":case"b3dm":case"glb":case"gltf":return lf;default:return t}}function Gm(e){switch(e){case"REPLACE":case"replace":return uf;case"ADD":case"add":return sf;default:return e}}function Um(e,t){if(!e)return null;if(e.content){var r=e.content.uri||e.content.url;e.contentUrl="".concat(t.basePath,"/").concat(r)}return e.id=e.contentUrl,e.lodMetricType=yf,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=Lm(e),e.refine=Gm(e.refine),e}function Nm(e){var t=e.basePath,r=Um(e.root,e),n=[];for(n.push(r);n.length>0;){var i,a=Fm((n.pop()||{}).children||[]);try{for(a.s();!(i=a.n()).done;){var o=i.value;Um(o,{basePath:t}),n.push(o)}}catch(e){a.e(e)}finally{a.f()}}return r}function Hm(e){return Jm.apply(this,arguments)}function Jm(){return(Jm=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.root){e.next=2;break}return e.abrupt("return",null);case 2:return r=t.basePath,n=t.root.extensions["3DTILES_implicit_tiling"],i=n.subdivisionScheme,a=n.maximumLevel,o=n.subtreeLevels,s=n.subtrees.uri,u=Dm(s,0,0,0,0),c="".concat(r,"/").concat(u),e.next=9,hl(c,Tm);case 9:return l=e.sent,f="".concat(r,"/").concat(t.root.content.uri),h=t.root.refine,d=t.root.geometricError,p={contentUrlTemplate:f,subtreesUriTemplate:s,subdivisionScheme:i,subtreeLevels:o,maximumLevel:a,refine:h,basePath:r,lodMetricType:yf,rootLodMetricValue:d,getTileType:Lm,getRefine:Gm},e.next=16,Vm(t.root,l,p);case 16:return e.abrupt("return",e.sent);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vm(e,t,r){return zm.apply(this,arguments)}function zm(){return(zm=V()(K.a.mark((function e(t,r,n){var i,a,o;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",null);case 2:return t.lodMetricType=yf,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,e.next=7,km(r,n);case 7:return i=e.sent,a=i.children,(o=i.contentUrl)&&(t.contentUrl=o,t.content={uri:o.replace("".concat(n.basePath,"/"),"")}),t.refine=Gm(t.refine),t.type=Lm(t),t.children=a,t.id=t.contentUrl,e.abrupt("return",t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Km={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.1.0",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(e,t,r){return Ym.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function Qm(e){return n.dirname(e.url)}function Xm(e,t,r){return qm.apply(this,arguments)}function qm(){return(qm=V()(K.a.mark((function e(t,r,n){var i;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={content:{featureIds:null}},0,e.next=4,wm(t,0,r,n,i.content);case 4:return e.abrupt("return",i.content);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wm(e,t,r){return Zm.apply(this,arguments)}function Zm(){return(Zm=V()(K.a.mark((function e(t,r,n){var i,a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=JSON.parse((new TextDecoder).decode(t))).loader=r.loader||Km,a.url=n.url,a.basePath=Qm(a),!$m(a)){e.next=10;break}return e.next=7,Hm(a);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=Nm(a);case 11:return a.root=e.t0,a.type=pf,a.lodMetricType=yf,a.lodMetricValue=(null===(i=a.root)||void 0===i?void 0:i.lodMetricValue)||0,e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ym(){return(Ym=V()(K.a.mark((function e(t,r,n){var i;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r["3d-tiles"]||{},!("auto"===i.isTileset?n.url&&-1!==n.url.indexOf(".json"):i.isTileset)){e.next=8;break}return e.next=5,Wm(t,r,n);case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,Xm(t,r,n);case 10:t=e.sent;case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $m(e){var t,r;return(null==e?void 0:null===(t=e.extensionsRequired)||void 0===t?void 0:t.includes("3DTILES_implicit_tiling"))&&(null==e?void 0:null===(r=e.extensionsUsed)||void 0===r?void 0:r.includes("3DTILES_implicit_tiling"))}function eb(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 tb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eb(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rb(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var nb=[0],ib={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:Km,onTilesetLoad:{type:"function",value:function(e){},compare:!1},onTileLoad:{type:"function",value:function(e){},compare:!1},onTileUnload:{type:"function",value:function(e){},compare:!1},onTileError:{type:"function",value:function(e,t,r){},compare:!1},_getMeshColor:{type:"function",value:function(e){return[255,255,255]},compare:!1}},ab=function(e){p()(n,e);var t,r=rb(n);function n(){return h()(this,n),r.apply(this,arguments)}return x()(n,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&b.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var e=this.state.tileset3d;return e&&e.isLoaded()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,n=e.changeFlags;if(t.data&&t.data!==r.data&&this._loadTileset(t.data),n.viewportChanged){var i=this.state.activeViewports;Object.keys(i).length&&(this._updateTileset(i),this.state.lastUpdatedViewports=i,this.state.activeViewports={})}if(n.propsChanged){var a=this.state.layerMap;for(var o in a)a[o].needsUpdate=!0}}},{key:"activateViewport",value:function(e){var t=this.state,r=t.activeViewports,n=t.lastUpdatedViewports;this.internalState.viewport=e,r[e.id]=e;var i=null==n?void 0:n[e.id];i&&e.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(e){var t=e.info,r=e.sourceLayer,n=this.state.layerMap,i=r&&r.id;if(i){var a=i.substring(this.id.length+1),o=a.substring(a.indexOf("-")+1);t.object=n[o]&&n[o].tile}return t}},{key:"filterSubLayer",value:function(e){var t=e.layer,r=e.viewport,n=t.props.tile,i=r.id;return n.selected&&n.viewportIds.includes(i)}},{key:"_updateAutoHighlight",value:function(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}},{key:"_loadTileset",value:(t=V()(K.a.mark((function e(t){var r,n,i,a,o,s,u;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.props.loadOptions,n=void 0===r?{}:r,i=this.props.loader||this.props.loaders,Array.isArray(i)&&(i=i[0]),a={loadOptions:tb({},n)},!i.preload){e.next=10;break}return e.next=7,i.preload(t,n);case 7:(o=e.sent).headers&&(a.loadOptions.fetch=tb(tb({},a.loadOptions.fetch),{},{headers:o.headers})),Object.assign(a,o);case 10:return e.next=12,hl(t,i,a.loadOptions);case 12:s=e.sent,u=new $f(s,tb({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileLoadFail:this.props.onTileError},a)),this.setState({tileset3d:u,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(u);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_onTileLoad",value:function(e){var t=this.state.lastUpdatedViewports;this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}},{key:"_updateTileset",value:function(e){var t=this.state.tileset3d,r=this.context.timeline,n=Object.keys(e).length;if(r&&n&&t){var i=t.update(Object.values(e));this.state.frameNumber!==i&&this.setState({frameNumber:i})}}},{key:"_getSubLayer",value:function(e,t){if(!e.content)return null;switch(e.type){case ff:return this._makePointCloudLayer(e,t);case lf:return this._make3DModelLayer(e,t);case hf:return this._makeSimpleMeshLayer(e,t);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(e.content.type))}}},{key:"_makePointCloudLayer",value:function(e,t){var r=e.content,n=r.attributes,i=r.pointCount,a=r.constantRGBA,o=r.cartographicOrigin,s=r.modelMatrix,u=n.positions,c=n.normals,l=n.colors;if(!u)return null;var f=t&&t.props.data||{header:{vertexCount:i},attributes:{POSITION:u,NORMAL:c,COLOR_0:l}},h=this.props,d=h.pointSize,p=h.getPointColor;return new(this.getSubLayerClass("pointcloud",b.PointCloudLayer))({pointSize:d},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(e.id),tile:e,data:f,coordinateSystem:b.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:o,modelMatrix:s,getColor:a||p,_offset:0})}},{key:"_make3DModelLayer",value:function(e){var t=e.content,r=t.gltf,n=t.instances,i=t.cartographicOrigin,a=t.modelMatrix;return new(this.getSubLayerClass("scenegraph",b.ScenegraphLayer))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(e.id),tile:e,data:n||nb,scenegraph:r,coordinateSystem:b.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:i,modelMatrix:a,getTransformMatrix:function(e){return e.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(e,t){var r=e.content,n=r.attributes,i=r.indices,a=r.modelMatrix,o=r.cartographicOrigin,s=r.coordinateSystem,u=void 0===s?b.COORDINATE_SYSTEM.METER_OFFSETS:s,c=r.material,l=r.featureIds,f=this.props._getMeshColor,h=t&&t.props.mesh||new Ai.Geometry({drawMode:4,attributes:ob(n),indices:i});return new(this.getSubLayerClass("mesh",Ps))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:h,data:nb,getColor:f(e),pbrMaterial:c,modelMatrix:a,coordinateOrigin:o,coordinateSystem:u,featureIds:l,_offset:0})}},{key:"renderLayers",value:function(){var e=this,t=this.state,r=t.tileset3d,n=t.layerMap;return r?r.tiles.map((function(t){var r=n[t.id]=n[t.id]||{tile:t},i=r.layer;return t.selected&&(i?r.needsUpdate&&(i=e._getSubLayer(t,i),r.needsUpdate=!1):i=e._getSubLayer(t)),r.layer=i,i})).filter(Boolean):null}}]),n}(b.CompositeLayer);function ob(e){var t={};return t.positions=tb(tb({},e.positions),{},{value:new Float32Array(e.positions.value)}),e.normals&&(t.normals=e.normals),e.texCoords&&(t.texCoords=e.texCoords),e.colors&&(t.colors=e.colors),e.uvRegions&&(t.uvRegions=e.uvRegions),t}ab.layerName="Tile3DLayer",ab.defaultProps=ib;var sb={name:"Terrain",id:"terrain",module:"terrain",version:"3.1.0",worker:!0,extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};function ub(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}function cb(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 lb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cb(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var fb=[1],hb=lb(lb({},Kn.defaultProps),{},{elevationData:mn,texture:lb(lb({},mn),{},{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:{type:"string",value:null},wireframe:!1,material:!0,loaders:[sb]});function db(e){return Array.isArray(e)?e.join(";"):e}var pb=function(e){p()(r,e);var t=ub(r);function r(){return h()(this,r),t.apply(this,arguments)}return x()(r,[{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,n=t.elevationData!==r.elevationData;if(n){var i=t.elevationData,a=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:a})}var o=n||t.meshMaxError!==r.meshMaxError||t.elevationDecoder!==r.elevationDecoder||t.bounds!==r.bounds;if(!this.state.isTiled&&o){var s=this.loadTerrain(t);this.setState({terrain:s})}t.workerUrl&&b.log.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(e){var t,r=e.elevationData,n=e.bounds,i=e.elevationDecoder,a=e.meshMaxError,o=e.signal;if(!r)return null;var s=this.getLoadOptions();return s=lb(lb({},s),{},{terrain:lb(lb({skirtHeight:this.state.isTiled?2*a:0},null===(t=s)||void 0===t?void 0:t.terrain),{},{bounds:n,meshMaxError:a,elevationDecoder:i})}),(0,this.props.fetch)(r,{propName:"elevationData",layer:this,loadOptions:s,signal:o})}},{key:"getTiledTerrainData",value:function(e){var t=this.props,r=t.elevationData,n=t.fetch,i=t.texture,a=t.elevationDecoder,o=t.meshMaxError,s=this.context.viewport,u=An(r,e),c=An(i,e),l=e.bbox,f=e.signal,h=s.isGeospatial?s.projectFlat([l.west,l.south]):[l.left,l.bottom],d=s.isGeospatial?s.projectFlat([l.east,l.north]):[l.right,l.top],p=[h[0],h[1],d[0],d[1]],y=this.loadTerrain({elevationData:u,bounds:p,elevationDecoder:a,meshMaxError:o,signal:f}),v=c?n(c,{propName:"texture",layer:this,loaders:[],signal:f}).catch((function(e){return null})):Promise.resolve(null);return Promise.all([y,v])}},{key:"renderSubLayers",value:function(e){var t=this.getSubLayerClass("mesh",b.SimpleMeshLayer),r=e.data,n=e.color;if(!r)return null;var i=E()(r,2),a=i[0],o=i[1];return new t(e,{data:fb,mesh:a,texture:o,_instanced:!1,coordinateSystem:b.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(e){return[0,0,0]},getColor:n})}},{key:"onViewportLoad",value:function(e){if(e){var t=this.state.zRange,r=e.map((function(e){return e.content})).filter(Boolean).map((function(e){return e[0].header.boundingBox.map((function(e){return e[2]}))}));if(0!==r.length){var n=Math.min.apply(Math,q()(r.map((function(e){return e[0]})))),i=Math.max.apply(Math,q()(r.map((function(e){return e[1]}))));(!t||n<t[0]||i>t[1])&&this.setState({zRange:[n,i]})}}}},{key:"renderLayers",value:function(){var e=this.props,t=e.color,r=e.material,n=e.elevationData,i=e.texture,a=e.wireframe,o=e.meshMaxError,s=e.elevationDecoder,u=e.tileSize,c=e.maxZoom,l=e.minZoom,f=e.extent,h=e.maxRequests,d=e.onTileLoad,p=e.onTileUnload,y=e.onTileError,v=e.maxCacheSize,g=e.maxCacheByteSize,m=e.refinementStrategy;return this.state.isTiled?new Kn(this.getSubLayerProps({id:"tiles"}),{wireframe:a,color:t,material:r,getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:db(n),texture:db(i),meshMaxError:o,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:u,maxZoom:c,minZoom:l,extent:f,maxRequests:h,onTileLoad:d,onTileUnload:p,onTileError:y,maxCacheSize:v,maxCacheByteSize:g,refinementStrategy:m}):new(this.getSubLayerClass("mesh",b.SimpleMeshLayer))(this.getSubLayerProps({id:"mesh"}),{data:fb,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(e){return[0,0,0]},getColor:t,material:r,wireframe:a})}}]),r}(b.CompositeLayer);function yb(e){for(var t,r,n=0,i=0,a=e.length-1;i<e.length;a=i++)t=e[i],n+=((r=e[a])[0]-t[0])*(t[1]+r[1]);return n}function vb(e,t,r){t&&r&&(1===e?t.id=r.readVarint():2===e?function(e,t){var r=e.readVarint()+e.pos;for(;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos))}pb.layerName="TerrainLayer",pb.defaultProps=hb;var gb=function(){function e(t,r,n,i,a){h()(this,e),En(this,"properties",void 0),En(this,"extent",void 0),En(this,"type",void 0),En(this,"id",void 0),En(this,"_pbf",void 0),En(this,"_geometry",void 0),En(this,"_keys",void 0),En(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,t.readFields(vb,this,r)}return x()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,a=0,o=0,s=[];e.pos<r;){if(i<=0){var u=e.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)a+=e.readSVarint(),o+=e.readSVarint(),1===n&&(t&&s.push(t),t=[]),t&&t.push([a,o]);else{if(7!==n)throw new Error("unknown command ".concat(n));t&&t.push(t[0].slice())}}return t&&s.push(t),s}},{key:"bbox",value:function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,u=1/0,c=-1/0;e.pos<t;){if(n<=0){var l=e.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=e.readSVarint())<u&&(u=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command ".concat(r))}return[o,u,s,c]}},{key:"_toGeoJSON",value:function(t){var r,n,i=this.loadGeometry(),a=e.types[this.type];switch(this.type){case 1:var o=[];for(r=0;r<i.length;r++)o[r]=i[r][0];t(i=o,this);break;case 2:for(r=0;r<i.length;r++)t(i[r],this);break;case 3:for(i=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],a=0;a<t;a++){var o=yb(e[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[e[a]]):r&&r.push(e[a]))}return r&&i.push(r),i}(i),r=0;r<i.length;r++)for(n=0;n<i[r].length;n++)t(i[r][n],this)}1===i.length?i=i[0]:a="Multi".concat(a);var s={type:"Feature",geometry:{type:a,coordinates:i},properties:this.properties};return null!==this.id&&(s.id=this.id),s}},{key:"toGeoJSON",value:function(e){if("function"==typeof e)return this._toGeoJSON(e);var t=e.x,r=e.y,n=e.z,i=this.extent*Math.pow(2,n),a=this.extent*t,o=this.extent*r;return this._toGeoJSON((function(e){for(var t=0;t<e.length;t++){var r=e[t];r[0]=360*(r[0]+a)/i-180;var n=180-360*(r[1]+o)/i;r[1]=360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}}))}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),e}(),mb=function(){function e(t,r){h()(this,e),En(this,"version",void 0),En(this,"name",void 0),En(this,"extent",void 0),En(this,"length",void 0),En(this,"_pbf",void 0),En(this,"_keys",void 0),En(this,"_values",void 0),En(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(bb,this,r),this.length=this._features.length}return x()(e,[{key:"feature",value:function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new gb(this._pbf,t,this.extent,this._keys,this._values)}}]),e}();function bb(e,t,r){t&&r&&(15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){var t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r)))}var Ab=function e(t,r){h()(this,e),En(this,"layers",void 0),this.layers=t.readFields(Bb,{},r)};function Bb(e,t,r){if(3===e&&r){var n=new mb(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function wb(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.start,n=void 0===r?0:r,i=t.end,a=void 0===i?e.length:i,o=t.size||2,s=0,u=n,c=a-o;u<a;u+=o)s+=(e[u]-e[c])*(e[u+1]+e[c+1]),c=u;return s/2}function xb(e,t,r,n){r=r||2;var i,a,o,s,u,c,l,f=t&&t.length,h=f?t[0]*r:e.length,d=_b(e,0,h,r,!0,n&&n[0]),p=[];if(!d||d.next===d.prev)return p;if(f&&(d=function(e,t,r,n,i){var a,o,s,u,c,l=[];for(a=0,o=t.length;a<o;a++)s=t[a]*n,u=a<o-1?t[a+1]*n:e.length,(c=_b(e,s,u,n,!1,i&&i[a+1]))===c.next&&(c.steiner=!0),l.push(Db(c));for(l.sort(Mb),a=0;a<l.length;a++)Ib(l[a],r),r=Cb(r,r.next);return r}(e,t,d,r,n)),e.length>80*r){s=a=e[0],u=o=e[1];for(var y=r;y<h;y+=r)(c=e[y])<s&&(s=c),(l=e[y+1])<u&&(u=l),c>a&&(a=c),l>o&&(o=l);i=0!==(i=Math.max(a-s,o-u))?1/i:0}return Ob(d,p,r,s,u,i),p}function _b(e,t,r,n,i,a){var o,s;if(void 0===a&&(a=wb(e,{start:t,end:r,size:n})),i===a<0)for(o=t;o<r;o+=n)s=zb(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=zb(o,e[o],e[o+1],s);return s&&Gb(s,s.next)&&(Kb(s),s=s.next),s}function Cb(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!Gb(n,n.next)&&0!==Lb(n.prev,n,n.next))n=n.next;else{if(Kb(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function Ob(e,t,r,n,i,a,o){if(e){!o&&a&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=Rb(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,u,c=1;do{for(i=e,e=null,u=null,n=0;i;){for(n++,o=i,a=0,r=0;r<c&&(a++,o=o.nextZ);r++);for(s=c;a>0||s>0&&o;)0!==a&&(0===s||!o||i.z<=o.z)?(t=i,i=i.nextZ,a--):(t=o,o=o.nextZ,s--),u?u.nextZ=t:e=t,t.prevZ=u,u=t;i=o}u.nextZ=null,c*=2}while(n>1)}(i)}(e,n,i,a);for(var s,u,c=e;e.prev!==e.next;)if(s=e.prev,u=e.next,a?Tb(e,n,i,a):Eb(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),Kb(e),e=u.next,c=u.next;else if((e=u)===c){o?1===o?Ob(e=Sb(Cb(e),t,r),t,r,n,i,a,2):2===o&&kb(e,t,r,n,i,a):Ob(Cb(e),t,r,n,i,a,1);break}}}function Eb(e){var t=e.prev,r=e,n=e.next;if(Lb(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Fb(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Lb(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Tb(e,t,r,n){var i=e.prev,a=e,o=e.next;if(Lb(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=Rb(s,u,t,r,n),h=Rb(c,l,t,r,n),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&Fb(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Lb(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&Fb(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Lb(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&Fb(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Lb(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&Fb(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Lb(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function Sb(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!Gb(i,a)&&Ub(i,n,n.next,a)&&Jb(i,a)&&Jb(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),Kb(n),Kb(n.next),n=e=a),n=n.next}while(n!==e);return Cb(n)}function kb(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&jb(o,s)){var u=Vb(o,s);return o=Cb(o,o.next),u=Cb(u,u.next),Ob(o,t,r,n,i,a),void Ob(u,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function Mb(e,t){return e.x-t.x}function Ib(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)return r;var u,c=r,l=r.x,f=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=l&&i!==n.x&&Fb(a<f?i:o,a,l,f,a<f?o:i,a,n.x,n.y)&&(u=Math.abs(a-n.y)/(i-n.x),Jb(n,e)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&Pb(r,n)))&&(r=n,h=u)),n=n.next}while(n!==c);return r}(e,t)){var r=Vb(t,e);Cb(t,t.next),Cb(r,r.next)}}function Pb(e,t){return Lb(e.prev,e,t.prev)<0&&Lb(t.next,e,e.next)<0}function Rb(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Db(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function Fb(e,t,r,n,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function jb(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Ub(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Jb(e,t)&&Jb(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Lb(e.prev,e,t.prev)||Lb(e,t.prev,t))||Gb(e,t)&&Lb(e.prev,e,e.next)>0&&Lb(t.prev,t,t.next)>0)}function Lb(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Gb(e,t){return e.x===t.x&&e.y===t.y}function Ub(e,t,r,n){var i=Hb(Lb(e,t,r)),a=Hb(Lb(e,t,n)),o=Hb(Lb(r,n,e)),s=Hb(Lb(r,n,t));return i!==a&&o!==s||(!(0!==i||!Nb(e,r,t))||(!(0!==a||!Nb(e,n,t))||(!(0!==o||!Nb(r,e,n))||!(0!==s||!Nb(r,t,n)))))}function Nb(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Hb(e){return e>0?1:e<0?-1:0}function Jb(e,t){return Lb(e.prev,e,e.next)<0?Lb(e,t,e.next)>=0&&Lb(e,e.prev,t)>=0:Lb(e,t,e.prev)<0||Lb(e,e.next,t)<0}function Vb(e,t){var r=new Qb(e.i,e.x,e.y),n=new Qb(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function zb(e,t,r,n){var i=new Qb(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Kb(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Qb(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Xb,qb,Wb,Zb,Yb,$b,eA;function tA(e){var t=e.lines.length;if(t<=1)return{data:e.data,areas:[[wb(e.data)]],lines:[e.lines]};for(var r,n,i,a=[],o=[],s=[],u=[],c=0,l=0;l<t;l++){i=e.lines[l]-c,n=e.lines[l+1]-c||e.data.length;var f=wb(e.data.slice(i,n));if(0!==f)void 0===r&&(r=f<0),r===f<0?(u.length&&(a.push(s),o.push(u)),u=[i],s=[f]):(s.push(f),u.push(i));else{var h=e.data.slice(0,i),d=e.data.slice(n);e.data=h.concat(d),c+=n-i}}return s&&a.push(s),u.length&&o.push(u),{areas:a,lines:o,data:e.data}}function rA(e,t,r,n){for(var i=0,a=e.length;i<a;i+=2){e[i]=360*(e[i]+t)/n-180;var o=180-360*(e[i+1]+r)/n;e[i+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}function nA(e,t,r){t&&r&&(1===e?t.id=r.readVarint():2===e?function(e,t){var r=e.readVarint()+e.pos;for(;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos))}function iA(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return aA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aA(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function aA(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var oA=function(){function e(t,r,n,i,a,o){h()(this,e),En(this,"properties",void 0),En(this,"extent",void 0),En(this,"type",void 0),En(this,"id",void 0),En(this,"_pbf",void 0),En(this,"_geometry",void 0),En(this,"_keys",void 0),En(this,"_values",void 0),En(this,"_firstPassData",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,this._firstPassData=o,t.readFields(nA,this,r)}return x()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry,Xb=e.readVarint()+e.pos,qb=1,Zb=0,Yb=0,$b=0,eA=0;for(var t=[],r=[];e.pos<Xb;)if(Zb<=0&&(Wb=e.readVarint(),qb=7&Wb,Zb=Wb>>3),Zb--,1===qb||2===qb)Yb+=e.readSVarint(),$b+=e.readSVarint(),1===qb&&t.push(eA),r.push(Yb,$b),eA+=2;else{if(7!==qb)throw new Error("unknown command ".concat(qb));if(eA>0){var n=t[t.length-1];r.push(r[n],r[n+1]),eA+=2}}return{data:r,lines:t}}},{key:"_toBinaryCoordinates",value:function(t){var r=this.loadGeometry();t(r.data,this);switch(this.type){case 1:this._firstPassData.pointFeaturesCount++,this._firstPassData.pointPositionsCount+=r.lines.length;break;case 2:this._firstPassData.lineFeaturesCount++,this._firstPassData.linePathsCount+=r.lines.length,this._firstPassData.linePositionsCount+=r.data.length/2;break;case 3:var n=tA(r);this._firstPassData.polygonFeaturesCount++,this._firstPassData.polygonObjectsCount+=n.lines.length;var i,a=iA(n.lines);try{for(a.s();!(i=a.n()).done;){var o=i.value;this._firstPassData.polygonRingsCount+=o.length}}catch(e){a.e(e)}finally{a.f()}this._firstPassData.polygonPositionsCount+=n.data.length/2,r=n}r.type=e.types[this.type],r.lines.length>1&&(r.type="Multi".concat(r.type));var s={type:"Feature",geometry:r,properties:this.properties};return null!==this.id&&(s.id=this.id),s}},{key:"toBinaryCoordinates",value:function(e){return"function"==typeof e?this._toBinaryCoordinates(e):this._toBinaryCoordinates(rA)}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),e}(),sA=function(){function e(t,r){h()(this,e),En(this,"version",void 0),En(this,"name",void 0),En(this,"extent",void 0),En(this,"length",void 0),En(this,"_pbf",void 0),En(this,"_keys",void 0),En(this,"_values",void 0),En(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(uA,this,r),this.length=this._features.length}return x()(e,[{key:"feature",value:function(e,t){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var r=this._pbf.readVarint()+this._pbf.pos;return new oA(this._pbf,r,this.extent,this._keys,this._values,t)}}]),e}();function uA(e,t,r){t&&r&&(15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){var t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r)))}var cA=function e(t,r){h()(this,e),En(this,"layers",void 0),this.layers=t.readFields(lA,{},r)};function lA(e,t,r){if(3===e&&r){var n=new sA(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function fA(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 hA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fA(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function dA(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return pA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pA(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function pA(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yA(e,t,r){var n=function(e){var t,r={},n=dA(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.properties)for(var a in i.properties){var o=i.properties[a];r[a]=xA(o,r[a])}}}catch(e){n.e(e)}finally{n.f()}return r}(e),i=Object.keys(n).filter((function(e){return n[e]!==Array}));return vA(e,t,{numericPropKeys:r?r.numericPropKeys:i,propArrayTypes:n,PositionDataType:r?r.PositionDataType:Float32Array})}function vA(e,t,r){for(var n=t.pointPositionsCount,i=t.pointFeaturesCount,a=t.linePositionsCount,o=t.linePathsCount,s=t.lineFeaturesCount,u=t.polygonPositionsCount,c=t.polygonObjectsCount,l=t.polygonRingsCount,f=t.polygonFeaturesCount,h=r.numericPropKeys,d=r.propArrayTypes,p=r.PositionDataType,y=void 0===p?Float32Array:p,v=(e[0]&&"id"in e[0]),g=e.length>65535?Uint32Array:Uint16Array,m={positions:new y(2*n),globalFeatureIds:new g(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},b={pathIndices:a>65535?new Uint32Array(o+1):new Uint16Array(o+1),positions:new y(2*a),globalFeatureIds:new g(a),featureIds:s>65535?new Uint32Array(a):new Uint16Array(a),numericProps:{},properties:[],fields:[]},A={polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new y(2*u),triangles:[],globalFeatureIds:new g(u),featureIds:f>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]},B=0,w=[m,b,A];B<w.length;B++){var x,_=w[B],C=dA(h);try{for(C.s();!(x=C.n()).done;){var O=x.value,E=d[O];_.numericProps[O]=new E(_.positions.length/2)}}catch(e){C.e(e)}finally{C.f()}}b.pathIndices[o]=a,A.polygonIndices[c]=u,A.primitivePolygonIndices[l]=u;var T,S={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},k=dA(e);try{for(k.s();!(T=k.n()).done;){var M=T.value,I=M.geometry,P=M.properties||{};switch(I.type){case"Point":case"MultiPoint":gA(I,m,S,2,P),m.properties.push(wA(P,h)),v&&m.fields.push({id:M.id}),S.pointFeature++;break;case"LineString":case"MultiLineString":mA(I,b,S,2,P),b.properties.push(wA(P,h)),v&&b.fields.push({id:M.id}),S.lineFeature++;break;case"Polygon":case"MultiPolygon":bA(I,A,S,2,P),A.properties.push(wA(P,h)),v&&A.fields.push({id:M.id}),S.polygonFeature++;break;default:throw new Error("Invalid geometry type")}S.feature++}}catch(e){k.e(e)}finally{k.f()}return function(e,t,r,n){var i={points:hA(hA({},e),{},{positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1}}),lines:hA(hA({},t),{},{pathIndices:{value:t.pathIndices,size:1},positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1}}),polygons:hA(hA({},r),{},{polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},positions:{value:r.positions,size:n},triangles:{value:new Uint32Array(r.triangles),size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1}})};for(var a in i)for(var o in i[a].numericProps)i[a].numericProps[o]={value:i[a].numericProps[o],size:1};return i}(m,b,A,2)}function gA(e,t,r,n,i){t.positions.set(e.data,r.pointPosition*n);var a=e.data.length/n;BA(t,i,r.pointPosition,a),t.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+a),t.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+a),r.pointPosition+=a}function mA(e,t,r,n,i){t.positions.set(e.data,r.linePosition*n);var a=e.data.length/n;BA(t,i,r.linePosition,a),t.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+a),t.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+a);for(var o=0,s=e.lines.length;o<s;++o){var u=e.lines[o],c=o===s-1?e.data.length:e.lines[o+1];t.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-u)/n}}function bA(e,t,r,n,i){t.positions.set(e.data,r.polygonPosition*n);var a=e.data.length/n;BA(t,i,r.polygonPosition,a),t.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+a),t.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+a);for(var o=0,s=e.lines.length;o<s;++o){var u=r.polygonPosition;t.polygonIndices[r.polygonObject++]=u;for(var c=e.areas[o],l=e.lines[o],f=e.lines[o+1],h=0,d=l.length;h<d;++h){var p=l[h],y=h===d-1?void 0===f?e.data.length:f[0]:l[h+1];t.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(y-p)/n}AA(t,c,l,{startPosition:u,endPosition:r.polygonPosition,coordLength:n})}}function AA(e,t,r,n){for(var i=n.startPosition,a=n.endPosition,o=n.coordLength,s=i*o,u=a*o,c=e.positions.subarray(s,u),l=r[0],f=xb(c,r.slice(1).map((function(e){return(e-l)/o})),o,t),h=0,d=f.length;h<d;++h)e.triangles.push(i+f[h])}function BA(e,t,r,n){for(var i in e.numericProps)i in t&&e.numericProps[i].fill(t[i],r,r+n)}function wA(e,t){var r={};for(var n in e)t.includes(n)||(r[n]=e[n]);return r}function xA(e,t){return t!==Array&&Number.isFinite(e)?t===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array:Array}var _A=r(44),CA=r.n(_A);function OA(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 EA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?OA(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function TA(e,t){t=function(e){if(e){var t="wgs84"===(e=EA(EA({},e),{},{mvt:e.mvt||{},gis:e.gis||{}})).coordinates,r=e.tileIndex,n=r&&Number.isFinite(r.x)&&Number.isFinite(r.y)&&Number.isFinite(r.z);if(t&&!n)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property. Check documentation.")}return e}(t);var r=[];if(t){var n="binary"===t.gis.format,i={pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength>0){var a=n?new cA(new CA.a(e)):new Ab(new CA.a(e)),o=t.mvt;(Array.isArray(o.layers)?o.layers:Object.keys(a.layers)).forEach((function(e){var t=a.layers[e],s=EA(EA({},o),{},{layerName:e});if(t)for(var u=0;u<t.length;u++){var c=t.feature(u,i),l=n?kA(c,s):SA(c,s);r.push(l)}}))}if(n){var s=yA(r,i);return s.byteLength=e.byteLength,s}}return r}function SA(e,t){var r=e.toGeoJSON("wgs84"===t.coordinates?t.tileIndex:MA);return t.layerProperty&&(r.properties[t.layerProperty]=t.layerName),r}function kA(e,t){var r=e.toBinaryCoordinates("wgs84"===t.coordinates?t.tileIndex:IA);return t.layerProperty&&(r.properties[t.layerProperty]=t.layerName),r}function MA(e,t){for(var r=t.extent,n=0;n<e.length;n++){var i=e[n];i[0]/=r,i[1]/=r}}function IA(e,t){for(var r=t.extent,n=0,i=e.length;n<i;++n)e[n]/=r}function PA(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 RA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?PA(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var DA,FA={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.1.0",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{coordinates:"local",layerProperty:"layerName",layers:null,tileIndex:null}}};RA(RA({},FA),{},{parse:(DA=V()(K.a.mark((function e(t,r){return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",TA(t,r));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return DA.apply(this,arguments)}),parseSync:TA,binary:!0});function jA(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 LA(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return GA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GA(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function GA(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function UA(e,t){var r=null==t?void 0:t.globalFeatureId;return void 0!==r?function(e,t){var r,n=LA(JA(e));try{for(n.s();!(r=n.n()).done;){for(var i=r.value,a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];if(u!==o){if(t===i.globalFeatureIds.value[a])return VA(i,a,s);a=s,o=u}}if(t===i.globalFeatureIds.value[a])return VA(i,a,i.featureIds.value.length)}}catch(e){n.e(e)}finally{n.f()}throw new Error("featureId:".concat(t," not found"))}(e,r):NA(e,null==t?void 0:t.type)}function NA(e,t){return function(e){var t,r=[],n=LA(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(0!==i.featureIds.value.length){for(var a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];u!==o&&(r.push(VA(i,a,s)),a=s,o=u)}r.push(VA(i,a,i.featureIds.value.length))}}}catch(e){n.e(e)}finally{n.f()}return r}(JA(e,t))}function HA(e,t,r){switch(e.type){case"Point":return function(e,t,r){var n=zA(e.positions,t,r);if(n.length>1)return{type:"MultiPoint",coordinates:n};return{type:"Point",coordinates:n[0]}}(e,t,r);case"LineString":return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=e.positions,i=e.pathIndices.value.filter((function(e){return e>=t&&e<=r})),a=i.length>2;if(!a){var o=zA(n,i[0],i[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<i.length-1;u++){var c=zA(n,i[u],i[u+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}(e,t,r);case"Polygon":return function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=t.positions,a=t.polygonIndices.value.filter((function(e){return e>=r&&e<=n})),o=t.primitivePolygonIndices.value.filter((function(e){return e>=r&&e<=n})),s=a.length>2;if(!s){for(var u=[],c=0;c<o.length-1;c++){var l=o[c],f=o[c+1],h=zA(i,l,f);u.push(h)}return{type:"Polygon",coordinates:u}}for(var d=[],p=0;p<a.length-1;p++){var y=a[p],v=a[p+1],g=e(t,y,v).coordinates;d.push(g)}return{type:"MultiPolygon",coordinates:d}}(e,t,r);default:var n=e;throw new Error("Unsupported geometry type: ".concat(null==n?void 0:n.type))}}function JA(e,t){if(!Boolean(e.points||e.lines||e.polygons))return e.type=t||function(e){if(e.pathIndices)return"LineString";if(e.polygonIndices)return"Polygon";return"Point"}(e),[e];var r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function VA(e,t,r){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jA(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({type:"Feature",geometry:HA(e,t,r),properties:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(arguments.length>2&&arguments[2],Object.assign({},e.properties[e.featureIds.value[t]]));for(var n in e.numericProps)r[n]=e.numericProps[n].value[t];return r}(e,t,r)},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;arguments.length>2&&arguments[2];return e.fields&&e.fields[e.featureIds.value[t]]}(e,t,r))}function zA(e,t,r){t=t||0,r=r||e.value.length/e.size;for(var n=[],i=t;i<r;i++){for(var a=Array(),o=i*e.size;o<(i+1)*e.size;o++)a.push(Number(e.value[o]));n.push(a)}return n}function KA(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 QA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?KA(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var XA={Point:qA,MultiPoint:function(e,t,r){return WA(e,t,r)},LineString:ZA,MultiLineString:function(e,t,r){return e.map((function(e){return ZA(e,t,r)}))},Polygon:YA,MultiPolygon:function(e,t,r){return e.map((function(e){return YA(e,t,r)}))}};function qA(e,t,r){var n=E()(e,2),i=n[0],a=n[1],o=E()(t,2),s=o[0],u=o[1],c=xe(s[0],u[0],i),l=xe(s[1],u[1],a);return r.unprojectFlat([c,l])}function WA(e,t,r){return e.map((function(e){return qA(e,t,r)}))}function ZA(e,t,r){return WA(e,t,r)}function YA(e,t,r){return e.map((function(e){return WA(e,t,r)}))}function $A(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return eB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eB(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function eB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var tB=["points","lines","polygons"];function rB(e,t,r,n){var i=e.featureIds.value;if(!i.length)return-1;var a=0,o=i[i.length-1]+1;if(n){var s=function(e,t){if(!e.__layers){for(var r={},n=e.properties,i=0;i<n.length;i++){var a=n[i].layerName;a&&(r[a]?r[a][1]=i:r[a]=[i,i])}e.__layers=r}return e.__layers[t]}(e,n);if(!s)return-1;a=s[0],o=s[1]+1}var u=-1;if(t in e.numericProps){var c=e.numericProps[t].value.findIndex((function(e,t){return e===r&&i[t]>=a&&i[t]<o}));return c>=0?e.globalFeatureIds.value[c]:-1}return(u=t?nB(e.properties,(function(e){return e[t]===r}),a,o):nB(e.fields,(function(e){return e.id===r}),a,o))>=0?function(e,t){if(!e.__ids){for(var r=[],n=e.featureIds.value,i=e.globalFeatureIds.value,a=0;a<n.length;a++)r[n[a]]=i[a];e.__ids=r}return e.__ids[t]}(e,u):-1}function nB(e,t,r,n){for(var i=r;i<n;i++)if(t(e[i],i))return i;return-1}function iB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return aB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aB(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function aB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function oB(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 sB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oB(Object(r),!0).forEach((function(t){C()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function uB(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v()(this,r)}}var cB={uniqueIdProperty:{type:"string",value:""},highlightedFeatureId:null,loaders:[FA],binary:!0},lB=function(e){p()(n,e);var t,r=uB(n);function n(){return h()(this,n),r.apply(this,arguments)}return x()(n,[{key:"initializeState",value:function(){Xn()(m()(n.prototype),"initializeState",this).call(this),this.setState({data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state.data&&this.state.tileset&&Xn()(m()(n.prototype),"isLoaded",this)}},{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,i=e.context,a=e.changeFlags;a.dataChanged&&this._updateTileData(),this.state.data&&(Xn()(m()(n.prototype),"updateState",this).call(this,{props:t,oldProps:r,context:i,changeFlags:a}),this._setWGS84PropertyForTiles());var o=t.highlightColor;o!==r.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}},{key:"_updateTileData",value:(t=V()(K.a.mark((function e(){var t,r,n,i,a;return K.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props.data,r=null,"string"!=typeof t||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)){e.next=18;break}return n=this.props,i=n.onDataLoad,a=n.fetch,this.setState({data:null,tileJSON:null}),e.prev=5,e.next=8,a(t,{propName:"data",layer:this,loaders:[]});case 8:r=e.sent,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(5),this.raiseError(e.t0,"loading TileJSON"),t=null;case 15:i&&i(r),e.next=19;break;case 18:t.tilejson&&(r=t);case 19:r&&(t=r.tiles),this.setState({data:t,tileJSON:r});case 21:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_getTilesetOptions",value:function(e){var t=Xn()(m()(n.prototype),"_getTilesetOptions",this).call(this,e),r=this.state.tileJSON;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>e.minZoom&&(t.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(e.maxZoom)||r.maxzoom<e.maxZoom)&&(t.maxZoom=r.maxzoom)),t}},{key:"renderLayers",value:function(){return this.state.data?Xn()(m()(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(e){var t,r=An(this.state.data,e);if(!r)return Promise.reject("Invalid URL");var n=this.getLoadOptions(),i=this.props,a=i.binary,o=i.fetch,s=e.signal,u=e.x,c=e.y,l=e.z;return o(r,{propName:"data",layer:this,loadOptions:n=sB(sB({},n),{},{mimeType:"application/x-protobuf",mvt:sB(sB({},null===(t=n)||void 0===t?void 0:t.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:{x:u,y:c,z:l}}),gis:a?{format:"binary"}:{}}),signal:s})}},{key:"renderSubLayers",value:function(e){var t=e.tile,r=Math.pow(2,t.z),i=512/r,a=-i,o=512*t.x/r,s=512*(1-t.y/r),u=(new Ir).scale([i,a,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=u,e.coordinateOrigin=[o,s,0],e.coordinateSystem=b.COORDINATE_SYSTEM.CARTESIAN,e.extensions=[].concat(q()(e.extensions||[]),[new b.ClipExtension]));var c=Xn()(m()(n.prototype),"renderSubLayers",this).call(this,e);return!this.props.binary||c instanceof b.GeoJsonLayer||b.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),c}},{key:"_updateAutoHighlight",value:function(e){var t,r,n=this.props.uniqueIdProperty,i=this.state,a=i.hoveredFeatureId,o=i.hoveredFeatureLayerName,s=e.object;s&&(t=fB(s,n),r=hB(s));var u=this.props.highlightColor;"function"==typeof u&&(u=u(e)),a===t&&o===r||this.setState({highlightColor:u,hoveredFeatureId:t,hoveredFeatureLayerName:r})}},{key:"getPickingInfo",value:function(e){var t=Xn()(m()(n.prototype),"getPickingInfo",this).call(this,e),r=this.context.viewport.resolution;if(this.props.binary&&-1!==t.index){var i=e.sourceLayer.props.data;t.object=UA(i,{globalFeatureId:t.index})}return t.object&&!r&&(t.object=pB(t.object,t.tile.bbox,this.context.viewport)),t}},{key:"getSubLayerPropsByTile",value:function(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(e){var t=this.state,r=t.hoveredFeatureId,n=t.hoveredFeatureLayerName,i=this.props,a=i.uniqueIdProperty,o=i.highlightedFeatureId,s=i.binary,u=e.content,c=dB(o);if(!(dB(r)||c))return-1;var l=c?o:r;return Array.isArray(u)?u.findIndex((function(e){var t=fB(e,a)===l,r=c||hB(e)===n;return t&&r})):u&&s?function(e,t,r,n){var i,a=$A(tB);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e[o]&&rB(e[o],t,r,n);if(s>=0)return s}}catch(e){a.e(e)}finally{a.f()}return-1}(u,a,l,c?"":n):-1}},{key:"_pickObjects",value:function(e){var t=this.context,r=t.deck,n=t.viewport,i=n.width,a=n.height,o=n.x,s=n.y,u=[this.id];return r.pickObjects({x:o,y:s,width:i,height:a,layerIds:u,maxObjects:e})}},{key:"getRenderedFeatures",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this._pickObjects(t),n=new Set,i=[],a=iB(r);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=fB(o.object,this.props.uniqueIdProperty);void 0===s?i.push(o.object):n.has(s)||(n.add(s),i.push(o.object))}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"_setWGS84PropertyForTiles",value:function(){var e=this;this.state.tileset.selectedTiles.forEach((function(t){t.hasOwnProperty("dataInWGS84")||Object.defineProperty(t,"dataInWGS84",{get:function(){if(!t.content)return null;if(e.props.binary&&Array.isArray(t.content)&&!t.content.length)return[];if(void 0===t._contentWGS84){var r=e.props.binary?UA(t.content):t.content;t._contentWGS84=r.map((function(r){return pB(r,t.bbox,e.context.viewport)}))}return t._contentWGS84}})}))}}]),n}(Kn);function fB(e,t){return t?e.properties[t]:"id"in e?e.id:void 0}function hB(e){var t;return(null===(t=e.properties)||void 0===t?void 0:t.layerName)||null}function dB(e){return null!=e&&""!==e}function pB(e,t,r){var n=sB(sB({},e),{},{geometry:{type:e.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){return function(e,t,r){var n=[r.projectFlat([t.west,t.north]),r.projectFlat([t.east,t.south])];return QA(QA({},e),{},{coordinates:XA[e.type](e.coordinates,n,r)})}(e.geometry,t,r).coordinates}}),n}lB.layerName="MVTLayer",lB.defaultProps=cB,r.d(t,"GreatCircleLayer",(function(){return B})),r.d(t,"S2Layer",(function(){return H})),r.d(t,"TileLayer",(function(){return Kn})),r.d(t,"TripsLayer",(function(){return Yn})),r.d(t,"H3ClusterLayer",(function(){return oi})),r.d(t,"H3HexagonLayer",(function(){return bi})),r.d(t,"Tile3DLayer",(function(){return ab})),r.d(t,"TerrainLayer",(function(){return pb})),r.d(t,"MVTLayer",(function(){return lB}))}])}));
|