@deck.gl/geo-layers 8.8.0-beta.2 → 8.8.0-beta.5

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.
Files changed (116) hide show
  1. package/dist/dist.dev.js +1892 -1657
  2. package/dist/es5/geohash-layer/geohash-layer.js +71 -0
  3. package/dist/es5/geohash-layer/geohash-layer.js.map +1 -0
  4. package/dist/es5/geohash-layer/geohash-utils.js +77 -0
  5. package/dist/es5/geohash-layer/geohash-utils.js.map +1 -0
  6. package/dist/es5/h3-layers/h3-cluster-layer.js +7 -0
  7. package/dist/es5/h3-layers/h3-cluster-layer.js.map +1 -1
  8. package/dist/es5/h3-layers/h3-hexagon-layer.js +3 -0
  9. package/dist/es5/h3-layers/h3-hexagon-layer.js.map +1 -1
  10. package/dist/es5/index.js +16 -0
  11. package/dist/es5/index.js.map +1 -1
  12. package/dist/es5/mvt-layer/mvt-layer.js.map +1 -1
  13. package/dist/es5/quadkey-layer/quadkey-layer.js.map +1 -1
  14. package/dist/es5/s2-layer/s2-layer.js.map +1 -1
  15. package/dist/es5/terrain-layer/terrain-layer.js +57 -34
  16. package/dist/es5/terrain-layer/terrain-layer.js.map +1 -1
  17. package/dist/es5/tile-3d-layer/tile-3d-layer.js.map +1 -1
  18. package/dist/es5/tile-layer/tile-layer.js +4 -2
  19. package/dist/es5/tile-layer/tile-layer.js.map +1 -1
  20. package/dist/es5/tile-layer/tileset-2d.js +38 -1
  21. package/dist/es5/tile-layer/tileset-2d.js.map +1 -1
  22. package/dist/es5/tile-layer/utils.js +46 -12
  23. package/dist/es5/tile-layer/utils.js.map +1 -1
  24. package/dist/es5/trips-layer/trips-layer.js.map +1 -1
  25. package/dist/esm/geohash-layer/geohash-layer.js +29 -0
  26. package/dist/esm/geohash-layer/geohash-layer.js.map +1 -0
  27. package/dist/esm/geohash-layer/geohash-utils.js +56 -0
  28. package/dist/esm/geohash-layer/geohash-utils.js.map +1 -0
  29. package/dist/esm/h3-layers/h3-cluster-layer.js +5 -0
  30. package/dist/esm/h3-layers/h3-cluster-layer.js.map +1 -1
  31. package/dist/esm/h3-layers/h3-hexagon-layer.js +4 -0
  32. package/dist/esm/h3-layers/h3-hexagon-layer.js.map +1 -1
  33. package/dist/esm/index.js +2 -0
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/mvt-layer/mvt-layer.js.map +1 -1
  36. package/dist/esm/quadkey-layer/quadkey-layer.js.map +1 -1
  37. package/dist/esm/s2-layer/s2-layer.js.map +1 -1
  38. package/dist/esm/terrain-layer/terrain-layer.js +35 -13
  39. package/dist/esm/terrain-layer/terrain-layer.js.map +1 -1
  40. package/dist/esm/tile-3d-layer/tile-3d-layer.js.map +1 -1
  41. package/dist/esm/tile-layer/tile-layer.js +6 -2
  42. package/dist/esm/tile-layer/tile-layer.js.map +1 -1
  43. package/dist/esm/tile-layer/tileset-2d.js +36 -3
  44. package/dist/esm/tile-layer/tileset-2d.js.map +1 -1
  45. package/dist/esm/tile-layer/utils.js +36 -0
  46. package/dist/esm/tile-layer/utils.js.map +1 -1
  47. package/dist/esm/trips-layer/trips-layer.js.map +1 -1
  48. package/dist.min.js +2 -2
  49. package/package.json +2 -2
  50. package/src/geohash-layer/geohash-layer.ts +39 -0
  51. package/src/geohash-layer/geohash-utils.ts +54 -0
  52. package/src/h3-layers/h3-cluster-layer.ts +5 -0
  53. package/src/h3-layers/h3-hexagon-layer.ts +5 -9
  54. package/src/index.ts +5 -0
  55. package/src/mvt-layer/mvt-layer.ts +1 -0
  56. package/src/quadkey-layer/quadkey-layer.ts +1 -0
  57. package/src/s2-layer/s2-layer.ts +1 -0
  58. package/src/terrain-layer/{terrain-layer.js → terrain-layer.ts} +120 -37
  59. package/src/tile-3d-layer/tile-3d-layer.ts +5 -4
  60. package/src/tile-layer/tile-layer.ts +4 -2
  61. package/src/tile-layer/tileset-2d.ts +41 -5
  62. package/src/tile-layer/utils.ts +44 -0
  63. package/src/trips-layer/trips-layer.ts +1 -0
  64. package/typed/geohash-layer/geohash-layer.d.ts +21 -0
  65. package/typed/geohash-layer/geohash-layer.d.ts.map +1 -0
  66. package/typed/geohash-layer/geohash-utils.d.ts +3 -0
  67. package/typed/geohash-layer/geohash-utils.d.ts.map +1 -0
  68. package/typed/h3-layers/h3-cluster-layer.d.ts +1 -0
  69. package/typed/h3-layers/h3-cluster-layer.d.ts.map +1 -1
  70. package/typed/h3-layers/h3-hexagon-layer.d.ts +2 -9
  71. package/typed/h3-layers/h3-hexagon-layer.d.ts.map +1 -1
  72. package/typed/index.d.ts +5 -0
  73. package/typed/index.d.ts.map +1 -1
  74. package/typed/mvt-layer/mvt-layer.d.ts +1 -0
  75. package/typed/mvt-layer/mvt-layer.d.ts.map +1 -1
  76. package/typed/quadkey-layer/quadkey-layer.d.ts +1 -0
  77. package/typed/quadkey-layer/quadkey-layer.d.ts.map +1 -1
  78. package/typed/s2-layer/s2-layer.d.ts +1 -0
  79. package/typed/s2-layer/s2-layer.d.ts.map +1 -1
  80. package/typed/terrain-layer/terrain-layer.d.ts +62 -26
  81. package/typed/terrain-layer/terrain-layer.d.ts.map +1 -1
  82. package/typed/tile-3d-layer/tile-3d-layer.d.ts +4 -3
  83. package/typed/tile-3d-layer/tile-3d-layer.d.ts.map +1 -1
  84. package/typed/tile-layer/tile-layer.d.ts +2 -4
  85. package/typed/tile-layer/tile-layer.d.ts.map +1 -1
  86. package/typed/tile-layer/tileset-2d.d.ts +10 -2
  87. package/typed/tile-layer/tileset-2d.d.ts.map +1 -1
  88. package/typed/tile-layer/utils.d.ts +14 -0
  89. package/typed/tile-layer/utils.d.ts.map +1 -1
  90. package/typed/trips-layer/trips-layer.d.ts +1 -0
  91. package/typed/trips-layer/trips-layer.d.ts.map +1 -1
  92. package/typed/geo-cell-layer/GeoCellLayer.js +0 -49
  93. package/typed/great-circle-layer/great-circle-layer.js +0 -29
  94. package/typed/h3-layers/h3-cluster-layer.js +0 -33
  95. package/typed/h3-layers/h3-hexagon-layer.js +0 -251
  96. package/typed/index.js +0 -33
  97. package/typed/mesh-layer/mesh-layer-fragment.glsl.js +0 -55
  98. package/typed/mesh-layer/mesh-layer-vertex.glsl.js +0 -80
  99. package/typed/mesh-layer/mesh-layer.js +0 -110
  100. package/typed/mvt-layer/coordinate-transform.js +0 -41
  101. package/typed/mvt-layer/find-index-binary.js +0 -96
  102. package/typed/mvt-layer/mvt-layer.js +0 -297
  103. package/typed/quadkey-layer/quadkey-layer.js +0 -18
  104. package/typed/quadkey-layer/quadkey-utils.js +0 -26
  105. package/typed/s2-layer/s2-geometry.js +0 -123
  106. package/typed/s2-layer/s2-layer.js +0 -37
  107. package/typed/s2-layer/s2-utils.js +0 -88
  108. package/typed/terrain-layer/terrain-layer.js +0 -226
  109. package/typed/tile-3d-layer/tile-3d-layer.js +0 -294
  110. package/typed/tile-layer/tile-2d-header.js +0 -113
  111. package/typed/tile-layer/tile-2d-traversal.js +0 -181
  112. package/typed/tile-layer/tile-layer.js +0 -192
  113. package/typed/tile-layer/tileset-2d.js +0 -399
  114. package/typed/tile-layer/types.js +0 -1
  115. package/typed/tile-layer/utils.js +0 -197
  116. package/typed/trips-layer/trips-layer.js +0 -92
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=60)}([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(87)},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(47);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(e,t,r){var n=r(69),i=r(70),a=r(71);e.exports=function(e,t){return n(e)||i(e,t)||a()}},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(t,r){t.exports=e},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){var n=r(88);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){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(78);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(79);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,r){var n=r(75),i=r(76),a=r(49),o=r(77);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,r){e.exports=t},,function(e,t,r){var n=r(83),i=r(84),a=r(85),o=r(86);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;
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=60)}([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(87)},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(47);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(69),i=r(70),a=r(71);e.exports=function(e,t){return n(e)||i(e,t)||a()}},function(e,t,r){var n=r(78),i=r(79),a=r(80);e.exports=function(e){return n(e)||i(e)||a()}},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(t,r){t.exports=e},function(e,t,r){var n=r(9),i=r(12);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){var n=r(88);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){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(81);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(82);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,r){var n=r(75),i=r(76),a=r(49),o=r(77);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,r){e.exports=t},,function(e,t,r){var n=r(83),i=r(84),a=r(85),o=r(86);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?v:p;if(t){if(e<0)return v;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 v=i(0,!0);e.UZERO=v;var y=i(1);e.ONE=y;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(y)},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,v=0,y=0,g=0,m=0;return g+=(m+=s*h)>>>16,y+=(g+=i*h)>>>16,g&=65535,y+=(g+=s*f)>>>16,v+=(y+=n*h)>>>16,y&=65535,v+=(y+=i*f)>>>16,y&=65535,v+=(y+=s*l)>>>16,v+=r*h+n*f+i*l+s*u,o((g&=65535)<<16|(m&=65535),(v&=65535)<<16|(y&=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?v:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return g;i=v}else{if(this.eq(B))return e.eq(y)||e.eq(m)?B:e.eq(B)?y:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?y:m:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(B))return this.unsigned?v: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=y),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(52);e.exports=function(e){return new n(e)}},function(e,t){},,,function(e,t){e.exports=r},function(e,t,r){var n=r(96);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(72),i=r(73),a=r(49),o=r(74);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){},function(e,t,r){"use strict";e.exports=i;var n=r(97);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 v(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function y(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,v,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,y,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){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(48);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){},function(e,t){e.exports=function(e){this.wrapped=e}},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){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){var n=r(89),i=r(90),a=r(91),o=r(93);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(47);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(98),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,r){var n=r(48);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){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){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(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,r){var n=r(50);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(50);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,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 x()}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,v=p&&p(p(_([])));v&&v!==t&&r.call(v,i)&&(d=v);var y=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 _(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:x}}function x(){return{value:void 0,done:!0}}return f.prototype=y.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(y),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(y),y[o]="Generator",y[i]=function(){return this},y.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=_,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:_(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(92);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){},function(e,t,r){var n=r(52);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){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,v=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*v}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"filename",(function(){return rl})),r.d(n,"dirname",(function(){return nl})),r.d(n,"join",(function(){return il}));var i={};r.r(i),r.d(i,"name",(function(){return Yy})),r.d(i,"decode",(function(){return $y}));var a={};r.r(a),r.d(a,"name",(function(){return ug})),r.d(a,"preprocess",(function(){return cg}));var o={};r.r(o),r.d(o,"name",(function(){return hg})),r.d(o,"preprocess",(function(){return dg}));var s={};r.r(s),r.d(s,"name",(function(){return Bg})),r.d(s,"preprocess",(function(){return wg})),r.d(s,"decode",(function(){return _g})),r.d(s,"encode",(function(){return Cg}));var u={};r.r(u),r.d(u,"name",(function(){return Rg})),r.d(u,"decode",(function(){return Pg})),r.d(u,"encode",(function(){return Dg}));var c={};r.r(c),r.d(c,"name",(function(){return Ug})),r.d(c,"decode",(function(){return Ng})),r.d(c,"encode",(function(){return Jg}));var l={};r.r(l),r.d(l,"name",(function(){return Kg})),r.d(l,"decode",(function(){return qg})),r.d(l,"encode",(function(){return Xg}));var f=r(2),h=r.n(f),d=r(6),p=r.n(d),v=r(11),y=r.n(v),g=r(5),m=r.n(g),b=r(0),A=r.n(b),B=r(10);function w(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 y()(this,r)}}var _=function(e){p()(r,e);var t=w(r);function r(){return h()(this,r),t.apply(this,arguments)}return r}(B.ArcLayer);A()(_,"layerName","GreatCircleLayer"),A()(_,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var x=r(3),C=r.n(x);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 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 y()(this,r)}}function E(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}var T=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},B.PolygonLayer.defaultProps),S=function(e){p()(r,e);var t=O(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){return null}},{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.lineWidthUnits,s=e.lineWidthScale,u=e.lineWidthMinPixels,c=e.lineWidthMaxPixels,l=e.lineJointRounded,f=e.lineMiterLimit,h=e.lineDashJustified,d=e.getElevation,p=e.getFillColor,v=e.getLineColor,y=e.getLineWidth,g=this.props,m=g.updateTriggers,b=g.material,A=g.transitions;return new(this.getSubLayerClass("cell",B.PolygonLayer))({filled:i,wireframe:n,extruded:r,elevationScale:t,stroked:a,lineWidthUnits:o,lineWidthScale:s,lineWidthMinPixels:u,lineWidthMaxPixels:c,lineJointRounded:l,lineMiterLimit:f,lineDashJustified:h,material:b,transitions:A,getElevation:d,getFillColor:p,getLineColor:v,getLineWidth:y},this.getSubLayerProps({id:"cell",updateTriggers:m&&{getElevation:m.getElevation,getFillColor:m.getFillColor,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}),this.indexToBounds())}}]),r}(B.CompositeLayer);A()(S,"layerName","GeoCellLayer"),A()(S,"defaultProps",T);var k=r(8),M=r.n(k),I=r(26),R=r.n(I),P=180/Math.PI;function F(e,t,r){var n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function D(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function L(e){return[D(e[0]),D(e[1])]}function j(e,t){var r=M()(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 G(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 U(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){var t=e.padEnd(16,"0");return R.a.fromString(t,16)}(e)}return function(e){for(var t=R.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=R.a.fromString(n,!0,2).toString(10),s=R.a.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}(e.toString())}function N(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,v=0;v<4;v++)for(var y=l[v].slice(0),g=l[v+1],m=(g[0]-y[0])/f,b=(g[1]-y[1])/f,A=0;A<f;A++){y[0]+=m,y[1]+=b;var B=j(s,L(F(u,c,y))),w=(t=B,r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,r=M()(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)*P,o*P]);Math.abs(w[1])>89.999&&(w[0]=p);var _=w[0]-p;w[0]+=_>180?-360:_<-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);G(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}}(U(e)))}function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return 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 y()(this,r)}}var J=function(e){p()(r,e);var t=H(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getS2Token;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return N(r(e,t))}}}}]),r}(S);A()(J,"layerName","S2Layer"),A()(J,"defaultProps",{getS2Token:{type:"accessor",value:function(e){return e.token}}});r(34);var V=r(20),z=r.n(V);r(53),r(54);var K="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function q(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 Q(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function X(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function W(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 Z(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}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Y,$;Y=new K(4),K!=Float32Array&&(Y[0]=0,Y[1]=0,Y[2]=0,Y[3]=0),$=Y;Math.log2;function ee(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],v=t[13],y=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,_=i*c-a*u,x=l*v-f*p,C=l*y-h*p,O=l*g-d*p,E=f*y-h*v,T=f*g-d*v,S=h*g-d*y,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]=(v*_-y*w+g*B)*k,e[3]=(h*w-f*_-d*B)*k,e[4]=(u*O-o*S-c*C)*k,e[5]=(r*S-i*O+a*C)*k,e[6]=(y*A-p*_-g*b)*k,e[7]=(l*_-h*A+d*b)*k,e[8]=(o*T-s*O+c*x)*k,e[9]=(n*O-r*T-a*x)*k,e[10]=(p*w-v*A+g*m)*k,e[11]=(f*A-l*w-d*m)*k,e[12]=(s*C-o*E-u*x)*k,e[13]=(r*E-n*C+i*x)*k,e[14]=(v*b-p*B-y*m)*k,e[15]=(l*B-f*b+h*m)*k,e):null}function te(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],v=t[12],y=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*v,e[1]=b*i+A*u+B*h+w*y,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*v,e[5]=b*i+A*u+B*h+w*y,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*v,e[9]=b*i+A*u+B*h+w*y,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*v,e[13]=b*i+A*u+B*h+w*y,e[14]=b*a+A*c+B*d+w*g,e[15]=b*o+A*l+B*p+w*m,e}function re(e,t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v=r[0],y=r[1],g=r[2];return t===e?(e[12]=t[0]*v+t[4]*y+t[8]*g+t[12],e[13]=t[1]*v+t[5]*y+t[9]*g+t[13],e[14]=t[2]*v+t[6]*y+t[10]*g+t[14],e[15]=t[3]*v+t[7]*y+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*v+s*y+f*g+t[12],e[13]=i*v+u*y+h*g+t[13],e[14]=a*v+c*y+d*g+t[14],e[15]=o*v+l*y+p*g+t[15]),e}function ne(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 ie(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 ae(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 oe(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}var se=function(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};var ue=function(e,t,r,n,i,a,o){var s=1/(t-r),u=1/(n-i),c=1/(a-o);return 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,e};function ce(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 le(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=function(){var e=new K(2);return K!=Float32Array&&(e[0]=0,e[1]=0),e}()}();function fe(){var e=new K(3);return K!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function he(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function de(e,t,r){var n=new K(3);return n[0]=e,n[1]=t,n[2]=r,n}function pe(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ve(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 ye(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 ge(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}function me(e,t,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,h=n*u-i*s,d=i*h-a*f,p=a*l-n*h,v=n*f-i*l,y=2*o;return l*=y,f*=y,h*=y,d*=2,p*=2,v*=2,e[0]=s+l+d,e[1]=u+f+p,e[2]=c+h+v,e}var be=he;!function(){var e=fe()}();function Ae(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var Be=Math.PI,we=Be/4,_e=Be/180,xe=180/Be;function Ce(e){var t=z()(e,2),r=t[0],n=t[1];Ae(Number.isFinite(r)),Ae(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=n*_e;return[512*(r*_e+Be)/(2*Be),512*(Be+Math.log(Math.tan(we+.5*i)))/(2*Be)]}function Oe(e){var t=z()(e,2),r=t[0],n=t[1],i=r/512*(2*Be)-Be,a=2*(Math.atan(Math.exp(n/512*(2*Be)-Be))-we);return[i*xe,a*xe]}Math.PI;r(55);function Ee(e){var t=function(e){for(var t=0,r=0,n=1<<e.length,i=n/512,a=0;a<e.length;a++){n>>=1;var o=parseInt(e[a]);o%2&&(t|=n),o>1&&(r|=n)}return[[t/i,512-r/i],[(t+.99)/i,512-(r+.99)/i]]}(e),r=M()(t,2),n=r[0],i=r[1],a=Oe(n),o=M()(a,2),s=o[0],u=o[1],c=Oe(i),l=M()(c,2),f=l[0],h=l[1];return[f,u,f,h,s,h,s,u,f,u]}function Te(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 y()(this,r)}}var Se=function(e){p()(r,e);var t=Te(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getQuadkey;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return Ee(r(e,t))}}}}]),r}(S);A()(Se,"layerName","QuadkeyLayer"),A()(Se,"defaultProps",{getQuadkey:{type:"accessor",value:function(e){return e.quadkey}}});var ke,Me=r(4),Ie=r.n(Me),Re=r(1),Pe=r.n(Re),Fe=function(){function e(t){h()(this,e),A()(this,"index",void 0),A()(this,"isVisible",void 0),A()(this,"isSelected",void 0),A()(this,"parent",void 0),A()(this,"children",void 0),A()(this,"content",void 0),A()(this,"state",void 0),A()(this,"layers",void 0),A()(this,"id",void 0),A()(this,"bbox",void 0),A()(this,"zoom",void 0),A()(this,"userData",void 0),A()(this,"_abortController",void 0),A()(this,"_loader",void 0),A()(this,"_loaderId",void 0),A()(this,"_isLoaded",void 0),A()(this,"_isCancelled",void 0),A()(this,"_needsReload",void 0),this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}var t;return C()(e,[{key:"data",get:function(){var e=this;return this.isLoading&&this._loader?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=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v;return Pe.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.index,s=this.id,u=this.bbox,c=this.userData,l=this.zoom,f=this._loaderId,this._abortController=new AbortController,h=this._abortController.signal,e.next=7,n.scheduleRequest(this,(function(e){return e.isSelected?1:-1}));case 7:if(d=e.sent){e.next=11;break}return this._isCancelled=!0,e.abrupt("return");case 11:if(!this._isCancelled){e.next=14;break}return d.done(),e.abrupt("return");case 14:return p=null,e.prev=15,e.next=18,r({index:o,id:s,bbox:u,userData:c,zoom:l,signal:h});case 18:p=e.sent,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(15),v=e.t0||!0;case 24:return e.prev=24,d.done(),e.finish(24);case 27:if(f===this._loaderId){e.next=29;break}return e.abrupt("return");case 29:if(this._loader=void 0,this.content=p,!this._isCancelled||p){e.next=34;break}return this._isLoaded=!1,e.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,v?a(v,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(){var e;this.isLoaded||(this._isCancelled=!0,null===(e=this._abortController)||void 0===e||e.abort())}}]),e}(),De=r(7),Le=r.n(De);!function(e){e[e.OUTSIDE=-1]="OUTSIDE",e[e.INTERSECTING=0]="INTERSECTING",e[e.INSIDE=1]="INSIDE"}(ke||(ke={}));var je=r(21),Ge=r.n(je),Ue=r(22),Ne=r.n(Ue);function He(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Je=r(16),Ve=r.n(Je),ze=r(17),Ke=r.n(ze),qe=r(18),Qe=r.n(qe),Xe=r(19),We=r.n(Xe),Ze=r(14),Ye=r.n(Ze);r(38);function $e(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var et=1/Math.PI*180,tt=1/180*Math.PI,rt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.precision,n=void 0===r?rt.precision:r;return e=ft(e),"".concat(parseFloat(e.toPrecision(n)))}function it(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function at(e){return function(e,t){return ht(e,(function(e){return e*tt}),t)}(e)}function ot(e){return st(e)}function st(e,t){return ht(e,(function(e){return e*et}),t)}function ut(e,t,r){return ht(e,(function(e){return Math.max(t,Math.min(r,e))}))}function ct(e,t,r){return it(e)?e.map((function(e,n){return ct(e,t[n],r)})):r*t+(1-r)*e}function lt(e,t,r){var n=rt.EPSILON;r&&(rt.EPSILON=r);try{if(e===t)return!0;if(it(e)&&it(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;++i)if(!lt(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):"number"==typeof e&&"number"==typeof t&&Math.abs(e-t)<=rt.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{rt.EPSILON=n}}function ft(e){return Math.round(e/rt.EPSILON)*rt.EPSILON}function ht(e,t,r){if(it(e)){var n=e;r=r||function(e){return e.clone?e.clone():new Array(e.length)}(n);for(var i=0;i<r.length&&i<n.length;++i)r[i]=t(e[i],i,r);return r}return t(e)}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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var pt=function(e){Qe()(r,e);var t=dt(r);function r(){return Ve()(this,r),t.apply(this,arguments)}return Ke()(r,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{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:"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:"from",value:function(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}},{key:"to",value:function(e){return e===this?this:it(e)?this.toArray(e):this.toObject(e)}},{key:"toTarget",value:function(e){return e?this.to(e):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(rt)}},{key:"formatString",value:function(e){for(var t="",r=0;r<this.ELEMENTS;++r)t+=(r>0?", ":"")+nt(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(!lt(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){if(void 0===r)return this.lerp(this,e,t);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("number"==typeof e)for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(var r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}},{key:"multiplyByScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"check",value:function(){if(rt.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:"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.multiplyByScalar(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:"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 vt(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 yt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function gt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(rt.debug&&!vt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function mt(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var bt=function(e){Qe()(r,e);var t=mt(r);function r(){return Ve()(this,r),t.apply(this,arguments)}return Ke()(r,[{key:"x",get:function(){return this[0]},set:function(e){this[0]=yt(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=yt(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 yt(t)}},{key:"dot",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r)t+=this[r]*e[r];return yt(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 $e(e>=0&&e<this.ELEMENTS,"index is out of range"),yt(this[e])}},{key:"setComponent",value:function(e,t){return $e(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}(pt);function At(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 Bt(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 wt(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}function _t(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var xt,Ct=[0,0,0],Ot=function(e){Qe()(r,e);var t=_t(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 Ve()(this,r),e=t.call(this,-0,-0,-0),1===arguments.length&&it(n)?e.copy(n):(rt.debug&&(yt(n),yt(i),yt(a)),e[0]=n,e[1]=i,e[2]=a),e}return Ke()(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 rt.debug&&(yt(e.x),yt(e.y),yt(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]=yt(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&&pe(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 ve(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Ct:r,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Ct:r,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Ct:r,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return ye(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return Bt(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return ge(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,e[2]=t[2]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return me(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return xt||(xt=new r(0,0,0),Object.freeze(xt)),xt}}]),r}(bt),Et=new Ot,Tt=new Ot,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,0,0],n=arguments.length>2?arguments[2]:void 0;Ge()(this,e),He(this,"center",void 0),He(this,"halfDiagonal",void 0),He(this,"minimum",void 0),He(this,"maximum",void 0),n=n||Et.copy(t).add(r).scale(.5),this.center=new Ot(n),this.halfDiagonal=new Ot(r).subtract(this.center),this.minimum=new Ot(t),this.maximum=new Ot(r)}return Ne()(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=Tt.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?ke.INSIDE:i+n<0?ke.OUTSIDE:ke.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t,r=Et.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}(),kt=new Ot,Mt=new Ot,It=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;Ge()(this,e),He(this,"center",void 0),He(this,"radius",void 0),this.radius=-0,this.center=new Ot,this.fromCenterRadius(t,r)}return Ne()(e,[{key:"fromCenterRadius",value:function(e,t){return this.center.from(e),this.radius=t,this}},{key:"fromCornerPoints",value:function(e,t){return t=kt.from(t),this.center=(new Ot).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=kt.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 Mt.copy(a).scale((-r+s)/o).add(t),this.center.copy(Mt),this.radius=s,this}},{key:"expand",value:function(e){var t=kt.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=oe(kt,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=kt.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?ke.OUTSIDE:n<r?ke.INTERSECTING:ke.INSIDE}}]),e}(),Rt=r(25),Pt=r.n(Rt);function Ft(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var Dt=function(e){Qe()(r,e);var t=Ft(r);function r(){return Ve()(this,r),t.apply(this,arguments)}return Ke()(r,[{key:"toString",value:function(){var e="[";if(rt.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]=yt(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}(pt);function Lt(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],v=r[3],y=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]=v*n+y*o+g*c,e[4]=v*i+y*s+g*l,e[5]=v*a+y*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 jt(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}var Gt;function Ut(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}!function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"}(Gt||(Gt={}));var Nt,Ht,Jt,Vt=Object.freeze([1,0,0,0,1,0,0,0,1]),zt=function(e){Qe()(r,e);var t=Ut(r);function r(e){for(var n,i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return Ve()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):a.length>0?n.copy([e].concat(a)):n.identity(),n}return Ke()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Gt}},{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:"identity",value:function(){return this.copy(Vt)}},{key:"fromObject",value:function(e){return this.check()}},{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,v=a*o,y=a*s,g=a*u;e[0]=1-f-p,e[3]=l-g,e[6]=h+y,e[1]=l+g,e[4]=1-c-p,e[7]=d-v,e[2]=h-y,e[5]=d+v,e[8]=1-c-f}(this,e),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:"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(){return function(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=l*o-s*c,h=-l*a+s*u,d=c*a-o*u,p=r*f+n*h+i*d;p&&(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,this),this.check()}},{key:"multiplyLeft",value:function(e){return Lt(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return Lt(this,this,e),this.check()}},{key:"rotate",value:function(e){return function(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=Math.sin(r),d=Math.cos(r);e[0]=d*n+h*o,e[1]=d*i+h*s,e[2]=d*a+h*u,e[3]=d*o-h*n,e[4]=d*s-h*i,e[5]=d*u-h*a,e[6]=c,e[7]=l,e[8]=f}(this,this,e),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?jt(this,this,e):jt(this,this,[e,e]),this.check()}},{key:"translate",value:function(e){return function(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];e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=h*n+d*o+c,e[7]=h*i+d*s+l,e[8]=h*a+d*u+f}(this,this,e),this.check()}},{key:"transform",value:function(e,t){var r;switch(e.length){case 2:r=ce(t||[-0,-0],e,this);break;case 3:r=ge(t||[-0,-0,-0],e,this);break;case 4:r=wt(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return gt(r,e.length),r}},{key:"transformVector",value:function(e,t){return this.transform(e,t)}},{key:"transformVector2",value:function(e,t){return this.transform(e,t)}},{key:"transformVector3",value:function(e,t){return this.transform(e,t)}}],[{key:"IDENTITY",get:function(){return function(){Ht||(Ht=new zt,Object.freeze(Ht));return Ht}()}},{key:"ZERO",get:function(){return function(){Nt||(Nt=new zt([0,0,0,0,0,0,0,0,0]),Object.freeze(Nt));return Nt}()}}]),r}(Dt);function Kt(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var qt=function(e){Qe()(r,e);var t=Kt(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]:0;return Ve()(this,r),e=t.call(this,-0,-0,-0,-0),it(n)&&1===arguments.length?e.copy(n):(rt.debug&&(yt(n),yt(i),yt(a),yt(o)),e[0]=n,e[1]=i,e[2]=a,e[3]=o),e}return Ke()(r,[{key:"set",value:function(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}},{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:"fromObject",value:function(e){return rt.debug&&(yt(e.x),yt(e.y),yt(e.z),yt(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=yt(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=yt(e)}},{key:"transform",value:function(e){return ye(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return wt(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,e[2]=t[2],e[3]=t[3]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return me(this,this,e),this.check()}},{key:"applyMatrix4",value:function(e){return e.transform(this,this),this}}],[{key:"ZERO",get:function(){return Jt||(Jt=new r(0,0,0,0),Object.freeze(Jt)),Jt}}]),r}(bt);function Qt(){var e=new K(4);return K!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Xt(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 Wt(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 Zt(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],v=r[2],y=r[3];return(a=c*d+l*p+f*v+h*y)<0&&(a=-a,d=-d,p=-p,v=-v,y=-y),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*v,e[3]=s*h+u*y,e}function Yt(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 $t,er,tr,rr,nr,ir,ar=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},or=q,sr=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},ur=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},cr=Q,lr=X,fr=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},hr=($t=fe(),er=de(1,0,0),tr=de(0,1,0),function(e,t,r){var n=pe(t,r);return n<-.999999?(ve($t,er,t),be($t)<1e-6&&ve($t,tr,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}($t,$t),Xt(e,$t,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(ve($t,t,r),e[0]=$t[0],e[1]=$t[1],e[2]=$t[2],e[3]=1+n,fr(e,e))});rr=Qt(),nr=Qt(),ir=function(){var e=new K(9);return K!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}();function dr(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var pr=[0,0,0,1],vr=function(e){Qe()(r,e);var t=dr(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 Ve()(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 Ke()(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:"fromObject",value:function(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}},{key:"fromMatrix3",value:function(e){return Yt(this,e),this.check()}},{key:"fromAxisRotation",value:function(e,t){return Xt(this,e,t),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:"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]=yt(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=yt(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=yt(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=yt(e)}},{key:"len",value:function(){return cr(this)}},{key:"lengthSquared",value:function(){return lr(this)}},{key:"dot",value:function(e){return sr(this,e)}},{key:"rotationTo",value:function(e,t){return hr(this,e,t),this.check()}},{key:"add",value:function(e){return ar(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 void 0===r?this.lerp(this,e,t):(ur(this,e,t,r),this.check())}},{key:"multiplyRight",value:function(e){return Wt(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e){return Wt(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 or(this,this,e),this.check()}},{key:"slerp",value:function(e,t,r){var n,i,a;switch(arguments.length){case 1:var o=e.start;n=void 0===o?pr:o,i=e.target,a=e.ratio;break;case 2:n=this,i=e,a=t;break;default:n=e,i=t,a=r}return Zt(this,n,i,a),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qt;return Z(t,e,this),gt(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){return this.multiplyLeft(e)}},{key:"multiply",value:function(e){return this.multiplyRight(e)}}]),r}(pt),yr=new Ot,gr=new Ot,mr=new Ot,br=new Ot,Ar=new Ot,Br=new Ot,wr=new Ot,_r=0,xr=1,Cr=2,Or=3,Er=4,Tr=5,Sr=6,kr=7,Mr=8,Ir=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];Ge()(this,e),He(this,"center",void 0),He(this,"halfAxes",void 0),this.center=(new Ot).from(t),this.halfAxes=new zt(r)}return Ne()(e,[{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Ot(e).len(),new Ot(t).len(),new Ot(r).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Ot(e).normalize(),i=new Ot(t).normalize(),a=new Ot(r).normalize();return(new vr).fromMatrix3(new zt([].concat(Pt()(n),Pt()(i),Pt()(a))))}},{key:"fromCenterHalfSizeQuaternion",value:function(e,t,r){var n=new vr(r),i=(new zt).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 Ot).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 It,t=this.halfAxes,r=t.getColumn(0,mr),n=t.getColumn(1,br),i=t.getColumn(2,Ar),a=yr.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[_r]+a*n[xr]+o*n[Cr])+Math.abs(i*n[Or]+a*n[Er]+o*n[Tr])+Math.abs(i*n[Sr]+a*n[kr]+o*n[Mr]),u=r.dot(t)+e.distance;return u<=-s?ke.OUTSIDE:u>=s?ke.INSIDE:ke.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t=gr.from(e).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,mr),i=r.getColumn(1,br),a=r.getColumn(2,Ar),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,mr),u=o.getColumn(1,br),c=o.getColumn(2,Ar),l=Br.copy(s).add(u).add(c).add(a),f=wr.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,mr);t.transformAsPoint(e);var r=this.halfAxes.getColumn(1,br);r.transformAsPoint(e);var n=this.halfAxes.getColumn(2,Ar);return n.transformAsPoint(e),this.halfAxes=new zt([].concat(Pt()(t),Pt()(r),Pt()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),e}(),Rr=new Ot,Pr=new Ot,Fr=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;Ge()(this,e),He(this,"normal",void 0),He(this,"distance",void 0),this.normal=new Ot,this.distance=-0,this.fromNormalDistance(t,r)}return Ne()(e,[{key:"fromNormalDistance",value:function(e,t){return $e(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}},{key:"fromPointNormal",value:function(e,t){e=Rr.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),$e(lt(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(){return new e(this.normal,this.distance)}},{key:"equals",value:function(e){return lt(this.distance,e.distance)&&lt(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=Rr.from(e);var r=this.getPointDistance(e),n=Pr.copy(this.normal).scale(r);return e.subtract(n).to(t)}}]),e}();function Dr(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 Lr(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 Lr(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 Lr(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 jr,Gr=[new Ot([1,0,0]),new Ot([0,1,0]),new Ot([0,0,1])],Ur=new Ot,Nr=new Ot,Hr=(new Fr(new Ot(1,0,0),0),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ge()(this,e),He(this,"planes",void 0),this.planes=t}return Ne()(e,[{key:"fromBoundingSphere",value:function(e){this.planes.length=2*Gr.length;var t,r=e.center,n=e.radius,i=0,a=Dr(Gr);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 Fr),u||(u=this.planes[i+1]=new Fr);var c=Ur.copy(o).scale(-n).add(r);o.dot(c);s.fromPointNormal(c,o);var l=Ur.copy(o).scale(n).add(r),f=Nr.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){var t,r=ke.INSIDE,n=Dr(this.planes);try{for(n.s();!(t=n.n()).done;){var i=t.value;switch(e.intersectPlane(i)){case ke.OUTSIDE:return ke.OUTSIDE;case ke.INTERSECTING:r=ke.INTERSECTING}}}catch(e){n.e(e)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(t,r){if($e(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===ke.OUTSIDE)return e.MASK_OUTSIDE;u===ke.INTERSECTING&&(n|=o)}}return n}}]),e}());function Jr(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}He(Hr,"MASK_OUTSIDE",4294967295),He(Hr,"MASK_INSIDE",0),He(Hr,"MASK_INDETERMINATE",2147483647),function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"}(jr||(jr={}));var Vr,zr,Kr=45*Math.PI/180,qr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Qr=function(e){Qe()(r,e);var t=Jr(r);function r(e){var n;return Ve()(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 Ke()(r,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return jr}},{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,v){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]=v,this.check()}},{key:"setRowMajor",value:function(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v){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]=v,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(qr)}},{key:"fromObject",value:function(e){return this.check()}},{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,v=a*o,y=a*s,g=a*u;e[0]=1-f-p,e[1]=l+g,e[2]=h-y,e[3]=0,e[4]=l-g,e[5]=1-c-p,e[6]=d+v,e[7]=0,e[8]=h+y,e[9]=d-v,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,r=e.right,n=e.bottom,i=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return u===1/0?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;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}(this,t,r,n,i,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,r,n,i,o,u),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,r=e.center,n=void 0===r?[0,0,0]:r,i=e.up;return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p=t[0],v=t[1],y=t[2],g=n[0],m=n[1],b=n[2],A=r[0],B=r[1],w=r[2];Math.abs(p-A)<1e-6&&Math.abs(v-B)<1e-6&&Math.abs(y-w)<1e-6?function(e){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):(l=p-A,f=v-B,h=y-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*v+o*y),e[13]=-(s*p+u*v+c*y),e[14]=-(l*p+f*v+h*y),e[15]=1)}(this,t,n,void 0===i?[0,1,0]:i),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 ue(this,t,r,n,i,o,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(e){var t=e.fovy,r=void 0===t?Kr:t,n=e.aspect,i=void 0===n?1:n,a=e.focalDistance,o=void 0===a?1:a,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;Xr(r);var f=r/2,h=o*Math.tan(f),d=h*i;return this.ortho({left:-d,right:d,bottom:-h,top:h,near:u,far:l})}},{key:"perspective",value:function(e){var t=e.fovy,r=void 0===t?45*Math.PI/180:t,n=e.aspect,i=void 0===n?1:n,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return Xr(r),se(this,r,i,o,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],l=e[9],f=e[10],h=e[11],d=e[12],p=e[13],v=e[14],y=e[15],(t*o-r*a)*(f*y-h*v)-(t*s-n*a)*(l*y-h*p)+(t*u-i*a)*(l*v-f*p)+(r*s-n*o)*(c*y-h*d)-(r*u-i*o)*(c*v-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,v,y}},{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(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];var r=this.getScale(t),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(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];var r=this.getScale(t),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 ee(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return te(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return te(this,this,e),this.check()}},{key:"rotateX",value:function(e){return ie(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 ae(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}},{key:"rotateAxis",value:function(e,t){return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,v,y,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],v=t[8],y=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,_=S*S*o+a,x=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+v*B,e[1]=u*b+h*A+y*B,e[2]=c*b+d*A+g*B,e[3]=l*b+p*A+m*B,e[4]=s*w+f*_+v*x,e[5]=u*w+h*_+y*x,e[6]=c*w+d*_+g*x,e[7]=l*w+p*_+m*x,e[8]=s*C+f*O+v*E,e[9]=u*C+h*O+y*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 ne(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}},{key:"translate",value:function(e){return re(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(gt(t=W(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){var r;switch(e.length){case 2:r=le(t||[-0,-0],e,this);break;case 3:r=ye(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return gt(r,e.length),r}},{key:"transformAsVector",value:function(e,t){var r;switch(e.length){case 2:r=At(t||[-0,-0],e,this);break;case 3:r=Bt(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return gt(r,e.length),r}},{key:"transformPoint",value:function(e,t){return this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return this.transformAsVector(e,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:"IDENTITY",get:function(){return function(){zr||(zr=new Qr,Object.freeze(zr));return zr}()}},{key:"ZERO",get:function(){return function(){Vr||(Vr=new Qr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Vr));return Vr}()}}]),r}(Dt);function Xr(e){if(e>2*Math.PI)throw Error("expected radians")}new Ot,new Ot,new Ot,new Ot,new Ot;function Wr(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var Zr=function(e){Qe()(r,e);var t=Wr(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 Ve()(this,r),e=t.call(this,2),it(n)&&1===arguments.length?e.copy(n):(rt.debug&&(yt(n),yt(i)),e[0]=n,e[1]=i),e}return Ke()(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 rt.debug&&(yt(e.x),yt(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 le(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return At(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return ce(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}(bt);new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,Math.PI;var Yr=.1,$r=1e-12,en=1e-15,tn=1e-20,rn=(Math.PI,Math.PI,Math.PI,Math.PI,new zt),nn=new zt,an=new zt,on=new zt,sn=new zt;function un(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=tn,n=10,i=0,a=0,o=nn,s=an;o.identity(),s.copy(e);for(var u=r*cn(s);a<n&&hn(s)>u;)dn(s,on),sn.copy(on).transpose(),s.multiplyRight(on),s.multiplyLeft(sn),o.multiplyRight(on),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function cn(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}var ln=[1,0,0],fn=[2,2,1];function hn(e){for(var t=0,r=0;r<3;++r){var n=e[rn.getElementIndex(fn[r],ln[r])];t+=2*n*n}return Math.sqrt(t)}function dn(e,t){for(var r=en,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[rn.getElementIndex(fn[a],ln[a])]);o>n&&(i=a,n=o)}var s=ln[i],u=fn[i],c=1,l=0;if(Math.abs(e[rn.getElementIndex(u,s)])>r){var f,h=(e[rn.getElementIndex(u,u)]-e[rn.getElementIndex(s,s)])/2/e[rn.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 zt.IDENTITY.to(t),t[rn.getElementIndex(s,s)]=t[rn.getElementIndex(u,u)]=c,t[rn.getElementIndex(u,s)]=l,t[rn.getElementIndex(s,u)]=-l,t}function pn(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 vn(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 vn(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 vn(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 yn=new Ot,gn=new Ot,mn=new Ot,bn=new Ot,An=new Ot,Bn=new zt,wn={diagonal:new zt,unitary:new zt};function _n(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 xn(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 xn(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 xn(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 Cn=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],On=Cn.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),En=On.concat([[.25,.5],[.75,.5]]),Tn=function(){function e(t,r,n){h()(this,e),A()(this,"x",void 0),A()(this,"y",void 0),A()(this,"z",void 0),A()(this,"childVisible",void 0),A()(this,"selected",void 0),A()(this,"_children",void 0),this.x=t,this.y=r,this.z=n}return C()(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=_n(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=_n(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=M()(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=_n(this.z<1?En:this.z<2?On:Cn);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=Pn(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 Ir;if(!e||0===e.length)return t.halfAxes=new zt([0,0,0,0,0,0,0,0,0]),t.center=new Ot,t;var r,n=e.length,i=new Ot(0,0,0),a=pn(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,v=pn(e);try{for(v.s();!(u=v.n()).done;){var y=u.value,g=yn.copy(y).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){v.e(e)}finally{v.f()}c*=s,l*=s,f*=s,h*=s,d*=s,p*=s;var m=Bn;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=un(m,wn),B=A.unitary,w=t.halfAxes.copy(B),_=w.getColumn(0,mn),x=w.getColumn(1,bn),C=w.getColumn(2,An),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=pn(e);try{for(I.s();!(b=I.n()).done;){var R=b.value;yn.copy(R),O=Math.max(yn.dot(_),O),E=Math.max(yn.dot(x),E),T=Math.max(yn.dot(C),T),S=Math.min(yn.dot(_),S),k=Math.min(yn.dot(x),k),M=Math.min(yn.dot(C),M)}}catch(e){I.e(e)}finally{I.f()}_=_.multiplyByScalar(.5*(S+O)),x=x.multiplyByScalar(.5*(k+E)),C=C.multiplyByScalar(.5*(M+T)),t.center.copy(_).add(x).add(C);var P=gn.set(O-S,E-k,T-M).multiplyByScalar(.5),F=new zt([P[0],0,0,0,P[1],0,0,0,P[2]]);return t.halfAxes.multiplyRight(F),t}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*t,l=512-(this.y+1)*u;return new St([c,l,e[0]],[c+u,l+u,e[1]])}}]),e}();var Sn=[-1/0,-1/0,1/0,1/0],kn={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 Mn(e,t){var r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min.apply(Math,Le()(r.map((function(e){return e[0]})))),Math.min.apply(Math,Le()(r.map((function(e){return e[1]})))),Math.max.apply(Math,Le()(r.map((function(e){return e[0]})))),Math.max.apply(Math,Le()(r.map((function(e){return e[1]}))))]}function In(e,t){if(!e||!e.length)return null;var r,n=t.index,i=t.id;Array.isArray(e)&&(e=e[(r=i,Math.abs(r.split("").reduce((function(e,t){return(e<<5)-e+t.charCodeAt(0)|0}),0))%e.length)]);for(var a=e,o=0,s=Object.keys(n);o<s.length;o++){var u=s[o],c=new RegExp("{".concat(u,"}"),"g");a=a.replace(c,String(n[u]))}return Number.isInteger(n.y)&&Number.isInteger(n.z)&&(a=a.replace(/\{-y\}/g,String(Math.pow(2,n.z)-n.y-1))),a}function Rn(e,t){return 512*Math.pow(2,e)/t}function Pn(e,t,r){var n=Rn(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 Fn(e,t,r,n){var i=Rn(r,n);return[e/i*512,t/i*512]}function Dn(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(e.isGeospatial){var a=Pn(t,r,n),o=M()(a,2),s=o[0],u=o[1],c=Pn(t+1,r+1,n),l=M()(c,2),f=l[0],h=l[1];return{west:s,north:u,east:f,south:h}}var d=Fn(t,r,n,i),p=M()(d,2),v=p[0],y=p[1],g=Fn(t+1,r+1,n,i),m=M()(g,2),b=m[0],A=m[1];return{left:v,top:y,right:b,bottom:A}}function Ln(e,t,r,n,i){for(var a=function(e,t,r){return r?Mn(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=M()(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),Rn(t,r),i),o=M()(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 jn(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"==typeof n&&Number.isFinite(n)&&h<n){if(!a)return[];h=n}"number"==typeof r&&Number.isFinite(r)&&h>r&&(h=r);var d=a;return u&&c&&a&&!t.isGeospatial&&(d=Mn(a,u)),t.isGeospatial?function(e,t,r,n){var i=e instanceof B._GlobeViewport&&e.resolution?e.projectPosition:null,a=Object.values(e.getFrustumPlanes()).map((function(e){var t=e.normal,r=e.distance;return new Fr(t.clone().negate(),r)})),o=new Hr(a),s=e.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,c=r&&r[1]*s||0,l=e instanceof B.WebMercatorViewport&&e.pitch<=60?t:0;if(n){var f=n,h=M()(f,4),d=h[0],p=h[1],v=h[2],y=Ce([d,h[3]]),g=Ce([v,p]);n=[y[0],512-y[1],g[0],512-g[1]]}var m=new Tn(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 instanceof B.WebMercatorViewport&&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):Ln(t,h,s,d||Sn,c)}function Gn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Un(){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 Nn=function(){function e(t,r){h()(this,e),Gn(this,"name",void 0),Gn(this,"type",void 0),Gn(this,"sampleSize",1),Gn(this,"time",void 0),Gn(this,"count",void 0),Gn(this,"samples",void 0),Gn(this,"lastTiming",void 0),Gn(this,"lastSampleTime",void 0),Gn(this,"lastSampleCount",void 0),Gn(this,"_count",0),Gn(this,"_time",0),Gn(this,"_samples",0),Gn(this,"_startTime",0),Gn(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}return C()(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=Un(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Un()-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}(),Hn=function(){function e(t){h()(this,e),Gn(this,"id",void 0),Gn(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}return C()(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 Nn?e:new Nn(t,r)),this.stats[t]}}]),e}();function Jn(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 Vn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jn(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var zn,Kn={id:"request-scheduler",throttleRequests:!0,maxRequests:6},qn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h()(this,e),Gn(this,"props",void 0),Gn(this,"stats",void 0),Gn(this,"activeRequestCount",0),Gn(this,"requestQueue",[]),Gn(this,"requestMap",new Map),Gn(this,"deferredUpdate",null),this.props=Vn(Vn({},Kn),t),this.stats=new Hn({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 C()(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 Qn(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 Xn(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 Xn(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 Xn(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 Wn=(zn={},A()(zn,"best-available",(function(e){var t,r=Qn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Qn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&!Yn(a)&&$n(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Qn(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()}})),A()(zn,"no-overlap",(function(e){var t,r=Qn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Qn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&Yn(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Qn(Array.from(e).sort((function(e,t){return e.zoom-t.zoom})));try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.isVisible=Boolean(2&u.state),u.children&&(u.isVisible||1&u.state)){var c,l=Qn(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&&$n(u)}}catch(e){s.e(e)}finally{s.f()}})),A()(zn,"never",(function(){})),zn),Zn=function(){function e(t){var r=this;h()(this,e),A()(this,"opts",void 0),A()(this,"_requestScheduler",void 0),A()(this,"_cache",void 0),A()(this,"_dirty",void 0),A()(this,"_tiles",void 0),A()(this,"_cacheByteSize",void 0),A()(this,"_viewport",void 0),A()(this,"_selectedTiles",void 0),A()(this,"_frameNumber",void 0),A()(this,"_modelMatrix",void 0),A()(this,"_modelMatrixInverse",void 0),A()(this,"_maxZoom",void 0),A()(this,"_minZoom",void 0),A()(this,"onTileLoad",void 0),this.opts=t,this.onTileLoad=function(e){r.opts.onTileLoad(e),r.opts.maxCacheByteSize&&(r._cacheByteSize+=e.byteLength,r._resizeCache())},this._requestScheduler=new qn({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._modelMatrix=new Qr,this._modelMatrixInverse=new Qr,this.setOptions(t)}return C()(e,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return null!==this._selectedTiles&&this._selectedTiles.every((function(e){return e.isLoaded}))}},{key:"needsReload",get:function(){return null!==this._selectedTiles&&this._selectedTiles.some((function(e){return e.needsReload}))}},{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=Qn(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=Qn(this._cache.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value,n=this._cache.get(r);this._selectedTiles&&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 Qr(i),o=!a.equals(this._modelMatrix);if(this._viewport&&e.equals(this._viewport)&&!o)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((function(e){return t._getTile(e.index,!0)})));else{o&&(this._modelMatrixInverse=a.clone().invert(),this._modelMatrix=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 jn({viewport:t,maxZoom:r,minZoom:n,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:a,modelMatrixInverse:o,zoomOffset:s.zoomOffset})}},{key:"getTileId",value:function(e){return"".concat(e.x,"-").concat(e.y,"-").concat(e.z)}},{key:"getTileZoom",value:function(e){return e.z}},{key:"getTileMetadata",value:function(e){var t=this.opts.tileSize;return{bbox:Dn(this._viewport,e.x,e.y,e.z,t)}}},{key:"getParentIndex",value:function(e){return{x:Math.floor(e.x/2),y:Math.floor(e.y/2),z:e.z-1}}},{key:"updateTileStates",value:function(){var e,t=this.opts.refinementStrategy||"best-available",r=new Array(this._cache.size),n=0,i=Qn(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=Qn(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:Wn[t])(Array.from(this._cache.values())),n=0;var c,l=Qn(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=Qn(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=Qn(t.values());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.parent=null,n.children&&(n.children.length=0)}}catch(e){r.e(e)}finally{r.f()}var i,a=Qn(t.values());try{for(a.s();!(i=a.n()).done;){var o=i.value,s=this._getNearestAncestor(o);o.parent=s,null!=s&&s.children&&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=Qn(e);try{for(a.s();!(i=a.n()).done;){var o=M()(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.zoom-t.zoom})),this._dirty=!1)}},{key:"_getTile",value:function(e,t){var r=this.getTileId(e),n=this._cache.get(r),i=!1;return!n&&t?(n=new Fe(e),Object.assign(n,this.getTileMetadata(n.index)),Object.assign(n,{id:r,zoom:this.getTileZoom(n.index)}),i=!0,this._cache.set(r,n),this._dirty=!0):n&&n.needsReload&&(i=!0),n&&i&&n.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),n}},{key:"_getNearestAncestor",value:function(e){for(var t=this._minZoom,r=void 0===t?0:t,n=e.index;this.getTileZoom(n)>r;){n=this.getParentIndex(n);var i=this._getTile(n);if(i)return i}return null}}]),e}();function Yn(e){for(var t=e;t;){if(t.isLoaded||t.content)return t.state|=2,!0;t=t.parent}return!1}function $n(e){var t,r=Qn(e.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.isLoaded||n.content?n.state|=2:$n(n)}}catch(e){r.e(e)}finally{r.f()}}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){A()(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}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 y()(this,r)}}var ni={TilesetClass:Zn,data:{type:"data",value:[]},dataComparator:kn.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},ii=function(e){p()(r,e);var t=ri(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var e,t;null===(e=this.state)||void 0===e||null===(t=e.tileset)||void 0===t||t.finalize()}},{key:"isLoaded",get:function(){var e,t;return null===(e=this.state)||void 0===e?void 0:null===(t=e.tileset)||void 0===t?void 0:t.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.changeFlags,r=this.state.tileset,n=t.propsOrDataChanged||t.updateTriggersChanged,i=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),i?r.reloadAll():this.state.tileset.tiles.forEach((function(e){e.layers=null}))):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var e=this.props,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="string"==typeof r||Array.isArray(r)?In(r,e):null,n?n(e):i&&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(ti(ti({},e.props),{},{id:"".concat(e.id,"-").concat(t.id),data:t.content,_offset:0,tile:t}));t.layers=Object(B._flatten)(n,Boolean).map((function(e){return e.clone(ti({tile:t},r))}))}else;return t.layers}))}},{key:"filterSubLayer",value:function(e){return e.layer.props.tile.isVisible}}]),r}(B.CompositeLayer);A()(ii,"defaultProps",ni),A()(ii,"layerName","TileLayer");var ai=r(15),oi=r.n(ai);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){A()(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){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 y()(this,r)}}var li=function(e){p()(r,e);var t=ci(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"getShaders",value:function(){var e=oi()(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(){oi()(m()(r.prototype),"initializeState",this).call(this),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=ui(ui({},e.uniforms),{},{fadeTrail:n,trailLength:i,currentTime:a}),oi()(m()(r.prototype),"draw",this).call(this,e)}}]),r}(B.PathLayer);A()(li,"layerName","TripsLayer"),A()(li,"defaultProps",{fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(e){return e.timestamps}}});var fi=r(23);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){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 y()(this,r)}}var vi=function(e){p()(r,e);var t=pi(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"updateState",value:function(e){var t=e.props,r=e.changeFlags;if(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagons){var n,i=t.data,a=t.getHexagons,o=[],s=Object(B.createIterable)(i),u=s.iterable,c=s.objectInfo,l=hi(u);try{for(l.s();!(n=l.n()).done;){var f=n.value;c.index++;var h,d=a(f,c),p=hi(Object(fi.h3SetToMultiPolygon)(d,!0));try{for(p.s();!(h=p.n()).done;){var v=h.value;o.push(this.getSubLayerRow({polygon:v},f,c.index))}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}this.setState({polygons:o})}}},{key:"indexToBounds",value:function(){return{data:this.state.polygons,getPolygon:function(e){return e.polygon}}}}]),r}(S);A()(vi,"layerName","H3ClusterLayer"),A()(vi,"defaultProps",{getHexagons:{type:"accessor",value:function(e){return e.hexagons}}});var yi=r(13),gi=r.n(yi),mi=r(9),bi=r.n(mi);function Ai(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 y()(this,r)}}function Bi(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 wi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bi(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _i(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 xi(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 xi(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 xi(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 Ci(e,t){t=void 0===t?e[0][0]:t;var r,n=_i(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 Oi(e,t,r){var n=Object(fi.h3ToGeo)(e),i=M()(n,2),a=i[0],o=i[1],s=t.length;Ci(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c<u;c++)t[c][0]=ct(o,t[c][0],r),t[c][1]=ct(a,t[c][1],r)}function Ei(e,t,r){var n=e(t,r),i=Object(fi.h3ToGeo)(n),a=M()(i,2),o=a[0];return[a[1],o]}function Ti(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=Object(fi.h3ToGeoBoundary)(e,!0);return 1!==t?Oi(e,r,t):Ci(r),r}var Si=wi(wi({},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}),ki=function(e){p()(r,e);var t=Ai(r);function r(){var e;h()(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i)),A()(gi()(e),"state",void 0),e}return C()(r,[{key:"initializeState",value:function(){this.state={edgeLengthKM:0,resolution:-1}}},{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.changeFlags;if(!0!==t.highPrecision&&(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagon)){var n=this._calculateH3DataProps();this.setState(n)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(){var e,t=-1,r=!1,n=!1,i=Object(B.createIterable)(this.props.data),a=i.iterable,o=i.objectInfo,s=_i(a);try{for(s.s();!(e=s.n()).done;){var u=e.value;o.index++;var c=this.props.getHexagon(u,o),l=Object(fi.h3GetResolution)(c);if(t<0){if(t=l,!this.props.highPrecision)break}else if(t!==l){n=!0;break}if(Object(fi.h3IsPentagon)(c)){r=!0;break}}}catch(e){s.e(e)}finally{s.f()}return{resolution:t,edgeLengthKM:t>=0?Object(fi.edgeLength)(t,"km"):0,hasMultipleRes:n,hasPentagon:r}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var e=this.state,t=e.resolution,r=e.hasPentagon,n=e.hasMultipleRes,i=this.context.viewport;return Boolean(null==i?void 0:i.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(fi.geoToH3)(e.latitude,e.longitude,r);if(i!==a){if(i){var o=Object(fi.h3Distance)(i,a);if(o>=0&&o*n<10)return}var s=e.distanceScales.unitsPerMeter,u=Ti(a),c=Object(fi.h3ToGeo)(a),l=M()(c,2),f=l[0],h=l[1],d=e.projectFlat([h,f]),p=M()(d,2),v=p[0],y=p[1];u=u.map((function(t){var r=e.projectFlat(t);return[(r[0]-v)/s[0],(r[1]-y)/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,v=e.getLineWidth,y=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:v,transitions:y,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"===bi()(e)?wi(wi({},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 function(e){var t,r=new Float64Array(2*e.length),n=0,i=_i(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;r[n++]=a[0],r[n++]=a[1]}}catch(e){i.e(e)}finally{i.f()}return r}(Ti(r(e,t),i))}})}},{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:Ei.bind(null,r)})}}]),r}(B.CompositeLayer);A()(ki,"defaultProps",Si),A()(ki,"layerName","H3HexagonLayer");var Mi=r(31);function Ii(){return!("object"===("undefined"==typeof process?"undefined":bi()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===bi()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===bi()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":bi()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}var Ri=Ii();function Pi(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var Fi=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";h()(this,e),this.storage=Pi(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return C()(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 Di(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 Li={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 ji(e){return"string"==typeof e?Li[e.toUpperCase()]||Li.WHITE:e}function Gi(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 Ui(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 Ui(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 Ui(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 Ni(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=Gi(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 Hi(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":bi()(process))&&process},Vi=Ji.window||Ji.self||Ji.global,zi=Ji.process||{};console;function Ki(){var e;if(Ri&&Vi.performance)e=Vi.performance.now();else if(zi.hrtime){var t=zi.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var qi={debug:Ri&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Qi={enabled:!0,level:0};function Xi(){}var Wi={},Zi={once:!0};function Yi(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}var $i=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.8.0-beta.2",this._startTs=Ki(),this._deltaTs=Ki(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Fi("__probe-".concat(this.id,"__"),Qi),this.userData={},this.timeStamp("".concat(this.id," started")),Ni(this),Object.seal(this)}return C()(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((Ki()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Ki()-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){Hi(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,qi.warn,arguments,Zi)}},{key:"error",value:function(e){return this._getLogFunction(0,e,qi.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,qi.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,qi.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,qi.debug||qi.info,arguments,Zi)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Xi,r&&[r],{tag:Yi(t)}):Xi}},{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)?Ri?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=Di(o,n,a);(e=console).log.apply(e,Le()(t))},o.src=t,Xi}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Le()(Di(t,n,a))),Xi}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,Le()(Di(c,n,a)))},c.src=t.toDataURL(),Xi}return Xi}({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(94)}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 Xi}({image:i,message:o,scale:u}):Xi}},{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(A()({},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||Xi)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=ta({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||Xi)}},{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()>=ea(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=ta({logLevel:e,message:t,args:n,opts:i}),Hi(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Ki();var o=i.tag||i.message;if(i.once){if(Wi[o])return Xi;Wi[o]=Ki()}return t=ra(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(Le()(i.args)))}return Xi}}]),e}();function ea(e){if(!e)return 0;var t;switch(bi()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Hi(Number.isFinite(t)&&t>=0),t}function ta(e){var t=e.logLevel,r=e.message;e.logLevel=ea(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(e.args=n,bi()(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=bi()(e.message);return Hi("string"===i||"object"===i),Object.assign(e,e.opts)}function ra(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,Ri||"string"!=typeof i||(a&&(a=ji(a),i="[".concat(a,"m").concat(i,"")),o&&(a=ji(o),i="[".concat(o+10,"m").concat(i,""))),t=i}var i,a,o,s;return t}$i.VERSION="8.8.0-beta.2";var na=new $i({id:"luma.gl"});function ia(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function aa(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version)))}function oa(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function sa(e){return ia(aa(e),"Invalid WebGLRenderingContext"),e}function ua(e){return ia(oa(e),"Requires WebGL2"),e}var ca={};function la(e,t){var r;ca[e]=!0,void 0!==t&&(r=t,globalThis.console&&globalThis.console.error&&globalThis.console.error(r))}var fa=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};(fa.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 ha,da=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))&&(ca[r]=!0)}while(0!==r);for(r in ca)if(ca[r])return delete ca[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",globalThis.console&&globalThis.console.log&&globalThis.console.log(e),t.reset_()}),!0),this.reset_()};da.prototype.VERTEX_ARRAY_BINDING_OES=34229,da.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 fa(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},da.prototype.createVertexArrayOES=function(){var e=new fa(this);return this.vertexArrayObjects.push(e),e},da.prototype.deleteVertexArrayOES=function(e){e.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(e),1),this.currentVertexArrayObject===e&&this.bindVertexArrayOES(null)},da.prototype.isVertexArrayOES=function(e){return!!(e&&e instanceof fa&&e.hasBeenBound&&e.ext===this)},da.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 la(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var pa,va=function(e){return oa(e)?void 0:0},ya=(ha={},A()(ha,3074,(function(e){return oa(e)?void 0:36064})),A()(ha,35723,(function(e){return oa(e)?void 0:4352})),A()(ha,35977,va),A()(ha,32937,va),A()(ha,36795,(function(e,t){var r=oa(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})),A()(ha,37445,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),A()(ha,37446,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),A()(ha,34047,(function(e,t){var r=e.luma.extensions.EXT_texture_filter_anisotropic;return r?t(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),A()(ha,32883,va),A()(ha,35071,va),A()(ha,37447,va),A()(ha,36063,(function(e,t){if(!oa(e)){var r=e.getExtension("WEBGL_draw_buffers");return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),A()(ha,35379,va),A()(ha,35374,va),A()(ha,35377,va),A()(ha,34852,(function(e){if(!oa(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}})),A()(ha,36203,(function(e){return e.getExtension("OES_element_index")?2147483647:65535})),A()(ha,33001,(function(e){return e.getExtension("OES_element_index")?16777216:65535})),A()(ha,33e3,(function(e){return 16777216})),A()(ha,37157,va),A()(ha,35373,va),A()(ha,35657,va),A()(ha,36183,va),A()(ha,37137,va),A()(ha,34045,va),A()(ha,35978,va),A()(ha,35979,va),A()(ha,35968,va),A()(ha,35376,va),A()(ha,35375,va),A()(ha,35659,va),A()(ha,37154,va),A()(ha,35371,va),A()(ha,35658,va),A()(ha,35076,va),A()(ha,35077,va),A()(ha,35380,va),ha);var ga,ma,ba,Aa=(pa={},A()(pa,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){ia(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),A()(pa,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){ia(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),A()(pa,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){ia(!1)}}),A()(pa,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){ia(!1)},deleteQuery:function(){ia(!1)},beginQuery:function(){ia(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),pa),Ba={readBuffer:function(e,t,r){oa(e)&&t(r)},getVertexAttrib:function(e,t,r,n){var i,a=function(e,t){return{webgl2:oa(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(!oa(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(!oa(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=ya[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 wa(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 _a(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 _a(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 _a(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 xa(e,t){var r=t.extension,n=t.target,i=t.target2,a=Aa[r];ia(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()}globalThis.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 da(this)),this.__OESVertexArrayObject))}}}(e),function(e){e.luma.extensions={};var t,r=wa(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=wa(Object.getOwnPropertyNames(t));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&xa(e,{extension:i,target:e.luma,target2:e})}}catch(e){n.e(e)}finally{n.f()}}(e,Aa),function(e,t){var r=t.target,n=t.target2;Object.keys(Ba).forEach((function(t){if("function"==typeof Ba[t]){var i=e[t]?e[t].bind(e):function(){},a=Ba[t].bind(null,e,i);r[t]=a,n[t]=a}}))}(e,{target:t,target2:e}),t.polyfilled=!0),e};var Ca=(ga={},A()(ga,3042,!1),A()(ga,32773,new Float32Array([0,0,0,0])),A()(ga,32777,32774),A()(ga,34877,32774),A()(ga,32969,1),A()(ga,32968,0),A()(ga,32971,1),A()(ga,32970,0),A()(ga,3106,new Float32Array([0,0,0,0])),A()(ga,3107,[!0,!0,!0,!0]),A()(ga,2884,!1),A()(ga,2885,1029),A()(ga,2929,!1),A()(ga,2931,1),A()(ga,2932,513),A()(ga,2928,new Float32Array([0,1])),A()(ga,2930,!0),A()(ga,3024,!0),A()(ga,36006,null),A()(ga,2886,2305),A()(ga,33170,4352),A()(ga,2849,1),A()(ga,32823,!1),A()(ga,32824,0),A()(ga,10752,0),A()(ga,32938,1),A()(ga,32939,!1),A()(ga,3089,!1),A()(ga,3088,new Int32Array([0,0,1024,1024])),A()(ga,2960,!1),A()(ga,2961,0),A()(ga,2968,4294967295),A()(ga,36005,4294967295),A()(ga,2962,519),A()(ga,2967,0),A()(ga,2963,4294967295),A()(ga,34816,519),A()(ga,36003,0),A()(ga,36004,4294967295),A()(ga,2964,7680),A()(ga,2965,7680),A()(ga,2966,7680),A()(ga,34817,7680),A()(ga,34818,7680),A()(ga,34819,7680),A()(ga,2978,[0,0,1024,1024]),A()(ga,3333,4),A()(ga,3317,4),A()(ga,37440,!1),A()(ga,37441,!1),A()(ga,37443,37444),A()(ga,35723,4352),A()(ga,36010,null),A()(ga,35977,!1),A()(ga,3330,0),A()(ga,3332,0),A()(ga,3331,0),A()(ga,3314,0),A()(ga,32878,0),A()(ga,3316,0),A()(ga,3315,0),A()(ga,32877,0),ga),Oa=function(e,t,r){return t?e.enable(r):e.disable(r)},Ea=function(e,t,r){return e.hint(r,t)},Ta=function(e,t,r){return e.pixelStorei(r,t)};function Sa(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var ka=(ma={},A()(ma,3042,Oa),A()(ma,32773,(function(e,t){return e.blendColor.apply(e,Le()(t))})),A()(ma,32777,"blendEquation"),A()(ma,34877,"blendEquation"),A()(ma,32969,"blendFunc"),A()(ma,32968,"blendFunc"),A()(ma,32971,"blendFunc"),A()(ma,32970,"blendFunc"),A()(ma,3106,(function(e,t){return e.clearColor.apply(e,Le()(t))})),A()(ma,3107,(function(e,t){return e.colorMask.apply(e,Le()(t))})),A()(ma,2884,Oa),A()(ma,2885,(function(e,t){return e.cullFace(t)})),A()(ma,2929,Oa),A()(ma,2931,(function(e,t){return e.clearDepth(t)})),A()(ma,2932,(function(e,t){return e.depthFunc(t)})),A()(ma,2928,(function(e,t){return e.depthRange.apply(e,Le()(t))})),A()(ma,2930,(function(e,t){return e.depthMask(t)})),A()(ma,3024,Oa),A()(ma,35723,Ea),A()(ma,36006,(function(e,t){var r=oa(e)?36009:36160;return e.bindFramebuffer(r,t)})),A()(ma,2886,(function(e,t){return e.frontFace(t)})),A()(ma,33170,Ea),A()(ma,2849,(function(e,t){return e.lineWidth(t)})),A()(ma,32823,Oa),A()(ma,32824,"polygonOffset"),A()(ma,10752,"polygonOffset"),A()(ma,35977,Oa),A()(ma,32938,"sampleCoverage"),A()(ma,32939,"sampleCoverage"),A()(ma,3089,Oa),A()(ma,3088,(function(e,t){return e.scissor.apply(e,Le()(t))})),A()(ma,2960,Oa),A()(ma,2961,(function(e,t){return e.clearStencil(t)})),A()(ma,2968,(function(e,t){return e.stencilMaskSeparate(1028,t)})),A()(ma,36005,(function(e,t){return e.stencilMaskSeparate(1029,t)})),A()(ma,2962,"stencilFuncFront"),A()(ma,2967,"stencilFuncFront"),A()(ma,2963,"stencilFuncFront"),A()(ma,34816,"stencilFuncBack"),A()(ma,36003,"stencilFuncBack"),A()(ma,36004,"stencilFuncBack"),A()(ma,2964,"stencilOpFront"),A()(ma,2965,"stencilOpFront"),A()(ma,2966,"stencilOpFront"),A()(ma,34817,"stencilOpBack"),A()(ma,34818,"stencilOpBack"),A()(ma,34819,"stencilOpBack"),A()(ma,2978,(function(e,t){return e.viewport.apply(e,Le()(t))})),A()(ma,3333,Ta),A()(ma,3317,Ta),A()(ma,37440,Ta),A()(ma,37441,Ta),A()(ma,37443,Ta),A()(ma,3330,Ta),A()(ma,3332,Ta),A()(ma,3331,Ta),A()(ma,36010,(function(e,t){return e.bindFramebuffer(36008,t)})),A()(ma,3314,Ta),A()(ma,32878,Ta),A()(ma,3316,Ta),A()(ma,3315,Ta),A()(ma,32877,Ta),A()(ma,"framebuffer",(function(e,t){var r=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,r)})),A()(ma,"blend",(function(e,t){return t?e.enable(3042):e.disable(3042)})),A()(ma,"blendColor",(function(e,t){return e.blendColor.apply(e,Le()(t))})),A()(ma,"blendEquation",(function(e,t){t=Sa(t)?t:[t,t],e.blendEquationSeparate.apply(e,Le()(t))})),A()(ma,"blendFunc",(function(e,t){t=Sa(t)&&2===t.length?[].concat(Le()(t),Le()(t)):t,e.blendFuncSeparate.apply(e,Le()(t))})),A()(ma,"clearColor",(function(e,t){return e.clearColor.apply(e,Le()(t))})),A()(ma,"clearDepth",(function(e,t){return e.clearDepth(t)})),A()(ma,"clearStencil",(function(e,t){return e.clearStencil(t)})),A()(ma,"colorMask",(function(e,t){return e.colorMask.apply(e,Le()(t))})),A()(ma,"cull",(function(e,t){return t?e.enable(2884):e.disable(2884)})),A()(ma,"cullFace",(function(e,t){return e.cullFace(t)})),A()(ma,"depthTest",(function(e,t){return t?e.enable(2929):e.disable(2929)})),A()(ma,"depthFunc",(function(e,t){return e.depthFunc(t)})),A()(ma,"depthMask",(function(e,t){return e.depthMask(t)})),A()(ma,"depthRange",(function(e,t){return e.depthRange.apply(e,Le()(t))})),A()(ma,"dither",(function(e,t){return t?e.enable(3024):e.disable(3024)})),A()(ma,"derivativeHint",(function(e,t){e.hint(35723,t)})),A()(ma,"frontFace",(function(e,t){return e.frontFace(t)})),A()(ma,"mipmapHint",(function(e,t){return e.hint(33170,t)})),A()(ma,"lineWidth",(function(e,t){return e.lineWidth(t)})),A()(ma,"polygonOffsetFill",(function(e,t){return t?e.enable(32823):e.disable(32823)})),A()(ma,"polygonOffset",(function(e,t){return e.polygonOffset.apply(e,Le()(t))})),A()(ma,"sampleCoverage",(function(e,t){return e.sampleCoverage.apply(e,Le()(t))})),A()(ma,"scissorTest",(function(e,t){return t?e.enable(3089):e.disable(3089)})),A()(ma,"scissor",(function(e,t){return e.scissor.apply(e,Le()(t))})),A()(ma,"stencilTest",(function(e,t){return t?e.enable(2960):e.disable(2960)})),A()(ma,"stencilMask",(function(e,t){var r=t=Sa(t)?t:[t,t],n=M()(r,2),i=n[0],a=n[1];e.stencilMaskSeparate(1028,i),e.stencilMaskSeparate(1029,a)})),A()(ma,"stencilFunc",(function(e,t){var r=t=Sa(t)&&3===t.length?[].concat(Le()(t),Le()(t)):t,n=M()(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)})),A()(ma,"stencilOp",(function(e,t){var r=t=Sa(t)&&3===t.length?[].concat(Le()(t),Le()(t)):t,n=M()(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)})),A()(ma,"viewport",(function(e,t){return e.viewport.apply(e,Le()(t))})),ma);function Ma(e,t,r){return void 0!==t[e]?t[e]:r[e]}var Ia={blendEquation:function(e,t,r){return e.blendEquationSeparate(Ma(32777,t,r),Ma(34877,t,r))},blendFunc:function(e,t,r){return e.blendFuncSeparate(Ma(32969,t,r),Ma(32968,t,r),Ma(32971,t,r),Ma(32970,t,r))},polygonOffset:function(e,t,r){return e.polygonOffset(Ma(32824,t,r),Ma(10752,t,r))},sampleCoverage:function(e,t,r){return e.sampleCoverage(Ma(32938,t,r),Ma(32939,t,r))},stencilFuncFront:function(e,t,r){return e.stencilFuncSeparate(1028,Ma(2962,t,r),Ma(2967,t,r),Ma(2963,t,r))},stencilFuncBack:function(e,t,r){return e.stencilFuncSeparate(1029,Ma(34816,t,r),Ma(36003,t,r),Ma(36004,t,r))},stencilOpFront:function(e,t,r){return e.stencilOpSeparate(1028,Ma(2964,t,r),Ma(2965,t,r),Ma(2966,t,r))},stencilOpBack:function(e,t,r){return e.stencilOpSeparate(1029,Ma(34817,t,r),Ma(34818,t,r),Ma(34819,t,r))}},Ra={enable:function(e,t){return e(A()({},t,!0))},disable:function(e,t){return e(A()({},t,!1))},pixelStorei:function(e,t,r){return e(A()({},t,r))},hint:function(e,t,r){return e(A()({},t,r))},bindFramebuffer:function(e,t,r){var n;switch(t){case 36160:return e((n={},A()(n,36006,r),A()(n,36010,r),n));case 36009:return e(A()({},36006,r));case 36008:return e(A()({},36010,r));default:return null}},blendColor:function(e,t,r,n,i){return e(A()({},32773,new Float32Array([t,r,n,i])))},blendEquation:function(e,t){var r;return e((r={},A()(r,32777,t),A()(r,34877,t),r))},blendEquationSeparate:function(e,t,r){var n;return e((n={},A()(n,32777,t),A()(n,34877,r),n))},blendFunc:function(e,t,r){var n;return e((n={},A()(n,32969,t),A()(n,32968,r),A()(n,32971,t),A()(n,32970,r),n))},blendFuncSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,32969,t),A()(a,32968,r),A()(a,32971,n),A()(a,32970,i),a))},clearColor:function(e,t,r,n,i){return e(A()({},3106,new Float32Array([t,r,n,i])))},clearDepth:function(e,t){return e(A()({},2931,t))},clearStencil:function(e,t){return e(A()({},2961,t))},colorMask:function(e,t,r,n,i){return e(A()({},3107,[t,r,n,i]))},cullFace:function(e,t){return e(A()({},2885,t))},depthFunc:function(e,t){return e(A()({},2932,t))},depthRange:function(e,t,r){return e(A()({},2928,new Float32Array([t,r])))},depthMask:function(e,t){return e(A()({},2930,t))},frontFace:function(e,t){return e(A()({},2886,t))},lineWidth:function(e,t){return e(A()({},2849,t))},polygonOffset:function(e,t,r){var n;return e((n={},A()(n,32824,t),A()(n,10752,r),n))},sampleCoverage:function(e,t,r){var n;return e((n={},A()(n,32938,t),A()(n,32939,r),n))},scissor:function(e,t,r,n,i){return e(A()({},3088,new Int32Array([t,r,n,i])))},stencilMask:function(e,t){var r;return e((r={},A()(r,2968,t),A()(r,36005,t),r))},stencilMaskSeparate:function(e,t,r){return e(A()({},1028===t?2968:36005,r))},stencilFunc:function(e,t,r,n){var i;return e((i={},A()(i,2962,t),A()(i,2967,r),A()(i,2963,n),A()(i,34816,t),A()(i,36003,r),A()(i,36004,n),i))},stencilFuncSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,1028===t?2962:34816,r),A()(a,1028===t?2967:36003,n),A()(a,1028===t?2963:36004,i),a))},stencilOp:function(e,t,r,n){var i;return e((i={},A()(i,2964,t),A()(i,2965,r),A()(i,2966,n),A()(i,34817,t),A()(i,34818,r),A()(i,34819,n),i))},stencilOpSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,1028===t?2964:34817,r),A()(a,1028===t?2965:34818,n),A()(a,1028===t?2966:34819,i),a))},viewport:function(e,t,r,n,i){return e(A()({},2978,[t,r,n,i]))}},Pa=function(e,t){return e.isEnabled(t)},Fa=(ba={},A()(ba,3042,Pa),A()(ba,2884,Pa),A()(ba,2929,Pa),A()(ba,3024,Pa),A()(ba,32823,Pa),A()(ba,32926,Pa),A()(ba,32928,Pa),A()(ba,3089,Pa),A()(ba,2960,Pa),A()(ba,35977,Pa),ba);function Da(e){for(var t in e)return!1;return!0}function La(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 ja(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 Ga(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 Ua(e){var t=e.useProgram.bind(e);e.useProgram=function(r){e.state.program!==r&&(t(r),e.state.program=r)}}var Na=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?qa(t):Object.assign({},Ca),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return C()(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){ia(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Ka(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){ia(void 0!==i);var a=e[i],o=this.cache[i];La(a,o)||(r=!0,t=o,!n||i in n||(n[i]=o),this.cache[i]=a)}return{valueChanged:r,oldValue:t}}}]),e}();function Ha(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.enable,n=void 0===r||r,i=t.copyState;if(ia(void 0!==i),!e.state){var a=globalThis.polyfillContext;for(var o in a&&a(e),e.state=new Na(e,{copyState:i}),Ua(e),Ra){var s=Ra[o];Ga(e,o,s)}ja(e,"getParameter"),ja(e,"isEnabled")}return e.state.enable=n,e}function Ja(e){ia(e.state),e.state.pop()}function Va(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 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=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 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}function Ka(e,t){if(ia(aa(e),"setParameters requires a WebGL context"),!Da(t)){var r={};for(var n in t){var i=Number(n),a=ka[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,Ia[s])(e,t,o)}}}function qa(e,t){if("number"==typeof(t=t||Ca)){var r=t,n=Fa[r];return n?n(e,r):e.getParameter(r)}var i,a={},o=Va(Array.isArray(t)?t:Object.keys(t));try{for(o.s();!(i=o.n()).done;){var s=i.value,u=Fa[s];a[s]=u?u(e,Number(s)):e.getParameter(Number(s))}}catch(e){o.e(e)}finally{o.f()}return a}function Qa(e,t,r){if(Da(t))return r(e);var n,i=t.nocatch,a=void 0===i||i;if(function(e){e.state||Ha(e,{copyState:!1}),e.state.push()}(e),Ka(e,t),a)n=r(e),Ja(e);else try{n=r(e)}finally{Ja(e)}return n}function Xa(){return!("object"===("undefined"==typeof process?"undefined":bi()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===bi()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===bi()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":bi()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}var Wa=Xa();function Za(){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 Ya=function(){function e(t,r){h()(this,e),this.name=t,this.type=r,this.sampleSize=1,this.reset()}return C()(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=Za(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Za()-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}(),$a=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 C()(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 Ya?e:new Ya(t,r)),this.stats[t]}}]),e}(),eo=new(function(){function e(){h()(this,e),this.stats=new Map}return C()(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new $a({id:e})),this.stats.get(e)}}]),e}());if(globalThis.luma&&"8.5.14"!==globalThis.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat("8.5.14"));globalThis.luma||(Xa()&&na.log(1,"luma.gl ".concat("8.5.14"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:"8.5.14",version:"8.5.14",log:na,stats:eo,globals:{modules:{},nodeIO:{}}});globalThis.luma;function to(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function ro(e,t){if("string"!=typeof t)return t;var r=Number(t);if(!isNaN(r))return r;var n=e[t=t.replace(/^.*\./,"")];return to(void 0!==n,"Accessing undefined constant GL.".concat(t)),n}function no(e,t){for(var r in t=Number(t),e)if(e[r]===t)return"GL.".concat(r);return String(t)}var io={};function ao(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";io[e]=io[e]||1;var t=io[e]++;return"".concat(e,"-").concat(t)}function oo(e){return to("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function so(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 uo(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 uo(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 uo(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 co="Resource subclass must define virtual methods",lo=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h()(this,t),sa(e);var n=r.id,i=r.userData,a=void 0===i?{}:i;this.gl=e,this.gl2=e,this.id=n||ao(this[Symbol.toStringTag]),this.userData=a,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return C()(t,[{key:e,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||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]:{};to(e=ro(this.gl,e));var r=this.constructor.PARAMETERS||{},n=r[e];if(n){var i=oa(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=oa(this.gl),o={},s=r||Object.keys(i),u=so(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?no(this.gl,c):c;o[h]=this.getParameter(c,t),n&&"GLenum"===l.type&&(o[h]=no(this.gl,o[h]))}}}catch(e){u.e(e)}finally{u.f()}return o}},{key:"setParameter",value:function(e,t){to(e=ro(this.gl,e));var r=(this.constructor.PARAMETERS||{})[e];if(r){var n=oa(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=ro(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 na.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(co)}},{key:"_deleteHandle",value:function(){throw new Error(co)}},{key:"_bindHandle",value:function(e){throw new Error(co)}},{key:"_getOptsFromHandle",value:function(){throw new Error(co)}},{key:"_getParameter",value:function(e,t){throw new Error(co)}},{key:"_setParameter",value:function(e,t){throw new Error(co)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this[Symbol.toStringTag],t=eo.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[Symbol.toStringTag];eo.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[Symbol.toStringTag],r=eo.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[Symbol.toStringTag],t=eo.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),t}(Symbol.toStringTag),fo=r(59),ho=r.n(fo);function po(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 vo(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 yo(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 go(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 mo(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";na.removed("".concat(e,".").concat(c),l)()}for(var f in o)if(f in t){var h=o[f];na.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(h))()}var d=null;for(var p in u)if(p in t){var v=u[p];na.deprecated("".concat(e,".").concat(p),"".concat(e,".").concat(v))(),(d=d||Object.assign({},t))[v]=t[p],delete d[p]}return d||t}var bo={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Ao={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Bo=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 C()(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=mo("Accessor",e,Ao)).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 vo(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return to(e.size),vo(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 ho()(e,[bo].concat(r))}}]),e}();function wo(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 y()(this,r)}}var _o,xo,Co,Oo={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"},Eo={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Oo},To={removedProps:Oo},So=function(e,t){p()(n,e);var r=wo(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,n),(t=r.call(this,e,i)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),t.target=i.target||(t.gl.webgl2?36662:34962),t.initialize(i),Object.seal(gi()(t)),t}return C()(n,[{key:t,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/Bo.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/Bo.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=mo("Buffer",e,Eo),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=mo("Buffer",e,To))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new Bo(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;to(r);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(ua(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 ua(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;ua(this.gl);var c,l,f=vo(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 to((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):(to(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;to(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=po(e);return to(i),this.setAccessor(new Bo(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;to(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/vo(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new Bo(this.accessor,{type:po(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 na.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return na.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(e){return na.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return na.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new Bo(this.accessor,e),this}}]),n}(lo,Symbol.toStringTag),ko=(_o={},A()(_o,6407,{dataFormat:6407,types:[5121,33635]}),A()(_o,6408,{dataFormat:6408,types:[5121,32819,32820]}),A()(_o,6406,{dataFormat:6406,types:[5121]}),A()(_o,6409,{dataFormat:6409,types:[5121]}),A()(_o,6410,{dataFormat:6410,types:[5121]}),A()(_o,33326,{dataFormat:6403,types:[5126],gl2:!0}),A()(_o,33328,{dataFormat:33319,types:[5126],gl2:!0}),A()(_o,34837,{dataFormat:6407,types:[5126],gl2:!0}),A()(_o,34836,{dataFormat:6408,types:[5126],gl2:!0}),_o),Mo=(xo={},A()(xo,6403,1),A()(xo,36244,1),A()(xo,33319,2),A()(xo,33320,2),A()(xo,6407,3),A()(xo,36248,3),A()(xo,6408,4),A()(xo,36249,4),A()(xo,6402,1),A()(xo,34041,1),A()(xo,6406,1),A()(xo,6409,1),A()(xo,6410,2),xo),Io=(Co={},A()(Co,5126,4),A()(Co,5125,4),A()(Co,5124,4),A()(Co,5123,2),A()(Co,5122,2),A()(Co,5131,2),A()(Co,5120,1),A()(Co,5121,1),Co);function Ro(e,t){var r=ko[t];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=oa(e)&&r.gl2||r.gl1;return"string"==typeof n?e.getExtension(n):n}function Po(e,t){var r=ko[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 Fo(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 Do(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 Do(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 Do(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 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 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 y()(this,r)}}var jo=[9729,9728],Go=globalThis.WebGLBuffer||function(){},Uo=function(e,t){p()(n,e);var r=Lo(n);function n(e,t){var i;h()(this,n);var a=t.id,o=void 0===a?ao("texture"):a,s=t.handle,u=t.target;return(i=r.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 C()(n,[{key:t,get:function(){return"Texture"}},{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,v=void 0===p?{}:p,y=t.textureUnit,g=void 0===y?void 0:y;r||(r=a);var m=t.width,b=t.height,A=t.dataFormat,B=t.type,w=t.compressed,_=void 0!==w&&w,x=t.mipmaps,C=void 0===x||x,O=t.depth,E=void 0===O?0:O,T=this._deduceParameters({format:s,type:B,dataFormat:A,compressed:_,data:r,width:m,height:b});return m=T.width,b=T.height,_=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()&&(na.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:v,compressed:_}),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()?(na.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Qa(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,v=e.data,y=void 0===v?null:v,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,_=e.dataFormat,x=void 0===_?this.dataFormat:_,C=e.compressed,O=void 0!==C&&C;y||(y=i);var E=this._deduceParameters({format:u,type:m,dataFormat:x,compressed:O,data:y,width:A,height:w});m=E.type,x=E.dataFormat,O=E.compressed,A=E.width,w=E.height;var T=this.gl;T.bindTexture(this.target,this.handle);var S,k,I=this._getDataType({data:y,compressed:O});y=I.data,S=I.dataType;var R=0;if(Qa(this.gl,p,(function(){switch(S){case"null":T.texImage2D(r,o,u,A,w,l,x,m,y);break;case"typed-array":T.texImage2D(r,o,u,A,w,l,x,m,y,h);break;case"buffer":(k=ua(T)).bindBuffer(35052,y.handle||y),k.texImage2D(r,o,u,A,w,l,x,m,h),k.bindBuffer(35052,null);break;case"browser-object":oa(T)?T.texImage2D(r,o,u,A,w,l,x,m,y):T.texImage2D(r,o,u,x,m,y);break;case"compressed":var e,t=Fo(y.entries());try{for(t.s();!(e=t.n()).done;){var n=M()(e.value,2),i=n[0],a=n[1];T.compressedTexImage2D(r,i,a.format,a.width,a.height,l,a.data),R+=a.levelSize}}catch(e){t.e(e)}finally{t.f()}break;default:to(!1,"Unknown image data type")}})),"compressed"===S)this._trackAllocatedMemory(R,"Texture");else if(y&&y.byteLength)this._trackAllocatedMemory(y.byteLength,"Texture");else{var P=Mo[this.dataFormat]||4,F=Io[this.type]||1;this._trackAllocatedMemory(this.width*this.height*P*F,"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,v=void 0===p?this.height:p,y=e.level,g=void 0===y?0:y,m=e.format,b=void 0===m?this.format:m,A=e.type,B=void 0===A?this.type:A,w=e.dataFormat,_=void 0===w?this.dataFormat:w,x=e.compressed,C=void 0!==x&&x,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:_,compressed:C,data:s,width:d,height:v});if(B=M.type,_=M.dataFormat,C=M.compressed,d=M.width,v=M.height,to(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],v=I.shape[1]}s instanceof So&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Qa(this.gl,k,(function(){if(C)t.gl.compressedTexSubImage2D(n,g,c,f,d,v,b,s);else if(null===s)t.gl.texSubImage2D(n,g,c,f,d,v,_,B,null);else if(ArrayBuffer.isView(s))t.gl.texSubImage2D(n,g,c,f,d,v,_,B,s,E);else if(s instanceof Go){var e=ua(t.gl);e.bindBuffer(35052,s),e.texSubImage2D(n,g,c,f,d,v,_,B,E),e.bindBuffer(35052,null)}else if(oa(t.gl)){ua(t.gl).texSubImage2D(n,g,c,f,d,v,_,B,s)}else t.gl.texSubImage2D(n,g,c,f,_,B,s)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return na.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 So?{data:t.handle,dataType:"buffer"}:t instanceof Go?{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=ko[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 to(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"),to(void 0===t||n.width===t,"Deduced texture width does not match supplied width"),to(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:to(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!oa(this.gl)&&(!(!this.width||!this.height)&&(!oo(this.width)||!oo(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===jo.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&&Ro(e,r))&&(!n||Po(e,r))),i}}]),n}(lo,Symbol.toStringTag),No="";function Ho(e,t){return to("string"==typeof e),e=No+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 Jo(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 y()(this,r)}}var Vo,zo=function(e,t){p()(n,e);var r=Jo(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,n),sa(e),(i instanceof Promise||"string"==typeof i)&&(i={data:i}),"string"==typeof i.data&&(i=Object.assign({},i,{data:Ho(i.data)})),(t=r.call(this,e,Object.assign({},i,{target:3553}))).initialize(i),Object.seal(gi()(t)),t}return C()(n,[{key:t,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(e,t){return Uo.isSupported(e,t)}}]),n}(Uo,Symbol.toStringTag),Ko="EXT_color_buffer_float",qo=(Vo={},A()(Vo,33189,{bpp:2}),A()(Vo,33190,{gl2:!0,bpp:3}),A()(Vo,36012,{gl2:!0,bpp:4}),A()(Vo,36168,{bpp:1}),A()(Vo,34041,{bpp:4}),A()(Vo,35056,{gl2:!0,bpp:4}),A()(Vo,36013,{gl2:!0,bpp:5}),A()(Vo,32854,{bpp:2}),A()(Vo,36194,{bpp:2}),A()(Vo,32855,{bpp:2}),A()(Vo,33321,{gl2:!0,bpp:1}),A()(Vo,33330,{gl2:!0,bpp:1}),A()(Vo,33329,{gl2:!0,bpp:1}),A()(Vo,33332,{gl2:!0,bpp:2}),A()(Vo,33331,{gl2:!0,bpp:2}),A()(Vo,33334,{gl2:!0,bpp:4}),A()(Vo,33333,{gl2:!0,bpp:4}),A()(Vo,33323,{gl2:!0,bpp:2}),A()(Vo,33336,{gl2:!0,bpp:2}),A()(Vo,33335,{gl2:!0,bpp:2}),A()(Vo,33338,{gl2:!0,bpp:4}),A()(Vo,33337,{gl2:!0,bpp:4}),A()(Vo,33340,{gl2:!0,bpp:8}),A()(Vo,33339,{gl2:!0,bpp:8}),A()(Vo,32849,{gl2:!0,bpp:3}),A()(Vo,32856,{gl2:!0,bpp:4}),A()(Vo,32857,{gl2:!0,bpp:4}),A()(Vo,36220,{gl2:!0,bpp:4}),A()(Vo,36238,{gl2:!0,bpp:4}),A()(Vo,36975,{gl2:!0,bpp:4}),A()(Vo,36214,{gl2:!0,bpp:8}),A()(Vo,36232,{gl2:!0,bpp:8}),A()(Vo,36226,{gl2:!0,bpp:16}),A()(Vo,36208,{gl2:!0,bpp:16}),A()(Vo,33325,{gl2:Ko,bpp:2}),A()(Vo,33327,{gl2:Ko,bpp:4}),A()(Vo,34842,{gl2:Ko,bpp:8}),A()(Vo,33326,{gl2:Ko,bpp:4}),A()(Vo,33328,{gl2:Ko,bpp:8}),A()(Vo,34836,{gl2:Ko,bpp:16}),A()(Vo,35898,{gl2:Ko,bpp:4}),Vo);function Qo(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 y()(this,r)}}function Xo(e,t,r){var n=r[t];if(!n)return!1;var i=oa(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}var Wo=function(e,t){p()(n,e);var r=Qo(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,n),(t=r.call(this,e,i)).initialize(i),Object.seal(gi()(t)),t}return C()(n,[{key:t,get:function(){return"Renderbuffer"}},{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 to(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&oa(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)*qo[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||Xo(e,r,qo)}},{key:"getSamplesForFormat",value:function(e,t){var r=t.format;return e.getInternalformatParameter(36161,r,32937)}}]),n}(lo,Symbol.toStringTag);function Zo(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)),to(0!==f,"clear: bad arguments"),Qa(e,l,(function(){e.clear(f)}))}function Yo(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;ua(e),Qa(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=M()(c,2),r=t[0],n=t[1];e.clearBufferfi(34041,0,r,n);break;default:to(!1,"clear: bad arguments")}}))}function $o(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 to(!1),0}}function es(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 y()(this,r)}}var ts=[34069,34070,34071,34072,34073,34074],rs=function(e,t){p()(i,e);var r,n=es(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,i),sa(e),(t=n.call(this,e,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(gi()(t)),t}return C()(i,[{key:t,get:function(){return"TextureCube"}},{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:(r=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v=this;return Pe.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(ts.map((function(e){var t=d[e];return Promise.all(Array.isArray(t)?t:[t])})));case 5:p=e.sent,this.bind(),ts.forEach((function(e,t){p[t].length>1&&!1!==v.opts.mipmaps&&na.warn("".concat(v.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 r.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}}]),i}(Uo,Symbol.toStringTag);function ns(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;Reflect.construct(n,arguments,i)}else n.apply(this,arguments);return y()(this,r)}}rs.FACES=ts;Symbol.toStringTag;function is(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,v=os(e),y=v.framebuffer,g=v.deleteFramebuffer;to(y);var m=y.gl,b=y.handle,A=y.attachments;h=h||y.width,d=d||y.height,36064===c&&null===b&&(c=1028),to(A[c]),f=ss(f,p=p||A[c].type,s,h,d),p=p||po(f);var B=m.bindFramebuffer(36160,b);return m.readPixels(n,a,h,d,s,p,f),m.bindFramebuffer(36160,B||null),g&&y.delete(),f}function as(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=is(e,{sourceAttachment:n}),s=e.width,u=e.height;u>a;){var c=go({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}yo({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 os(e){return e instanceof fs?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,n=t.gl,i=t.width,a=t.height,o=t.id,new fs(n,Object.assign({},r,{id:"framebuffer-for-".concat(o),width:i,height:a,attachments:A()({},36064,t)}))),deleteFramebuffer:!0};var t,r,n,i,a,o}function ss(e,t,r,n,i){return e||new(vo(t=t||5121,{clamped:!1}))(n*i*$o(r))}function us(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 cs(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 cs(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 cs(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 ls(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 y()(this,r)}}var fs=function(e,t){p()(n,e);var r=ls(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,n),(t=r.call(this,e,i)).width=null,t.height=null,t.attachments={},t.readBuffer=36064,t.drawBuffers=[36064],t.ownResources=[],t.initialize(i),Object.seal(gi()(t)),t}return C()(n,[{key:t,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=ua(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=ua(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,v=e.readBuffer,y=void 0===v?void 0:v,g=e.drawBuffers,m=void 0===g?void 0:g;if(to(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:y,drawBuffers:m}),o&&p&&this.checkStatus()}},{key:"delete",value:function(){var e,t=us(this.ownResources);try{for(t.s();!(e=t.n()).done;){e.value.delete()}}catch(e){t.e(e)}finally{t.f()}return oi()(m()(n.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 to(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&&na.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){to(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof Wo)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=M()(f,3),p=d[0],v=d[1],y=void 0===v?0:v,g=d[2],m=void 0===g?0:g;h=p,this._attachTexture({attachment:l,texture:p,layer:y,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(fs.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)&&Zo(this.gl,{color:r,depth:n,stencil:i}),o.forEach((function(t,r){Yo(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 na.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 na.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 na.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 na.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 na.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 na.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=ua(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=no(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=us(n);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=r?no(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?no(this.gl,o):o;r[s]=this.getAttachmentParameters(o,e)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(as(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>na.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var r=as(this,{targetMaxHeight:100});return na.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 zo(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(a={},A()(a,10241,9729),A()(a,10240,9729),A()(a,10242,33071),A()(a,10243,33071),a)}),this.ownResources.push(o[36064]));return t&&r?((o=o||{})[33306]=new Wo(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new Wo(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(o[36096])):r&&to(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof Wo?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:ua(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:to(!1,"Illegal texture type")}o.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(e){var t,r=oa(t=this.gl)?t:null;r?r.readBuffer(e):to(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,r=ua(t);if(r)r.drawBuffers(e);else{var n=t.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(e):to(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||{},Fs)void 0===e.luma.caps[t]&&(e.luma.caps[t]=Gs(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 n(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),n}(lo,Symbol.toStringTag);var hs;fs.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var ds="WEBGL2",ps="VERTEX_ARRAY_OBJECT",vs="TIMER_QUERY",ys="INSTANCED_RENDERING",gs="MULTIPLE_RENDER_TARGETS",ms="ELEMENT_INDEX_UINT32",bs="BLEND_EQUATION_MINMAX",As="FLOAT_BLEND",Bs="COLOR_ENCODING_SRGB",ws="TEXTURE_DEPTH",_s="TEXTURE_FLOAT",xs="TEXTURE_HALF_FLOAT",Cs="TEXTURE_FILTER_LINEAR_FLOAT",Os="TEXTURE_FILTER_LINEAR_HALF_FLOAT",Es="TEXTURE_FILTER_ANISOTROPIC",Ts="COLOR_ATTACHMENT_RGBA32F",Ss="COLOR_ATTACHMENT_FLOAT",ks="COLOR_ATTACHMENT_HALF_FLOAT",Ms="GLSL_FRAG_DATA",Is="GLSL_FRAG_DEPTH",Rs="GLSL_DERIVATIVES",Ps="GLSL_TEXTURE_LOD";var Fs=(hs={},A()(hs,ds,[!1,!0]),A()(hs,ps,["OES_vertex_array_object",!0]),A()(hs,vs,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),A()(hs,ys,["ANGLE_instanced_arrays",!0]),A()(hs,gs,["WEBGL_draw_buffers",!0]),A()(hs,ms,["OES_element_index_uint",!0]),A()(hs,bs,["EXT_blend_minmax",!0]),A()(hs,As,["EXT_float_blend"]),A()(hs,Bs,["EXT_sRGB",!0]),A()(hs,ws,["WEBGL_depth_texture",!0]),A()(hs,_s,["OES_texture_float",!0]),A()(hs,xs,["OES_texture_half_float",!0]),A()(hs,Cs,["OES_texture_float_linear"]),A()(hs,Os,["OES_texture_half_float_linear"]),A()(hs,Es,["EXT_texture_filter_anisotropic"]),A()(hs,Ts,[function(e){var t=new zo(e,{format:6408,type:5126,dataFormat:6408}),r=new fs(e,{id:"test-framebuffer",check:!1,attachments:A()({},36064,t)}),n=r.getStatus();return t.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),A()(hs,Ss,[!1,"EXT_color_buffer_float"]),A()(hs,ks,["EXT_color_buffer_half_float"]),A()(hs,Ms,["WEBGL_draw_buffers",!0]),A()(hs,Is,["EXT_frag_depth",!0]),A()(hs,Rs,["OES_standard_derivatives",!0]),A()(hs,Ps,["EXT_shader_texture_lod",!0]),hs);function Ds(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 Ls(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 Ls(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 Ls(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 js(e,t){return function(e,t){return(t=Array.isArray(t)?t:[t]).every((function(t){return Gs(e,t)}))}(e,t)}function Gs(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=Fs[t];to(n,t);var i=oa(e)&&n[1]||n[0];if("function"==typeof i)r=i(e);else if(Array.isArray(i)){r=!0;var a,o=Ds(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:to(!1);return r}(e,t)),e.luma.caps[t]||na.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}function Us(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 Ns(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Us(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Us(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Hs=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},js(t,Ps)&&(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 C()(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=A()({},this.gl.TEXTURE_MIN_FILTER,a.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):r={data:a};var s=new zo(this.gl,Ns({id:e.name||e.id,parameters:Ns(Ns({},i),o),pixelStore:A()({},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&&(na.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]}))}},{key:"delete",value:function(){this.generatedTextures.forEach((function(e){return e.delete()}))}}]),e}();function Js(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 Vs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Js(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Js(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zs(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 y()(this,r)}}var Ks=function(e){p()(r,e);var t=zs(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"getShaders",value:function(){var e=oi()(m()(r.prototype),"getShaders",this).call(this);return e.modules.push(Mi.pbr),Vs(Vs({},e),{},{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\n\n// Instance attributes\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\n\n// Outputs to fragment shader\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 // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md\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 (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 // set PBR data\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\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\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;oi()(m()(r.prototype),"initializeState",this).call(this);var t=this.getAttributeManager();e&&t.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(e){oi()(m()(r.prototype),"updateState",this).call(this,e);var t=e.props,n=e.oldProps;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,pickFeatureIds:Boolean(t)}),oi()(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 Mi.Model(this.context.gl,Vs(Vs({},this.getShaders()),{},{id:n,geometry:e,defines:Vs(Vs(Vs({},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 Hs(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:Vs({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);A()(Ks,"layerName","MeshLayer"),A()(Ks,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var qs=function(e){return"boolean"==typeof e},Qs=function(e){return"function"==typeof e},Xs=function(e){return null!==e&&"object"===bi()(e)},Ws=function(e){return Xs(e)&&e.constructor==={}.constructor},Zs=function(e){return e&&"function"==typeof e[Symbol.iterator]},Ys=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},$s=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},eu=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},tu=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||Xs(e)&&Qs(e.tee)&&Qs(e.cancel)&&Qs(e.getReader)}(e)||function(e){return Xs(e)&&Qs(e.read)&&Qs(e.pipe)&&qs(e.readable)}(e)};function ru(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function nu(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 iu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nu(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function au(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function ou(e){var t,r,n;return ru(e,"null loader"),ru(au(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=iu(iu({},e=e[0]),{},{options:iu(iu({},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 su="",uu={};function cu(e){for(var t in uu)if(e.startsWith(t)){var r=uu[t];e=e.replace(t,r)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(su).concat(e)),e}var lu=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,fu=/^([-\w.]+\/[-\w.+]+)/;function hu(e){var t=fu.exec(e);return t?t[1]:e}function du(e){var t=lu.exec(e);return t?t[1]:""}var pu=/\?.*/;function vu(e){if($s(e)){var t=gu(e.url||"");return{url:t,type:hu(e.headers.get("content-type")||"")||du(t)}}return eu(e)?{url:gu(e.name||""),type:e.type||""}:"string"==typeof e?{url:gu(e),type:du(e)}:{url:"",type:""}}function yu(e){return $s(e)?e.headers["content-length"]||-1:eu(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer?e.byteLength:ArrayBuffer.isView(e)?e.byteLength:-1}function gu(e){return e.replace(pu,"")}function mu(e){return bu.apply(this,arguments)}function bu(){return(bu=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!$s(t)){e.next=2;break}return e.abrupt("return",t);case 2:return r={},(n=yu(t))>=0&&(r["content-length"]=String(n)),i=vu(t),a=i.url,(o=i.type)&&(r["content-type"]=o),e.next=9,xu(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 Au(e){return Bu.apply(this,arguments)}function Bu(){return(Bu=Ie()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,wu(t);case 3:throw r=e.sent,new Error(r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wu(e){return _u.apply(this,arguments)}function _u(){return(_u=Ie()(Pe.a.mark((function e(t){var r,n,i;return Pe.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(0,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 xu(e){return Cu.apply(this,arguments)}function Cu(){return(Cu=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.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=Ou(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 Ou(e){for(var t="",r=new Uint8Array(e),n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function Eu(e,t){return Tu.apply(this,arguments)}function Tu(){return(Tu=Ie()(Pe.a.mark((function e(t,r){var n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=7;break}return t=cu(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,mu(t);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Su=new $i({id:"loaders.gl"}),ku=function(){function e(){h()(this,e)}return C()(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=function(){function e(){h()(this,e),Gn(this,"console",void 0),this.console=console}return C()(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}(),Iu=("undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof global&&global,"undefined"!=typeof document&&document,Boolean("object"!==("undefined"==typeof process?"undefined":bi()(process))||"[object process]"!==String(process)||process.browser)),Ru="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Pu=(Ru&&parseFloat(Ru[1]),{fetch:null,mimeType:void 0,nothrow:!1,log:new Mu,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Iu,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}),Fu={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 Du(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 Lu(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 Lu(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 Lu(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 ju(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 Gu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ju(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ju(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Uu(){globalThis.loaders=globalThis.loaders||{};var e=globalThis.loaders;return e._state=e._state||{},e._state}var Nu=function(){var e=Uu();return e.globalOptions=e.globalOptions||Gu({},Pu),e.globalOptions};function Hu(e,t,r,n){return r=r||[],function(e,t){Vu(e,null,Pu,Fu,t);var r,n=Du(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]||{};Vu(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 Ju(e,t){var r=Nu(),n=e||r;return"function"==typeof n.fetch?n.fetch:Xs(n.fetch)?function(e){return Eu(e,n)}:null!=t&&t.fetch?null==t?void 0:t.fetch:Eu}function Vu(e,t,r,n,i){var a=t||"Top level",o=t?"".concat(t,"."):"";for(var s in e){var u=!t&&Xs(e[s]);if(!(s in r||"baseUri"===s&&!t||"workerUrl"===s&&t))if(s in n)Su.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var c=zu(s,i);Su.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(c))()}}}function zu(e,t){var r,n=e.toLowerCase(),i="",a=Du(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=Gu({},e.options||{});return function(e,t){!t||"baseUri"in e||(e.baseUri=t)}(n,r),null===n.log&&(n.log=new ku),qu(n,Nu()),qu(n,t),n}function qu(e,t){for(var r in t)if(r in t){var n=t[r];Ws(n)&&Ws(e[r])?e[r]=Gu(Gu({},e[r]),t[r]):e[r]=t[r]}}function Qu(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}function Xu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.2.3";Qu(e,"no worker provided");var r=e.version;return!(!t||!r)}var Wu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Zu=Wu.global||Wu.self||Wu.window||{},Yu="object"!==("undefined"==typeof process?"undefined":bi()(process))||"[object process]"!==String(process)||process.browser,$u="function"==typeof importScripts,ec="undefined"!=typeof window&&void 0!==window.orientation,tc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),rc=(tc&&parseFloat(tc[1]),function e(){h()(this,e)}),nc=new Map;function ic(e){Qu(e.source&&!e.url||!e.source&&e.url);var t=nc.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return ac((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),nc.set(e.url,t)),e.source&&(t=ac(e.source),nc.set(e.source,t))),Qu(t),t}function ac(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function oc(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 sc=function(){},uc=function(){function e(t){h()(this,e),Gn(this,"name",void 0),Gn(this,"source",void 0),Gn(this,"url",void 0),Gn(this,"terminated",!1),Gn(this,"worker",void 0),Gn(this,"onMessage",void 0),Gn(this,"onError",void 0),Gn(this,"_loadableURL","");var r=t.name,n=t.source,i=t.url;Qu(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=sc,this.onError=function(e){return console.log(e)},this.worker=Yu?this._createBrowserWorker():this._createNodeWorker()}return C()(e,[{key:"destroy",value:function(){this.onMessage=sc,this.onError=sc,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(oc(t))i.add(t);else if(oc(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(r&&"object"===bi()(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=ic({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:"_createNodeWorker",value:function(){var e,t=this;if(this.url){var r=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new rc(r,{eval:!1})}else{if(!this.source)throw new Error("no worker");e=new rc(this.source,{eval:!0})}return e.on("message",(function(e){t.onMessage(e)})),e.on("error",(function(e){t.onError(e)})),e.on("exit",(function(e){})),e}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker&&Yu||void 0!==bi()(rc)}}]),e}(),cc=function(){function e(t,r){var n=this;h()(this,e),Gn(this,"name",void 0),Gn(this,"workerThread",void 0),Gn(this,"isRunning",!0),Gn(this,"result",void 0),Gn(this,"_resolve",(function(){})),Gn(this,"_reject",(function(){})),this.name=t,this.workerThread=r,this.result=new Promise((function(e,t){n._resolve=e,n._reject=t}))}return C()(e,[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){Qu(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){Qu(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}();function lc(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 fc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var hc=function(){function e(t){h()(this,e),Gn(this,"name","unnamed"),Gn(this,"source",void 0),Gn(this,"url",void 0),Gn(this,"maxConcurrency",1),Gn(this,"maxMobileConcurrency",1),Gn(this,"onDebug",(function(){})),Gn(this,"reuseWorkers",!0),Gn(this,"props",{}),Gn(this,"jobQueue",[]),Gn(this,"idleQueue",[]),Gn(this,"count",0),Gn(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}var t,r;return C()(e,[{key:"destroy",value:function(){this.idleQueue.forEach((function(e){return e.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=fc(fc({},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=Ie()(Pe.a.mark((function e(t){var r,n,i,a=this,o=arguments;return Pe.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=Ie()(Pe.a.mark((function e(){var t,r,n;return Pe.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 cc(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 uc({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return ec?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return uc.isSupported()}}]),e}();function dc(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 pc(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 pc(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 pc(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 vc(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 yc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var gc={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},mc=function(){function e(t){h()(this,e),Gn(this,"props",void 0),Gn(this,"workerPools",new Map),this.props=yc({},gc),this.setProps(t),this.workerPools=new Map}return C()(e,[{key:"destroy",value:function(){var e,t=dc(this.workerPools.values());try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}this.workerPools=new Map}},{key:"setProps",value:function(e){this.props=yc(yc({},this.props),e);var t,r=dc(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 hc({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 uc.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}();Gn(mc,"_workerFarm",void 0);function bc(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="latest");var o=a?"@".concat(a):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(o,"/dist/").concat(n)}return Qu(i),i}function Ac(e,t){return!!mc.isSupported()&&(!!(Yu||null!=t&&t._nodeWorkers)&&(e.worker&&(null==t?void 0:t.worker)))}function Bc(e,t,r,n,i){return wc.apply(this,arguments)}function wc(){return(wc=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.id,s=bc(t,n),u=mc.getWorkerFarm(n),c=u.getWorkerPool({name:o,url:s}),n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{})),e.next=8,c.startJob("process-on-worker",_c.bind(null,a));case 8:return(l=e.sent).postMessage("process",{input:r,options:n,context:i}),e.next=12,l.result;case 12:return f=e.sent,e.next=15,f.result;case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _c(e,t,r,n){return xc.apply(this,arguments)}function xc(){return(xc=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c;return Pe.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 Cc=r(33),Oc=r.n(Cc);r(40);function Ec(e){return e&&"object"===bi()(e)&&e.isBuffer}function Tc(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 Sc(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 Sc(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 Sc(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 kc(e){if(Ec(e))return Ec(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"===bi()(e)&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Mc(){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=Tc(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 Ic(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 Rc(e){return Pc.apply(this,arguments)}function Pc(){return(Pc=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=!1,i=!1,e.prev=3,o=Oc()(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",Mc.apply(void 0,r));case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var Fc=Pe.a.mark(Dc);function Dc(e,t){var r,n,i,a,o;return Pe.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()}}),Fc)}var Lc=Pe.a.mark(jc);function jc(e){var t,r,n,i,a,o,s,u=arguments;return Pe.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()}}),Lc)}var Gc=r(27),Uc=r.n(Gc),Nc=r(32),Hc=r.n(Nc);function Jc(){return(Jc=Hc()(Pe.a.mark((function e(t,r){var n,i,a,o;return Pe.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,Uc()(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 Vc(e,t){return Iu?function(e,t){return zc.apply(this,arguments)}(e,t):function(e,t){return Kc.apply(this,arguments)}(e,t)}function zc(){return(zc=Hc()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.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,Uc()(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,kc(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 Kc(){return(Kc=Hc()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!1,i=!1,e.prev=2,o=Oc()(t);case 4:return e.next=6,Uc()(o.next());case 6:if(!(n=!(s=e.sent).done)){e.next=13;break}return u=s.value,e.next=10,kc(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,Uc()(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 qc(e,t){if("string"==typeof e)return Dc(e,t);if(e instanceof ArrayBuffer)return jc(e,t);if(eu(e))return function(e,t){return Jc.apply(this,arguments)}(e,t);if(tu(e))return Vc(e,t);if($s(e))return Vc(e.body,t);throw new Error("makeIterator")}var Qc="Cannot convert supplied data type";function Xc(e,t,r){if(t.text&&"string"==typeof e)return e;var n;if((n=e)&&"object"===bi()(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(Qc)}function Wc(e,t,r){return Zc.apply(this,arguments)}function Zc(){return(Zc=Ie()(Pe.a.mark((function e(t,r,n){var i,a;return Pe.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",Xc(t,r));case 3:if(!eu(t)){e.next=7;break}return e.next=6,mu(t);case 6:t=e.sent;case 7:if(!$s(t)){e.next=21;break}return a=t,e.next=11,Au(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(tu(t)&&(t=qc(t,n)),!Zs(t)&&!Ys(t)){e.next=24;break}return e.abrupt("return",Rc(t));case 24:throw new Error(Qc);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yc(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 $c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function el(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(r)return r;var n=$c({fetch:Ju(t,e)},e);return Array.isArray(n.loaders)||(n.loaders=null),n}function tl(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(Le()(r),Le()(n)):n}return r&&r.length?r:null}function rl(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(t+1):""}function nl(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(0,t):""}function il(){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(51),Xa();function al(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var ol,sl=function(){function e(t){h()(this,e);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Gn(this,"storage",void 0),Gn(this,"id",void 0),Gn(this,"config",{}),this.storage=al(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return C()(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 ul(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]}function cl(e){return"string"==typeof e?ol[e.toUpperCase()]||ol.WHITE:e}function ll(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 fl(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 fl(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 fl(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 hl(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=ll(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 dl(e,t){if(!e)throw new Error(t||"Assertion failed")}!function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(ol||(ol={}));var pl={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":bi()(process))&&process},vl=(globalThis,pl.window||pl.self||pl.global),yl=pl.process||{};console;function gl(){var e,t,r;if(Xa&&"performance"in vl)e=null==vl?void 0:null===(t=vl.performance)||void 0===t?void 0:null===(r=t.now)||void 0===r?void 0:r.call(t);else if("hrtime"in yl){var n,i=null==yl?void 0:null===(n=yl.hrtime)||void 0===n?void 0:n.call(yl);e=1e3*i[0]+i[1]/1e6}else e=Date.now();return e}var ml={debug:Xa&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},bl={enabled:!0,level:0};function Al(){}var Bl={},wl={once:!0},_l=function(){function e(){h()(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=t.id;Gn(this,"id",void 0),Gn(this,"VERSION","8.8.0-beta.2"),Gn(this,"_startTs",gl()),Gn(this,"_deltaTs",gl()),Gn(this,"_storage",void 0),Gn(this,"userData",{}),Gn(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this._storage=new sl("__probe-".concat(this.id,"__"),bl),this.userData={},this.timeStamp("".concat(this.id," started")),hl(this),Object.seal(this)}return C()(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((gl()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((gl()-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:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(A()({},e,t))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(e,t){dl(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,ml.warn,arguments,wl)}},{key:"error",value:function(e){return this._getLogFunction(0,e,ml.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,ml.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,ml.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this._getLogFunction(e,t,ml.debug||ml.info,arguments,wl)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Al,r&&[r],{tag:Ol(t)}):Al}},{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)?Xa?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=ul(o,n,a);(e=console).log.apply(e,Le()(t))},o.src=t,Al}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Le()(ul(t,n,a))),Al}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,Le()(ul(c,n,a)))},c.src=t.toDataURL(),Al}return Al}({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(95)}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 Al}({image:i,message:o,scale:u}):Al}},{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||Al)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=Cl({logLevel:e,message:t,opts:r}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{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||Al)}},{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()>=xl(e)}},{key:"_getLogFunction",value:function(e,t,r,n,i){if(this._shouldLog(e)){var a;i=Cl({logLevel:e,message:t,args:n,opts:i}),dl(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=gl();var o=i.tag||i.message;if(i.once){if(Bl[o])return Al;Bl[o]=gl()}return t=function(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,Xa||"string"!=typeof i||(a&&(a=cl(a),i="[".concat(a,"m").concat(i,"")),o&&(a=cl(o),i="[".concat(o+10,"m").concat(i,""))),t=i}var i,a,o;var s;return t}(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(Le()(i.args)))}return Al}}]),e}();function xl(e){if(!e)return 0;var t;switch(bi()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return dl(Number.isFinite(t)&&t>=0),t}function Cl(e){var t=e.logLevel,r=e.message;e.logLevel=xl(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(bi()(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=bi()(e.message);return dl("string"===i||"object"===i),Object.assign(e,{args:n},e.opts)}function Ol(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}Gn(_l,"VERSION","8.8.0-beta.2");var El=new _l({id:"loaders.gl"});var Tl=function(){var e=Uu();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Sl(){return Tl()}function kl(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 Ml(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kl(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Il(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 Rl(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 Rl(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 Rl(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 Pl=/\.([^.]+)$/;function Fl(e){return Dl.apply(this,arguments)}function Dl(){return(Dl=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o=arguments;return Pe.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,Gl(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(a=Ll(t,r,Ml(Ml({},n),{},{nothrow:!0}),i))){e.next=8;break}return e.abrupt("return",a);case 8:if(!eu(t)){e.next=13;break}return e.next=11,t.slice(0,10).arrayBuffer();case 11:t=e.sent,a=Ll(t,r,n,i);case 13:if(a||null!=n&&n.nothrow){e.next=15;break}throw new Error(Ul(t));case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ll(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(!Gl(e))return null;if(t&&!Array.isArray(t))return ou(t);var i,a=[];(t&&(a=a.concat(t)),null!=r&&r.ignoreRegisteredLoaders)||(i=a).push.apply(i,Le()(Sl()));Nl(a);var o=jl(e,a,r,n);if(!(o||null!=r&&r.nothrow))throw new Error(Ul(e));return o}function jl(e,t,r,n){var i,a=vu(e),o=a.url,s=a.type,u=o||(null==n?void 0:n.url),c=null,l="";(null!=r&&r.mimeType&&(c=Hl(t,null==r?void 0:r.mimeType),l="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType)),c=c||function(e,t){var r=t&&Pl.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();var r,n=Il(e);try{for(n.s();!(r=n.n()).done;){var i,a=r.value,o=Il(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,u),l=l||(c?"matched url ".concat(u):""),c=c||Hl(t,s),l=l||(c?"matched MIME type ".concat(s):""),c=c||function(e,t){if(!t)return null;var r,n=Il(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if("string"==typeof t){if(Jl(t,i))return i}else if(ArrayBuffer.isView(t)){if(Vl(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer){if(Vl(t,0,i))return i}}}catch(e){n.e(e)}finally{n.f()}return null}(t,e),l=l||(c?"matched initial data ".concat(zl(e)):""),c=c||Hl(t,null==r?void 0:r.fallbackMimeType),l=l||(c?"matched fallback MIME type ".concat(s):""))&&El.log(1,"selectLoader selected ".concat(null===(i=c)||void 0===i?void 0:i.name,": ").concat(l,"."));return c}function Gl(e){return!(e instanceof Response&&204===e.status)}function Ul(e){var t=vu(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?zl(e):"";return a+=o?' first bytes: "'.concat(o,'"'):"first bytes: not available",a+=")"}function Nl(e){var t,r=Il(e);try{for(r.s();!(t=r.n()).done;){ou(t.value)}}catch(e){r.e(e)}finally{r.f()}}function Hl(e,t){var r,n=Il(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 Jl(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some((function(t){return e.startsWith(t)}))}function Vl(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(bi()(n)){case"function":return n(e,r);case"string":var i=Kl(e,t,n.length);return n===i;default:return!1}}(e,t,r,n)}))}function zl(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 Kl(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return Kl(e,r,t)}return""}function Kl(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 ql(e,t,r,n){return Ql.apply(this,arguments)}function Ql(){return(Ql=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Qu(!i||"object"===bi()(i)),!r||Array.isArray(r)||au(r)||(i=void 0,n=r,r=void 0),e.next=4,t;case 4:return t=e.sent,n=n||{},a=vu(t),o=a.url,s=tl(r,i),e.next=11,Fl(t,s,n);case 11:if(u=e.sent){e.next=14;break}return e.abrupt("return",null);case 14:return n=Hu(n,u,s,o),i=el({url:o,parse:ql,loaders:s},n,i),e.next=18,Xl(u,t,n,i);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xl(e,t,r,n){return Wl.apply(this,arguments)}function Wl(){return(Wl=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Xu(t),$s(r)&&(o=(a=r).ok,s=a.redirected,u=a.status,c=a.statusText,l=a.type,f=a.url,h=Object.fromEntries(a.headers.entries()),i.response={headers:h,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}),e.next=4,Wc(r,t,n);case 4:if(r=e.sent,!t.parseTextSync||"string"!=typeof r){e.next=8;break}return n.dataType="text",e.abrupt("return",t.parseTextSync(r,n,i,t));case 8:if(!Ac(t,n)){e.next=12;break}return e.next=11,Bc(t,r,n,i,ql);case 11:return e.abrupt("return",e.sent);case 12:if(!t.parseText||"string"!=typeof r){e.next=16;break}return e.next=15,t.parseText(r,n,i,t);case 15:return e.abrupt("return",e.sent);case 16:if(!t.parse){e.next=20;break}return e.next=19,t.parse(r,n,i,t);case 19:return e.abrupt("return",e.sent);case 20:throw Qu(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zl(e,t,r,n){return Yl.apply(this,arguments)}function Yl(){return(Yl=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(r)||au(r)||(void 0,n=r,r=void 0),a=Ju(n),o=t,"string"!=typeof t){e.next=7;break}return e.next=6,a(t);case 6:o=e.sent;case 7:if(!eu(t)){e.next=11;break}return e.next=10,a(t);case 10:o=e.sent;case 11:return e.next=13,ql(o,r,n);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $l=r(56),ef=r.n($l),tf=r(57),rf=r.n(tf),nf=r(58),af=r.n(nf);function of(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Math.max(6378137,6378137,6356752.314245179);function sf(e){return e}new Ot;function uf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:sf;return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function cf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return uf(e,t,rt._cartographicRadians?sf:at)}function lf(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:sf;return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function ff(e,t){return lf(e,t,rt._cartographicRadians?sf:ot)}var hf=new Ot,df=new Ot,pf=new Ot;var vf=new Ot,yf={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"}},gf={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},mf={east:new Ot,north:new Ot,up:new Ot,west:new Ot,south:new Ot,down:new Ot},bf=new Ot,Af=new Ot,Bf=new Ot;function wf(e,t,r,n,i,a){var o,s,u,c=yf[t]&&yf[t][r];$e(c&&(!n||n===c));var l=vf.copy(i);if(lt(l.x,0,1e-14)&&lt(l.y,0,1e-14)){var f=Math.sign(l.z);o=bf.fromArray(gf[t]),"east"!==t&&"west"!==t&&o.scale(f),s=Af.fromArray(gf[r]),"east"!==r&&"west"!==r&&s.scale(f),u=Bf.fromArray(gf[n]),"east"!==n&&"west"!==n&&u.scale(f)}else{var h=mf.up,d=mf.east,p=mf.north;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,h),p.copy(h).cross(d);var v=mf.west,y=mf.south;mf.down.copy(h).scale(-1),v.copy(d).scale(-1),y.copy(p).scale(-1),o=mf[t],s=mf[r],u=mf[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 _f=new Ot,xf=new Ot,Cf=new Ot,Of=new Ot,Ef=new Ot,Tf=new Ot,Sf=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;rf()(this,e),of(this,"radii",void 0),of(this,"radiiSquared",void 0),of(this,"radiiToTheFourth",void 0),of(this,"oneOverRadii",void 0),of(this,"oneOverRadiiSquared",void 0),of(this,"minimumRadius",void 0),of(this,"maximumRadius",void 0),of(this,"centerToleranceSquared",Yr),of(this,"squaredXOverSquaredZ",void 0),$e(t>=0),$e(r>=0),$e(n>=0),this.radii=new Ot(t,r,n),this.radiiSquared=new Ot(t*t,r*r,n*n),this.radiiToTheFourth=new Ot(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new Ot(0===t?0:1/t,0===r?0:1/r,0===n?0:1/n),this.oneOverRadiiSquared=new Ot(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),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return af()(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=xf,n=Cf,i=ef()(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];Tf.from(e);var r=this.scaleToGeodeticSurface(Tf,Of);if(r){var n=this.geodeticSurfaceNormal(r,xf),i=Ef;i.copy(Tf).subtract(r);var a=Math.atan2(n.y,n.x),o=Math.asin(n.z),s=Math.sign(pe(i,Tf))*he(i);return ff([a,o,s],t)}}},{key:"eastNorthUpToFixedFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Qr;return wf(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 Qr;return wf(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 _f.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=cf(e),n=r[0],i=r[1],a=Math.cos(i);return _f.set(a*Math.cos(n),a*Math.sin(n),Math.sin(i)).normalize(),_f.to(t)}},{key:"geodeticSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return _f.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]:[],n=t.oneOverRadii,i=t.oneOverRadiiSquared,a=t.centerToleranceSquared;hf.from(e);var o=hf.x,s=hf.y,u=hf.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,v=h+d+p,y=Math.sqrt(1/v);if(Number.isFinite(y)){var g=df;if(g.copy(e).scale(y),v<a)return g.to(r);var m=i.x,b=i.y,A=i.z,B=pf;B.set(g.x*m*2,g.y*b*2,g.z*A*2);var w,_,x,C,O=(1-y)*hf.len()/(.5*B.len()),E=0;do{var T=(w=1/(1+(O-=E)*m))*w,S=(_=1/(1+O*b))*_,k=(x=1/(1+O*A))*x,M=T*w,I=S*_,R=k*x,P=h*M*m+d*I*b+p*R*A,F=-2*P;E=(C=h*T+d*S+p*k-1)/F}while(Math.abs(C)>$r);return hf.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];Of.from(e);var r=Of.x,n=Of.y,i=Of.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*a.x+n*n*a.y+i*i*a.z);return Of.multiplyScalar(o).to(t)}},{key:"transformPositionToScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Of.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 Of.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];$e(lt(this.radii.x,this.radii.y,en)),$e(this.radii.z>0),Of.from(e);var n=Of.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Of.set(0,0,n).to(r)}}]),e}();of(Sf,"WGS84",new Sf(6378137,6378137,6356752.314245179));var kf=function e(t,r,n){h()(this,e),Gn(this,"item",void 0),Gn(this,"previous",void 0),Gn(this,"next",void 0),this.item=t,this.previous=r,this.next=n},Mf=function(){function e(){h()(this,e),Gn(this,"head",null),Gn(this,"tail",null),Gn(this,"_length",0)}return C()(e,[{key:"length",get:function(){return this._length}},{key:"add",value:function(e){var t=new kf(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 If(e){return null!=e}var Rf=function(){function e(){h()(this,e),Gn(this,"_list",void 0),Gn(this,"_sentinel",void 0),Gn(this,"_trimTiles",void 0),this._list=new Mf,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return C()(e,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(e){var t=e._cacheNode;If(t)&&this._list.splice(this._sentinel,t)}},{key:"add",value:function(e,t,r){If(t._cacheNode)||(t._cacheNode=this._list.add(t),r&&r(e,t))}},{key:"unloadTile",value:function(e,t,r){var n=t._cacheNode;If(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}();function Pf(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 Ff(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 Ff(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 Ff(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 Df=new Ot,Lf=new Ot,jf=new Hr([new Fr,new Fr,new Fr,new Fr,new Fr,new Fr]);function Gf(e,t){var r=e.cameraDirection,n=e.cameraUp,i=e.height,a=e.distanceScales.metersPerUnit,o=e.unprojectPosition(e.center),s=Sf.WGS84.cartographicToCartesian(o,new Ot),u=Sf.WGS84.eastNorthUpToFixedFrame(s),c=e.unprojectPosition(e.cameraPosition),l=Sf.WGS84.cartographicToCartesian(c,new Ot),f=new Ot(u.transformAsVector(new Ot(r).scale(a))).normalize(),h=new Ot(u.transformAsVector(new Ot(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);Lf.copy(a.normal).scale(a.distance-o).add(e.center);var s=e.unprojectPosition(Lf),u=Sf.WGS84.cartographicToCartesian(s,new Ot);jf.planes[n++].fromPointNormal(u,Df.copy(t).subtract(u))}}(e,s),{camera:{position:l,direction:f,up:h},viewport:e,topDownViewport:new(0,e.constructor)({longitude:e.longitude,latitude:e.latitude,height:i,width:e.width,bearing:e.bearing,zoom:e.zoom,pitch:0}),height:i,cullingVolume:jf,frameNumber:t,sseDenominator:1.15}}var Uf=new Ot;function Nf(e,t){if(e instanceof Ir){var r=function(e){e.getColumn(0,Uf);var t=e.getColumn(1),r=e.getColumn(2);return Uf.add(t).add(r).len()}(e.halfAxes);return Math.log2(6356752.314245179/(r+t[2]))}if(e instanceof It){var n=e.radius;return Math.log2(6356752.314245179/(n+t[2]))}if(e.width&&e.height){var i=e.width,a=e.height;return(Math.log2(6378137/i)+Math.log2(6378137/a))/2}return 1}function Hf(e,t,r){var n=Sf.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new Ot),i=Math.sqrt(Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2)+Math.pow(n[2]-r[2],2));return Math.log2(6356752.314245179/(i+t[2]))}var Jf=0,Vf=1,zf=3,Kf=4,qf=5,Qf=1,Xf=2,Wf="empty",Zf="scenegraph",Yf="pointcloud",$f="mesh",eh="I3S",th="TILES3D",rh="geometricError",nh=1;function ih(e){return null!=e}var ah=new Ot,oh=new Ot,sh=new Ot;function uh(e,t,r){if(ru(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,r){var n=new Ot(e[0],e[1],e[2]);t.transform(n,n);var i=[];if(10===e.length){var a=e.slice(3,6),o=new vr;o.fromArray(e,6);var s=new Ot([1,0,0]),u=new Ot([0,1,0]),c=new Ot([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(Le()(s.toArray()),Le()(u.toArray()),Le()(c.toArray()))}else i=[].concat(Le()(e.slice(3,6)),Le()(e.slice(6,9)),Le()(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 zt([l[0],l[1],l[2],f[0],f[1],f[2],h[0],h[1],h[2]]);if(ih(r))return r.center=n,r.halfAxes=d,r;return new Ir(n,d)}(e.box,t,r);if(e.region){var n=M()(e.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5],l=Sf.WGS84.cartographicToCartesian([st(i),st(s),u],oh),f=Sf.WGS84.cartographicToCartesian([st(o),st(a),c],sh),h=(new Ot).addVectors(l,f).multiplyScalar(.5),d=(new Ot).subVectors(l,f).len()/2;return ch([h[0],h[1],h[2],d],new Qr)}if(e.sphere)return ch(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function ch(e,t,r){var n=new Ot(e[0],e[1],e[2]);t.transform(n,n);var i=t.getScale(ah),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return ih(r)?(r.center=n,r.radius=o,r):new It(n,o)}new Ot,new Ot,new Qr,new Ot,new Ot,new Ot;function lh(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 fh=new Ot,hh=new Ot,dh=new Ot,ph=new Ot,vh=new Ot,yh=new Qr,gh=new Qr;function mh(e,t){var r=t.topDownViewport,n=e.header.mbs[1],i=e.header.mbs[0],a=e.header.mbs[2],o=e.header.mbs[3],s=Le()(e.boundingVolume.center),u=r.unprojectPosition(r.cameraPosition);Sf.WGS84.cartographicToCartesian(u,fh),hh.copy(fh).subtract(s).normalize(),Sf.WGS84.eastNorthUpToFixedFrame(s,yh),gh.copy(yh).invert(),dh.copy(fh).transform(gh);var c=Math.sqrt(dh[0]*dh[0]+dh[1]*dh[1]),l=c*c/dh[2];ph.copy([dh[0],dh[1],l]);var f=ph.transform(yh).subtract(s).normalize(),h=hh.cross(f).normalize().scale(o).add(s),d=Sf.WGS84.cartesianToCartographic(h),p=r.project([i,n,a]),v=r.project(d);return vh.copy(p).subtract(v).magnitude()}var bh=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;h()(this,e),Gn(this,"_map",new Map),Gn(this,"_array",void 0),Gn(this,"_length",void 0),this._array=new Array(t),this._length=t}return C()(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 ru(e<this._array.length),this._array[e]}},{key:"set",value:function(e,t){ru(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){ru(e>=0),e>this._array.length&&(this._array.length=e)}},{key:"resize",value:function(e){ru(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 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 Bh(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 Bh(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 Bh(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 wh(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 _h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xh={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Ch=function(){function e(t){h()(this,e),Gn(this,"options",void 0),Gn(this,"root",void 0),Gn(this,"requestedTiles",void 0),Gn(this,"selectedTiles",void 0),Gn(this,"emptyTiles",void 0),Gn(this,"lastUpdate",(new Date).getTime()),Gn(this,"updateDebounceTime",1e3),Gn(this,"_traversalStack",void 0),Gn(this,"_emptyTraversalStack",void 0),Gn(this,"_frameNumber",void 0),this.options=_h(_h({},xh),t),this._traversalStack=new bh,this._emptyTraversalStack=new bh,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return C()(e,[{key:"traversalFinished",get:function(){return!0}},{key:"traverse",value:function(e,t,r){this.root=e,this.options=_h(_h({},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===Qf?(this.loadTile(n,t),this.selectTile(n,t)):n.refine===Xf&&(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}var u=(new Date).getTime();(this.traversalFinished||u-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=u,this.options.onTraversalEnd(t))}},{key:"updateChildTiles",value:function(e,t){var r,n=Ah(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===Xf&&e.hasRenderContent&&!o,l=!1,f=!0,h=Ah(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=Ah(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=Ah(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 Oh(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 Eh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Oh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Th=new Ot;var Sh=function(){function e(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";h()(this,e),Gn(this,"tileset",void 0),Gn(this,"header",void 0),Gn(this,"id",void 0),Gn(this,"url",void 0),Gn(this,"parent",void 0),Gn(this,"refine",void 0),Gn(this,"type",void 0),Gn(this,"contentUrl",void 0),Gn(this,"lodMetricType",void 0),Gn(this,"lodMetricValue",void 0),Gn(this,"boundingVolume",void 0),Gn(this,"content",void 0),Gn(this,"contentState",void 0),Gn(this,"gpuMemoryUsageInBytes",void 0),Gn(this,"children",void 0),Gn(this,"depth",void 0),Gn(this,"viewportIds",void 0),Gn(this,"transform",void 0),Gn(this,"extensions",void 0),Gn(this,"userData",void 0),Gn(this,"computedTransform",void 0),Gn(this,"hasEmptyContent",void 0),Gn(this,"hasTilesetContent",void 0),Gn(this,"traverser",void 0),Gn(this,"_cacheNode",void 0),Gn(this,"_frameNumber",void 0),Gn(this,"_lodJudge",void 0),Gn(this,"_expireDate",void 0),Gn(this,"_expiredContent",void 0),Gn(this,"_shouldRefine",void 0),Gn(this,"_distanceToCamera",void 0),Gn(this,"_centerZDepth",void 0),Gn(this,"_screenSpaceError",void 0),Gn(this,"_visibilityPlaneMask",void 0),Gn(this,"_visible",void 0),Gn(this,"_inRequestVolume",void 0),Gn(this,"_stackLength",void 0),Gn(this,"_selectionDepth",void 0),Gn(this,"_touchedFrame",void 0),Gn(this,"_visitedFrame",void 0),Gn(this,"_selectedFrame",void 0),Gn(this,"_requestedFrame",void 0),Gn(this,"_priority",void 0),Gn(this,"_contentBoundingVolume",void 0),Gn(this,"_viewerRequestVolume",void 0),Gn(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=Jf,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 Ch({}),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 Qr,this.transform=new Qr,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 C()(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===zf||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===Jf}},{key:"contentExpired",get:function(){return this.contentState===Kf}},{key:"contentFailed",get:function(){return this.contentState===qf}},{key:"getScreenSpaceError",value:function(e,t){switch(this.tileset.type){case eh:return mh(this,e);case th: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-=lh(n,o)}(this,e,t);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getPriority",value:function(){var e=this.tileset._traverser,t=e.options.skipLevelOfDetail,r=this.refine===Qf||t;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Jf)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=Ie()(Pe.a.mark((function e(){var t,r,n,i;return Pe.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=Vf,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=Jf,e.abrupt("return",!1);case 13:return e.prev=13,r=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,i=Eh(Eh({},this.tileset.loadOptions),{},A()({},n.id,Eh(Eh({},this.tileset.loadOptions[n.id]),{},{isTileset:"json"===this.type},this._getLoaderSpecificOptions(n.id)))),e.next=19,Zl(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=zf,this._onContentLoaded(),e.abrupt("return",!0);case 29:throw e.prev=29,e.t0=e.catch(13),this.contentState=qf,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=Jf,!0}},{key:"updateVisibility",value:function(e,t){if(this._frameNumber!==e.frameNumber){var r=this.parent,n=r?r._visibilityPlaneMask:Hr.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!==Hr.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 Th.subVectors(r.center,t.position),t.direction.dot(Th)}},{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=Kf,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 Qr(e.transform):new Qr;var t=this.parent,r=this.tileset,n=t&&t.computedTransform?t.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new Qr(n).multiplyRight(this.transform);var i=t&&t._initialTransform?t._initialTransform.clone():new Qr;this._initialTransform=new Qr(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=Jf,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=Hr.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||Xf}},{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=uh(e.boundingVolume,this.computedTransform,this.boundingVolume);var t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=uh(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=uh(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Qr,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 Eh(Eh({},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 kh(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 y()(this,r)}}var Mh=function(e){p()(r,e);var t=kh(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(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(oi()(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===Xf,o=e._optimChildrenWithinParent===nh;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!==Qf)&&!this.shouldRefine(e,t,!0)}}]),r}(Ch),Ih=function(){function e(){h()(this,e),Gn(this,"frameNumberMap",new Map)}return C()(e,[{key:"register",value:function(e){var t=this.frameNumberMap.get(e)||0;this.frameNumberMap.set(e,t+1)}},{key:"deregister",value:function(e){var t=this.frameNumberMap.get(e)||1;this.frameNumberMap.set(e,t-1)}},{key:"isZero",value:function(e){return 0===(this.frameNumberMap.get(e)||0)}}]),e}(),Rh="REQUESTED",Ph="COMPLETED",Fh="ERROR",Dh=function(){function e(){h()(this,e),Gn(this,"_statusMap",void 0),Gn(this,"pendingTilesRegister",new Ih),this._statusMap={}}return C()(e,[{key:"add",value:function(e,t,r,n){var i=this;if(!this._statusMap[t]){var a=n.frameNumber;this._statusMap[t]={request:e,callback:r,key:t,frameState:n,status:Rh},this.pendingTilesRegister.register(a),e().then((function(e){i._statusMap[t].status=Ph;var r=i._statusMap[t].frameState.frameNumber;i.pendingTilesRegister.deregister(r),i._statusMap[t].callback(e,n)})).catch((function(e){i._statusMap[t].status=Fh;var n=i._statusMap[t].frameState.frameNumber;i.pendingTilesRegister.deregister(n),r(e)}))}}},{key:"update",value:function(e,t){this._statusMap[e]&&(this.pendingTilesRegister.deregister(this._statusMap[e].frameState.frameNumber),this.pendingTilesRegister.register(t.frameNumber),this._statusMap[e].frameState=t)}},{key:"find",value:function(e){return this._statusMap[e]}},{key:"hasPendingTiles",value:function(e){return!this.pendingTilesRegister.isZero(e)}}]),e}();function Lh(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 jh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gh(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 Uh(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 Uh(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 Uh(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 Nh(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 y()(this,r)}}var Hh=function(e){p()(n,e);var t,r=Nh(n);function n(e){var t;return h()(this,n),t=r.call(this,e),Gn(gi()(t),"_tileManager",void 0),t._tileManager=new Dh,t}return C()(n,[{key:"traversalFinished",get:function(){return!this._tileManager.hasPendingTiles(this._frameNumber||0)}},{key:"shouldRefine",value:function(e,t){return e._lodJudge=function(e,t){if(0===e.lodMetricValue||isNaN(e.lodMetricValue))return"DIG";var r=2*mh(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=Gh(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=Ie()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.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=jh(jh({},r.loadOptions),{},{i3s:jh(jh({},r.loadOptions.i3s),{},{isTileHeader:!0,loadContent:!1})}),e.next=5,Zl(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 Sh(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.traversalFinished||(new Date).getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(n,i)}}]),n}(Ch);function Jh(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 Vh(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 Vh(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 Vh(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 zh(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 Kh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qh={description:"",ellipsoid:Sf.WGS84,modelMatrix:new Qr,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,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:{}},Qh="Tiles In Tileset(s)",Xh=function(){function e(t,r){h()(this,e),Gn(this,"options",void 0),Gn(this,"loadOptions",void 0),Gn(this,"type",void 0),Gn(this,"tileset",void 0),Gn(this,"loader",void 0),Gn(this,"url",void 0),Gn(this,"basePath",void 0),Gn(this,"modelMatrix",void 0),Gn(this,"ellipsoid",void 0),Gn(this,"lodMetricType",void 0),Gn(this,"lodMetricValue",void 0),Gn(this,"refine",void 0),Gn(this,"root",void 0),Gn(this,"roots",void 0),Gn(this,"asset",void 0),Gn(this,"description",void 0),Gn(this,"properties",void 0),Gn(this,"extras",void 0),Gn(this,"attributions",void 0),Gn(this,"credits",void 0),Gn(this,"stats",void 0),Gn(this,"traverseCounter",void 0),Gn(this,"geometricError",void 0),Gn(this,"selectedTiles",void 0),Gn(this,"updatePromise",null),Gn(this,"tilesetInitializationPromise",void 0),Gn(this,"cartographicCenter",void 0),Gn(this,"cartesianCenter",void 0),Gn(this,"zoom",void 0),Gn(this,"boundingVolume",void 0),Gn(this,"gpuMemoryUsageInBytes",void 0),Gn(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Gn(this,"_traverser",void 0),Gn(this,"_cache",void 0),Gn(this,"_requestScheduler",void 0),Gn(this,"_frameNumber",void 0),Gn(this,"_queryParamsString",void 0),Gn(this,"_queryParams",void 0),Gn(this,"_extensionsUsed",void 0),Gn(this,"_tiles",void 0),Gn(this,"_pendingCount",void 0),Gn(this,"lastUpdatedVieports",void 0),Gn(this,"_requestedTiles",void 0),Gn(this,"_emptyTiles",void 0),Gn(this,"frameStateData",void 0),Gn(this,"maximumMemoryUsage",void 0),ru(t),this.options=Kh(Kh({},qh),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 Rf,this._requestScheduler=new qn({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 Hn({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.tilesetInitializationPromise=this._initializeTileSet(t)}var t,r,i;return C()(e,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}},{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=Kh(Kh({},this.options),e)}},{key:"setOptions",value:function(e){this.options=Kh(Kh({},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(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((function(){!t&&e.lastUpdatedVieports?t=e.lastUpdatedVieports:e.lastUpdatedVieports=t,e.doUpdate(t)}))}},{key:"selectTiles",value:(i=Ie()(Pe.a.mark((function e(){var t,r=this,n=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:null,e.next=3,this.tilesetInitializationPromise;case 3:return t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise((function(e){setTimeout((function(){r.doUpdate(r.lastUpdatedVieports),e(r._frameNumber),r.updatePromise=null}),r.options.debounceTime)}))),e.abrupt("return",this.updatePromise);case 6:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"doUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if((!("loadTiles"in this.options)||this.options.loadTiles)&&!(this.traverseCounter>0)){e instanceof Array||(e=[e]),this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;var t,r=[],n=Jh(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,a=i.id;this._needTraverse(a)?r.push(a):this.traverseCounter--}}catch(e){n.e(e)}finally{n.f()}var o,s=Jh(e);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=u.id;if(this.roots[c]||(this.roots[c]=this._initializeTileHeaders(this.tileset,null)),r.includes(c)){var l=Gf(u,this._frameNumber);this._traverser.traverse(this.roots[c],l,this.options)}}}catch(e){s.e(e)}finally{s.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=function(e,t,r){if(0===r||e.length<=r)return[e,[]];var n,i=[],a=t.viewport,o=a.longitude,s=a.latitude,u=Pf(e.entries());try{for(u.s();!(n=u.n()).done;){var c=M()(n.value,2),l=c[0],f=c[1],h=M()(f.header.mbs,2),d=h[0],p=h[1],v=Math.abs(o-d),y=Math.abs(s-p),g=Math.sqrt(y*y+v*v);i.push([l,g])}}catch(e){u.e(e)}finally{u.f()}for(var m=i.sort((function(e,t){return e[1]-t[1]})),b=[],A=0;A<r;A++)b.push(e[m[A][0]]);for(var B=[],w=r;w<m.length;w++)B.push(e[m[w][0]]);return[b,B]}(Object.values(this._traverser.selectedTiles),e,this.options.maximumTilesSelected),i=M()(n,2),a=i[0],o=i[1];r.selectedTiles=a;var s,u=Jh(o);try{for(u.s();!(s=u.n()).done;){s.value.unselect()}}catch(e){u.e(e)}finally{u.f()}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=Jh(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=Jh(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=Jh(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:r+=i.content.vertexCount)}}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/Vertices").count=r}},{key:"_initializeTileSet",value:(r=Ie()(Pe.a.mark((function e(t){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.type!==eh){e.next=5;break}return this.calculateViewPropsI3S(),e.next=4,t.root;case 4:t.root=e.sent;case 5:this.root=this._initializeTileHeaders(t,null),this.type===th&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===eh&&this._initializeI3STileset();case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"calculateViewPropsI3S",value:function(){var e,t=this.tileset.fullExtent;if(t){var r=t.xmin,n=t.xmax,i=t.ymin,a=t.ymax,o=t.zmin,s=t.zmax;return this.cartographicCenter=new Ot(r+(n-r)/2,i+(a-i)/2,o+(s-o)/2),this.cartesianCenter=Sf.WGS84.cartographicToCartesian(this.cartographicCenter,new Ot),void(this.zoom=Hf(t,this.cartographicCenter,this.cartesianCenter))}var u=null===(e=this.tileset.store)||void 0===e?void 0:e.extent;if(u){var c=M()(u,4),l=c[0],f=c[1],h=c[2],d=c[3];return this.cartographicCenter=new Ot(l+(h-l)/2,f+(d-f)/2,0),this.cartesianCenter=Sf.WGS84.cartographicToCartesian(this.cartographicCenter,new Ot),void(this.zoom=function(e,t,r){var n=M()(e,4),i=n[0],a=n[1];return Hf({xmin:i,xmax:n[2],ymin:a,ymax:n[3],zmin:0,zmax:0},t,r)}(u,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new Ot,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var e=this.root;ru(e);var t=e.boundingVolume.center;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Ot,void(this.zoom=1);this.cartographicCenter=Sf.WGS84.cartesianToCartographic(t,new Ot),this.cartesianCenter=t,this.zoom=Nf(e.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(Qh),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/Vertices","memory"),this.stats.get("Tile Memory Use","memory")}},{key:"_initializeTileHeaders",value:function(e,t){var r=new Sh(this,e.root,t);if(t&&(t.children.push(r),r.depth=t.depth+1),this.type===th){var n=[];for(n.push(r);n.length>0;){var i=n.pop();this.stats.get(Qh).incrementCount();var a,o=Jh(i.header.children||[]);try{for(o.s();!(a=o.n()).done;){var s=a.value,u=new Sh(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 th:e=Mh;break;case eh:e=Hh;break;default:e=Ch}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(e){this._destroySubtree(e)}},{key:"_loadTile",value:(t=Ie()(Pe.a.mark((function e(t){var r;return Pe.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){if(t){if(this.type===eh){var r,n,i=(null===(r=this.tileset)||void 0===r?void 0:null===(n=r.nodePagesTile)||void 0===n?void 0:n.nodesInNodePages)||0;this.stats.get(Qh).reset(),this.stats.get(Qh).addCount(i)}e&&e.content&&function(e,t){ru(e),ru(t);var r=t.rtcCenter,n=t.gltfUpAxis,i=e.computedTransform,a=e.boundingVolume.center,o=new Qr(i);switch(r&&o.translate(r),n){case"Z":break;case"Y":var s=(new Qr).rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=(new Qr).rotateY(-Math.PI/2);o=o.multiplyRight(u)}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);var c=new Ot(a);t.cartesianModelMatrix=o,t.cartesianOrigin=c;var l=Sf.WGS84.cartesianToCartographic(c,new Ot),f=Sf.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=Jh(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=Jh((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:"_initializeTiles3DTileset",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 Wh={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(Wh);function Zh(e,t,r){ru(e instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function Yh(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 $h={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:"3.2.3",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":bi()(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function ed(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 td(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 rd(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 rd(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 rd(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 nd=function(){function e(t,r){h()(this,e),Gn(this,"fields",void 0),Gn(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=td(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 C()(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=id(id(new Map,this.metadata),i.metadata)}else r=t;var a,o=Object.create(null),s=td(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=td(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 id(e,t){return new Map([].concat(Le()(e||new Map),Le()(t||new Map)))}var ad,od=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),Gn(this,"name",void 0),Gn(this,"type",void 0),Gn(this,"nullable",void 0),Gn(this,"metadata",void 0),this.name=t,this.type=r,this.nullable=n,this.metadata=i}return C()(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 sd(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 y()(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"}(ad||(ad={}));var ud=function(){function e(){h()(this,e)}return C()(e,[{key:"typeId",get:function(){return ad.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===ad.Null}},{key:"isInt",value:function(e){return e&&e.typeId===ad.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===ad.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===ad.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===ad.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===ad.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===ad.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===ad.Date}},{key:"isTime",value:function(e){return e&&e.typeId===ad.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===ad.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===ad.Interval}},{key:"isList",value:function(e){return e&&e.typeId===ad.List}},{key:"isStruct",value:function(e){return e&&e.typeId===ad.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===ad.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===ad.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===ad.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===ad.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===ad.Dictionary}}]),e}(),cd=(Symbol.toStringTag,Symbol.toStringTag,function(e,t){p()(n,e);var r=sd(n);function n(e,t){var i;return h()(this,n),i=r.call(this),Gn(gi()(i),"isSigned",void 0),Gn(gi()(i),"bitWidth",void 0),i.isSigned=e,i.bitWidth=t,i}return C()(n,[{key:"typeId",get:function(){return ad.Int}},{key:t,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(ud,Symbol.toStringTag)),ld=function(e){p()(r,e);var t=sd(r);function r(){return h()(this,r),t.call(this,!0,8)}return r}(cd),fd=function(e){p()(r,e);var t=sd(r);function r(){return h()(this,r),t.call(this,!0,16)}return r}(cd),hd=function(e){p()(r,e);var t=sd(r);function r(){return h()(this,r),t.call(this,!0,32)}return r}(cd),dd=function(e){p()(r,e);var t=sd(r);function r(){return h()(this,r),t.call(this,!1,8)}return r}(cd),pd=function(e){p()(r,e);var t=sd(r);function r(){return h()(this,r),t.call(this,!1,16)}return r}(cd),vd=function(e){p()(r,e);var t=sd(r);function r(){return h()(this,r),t.call(this,!1,32)}return r}(cd),yd=32,gd=64,md=function(e,t){p()(n,e);var r=sd(n);function n(e){var t;return h()(this,n),t=r.call(this),Gn(gi()(t),"precision",void 0),t.precision=e,t}return C()(n,[{key:"typeId",get:function(){return ad.Float}},{key:t,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(ud,Symbol.toStringTag),bd=function(e){p()(r,e);var t=sd(r);function r(){return h()(this,r),t.call(this,yd)}return r}(md),Ad=function(e){p()(r,e);var t=sd(r);function r(){return h()(this,r),t.call(this,gd)}return r}(md),Bd=(Symbol.toStringTag,Symbol.toStringTag,{DAY:0,MILLISECOND:1}),wd=(Symbol.toStringTag,{SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9}),_d=(Symbol.toStringTag,Symbol.toStringTag,{DAY_TIME:0,YEAR_MONTH:1}),xd=(Symbol.toStringTag,function(e,t){p()(n,e);var r=sd(n);function n(e,t){var i;return h()(this,n),i=r.call(this),Gn(gi()(i),"listSize",void 0),Gn(gi()(i),"children",void 0),i.listSize=e,i.children=[t],i}return C()(n,[{key:"typeId",get:function(){return ad.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}(ud,Symbol.toStringTag));Symbol.toStringTag;function Cd(e,t,r){var n=function(e){switch(e.constructor){case Int8Array:return new ld;case Uint8Array:return new dd;case Int16Array:return new fd;case Uint16Array:return new pd;case Int32Array:return new hd;case Uint32Array:return new vd;case Float32Array:return new bd;case Float64Array:return new Ad;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 od(e,new xd(t.size,new od("value",n)),!1,i)}function Od(e,t,r){var n=Td(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=Ed(o,e[o],a[o]);i.push(s)}if(r){var u=Ed("indices",r);i.push(u)}return new nd(i,n)}function Ed(e,t,r){return Cd(e,t,r?Td(r.metadata):void 0)}function Td(e){var t=new Map;for(var r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}function Sd(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 kd(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 kd(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 kd(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 Md(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 Id(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Md(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Md(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Rd={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Pd={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Fd=function(){function e(t){h()(this,e),Gn(this,"draco",void 0),Gn(this,"decoder",void 0),Gn(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return C()(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=ed(u.attributes),l=Od(u.attributes,s,u.indices),f=Id(Id({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=Pd[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=M()(i[n],2),o=a[0];if(a[1]===r)return o}var s=e.attribute_type;for(var u in Rd){if(this.draco[u]===s)return Rd[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=Sd([].concat(Le()(n),Le()(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 Dd=r(28),Ld={};function jd(e){return Gd.apply(this,arguments)}function Gd(){return(Gd=Ie()(Pe.a.mark((function e(t){var r,n,i=arguments;return Pe.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=Ud(t,r,n)),Ld[t]=Ld[t]||Nd(t),e.next=6,Ld[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ud(e,t,r){if(e.startsWith("http"))return e;var n=r.modules||{};return n[e]?n[e]:Yu?r.CDN?(Qu(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.2.3","/dist/libs/").concat(e)):$u?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function Nd(e){return Hd.apply(this,arguments)}function Hd(){return(Hd=Ie()(Pe.a.mark((function e(t){var r,n,i;return Pe.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(Yu){e.next=20;break}if(e.prev=8,e.t0=Dd&&Dd.requireFromFile,!e.t0){e.next=14;break}return e.next=13,Dd.requireFromFile(t);case 13:e.t0=e.sent;case 14:return e.abrupt("return",e.t0);case 17:return e.prev=17,e.t1=e.catch(8),e.abrupt("return",null);case 20:if(!$u){e.next=22;break}return e.abrupt("return",importScripts(t));case 22:return e.next=24,fetch(t);case 24:return n=e.sent,e.next=27,n.text();case 27:return i=e.sent,e.abrupt("return",Jd(i,t));case 29:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}function Jd(e,t){if(!Yu)return Dd.requireFromString&&Dd.requireFromString(e,t);if($u)return eval.call(Zu,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 Vd(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 zd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vd(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Kd,qd="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Qd="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),Xd="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 Wd(e){return Zd.apply(this,arguments)}function Zd(){return(Zd=Ie()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modules||{},Kd=r.draco3d?Kd||r.draco3d.createDecoderModule({}).then((function(e){return{draco:e}})):Kd||Yd(t),e.next=4,Kd;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yd(e){return $d.apply(this,arguments)}function $d(){return($d=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.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,jd(qd,"draco",t);case 5:return r=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,jd(Qd,"draco",t);case 10:return e.t2=e.sent,e.next=13,jd(Xd,"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=M()(i,2),r=a[0],n=a[1];case 21:return r=r||globalThis.DracoDecoderModule,e.next=24,ep(r,n);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ep(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(zd(zd({},r),{},{onModuleLoaded:function(e){return t({draco:e})}}))}))}function tp(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 rp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tp(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var np=rp(rp({},$h),{},{parse:function(e,t){return ip.apply(this,arguments)}});function ip(){return(ip=Ie()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Wd(r);case 2:return n=e.sent,i=n.draco,a=new Fd(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 ap,op=(ap={},A()(ap,5130,Float64Array),A()(ap,5126,Float32Array),A()(ap,5123,Uint16Array),A()(ap,5125,Uint32Array),A()(ap,5121,Uint8Array),A()(ap,5120,Int8Array),A()(ap,5122,Int16Array),A()(ap,5124,Int32Array),ap),sp={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},up=function(){function e(){h()(this,e)}return C()(e,null,[{key:"fromTypedArray",value:function(e){for(var t in e=ArrayBuffer.isView(e)?e.constructor:e,op){if(op[t]===e)return t}throw new Error("Failed to convert GL type")}},{key:"fromName",value:function(e){var t=sp[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=op[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}(),cp=function(){function e(t,r){h()(this,e),Gn(this,"json",void 0),Gn(this,"buffer",void 0),Gn(this,"featuresLength",0),Gn(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=r}return C()(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=up.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=up.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=up.createTypedArray(t,r),n[e]=i),i}}]),e}(),lp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},fp={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]]}},hp={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 dp=function(e){return void 0!==e};function pp(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;dp(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(dp(c))for(dp(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];dp(l)&&dp(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,v=getBinaryProperties(d,p,t);s[r].instances=combine(v,p)}var y=new Array(h).fill(0),g=new Uint16Array(o);for(r=0;r<o;++r)n=u[r],g[r]=y[n],++y[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)yp(e,r,stack)}(m),m}(n,r):null}function vp(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(dp(f))return f;for(var h=i[t],d=o[t],p=0;p<h;++p){var v=a[d+p];v!==t&&l.push(v)}}return null}(e,t,r):function(e,t,r){var n=!0;for(;n;){var i=r(e,t);if(dp(i))return i;var a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}(e,t,r)}}function yp(e,t,r){var n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,o=e.classIds.length;if(dp(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=dp(n)?n[t]:1,u=dp(n)?a[t]:t,c=0;c<s;++c){var l=i[u+c];l!==t&&yp(e,l,r)}r.pop(t)}}function gp(e){return null!=e}var mp=function(e,t){return e},bp={HIERARCHY:!0,extensions:!0,extras:!0},Ap=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),Gn(this,"json",void 0),Gn(this,"binary",void 0),Gn(this,"featureCount",void 0),Gn(this,"_extensions",void 0),Gn(this,"_properties",void 0),Gn(this,"_binaryProperties",void 0),Gn(this,"_hierarchy",void 0),ru(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)bp[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),a["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=pp(this,this.json,this.binary))}return C()(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),ru("string"==typeof t,t),!!this._hierarchy&&gp(vp(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return e.classes[n].name===t})))}},{key:"isExactClass",value:function(e,t){return ru("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),ru("string"==typeof t,t),gp(this._properties[t])||this._hasPropertyInHierarchy(e,t)}},{key:"getPropertyNames",value:function(e,t){var r;this._checkBatchId(e),(t=gp(t)?t:[]).length=0;var n=Object.keys(this._properties);return(r=t).push.apply(r,Le()(n)),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}},{key:"getProperty",value:function(e,t){if(this._checkBatchId(e),ru("string"==typeof t,t),this._binaryProperties){var r=this._binaryProperties[t];if(gp(r))return this._getBinaryProperty(r,e)}var n=this._properties[t];if(gp(n))return mp(n[e]);if(this._hierarchy){var i=this._getHierarchyProperty(e,t);if(gp(i))return i}}},{key:"setProperty",value:function(e,t,r){var n=this.featureCount;if(this._checkBatchId(e),ru("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];gp(a)||(this._properties[t]=new Array(n),a=this._properties[t]),a[e]=mp(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;ru(this.binary,"Property ".concat(e," requires a batch table binary.")),ru(r.type,"Property ".concat(e," requires a type."));var n=function(e,t,r,n){var i=e.componentType;ru(e.componentType);var a="string"==typeof i?up.fromName(i):i,o=lp[e.type],s=fp[e.type],u=hp[e.type];return r+=e.byteOffset,{values:up.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=vp(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return gp(e.classes[n].instances[t])}));return gp(r)}},{key:"_getPropertyNamesInHierarchy",value:function(e,t){vp(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 vp(this._hierarchy,e,(function(e,n){var i=e.classIds[n],a=e.classes[i],o=e.classIndexes[n],s=a.instances[t];return gp(s)?gp(s.typedArray)?r._getBinaryProperty(s,o):mp(s[o]):null}))}},{key:"_setHierarchyProperty",value:function(e,t,r,n){var i=this,a=vp(this._hierarchy,t,(function(e,a){var o=e.classIds[a],s=e.classes[o],u=e.classIndexes[a],c=s.instances[r];return!!gp(c)&&(ru(a===t,'Inherited property "'.concat(r,'" is read-only.')),gp(c.typedArray)?i._setBinaryProperty(c,u,n):c[u]=mp(n),!0)}));return gp(a)}}]),e}();function Bp(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 wp(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 _p(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=Zh(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=Zh(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 xp(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 Cp(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=xp(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 Op(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new Zr,new Ot,new Zr,new Zr,new Uint8Array(1);function Ep(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return ut(e,0,t)/t*2-1}function Tp(e){return e<0?-1:1}function Sp(e,t,r,n){if(Op(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=Ep(e,r),n.y=Ep(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))*Tp(i),n.y=(1-Math.abs(i))*Tp(n.y)}return n.normalize()}function kp(e,t,r){return Sp(e,t,255,r)}var Mp=new Ot;function Ip(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){for(var r=new Ot,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 Rp(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 Pp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rp(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Fp(e,t,r,n,i){return Dp.apply(this,arguments)}function Dp(){return(Dp=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Bp(t,r,n),n=wp(t,r,n),n=_p(t,r,n),Lp(t),o=jp(t),s=o.featureTable,u=o.batchTable,e.next=7,Hp(t,s,u,i,a);case 7:return Gp(t,s,i),Up(t,s,u),Np(t,s),e.abrupt("return",n);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lp(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function jp(e){var t=new cp(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 Ap(i,a,n)}return r}(e,t);return{featureTable:t,batchTable:n}}function Gp(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=Ip(e,n,r)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Up(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=Cp(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",5121,4))}function Np(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++)kp(t[2*n],t[2*n+1],Mp),Mp.toArray(r,3*n);return{type:5126,size:2,value:r}}return{type:5126,size:2,value:t}}(e,r)}}function Hp(e,t,r,n,i){return Jp.apply(this,arguments)}function Jp(){return(Jp=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h,d;return Pe.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:Pp(Pp({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},e.next=20,Vp(t,d,i,a);case 20:return e.abrupt("return",e.sent);case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vp(e,t,r,n){return zp.apply(this,arguments)}function zp(){return(zp=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,v,y,g,m,b;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.parse,delete(o=Pp(Pp({},n),{},{draco:Pp(Pp({},n.draco),{},{extraAttributes:r.batchTableProperties||{}})}))["3d-tiles"],e.next=5,a(r.buffer,np,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,v=p.range,t.quantizedVolumeScale=new Ot(v,v,v),t.quantizedVolumeOffset=new Ot(p.minValues),t.quantizedRange=(1<<p.quantizationBits)-1,t.isQuantizedDraco=!0),d&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0),y={},r.batchTableProperties)for(g=0,m=Object.keys(r.batchTableProperties);g<m.length;g++)b=m[g],s.attributes[b]&&s.attributes[b].value&&(y[b.toLowerCase()]=s.attributes[b].value);t.attributes=Pp({positions:u,colors:Cp(t,c,void 0),normals:l,batchIds:f},y);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Kp,qp,Qp="https://unpkg.com/@loaders.gl/textures@".concat("3.2.3","/dist/libs/basis_encoder.wasm"),Xp="https://unpkg.com/@loaders.gl/textures@".concat("3.2.3","/dist/libs/basis_encoder.js");function Wp(e){return Zp.apply(this,arguments)}function Zp(){return(Zp=Ie()(Pe.a.mark((function e(t){var r;return Pe.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 Kp=Kp||Yp(t),e.next=6,Kp;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yp(e){return $p.apply(this,arguments)}function $p(){return($p=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,jd("basis_transcoder.js","textures",t);case 5:return e.t1=e.sent,e.next=8,jd("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=M()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,ev(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ev(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 tv(e){return rv.apply(this,arguments)}function rv(){return(rv=Ie()(Pe.a.mark((function e(t){var r;return Pe.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 qp=qp||nv(t),e.next=6,qp;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nv(e){return iv.apply(this,arguments)}function iv(){return(iv=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,jd(Xp,"textures",t);case 5:return e.t1=e.sent,e.next=8,jd(Qp,"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=M()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,av(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function av(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 ov={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 sv(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 cv=["","WEBKIT_","MOZ_"],lv={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"},fv=null;function hv(e){if(!fv){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,fv=new Set;var t,r=sv(cv);try{for(r.s();!(t=r.n()).done;){var n=t.value;for(var i in lv)if(e&&e.getExtension("".concat(n).concat(i))){var a=lv[i];fv.add(a)}}}catch(e){r.e(e)}finally{r.f()}}return fv}new Uint8Array([0]);var dv,pv,vv,yv,gv,mv,bv,Av,Bv;(Bv=dv||(dv={}))[Bv.NONE=0]="NONE",Bv[Bv.BASISLZ=1]="BASISLZ",Bv[Bv.ZSTD=2]="ZSTD",Bv[Bv.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(pv||(pv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(vv||(vv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(yv||(yv={})),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"}(gv||(gv={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(mv||(mv={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(bv||(bv={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Av||(Av={}));var wv=[171,75,84,88,32,50,48,187,13,10,26,10];function _v(e){var t=new Uint8Array(e);return!(t.byteLength<wv.length||t[0]!==wv[0]||t[1]!==wv[1]||t[2]!==wv[2]||t[3]!==wv[3]||t[4]!==wv[4]||t[5]!==wv[5]||t[6]!==wv[6]||t[7]!==wv[7]||t[8]!==wv[8]||t[9]!==wv[9]||t[10]!==wv[10]||t[11]!==wv[11])}var xv={etc1:{basisFormat:0,compressed:!0,format:ov.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ov.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ov.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:ov.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ov.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ov.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 Cv(){return(Cv=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("auto"!==r.basis.containerFormat){e.next=11;break}if(!_v(t)){e.next=6;break}return e.next=4,tv(r);case 4:return n=e.sent,e.abrupt("return",Tv(n.KTX2File,t,r));case 6:return e.next=8,Wp(r);case 8:return i=e.sent,a=i.BasisFile,e.abrupt("return",Ov(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,tv(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",Tv(o.KTX2File,t,r));case 21:return e.abrupt("return",Ov(o.BasisFile,t,r));case 22:return e.next=24,Wp(r);case 24:return s=e.sent,u=s.BasisFile,e.abrupt("return",Ov(u,t,r));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ov(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");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(Ev(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function Ev(e,t,r,n){var i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),s=kv(n,o),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,r,l),h=new Uint8Array(f);if(!e.transcodeImage(h,t,r,l,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:h,compressed:u,format:c,hasAlpha:o}}function Tv(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var i=n.getLevels(),a=[],o=0;o<i;o++){a.push(Sv(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function Sv(e,t,r){var n=e.getImageLevelInfo(t,0,0),i=n.alphaFlag,a=n.height,o=n.width,s=kv(r,i),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,0,0,l),h=new Uint8Array(f);if(!e.transcodeImage(h,t,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:a,data:h,compressed:u,hasAlpha:i,format:c}}function kv(e,t){var r=e&&e.basis&&e.basis.format;return"auto"===r&&(r=Mv()),"object"===bi()(r)&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),xv[r]}function Mv(){var e=hv();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 Iv(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 Rv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Iv(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pv={name:"Basis",id:"basis",module:"textures",version:"3.2.3",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"}}},Fv=Rv(Rv({},Pv),{},{parse:function(e,t){return Cv.apply(this,arguments)}}),Dv=globalThis._parseImageNode,Lv="undefined"!=typeof Image,jv="undefined"!=typeof ImageBitmap,Gv=Boolean(Dv),Uv=!!Iu||Gv;function Nv(e){var t=Jv(e);if(!t)throw new Error("Not an image");return t}function Hv(e){switch(Nv(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 Jv(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"===bi()(e)&&e.data&&e.width&&e.height?"data":null}var Vv=/^data:image\/svg\+xml/,zv=/\.svg((\?|#).*)?$/;function Kv(e){return e&&(Vv.test(e)||zv.test(e))}function qv(e,t){if(Kv(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 Qv(e,t)}function Qv(e,t){if(Kv(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function Xv(e,t,r){return Wv.apply(this,arguments)}function Wv(){return(Wv=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=qv(t,n),a=self.URL||self.webkitURL,o="string"!=typeof i&&a.createObjectURL(i),e.prev=3,e.next=6,Zv(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 Zv(e,t){return Yv.apply(this,arguments)}function Yv(){return(Yv=Ie()(Pe.a.mark((function e(t,r){var n;return Pe.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 $v={},ey=!0;function ty(e,t,r){return ry.apply(this,arguments)}function ry(){return(ry=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Kv(n)){e.next=7;break}return e.next=3,Xv(t,r,n);case 3:a=e.sent,i=a,e.next=8;break;case 7:i=Qv(t,n);case 8:return o=r&&r.imagebitmap,e.next=11,ny(i,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ny(e){return iy.apply(this,arguments)}function iy(){return(iy=Ie()(Pe.a.mark((function e(t){var r,n=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ay(r=n.length>1&&void 0!==n[1]?n[1]:null)&&ey||(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),ey=!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 ay(e){for(var t in e||$v)return!1;return!0}function oy(e){var t=sy(e);return function(e){var t=sy(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=sy(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=sy(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=sy(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 sy(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 uy(e,t){return cy.apply(this,arguments)}function cy(){return(cy=Ie()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=oy(t)||{},i=n.mimeType,ru(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 ly(){return(ly=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=(r=r||{}).image||{},a=i.type||"auto",o=(n||{}).url,s=fy(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,ty(t,r,o);case 10:return u=e.sent,e.abrupt("break",21);case 12:return e.next=14,Xv(t,r,o);case 14:return u=e.sent,e.abrupt("break",21);case 16:return e.next=18,uy(t,r);case 18:return u=e.sent,e.abrupt("break",21);case 20:ru(!1);case 21:return"data"===a&&(u=Hv(u)),e.abrupt("return",u);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fy(e){switch(e){case"auto":case"data":return function(){if(jv)return"imagebitmap";if(Lv)return"image";if(Uv)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return jv||Lv||Uv;case"imagebitmap":return jv;case"image":return Lv;case"data":return Uv;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var hy={id:"image",module:"images",name:"Images",version:"3.2.3",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 ly.apply(this,arguments)},tests:[function(e){return Boolean(oy(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}};function dy(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 py(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 dy(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return dy(e,r,t)}return""}(e),'"'))}}function vy(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function yy(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 gy(e,t,r){var n=e.bufferViews[r];vy(n);var i=t[n.buffer];vy(i);var a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}function my(e,t){return ru(e>=0),ru(t>0),e+(t-1)&~(t-1)}function by(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+my(n.byteLength,4)}var Ay=["SCALAR","VEC2","VEC3","VEC4"],By=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],wy=new Map(By),_y={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},xy={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Cy={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Oy(e){return Ay[e-1]||Ay[0]}function Ey(e){var t=wy.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Ty(e,t){var r=Cy[e.componentType],n=_y[e.type],i=xy[e.componentType],a=e.count*n,o=e.count*n*i;return vy(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function Sy(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 ky(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 ky(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 ky(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,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?My(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):My(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ry,Py={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Fy=function(){function e(t){h()(this,e),Gn(this,"gltf",void 0),Gn(this,"sourceBuffers",void 0),Gn(this,"byteLength",void 0),this.gltf=t||{json:Iy({},Py),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 C()(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"===bi()(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];vy(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=Ty(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 vy(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 vy(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=oy(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;vy(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=my(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:Oy(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:Ey(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=Sy(this.sourceBuffers||[]);try{for(s.s();!(r=s.n()).done;){o=by(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=Sy(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}(),Dy=("undefined"==typeof WebAssembly||bi()(WebAssembly),"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"),Ly="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",jy=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]),Gy=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]),Uy={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Ny={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function Hy(e,t,r,n,i){return Jy.apply(this,arguments)}function Jy(){return(Jy=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u=arguments;return Pe.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,Vy();case 3:Xy(s=e.sent,s.exports[Ny[a]],t,r,n,i,s.exports[Uy[o||"NONE"]]);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vy(){return zy.apply(this,arguments)}function zy(){return(zy=Ie()(Pe.a.mark((function e(){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ry||(Ry=Ky()),e.abrupt("return",Ry);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ky(){return qy.apply(this,arguments)}function qy(){return(qy=Ie()(Pe.a.mark((function e(){var t,r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Dy,WebAssembly.validate(jy)&&(t=Ly,console.log("Warning: meshopt_decoder is using experimental SIMD support")),e.next=4,WebAssembly.instantiate(Qy(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 Qy(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?Gy[t[a]]:64*(t[a]-60)+t[++a];return t.buffer.slice(0,i)}function Xy(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 Wy(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 Zy(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 Zy(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 Zy(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 Yy="EXT_meshopt_compression";function $y(e,t){return eg.apply(this,arguments)}function eg(){return(eg=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=new Fy(t),null!=r&&null!==(n=r.gltf)&&void 0!==n&&n.decompressMeshes){e.next=3;break}return e.abrupt("return");case 3:a=[],o=Wy(t.json.bufferViews||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,a.push(tg(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 tg(e,t){return rg.apply(this,arguments)}function rg(){return(rg=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v,y;return Pe.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=n.byteOffset,a=void 0===i?0:i,o=n.byteLength,s=void 0===o?0:o,u=n.byteStride,c=n.count,l=n.mode,f=n.filter,h=void 0===f?"NONE":f,d=n.buffer,p=t.gltf.buffers[d],v=new Uint8Array(p.arrayBuffer,p.byteOffset+a,s),y=new Uint8Array(t.gltf.buffers[r.buffer].arrayBuffer,r.byteOffset,r.byteLength),e.next=8,Hy(y,c,u,v,l,h);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 ng=["image/png","image/jpeg","image/gif"],ig={};function ag(e){return void 0===ig[e]&&(ig[e]=function(e){switch(e){case"image/webp":return function(){if(!Iu)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch(e){return!1}}();case"image/svg":return Iu;default:if(!Iu){var t=globalThis._parseImageNode;return Boolean(t)&&ng.includes(e)}return!0}}(e)),ig[e]}function og(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 sg(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 sg(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 sg(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 ug="EXT_texture_webp";function cg(e,t){var r=new Fy(e);if(ag("image/webp")){var n,i=og(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 lg(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 fg(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 fg(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 fg(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 hg="KHR_texture_basisu";function dg(e,t){var r,n=new Fy(e),i=lg(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 pg(e){var t={};for(var r in e){var n=e[r];if("indices"!==r){var i=vg(n);t[r]=i}}return t}function vg(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:Oy(n),componentType:Ey(r)}}function yg(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 gg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yg(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var mg=Pe.a.mark(kg);function bg(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 Ag(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 Ag(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 Ag(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 Bg="KHR_draco_mesh_compression";function wg(e,t,r){var n,i=new Fy(e),a=bg(kg(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 _g(e,t,r){return xg.apply(this,arguments)}function xg(){return(xg=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c;return Pe.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 Fy(t),o=[],s=bg(kg(a));try{for(s.s();!(u=s.n()).done;)c=u.value,a.getObjectExtension(c,"KHR_draco_mesh_compression")&&o.push(Og(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 Cg(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Fy(e),i=bg(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value;Tg(a,r),n.addRequiredExtension("KHR_draco_mesh_compression")}}catch(e){i.e(e)}finally{i.f()}}function Og(e,t,r,n){return Eg.apply(this,arguments)}function Eg(){return(Eg=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,v,y,g,m;return Pe.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=Ic(o.buffer,o.byteOffset),u=i.parse,delete(c=gg({},n))["3d-tiles"],e.next=10,u(s,np,c,i);case 10:for(l=e.sent,f=pg(l.attributes),h=0,d=Object.entries(f);h<d.length;h++)p=M()(d[h],2),v=p[0],y=p[1],v in r.attributes&&(g=r.attributes[v],null!=(m=t.getAccessor(g))&&m.min&&null!=m&&m.max&&(y.min=m.min,y.max=m.max));r.attributes=f,l.indices&&(r.indices=vg(l.indices)),Sg(r);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tg(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:A()({},"KHR_draco_mesh_compression",{bufferView:c,attributes:u})}]};return l}function Sg(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function kg(e){var t,r,n,i,a,o;return Pe.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:t=bg(e.json.meshes||[]),s.prev=1,t.s();case 3:if((r=t.n()).done){s.next=24;break}n=r.value,i=bg(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()}}),mg,null,[[1,26,29,32],[6,16,19,22]])}function Mg(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 Ig(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 Ig(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 Ig(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 Rg="KHR_lights_punctual";function Pg(e){return Fg.apply(this,arguments)}function Fg(){return(Fg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new Fy(t),n=r.json,(i=r.getExtension("KHR_lights_punctual"))&&(r.json.lights=i.lights,r.removeExtension("KHR_lights_punctual")),a=Mg(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 Dg(e){return Lg.apply(this,arguments)}function Lg(){return(Lg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new Fy(t),(n=r.json).lights&&(vy(!(i=r.addExtension("KHR_lights_punctual")).lights),i.lights=n.lights,delete n.lights),r.json.lights){a=Mg(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 jg(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 Ug="KHR_materials_unlit";function Ng(e){return Hg.apply(this,arguments)}function Hg(){return(Hg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new Fy(t),n=r.json,r.removeExtension("KHR_materials_unlit"),i=jg(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 Jg(e){var t=new Fy(e),r=t.json;if(t.materials){var n,i=jg(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 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}var Kg="KHR_techniques_webgl";function qg(e){return Qg.apply(this,arguments)}function Qg(){return(Qg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new Fy(t),n=r.json,i=r.getExtension("KHR_techniques_webgl")){a=Zg(i,r),o=Vg(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=Yg(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 Xg(e,t){return Wg.apply(this,arguments)}function Wg(){return(Wg=Ie()(Pe.a.mark((function e(t,r){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zg(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 Yg(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"===bi()(r[e])&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))})),r}function $g(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 em(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 em(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 em(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 tm=[i,a,o,s,u,c,l];function rm(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=tm.filter((function(e){return am(e.name,r)})),a=$g(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 nm(e){return im.apply(this,arguments)}function im(){return(im=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c=arguments;return Pe.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=tm.filter((function(e){return am(e.name,r)})),a=$g(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 am(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 om(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 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=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 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,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 cm(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 cm(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 cm(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 lm,fm={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},hm={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},dm=function(){function e(){h()(this,e),Gn(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Gn(this,"json",void 0)}return C()(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 Fy(e),n=r.json,i=om(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 fm)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 fm)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var r,n=um(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=um(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=um(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=um(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=um(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=um(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=hm[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=um(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=um(e.materials);try{var n=function(){var r=t.value;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var n=(null===(i=r.values)||void 0===i?void 0:i.tex)||(null===(a=r.values)||void 0===a?void 0:a.texture2d_0),o=e.textures.findIndex((function(e){return e.id===n}));-1!==o&&(r.pbrMetallicRoughness.baseColorTexture={index:o})};for(r.s();!(t=r.n()).done;){var i,a;n()}}catch(e){r.e(e)}finally{r.f()}}}]),e}();function pm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new dm).normalize(e,t)}function vm(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 ym(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vm(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var gm={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},mm={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bm=10240,Am=10241,Bm=10242,wm=10243,_m=10497,xm=9729,Cm=9986,Om={magFilter:bm,minFilter:Am,wrapS:Bm,wrapT:wm},Em=(lm={},A()(lm,bm,xm),A()(lm,Am,Cm),A()(lm,Bm,_m),A()(lm,wm,_m),lm);var Tm=function(){function e(){h()(this,e),Gn(this,"baseUri",""),Gn(this,"json",{}),Gn(this,"buffers",[]),Gn(this,"images",[])}return C()(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 vy(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"===bi()(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=ym({},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=ym({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=ym({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=ym({},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=ym({},e.pbrMetallicRoughness);var r=e.pbrMetallicRoughness;r.baseColorTexture&&(r.baseColorTexture=ym({},r.baseColorTexture),r.baseColorTexture.texture=this.getTexture(r.baseColorTexture.index)),r.metallicRoughnessTexture&&(r.metallicRoughnessTexture=ym({},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,mm[r]),e.components=(n=e.type,gm[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var i=e.bufferView.buffer,a=Ty(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):Em,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 Om[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=ym(ym({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 Sm(e,t){return(new Tm).postProcess(e,t)}function km(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 Mm(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 Im(e,t,r){ru(e.header.byteLength>20);var n=t.getUint32(r+0,!0),i=t.getUint32(r+4,!0);return r+=8,ru(0===i),Pm(e,t,r,n),r+=n,r+=Fm(e,t,r,e.header.byteLength)}function Rm(e,t,r,n){return ru(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:Pm(e,t,r,i);break;case 5130562:Fm(e,t,r,i);break;case 0:n.strict||Pm(e,t,r,i);break;case 1:n.strict||Fm(e,t,r,i)}r+=my(i,4)}}(e,t,r,n),r+e.header.byteLength}function Pm(e,t,r,n){var i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),my(n,4)}function Fm(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),my(n,4)}function Dm(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 Lm(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 Lm(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 Lm(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 jm(e,t){return Gm.apply(this,arguments)}function Gm(){return(Gm=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d=arguments;return Pe.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,Um(t,r,n,i),pm(t,{normalize:null==i?void 0:null===(o=i.gltf)||void 0===o?void 0:o.normalize}),rm(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,Nm(t,i,a);case 10:return null!=i&&null!==(u=i.gltf)&&void 0!==u&&u.loadImages&&(f=Jm(t,i,a),l.push(f)),h=nm(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?Sm(t,i):t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Um(e,t,r,n){(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Mm(t,r,n))&&(t=(new TextDecoder).decode(t));if("string"==typeof t)e.json=py(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=km(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 Im(e,n,r);case 2:return Rm(e,n,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}(i,t,r,n.glb),vy("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else vy(!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 Nm(e,t,r){return Hm.apply(this,arguments)}function Hm(){return(Hm=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c,l,f;return Pe.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=22;break}if(!(o=i[a]).uri){e.next=18;break}return vy(n.fetch),c=yy(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,e.next=19;break;case 18:null===t.buffers[a]&&(t.buffers[a]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength});case 19:++a,e.next=2;break;case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jm(e,t,r){return Vm.apply(this,arguments)}function Vm(){return(Vm=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=zm(t),a=t.json.images||[],o=[],s=Dm(i);try{for(s.s();!(u=s.n()).done;)c=u.value,o.push(Km(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 zm(e){var t,r=new Set,n=Dm(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 Km(e,t,r,n,i){return qm.apply(this,arguments)}function qm(){return(qm=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h;return Pe.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=yy(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=gy(t.json,t.buffers,r.bufferView),u=Ic(f.buffer,f.byteOffset,f.byteLength)),vy(u,"glTF image has no data"),e.next=13,s(u,[hy,Fv],{mimeType:r.mimeType,basis:i.basis||{format:Mv()}},a);case 13:(h=e.sent)&&h[0]&&(h={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h[0]}),t.images=t.images||[],t.images[n]=h;case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qm(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 Xm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qm(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Wm={name:"glTF",id:"gltf",module:"gltf",version:"3.2.3",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(e){return Zm.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 Zm(){return(Zm=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s=arguments;return Pe.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=Xm(Xm({},Wm.options),r)).gltf=Xm(Xm({},Wm.options.gltf),r.gltf),i=r.byteOffset,a=void 0===i?0:i,o={},e.next=8,jm(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 Ym=0,$m=1;function eb(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=Ic(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 tb(e,t,r,n){return rb.apply(this,arguments)}function rb(){return(rb=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n["3d-tiles"]||{},nb(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,Wm,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 nb(e,t,r){switch(t){case Ym: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 $m:break;default:throw new Error("b3dm: Illegal glTF format field")}}function ib(e,t,r,n,i){return ab.apply(this,arguments)}function ab(){return(ab=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ob(t,r,n,i,a),e.next=3,tb(t,$m,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 ob(e,t,r,n,i){r=eb(e,t,r=_p(e,t,r=wp(e,t,r=Bp(e,t,r))),n);var a=new cp(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),r}function sb(e,t,r,n,i){return ub.apply(this,arguments)}function ub(){return(ub=Ie()(Pe.a.mark((function e(t,r,n,i,a){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=cb(t,r,n,i,a),e.next=3,tb(t,t.gltfFormat,i,a);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cb(e,t,r,n,i){if(r=Bp(e,t,r),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));r=wp(e,t,r);var a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r=eb(e,t,r=_p(e,t,r+=4),n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new cp(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 Ap(e.batchTableJson,e.batchTableBinary,s);return function(e,t,r,n){for(var i=[new Array(n),e._batchTable][0],a=new Ot,o=(new Ot,new Ot,new Ot,new zt),s=new vr,u=new Ot,c={},l=new Qr,f=[],h=[],d=new Ot,p=new Ot,v=0;v<n;v++){var y=void 0;if(t.hasProperty("POSITION"))y=t.getProperty("POSITION",5126,3,v,a);else if(t.hasProperty("POSITION_QUANTIZED")){y=t.getProperty("POSITION_QUANTIZED",5123,3,v,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++)y[b]=y[b]/65535*m[b]+g[b]}if(!y)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(y),c.translation=a,e.normalUp=t.getProperty("NORMAL_UP",5126,3,v,f),e.normalRight=t.getProperty("NORMAL_RIGHT",5126,3,v,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?(Sf.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,v);Number.isFinite(A)&&u.multiplyByScalar(A);var B=t.getProperty("SCALE_NON_UNIFORM",5126,3,v,f);B&&u.scale(B),c.scale=u;var w=t.getProperty("BATCH_ID",5123,1,v);void 0===w&&(w=v);var _=(new Qr).fromQuaternion(c.rotation);l.identity(),l.translate(c.translation),l.multiplyRight(_),l.scale(c.scale);var x=l.clone();i[v]={modelMatrix:x,batchId:w}}e.instances=i}(e,o,0,s),r}function lb(e,t,r,n,i,a){return fb.apply(this,arguments)}function fb(){return(fb=Ie()(Pe.a.mark((function e(t,r,n,i,a,o){var s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Bp(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 hb(e,t,r,n){return db.apply(this,arguments)}function db(){return(db=Ie()(Pe.a.mark((function e(t,r,n,i){var a;return Pe.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,Wm,n,i);case 5:t.gltf=e.sent;case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pb(e){return vb.apply(this,arguments)}function vb(){return(vb=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o=arguments;return Pe.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=Yh(t,r),e.t0=a.type,e.next=e.t0===Wh.COMPOSITE?9:e.t0===Wh.BATCHED_3D_MODEL?12:e.t0===Wh.GLTF?15:e.t0===Wh.INSTANCED_3D_MODEL?18:e.t0===Wh.POINT_CLOUD?21:24;break;case 9:return e.next=11,lb(a,t,r,n,i,pb);case 11:return e.abrupt("return",e.sent);case 12:return e.next=14,ib(a,t,r,n,i);case 14:return e.abrupt("return",e.sent);case 15:return e.next=17,hb(a,t,n,i);case 17:return e.abrupt("return",e.sent);case 18:return e.next=20,sb(a,t,r,n,i);case 20:return e.abrupt("return",e.sent);case 21:return e.next=23,Fp(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 yb(){return(yb=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.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=bb(t.slice(8,16)),n=new Uint8Array(t,24,r),i=new TextDecoder("utf8"),a=i.decode(n),o=JSON.parse(a),s=bb(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,gb(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,gb(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,gb(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 gb(e,t,r){return mb.apply(this,arguments)}function mb(){return(mb=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u;return Pe.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,Eu(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 bb(e){var t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+Math.pow(2,32)*n}var Ab={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.2.3",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:function(e){return yb.apply(this,arguments)},options:{}},Bb={QUADTREE:4,OCTREE:8};function wb(e){return _b.apply(this,arguments)}function _b(){return(_b=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v,y,g,m,b,A,B,w,_,x,C,O,E,T,S,k,M,I,R,P,F,D,L,j,G,U,N;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.options,n=t.parentData,i=void 0===n?{mortonIndex:0,x:0,y:0,z:0}:n,a=t.childIndex,o=void 0===a?0:a,s=t.globalData,u=void 0===s?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,c=t.subtree,l=t.level,f=void 0===l?0:l,h=r.subdivisionScheme,d=r.subtreeLevels,p=r.maximumLevel,v=r.contentUrlTemplate,y=r.subtreesUriTemplate,g=r.basePath,m={children:[],lodMetricValue:0,contentUrl:""},b=Bb[h],A=1&o,B=o>>1&1,w=o>>2&1,_=(Math.pow(b,f)-1)/(b-1),x=Ob(i.mortonIndex,o),C=_+x,O=Ob(i.x,A),E=Ob(i.y,B),T=Ob(i.z,w),S=!1,f+1>d&&(S=xb(c.childSubtreeAvailability,x)),k=Ob(u.x,O),M=Ob(u.y,E),I=Ob(u.z,T),R=f+u.level,!S){e.next=38;break}return P="".concat(g,"/").concat(y),F=Eb(P,R,k,M,I),e.next=25,Zl(F,Ab);case 25:D=e.sent,c=D,u.mortonIndex=x,u.x=O,u.y=E,u.z=T,u.level=f,x=0,C=0,O=0,E=0,T=0,f=0;case 38:if(xb(c.tileAvailability,C)&&!(f>p)){e.next=41;break}return e.abrupt("return",m);case 41:xb(c.contentAvailability,C)&&(m.contentUrl=Eb(v,R,k,M,I)),L=f+1,j={mortonIndex:x,x:O,y:E,z:T},G=0;case 46:if(!(G<b)){e.next=54;break}return e.next=49,wb({subtree:c,options:r,parentData:j,childIndex:G,level:L,globalData:u});case 49:((U=e.sent).contentUrl||U.children.length)&&(N=Cb(U,R+1,{childTileX:O,childTileY:E,childTileZ:T},r),m.children.push(N));case 51:G++,e.next=46;break;case 54:return e.abrupt("return",m);case 55:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xb(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 Cb(e,t,r,n){var i=n.basePath,a=n.refine,o=n.getRefine,s=n.lodMetricType,u=n.getTileType,c=n.rootLodMetricValue,l=n.rootBoundingVolume,f=e.contentUrl&&e.contentUrl.replace("".concat(i,"/"),""),h=c/Math.pow(2,t),d=function(e,t,r){if(t.region){var n=r.childTileX,i=r.childTileY,a=r.childTileZ,o=M()(t.region,6),s=o[0],u=o[1],c=o[2],l=o[3],f=o[4],h=o[5],d=Math.pow(2,e),p=(c-s)/d,v=(l-u)/d,y=(h-f)/d;return{region:[s+p*n,u+v*i,s+p*(n+1),u+v*(i+1),f+y*a,f+y*(a+1)]}}return console.warn("Unsupported bounding volume type: ",t),null}(t,l,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:f},id:e.contentUrl,refine:o(a),type:u(e),lodMetricType:s,lodMetricValue:h,boundingVolume:d}}function Ob(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function Eb(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 Tb(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 Sb(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 Sb(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 Sb(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 kb(e){if(!e.contentUrl)return Wf;var t=e.contentUrl.split(".").pop();switch(t){case"pnts":return Yf;case"i3dm":case"b3dm":case"glb":case"gltf":return Zf;default:return t}}function Mb(e){switch(e){case"REPLACE":case"replace":return Xf;case"ADD":case"add":return Qf;default:return e}}function Ib(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=rh,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=kb(e),e.refine=Mb(e.refine),e}function Rb(e){var t=e.basePath,r=Ib(e.root,e),n=[];for(n.push(r);n.length>0;){var i,a=Tb((n.pop()||{}).children||[]);try{for(a.s();!(i=a.n()).done;){var o=i.value;Ib(o,{basePath:t}),n.push(o)}}catch(e){a.e(e)}finally{a.f()}}return r}function Pb(e){return Fb.apply(this,arguments)}function Fb(){return(Fb=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v;return Pe.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=Eb(s,0,0,0,0),c="".concat(r,"/").concat(u),e.next=9,Zl(c,Ab);case 9:return l=e.sent,f="".concat(r,"/").concat(t.root.content.uri),h=t.root.refine,d=t.root.geometricError,p=t.root.boundingVolume,v={contentUrlTemplate:f,subtreesUriTemplate:s,subdivisionScheme:i,subtreeLevels:o,maximumLevel:a,refine:h,basePath:r,lodMetricType:rh,rootLodMetricValue:d,rootBoundingVolume:p,getTileType:kb,getRefine:Mb},e.next=17,Db(t.root,l,v);case 17:return e.abrupt("return",e.sent);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Db(e,t,r){return Lb.apply(this,arguments)}function Lb(){return(Lb=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.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=rh,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,e.next=7,wb({subtree:r,options: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=Mb(t.refine),t.type=kb(t),t.children=a,t.id=t.contentUrl,e.abrupt("return",t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jb={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.2.3",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(e,t,r){return Vb.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function Gb(e){return n.dirname(e.url)}function Ub(e,t,r){return Nb.apply(this,arguments)}function Nb(){return(Nb=Ie()(Pe.a.mark((function e(t,r,n){var i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={content:{featureIds:null}},0,e.next=4,pb(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 Hb(e,t,r){return Jb.apply(this,arguments)}function Jb(){return(Jb=Ie()(Pe.a.mark((function e(t,r,n){var i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=JSON.parse((new TextDecoder).decode(t))).loader=r.loader||jb,a.url=n.url,a.basePath=Gb(a),!zb(a)){e.next=10;break}return e.next=7,Pb(a);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=Rb(a);case 11:return a.root=e.t0,a.type=th,a.lodMetricType=rh,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 Vb(){return(Vb=Ie()(Pe.a.mark((function e(t,r,n){var i;return Pe.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,Hb(t,r,n);case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,Ub(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 zb(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 Kb(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 qb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kb(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Qb(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 y()(this,r)}}var Xb=[0],Wb={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:jb,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}},Zb=function(e){p()(n,e);var t,r=Qb(n);function n(){var e;h()(this,n);for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return e=r.call.apply(r,[this].concat(i)),A()(gi()(e),"state",void 0),e}return C()(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 null!==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=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.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:qb({},n)},!i.preload){e.next=10;break}return e.next=7,i.preload(t,n);case 7:(o=e.sent).headers&&(a.loadOptions.fetch=qb(qb({},a.loadOptions.fetch),{},{headers:o.headers})),Object.assign(a,o);case 10:return e.next=12,Zl(t,i,a.loadOptions);case 12:s=e.sent,u=new Xh(s,qb({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError: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;if(e){var r=this.state.tileset3d,n=this.context.timeline,i=Object.keys(e).length;n&&i&&r&&r.selectTiles(Object.values(e)).then((function(e){t.state.frameNumber!==e&&t.setState({frameNumber:e})}))}}},{key:"_getSubLayer",value:function(e,t){if(!e.content)return null;switch(e.type){case Yf:return this._makePointCloudLayer(e,t);case Zf:return this._make3DModelLayer(e);case $f: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||Xb,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 Mi.Geometry({drawMode:4,attributes:Yb(n),indices:i});return new(this.getSubLayerClass("mesh",Ks))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:h,data:Xb,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 Yb(e){var t={};return t.positions=qb(qb({},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}A()(Zb,"defaultProps",Wb),A()(Zb,"layerName","Tile3DLayer");var $b={name:"Terrain",id:"terrain",module:"terrain",version:"3.2.3",worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};function eA(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 y()(this,r)}}function tA(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?tA(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var nA=[1],iA=rA(rA({},ii.defaultProps),{},{elevationData:kn,texture:rA(rA({},kn),{},{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:[$b]});function aA(e){return Array.isArray(e)?e.join(";"):e}var oA,sA=function(e){p()(r,e);var t=eA(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(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=rA(rA({},s),{},{terrain:rA(rA({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=In(r,e),c=In(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]],v=this.loadTerrain({elevationData:u,bounds:p,elevationDecoder:a,meshMaxError:o,signal:f}),y=c?n(c,{propName:"texture",layer:this,loaders:[],signal:f}).catch((function(e){return null})):Promise.resolve(null);return Promise.all([v,y])}},{key:"renderSubLayers",value:function(e){var t=this.getSubLayerClass("mesh",B.SimpleMeshLayer),r=e.data,n=e.color;if(!r)return null;var i=M()(r,2),a=i[0],o=i[1];return new t(e,{data:nA,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,Le()(r.map((function(e){return e[0]})))),i=Math.max.apply(Math,Le()(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,v=e.onTileError,y=e.maxCacheSize,g=e.maxCacheByteSize,m=e.refinementStrategy;return this.state.isTiled?new ii(this.getSubLayerProps({id:"tiles"}),{wireframe:a,color:t,material:r,getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:aA(n),texture:aA(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:v,maxCacheSize:y,maxCacheByteSize:g,refinementStrategy:m}):new(this.getSubLayerClass("mesh",B.SimpleMeshLayer))(this.getSubLayerProps({id:"mesh"}),{data:nA,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 uA(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}sA.layerName="TerrainLayer",sA.defaultProps=iA,function(e){e[e.CLOCKWISE=1]="CLOCKWISE",e[e.COUNTER_CLOCKWISE=-1]="COUNTER_CLOCKWISE"}(oA||(oA={}));function cA(e,t,r,n,i,a){var o,s;if(void 0===a&&(a=uA(e,{start:t,end:r,size:n})),i===a<0)for(o=t;o<r;o+=n)s=MA(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=MA(o,e[o],e[o+1],s);return s&&CA(s,s.next)&&(IA(s),s=s.next),s}function lA(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!CA(n,n.next)&&0!==xA(n.prev,n,n.next))n=n.next;else{if(IA(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function fA(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=AA(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?dA(e,n,i,a):hA(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),IA(e),e=u.next,c=u.next;else if((e=u)===c){o?1===o?fA(e=pA(lA(e),t,r),t,r,n,i,a,2):2===o&&vA(e,t,r,n,i,a):fA(lA(e),t,r,n,i,a,1);break}}}function hA(e){var t=e.prev,r=e,n=e.next;if(xA(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(wA(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&xA(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function dA(e,t,r,n){var i=e.prev,a=e,o=e.next;if(xA(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=AA(s,u,t,r,n),h=AA(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&&wA(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xA(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&wA(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xA(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&wA(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xA(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&wA(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xA(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function pA(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!CA(i,a)&&OA(i,n,n.next,a)&&SA(i,a)&&SA(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),IA(n),IA(n.next),n=e=a),n=n.next}while(n!==e);return lA(n)}function vA(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&_A(o,s)){var u=kA(o,s);return o=lA(o,o.next),u=lA(u,u.next),fA(o,t,r,n,i,a),void fA(u,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function yA(e,t,r,n,i){var a,o,s,u=[];for(a=0,o=t.length;a<o;a++)(s=cA(e,t[a]*n,a<o-1?t[a+1]*n:e.length,n,!1,i&&i[a+1]))===s.next&&(s.steiner=!0),u.push(BA(s));for(u.sort(gA),a=0;a<u.length;a++)mA(u[a],r),r=lA(r,r.next);return r}function gA(e,t){return e.x-t.x}function mA(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&&wA(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),SA(n,e)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&bA(r,n)))&&(r=n,h=u)),n=n.next}while(n!==c);return r}(e,t)){var r=kA(t,e);lA(t,t.next),lA(r,r.next)}}function bA(e,t){return xA(e.prev,e,t.prev)<0&&xA(t.next,e,e.next)<0}function AA(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 BA(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 wA(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 _A(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&&OA(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(SA(e,t)&&SA(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)&&(xA(e.prev,e,t.prev)||xA(e,t.prev,t))||CA(e,t)&&xA(e.prev,e,e.next)>0&&xA(t.prev,t,t.next)>0)}function xA(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function CA(e,t){return e.x===t.x&&e.y===t.y}function OA(e,t,r,n){var i=TA(xA(e,t,r)),a=TA(xA(e,t,n)),o=TA(xA(r,n,e)),s=TA(xA(r,n,t));return i!==a&&o!==s||(!(0!==i||!EA(e,r,t))||(!(0!==a||!EA(e,n,t))||(!(0!==o||!EA(r,e,n))||!(0!==s||!EA(r,t,n)))))}function EA(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 TA(e){return e>0?1:e<0?-1:0}function SA(e,t){return xA(e.prev,e,e.next)<0?xA(e,t,e.next)>=0&&xA(e,e.prev,t)>=0:xA(e,t,e.prev)<0||xA(e,e.next,t)<0}function kA(e,t){var r=new RA(e.i,e.x,e.y),n=new RA(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 MA(e,t,r,n){var i=new RA(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 IA(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 RA(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}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 FA(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 FA(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 FA(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=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){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?DA(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jA(e,t,r){var n=GA(e),i=Object.keys(n).filter((function(e){return n[e]!==Array}));return function(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=t.propArrayTypes,d=t.coordLength,p=r.numericPropKeys,v=void 0===p?[]:p,y=r.PositionDataType,g=void 0===y?Float32Array:y,m=(e[0]&&"id"in e[0]),b=e.length>65535?Uint32Array:Uint16Array,A={type:"Point",positions:new g(n*d),globalFeatureIds:new b(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},B={type:"LineString",pathIndices:a>65535?new Uint32Array(o+1):new Uint16Array(o+1),positions:new g(a*d),globalFeatureIds:new b(a),featureIds:s>65535?new Uint32Array(a):new Uint16Array(a),numericProps:{},properties:[],fields:[]},w={type:"Polygon",polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new g(u*d),triangles:[],globalFeatureIds:new b(u),featureIds:f>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]},_=0,x=[A,B,w];_<x.length;_++){var C,O=x[_],E=PA(v);try{for(E.s();!(C=E.n()).done;){var T=C.value,S=h[T];O.numericProps[T]=new S(O.positions.length/d)}}catch(e){E.e(e)}finally{E.f()}}B.pathIndices[o]=a,w.polygonIndices[c]=u,w.primitivePolygonIndices[l]=u;var k,M={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},I=PA(e);try{for(I.s();!(k=I.n()).done;){var R=k.value,P=R.geometry,F=R.properties||{};switch(P.type){case"Point":UA(P,A,M,d,F),A.properties.push(KA(F,v)),m&&A.fields.push({id:R.id}),M.pointFeature++;break;case"LineString":NA(P,B,M,d,F),B.properties.push(KA(F,v)),m&&B.fields.push({id:R.id}),M.lineFeature++;break;case"Polygon":HA(P,w,M,d,F),w.properties.push(KA(F,v)),m&&w.fields.push({id:R.id}),M.polygonFeature++;break;default:throw new Error("Invalid geometry type")}M.feature++}}catch(e){I.e(e)}finally{I.f()}return function(e,t,r,n){return{points:LA(LA({},e),{},{positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:VA(e.numericProps,1)}),lines:LA(LA({},t),{},{positions:{value:t.positions,size:n},pathIndices:{value:t.pathIndices,size:1},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:VA(t.numericProps,1)}),polygons:LA(LA({},r),{},{positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},triangles:{value:new Uint32Array(r.triangles),size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:VA(r.numericProps,1)})}}(A,B,w,d)}(e,LA({propArrayTypes:n},t),{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array})}function GA(e){var t,r={},n=PA(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]=qA(o,r[a])}}}catch(e){n.e(e)}finally{n.f()}return r}function UA(e,t,r,n,i){t.positions.set(e.data,r.pointPosition*n);var a=e.data.length/n;zA(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 NA(e,t,r,n,i){t.positions.set(e.data,r.linePosition*n);var a=e.data.length/n;zA(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.indices.length;o<s;++o){var u=e.indices[o],c=o===s-1?e.data.length:e.indices[o+1];t.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-u)/n}}function HA(e,t,r,n,i){t.positions.set(e.data,r.polygonPosition*n);var a=e.data.length/n;zA(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.indices.length;o<s;++o){var u=r.polygonPosition;t.polygonIndices[r.polygonObject++]=u;for(var c=e.areas[o],l=e.indices[o],f=e.indices[o+1],h=0,d=l.length;h<d;++h){var p=l[h],v=h===d-1?void 0===f?e.data.length:f[0]:l[h+1];t.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(v-p)/n}JA(t,c,l,{startPosition:u,endPosition:r.polygonPosition,coordLength:n})}}function JA(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=function(e,t){var r,n,i,a,o,s,u,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=arguments.length>3?arguments[3]:void 0,f=t&&t.length,h=f?t[0]*c:e.length,d=cA(e,0,h,c,!0,l&&l[0]),p=[];if(!d||d.next===d.prev)return p;if(f&&(d=yA(e,t,d,c,l)),e.length>80*c){a=n=e[0],o=i=e[1];for(var v=c;v<h;v+=c)(s=e[v])<a&&(a=s),(u=e[v+1])<o&&(o=u),s>n&&(n=s),u>i&&(i=u);r=0!==(r=Math.max(n-a,i-o))?1/r:0}return fA(d,p,c,a,o,r),p}(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 VA(e,t){var r={};for(var n in e)r[n]={value:e[n],size:t};return r}function zA(e,t,r,n){for(var i in e.numericProps)if(i in t){var a=t[i];e.numericProps[i].fill(a,r,r+n)}}function KA(e,t){var r={};for(var n in e)t.includes(n)||(r[n]=e[n]);return r}function qA(e,t){return t!==Array&&Number.isFinite(e)?t===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array:Array}var QA=r(41),XA=r.n(QA);function WA(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 ZA(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))}var YA=function(){function e(t,r,n,i,a){h()(this,e),Gn(this,"properties",void 0),Gn(this,"extent",void 0),Gn(this,"type",void 0),Gn(this,"id",void 0),Gn(this,"_pbf",void 0),Gn(this,"_geometry",void 0),Gn(this,"_keys",void 0),Gn(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(ZA,this,r)}return C()(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=WA(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}(),$A=function(){function e(t,r){h()(this,e),Gn(this,"version",void 0),Gn(this,"name",void 0),Gn(this,"extent",void 0),Gn(this,"length",void 0),Gn(this,"_pbf",void 0),Gn(this,"_keys",void 0),Gn(this,"_values",void 0),Gn(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(eB,this,r),this.length=this._features.length}return C()(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 YA(this._pbf,t,this.extent,this._keys,this._values)}}]),e}();function eB(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 tB,rB,nB,iB,aB,oB,sB,uB=function e(t,r){h()(this,e),Gn(this,"layers",void 0),this.layers=t.readFields(cB,{},r)};function cB(e,t,r){if(3===e&&r){var n=new $A(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function lB(e){var t=e.indices.length;if(t<=1)return{type:"Polygon",data:e.data,areas:[[uA(e.data)]],indices:[e.indices]};for(var r,n,i,a=[],o=[],s=[],u=[],c=0,l=0;l<t;l++){i=e.indices[l]-c,n=e.indices[l+1]-c||e.data.length;var f=uA(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),{type:"Polygon",areas:a,indices:o,data:e.data}}function fB(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 hB(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 dB(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 dB(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 dB(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 pB(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 vB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var yB=function(){function e(t,r,n,i,a,o){h()(this,e),Gn(this,"properties",void 0),Gn(this,"extent",void 0),Gn(this,"type",void 0),Gn(this,"id",void 0),Gn(this,"_pbf",void 0),Gn(this,"_geometry",void 0),Gn(this,"_keys",void 0),Gn(this,"_values",void 0),Gn(this,"_geometryInfo",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._geometryInfo=o,t.readFields(fB,this,r)}return C()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry,tB=e.readVarint()+e.pos,rB=1,iB=0,aB=0,oB=0,sB=0;for(var t=[],r=[];e.pos<tB;)if(iB<=0&&(nB=e.readVarint(),rB=7&nB,iB=nB>>3),iB--,1===rB||2===rB)aB+=e.readSVarint(),oB+=e.readSVarint(),1===rB&&t.push(sB),r.push(aB,oB),sB+=2;else{if(7!==rB)throw new Error("unknown command ".concat(rB));if(sB>0){var n=t[t.length-1];r.push(r[n],r[n+1]),sB+=2}}return{data:r,indices:t}}},{key:"_toBinaryCoordinates",value:function(e){var t,r=this.loadGeometry();e(r.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,t=vB({type:"Point"},r);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/2,t=vB({type:"LineString"},r);break;case 3:t=lB(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=t.indices.length;var n,i=hB(t.indices);try{for(i.s();!(n=i.n()).done;){var a=n.value;this._geometryInfo.polygonRingsCount+=a.length}}catch(e){i.e(e)}finally{i.f()}this._geometryInfo.polygonPositionsCount+=t.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var o={type:"Feature",geometry:t,properties:this.properties};return null!==this.id&&(o.id=this.id),o}},{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){return function(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}}(e,a,o,i)}))}}]),e}(),gB=function(){function e(t,r){h()(this,e),Gn(this,"version",void 0),Gn(this,"name",void 0),Gn(this,"extent",void 0),Gn(this,"length",void 0),Gn(this,"_pbf",void 0),Gn(this,"_keys",void 0),Gn(this,"_values",void 0),Gn(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(mB,this,r),this.length=this._features.length}return C()(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 yB(this._pbf,r,this.extent,this._keys,this._values,t)}}]),e}();function mB(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 bB=function e(t,r){h()(this,e),Gn(this,"layers",void 0),this.layers=t.readFields(AB,{},r)};function AB(e,t,r){if(3===e&&r){var n=new gB(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function BB(e,t){var r,n,i=function(e){var t;if(null==e||!e.mvt)throw new Error("mvt options required");var r="wgs84"===(null===(t=e.mvt)||void 0===t?void 0:t.coordinates),n=e.mvt.tileIndex,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(r&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return e.mvt}(t),a=(null==t?void 0:null===(r=t.gis)||void 0===r?void 0:r.format)||(null==t?void 0:null===(n=t.mvt)||void 0===n?void 0:n.shape);switch(a){case"columnar-table":return{shape:"columnar-table",data:wB(e,i)};case"geojson-row-table":return{shape:"geojson-row-table",data:_B(e,i)};case"geojson":return _B(e,i);case"binary-geometry":case"binary":return wB(e,i);default:throw new Error(a)}}function wB(e,t){var r=function(e,t){var r=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength<=0)return[r,n];var i=new bB(new XA.a(e));return(t&&Array.isArray(t.layers)?t.layers:Object.keys(i.layers)).forEach((function(e){var a=i.layers[e];if(a)for(var o=0;o<a.length;o++){var s=CB(a.feature(o,n),t,e);r.push(s)}})),[r,n]}(e,t),n=M()(r,2),i=jA(n[0],n[1]);return i.byteLength=e.byteLength,i}function _B(e,t){if(e.byteLength<=0)return[];var r=[],n=new uB(new XA.a(e));return(Array.isArray(t.layers)?t.layers:Object.keys(n.layers)).forEach((function(e){var i=n.layers[e];if(i)for(var a=0;a<i.length;a++){var o=xB(i.feature(a),t,e);r.push(o)}})),r}function xB(e,t,r){var n=e.toGeoJSON("wgs84"===t.coordinates?t.tileIndex:OB);return t.layerProperty&&(n.properties[t.layerProperty]=r),n}function CB(e,t,r){var n=e.toBinaryCoordinates("wgs84"===t.coordinates?t.tileIndex:EB);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=r),n}function OB(e,t){for(var r=t.extent,n=0;n<e.length;n++){var i=e[n];i[0]/=r,i[1]/=r}}function EB(e,t){for(var r=t.extent,n=0,i=e.length;n<i;++n)e[n]/=r}function TB(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?TB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var kB,MB={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.2.3",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}};SB(SB({},MB),{},{parse:(kB=Ie()(Pe.a.mark((function e(t,r){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",BB(t,r));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return kB.apply(this,arguments)}),parseSync:BB,binary:!0});function IB(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 RB(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 PB(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 PB(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 PB(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 FB(e,t){var r=null==t?void 0:t.globalFeatureId;return void 0!==r?function(e,t){var r,n=RB(jB(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 GB(i,a,s);a=s,o=u}}if(t===i.globalFeatureIds.value[a])return GB(i,a,i.featureIds.value.length)}}catch(e){n.e(e)}finally{n.f()}throw new Error("featureId:".concat(t," not found"))}(e,r):DB(e,null==t?void 0:t.type)}function DB(e,t){return function(e){var t,r=[],n=RB(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(GB(i,a,s)),a=s,o=u)}r.push(GB(i,a,i.featureIds.value.length))}}}catch(e){n.e(e)}finally{n.f()}return r}(jB(e,t))}function LB(e,t,r){switch(e.type){case"Point":return function(e,t,r){var n=UB(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=UB(n,i[0],i[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<i.length-1;u++){var c=UB(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=UB(i,l,f);u.push(h)}return{type:"Polygon",coordinates:u}}for(var d=[],p=0;p<a.length-1;p++){var v=a[p],y=a[p+1],g=e(t,v,y).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 jB(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 GB(e,t,r){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?IB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({type:"Feature",geometry:LB(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 UB(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 NB(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 HB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?NB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var JB={Point:VB,MultiPoint:function(e,t,r){return zB(e,t,r)},LineString:KB,MultiLineString:function(e,t,r){return e.map((function(e){return KB(e,t,r)}))},Polygon:qB,MultiPolygon:function(e,t,r){return e.map((function(e){return qB(e,t,r)}))}};function VB(e,t,r){var n=M()(e,2),i=n[0],a=n[1],o=M()(t,2),s=o[0],u=o[1],c=ct(s[0],u[0],i),l=ct(s[1],u[1],a);return r.unprojectFlat([c,l])}function zB(e,t,r){return e.map((function(e){return VB(e,t,r)}))}function KB(e,t,r){return zB(e,t,r)}function qB(e,t,r){return e.map((function(e){return zB(e,t,r)}))}function QB(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 XB(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 XB(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 XB(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 WB=["points","lines","polygons"];function ZB(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 t?u=YB(e.properties,(function(e){return e[t]===r}),a,o):e.fields&&(u=YB(e.fields,(function(e){return e.id===r}),a,o)),u>=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 YB(e,t,r,n){for(var i=r;i<n;i++)if(t(e[i],i))return i;return-1}function $B(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 ew(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 ew(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 ew(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 tw(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 y()(this,r)}}function rw(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 nw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rw(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rw(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var iw=nw(nw({},B.GeoJsonLayer.defaultProps),{},{onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[MB],binary:!0}),aw=function(e){p()(n,e);var t,r=tw(n);function n(){return h()(this,n),r.apply(this,arguments)}return C()(n,[{key:"initializeState",value:function(){oi()(m()(n.prototype),"initializeState",this).call(this);var e=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:e,data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&oi()(m()(n.prototype),"isLoaded",this)}},{key:"updateState",value:function(e){var t,r=e.props,i=e.oldProps,a=e.context,o=e.changeFlags;o.dataChanged&&this._updateTileData(),null!==(t=this.state)&&void 0!==t&&t.data&&(oi()(m()(n.prototype),"updateState",this).call(this,{props:r,oldProps:i,context:a,changeFlags:o}),this._setWGS84PropertyForTiles());var s=r.highlightColor;s!==i.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}},{key:"_updateTileData",value:(t=Ie()(Pe.a.mark((function e(){var t,r,n,i,a;return Pe.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,{propName:"data",layer:this}),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(){var e=oi()(m()(n.prototype),"_getTilesetOptions",this).call(this),t=this.state.tileJSON,r=this.props,i=r.minZoom,a=r.maxZoom;return t&&(Number.isFinite(t.minzoom)&&t.minzoom>i&&(e.minZoom=t.minzoom),Number.isFinite(t.maxzoom)&&(!Number.isFinite(a)||t.maxzoom<a)&&(e.maxZoom=t.maxzoom)),e}},{key:"renderLayers",value:function(){var e;return null!==(e=this.state)&&void 0!==e&&e.data?oi()(m()(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(e){var t,r=this.state,n=r.data,i=r.binary,a=e.index,o=e.signal,s=In(n,e);if(!s)return Promise.reject("Invalid URL");var u=this.getLoadOptions();return(0,this.props.fetch)(s,{propName:"data",layer:this,loadOptions:u=nw(nw({},u),{},{mimeType:"application/x-protobuf",mvt:nw(nw({},null===(t=u)||void 0===t?void 0:t.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:a}),gis:i?{format:"binary"}:{}}),signal:o})}},{key:"renderSubLayers",value:function(e){var t=e.tile.index,r=t.x,i=t.y,a=t.z,o=Math.pow(2,a),s=512/o,u=-s,c=512*r/o,l=512*(1-i/o),f=(new Qr).scale([s,u,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=f,e.coordinateOrigin=[c,l,0],e.coordinateSystem=B.COORDINATE_SYSTEM.CARTESIAN,e.extensions=[].concat(Le()(e.extensions||[]),[new B.ClipExtension]));var h=oi()(m()(n.prototype),"renderSubLayers",this).call(this,e);return!this.state.binary||h instanceof B.GeoJsonLayer||B.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),h}},{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=ow(s,n),r=sw(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=oi()(m()(n.prototype),"getPickingInfo",this).call(this,e),r=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==t.index){var i=e.sourceLayer.props.data;t.object=FB(i,{globalFeatureId:t.index})}return t.object&&!r&&(t.object=cw(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=t.binary,a=this.props,o=a.uniqueIdProperty,s=a.highlightedFeatureId,u=e.content,c=uw(s);if(!(uw(r)||c))return-1;var l=c?s:r;return Array.isArray(u)?u.findIndex((function(e){var t=ow(e,o)===l,r=c||sw(e)===n;return t&&r})):u&&i?function(e,t,r,n){var i,a=QB(WB);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e[o]&&ZB(e[o],t,r,n);if(s>=0)return s}}catch(e){a.e(e)}finally{a.f()}return-1}(u,o,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=$B(r);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=ow(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.state.binary&&Array.isArray(t.content)&&!t.content.length)return[];var r,n=t.bbox;if(void 0===t._contentWGS84&&(r=n,Number.isFinite(r.west)&&Number.isFinite(r.north)&&Number.isFinite(r.east)&&Number.isFinite(r.south))){var i=e.state.binary?FB(t.content):t.content;t._contentWGS84=i.map((function(t){return cw(t,n,e.context.viewport)}))}return t._contentWGS84}})}))}}]),n}(ii);function ow(e,t){return e.properties&&t?e.properties[t]:"id"in e?e.id:void 0}function sw(e){var t;return(null===(t=e.properties)||void 0===t?void 0:t.layerName)||null}function uw(e){return null!=e&&""!==e}function cw(e,t,r){var n=nw(nw({},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 HB(HB({},e),{},{coordinates:JB[e.type](e.coordinates,n,r)})}(e.geometry,t,r).coordinates}}),n}A()(aw,"layerName","MVTLayer"),A()(aw,"defaultProps",iw),r.d(t,"GreatCircleLayer",(function(){return _})),r.d(t,"S2Layer",(function(){return J})),r.d(t,"QuadkeyLayer",(function(){return Se})),r.d(t,"TileLayer",(function(){return ii})),r.d(t,"TripsLayer",(function(){return li})),r.d(t,"H3ClusterLayer",(function(){return vi})),r.d(t,"H3HexagonLayer",(function(){return ki})),r.d(t,"Tile3DLayer",(function(){return Zb})),r.d(t,"TerrainLayer",(function(){return sA})),r.d(t,"MVTLayer",(function(){return aw})),r.d(t,"_getURLFromTemplate",(function(){return In})),r.d(t,"_Tileset2D",(function(){return Zn})),r.d(t,"_Tile2DHeader",(function(){return Fe}))}])}));
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?v:p;if(t){if(e<0)return v;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 v=i(0,!0);e.UZERO=v;var y=i(1);e.ONE=y;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(y)},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,v=0,y=0,g=0,m=0;return g+=(m+=s*h)>>>16,y+=(g+=i*h)>>>16,g&=65535,y+=(g+=s*f)>>>16,v+=(y+=n*h)>>>16,y&=65535,v+=(y+=i*f)>>>16,y&=65535,v+=(y+=s*l)>>>16,v+=r*h+n*f+i*l+s*u,o((g&=65535)<<16|(m&=65535),(v&=65535)<<16|(y&=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?v:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return g;i=v}else{if(this.eq(B))return e.eq(y)||e.eq(m)?B:e.eq(B)?y:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?y:m:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(B))return this.unsigned?v: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=y),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(52);e.exports=function(e){return new n(e)}},function(e,t){},,,function(e,t){e.exports=r},function(e,t,r){var n=r(96);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(72),i=r(73),a=r(49),o=r(74);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){},function(e,t,r){"use strict";e.exports=i;var n=r(97);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 v(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function y(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,v,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,y,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){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(48);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){},function(e,t){e.exports=function(e){this.wrapped=e}},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){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){var n=r(89),i=r(90),a=r(91),o=r(93);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(47);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(98),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,r){var n=r(48);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){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){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){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,r){var n=r(50);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(50);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,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 x()}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,v=p&&p(p(_([])));v&&v!==t&&r.call(v,i)&&(d=v);var y=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 _(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:x}}function x(){return{value:void 0,done:!0}}return f.prototype=y.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(y),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(y),y[o]="Generator",y[i]=function(){return this},y.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=_,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:_(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(92);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){},function(e,t,r){var n=r(52);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){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,v=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*v}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"filename",(function(){return nl})),r.d(n,"dirname",(function(){return il})),r.d(n,"join",(function(){return al}));var i={};r.r(i),r.d(i,"name",(function(){return $y})),r.d(i,"decode",(function(){return eg}));var a={};r.r(a),r.d(a,"name",(function(){return cg})),r.d(a,"preprocess",(function(){return lg}));var o={};r.r(o),r.d(o,"name",(function(){return dg})),r.d(o,"preprocess",(function(){return pg}));var s={};r.r(s),r.d(s,"name",(function(){return wg})),r.d(s,"preprocess",(function(){return _g})),r.d(s,"decode",(function(){return xg})),r.d(s,"encode",(function(){return Og}));var u={};r.r(u),r.d(u,"name",(function(){return Pg})),r.d(u,"decode",(function(){return Fg})),r.d(u,"encode",(function(){return Lg}));var c={};r.r(c),r.d(c,"name",(function(){return Ng})),r.d(c,"decode",(function(){return Hg})),r.d(c,"encode",(function(){return Vg}));var l={};r.r(l),r.d(l,"name",(function(){return qg})),r.d(l,"decode",(function(){return Xg})),r.d(l,"encode",(function(){return Wg}));var f=r(2),h=r.n(f),d=r(6),p=r.n(d),v=r(11),y=r.n(v),g=r(5),m=r.n(g),b=r(0),A=r.n(b),B=r(10);function w(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 y()(this,r)}}var _=function(e){p()(r,e);var t=w(r);function r(){return h()(this,r),t.apply(this,arguments)}return r}(B.ArcLayer);A()(_,"layerName","GreatCircleLayer"),A()(_,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var x=r(3),C=r.n(x);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 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 y()(this,r)}}function E(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}var T=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},B.PolygonLayer.defaultProps),S=function(e){p()(r,e);var t=O(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){return null}},{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.lineWidthUnits,s=e.lineWidthScale,u=e.lineWidthMinPixels,c=e.lineWidthMaxPixels,l=e.lineJointRounded,f=e.lineMiterLimit,h=e.lineDashJustified,d=e.getElevation,p=e.getFillColor,v=e.getLineColor,y=e.getLineWidth,g=this.props,m=g.updateTriggers,b=g.material,A=g.transitions;return new(this.getSubLayerClass("cell",B.PolygonLayer))({filled:i,wireframe:n,extruded:r,elevationScale:t,stroked:a,lineWidthUnits:o,lineWidthScale:s,lineWidthMinPixels:u,lineWidthMaxPixels:c,lineJointRounded:l,lineMiterLimit:f,lineDashJustified:h,material:b,transitions:A,getElevation:d,getFillColor:p,getLineColor:v,getLineWidth:y},this.getSubLayerProps({id:"cell",updateTriggers:m&&{getElevation:m.getElevation,getFillColor:m.getFillColor,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}),this.indexToBounds())}}]),r}(B.CompositeLayer);A()(S,"layerName","GeoCellLayer"),A()(S,"defaultProps",T);var k=r(7),M=r.n(k),I=r(26),R=r.n(I),P=180/Math.PI;function F(e,t,r){var n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function D(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function L(e){return[D(e[0]),D(e[1])]}function j(e,t){var r=M()(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 G(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 U(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){var t=e.padEnd(16,"0");return R.a.fromString(t,16)}(e)}return function(e){for(var t=R.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=R.a.fromString(n,!0,2).toString(10),s=R.a.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}(e.toString())}function N(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,v=0;v<4;v++)for(var y=l[v].slice(0),g=l[v+1],m=(g[0]-y[0])/f,b=(g[1]-y[1])/f,A=0;A<f;A++){y[0]+=m,y[1]+=b;var B=j(s,L(F(u,c,y))),w=(t=B,r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,r=M()(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)*P,o*P]);Math.abs(w[1])>89.999&&(w[0]=p);var _=w[0]-p;w[0]+=_>180?-360:_<-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);G(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}}(U(e)))}function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return 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 y()(this,r)}}var J=function(e){p()(r,e);var t=H(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getS2Token;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return N(r(e,t))}}}}]),r}(S);A()(J,"layerName","S2Layer"),A()(J,"defaultProps",{getS2Token:{type:"accessor",value:function(e){return e.token}}});r(34);var V=r(20),z=r.n(V);r(53),r(54);var K="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function q(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 X(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function Q(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function W(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 Z(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}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Y,$;Y=new K(4),K!=Float32Array&&(Y[0]=0,Y[1]=0,Y[2]=0,Y[3]=0),$=Y;Math.log2;function ee(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],v=t[13],y=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,_=i*c-a*u,x=l*v-f*p,C=l*y-h*p,O=l*g-d*p,E=f*y-h*v,T=f*g-d*v,S=h*g-d*y,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]=(v*_-y*w+g*B)*k,e[3]=(h*w-f*_-d*B)*k,e[4]=(u*O-o*S-c*C)*k,e[5]=(r*S-i*O+a*C)*k,e[6]=(y*A-p*_-g*b)*k,e[7]=(l*_-h*A+d*b)*k,e[8]=(o*T-s*O+c*x)*k,e[9]=(n*O-r*T-a*x)*k,e[10]=(p*w-v*A+g*m)*k,e[11]=(f*A-l*w-d*m)*k,e[12]=(s*C-o*E-u*x)*k,e[13]=(r*E-n*C+i*x)*k,e[14]=(v*b-p*B-y*m)*k,e[15]=(l*B-f*b+h*m)*k,e):null}function te(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],v=t[12],y=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*v,e[1]=b*i+A*u+B*h+w*y,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*v,e[5]=b*i+A*u+B*h+w*y,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*v,e[9]=b*i+A*u+B*h+w*y,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*v,e[13]=b*i+A*u+B*h+w*y,e[14]=b*a+A*c+B*d+w*g,e[15]=b*o+A*l+B*p+w*m,e}function re(e,t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v=r[0],y=r[1],g=r[2];return t===e?(e[12]=t[0]*v+t[4]*y+t[8]*g+t[12],e[13]=t[1]*v+t[5]*y+t[9]*g+t[13],e[14]=t[2]*v+t[6]*y+t[10]*g+t[14],e[15]=t[3]*v+t[7]*y+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*v+s*y+f*g+t[12],e[13]=i*v+u*y+h*g+t[13],e[14]=a*v+c*y+d*g+t[14],e[15]=o*v+l*y+p*g+t[15]),e}function ne(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 ie(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 ae(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 oe(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}var se=function(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};var ue=function(e,t,r,n,i,a,o){var s=1/(t-r),u=1/(n-i),c=1/(a-o);return 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,e};function ce(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 le(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=function(){var e=new K(2);return K!=Float32Array&&(e[0]=0,e[1]=0),e}()}();function fe(){var e=new K(3);return K!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function he(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function de(e,t,r){var n=new K(3);return n[0]=e,n[1]=t,n[2]=r,n}function pe(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ve(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 ye(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 ge(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}function me(e,t,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,h=n*u-i*s,d=i*h-a*f,p=a*l-n*h,v=n*f-i*l,y=2*o;return l*=y,f*=y,h*=y,d*=2,p*=2,v*=2,e[0]=s+l+d,e[1]=u+f+p,e[2]=c+h+v,e}var be=he;!function(){var e=fe()}();function Ae(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var Be=Math.PI,we=Be/4,_e=Be/180,xe=180/Be;function Ce(e){var t=z()(e,2),r=t[0],n=t[1];Ae(Number.isFinite(r)),Ae(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=n*_e;return[512*(r*_e+Be)/(2*Be),512*(Be+Math.log(Math.tan(we+.5*i)))/(2*Be)]}function Oe(e){var t=z()(e,2),r=t[0],n=t[1],i=r/512*(2*Be)-Be,a=2*(Math.atan(Math.exp(n/512*(2*Be)-Be))-we);return[i*xe,a*xe]}Math.PI;r(55);function Ee(e){var t=function(e){for(var t=0,r=0,n=1<<e.length,i=n/512,a=0;a<e.length;a++){n>>=1;var o=parseInt(e[a]);o%2&&(t|=n),o>1&&(r|=n)}return[[t/i,512-r/i],[(t+.99)/i,512-(r+.99)/i]]}(e),r=M()(t,2),n=r[0],i=r[1],a=Oe(n),o=M()(a,2),s=o[0],u=o[1],c=Oe(i),l=M()(c,2),f=l[0],h=l[1];return[f,u,f,h,s,h,s,u,f,u]}function Te(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 y()(this,r)}}var Se=function(e){p()(r,e);var t=Te(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getQuadkey;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return Ee(r(e,t))}}}}]),r}(S);A()(Se,"layerName","QuadkeyLayer"),A()(Se,"defaultProps",{getQuadkey:{type:"accessor",value:function(e){return e.quadkey}}});var ke,Me=r(4),Ie=r.n(Me),Re=r(1),Pe=r.n(Re),Fe=function(){function e(t){h()(this,e),A()(this,"index",void 0),A()(this,"isVisible",void 0),A()(this,"isSelected",void 0),A()(this,"parent",void 0),A()(this,"children",void 0),A()(this,"content",void 0),A()(this,"state",void 0),A()(this,"layers",void 0),A()(this,"id",void 0),A()(this,"bbox",void 0),A()(this,"zoom",void 0),A()(this,"userData",void 0),A()(this,"_abortController",void 0),A()(this,"_loader",void 0),A()(this,"_loaderId",void 0),A()(this,"_isLoaded",void 0),A()(this,"_isCancelled",void 0),A()(this,"_needsReload",void 0),this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}var t;return C()(e,[{key:"data",get:function(){var e=this;return this.isLoading&&this._loader?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=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v;return Pe.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.index,s=this.id,u=this.bbox,c=this.userData,l=this.zoom,f=this._loaderId,this._abortController=new AbortController,h=this._abortController.signal,e.next=7,n.scheduleRequest(this,(function(e){return e.isSelected?1:-1}));case 7:if(d=e.sent){e.next=11;break}return this._isCancelled=!0,e.abrupt("return");case 11:if(!this._isCancelled){e.next=14;break}return d.done(),e.abrupt("return");case 14:return p=null,e.prev=15,e.next=18,r({index:o,id:s,bbox:u,userData:c,zoom:l,signal:h});case 18:p=e.sent,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(15),v=e.t0||!0;case 24:return e.prev=24,d.done(),e.finish(24);case 27:if(f===this._loaderId){e.next=29;break}return e.abrupt("return");case 29:if(this._loader=void 0,this.content=p,!this._isCancelled||p){e.next=34;break}return this._isLoaded=!1,e.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,v?a(v,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(){var e;this.isLoaded||(this._isCancelled=!0,null===(e=this._abortController)||void 0===e||e.abort())}}]),e}(),De=r(8),Le=r.n(De);!function(e){e[e.OUTSIDE=-1]="OUTSIDE",e[e.INTERSECTING=0]="INTERSECTING",e[e.INSIDE=1]="INSIDE"}(ke||(ke={}));var je=r(21),Ge=r.n(je),Ue=r(22),Ne=r.n(Ue);function He(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Je=r(16),Ve=r.n(Je),ze=r(17),Ke=r.n(ze),qe=r(18),Xe=r.n(qe),Qe=r(19),We=r.n(Qe),Ze=r(14),Ye=r.n(Ze);r(38);function $e(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var et=1/Math.PI*180,tt=1/180*Math.PI,rt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.precision,n=void 0===r?rt.precision:r;return e=ft(e),"".concat(parseFloat(e.toPrecision(n)))}function it(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function at(e){return function(e,t){return ht(e,(function(e){return e*tt}),t)}(e)}function ot(e){return st(e)}function st(e,t){return ht(e,(function(e){return e*et}),t)}function ut(e,t,r){return ht(e,(function(e){return Math.max(t,Math.min(r,e))}))}function ct(e,t,r){return it(e)?e.map((function(e,n){return ct(e,t[n],r)})):r*t+(1-r)*e}function lt(e,t,r){var n=rt.EPSILON;r&&(rt.EPSILON=r);try{if(e===t)return!0;if(it(e)&&it(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;++i)if(!lt(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):"number"==typeof e&&"number"==typeof t&&Math.abs(e-t)<=rt.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{rt.EPSILON=n}}function ft(e){return Math.round(e/rt.EPSILON)*rt.EPSILON}function ht(e,t,r){if(it(e)){var n=e;r=r||function(e){return e.clone?e.clone():new Array(e.length)}(n);for(var i=0;i<r.length&&i<n.length;++i)r[i]=t(e[i],i,r);return r}return t(e)}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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var pt=function(e){Xe()(r,e);var t=dt(r);function r(){return Ve()(this,r),t.apply(this,arguments)}return Ke()(r,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{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:"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:"from",value:function(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}},{key:"to",value:function(e){return e===this?this:it(e)?this.toArray(e):this.toObject(e)}},{key:"toTarget",value:function(e){return e?this.to(e):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(rt)}},{key:"formatString",value:function(e){for(var t="",r=0;r<this.ELEMENTS;++r)t+=(r>0?", ":"")+nt(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(!lt(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){if(void 0===r)return this.lerp(this,e,t);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("number"==typeof e)for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(var r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}},{key:"multiplyByScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"check",value:function(){if(rt.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:"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.multiplyByScalar(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:"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 vt(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 yt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function gt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(rt.debug&&!vt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function mt(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var bt=function(e){Xe()(r,e);var t=mt(r);function r(){return Ve()(this,r),t.apply(this,arguments)}return Ke()(r,[{key:"x",get:function(){return this[0]},set:function(e){this[0]=yt(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=yt(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 yt(t)}},{key:"dot",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r)t+=this[r]*e[r];return yt(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 $e(e>=0&&e<this.ELEMENTS,"index is out of range"),yt(this[e])}},{key:"setComponent",value:function(e,t){return $e(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}(pt);function At(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 Bt(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 wt(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}function _t(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var xt,Ct=[0,0,0],Ot=function(e){Xe()(r,e);var t=_t(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 Ve()(this,r),e=t.call(this,-0,-0,-0),1===arguments.length&&it(n)?e.copy(n):(rt.debug&&(yt(n),yt(i),yt(a)),e[0]=n,e[1]=i,e[2]=a),e}return Ke()(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 rt.debug&&(yt(e.x),yt(e.y),yt(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]=yt(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&&pe(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 ve(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Ct:r,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Ct:r,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Ct:r,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return ye(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return Bt(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return ge(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,e[2]=t[2]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return me(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return xt||(xt=new r(0,0,0),Object.freeze(xt)),xt}}]),r}(bt),Et=new Ot,Tt=new Ot,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,0,0],n=arguments.length>2?arguments[2]:void 0;Ge()(this,e),He(this,"center",void 0),He(this,"halfDiagonal",void 0),He(this,"minimum",void 0),He(this,"maximum",void 0),n=n||Et.copy(t).add(r).scale(.5),this.center=new Ot(n),this.halfDiagonal=new Ot(r).subtract(this.center),this.minimum=new Ot(t),this.maximum=new Ot(r)}return Ne()(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=Tt.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?ke.INSIDE:i+n<0?ke.OUTSIDE:ke.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t,r=Et.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}(),kt=new Ot,Mt=new Ot,It=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;Ge()(this,e),He(this,"center",void 0),He(this,"radius",void 0),this.radius=-0,this.center=new Ot,this.fromCenterRadius(t,r)}return Ne()(e,[{key:"fromCenterRadius",value:function(e,t){return this.center.from(e),this.radius=t,this}},{key:"fromCornerPoints",value:function(e,t){return t=kt.from(t),this.center=(new Ot).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=kt.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 Mt.copy(a).scale((-r+s)/o).add(t),this.center.copy(Mt),this.radius=s,this}},{key:"expand",value:function(e){var t=kt.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=oe(kt,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=kt.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?ke.OUTSIDE:n<r?ke.INTERSECTING:ke.INSIDE}}]),e}(),Rt=r(25),Pt=r.n(Rt);function Ft(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var Dt=function(e){Xe()(r,e);var t=Ft(r);function r(){return Ve()(this,r),t.apply(this,arguments)}return Ke()(r,[{key:"toString",value:function(){var e="[";if(rt.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]=yt(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}(pt);function Lt(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],v=r[3],y=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]=v*n+y*o+g*c,e[4]=v*i+y*s+g*l,e[5]=v*a+y*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 jt(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}var Gt;function Ut(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}!function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"}(Gt||(Gt={}));var Nt,Ht,Jt,Vt=Object.freeze([1,0,0,0,1,0,0,0,1]),zt=function(e){Xe()(r,e);var t=Ut(r);function r(e){for(var n,i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return Ve()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):a.length>0?n.copy([e].concat(a)):n.identity(),n}return Ke()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Gt}},{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:"identity",value:function(){return this.copy(Vt)}},{key:"fromObject",value:function(e){return this.check()}},{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,v=a*o,y=a*s,g=a*u;e[0]=1-f-p,e[3]=l-g,e[6]=h+y,e[1]=l+g,e[4]=1-c-p,e[7]=d-v,e[2]=h-y,e[5]=d+v,e[8]=1-c-f}(this,e),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:"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(){return function(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=l*o-s*c,h=-l*a+s*u,d=c*a-o*u,p=r*f+n*h+i*d;p&&(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,this),this.check()}},{key:"multiplyLeft",value:function(e){return Lt(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return Lt(this,this,e),this.check()}},{key:"rotate",value:function(e){return function(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=Math.sin(r),d=Math.cos(r);e[0]=d*n+h*o,e[1]=d*i+h*s,e[2]=d*a+h*u,e[3]=d*o-h*n,e[4]=d*s-h*i,e[5]=d*u-h*a,e[6]=c,e[7]=l,e[8]=f}(this,this,e),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?jt(this,this,e):jt(this,this,[e,e]),this.check()}},{key:"translate",value:function(e){return function(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];e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=h*n+d*o+c,e[7]=h*i+d*s+l,e[8]=h*a+d*u+f}(this,this,e),this.check()}},{key:"transform",value:function(e,t){var r;switch(e.length){case 2:r=ce(t||[-0,-0],e,this);break;case 3:r=ge(t||[-0,-0,-0],e,this);break;case 4:r=wt(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return gt(r,e.length),r}},{key:"transformVector",value:function(e,t){return this.transform(e,t)}},{key:"transformVector2",value:function(e,t){return this.transform(e,t)}},{key:"transformVector3",value:function(e,t){return this.transform(e,t)}}],[{key:"IDENTITY",get:function(){return function(){Ht||(Ht=new zt,Object.freeze(Ht));return Ht}()}},{key:"ZERO",get:function(){return function(){Nt||(Nt=new zt([0,0,0,0,0,0,0,0,0]),Object.freeze(Nt));return Nt}()}}]),r}(Dt);function Kt(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var qt=function(e){Xe()(r,e);var t=Kt(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]:0;return Ve()(this,r),e=t.call(this,-0,-0,-0,-0),it(n)&&1===arguments.length?e.copy(n):(rt.debug&&(yt(n),yt(i),yt(a),yt(o)),e[0]=n,e[1]=i,e[2]=a,e[3]=o),e}return Ke()(r,[{key:"set",value:function(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}},{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:"fromObject",value:function(e){return rt.debug&&(yt(e.x),yt(e.y),yt(e.z),yt(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=yt(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=yt(e)}},{key:"transform",value:function(e){return ye(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return wt(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,e[2]=t[2],e[3]=t[3]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return me(this,this,e),this.check()}},{key:"applyMatrix4",value:function(e){return e.transform(this,this),this}}],[{key:"ZERO",get:function(){return Jt||(Jt=new r(0,0,0,0),Object.freeze(Jt)),Jt}}]),r}(bt);function Xt(){var e=new K(4);return K!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Qt(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 Wt(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 Zt(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],v=r[2],y=r[3];return(a=c*d+l*p+f*v+h*y)<0&&(a=-a,d=-d,p=-p,v=-v,y=-y),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*v,e[3]=s*h+u*y,e}function Yt(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 $t,er,tr,rr,nr,ir,ar=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},or=q,sr=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},ur=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},cr=X,lr=Q,fr=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},hr=($t=fe(),er=de(1,0,0),tr=de(0,1,0),function(e,t,r){var n=pe(t,r);return n<-.999999?(ve($t,er,t),be($t)<1e-6&&ve($t,tr,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}($t,$t),Qt(e,$t,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(ve($t,t,r),e[0]=$t[0],e[1]=$t[1],e[2]=$t[2],e[3]=1+n,fr(e,e))});rr=Xt(),nr=Xt(),ir=function(){var e=new K(9);return K!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}();function dr(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var pr=[0,0,0,1],vr=function(e){Xe()(r,e);var t=dr(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 Ve()(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 Ke()(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:"fromObject",value:function(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}},{key:"fromMatrix3",value:function(e){return Yt(this,e),this.check()}},{key:"fromAxisRotation",value:function(e,t){return Qt(this,e,t),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:"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]=yt(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=yt(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=yt(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=yt(e)}},{key:"len",value:function(){return cr(this)}},{key:"lengthSquared",value:function(){return lr(this)}},{key:"dot",value:function(e){return sr(this,e)}},{key:"rotationTo",value:function(e,t){return hr(this,e,t),this.check()}},{key:"add",value:function(e){return ar(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 void 0===r?this.lerp(this,e,t):(ur(this,e,t,r),this.check())}},{key:"multiplyRight",value:function(e){return Wt(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e){return Wt(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 or(this,this,e),this.check()}},{key:"slerp",value:function(e,t,r){var n,i,a;switch(arguments.length){case 1:var o=e.start;n=void 0===o?pr:o,i=e.target,a=e.ratio;break;case 2:n=this,i=e,a=t;break;default:n=e,i=t,a=r}return Zt(this,n,i,a),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qt;return Z(t,e,this),gt(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){return this.multiplyLeft(e)}},{key:"multiply",value:function(e){return this.multiplyRight(e)}}]),r}(pt),yr=new Ot,gr=new Ot,mr=new Ot,br=new Ot,Ar=new Ot,Br=new Ot,wr=new Ot,_r=0,xr=1,Cr=2,Or=3,Er=4,Tr=5,Sr=6,kr=7,Mr=8,Ir=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];Ge()(this,e),He(this,"center",void 0),He(this,"halfAxes",void 0),this.center=(new Ot).from(t),this.halfAxes=new zt(r)}return Ne()(e,[{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Ot(e).len(),new Ot(t).len(),new Ot(r).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Ot(e).normalize(),i=new Ot(t).normalize(),a=new Ot(r).normalize();return(new vr).fromMatrix3(new zt([].concat(Pt()(n),Pt()(i),Pt()(a))))}},{key:"fromCenterHalfSizeQuaternion",value:function(e,t,r){var n=new vr(r),i=(new zt).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 Ot).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 It,t=this.halfAxes,r=t.getColumn(0,mr),n=t.getColumn(1,br),i=t.getColumn(2,Ar),a=yr.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[_r]+a*n[xr]+o*n[Cr])+Math.abs(i*n[Or]+a*n[Er]+o*n[Tr])+Math.abs(i*n[Sr]+a*n[kr]+o*n[Mr]),u=r.dot(t)+e.distance;return u<=-s?ke.OUTSIDE:u>=s?ke.INSIDE:ke.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t=gr.from(e).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,mr),i=r.getColumn(1,br),a=r.getColumn(2,Ar),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,mr),u=o.getColumn(1,br),c=o.getColumn(2,Ar),l=Br.copy(s).add(u).add(c).add(a),f=wr.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,mr);t.transformAsPoint(e);var r=this.halfAxes.getColumn(1,br);r.transformAsPoint(e);var n=this.halfAxes.getColumn(2,Ar);return n.transformAsPoint(e),this.halfAxes=new zt([].concat(Pt()(t),Pt()(r),Pt()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),e}(),Rr=new Ot,Pr=new Ot,Fr=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;Ge()(this,e),He(this,"normal",void 0),He(this,"distance",void 0),this.normal=new Ot,this.distance=-0,this.fromNormalDistance(t,r)}return Ne()(e,[{key:"fromNormalDistance",value:function(e,t){return $e(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}},{key:"fromPointNormal",value:function(e,t){e=Rr.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),$e(lt(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(){return new e(this.normal,this.distance)}},{key:"equals",value:function(e){return lt(this.distance,e.distance)&&lt(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=Rr.from(e);var r=this.getPointDistance(e),n=Pr.copy(this.normal).scale(r);return e.subtract(n).to(t)}}]),e}();function Dr(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 Lr(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 Lr(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 Lr(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 jr,Gr=[new Ot([1,0,0]),new Ot([0,1,0]),new Ot([0,0,1])],Ur=new Ot,Nr=new Ot,Hr=(new Fr(new Ot(1,0,0),0),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ge()(this,e),He(this,"planes",void 0),this.planes=t}return Ne()(e,[{key:"fromBoundingSphere",value:function(e){this.planes.length=2*Gr.length;var t,r=e.center,n=e.radius,i=0,a=Dr(Gr);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 Fr),u||(u=this.planes[i+1]=new Fr);var c=Ur.copy(o).scale(-n).add(r);o.dot(c);s.fromPointNormal(c,o);var l=Ur.copy(o).scale(n).add(r),f=Nr.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){var t,r=ke.INSIDE,n=Dr(this.planes);try{for(n.s();!(t=n.n()).done;){var i=t.value;switch(e.intersectPlane(i)){case ke.OUTSIDE:return ke.OUTSIDE;case ke.INTERSECTING:r=ke.INTERSECTING}}}catch(e){n.e(e)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(t,r){if($e(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===ke.OUTSIDE)return e.MASK_OUTSIDE;u===ke.INTERSECTING&&(n|=o)}}return n}}]),e}());function Jr(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}He(Hr,"MASK_OUTSIDE",4294967295),He(Hr,"MASK_INSIDE",0),He(Hr,"MASK_INDETERMINATE",2147483647),function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"}(jr||(jr={}));var Vr,zr,Kr=45*Math.PI/180,qr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Xr=function(e){Xe()(r,e);var t=Jr(r);function r(e){var n;return Ve()(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 Ke()(r,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return jr}},{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,v){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]=v,this.check()}},{key:"setRowMajor",value:function(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v){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]=v,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(qr)}},{key:"fromObject",value:function(e){return this.check()}},{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,v=a*o,y=a*s,g=a*u;e[0]=1-f-p,e[1]=l+g,e[2]=h-y,e[3]=0,e[4]=l-g,e[5]=1-c-p,e[6]=d+v,e[7]=0,e[8]=h+y,e[9]=d-v,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,r=e.right,n=e.bottom,i=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return u===1/0?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;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}(this,t,r,n,i,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,r,n,i,o,u),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,r=e.center,n=void 0===r?[0,0,0]:r,i=e.up;return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p=t[0],v=t[1],y=t[2],g=n[0],m=n[1],b=n[2],A=r[0],B=r[1],w=r[2];Math.abs(p-A)<1e-6&&Math.abs(v-B)<1e-6&&Math.abs(y-w)<1e-6?function(e){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):(l=p-A,f=v-B,h=y-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*v+o*y),e[13]=-(s*p+u*v+c*y),e[14]=-(l*p+f*v+h*y),e[15]=1)}(this,t,n,void 0===i?[0,1,0]:i),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 ue(this,t,r,n,i,o,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(e){var t=e.fovy,r=void 0===t?Kr:t,n=e.aspect,i=void 0===n?1:n,a=e.focalDistance,o=void 0===a?1:a,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;Qr(r);var f=r/2,h=o*Math.tan(f),d=h*i;return this.ortho({left:-d,right:d,bottom:-h,top:h,near:u,far:l})}},{key:"perspective",value:function(e){var t=e.fovy,r=void 0===t?45*Math.PI/180:t,n=e.aspect,i=void 0===n?1:n,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return Qr(r),se(this,r,i,o,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],l=e[9],f=e[10],h=e[11],d=e[12],p=e[13],v=e[14],y=e[15],(t*o-r*a)*(f*y-h*v)-(t*s-n*a)*(l*y-h*p)+(t*u-i*a)*(l*v-f*p)+(r*s-n*o)*(c*y-h*d)-(r*u-i*o)*(c*v-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,v,y}},{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(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];var r=this.getScale(t),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(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];var r=this.getScale(t),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 ee(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return te(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return te(this,this,e),this.check()}},{key:"rotateX",value:function(e){return ie(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 ae(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}},{key:"rotateAxis",value:function(e,t){return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,v,y,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],v=t[8],y=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,_=S*S*o+a,x=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+v*B,e[1]=u*b+h*A+y*B,e[2]=c*b+d*A+g*B,e[3]=l*b+p*A+m*B,e[4]=s*w+f*_+v*x,e[5]=u*w+h*_+y*x,e[6]=c*w+d*_+g*x,e[7]=l*w+p*_+m*x,e[8]=s*C+f*O+v*E,e[9]=u*C+h*O+y*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 ne(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}},{key:"translate",value:function(e){return re(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(gt(t=W(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){var r;switch(e.length){case 2:r=le(t||[-0,-0],e,this);break;case 3:r=ye(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return gt(r,e.length),r}},{key:"transformAsVector",value:function(e,t){var r;switch(e.length){case 2:r=At(t||[-0,-0],e,this);break;case 3:r=Bt(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return gt(r,e.length),r}},{key:"transformPoint",value:function(e,t){return this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return this.transformAsVector(e,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:"IDENTITY",get:function(){return function(){zr||(zr=new Xr,Object.freeze(zr));return zr}()}},{key:"ZERO",get:function(){return function(){Vr||(Vr=new Xr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Vr));return Vr}()}}]),r}(Dt);function Qr(e){if(e>2*Math.PI)throw Error("expected radians")}new Ot,new Ot,new Ot,new Ot,new Ot;function Wr(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=Ye()(e);if(t){var i=Ye()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return We()(this,r)}}var Zr=function(e){Xe()(r,e);var t=Wr(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 Ve()(this,r),e=t.call(this,2),it(n)&&1===arguments.length?e.copy(n):(rt.debug&&(yt(n),yt(i)),e[0]=n,e[1]=i),e}return Ke()(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 rt.debug&&(yt(e.x),yt(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 le(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return At(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return ce(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}(bt);new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,Math.PI;var Yr=.1,$r=1e-12,en=1e-15,tn=1e-20,rn=(Math.PI,Math.PI,Math.PI,Math.PI,new zt),nn=new zt,an=new zt,on=new zt,sn=new zt;function un(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=tn,n=10,i=0,a=0,o=nn,s=an;o.identity(),s.copy(e);for(var u=r*cn(s);a<n&&hn(s)>u;)dn(s,on),sn.copy(on).transpose(),s.multiplyRight(on),s.multiplyLeft(sn),o.multiplyRight(on),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function cn(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}var ln=[1,0,0],fn=[2,2,1];function hn(e){for(var t=0,r=0;r<3;++r){var n=e[rn.getElementIndex(fn[r],ln[r])];t+=2*n*n}return Math.sqrt(t)}function dn(e,t){for(var r=en,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[rn.getElementIndex(fn[a],ln[a])]);o>n&&(i=a,n=o)}var s=ln[i],u=fn[i],c=1,l=0;if(Math.abs(e[rn.getElementIndex(u,s)])>r){var f,h=(e[rn.getElementIndex(u,u)]-e[rn.getElementIndex(s,s)])/2/e[rn.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 zt.IDENTITY.to(t),t[rn.getElementIndex(s,s)]=t[rn.getElementIndex(u,u)]=c,t[rn.getElementIndex(u,s)]=l,t[rn.getElementIndex(s,u)]=-l,t}function pn(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 vn(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 vn(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 vn(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 yn=new Ot,gn=new Ot,mn=new Ot,bn=new Ot,An=new Ot,Bn=new zt,wn={diagonal:new zt,unitary:new zt};function _n(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 xn(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 xn(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 xn(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 Cn=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],On=Cn.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),En=On.concat([[.25,.5],[.75,.5]]),Tn=function(){function e(t,r,n){h()(this,e),A()(this,"x",void 0),A()(this,"y",void 0),A()(this,"z",void 0),A()(this,"childVisible",void 0),A()(this,"selected",void 0),A()(this,"_children",void 0),this.x=t,this.y=r,this.z=n}return C()(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=_n(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=_n(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=M()(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=_n(this.z<1?En:this.z<2?On:Cn);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=Fn(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 Ir;if(!e||0===e.length)return t.halfAxes=new zt([0,0,0,0,0,0,0,0,0]),t.center=new Ot,t;var r,n=e.length,i=new Ot(0,0,0),a=pn(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,v=pn(e);try{for(v.s();!(u=v.n()).done;){var y=u.value,g=yn.copy(y).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){v.e(e)}finally{v.f()}c*=s,l*=s,f*=s,h*=s,d*=s,p*=s;var m=Bn;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=un(m,wn),B=A.unitary,w=t.halfAxes.copy(B),_=w.getColumn(0,mn),x=w.getColumn(1,bn),C=w.getColumn(2,An),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=pn(e);try{for(I.s();!(b=I.n()).done;){var R=b.value;yn.copy(R),O=Math.max(yn.dot(_),O),E=Math.max(yn.dot(x),E),T=Math.max(yn.dot(C),T),S=Math.min(yn.dot(_),S),k=Math.min(yn.dot(x),k),M=Math.min(yn.dot(C),M)}}catch(e){I.e(e)}finally{I.f()}_=_.multiplyByScalar(.5*(S+O)),x=x.multiplyByScalar(.5*(k+E)),C=C.multiplyByScalar(.5*(M+T)),t.center.copy(_).add(x).add(C);var P=gn.set(O-S,E-k,T-M).multiplyByScalar(.5),F=new zt([P[0],0,0,0,P[1],0,0,0,P[2]]);return t.halfAxes.multiplyRight(F),t}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*t,l=512-(this.y+1)*u;return new St([c,l,e[0]],[c+u,l+u,e[1]])}}]),e}();var Sn=[-1/0,-1/0,1/0,1/0],kn={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 Mn(e,t){var r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min.apply(Math,Le()(r.map((function(e){return e[0]})))),Math.min.apply(Math,Le()(r.map((function(e){return e[1]})))),Math.max.apply(Math,Le()(r.map((function(e){return e[0]})))),Math.max.apply(Math,Le()(r.map((function(e){return e[1]}))))]}function In(e,t){if(!e||!e.length)return null;var r,n=t.index,i=t.id;Array.isArray(e)&&(e=e[(r=i,Math.abs(r.split("").reduce((function(e,t){return(e<<5)-e+t.charCodeAt(0)|0}),0))%e.length)]);for(var a=e,o=0,s=Object.keys(n);o<s.length;o++){var u=s[o],c=new RegExp("{".concat(u,"}"),"g");a=a.replace(c,String(n[u]))}return Number.isInteger(n.y)&&Number.isInteger(n.z)&&(a=a.replace(/\{-y\}/g,String(Math.pow(2,n.z)-n.y-1))),a}function Rn(e){var t=e.viewport,r=e.z,n=e.cullRect,i=n.x-t.x,a=n.y-t.y,o=n.width,s=n.height;if(!Array.isArray(r)){var u={targetZ:r||0},c=t.unproject([i,a],u),l=t.unproject([i+o,a],u),f=t.unproject([i,a+s],u),h=t.unproject([i+o,a+s],u);return[Math.min(c[0],l[0],f[0],h[0]),Math.min(c[1],l[1],f[1],h[1]),Math.max(c[0],l[0],f[0],h[0]),Math.max(c[1],l[1],f[1],h[1])]}var d=Rn({viewport:t,z:r[0],cullRect:n}),p=Rn({viewport:t,z:r[1],cullRect:n});return[Math.min(d[0],p[0]),Math.min(d[1],p[1]),Math.max(d[2],p[2]),Math.max(d[3],p[3])]}function Pn(e,t){return 512*Math.pow(2,e)/t}function Fn(e,t,r){var n=Pn(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 Dn(e,t,r,n){var i=Pn(r,n);return[e/i*512,t/i*512]}function Ln(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(e.isGeospatial){var a=Fn(t,r,n),o=M()(a,2),s=o[0],u=o[1],c=Fn(t+1,r+1,n),l=M()(c,2),f=l[0],h=l[1];return{west:s,north:u,east:f,south:h}}var d=Dn(t,r,n,i),p=M()(d,2),v=p[0],y=p[1],g=Dn(t+1,r+1,n,i),m=M()(g,2),b=m[0],A=m[1];return{left:v,top:y,right:b,bottom:A}}function jn(e,t,r,n,i){for(var a=function(e,t,r){return r?Mn(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=M()(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),Pn(t,r),i),o=M()(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 Gn(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"==typeof n&&Number.isFinite(n)&&h<n){if(!a)return[];h=n}"number"==typeof r&&Number.isFinite(r)&&h>r&&(h=r);var d=a;return u&&c&&a&&!t.isGeospatial&&(d=Mn(a,u)),t.isGeospatial?function(e,t,r,n){var i=e instanceof B._GlobeViewport&&e.resolution?e.projectPosition:null,a=Object.values(e.getFrustumPlanes()).map((function(e){var t=e.normal,r=e.distance;return new Fr(t.clone().negate(),r)})),o=new Hr(a),s=e.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,c=r&&r[1]*s||0,l=e instanceof B.WebMercatorViewport&&e.pitch<=60?t:0;if(n){var f=n,h=M()(f,4),d=h[0],p=h[1],v=h[2],y=Ce([d,h[3]]),g=Ce([v,p]);n=[y[0],512-y[1],g[0],512-g[1]]}var m=new Tn(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 instanceof B.WebMercatorViewport&&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):jn(t,h,s,d||Sn,c)}function Un(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nn(){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 Hn=function(){function e(t,r){h()(this,e),Un(this,"name",void 0),Un(this,"type",void 0),Un(this,"sampleSize",1),Un(this,"time",void 0),Un(this,"count",void 0),Un(this,"samples",void 0),Un(this,"lastTiming",void 0),Un(this,"lastSampleTime",void 0),Un(this,"lastSampleCount",void 0),Un(this,"_count",0),Un(this,"_time",0),Un(this,"_samples",0),Un(this,"_startTime",0),Un(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}return C()(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=Nn(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Nn()-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}(),Jn=function(){function e(t){h()(this,e),Un(this,"id",void 0),Un(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}return C()(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 Hn?e:new Hn(t,r)),this.stats[t]}}]),e}();function Vn(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?Vn(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Kn,qn={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Xn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h()(this,e),Un(this,"props",void 0),Un(this,"stats",void 0),Un(this,"activeRequestCount",0),Un(this,"requestQueue",[]),Un(this,"requestMap",new Map),Un(this,"deferredUpdate",null),this.props=zn(zn({},qn),t),this.stats=new Jn({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 C()(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 Qn(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 Wn(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 Wn(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 Wn(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 Zn=(Kn={},A()(Kn,"best-available",(function(e){var t,r=Qn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Qn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&!$n(a)&&ei(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Qn(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()}})),A()(Kn,"no-overlap",(function(e){var t,r=Qn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Qn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&$n(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Qn(Array.from(e).sort((function(e,t){return e.zoom-t.zoom})));try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.isVisible=Boolean(2&u.state),u.children&&(u.isVisible||1&u.state)){var c,l=Qn(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&&ei(u)}}catch(e){s.e(e)}finally{s.f()}})),A()(Kn,"never",(function(){})),Kn),Yn=function(){function e(t){var r=this;h()(this,e),A()(this,"opts",void 0),A()(this,"_requestScheduler",void 0),A()(this,"_cache",void 0),A()(this,"_dirty",void 0),A()(this,"_tiles",void 0),A()(this,"_cacheByteSize",void 0),A()(this,"_viewport",void 0),A()(this,"_zRange",void 0),A()(this,"_selectedTiles",void 0),A()(this,"_frameNumber",void 0),A()(this,"_modelMatrix",void 0),A()(this,"_modelMatrixInverse",void 0),A()(this,"_maxZoom",void 0),A()(this,"_minZoom",void 0),A()(this,"onTileLoad",void 0),A()(this,"_getCullBounds",Object(B._memoize)(Rn)),this.opts=t,this.onTileLoad=function(e){r.opts.onTileLoad(e),r.opts.maxCacheByteSize&&(r._cacheByteSize+=e.byteLength,r._resizeCache())},this._requestScheduler=new Xn({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._modelMatrix=new Xr,this._modelMatrixInverse=new Xr,this.setOptions(t)}return C()(e,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return null!==this._selectedTiles&&this._selectedTiles.every((function(e){return e.isLoaded}))}},{key:"needsReload",get:function(){return null!==this._selectedTiles&&this._selectedTiles.some((function(e){return e.needsReload}))}},{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=Qn(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=Qn(this._cache.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value,n=this._cache.get(r);this._selectedTiles&&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 Xr(i),o=!a.equals(this._modelMatrix);if(this._viewport&&e.equals(this._viewport)&&lt(this._zRange,n)&&!o)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((function(e){return t._getTile(e.index,!0)})));else{o&&(this._modelMatrixInverse=a.clone().invert(),this._modelMatrix=a),this._viewport=e,this._zRange=n;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:"isTileVisible",value:function(e,t){if(!e.isVisible)return!1;if(t&&this._viewport){var r=Rn({viewport:this._viewport,z:this._zRange,cullRect:t}),n=M()(r,4),i=n[0],a=n[1],o=n[2],s=n[3],u=e.bbox;if("west"in u)return u.west<o&&u.east>i&&u.south<s&&u.north>a;var c=Math.min(u.top,u.bottom),l=Math.max(u.top,u.bottom);return u.left<o&&u.right>i&&c<s&&l>a}return!0}},{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 Gn({viewport:t,maxZoom:r,minZoom:n,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:a,modelMatrixInverse:o,zoomOffset:s.zoomOffset})}},{key:"getTileId",value:function(e){return"".concat(e.x,"-").concat(e.y,"-").concat(e.z)}},{key:"getTileZoom",value:function(e){return e.z}},{key:"getTileMetadata",value:function(e){var t=this.opts.tileSize;return{bbox:Ln(this._viewport,e.x,e.y,e.z,t)}}},{key:"getParentIndex",value:function(e){return{x:Math.floor(e.x/2),y:Math.floor(e.y/2),z:e.z-1}}},{key:"updateTileStates",value:function(){var e,t=this.opts.refinementStrategy||"best-available",r=new Array(this._cache.size),n=0,i=Qn(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=Qn(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:Zn[t])(Array.from(this._cache.values())),n=0;var c,l=Qn(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=Qn(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=Qn(t.values());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.parent=null,n.children&&(n.children.length=0)}}catch(e){r.e(e)}finally{r.f()}var i,a=Qn(t.values());try{for(a.s();!(i=a.n()).done;){var o=i.value,s=this._getNearestAncestor(o);o.parent=s,null!=s&&s.children&&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=Qn(e);try{for(a.s();!(i=a.n()).done;){var o=M()(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.zoom-t.zoom})),this._dirty=!1)}},{key:"_getTile",value:function(e,t){var r=this.getTileId(e),n=this._cache.get(r),i=!1;return!n&&t?(n=new Fe(e),Object.assign(n,this.getTileMetadata(n.index)),Object.assign(n,{id:r,zoom:this.getTileZoom(n.index)}),i=!0,this._cache.set(r,n),this._dirty=!0):n&&n.needsReload&&(i=!0),n&&i&&n.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),n}},{key:"_getNearestAncestor",value:function(e){for(var t=this._minZoom,r=void 0===t?0:t,n=e.index;this.getTileZoom(n)>r;){n=this.getParentIndex(n);var i=this._getTile(n);if(i)return i}return null}}]),e}();function $n(e){for(var t=e;t;){if(t.isLoaded||t.content)return t.state|=2,!0;t=t.parent}return!1}function ei(e){var t,r=Qn(e.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.isLoaded||n.content?n.state|=2:ei(n)}}catch(e){r.e(e)}finally{r.f()}}function ti(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 ri(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ti(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ni(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 y()(this,r)}}var ii={TilesetClass:Yn,data:{type:"data",value:[]},dataComparator:kn.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},ai=function(e){p()(r,e);var t=ni(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var e,t;null===(e=this.state)||void 0===e||null===(t=e.tileset)||void 0===t||t.finalize()}},{key:"isLoaded",get:function(){var e,t;return null===(e=this.state)||void 0===e?void 0:null===(t=e.tileset)||void 0===t?void 0:t.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.changeFlags,r=this.state.tileset,n=t.propsOrDataChanged||t.updateTriggersChanged,i=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),i?r.reloadAll():this.state.tileset.tiles.forEach((function(e){e.layers=null}))):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var e=this.props,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="string"==typeof r||Array.isArray(r)?In(r,e):null,n?n(e):i&&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(ri(ri({},e.props),{},{id:"".concat(e.id,"-").concat(t.id),data:t.content,_offset:0,tile:t}));t.layers=Object(B._flatten)(n,Boolean).map((function(e){return e.clone(ri({tile:t},r))}))}else;return t.layers}))}},{key:"filterSubLayer",value:function(e){var t=e.layer,r=e.cullRect,n=t.props.tile;return this.state.tileset.isTileVisible(n,r)}}]),r}(B.CompositeLayer);A()(ai,"defaultProps",ii),A()(ai,"layerName","TileLayer");var oi=r(15),si=r.n(oi);function ui(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 ci(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ui(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ui(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function li(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 y()(this,r)}}var fi=function(e){p()(r,e);var t=li(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"getShaders",value:function(){var e=si()(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(){si()(m()(r.prototype),"initializeState",this).call(this),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=ci(ci({},e.uniforms),{},{fadeTrail:n,trailLength:i,currentTime:a}),si()(m()(r.prototype),"draw",this).call(this,e)}}]),r}(B.PathLayer);A()(fi,"layerName","TripsLayer"),A()(fi,"defaultProps",{fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(e){return e.timestamps}}});var hi=r(23),di=r(12),pi=r.n(di),vi=r(9),yi=r.n(vi);function gi(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 y()(this,r)}}function mi(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 bi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mi(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ai(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 Bi(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 Bi(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 Bi(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 wi(e,t){t=void 0===t?e[0][0]:t;var r,n=Ai(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 _i(e,t,r){var n=Object(hi.h3ToGeo)(e),i=M()(n,2),a=i[0],o=i[1],s=t.length;wi(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c<u;c++)t[c][0]=ct(o,t[c][0],r),t[c][1]=ct(a,t[c][1],r)}function xi(e,t,r){var n=e(t,r),i=Object(hi.h3ToGeo)(n),a=M()(i,2),o=a[0];return[a[1],o]}function Ci(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=Object(hi.h3ToGeoBoundary)(e,!0);return 1!==t?_i(e,r,t):wi(r),r}var Oi=bi(bi({},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}),Ei=function(e){p()(r,e);var t=gi(r);function r(){var e;h()(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i)),A()(pi()(e),"state",void 0),e}return C()(r,[{key:"initializeState",value:function(){r._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{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.changeFlags;if(!0!==t.highPrecision&&(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagon)){var n=this._calculateH3DataProps();this.setState(n)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(){var e,t=-1,r=!1,n=!1,i=Object(B.createIterable)(this.props.data),a=i.iterable,o=i.objectInfo,s=Ai(a);try{for(s.s();!(e=s.n()).done;){var u=e.value;o.index++;var c=this.props.getHexagon(u,o),l=Object(hi.h3GetResolution)(c);if(t<0){if(t=l,!this.props.highPrecision)break}else if(t!==l){n=!0;break}if(Object(hi.h3IsPentagon)(c)){r=!0;break}}}catch(e){s.e(e)}finally{s.f()}return{resolution:t,edgeLengthKM:t>=0?Object(hi.edgeLength)(t,"km"):0,hasMultipleRes:n,hasPentagon:r}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var e=this.state,t=e.resolution,r=e.hasPentagon,n=e.hasMultipleRes,i=this.context.viewport;return Boolean(null==i?void 0:i.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(hi.geoToH3)(e.latitude,e.longitude,r);if(i!==a){if(i){var o=Object(hi.h3Distance)(i,a);if(o>=0&&o*n<10)return}var s=e.distanceScales.unitsPerMeter,u=Ci(a),c=Object(hi.h3ToGeo)(a),l=M()(c,2),f=l[0],h=l[1],d=e.projectFlat([h,f]),p=M()(d,2),v=p[0],y=p[1];u=u.map((function(t){var r=e.projectFlat(t);return[(r[0]-v)/s[0],(r[1]-y)/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,v=e.getLineWidth,y=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:v,transitions:y,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"===yi()(e)?bi(bi({},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 function(e){var t,r=new Float64Array(2*e.length),n=0,i=Ai(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;r[n++]=a[0],r[n++]=a[1]}}catch(e){i.e(e)}finally{i.f()}return r}(Ci(r(e,t),i))}})}},{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:xi.bind(null,r)})}}]),r}(B.CompositeLayer);function Ti(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 Si(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 Si(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 Si(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 ki(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 y()(this,r)}}A()(Ei,"defaultProps",Oi),A()(Ei,"layerName","H3HexagonLayer"),A()(Ei,"_checkH3Lib",(function(){}));var Mi=function(e){p()(r,e);var t=ki(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"initializeState",value:function(){Ei._checkH3Lib()}},{key:"updateState",value:function(e){var t=e.props,r=e.changeFlags;if(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagons){var n,i=t.data,a=t.getHexagons,o=[],s=Object(B.createIterable)(i),u=s.iterable,c=s.objectInfo,l=Ti(u);try{for(l.s();!(n=l.n()).done;){var f=n.value;c.index++;var h,d=a(f,c),p=Ti(Object(hi.h3SetToMultiPolygon)(d,!0));try{for(p.s();!(h=p.n()).done;){var v=h.value;o.push(this.getSubLayerRow({polygon:v},f,c.index))}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}this.setState({polygons:o})}}},{key:"indexToBounds",value:function(){return{data:this.state.polygons,getPolygon:function(e){return e.polygon}}}}]),r}(S);A()(Mi,"layerName","H3ClusterLayer"),A()(Mi,"defaultProps",{getHexagons:{type:"accessor",value:function(e){return e.hexagons}}});var Ii=r(31);function Ri(){return!("object"===("undefined"==typeof process?"undefined":yi()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===yi()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===yi()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":yi()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}var Pi=Ri();function Fi(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var Di=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";h()(this,e),this.storage=Fi(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return C()(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 Li(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 ji={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 Gi(e){return"string"==typeof e?ji[e.toUpperCase()]||ji.WHITE:e}function Ui(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 Ni(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 Ni(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 Ni(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 Hi(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=Ui(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 Ji(e,t){if(!e)throw new Error(t||"Assertion failed")}var Vi={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":yi()(process))&&process},zi=Vi.window||Vi.self||Vi.global,Ki=Vi.process||{};console;function qi(){var e;if(Pi&&zi.performance)e=zi.performance.now();else if(Ki.hrtime){var t=Ki.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var Xi={debug:Pi&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Qi={enabled:!0,level:0};function Wi(){}var Zi={},Yi={once:!0};function $i(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}var ea=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.8.0-beta.5",this._startTs=qi(),this._deltaTs=qi(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Di("__probe-".concat(this.id,"__"),Qi),this.userData={},this.timeStamp("".concat(this.id," started")),Hi(this),Object.seal(this)}return C()(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((qi()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((qi()-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){Ji(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Xi.warn,arguments,Yi)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Xi.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,Xi.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Xi.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,Xi.debug||Xi.info,arguments,Yi)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Wi,r&&[r],{tag:$i(t)}):Wi}},{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)?Pi?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=Li(o,n,a);(e=console).log.apply(e,Le()(t))},o.src=t,Wi}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Le()(Li(t,n,a))),Wi}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,Le()(Li(c,n,a)))},c.src=t.toDataURL(),Wi}return Wi}({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(94)}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 Wi}({image:i,message:o,scale:u}):Wi}},{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(A()({},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||Wi)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=ra({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||Wi)}},{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()>=ta(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=ra({logLevel:e,message:t,args:n,opts:i}),Ji(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=qi();var o=i.tag||i.message;if(i.once){if(Zi[o])return Wi;Zi[o]=qi()}return t=na(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(Le()(i.args)))}return Wi}}]),e}();function ta(e){if(!e)return 0;var t;switch(yi()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Ji(Number.isFinite(t)&&t>=0),t}function ra(e){var t=e.logLevel,r=e.message;e.logLevel=ta(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(e.args=n,yi()(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=yi()(e.message);return Ji("string"===i||"object"===i),Object.assign(e,e.opts)}function na(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,Pi||"string"!=typeof i||(a&&(a=Gi(a),i="[".concat(a,"m").concat(i,"")),o&&(a=Gi(o),i="[".concat(o+10,"m").concat(i,""))),t=i}var i,a,o,s;return t}ea.VERSION="8.8.0-beta.5";var ia=new ea({id:"luma.gl"});function aa(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function oa(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version)))}function sa(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function ua(e){return aa(oa(e),"Invalid WebGLRenderingContext"),e}function ca(e){return aa(sa(e),"Requires WebGL2"),e}var la={};function fa(e,t){var r;la[e]=!0,void 0!==t&&(r=t,globalThis.console&&globalThis.console.error&&globalThis.console.error(r))}var ha=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};(ha.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 da,pa=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))&&(la[r]=!0)}while(0!==r);for(r in la)if(la[r])return delete la[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",globalThis.console&&globalThis.console.log&&globalThis.console.log(e),t.reset_()}),!0),this.reset_()};pa.prototype.VERTEX_ARRAY_BINDING_OES=34229,pa.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 ha(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},pa.prototype.createVertexArrayOES=function(){var e=new ha(this);return this.vertexArrayObjects.push(e),e},pa.prototype.deleteVertexArrayOES=function(e){e.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(e),1),this.currentVertexArrayObject===e&&this.bindVertexArrayOES(null)},pa.prototype.isVertexArrayOES=function(e){return!!(e&&e instanceof ha&&e.hasBeenBound&&e.ext===this)},pa.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 fa(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var va,ya=function(e){return sa(e)?void 0:0},ga=(da={},A()(da,3074,(function(e){return sa(e)?void 0:36064})),A()(da,35723,(function(e){return sa(e)?void 0:4352})),A()(da,35977,ya),A()(da,32937,ya),A()(da,36795,(function(e,t){var r=sa(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})),A()(da,37445,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),A()(da,37446,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),A()(da,34047,(function(e,t){var r=e.luma.extensions.EXT_texture_filter_anisotropic;return r?t(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),A()(da,32883,ya),A()(da,35071,ya),A()(da,37447,ya),A()(da,36063,(function(e,t){if(!sa(e)){var r=e.getExtension("WEBGL_draw_buffers");return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),A()(da,35379,ya),A()(da,35374,ya),A()(da,35377,ya),A()(da,34852,(function(e){if(!sa(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}})),A()(da,36203,(function(e){return e.getExtension("OES_element_index")?2147483647:65535})),A()(da,33001,(function(e){return e.getExtension("OES_element_index")?16777216:65535})),A()(da,33e3,(function(e){return 16777216})),A()(da,37157,ya),A()(da,35373,ya),A()(da,35657,ya),A()(da,36183,ya),A()(da,37137,ya),A()(da,34045,ya),A()(da,35978,ya),A()(da,35979,ya),A()(da,35968,ya),A()(da,35376,ya),A()(da,35375,ya),A()(da,35659,ya),A()(da,37154,ya),A()(da,35371,ya),A()(da,35658,ya),A()(da,35076,ya),A()(da,35077,ya),A()(da,35380,ya),da);var ma,ba,Aa,Ba=(va={},A()(va,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){aa(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),A()(va,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){aa(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),A()(va,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){aa(!1)}}),A()(va,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){aa(!1)},deleteQuery:function(){aa(!1)},beginQuery:function(){aa(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),va),wa={readBuffer:function(e,t,r){sa(e)&&t(r)},getVertexAttrib:function(e,t,r,n){var i,a=function(e,t){return{webgl2:sa(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(!sa(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(!sa(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=ga[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 _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 xa(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 xa(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 xa(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){var r=t.extension,n=t.target,i=t.target2,a=Ba[r];aa(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()}globalThis.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 pa(this)),this.__OESVertexArrayObject))}}}(e),function(e){e.luma.extensions={};var t,r=_a(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=_a(Object.getOwnPropertyNames(t));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&Ca(e,{extension:i,target:e.luma,target2:e})}}catch(e){n.e(e)}finally{n.f()}}(e,Ba),function(e,t){var r=t.target,n=t.target2;Object.keys(wa).forEach((function(t){if("function"==typeof wa[t]){var i=e[t]?e[t].bind(e):function(){},a=wa[t].bind(null,e,i);r[t]=a,n[t]=a}}))}(e,{target:t,target2:e}),t.polyfilled=!0),e};var Oa=(ma={},A()(ma,3042,!1),A()(ma,32773,new Float32Array([0,0,0,0])),A()(ma,32777,32774),A()(ma,34877,32774),A()(ma,32969,1),A()(ma,32968,0),A()(ma,32971,1),A()(ma,32970,0),A()(ma,3106,new Float32Array([0,0,0,0])),A()(ma,3107,[!0,!0,!0,!0]),A()(ma,2884,!1),A()(ma,2885,1029),A()(ma,2929,!1),A()(ma,2931,1),A()(ma,2932,513),A()(ma,2928,new Float32Array([0,1])),A()(ma,2930,!0),A()(ma,3024,!0),A()(ma,36006,null),A()(ma,2886,2305),A()(ma,33170,4352),A()(ma,2849,1),A()(ma,32823,!1),A()(ma,32824,0),A()(ma,10752,0),A()(ma,32938,1),A()(ma,32939,!1),A()(ma,3089,!1),A()(ma,3088,new Int32Array([0,0,1024,1024])),A()(ma,2960,!1),A()(ma,2961,0),A()(ma,2968,4294967295),A()(ma,36005,4294967295),A()(ma,2962,519),A()(ma,2967,0),A()(ma,2963,4294967295),A()(ma,34816,519),A()(ma,36003,0),A()(ma,36004,4294967295),A()(ma,2964,7680),A()(ma,2965,7680),A()(ma,2966,7680),A()(ma,34817,7680),A()(ma,34818,7680),A()(ma,34819,7680),A()(ma,2978,[0,0,1024,1024]),A()(ma,3333,4),A()(ma,3317,4),A()(ma,37440,!1),A()(ma,37441,!1),A()(ma,37443,37444),A()(ma,35723,4352),A()(ma,36010,null),A()(ma,35977,!1),A()(ma,3330,0),A()(ma,3332,0),A()(ma,3331,0),A()(ma,3314,0),A()(ma,32878,0),A()(ma,3316,0),A()(ma,3315,0),A()(ma,32877,0),ma),Ea=function(e,t,r){return t?e.enable(r):e.disable(r)},Ta=function(e,t,r){return e.hint(r,t)},Sa=function(e,t,r){return e.pixelStorei(r,t)};function ka(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var Ma=(ba={},A()(ba,3042,Ea),A()(ba,32773,(function(e,t){return e.blendColor.apply(e,Le()(t))})),A()(ba,32777,"blendEquation"),A()(ba,34877,"blendEquation"),A()(ba,32969,"blendFunc"),A()(ba,32968,"blendFunc"),A()(ba,32971,"blendFunc"),A()(ba,32970,"blendFunc"),A()(ba,3106,(function(e,t){return e.clearColor.apply(e,Le()(t))})),A()(ba,3107,(function(e,t){return e.colorMask.apply(e,Le()(t))})),A()(ba,2884,Ea),A()(ba,2885,(function(e,t){return e.cullFace(t)})),A()(ba,2929,Ea),A()(ba,2931,(function(e,t){return e.clearDepth(t)})),A()(ba,2932,(function(e,t){return e.depthFunc(t)})),A()(ba,2928,(function(e,t){return e.depthRange.apply(e,Le()(t))})),A()(ba,2930,(function(e,t){return e.depthMask(t)})),A()(ba,3024,Ea),A()(ba,35723,Ta),A()(ba,36006,(function(e,t){var r=sa(e)?36009:36160;return e.bindFramebuffer(r,t)})),A()(ba,2886,(function(e,t){return e.frontFace(t)})),A()(ba,33170,Ta),A()(ba,2849,(function(e,t){return e.lineWidth(t)})),A()(ba,32823,Ea),A()(ba,32824,"polygonOffset"),A()(ba,10752,"polygonOffset"),A()(ba,35977,Ea),A()(ba,32938,"sampleCoverage"),A()(ba,32939,"sampleCoverage"),A()(ba,3089,Ea),A()(ba,3088,(function(e,t){return e.scissor.apply(e,Le()(t))})),A()(ba,2960,Ea),A()(ba,2961,(function(e,t){return e.clearStencil(t)})),A()(ba,2968,(function(e,t){return e.stencilMaskSeparate(1028,t)})),A()(ba,36005,(function(e,t){return e.stencilMaskSeparate(1029,t)})),A()(ba,2962,"stencilFuncFront"),A()(ba,2967,"stencilFuncFront"),A()(ba,2963,"stencilFuncFront"),A()(ba,34816,"stencilFuncBack"),A()(ba,36003,"stencilFuncBack"),A()(ba,36004,"stencilFuncBack"),A()(ba,2964,"stencilOpFront"),A()(ba,2965,"stencilOpFront"),A()(ba,2966,"stencilOpFront"),A()(ba,34817,"stencilOpBack"),A()(ba,34818,"stencilOpBack"),A()(ba,34819,"stencilOpBack"),A()(ba,2978,(function(e,t){return e.viewport.apply(e,Le()(t))})),A()(ba,3333,Sa),A()(ba,3317,Sa),A()(ba,37440,Sa),A()(ba,37441,Sa),A()(ba,37443,Sa),A()(ba,3330,Sa),A()(ba,3332,Sa),A()(ba,3331,Sa),A()(ba,36010,(function(e,t){return e.bindFramebuffer(36008,t)})),A()(ba,3314,Sa),A()(ba,32878,Sa),A()(ba,3316,Sa),A()(ba,3315,Sa),A()(ba,32877,Sa),A()(ba,"framebuffer",(function(e,t){var r=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,r)})),A()(ba,"blend",(function(e,t){return t?e.enable(3042):e.disable(3042)})),A()(ba,"blendColor",(function(e,t){return e.blendColor.apply(e,Le()(t))})),A()(ba,"blendEquation",(function(e,t){t=ka(t)?t:[t,t],e.blendEquationSeparate.apply(e,Le()(t))})),A()(ba,"blendFunc",(function(e,t){t=ka(t)&&2===t.length?[].concat(Le()(t),Le()(t)):t,e.blendFuncSeparate.apply(e,Le()(t))})),A()(ba,"clearColor",(function(e,t){return e.clearColor.apply(e,Le()(t))})),A()(ba,"clearDepth",(function(e,t){return e.clearDepth(t)})),A()(ba,"clearStencil",(function(e,t){return e.clearStencil(t)})),A()(ba,"colorMask",(function(e,t){return e.colorMask.apply(e,Le()(t))})),A()(ba,"cull",(function(e,t){return t?e.enable(2884):e.disable(2884)})),A()(ba,"cullFace",(function(e,t){return e.cullFace(t)})),A()(ba,"depthTest",(function(e,t){return t?e.enable(2929):e.disable(2929)})),A()(ba,"depthFunc",(function(e,t){return e.depthFunc(t)})),A()(ba,"depthMask",(function(e,t){return e.depthMask(t)})),A()(ba,"depthRange",(function(e,t){return e.depthRange.apply(e,Le()(t))})),A()(ba,"dither",(function(e,t){return t?e.enable(3024):e.disable(3024)})),A()(ba,"derivativeHint",(function(e,t){e.hint(35723,t)})),A()(ba,"frontFace",(function(e,t){return e.frontFace(t)})),A()(ba,"mipmapHint",(function(e,t){return e.hint(33170,t)})),A()(ba,"lineWidth",(function(e,t){return e.lineWidth(t)})),A()(ba,"polygonOffsetFill",(function(e,t){return t?e.enable(32823):e.disable(32823)})),A()(ba,"polygonOffset",(function(e,t){return e.polygonOffset.apply(e,Le()(t))})),A()(ba,"sampleCoverage",(function(e,t){return e.sampleCoverage.apply(e,Le()(t))})),A()(ba,"scissorTest",(function(e,t){return t?e.enable(3089):e.disable(3089)})),A()(ba,"scissor",(function(e,t){return e.scissor.apply(e,Le()(t))})),A()(ba,"stencilTest",(function(e,t){return t?e.enable(2960):e.disable(2960)})),A()(ba,"stencilMask",(function(e,t){var r=t=ka(t)?t:[t,t],n=M()(r,2),i=n[0],a=n[1];e.stencilMaskSeparate(1028,i),e.stencilMaskSeparate(1029,a)})),A()(ba,"stencilFunc",(function(e,t){var r=t=ka(t)&&3===t.length?[].concat(Le()(t),Le()(t)):t,n=M()(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)})),A()(ba,"stencilOp",(function(e,t){var r=t=ka(t)&&3===t.length?[].concat(Le()(t),Le()(t)):t,n=M()(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)})),A()(ba,"viewport",(function(e,t){return e.viewport.apply(e,Le()(t))})),ba);function Ia(e,t,r){return void 0!==t[e]?t[e]:r[e]}var Ra={blendEquation:function(e,t,r){return e.blendEquationSeparate(Ia(32777,t,r),Ia(34877,t,r))},blendFunc:function(e,t,r){return e.blendFuncSeparate(Ia(32969,t,r),Ia(32968,t,r),Ia(32971,t,r),Ia(32970,t,r))},polygonOffset:function(e,t,r){return e.polygonOffset(Ia(32824,t,r),Ia(10752,t,r))},sampleCoverage:function(e,t,r){return e.sampleCoverage(Ia(32938,t,r),Ia(32939,t,r))},stencilFuncFront:function(e,t,r){return e.stencilFuncSeparate(1028,Ia(2962,t,r),Ia(2967,t,r),Ia(2963,t,r))},stencilFuncBack:function(e,t,r){return e.stencilFuncSeparate(1029,Ia(34816,t,r),Ia(36003,t,r),Ia(36004,t,r))},stencilOpFront:function(e,t,r){return e.stencilOpSeparate(1028,Ia(2964,t,r),Ia(2965,t,r),Ia(2966,t,r))},stencilOpBack:function(e,t,r){return e.stencilOpSeparate(1029,Ia(34817,t,r),Ia(34818,t,r),Ia(34819,t,r))}},Pa={enable:function(e,t){return e(A()({},t,!0))},disable:function(e,t){return e(A()({},t,!1))},pixelStorei:function(e,t,r){return e(A()({},t,r))},hint:function(e,t,r){return e(A()({},t,r))},bindFramebuffer:function(e,t,r){var n;switch(t){case 36160:return e((n={},A()(n,36006,r),A()(n,36010,r),n));case 36009:return e(A()({},36006,r));case 36008:return e(A()({},36010,r));default:return null}},blendColor:function(e,t,r,n,i){return e(A()({},32773,new Float32Array([t,r,n,i])))},blendEquation:function(e,t){var r;return e((r={},A()(r,32777,t),A()(r,34877,t),r))},blendEquationSeparate:function(e,t,r){var n;return e((n={},A()(n,32777,t),A()(n,34877,r),n))},blendFunc:function(e,t,r){var n;return e((n={},A()(n,32969,t),A()(n,32968,r),A()(n,32971,t),A()(n,32970,r),n))},blendFuncSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,32969,t),A()(a,32968,r),A()(a,32971,n),A()(a,32970,i),a))},clearColor:function(e,t,r,n,i){return e(A()({},3106,new Float32Array([t,r,n,i])))},clearDepth:function(e,t){return e(A()({},2931,t))},clearStencil:function(e,t){return e(A()({},2961,t))},colorMask:function(e,t,r,n,i){return e(A()({},3107,[t,r,n,i]))},cullFace:function(e,t){return e(A()({},2885,t))},depthFunc:function(e,t){return e(A()({},2932,t))},depthRange:function(e,t,r){return e(A()({},2928,new Float32Array([t,r])))},depthMask:function(e,t){return e(A()({},2930,t))},frontFace:function(e,t){return e(A()({},2886,t))},lineWidth:function(e,t){return e(A()({},2849,t))},polygonOffset:function(e,t,r){var n;return e((n={},A()(n,32824,t),A()(n,10752,r),n))},sampleCoverage:function(e,t,r){var n;return e((n={},A()(n,32938,t),A()(n,32939,r),n))},scissor:function(e,t,r,n,i){return e(A()({},3088,new Int32Array([t,r,n,i])))},stencilMask:function(e,t){var r;return e((r={},A()(r,2968,t),A()(r,36005,t),r))},stencilMaskSeparate:function(e,t,r){return e(A()({},1028===t?2968:36005,r))},stencilFunc:function(e,t,r,n){var i;return e((i={},A()(i,2962,t),A()(i,2967,r),A()(i,2963,n),A()(i,34816,t),A()(i,36003,r),A()(i,36004,n),i))},stencilFuncSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,1028===t?2962:34816,r),A()(a,1028===t?2967:36003,n),A()(a,1028===t?2963:36004,i),a))},stencilOp:function(e,t,r,n){var i;return e((i={},A()(i,2964,t),A()(i,2965,r),A()(i,2966,n),A()(i,34817,t),A()(i,34818,r),A()(i,34819,n),i))},stencilOpSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,1028===t?2964:34817,r),A()(a,1028===t?2965:34818,n),A()(a,1028===t?2966:34819,i),a))},viewport:function(e,t,r,n,i){return e(A()({},2978,[t,r,n,i]))}},Fa=function(e,t){return e.isEnabled(t)},Da=(Aa={},A()(Aa,3042,Fa),A()(Aa,2884,Fa),A()(Aa,2929,Fa),A()(Aa,3024,Fa),A()(Aa,32823,Fa),A()(Aa,32926,Fa),A()(Aa,32928,Fa),A()(Aa,3089,Fa),A()(Aa,2960,Fa),A()(Aa,35977,Fa),Aa);function La(e){for(var t in e)return!1;return!0}function ja(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 Ga(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 Ua(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 Na(e){var t=e.useProgram.bind(e);e.useProgram=function(r){e.state.program!==r&&(t(r),e.state.program=r)}}var Ha=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?Xa(t):Object.assign({},Oa),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return C()(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){aa(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];qa(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){aa(void 0!==i);var a=e[i],o=this.cache[i];ja(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(aa(void 0!==i),!e.state){var a=globalThis.polyfillContext;for(var o in a&&a(e),e.state=new Ha(e,{copyState:i}),Na(e),Pa){var s=Pa[o];Ua(e,o,s)}Ga(e,"getParameter"),Ga(e,"isEnabled")}return e.state.enable=n,e}function Va(e){aa(e.state),e.state.pop()}function za(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 Ka(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 Ka(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 Ka(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 qa(e,t){if(aa(oa(e),"setParameters requires a WebGL context"),!La(t)){var r={};for(var n in t){var i=Number(n),a=Ma[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,Ra[s])(e,t,o)}}}function Xa(e,t){if("number"==typeof(t=t||Oa)){var r=t,n=Da[r];return n?n(e,r):e.getParameter(r)}var i,a={},o=za(Array.isArray(t)?t:Object.keys(t));try{for(o.s();!(i=o.n()).done;){var s=i.value,u=Da[s];a[s]=u?u(e,Number(s)):e.getParameter(Number(s))}}catch(e){o.e(e)}finally{o.f()}return a}function Qa(e,t,r){if(La(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),qa(e,t),a)n=r(e),Va(e);else try{n=r(e)}finally{Va(e)}return n}function Wa(){return!("object"===("undefined"==typeof process?"undefined":yi()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===yi()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===yi()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":yi()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}var Za=Wa();function Ya(){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 $a=function(){function e(t,r){h()(this,e),this.name=t,this.type=r,this.sampleSize=1,this.reset()}return C()(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=Ya(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Ya()-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}(),eo=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 C()(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 $a?e:new $a(t,r)),this.stats[t]}}]),e}(),to=new(function(){function e(){h()(this,e),this.stats=new Map}return C()(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new eo({id:e})),this.stats.get(e)}}]),e}());if(globalThis.luma&&"8.5.14"!==globalThis.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat("8.5.14"));globalThis.luma||(Wa()&&ia.log(1,"luma.gl ".concat("8.5.14"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:"8.5.14",version:"8.5.14",log:ia,stats:to,globals:{modules:{},nodeIO:{}}});globalThis.luma;function ro(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function no(e,t){if("string"!=typeof t)return t;var r=Number(t);if(!isNaN(r))return r;var n=e[t=t.replace(/^.*\./,"")];return ro(void 0!==n,"Accessing undefined constant GL.".concat(t)),n}function io(e,t){for(var r in t=Number(t),e)if(e[r]===t)return"GL.".concat(r);return String(t)}var ao={};function oo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";ao[e]=ao[e]||1;var t=ao[e]++;return"".concat(e,"-").concat(t)}function so(e){return ro("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function uo(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 co(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 co(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 co(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 lo="Resource subclass must define virtual methods",fo=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h()(this,t),ua(e);var n=r.id,i=r.userData,a=void 0===i?{}:i;this.gl=e,this.gl2=e,this.id=n||oo(this[Symbol.toStringTag]),this.userData=a,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return C()(t,[{key:e,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||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]:{};ro(e=no(this.gl,e));var r=this.constructor.PARAMETERS||{},n=r[e];if(n){var i=sa(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=sa(this.gl),o={},s=r||Object.keys(i),u=uo(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?io(this.gl,c):c;o[h]=this.getParameter(c,t),n&&"GLenum"===l.type&&(o[h]=io(this.gl,o[h]))}}}catch(e){u.e(e)}finally{u.f()}return o}},{key:"setParameter",value:function(e,t){ro(e=no(this.gl,e));var r=(this.constructor.PARAMETERS||{})[e];if(r){var n=sa(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=no(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 ia.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(lo)}},{key:"_deleteHandle",value:function(){throw new Error(lo)}},{key:"_bindHandle",value:function(e){throw new Error(lo)}},{key:"_getOptsFromHandle",value:function(){throw new Error(lo)}},{key:"_getParameter",value:function(e,t){throw new Error(lo)}},{key:"_setParameter",value:function(e,t){throw new Error(lo)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this[Symbol.toStringTag],t=to.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[Symbol.toStringTag];to.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[Symbol.toStringTag],r=to.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[Symbol.toStringTag],t=to.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),t}(Symbol.toStringTag),ho=r(59),po=r.n(ho);function vo(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 yo(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 go(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 mo(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 bo(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";ia.removed("".concat(e,".").concat(c),l)()}for(var f in o)if(f in t){var h=o[f];ia.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(h))()}var d=null;for(var p in u)if(p in t){var v=u[p];ia.deprecated("".concat(e,".").concat(p),"".concat(e,".").concat(v))(),(d=d||Object.assign({},t))[v]=t[p],delete d[p]}return d||t}var Ao={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Bo={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},wo=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 C()(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=bo("Accessor",e,Bo)).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 yo(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return ro(e.size),yo(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 po()(e,[Ao].concat(r))}}]),e}();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 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 y()(this,r)}}var xo,Co,Oo,Eo={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"},To={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Eo},So={removedProps:Eo},ko=function(e,t){p()(n,e);var r=_o(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,n),(t=r.call(this,e,i)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),t.target=i.target||(t.gl.webgl2?36662:34962),t.initialize(i),Object.seal(pi()(t)),t}return C()(n,[{key:t,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/wo.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/wo.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=bo("Buffer",e,To),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=bo("Buffer",e,So))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new wo(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;ro(r);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(ca(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 ca(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;ca(this.gl);var c,l,f=yo(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 ro((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):(ro(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;ro(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=vo(e);return ro(i),this.setAccessor(new wo(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;ro(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/yo(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new wo(this.accessor,{type:vo(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 ia.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return ia.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(e){return ia.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return ia.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new wo(this.accessor,e),this}}]),n}(fo,Symbol.toStringTag),Mo=(xo={},A()(xo,6407,{dataFormat:6407,types:[5121,33635]}),A()(xo,6408,{dataFormat:6408,types:[5121,32819,32820]}),A()(xo,6406,{dataFormat:6406,types:[5121]}),A()(xo,6409,{dataFormat:6409,types:[5121]}),A()(xo,6410,{dataFormat:6410,types:[5121]}),A()(xo,33326,{dataFormat:6403,types:[5126],gl2:!0}),A()(xo,33328,{dataFormat:33319,types:[5126],gl2:!0}),A()(xo,34837,{dataFormat:6407,types:[5126],gl2:!0}),A()(xo,34836,{dataFormat:6408,types:[5126],gl2:!0}),xo),Io=(Co={},A()(Co,6403,1),A()(Co,36244,1),A()(Co,33319,2),A()(Co,33320,2),A()(Co,6407,3),A()(Co,36248,3),A()(Co,6408,4),A()(Co,36249,4),A()(Co,6402,1),A()(Co,34041,1),A()(Co,6406,1),A()(Co,6409,1),A()(Co,6410,2),Co),Ro=(Oo={},A()(Oo,5126,4),A()(Oo,5125,4),A()(Oo,5124,4),A()(Oo,5123,2),A()(Oo,5122,2),A()(Oo,5131,2),A()(Oo,5120,1),A()(Oo,5121,1),Oo);function Po(e,t){var r=Mo[t];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=sa(e)&&r.gl2||r.gl1;return"string"==typeof n?e.getExtension(n):n}function Fo(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 Do(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 Lo(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 Lo(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 Lo(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 jo(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 y()(this,r)}}var Go=[9729,9728],Uo=globalThis.WebGLBuffer||function(){},No=function(e,t){p()(n,e);var r=jo(n);function n(e,t){var i;h()(this,n);var a=t.id,o=void 0===a?oo("texture"):a,s=t.handle,u=t.target;return(i=r.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 C()(n,[{key:t,get:function(){return"Texture"}},{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,v=void 0===p?{}:p,y=t.textureUnit,g=void 0===y?void 0:y;r||(r=a);var m=t.width,b=t.height,A=t.dataFormat,B=t.type,w=t.compressed,_=void 0!==w&&w,x=t.mipmaps,C=void 0===x||x,O=t.depth,E=void 0===O?0:O,T=this._deduceParameters({format:s,type:B,dataFormat:A,compressed:_,data:r,width:m,height:b});return m=T.width,b=T.height,_=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()&&(ia.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:v,compressed:_}),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()?(ia.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Qa(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,v=e.data,y=void 0===v?null:v,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,_=e.dataFormat,x=void 0===_?this.dataFormat:_,C=e.compressed,O=void 0!==C&&C;y||(y=i);var E=this._deduceParameters({format:u,type:m,dataFormat:x,compressed:O,data:y,width:A,height:w});m=E.type,x=E.dataFormat,O=E.compressed,A=E.width,w=E.height;var T=this.gl;T.bindTexture(this.target,this.handle);var S,k,I=this._getDataType({data:y,compressed:O});y=I.data,S=I.dataType;var R=0;if(Qa(this.gl,p,(function(){switch(S){case"null":T.texImage2D(r,o,u,A,w,l,x,m,y);break;case"typed-array":T.texImage2D(r,o,u,A,w,l,x,m,y,h);break;case"buffer":(k=ca(T)).bindBuffer(35052,y.handle||y),k.texImage2D(r,o,u,A,w,l,x,m,h),k.bindBuffer(35052,null);break;case"browser-object":sa(T)?T.texImage2D(r,o,u,A,w,l,x,m,y):T.texImage2D(r,o,u,x,m,y);break;case"compressed":var e,t=Do(y.entries());try{for(t.s();!(e=t.n()).done;){var n=M()(e.value,2),i=n[0],a=n[1];T.compressedTexImage2D(r,i,a.format,a.width,a.height,l,a.data),R+=a.levelSize}}catch(e){t.e(e)}finally{t.f()}break;default:ro(!1,"Unknown image data type")}})),"compressed"===S)this._trackAllocatedMemory(R,"Texture");else if(y&&y.byteLength)this._trackAllocatedMemory(y.byteLength,"Texture");else{var P=Io[this.dataFormat]||4,F=Ro[this.type]||1;this._trackAllocatedMemory(this.width*this.height*P*F,"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,v=void 0===p?this.height:p,y=e.level,g=void 0===y?0:y,m=e.format,b=void 0===m?this.format:m,A=e.type,B=void 0===A?this.type:A,w=e.dataFormat,_=void 0===w?this.dataFormat:w,x=e.compressed,C=void 0!==x&&x,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:_,compressed:C,data:s,width:d,height:v});if(B=M.type,_=M.dataFormat,C=M.compressed,d=M.width,v=M.height,ro(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],v=I.shape[1]}s instanceof ko&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Qa(this.gl,k,(function(){if(C)t.gl.compressedTexSubImage2D(n,g,c,f,d,v,b,s);else if(null===s)t.gl.texSubImage2D(n,g,c,f,d,v,_,B,null);else if(ArrayBuffer.isView(s))t.gl.texSubImage2D(n,g,c,f,d,v,_,B,s,E);else if(s instanceof Uo){var e=ca(t.gl);e.bindBuffer(35052,s),e.texSubImage2D(n,g,c,f,d,v,_,B,E),e.bindBuffer(35052,null)}else if(sa(t.gl)){ca(t.gl).texSubImage2D(n,g,c,f,d,v,_,B,s)}else t.gl.texSubImage2D(n,g,c,f,_,B,s)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ia.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 ko?{data:t.handle,dataType:"buffer"}:t instanceof Uo?{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 ro(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"),ro(void 0===t||n.width===t,"Deduced texture width does not match supplied width"),ro(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:ro(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!sa(this.gl)&&(!(!this.width||!this.height)&&(!so(this.width)||!so(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===Go.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&&Po(e,r))&&(!n||Fo(e,r))),i}}]),n}(fo,Symbol.toStringTag),Ho="";function Jo(e,t){return ro("string"==typeof e),e=Ho+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 Vo(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 y()(this,r)}}var zo,Ko=function(e,t){p()(n,e);var r=Vo(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,n),ua(e),(i instanceof Promise||"string"==typeof i)&&(i={data:i}),"string"==typeof i.data&&(i=Object.assign({},i,{data:Jo(i.data)})),(t=r.call(this,e,Object.assign({},i,{target:3553}))).initialize(i),Object.seal(pi()(t)),t}return C()(n,[{key:t,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(e,t){return No.isSupported(e,t)}}]),n}(No,Symbol.toStringTag),qo="EXT_color_buffer_float",Xo=(zo={},A()(zo,33189,{bpp:2}),A()(zo,33190,{gl2:!0,bpp:3}),A()(zo,36012,{gl2:!0,bpp:4}),A()(zo,36168,{bpp:1}),A()(zo,34041,{bpp:4}),A()(zo,35056,{gl2:!0,bpp:4}),A()(zo,36013,{gl2:!0,bpp:5}),A()(zo,32854,{bpp:2}),A()(zo,36194,{bpp:2}),A()(zo,32855,{bpp:2}),A()(zo,33321,{gl2:!0,bpp:1}),A()(zo,33330,{gl2:!0,bpp:1}),A()(zo,33329,{gl2:!0,bpp:1}),A()(zo,33332,{gl2:!0,bpp:2}),A()(zo,33331,{gl2:!0,bpp:2}),A()(zo,33334,{gl2:!0,bpp:4}),A()(zo,33333,{gl2:!0,bpp:4}),A()(zo,33323,{gl2:!0,bpp:2}),A()(zo,33336,{gl2:!0,bpp:2}),A()(zo,33335,{gl2:!0,bpp:2}),A()(zo,33338,{gl2:!0,bpp:4}),A()(zo,33337,{gl2:!0,bpp:4}),A()(zo,33340,{gl2:!0,bpp:8}),A()(zo,33339,{gl2:!0,bpp:8}),A()(zo,32849,{gl2:!0,bpp:3}),A()(zo,32856,{gl2:!0,bpp:4}),A()(zo,32857,{gl2:!0,bpp:4}),A()(zo,36220,{gl2:!0,bpp:4}),A()(zo,36238,{gl2:!0,bpp:4}),A()(zo,36975,{gl2:!0,bpp:4}),A()(zo,36214,{gl2:!0,bpp:8}),A()(zo,36232,{gl2:!0,bpp:8}),A()(zo,36226,{gl2:!0,bpp:16}),A()(zo,36208,{gl2:!0,bpp:16}),A()(zo,33325,{gl2:qo,bpp:2}),A()(zo,33327,{gl2:qo,bpp:4}),A()(zo,34842,{gl2:qo,bpp:8}),A()(zo,33326,{gl2:qo,bpp:4}),A()(zo,33328,{gl2:qo,bpp:8}),A()(zo,34836,{gl2:qo,bpp:16}),A()(zo,35898,{gl2:qo,bpp:4}),zo);function Qo(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 y()(this,r)}}function Wo(e,t,r){var n=r[t];if(!n)return!1;var i=sa(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}var Zo=function(e,t){p()(n,e);var r=Qo(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,n),(t=r.call(this,e,i)).initialize(i),Object.seal(pi()(t)),t}return C()(n,[{key:t,get:function(){return"Renderbuffer"}},{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 ro(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&sa(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)*Xo[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||Wo(e,r,Xo)}},{key:"getSamplesForFormat",value:function(e,t){var r=t.format;return e.getInternalformatParameter(36161,r,32937)}}]),n}(fo,Symbol.toStringTag);function Yo(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)),ro(0!==f,"clear: bad arguments"),Qa(e,l,(function(){e.clear(f)}))}function $o(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;ca(e),Qa(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=M()(c,2),r=t[0],n=t[1];e.clearBufferfi(34041,0,r,n);break;default:ro(!1,"clear: bad arguments")}}))}function es(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 ro(!1),0}}function ts(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 y()(this,r)}}var rs=[34069,34070,34071,34072,34073,34074],ns=function(e,t){p()(i,e);var r,n=ts(i);function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,i),ua(e),(t=n.call(this,e,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(pi()(t)),t}return C()(i,[{key:t,get:function(){return"TextureCube"}},{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:(r=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v=this;return Pe.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(rs.map((function(e){var t=d[e];return Promise.all(Array.isArray(t)?t:[t])})));case 5:p=e.sent,this.bind(),rs.forEach((function(e,t){p[t].length>1&&!1!==v.opts.mipmaps&&ia.warn("".concat(v.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 r.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}}]),i}(No,Symbol.toStringTag);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;Reflect.construct(n,arguments,i)}else n.apply(this,arguments);return y()(this,r)}}ns.FACES=rs;Symbol.toStringTag;function as(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,v=ss(e),y=v.framebuffer,g=v.deleteFramebuffer;ro(y);var m=y.gl,b=y.handle,A=y.attachments;h=h||y.width,d=d||y.height,36064===c&&null===b&&(c=1028),ro(A[c]),f=us(f,p=p||A[c].type,s,h,d),p=p||vo(f);var B=m.bindFramebuffer(36160,b);return m.readPixels(n,a,h,d,s,p,f),m.bindFramebuffer(36160,B||null),g&&y.delete(),f}function os(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=as(e,{sourceAttachment:n}),s=e.width,u=e.height;u>a;){var c=mo({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}go({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 ss(e){return e instanceof hs?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,n=t.gl,i=t.width,a=t.height,o=t.id,new hs(n,Object.assign({},r,{id:"framebuffer-for-".concat(o),width:i,height:a,attachments:A()({},36064,t)}))),deleteFramebuffer:!0};var t,r,n,i,a,o}function us(e,t,r,n,i){return e||new(yo(t=t||5121,{clamped:!1}))(n*i*es(r))}function cs(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 ls(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 ls(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 ls(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 fs(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 y()(this,r)}}var hs=function(e,t){p()(n,e);var r=fs(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,n),(t=r.call(this,e,i)).width=null,t.height=null,t.attachments={},t.readBuffer=36064,t.drawBuffers=[36064],t.ownResources=[],t.initialize(i),Object.seal(pi()(t)),t}return C()(n,[{key:t,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=ca(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=ca(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,v=e.readBuffer,y=void 0===v?void 0:v,g=e.drawBuffers,m=void 0===g?void 0:g;if(ro(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:y,drawBuffers:m}),o&&p&&this.checkStatus()}},{key:"delete",value:function(){var e,t=cs(this.ownResources);try{for(t.s();!(e=t.n()).done;){e.value.delete()}}catch(e){t.e(e)}finally{t.f()}return si()(m()(n.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 ro(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&&ia.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){ro(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof Zo)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=M()(f,3),p=d[0],v=d[1],y=void 0===v?0:v,g=d[2],m=void 0===g?0:g;h=p,this._attachTexture({attachment:l,texture:p,layer:y,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(hs.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)&&Yo(this.gl,{color:r,depth:n,stencil:i}),o.forEach((function(t,r){$o(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 ia.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 ia.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 ia.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 ia.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 ia.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 ia.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=ca(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=io(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=cs(n);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=r?io(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?io(this.gl,o):o;r[s]=this.getAttachmentParameters(o,e)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(os(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>ia.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var r=os(this,{targetMaxHeight:100});return ia.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 Ko(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(a={},A()(a,10241,9729),A()(a,10240,9729),A()(a,10242,33071),A()(a,10243,33071),a)}),this.ownResources.push(o[36064]));return t&&r?((o=o||{})[33306]=new Zo(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new Zo(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(o[36096])):r&&ro(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof Zo?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:ca(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:ro(!1,"Illegal texture type")}o.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(e){var t,r=sa(t=this.gl)?t:null;r?r.readBuffer(e):ro(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,r=ca(t);if(r)r.drawBuffers(e);else{var n=t.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(e):ro(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||{},Ds)void 0===e.luma.caps[t]&&(e.luma.caps[t]=Us(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 n(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),n}(fo,Symbol.toStringTag);var ds;hs.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var ps="WEBGL2",vs="VERTEX_ARRAY_OBJECT",ys="TIMER_QUERY",gs="INSTANCED_RENDERING",ms="MULTIPLE_RENDER_TARGETS",bs="ELEMENT_INDEX_UINT32",As="BLEND_EQUATION_MINMAX",Bs="FLOAT_BLEND",ws="COLOR_ENCODING_SRGB",_s="TEXTURE_DEPTH",xs="TEXTURE_FLOAT",Cs="TEXTURE_HALF_FLOAT",Os="TEXTURE_FILTER_LINEAR_FLOAT",Es="TEXTURE_FILTER_LINEAR_HALF_FLOAT",Ts="TEXTURE_FILTER_ANISOTROPIC",Ss="COLOR_ATTACHMENT_RGBA32F",ks="COLOR_ATTACHMENT_FLOAT",Ms="COLOR_ATTACHMENT_HALF_FLOAT",Is="GLSL_FRAG_DATA",Rs="GLSL_FRAG_DEPTH",Ps="GLSL_DERIVATIVES",Fs="GLSL_TEXTURE_LOD";var Ds=(ds={},A()(ds,ps,[!1,!0]),A()(ds,vs,["OES_vertex_array_object",!0]),A()(ds,ys,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),A()(ds,gs,["ANGLE_instanced_arrays",!0]),A()(ds,ms,["WEBGL_draw_buffers",!0]),A()(ds,bs,["OES_element_index_uint",!0]),A()(ds,As,["EXT_blend_minmax",!0]),A()(ds,Bs,["EXT_float_blend"]),A()(ds,ws,["EXT_sRGB",!0]),A()(ds,_s,["WEBGL_depth_texture",!0]),A()(ds,xs,["OES_texture_float",!0]),A()(ds,Cs,["OES_texture_half_float",!0]),A()(ds,Os,["OES_texture_float_linear"]),A()(ds,Es,["OES_texture_half_float_linear"]),A()(ds,Ts,["EXT_texture_filter_anisotropic"]),A()(ds,Ss,[function(e){var t=new Ko(e,{format:6408,type:5126,dataFormat:6408}),r=new hs(e,{id:"test-framebuffer",check:!1,attachments:A()({},36064,t)}),n=r.getStatus();return t.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),A()(ds,ks,[!1,"EXT_color_buffer_float"]),A()(ds,Ms,["EXT_color_buffer_half_float"]),A()(ds,Is,["WEBGL_draw_buffers",!0]),A()(ds,Rs,["EXT_frag_depth",!0]),A()(ds,Ps,["OES_standard_derivatives",!0]),A()(ds,Fs,["EXT_shader_texture_lod",!0]),ds);function Ls(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 js(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 js(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 js(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 Gs(e,t){return function(e,t){return(t=Array.isArray(t)?t:[t]).every((function(t){return Us(e,t)}))}(e,t)}function Us(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=Ds[t];ro(n,t);var i=sa(e)&&n[1]||n[0];if("function"==typeof i)r=i(e);else if(Array.isArray(i)){r=!0;var a,o=Ls(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:ro(!1);return r}(e,t)),e.luma.caps[t]||ia.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}function Ns(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 Hs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ns(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ns(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Js=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},Gs(t,Fs)&&(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 C()(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=A()({},this.gl.TEXTURE_MIN_FILTER,a.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):r={data:a};var s=new Ko(this.gl,Hs({id:e.name||e.id,parameters:Hs(Hs({},i),o),pixelStore:A()({},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&&(ia.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]}))}},{key:"delete",value:function(){this.generatedTextures.forEach((function(e){return e.delete()}))}}]),e}();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){A()(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=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 y()(this,r)}}var qs=function(e){p()(r,e);var t=Ks(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"getShaders",value:function(){var e=si()(m()(r.prototype),"getShaders",this).call(this);return e.modules.push(Ii.pbr),zs(zs({},e),{},{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\n\n// Instance attributes\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\n\n// Outputs to fragment shader\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 // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md\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 (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 // set PBR data\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\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\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;si()(m()(r.prototype),"initializeState",this).call(this);var t=this.getAttributeManager();e&&t.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(e){si()(m()(r.prototype),"updateState",this).call(this,e);var t=e.props,n=e.oldProps;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,pickFeatureIds:Boolean(t)}),si()(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 Ii.Model(this.context.gl,zs(zs({},this.getShaders()),{},{id:n,geometry:e,defines:zs(zs(zs({},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 Js(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:zs({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);A()(qs,"layerName","MeshLayer"),A()(qs,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var Xs=function(e){return"boolean"==typeof e},Qs=function(e){return"function"==typeof e},Ws=function(e){return null!==e&&"object"===yi()(e)},Zs=function(e){return Ws(e)&&e.constructor==={}.constructor},Ys=function(e){return e&&"function"==typeof e[Symbol.iterator]},$s=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},eu=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},tu=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},ru=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||Ws(e)&&Qs(e.tee)&&Qs(e.cancel)&&Qs(e.getReader)}(e)||function(e){return Ws(e)&&Qs(e.read)&&Qs(e.pipe)&&Xs(e.readable)}(e)};function nu(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function iu(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 au(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?iu(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ou(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function su(e){var t,r,n;return nu(e,"null loader"),nu(ou(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=au(au({},e=e[0]),{},{options:au(au({},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 uu="",cu={};function lu(e){for(var t in cu)if(e.startsWith(t)){var r=cu[t];e=e.replace(t,r)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(uu).concat(e)),e}var fu=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,hu=/^([-\w.]+\/[-\w.+]+)/;function du(e){var t=hu.exec(e);return t?t[1]:e}function pu(e){var t=fu.exec(e);return t?t[1]:""}var vu=/\?.*/;function yu(e){if(eu(e)){var t=mu(e.url||"");return{url:t,type:du(e.headers.get("content-type")||"")||pu(t)}}return tu(e)?{url:mu(e.name||""),type:e.type||""}:"string"==typeof e?{url:mu(e),type:pu(e)}:{url:"",type:""}}function gu(e){return eu(e)?e.headers["content-length"]||-1:tu(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer?e.byteLength:ArrayBuffer.isView(e)?e.byteLength:-1}function mu(e){return e.replace(vu,"")}function bu(e){return Au.apply(this,arguments)}function Au(){return(Au=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!eu(t)){e.next=2;break}return e.abrupt("return",t);case 2:return r={},(n=gu(t))>=0&&(r["content-length"]=String(n)),i=yu(t),a=i.url,(o=i.type)&&(r["content-type"]=o),e.next=9,Cu(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 Bu(e){return wu.apply(this,arguments)}function wu(){return(wu=Ie()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,_u(t);case 3:throw r=e.sent,new Error(r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _u(e){return xu.apply(this,arguments)}function xu(){return(xu=Ie()(Pe.a.mark((function e(t){var r,n,i;return Pe.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(0,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 Cu(e){return Ou.apply(this,arguments)}function Ou(){return(Ou=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.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=Eu(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 Eu(e){for(var t="",r=new Uint8Array(e),n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function Tu(e,t){return Su.apply(this,arguments)}function Su(){return(Su=Ie()(Pe.a.mark((function e(t,r){var n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=7;break}return t=lu(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,bu(t);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ku=new ea({id:"loaders.gl"}),Mu=function(){function e(){h()(this,e)}return C()(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}(),Iu=function(){function e(){h()(this,e),Un(this,"console",void 0),this.console=console}return C()(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}(),Ru=("undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof global&&global,"undefined"!=typeof document&&document,Boolean("object"!==("undefined"==typeof process?"undefined":yi()(process))||"[object process]"!==String(process)||process.browser)),Pu="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Fu=(Pu&&parseFloat(Pu[1]),{fetch:null,mimeType:void 0,nothrow:!1,log:new Iu,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Ru,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}),Du={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 Lu(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 ju(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 ju(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 ju(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 Gu(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 Uu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gu(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Nu(){globalThis.loaders=globalThis.loaders||{};var e=globalThis.loaders;return e._state=e._state||{},e._state}var Hu=function(){var e=Nu();return e.globalOptions=e.globalOptions||Uu({},Fu),e.globalOptions};function Ju(e,t,r,n){return r=r||[],function(e,t){zu(e,null,Fu,Du,t);var r,n=Lu(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]||{};zu(a,i.id,o,s,t)}}catch(e){n.e(e)}finally{n.f()}}(e,r=Array.isArray(r)?r:[r]),qu(t,e,n)}function Vu(e,t){var r=Hu(),n=e||r;return"function"==typeof n.fetch?n.fetch:Ws(n.fetch)?function(e){return Tu(e,n)}:null!=t&&t.fetch?null==t?void 0:t.fetch:Tu}function zu(e,t,r,n,i){var a=t||"Top level",o=t?"".concat(t,"."):"";for(var s in e){var u=!t&&Ws(e[s]);if(!(s in r||"baseUri"===s&&!t||"workerUrl"===s&&t))if(s in n)ku.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var c=Ku(s,i);ku.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(c))()}}}function Ku(e,t){var r,n=e.toLowerCase(),i="",a=Lu(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 qu(e,t,r){var n=Uu({},e.options||{});return function(e,t){!t||"baseUri"in e||(e.baseUri=t)}(n,r),null===n.log&&(n.log=new Mu),Xu(n,Hu()),Xu(n,t),n}function Xu(e,t){for(var r in t)if(r in t){var n=t[r];Zs(n)&&Zs(e[r])?e[r]=Uu(Uu({},e[r]),t[r]):e[r]=t[r]}}function Qu(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}function Wu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.2.3";Qu(e,"no worker provided");var r=e.version;return!(!t||!r)}var Zu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Yu=Zu.global||Zu.self||Zu.window||{},$u="object"!==("undefined"==typeof process?"undefined":yi()(process))||"[object process]"!==String(process)||process.browser,ec="function"==typeof importScripts,tc="undefined"!=typeof window&&void 0!==window.orientation,rc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),nc=(rc&&parseFloat(rc[1]),function e(){h()(this,e)}),ic=new Map;function ac(e){Qu(e.source&&!e.url||!e.source&&e.url);var t=ic.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return oc((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),ic.set(e.url,t)),e.source&&(t=oc(e.source),ic.set(e.source,t))),Qu(t),t}function oc(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function sc(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 uc=function(){},cc=function(){function e(t){h()(this,e),Un(this,"name",void 0),Un(this,"source",void 0),Un(this,"url",void 0),Un(this,"terminated",!1),Un(this,"worker",void 0),Un(this,"onMessage",void 0),Un(this,"onError",void 0),Un(this,"_loadableURL","");var r=t.name,n=t.source,i=t.url;Qu(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=uc,this.onError=function(e){return console.log(e)},this.worker=$u?this._createBrowserWorker():this._createNodeWorker()}return C()(e,[{key:"destroy",value:function(){this.onMessage=uc,this.onError=uc,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(sc(t))i.add(t);else if(sc(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(r&&"object"===yi()(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=ac({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:"_createNodeWorker",value:function(){var e,t=this;if(this.url){var r=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new nc(r,{eval:!1})}else{if(!this.source)throw new Error("no worker");e=new nc(this.source,{eval:!0})}return e.on("message",(function(e){t.onMessage(e)})),e.on("error",(function(e){t.onError(e)})),e.on("exit",(function(e){})),e}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker&&$u||void 0!==yi()(nc)}}]),e}(),lc=function(){function e(t,r){var n=this;h()(this,e),Un(this,"name",void 0),Un(this,"workerThread",void 0),Un(this,"isRunning",!0),Un(this,"result",void 0),Un(this,"_resolve",(function(){})),Un(this,"_reject",(function(){})),this.name=t,this.workerThread=r,this.result=new Promise((function(e,t){n._resolve=e,n._reject=t}))}return C()(e,[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){Qu(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){Qu(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}();function fc(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 hc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var dc=function(){function e(t){h()(this,e),Un(this,"name","unnamed"),Un(this,"source",void 0),Un(this,"url",void 0),Un(this,"maxConcurrency",1),Un(this,"maxMobileConcurrency",1),Un(this,"onDebug",(function(){})),Un(this,"reuseWorkers",!0),Un(this,"props",{}),Un(this,"jobQueue",[]),Un(this,"idleQueue",[]),Un(this,"count",0),Un(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}var t,r;return C()(e,[{key:"destroy",value:function(){this.idleQueue.forEach((function(e){return e.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=hc(hc({},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=Ie()(Pe.a.mark((function e(t){var r,n,i,a=this,o=arguments;return Pe.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=Ie()(Pe.a.mark((function e(){var t,r,n;return Pe.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 lc(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 cc({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return tc?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return cc.isSupported()}}]),e}();function pc(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 vc(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 vc(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 vc(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 yc(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 gc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var mc={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},bc=function(){function e(t){h()(this,e),Un(this,"props",void 0),Un(this,"workerPools",new Map),this.props=gc({},mc),this.setProps(t),this.workerPools=new Map}return C()(e,[{key:"destroy",value:function(){var e,t=pc(this.workerPools.values());try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}this.workerPools=new Map}},{key:"setProps",value:function(e){this.props=gc(gc({},this.props),e);var t,r=pc(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 dc({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 cc.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}();Un(bc,"_workerFarm",void 0);function Ac(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="latest");var o=a?"@".concat(a):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(o,"/dist/").concat(n)}return Qu(i),i}function Bc(e,t){return!!bc.isSupported()&&(!!($u||null!=t&&t._nodeWorkers)&&(e.worker&&(null==t?void 0:t.worker)))}function wc(e,t,r,n,i){return _c.apply(this,arguments)}function _c(){return(_c=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.id,s=Ac(t,n),u=bc.getWorkerFarm(n),c=u.getWorkerPool({name:o,url:s}),n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{})),e.next=8,c.startJob("process-on-worker",xc.bind(null,a));case 8:return(l=e.sent).postMessage("process",{input:r,options:n,context:i}),e.next=12,l.result;case 12:return f=e.sent,e.next=15,f.result;case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xc(e,t,r,n){return Cc.apply(this,arguments)}function Cc(){return(Cc=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c;return Pe.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 Oc=r(33),Ec=r.n(Oc);r(40);function Tc(e){return e&&"object"===yi()(e)&&e.isBuffer}function Sc(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 kc(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 kc(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 kc(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 Mc(e){if(Tc(e))return Tc(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"===yi()(e)&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Ic(){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=Sc(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 Rc(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 Pc(e){return Fc.apply(this,arguments)}function Fc(){return(Fc=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=!1,i=!1,e.prev=3,o=Ec()(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",Ic.apply(void 0,r));case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var Dc=Pe.a.mark(Lc);function Lc(e,t){var r,n,i,a,o;return Pe.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()}}),Dc)}var jc=Pe.a.mark(Gc);function Gc(e){var t,r,n,i,a,o,s,u=arguments;return Pe.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()}}),jc)}var Uc=r(27),Nc=r.n(Uc),Hc=r(32),Jc=r.n(Hc);function Vc(){return(Vc=Jc()(Pe.a.mark((function e(t,r){var n,i,a,o;return Pe.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,Nc()(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 zc(e,t){return Ru?function(e,t){return Kc.apply(this,arguments)}(e,t):function(e,t){return qc.apply(this,arguments)}(e,t)}function Kc(){return(Kc=Jc()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.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,Nc()(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,Mc(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 qc(){return(qc=Jc()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!1,i=!1,e.prev=2,o=Ec()(t);case 4:return e.next=6,Nc()(o.next());case 6:if(!(n=!(s=e.sent).done)){e.next=13;break}return u=s.value,e.next=10,Mc(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,Nc()(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 Xc(e,t){if("string"==typeof e)return Lc(e,t);if(e instanceof ArrayBuffer)return Gc(e,t);if(tu(e))return function(e,t){return Vc.apply(this,arguments)}(e,t);if(ru(e))return zc(e,t);if(eu(e))return zc(e.body,t);throw new Error("makeIterator")}var Qc="Cannot convert supplied data type";function Wc(e,t,r){if(t.text&&"string"==typeof e)return e;var n;if((n=e)&&"object"===yi()(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(Qc)}function Zc(e,t,r){return Yc.apply(this,arguments)}function Yc(){return(Yc=Ie()(Pe.a.mark((function e(t,r,n){var i,a;return Pe.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",Wc(t,r));case 3:if(!tu(t)){e.next=7;break}return e.next=6,bu(t);case 6:t=e.sent;case 7:if(!eu(t)){e.next=21;break}return a=t,e.next=11,Bu(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(ru(t)&&(t=Xc(t,n)),!Ys(t)&&!$s(t)){e.next=24;break}return e.abrupt("return",Pc(t));case 24:throw new Error(Qc);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $c(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 el(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$c(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(r)return r;var n=el({fetch:Vu(t,e)},e);return Array.isArray(n.loaders)||(n.loaders=null),n}function rl(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(Le()(r),Le()(n)):n}return r&&r.length?r:null}function nl(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(t+1):""}function il(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(0,t):""}function al(){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(51),Wa();function ol(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var sl,ul=function(){function e(t){h()(this,e);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Un(this,"storage",void 0),Un(this,"id",void 0),Un(this,"config",{}),this.storage=ol(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return C()(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 cl(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]}function ll(e){return"string"==typeof e?sl[e.toUpperCase()]||sl.WHITE:e}function fl(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 hl(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 hl(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 hl(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 dl(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=fl(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 pl(e,t){if(!e)throw new Error(t||"Assertion failed")}!function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(sl||(sl={}));var vl={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":yi()(process))&&process},yl=(globalThis,vl.window||vl.self||vl.global),gl=vl.process||{};console;function ml(){var e,t,r;if(Wa&&"performance"in yl)e=null==yl?void 0:null===(t=yl.performance)||void 0===t?void 0:null===(r=t.now)||void 0===r?void 0:r.call(t);else if("hrtime"in gl){var n,i=null==gl?void 0:null===(n=gl.hrtime)||void 0===n?void 0:n.call(gl);e=1e3*i[0]+i[1]/1e6}else e=Date.now();return e}var bl={debug:Wa&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Al={enabled:!0,level:0};function Bl(){}var wl={},_l={once:!0},xl=function(){function e(){h()(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=t.id;Un(this,"id",void 0),Un(this,"VERSION","8.8.0-beta.5"),Un(this,"_startTs",ml()),Un(this,"_deltaTs",ml()),Un(this,"_storage",void 0),Un(this,"userData",{}),Un(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this._storage=new ul("__probe-".concat(this.id,"__"),Al),this.userData={},this.timeStamp("".concat(this.id," started")),dl(this),Object.seal(this)}return C()(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((ml()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((ml()-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:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(A()({},e,t))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(e,t){pl(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,bl.warn,arguments,_l)}},{key:"error",value:function(e){return this._getLogFunction(0,e,bl.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,bl.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,bl.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this._getLogFunction(e,t,bl.debug||bl.info,arguments,_l)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Bl,r&&[r],{tag:El(t)}):Bl}},{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)?Wa?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=cl(o,n,a);(e=console).log.apply(e,Le()(t))},o.src=t,Bl}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Le()(cl(t,n,a))),Bl}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,Le()(cl(c,n,a)))},c.src=t.toDataURL(),Bl}return Bl}({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(95)}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 Bl}({image:i,message:o,scale:u}):Bl}},{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||Bl)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=Ol({logLevel:e,message:t,opts:r}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{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||Bl)}},{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()>=Cl(e)}},{key:"_getLogFunction",value:function(e,t,r,n,i){if(this._shouldLog(e)){var a;i=Ol({logLevel:e,message:t,args:n,opts:i}),pl(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=ml();var o=i.tag||i.message;if(i.once){if(wl[o])return Bl;wl[o]=ml()}return t=function(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,Wa||"string"!=typeof i||(a&&(a=ll(a),i="[".concat(a,"m").concat(i,"")),o&&(a=ll(o),i="[".concat(o+10,"m").concat(i,""))),t=i}var i,a,o;var s;return t}(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(Le()(i.args)))}return Bl}}]),e}();function Cl(e){if(!e)return 0;var t;switch(yi()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return pl(Number.isFinite(t)&&t>=0),t}function Ol(e){var t=e.logLevel,r=e.message;e.logLevel=Cl(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(yi()(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=yi()(e.message);return pl("string"===i||"object"===i),Object.assign(e,{args:n},e.opts)}function El(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}Un(xl,"VERSION","8.8.0-beta.5");var Tl=new xl({id:"loaders.gl"});var Sl=function(){var e=Nu();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function kl(){return Sl()}function Ml(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 Il(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ml(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Rl(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 Pl(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 Pl(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 Pl(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 Fl=/\.([^.]+)$/;function Dl(e){return Ll.apply(this,arguments)}function Ll(){return(Ll=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o=arguments;return Pe.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,Ul(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(a=jl(t,r,Il(Il({},n),{},{nothrow:!0}),i))){e.next=8;break}return e.abrupt("return",a);case 8:if(!tu(t)){e.next=13;break}return e.next=11,t.slice(0,10).arrayBuffer();case 11:t=e.sent,a=jl(t,r,n,i);case 13:if(a||null!=n&&n.nothrow){e.next=15;break}throw new Error(Nl(t));case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jl(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(!Ul(e))return null;if(t&&!Array.isArray(t))return su(t);var i,a=[];(t&&(a=a.concat(t)),null!=r&&r.ignoreRegisteredLoaders)||(i=a).push.apply(i,Le()(kl()));Hl(a);var o=Gl(e,a,r,n);if(!(o||null!=r&&r.nothrow))throw new Error(Nl(e));return o}function Gl(e,t,r,n){var i,a=yu(e),o=a.url,s=a.type,u=o||(null==n?void 0:n.url),c=null,l="";(null!=r&&r.mimeType&&(c=Jl(t,null==r?void 0:r.mimeType),l="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType)),c=c||function(e,t){var r=t&&Fl.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();var r,n=Rl(e);try{for(n.s();!(r=n.n()).done;){var i,a=r.value,o=Rl(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,u),l=l||(c?"matched url ".concat(u):""),c=c||Jl(t,s),l=l||(c?"matched MIME type ".concat(s):""),c=c||function(e,t){if(!t)return null;var r,n=Rl(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if("string"==typeof t){if(Vl(t,i))return i}else if(ArrayBuffer.isView(t)){if(zl(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer){if(zl(t,0,i))return i}}}catch(e){n.e(e)}finally{n.f()}return null}(t,e),l=l||(c?"matched initial data ".concat(Kl(e)):""),c=c||Jl(t,null==r?void 0:r.fallbackMimeType),l=l||(c?"matched fallback MIME type ".concat(s):""))&&Tl.log(1,"selectLoader selected ".concat(null===(i=c)||void 0===i?void 0:i.name,": ").concat(l,"."));return c}function Ul(e){return!(e instanceof Response&&204===e.status)}function Nl(e){var t=yu(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?Kl(e):"";return a+=o?' first bytes: "'.concat(o,'"'):"first bytes: not available",a+=")"}function Hl(e){var t,r=Rl(e);try{for(r.s();!(t=r.n()).done;){su(t.value)}}catch(e){r.e(e)}finally{r.f()}}function Jl(e,t){var r,n=Rl(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 Vl(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some((function(t){return e.startsWith(t)}))}function zl(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(yi()(n)){case"function":return n(e,r);case"string":var i=ql(e,t,n.length);return n===i;default:return!1}}(e,t,r,n)}))}function Kl(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 ql(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return ql(e,r,t)}return""}function ql(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 Xl(e,t,r,n){return Ql.apply(this,arguments)}function Ql(){return(Ql=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Qu(!i||"object"===yi()(i)),!r||Array.isArray(r)||ou(r)||(i=void 0,n=r,r=void 0),e.next=4,t;case 4:return t=e.sent,n=n||{},a=yu(t),o=a.url,s=rl(r,i),e.next=11,Dl(t,s,n);case 11:if(u=e.sent){e.next=14;break}return e.abrupt("return",null);case 14:return n=Ju(n,u,s,o),i=tl({url:o,parse:Xl,loaders:s},n,i),e.next=18,Wl(u,t,n,i);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wl(e,t,r,n){return Zl.apply(this,arguments)}function Zl(){return(Zl=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Wu(t),eu(r)&&(o=(a=r).ok,s=a.redirected,u=a.status,c=a.statusText,l=a.type,f=a.url,h=Object.fromEntries(a.headers.entries()),i.response={headers:h,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}),e.next=4,Zc(r,t,n);case 4:if(r=e.sent,!t.parseTextSync||"string"!=typeof r){e.next=8;break}return n.dataType="text",e.abrupt("return",t.parseTextSync(r,n,i,t));case 8:if(!Bc(t,n)){e.next=12;break}return e.next=11,wc(t,r,n,i,Xl);case 11:return e.abrupt("return",e.sent);case 12:if(!t.parseText||"string"!=typeof r){e.next=16;break}return e.next=15,t.parseText(r,n,i,t);case 15:return e.abrupt("return",e.sent);case 16:if(!t.parse){e.next=20;break}return e.next=19,t.parse(r,n,i,t);case 19:return e.abrupt("return",e.sent);case 20:throw Qu(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yl(e,t,r,n){return $l.apply(this,arguments)}function $l(){return($l=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(r)||ou(r)||(void 0,n=r,r=void 0),a=Vu(n),o=t,"string"!=typeof t){e.next=7;break}return e.next=6,a(t);case 6:o=e.sent;case 7:if(!tu(t)){e.next=11;break}return e.next=10,a(t);case 10:o=e.sent;case 11:return e.next=13,Xl(o,r,n);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ef=r(56),tf=r.n(ef),rf=r(57),nf=r.n(rf),af=r(58),of=r.n(af);function sf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Math.max(6378137,6378137,6356752.314245179);function uf(e){return e}new Ot;function cf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:uf;return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function lf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return cf(e,t,rt._cartographicRadians?uf:at)}function ff(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:uf;return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function hf(e,t){return ff(e,t,rt._cartographicRadians?uf:ot)}var df=new Ot,pf=new Ot,vf=new Ot;var yf=new Ot,gf={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"}},mf={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},bf={east:new Ot,north:new Ot,up:new Ot,west:new Ot,south:new Ot,down:new Ot},Af=new Ot,Bf=new Ot,wf=new Ot;function _f(e,t,r,n,i,a){var o,s,u,c=gf[t]&&gf[t][r];$e(c&&(!n||n===c));var l=yf.copy(i);if(lt(l.x,0,1e-14)&&lt(l.y,0,1e-14)){var f=Math.sign(l.z);o=Af.fromArray(mf[t]),"east"!==t&&"west"!==t&&o.scale(f),s=Bf.fromArray(mf[r]),"east"!==r&&"west"!==r&&s.scale(f),u=wf.fromArray(mf[n]),"east"!==n&&"west"!==n&&u.scale(f)}else{var h=bf.up,d=bf.east,p=bf.north;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,h),p.copy(h).cross(d);var v=bf.west,y=bf.south;bf.down.copy(h).scale(-1),v.copy(d).scale(-1),y.copy(p).scale(-1),o=bf[t],s=bf[r],u=bf[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 xf=new Ot,Cf=new Ot,Of=new Ot,Ef=new Ot,Tf=new Ot,Sf=new Ot,kf=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;nf()(this,e),sf(this,"radii",void 0),sf(this,"radiiSquared",void 0),sf(this,"radiiToTheFourth",void 0),sf(this,"oneOverRadii",void 0),sf(this,"oneOverRadiiSquared",void 0),sf(this,"minimumRadius",void 0),sf(this,"maximumRadius",void 0),sf(this,"centerToleranceSquared",Yr),sf(this,"squaredXOverSquaredZ",void 0),$e(t>=0),$e(r>=0),$e(n>=0),this.radii=new Ot(t,r,n),this.radiiSquared=new Ot(t*t,r*r,n*n),this.radiiToTheFourth=new Ot(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new Ot(0===t?0:1/t,0===r?0:1/r,0===n?0:1/n),this.oneOverRadiiSquared=new Ot(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),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return of()(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=Cf,n=Of,i=tf()(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];Sf.from(e);var r=this.scaleToGeodeticSurface(Sf,Ef);if(r){var n=this.geodeticSurfaceNormal(r,Cf),i=Tf;i.copy(Sf).subtract(r);var a=Math.atan2(n.y,n.x),o=Math.asin(n.z),s=Math.sign(pe(i,Sf))*he(i);return hf([a,o,s],t)}}},{key:"eastNorthUpToFixedFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Xr;return _f(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 Xr;return _f(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 xf.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=lf(e),n=r[0],i=r[1],a=Math.cos(i);return xf.set(a*Math.cos(n),a*Math.sin(n),Math.sin(i)).normalize(),xf.to(t)}},{key:"geodeticSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return xf.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]:[],n=t.oneOverRadii,i=t.oneOverRadiiSquared,a=t.centerToleranceSquared;df.from(e);var o=df.x,s=df.y,u=df.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,v=h+d+p,y=Math.sqrt(1/v);if(Number.isFinite(y)){var g=pf;if(g.copy(e).scale(y),v<a)return g.to(r);var m=i.x,b=i.y,A=i.z,B=vf;B.set(g.x*m*2,g.y*b*2,g.z*A*2);var w,_,x,C,O=(1-y)*df.len()/(.5*B.len()),E=0;do{var T=(w=1/(1+(O-=E)*m))*w,S=(_=1/(1+O*b))*_,k=(x=1/(1+O*A))*x,M=T*w,I=S*_,R=k*x,P=h*M*m+d*I*b+p*R*A,F=-2*P;E=(C=h*T+d*S+p*k-1)/F}while(Math.abs(C)>$r);return df.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];Ef.from(e);var r=Ef.x,n=Ef.y,i=Ef.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*a.x+n*n*a.y+i*i*a.z);return Ef.multiplyScalar(o).to(t)}},{key:"transformPositionToScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Ef.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 Ef.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];$e(lt(this.radii.x,this.radii.y,en)),$e(this.radii.z>0),Ef.from(e);var n=Ef.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Ef.set(0,0,n).to(r)}}]),e}();sf(kf,"WGS84",new kf(6378137,6378137,6356752.314245179));var Mf=function e(t,r,n){h()(this,e),Un(this,"item",void 0),Un(this,"previous",void 0),Un(this,"next",void 0),this.item=t,this.previous=r,this.next=n},If=function(){function e(){h()(this,e),Un(this,"head",null),Un(this,"tail",null),Un(this,"_length",0)}return C()(e,[{key:"length",get:function(){return this._length}},{key:"add",value:function(e){var t=new Mf(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 Rf(e){return null!=e}var Pf=function(){function e(){h()(this,e),Un(this,"_list",void 0),Un(this,"_sentinel",void 0),Un(this,"_trimTiles",void 0),this._list=new If,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return C()(e,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(e){var t=e._cacheNode;Rf(t)&&this._list.splice(this._sentinel,t)}},{key:"add",value:function(e,t,r){Rf(t._cacheNode)||(t._cacheNode=this._list.add(t),r&&r(e,t))}},{key:"unloadTile",value:function(e,t,r){var n=t._cacheNode;Rf(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}();function Ff(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 Df(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 Df(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 Df(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 Lf=new Ot,jf=new Ot,Gf=new Hr([new Fr,new Fr,new Fr,new Fr,new Fr,new Fr]);function Uf(e,t){var r=e.cameraDirection,n=e.cameraUp,i=e.height,a=e.distanceScales.metersPerUnit,o=e.unprojectPosition(e.center),s=kf.WGS84.cartographicToCartesian(o,new Ot),u=kf.WGS84.eastNorthUpToFixedFrame(s),c=e.unprojectPosition(e.cameraPosition),l=kf.WGS84.cartographicToCartesian(c,new Ot),f=new Ot(u.transformAsVector(new Ot(r).scale(a))).normalize(),h=new Ot(u.transformAsVector(new Ot(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);jf.copy(a.normal).scale(a.distance-o).add(e.center);var s=e.unprojectPosition(jf),u=kf.WGS84.cartographicToCartesian(s,new Ot);Gf.planes[n++].fromPointNormal(u,Lf.copy(t).subtract(u))}}(e,s),{camera:{position:l,direction:f,up:h},viewport:e,topDownViewport:new(0,e.constructor)({longitude:e.longitude,latitude:e.latitude,height:i,width:e.width,bearing:e.bearing,zoom:e.zoom,pitch:0}),height:i,cullingVolume:Gf,frameNumber:t,sseDenominator:1.15}}var Nf=new Ot;function Hf(e,t){if(e instanceof Ir){var r=function(e){e.getColumn(0,Nf);var t=e.getColumn(1),r=e.getColumn(2);return Nf.add(t).add(r).len()}(e.halfAxes);return Math.log2(6356752.314245179/(r+t[2]))}if(e instanceof It){var n=e.radius;return Math.log2(6356752.314245179/(n+t[2]))}if(e.width&&e.height){var i=e.width,a=e.height;return(Math.log2(6378137/i)+Math.log2(6378137/a))/2}return 1}function Jf(e,t,r){var n=kf.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new Ot),i=Math.sqrt(Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2)+Math.pow(n[2]-r[2],2));return Math.log2(6356752.314245179/(i+t[2]))}var Vf=0,zf=1,Kf=3,qf=4,Xf=5,Qf=1,Wf=2,Zf="empty",Yf="scenegraph",$f="pointcloud",eh="mesh",th="I3S",rh="TILES3D",nh="geometricError",ih=1;function ah(e){return null!=e}var oh=new Ot,sh=new Ot,uh=new Ot;function ch(e,t,r){if(nu(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,r){var n=new Ot(e[0],e[1],e[2]);t.transform(n,n);var i=[];if(10===e.length){var a=e.slice(3,6),o=new vr;o.fromArray(e,6);var s=new Ot([1,0,0]),u=new Ot([0,1,0]),c=new Ot([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(Le()(s.toArray()),Le()(u.toArray()),Le()(c.toArray()))}else i=[].concat(Le()(e.slice(3,6)),Le()(e.slice(6,9)),Le()(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 zt([l[0],l[1],l[2],f[0],f[1],f[2],h[0],h[1],h[2]]);if(ah(r))return r.center=n,r.halfAxes=d,r;return new Ir(n,d)}(e.box,t,r);if(e.region){var n=M()(e.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5],l=kf.WGS84.cartographicToCartesian([st(i),st(s),u],sh),f=kf.WGS84.cartographicToCartesian([st(o),st(a),c],uh),h=(new Ot).addVectors(l,f).multiplyScalar(.5),d=(new Ot).subVectors(l,f).len()/2;return lh([h[0],h[1],h[2],d],new Xr)}if(e.sphere)return lh(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function lh(e,t,r){var n=new Ot(e[0],e[1],e[2]);t.transform(n,n);var i=t.getScale(oh),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return ah(r)?(r.center=n,r.radius=o,r):new It(n,o)}new Ot,new Ot,new Xr,new Ot,new Ot,new Ot;function fh(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 hh=new Ot,dh=new Ot,ph=new Ot,vh=new Ot,yh=new Ot,gh=new Xr,mh=new Xr;function bh(e,t){var r=t.topDownViewport,n=e.header.mbs[1],i=e.header.mbs[0],a=e.header.mbs[2],o=e.header.mbs[3],s=Le()(e.boundingVolume.center),u=r.unprojectPosition(r.cameraPosition);kf.WGS84.cartographicToCartesian(u,hh),dh.copy(hh).subtract(s).normalize(),kf.WGS84.eastNorthUpToFixedFrame(s,gh),mh.copy(gh).invert(),ph.copy(hh).transform(mh);var c=Math.sqrt(ph[0]*ph[0]+ph[1]*ph[1]),l=c*c/ph[2];vh.copy([ph[0],ph[1],l]);var f=vh.transform(gh).subtract(s).normalize(),h=dh.cross(f).normalize().scale(o).add(s),d=kf.WGS84.cartesianToCartographic(h),p=r.project([i,n,a]),v=r.project(d);return yh.copy(p).subtract(v).magnitude()}var Ah=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;h()(this,e),Un(this,"_map",new Map),Un(this,"_array",void 0),Un(this,"_length",void 0),this._array=new Array(t),this._length=t}return C()(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 nu(e<this._array.length),this._array[e]}},{key:"set",value:function(e,t){nu(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){nu(e>=0),e>this._array.length&&(this._array.length=e)}},{key:"resize",value:function(e){nu(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 Bh(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 wh(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 wh(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 wh(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 _h(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 xh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_h(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ch={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Oh=function(){function e(t){h()(this,e),Un(this,"options",void 0),Un(this,"root",void 0),Un(this,"requestedTiles",void 0),Un(this,"selectedTiles",void 0),Un(this,"emptyTiles",void 0),Un(this,"lastUpdate",(new Date).getTime()),Un(this,"updateDebounceTime",1e3),Un(this,"_traversalStack",void 0),Un(this,"_emptyTraversalStack",void 0),Un(this,"_frameNumber",void 0),this.options=xh(xh({},Ch),t),this._traversalStack=new Ah,this._emptyTraversalStack=new Ah,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return C()(e,[{key:"traversalFinished",get:function(){return!0}},{key:"traverse",value:function(e,t,r){this.root=e,this.options=xh(xh({},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===Qf?(this.loadTile(n,t),this.selectTile(n,t)):n.refine===Wf&&(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}var u=(new Date).getTime();(this.traversalFinished||u-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=u,this.options.onTraversalEnd(t))}},{key:"updateChildTiles",value:function(e,t){var r,n=Bh(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===Wf&&e.hasRenderContent&&!o,l=!1,f=!0,h=Bh(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=Bh(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=Bh(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 Eh(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 Th(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Eh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Eh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Sh=new Ot;var kh=function(){function e(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";h()(this,e),Un(this,"tileset",void 0),Un(this,"header",void 0),Un(this,"id",void 0),Un(this,"url",void 0),Un(this,"parent",void 0),Un(this,"refine",void 0),Un(this,"type",void 0),Un(this,"contentUrl",void 0),Un(this,"lodMetricType",void 0),Un(this,"lodMetricValue",void 0),Un(this,"boundingVolume",void 0),Un(this,"content",void 0),Un(this,"contentState",void 0),Un(this,"gpuMemoryUsageInBytes",void 0),Un(this,"children",void 0),Un(this,"depth",void 0),Un(this,"viewportIds",void 0),Un(this,"transform",void 0),Un(this,"extensions",void 0),Un(this,"userData",void 0),Un(this,"computedTransform",void 0),Un(this,"hasEmptyContent",void 0),Un(this,"hasTilesetContent",void 0),Un(this,"traverser",void 0),Un(this,"_cacheNode",void 0),Un(this,"_frameNumber",void 0),Un(this,"_lodJudge",void 0),Un(this,"_expireDate",void 0),Un(this,"_expiredContent",void 0),Un(this,"_shouldRefine",void 0),Un(this,"_distanceToCamera",void 0),Un(this,"_centerZDepth",void 0),Un(this,"_screenSpaceError",void 0),Un(this,"_visibilityPlaneMask",void 0),Un(this,"_visible",void 0),Un(this,"_inRequestVolume",void 0),Un(this,"_stackLength",void 0),Un(this,"_selectionDepth",void 0),Un(this,"_touchedFrame",void 0),Un(this,"_visitedFrame",void 0),Un(this,"_selectedFrame",void 0),Un(this,"_requestedFrame",void 0),Un(this,"_priority",void 0),Un(this,"_contentBoundingVolume",void 0),Un(this,"_viewerRequestVolume",void 0),Un(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=Vf,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 Oh({}),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 Xr,this.transform=new Xr,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 C()(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===Kf||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===Vf}},{key:"contentExpired",get:function(){return this.contentState===qf}},{key:"contentFailed",get:function(){return this.contentState===Xf}},{key:"getScreenSpaceError",value:function(e,t){switch(this.tileset.type){case th:return bh(this,e);case rh: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-=fh(n,o)}(this,e,t);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getPriority",value:function(){var e=this.tileset._traverser,t=e.options.skipLevelOfDetail,r=this.refine===Qf||t;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Vf)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=Ie()(Pe.a.mark((function e(){var t,r,n,i;return Pe.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=zf,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=Vf,e.abrupt("return",!1);case 13:return e.prev=13,r=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,i=Th(Th({},this.tileset.loadOptions),{},A()({},n.id,Th(Th({},this.tileset.loadOptions[n.id]),{},{isTileset:"json"===this.type},this._getLoaderSpecificOptions(n.id)))),e.next=19,Yl(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=Kf,this._onContentLoaded(),e.abrupt("return",!0);case 29:throw e.prev=29,e.t0=e.catch(13),this.contentState=Xf,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=Vf,!0}},{key:"updateVisibility",value:function(e,t){if(this._frameNumber!==e.frameNumber){var r=this.parent,n=r?r._visibilityPlaneMask:Hr.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!==Hr.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 Sh.subVectors(r.center,t.position),t.direction.dot(Sh)}},{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=qf,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 Xr(e.transform):new Xr;var t=this.parent,r=this.tileset,n=t&&t.computedTransform?t.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new Xr(n).multiplyRight(this.transform);var i=t&&t._initialTransform?t._initialTransform.clone():new Xr;this._initialTransform=new Xr(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=Vf,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=Hr.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||Wf}},{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=ch(e.boundingVolume,this.computedTransform,this.boundingVolume);var t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=ch(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=ch(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Xr,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 Th(Th({},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 Mh(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 y()(this,r)}}var Ih=function(e){p()(r,e);var t=Mh(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(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(si()(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===Wf,o=e._optimChildrenWithinParent===ih;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!==Qf)&&!this.shouldRefine(e,t,!0)}}]),r}(Oh),Rh=function(){function e(){h()(this,e),Un(this,"frameNumberMap",new Map)}return C()(e,[{key:"register",value:function(e){var t=this.frameNumberMap.get(e)||0;this.frameNumberMap.set(e,t+1)}},{key:"deregister",value:function(e){var t=this.frameNumberMap.get(e)||1;this.frameNumberMap.set(e,t-1)}},{key:"isZero",value:function(e){return 0===(this.frameNumberMap.get(e)||0)}}]),e}(),Ph="REQUESTED",Fh="COMPLETED",Dh="ERROR",Lh=function(){function e(){h()(this,e),Un(this,"_statusMap",void 0),Un(this,"pendingTilesRegister",new Rh),this._statusMap={}}return C()(e,[{key:"add",value:function(e,t,r,n){var i=this;if(!this._statusMap[t]){var a=n.frameNumber;this._statusMap[t]={request:e,callback:r,key:t,frameState:n,status:Ph},this.pendingTilesRegister.register(a),e().then((function(e){i._statusMap[t].status=Fh;var r=i._statusMap[t].frameState.frameNumber;i.pendingTilesRegister.deregister(r),i._statusMap[t].callback(e,n)})).catch((function(e){i._statusMap[t].status=Dh;var n=i._statusMap[t].frameState.frameNumber;i.pendingTilesRegister.deregister(n),r(e)}))}}},{key:"update",value:function(e,t){this._statusMap[e]&&(this.pendingTilesRegister.deregister(this._statusMap[e].frameState.frameNumber),this.pendingTilesRegister.register(t.frameNumber),this._statusMap[e].frameState=t)}},{key:"find",value:function(e){return this._statusMap[e]}},{key:"hasPendingTiles",value:function(e){return!this.pendingTilesRegister.isZero(e)}}]),e}();function jh(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 Gh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Uh(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 Nh(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 Nh(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 Nh(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 Hh(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 y()(this,r)}}var Jh=function(e){p()(n,e);var t,r=Hh(n);function n(e){var t;return h()(this,n),t=r.call(this,e),Un(pi()(t),"_tileManager",void 0),t._tileManager=new Lh,t}return C()(n,[{key:"traversalFinished",get:function(){return!this._tileManager.hasPendingTiles(this._frameNumber||0)}},{key:"shouldRefine",value:function(e,t){return e._lodJudge=function(e,t){if(0===e.lodMetricValue||isNaN(e.lodMetricValue))return"DIG";var r=2*bh(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=Uh(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=Ie()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.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=Gh(Gh({},r.loadOptions),{},{i3s:Gh(Gh({},r.loadOptions.i3s),{},{isTileHeader:!0,loadContent:!1})}),e.next=5,Yl(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 kh(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.traversalFinished||(new Date).getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(n,i)}}]),n}(Oh);function Vh(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 zh(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 zh(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 zh(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 Kh(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?Kh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Xh={description:"",ellipsoid:kf.WGS84,modelMatrix:new Xr,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,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:{}},Qh="Tiles In Tileset(s)",Wh=function(){function e(t,r){h()(this,e),Un(this,"options",void 0),Un(this,"loadOptions",void 0),Un(this,"type",void 0),Un(this,"tileset",void 0),Un(this,"loader",void 0),Un(this,"url",void 0),Un(this,"basePath",void 0),Un(this,"modelMatrix",void 0),Un(this,"ellipsoid",void 0),Un(this,"lodMetricType",void 0),Un(this,"lodMetricValue",void 0),Un(this,"refine",void 0),Un(this,"root",void 0),Un(this,"roots",void 0),Un(this,"asset",void 0),Un(this,"description",void 0),Un(this,"properties",void 0),Un(this,"extras",void 0),Un(this,"attributions",void 0),Un(this,"credits",void 0),Un(this,"stats",void 0),Un(this,"traverseCounter",void 0),Un(this,"geometricError",void 0),Un(this,"selectedTiles",void 0),Un(this,"updatePromise",null),Un(this,"tilesetInitializationPromise",void 0),Un(this,"cartographicCenter",void 0),Un(this,"cartesianCenter",void 0),Un(this,"zoom",void 0),Un(this,"boundingVolume",void 0),Un(this,"gpuMemoryUsageInBytes",void 0),Un(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Un(this,"_traverser",void 0),Un(this,"_cache",void 0),Un(this,"_requestScheduler",void 0),Un(this,"_frameNumber",void 0),Un(this,"_queryParamsString",void 0),Un(this,"_queryParams",void 0),Un(this,"_extensionsUsed",void 0),Un(this,"_tiles",void 0),Un(this,"_pendingCount",void 0),Un(this,"lastUpdatedVieports",void 0),Un(this,"_requestedTiles",void 0),Un(this,"_emptyTiles",void 0),Un(this,"frameStateData",void 0),Un(this,"maximumMemoryUsage",void 0),nu(t),this.options=qh(qh({},Xh),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 Pf,this._requestScheduler=new Xn({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 Jn({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.tilesetInitializationPromise=this._initializeTileSet(t)}var t,r,i;return C()(e,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}},{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=qh(qh({},this.options),e)}},{key:"setOptions",value:function(e){this.options=qh(qh({},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(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((function(){!t&&e.lastUpdatedVieports?t=e.lastUpdatedVieports:e.lastUpdatedVieports=t,e.doUpdate(t)}))}},{key:"selectTiles",value:(i=Ie()(Pe.a.mark((function e(){var t,r=this,n=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:null,e.next=3,this.tilesetInitializationPromise;case 3:return t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise((function(e){setTimeout((function(){r.doUpdate(r.lastUpdatedVieports),e(r._frameNumber),r.updatePromise=null}),r.options.debounceTime)}))),e.abrupt("return",this.updatePromise);case 6:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"doUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if((!("loadTiles"in this.options)||this.options.loadTiles)&&!(this.traverseCounter>0)){e instanceof Array||(e=[e]),this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;var t,r=[],n=Vh(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,a=i.id;this._needTraverse(a)?r.push(a):this.traverseCounter--}}catch(e){n.e(e)}finally{n.f()}var o,s=Vh(e);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=u.id;if(this.roots[c]||(this.roots[c]=this._initializeTileHeaders(this.tileset,null)),r.includes(c)){var l=Uf(u,this._frameNumber);this._traverser.traverse(this.roots[c],l,this.options)}}}catch(e){s.e(e)}finally{s.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=function(e,t,r){if(0===r||e.length<=r)return[e,[]];var n,i=[],a=t.viewport,o=a.longitude,s=a.latitude,u=Ff(e.entries());try{for(u.s();!(n=u.n()).done;){var c=M()(n.value,2),l=c[0],f=c[1],h=M()(f.header.mbs,2),d=h[0],p=h[1],v=Math.abs(o-d),y=Math.abs(s-p),g=Math.sqrt(y*y+v*v);i.push([l,g])}}catch(e){u.e(e)}finally{u.f()}for(var m=i.sort((function(e,t){return e[1]-t[1]})),b=[],A=0;A<r;A++)b.push(e[m[A][0]]);for(var B=[],w=r;w<m.length;w++)B.push(e[m[w][0]]);return[b,B]}(Object.values(this._traverser.selectedTiles),e,this.options.maximumTilesSelected),i=M()(n,2),a=i[0],o=i[1];r.selectedTiles=a;var s,u=Vh(o);try{for(u.s();!(s=u.n()).done;){s.value.unselect()}}catch(e){u.e(e)}finally{u.f()}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=Vh(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=Vh(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=Vh(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:r+=i.content.vertexCount)}}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/Vertices").count=r}},{key:"_initializeTileSet",value:(r=Ie()(Pe.a.mark((function e(t){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.type!==th){e.next=5;break}return this.calculateViewPropsI3S(),e.next=4,t.root;case 4:t.root=e.sent;case 5:this.root=this._initializeTileHeaders(t,null),this.type===rh&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===th&&this._initializeI3STileset();case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"calculateViewPropsI3S",value:function(){var e,t=this.tileset.fullExtent;if(t){var r=t.xmin,n=t.xmax,i=t.ymin,a=t.ymax,o=t.zmin,s=t.zmax;return this.cartographicCenter=new Ot(r+(n-r)/2,i+(a-i)/2,o+(s-o)/2),this.cartesianCenter=kf.WGS84.cartographicToCartesian(this.cartographicCenter,new Ot),void(this.zoom=Jf(t,this.cartographicCenter,this.cartesianCenter))}var u=null===(e=this.tileset.store)||void 0===e?void 0:e.extent;if(u){var c=M()(u,4),l=c[0],f=c[1],h=c[2],d=c[3];return this.cartographicCenter=new Ot(l+(h-l)/2,f+(d-f)/2,0),this.cartesianCenter=kf.WGS84.cartographicToCartesian(this.cartographicCenter,new Ot),void(this.zoom=function(e,t,r){var n=M()(e,4),i=n[0],a=n[1];return Jf({xmin:i,xmax:n[2],ymin:a,ymax:n[3],zmin:0,zmax:0},t,r)}(u,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new Ot,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var e=this.root;nu(e);var t=e.boundingVolume.center;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Ot,void(this.zoom=1);this.cartographicCenter=kf.WGS84.cartesianToCartographic(t,new Ot),this.cartesianCenter=t,this.zoom=Hf(e.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(Qh),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/Vertices","memory"),this.stats.get("Tile Memory Use","memory")}},{key:"_initializeTileHeaders",value:function(e,t){var r=new kh(this,e.root,t);if(t&&(t.children.push(r),r.depth=t.depth+1),this.type===rh){var n=[];for(n.push(r);n.length>0;){var i=n.pop();this.stats.get(Qh).incrementCount();var a,o=Vh(i.header.children||[]);try{for(o.s();!(a=o.n()).done;){var s=a.value,u=new kh(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 rh:e=Ih;break;case th:e=Jh;break;default:e=Oh}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(e){this._destroySubtree(e)}},{key:"_loadTile",value:(t=Ie()(Pe.a.mark((function e(t){var r;return Pe.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){if(t){if(this.type===th){var r,n,i=(null===(r=this.tileset)||void 0===r?void 0:null===(n=r.nodePagesTile)||void 0===n?void 0:n.nodesInNodePages)||0;this.stats.get(Qh).reset(),this.stats.get(Qh).addCount(i)}e&&e.content&&function(e,t){nu(e),nu(t);var r=t.rtcCenter,n=t.gltfUpAxis,i=e.computedTransform,a=e.boundingVolume.center,o=new Xr(i);switch(r&&o.translate(r),n){case"Z":break;case"Y":var s=(new Xr).rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=(new Xr).rotateY(-Math.PI/2);o=o.multiplyRight(u)}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);var c=new Ot(a);t.cartesianModelMatrix=o,t.cartesianOrigin=c;var l=kf.WGS84.cartesianToCartographic(c,new Ot),f=kf.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=Vh(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=Vh((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:"_initializeTiles3DTileset",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 Zh={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(Zh);function Yh(e,t,r){nu(e instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function $h(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 ed={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:"3.2.3",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":yi()(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function td(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 rd(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 nd(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 nd(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 nd(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 id=function(){function e(t,r){h()(this,e),Un(this,"fields",void 0),Un(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=rd(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 C()(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=ad(ad(new Map,this.metadata),i.metadata)}else r=t;var a,o=Object.create(null),s=rd(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=rd(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 ad(e,t){return new Map([].concat(Le()(e||new Map),Le()(t||new Map)))}var od,sd=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),Un(this,"name",void 0),Un(this,"type",void 0),Un(this,"nullable",void 0),Un(this,"metadata",void 0),this.name=t,this.type=r,this.nullable=n,this.metadata=i}return C()(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 ud(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 y()(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"}(od||(od={}));var cd=function(){function e(){h()(this,e)}return C()(e,[{key:"typeId",get:function(){return od.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===od.Null}},{key:"isInt",value:function(e){return e&&e.typeId===od.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===od.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===od.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===od.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===od.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===od.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===od.Date}},{key:"isTime",value:function(e){return e&&e.typeId===od.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===od.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===od.Interval}},{key:"isList",value:function(e){return e&&e.typeId===od.List}},{key:"isStruct",value:function(e){return e&&e.typeId===od.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===od.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===od.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===od.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===od.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===od.Dictionary}}]),e}(),ld=(Symbol.toStringTag,Symbol.toStringTag,function(e,t){p()(n,e);var r=ud(n);function n(e,t){var i;return h()(this,n),i=r.call(this),Un(pi()(i),"isSigned",void 0),Un(pi()(i),"bitWidth",void 0),i.isSigned=e,i.bitWidth=t,i}return C()(n,[{key:"typeId",get:function(){return od.Int}},{key:t,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(cd,Symbol.toStringTag)),fd=function(e){p()(r,e);var t=ud(r);function r(){return h()(this,r),t.call(this,!0,8)}return r}(ld),hd=function(e){p()(r,e);var t=ud(r);function r(){return h()(this,r),t.call(this,!0,16)}return r}(ld),dd=function(e){p()(r,e);var t=ud(r);function r(){return h()(this,r),t.call(this,!0,32)}return r}(ld),pd=function(e){p()(r,e);var t=ud(r);function r(){return h()(this,r),t.call(this,!1,8)}return r}(ld),vd=function(e){p()(r,e);var t=ud(r);function r(){return h()(this,r),t.call(this,!1,16)}return r}(ld),yd=function(e){p()(r,e);var t=ud(r);function r(){return h()(this,r),t.call(this,!1,32)}return r}(ld),gd=32,md=64,bd=function(e,t){p()(n,e);var r=ud(n);function n(e){var t;return h()(this,n),t=r.call(this),Un(pi()(t),"precision",void 0),t.precision=e,t}return C()(n,[{key:"typeId",get:function(){return od.Float}},{key:t,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(cd,Symbol.toStringTag),Ad=function(e){p()(r,e);var t=ud(r);function r(){return h()(this,r),t.call(this,gd)}return r}(bd),Bd=function(e){p()(r,e);var t=ud(r);function r(){return h()(this,r),t.call(this,md)}return r}(bd),wd=(Symbol.toStringTag,Symbol.toStringTag,{DAY:0,MILLISECOND:1}),_d=(Symbol.toStringTag,{SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9}),xd=(Symbol.toStringTag,Symbol.toStringTag,{DAY_TIME:0,YEAR_MONTH:1}),Cd=(Symbol.toStringTag,function(e,t){p()(n,e);var r=ud(n);function n(e,t){var i;return h()(this,n),i=r.call(this),Un(pi()(i),"listSize",void 0),Un(pi()(i),"children",void 0),i.listSize=e,i.children=[t],i}return C()(n,[{key:"typeId",get:function(){return od.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}(cd,Symbol.toStringTag));Symbol.toStringTag;function Od(e,t,r){var n=function(e){switch(e.constructor){case Int8Array:return new fd;case Uint8Array:return new pd;case Int16Array:return new hd;case Uint16Array:return new vd;case Int32Array:return new dd;case Uint32Array:return new yd;case Float32Array:return new Ad;case Float64Array:return new Bd;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 sd(e,new Cd(t.size,new sd("value",n)),!1,i)}function Ed(e,t,r){var n=Sd(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=Td(o,e[o],a[o]);i.push(s)}if(r){var u=Td("indices",r);i.push(u)}return new id(i,n)}function Td(e,t,r){return Od(e,t,r?Sd(r.metadata):void 0)}function Sd(e){var t=new Map;for(var r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}function kd(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 Md(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 Md(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 Md(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 Id(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 Rd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Id(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Id(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pd={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Fd={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Dd=function(){function e(t){h()(this,e),Un(this,"draco",void 0),Un(this,"decoder",void 0),Un(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return C()(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=td(u.attributes),l=Ed(u.attributes,s,u.indices),f=Rd(Rd({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=Fd[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=M()(i[n],2),o=a[0];if(a[1]===r)return o}var s=e.attribute_type;for(var u in Pd){if(this.draco[u]===s)return Pd[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=kd([].concat(Le()(n),Le()(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 Ld=r(28),jd={};function Gd(e){return Ud.apply(this,arguments)}function Ud(){return(Ud=Ie()(Pe.a.mark((function e(t){var r,n,i=arguments;return Pe.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=Nd(t,r,n)),jd[t]=jd[t]||Hd(t),e.next=6,jd[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nd(e,t,r){if(e.startsWith("http"))return e;var n=r.modules||{};return n[e]?n[e]:$u?r.CDN?(Qu(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.2.3","/dist/libs/").concat(e)):ec?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function Hd(e){return Jd.apply(this,arguments)}function Jd(){return(Jd=Ie()(Pe.a.mark((function e(t){var r,n,i;return Pe.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($u){e.next=20;break}if(e.prev=8,e.t0=Ld&&Ld.requireFromFile,!e.t0){e.next=14;break}return e.next=13,Ld.requireFromFile(t);case 13:e.t0=e.sent;case 14:return e.abrupt("return",e.t0);case 17:return e.prev=17,e.t1=e.catch(8),e.abrupt("return",null);case 20:if(!ec){e.next=22;break}return e.abrupt("return",importScripts(t));case 22:return e.next=24,fetch(t);case 24:return n=e.sent,e.next=27,n.text();case 27:return i=e.sent,e.abrupt("return",Vd(i,t));case 29:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}function Vd(e,t){if(!$u)return Ld.requireFromString&&Ld.requireFromString(e,t);if(ec)return eval.call(Yu,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 zd(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 Kd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zd(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qd,Xd="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Qd="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),Wd="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 Zd(e){return Yd.apply(this,arguments)}function Yd(){return(Yd=Ie()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modules||{},qd=r.draco3d?qd||r.draco3d.createDecoderModule({}).then((function(e){return{draco:e}})):qd||$d(t),e.next=4,qd;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $d(e){return ep.apply(this,arguments)}function ep(){return(ep=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.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,Gd(Xd,"draco",t);case 5:return r=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,Gd(Qd,"draco",t);case 10:return e.t2=e.sent,e.next=13,Gd(Wd,"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=M()(i,2),r=a[0],n=a[1];case 21:return r=r||globalThis.DracoDecoderModule,e.next=24,tp(r,n);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tp(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(Kd(Kd({},r),{},{onModuleLoaded:function(e){return t({draco:e})}}))}))}function rp(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 np(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rp(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ip=np(np({},ed),{},{parse:function(e,t){return ap.apply(this,arguments)}});function ap(){return(ap=Ie()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zd(r);case 2:return n=e.sent,i=n.draco,a=new Dd(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 op,sp=(op={},A()(op,5130,Float64Array),A()(op,5126,Float32Array),A()(op,5123,Uint16Array),A()(op,5125,Uint32Array),A()(op,5121,Uint8Array),A()(op,5120,Int8Array),A()(op,5122,Int16Array),A()(op,5124,Int32Array),op),up={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},cp=function(){function e(){h()(this,e)}return C()(e,null,[{key:"fromTypedArray",value:function(e){for(var t in e=ArrayBuffer.isView(e)?e.constructor:e,sp){if(sp[t]===e)return t}throw new Error("Failed to convert GL type")}},{key:"fromName",value:function(e){var t=up[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=sp[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}(),lp=function(){function e(t,r){h()(this,e),Un(this,"json",void 0),Un(this,"buffer",void 0),Un(this,"featuresLength",0),Un(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=r}return C()(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=cp.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=cp.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=cp.createTypedArray(t,r),n[e]=i),i}}]),e}(),fp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},hp={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]]}},dp={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 pp=function(e){return void 0!==e};function vp(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;pp(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(pp(c))for(pp(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];pp(l)&&pp(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,v=getBinaryProperties(d,p,t);s[r].instances=combine(v,p)}var y=new Array(h).fill(0),g=new Uint16Array(o);for(r=0;r<o;++r)n=u[r],g[r]=y[n],++y[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)gp(e,r,stack)}(m),m}(n,r):null}function yp(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(pp(f))return f;for(var h=i[t],d=o[t],p=0;p<h;++p){var v=a[d+p];v!==t&&l.push(v)}}return null}(e,t,r):function(e,t,r){var n=!0;for(;n;){var i=r(e,t);if(pp(i))return i;var a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}(e,t,r)}}function gp(e,t,r){var n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,o=e.classIds.length;if(pp(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=pp(n)?n[t]:1,u=pp(n)?a[t]:t,c=0;c<s;++c){var l=i[u+c];l!==t&&gp(e,l,r)}r.pop(t)}}function mp(e){return null!=e}var bp=function(e,t){return e},Ap={HIERARCHY:!0,extensions:!0,extras:!0},Bp=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),Un(this,"json",void 0),Un(this,"binary",void 0),Un(this,"featureCount",void 0),Un(this,"_extensions",void 0),Un(this,"_properties",void 0),Un(this,"_binaryProperties",void 0),Un(this,"_hierarchy",void 0),nu(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)Ap[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),a["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=vp(this,this.json,this.binary))}return C()(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),nu("string"==typeof t,t),!!this._hierarchy&&mp(yp(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return e.classes[n].name===t})))}},{key:"isExactClass",value:function(e,t){return nu("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),nu("string"==typeof t,t),mp(this._properties[t])||this._hasPropertyInHierarchy(e,t)}},{key:"getPropertyNames",value:function(e,t){var r;this._checkBatchId(e),(t=mp(t)?t:[]).length=0;var n=Object.keys(this._properties);return(r=t).push.apply(r,Le()(n)),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}},{key:"getProperty",value:function(e,t){if(this._checkBatchId(e),nu("string"==typeof t,t),this._binaryProperties){var r=this._binaryProperties[t];if(mp(r))return this._getBinaryProperty(r,e)}var n=this._properties[t];if(mp(n))return bp(n[e]);if(this._hierarchy){var i=this._getHierarchyProperty(e,t);if(mp(i))return i}}},{key:"setProperty",value:function(e,t,r){var n=this.featureCount;if(this._checkBatchId(e),nu("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];mp(a)||(this._properties[t]=new Array(n),a=this._properties[t]),a[e]=bp(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;nu(this.binary,"Property ".concat(e," requires a batch table binary.")),nu(r.type,"Property ".concat(e," requires a type."));var n=function(e,t,r,n){var i=e.componentType;nu(e.componentType);var a="string"==typeof i?cp.fromName(i):i,o=fp[e.type],s=hp[e.type],u=dp[e.type];return r+=e.byteOffset,{values:cp.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=yp(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return mp(e.classes[n].instances[t])}));return mp(r)}},{key:"_getPropertyNamesInHierarchy",value:function(e,t){yp(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 yp(this._hierarchy,e,(function(e,n){var i=e.classIds[n],a=e.classes[i],o=e.classIndexes[n],s=a.instances[t];return mp(s)?mp(s.typedArray)?r._getBinaryProperty(s,o):bp(s[o]):null}))}},{key:"_setHierarchyProperty",value:function(e,t,r,n){var i=this,a=yp(this._hierarchy,t,(function(e,a){var o=e.classIds[a],s=e.classes[o],u=e.classIndexes[a],c=s.instances[r];return!!mp(c)&&(nu(a===t,'Inherited property "'.concat(r,'" is read-only.')),mp(c.typedArray)?i._setBinaryProperty(c,u,n):c[u]=bp(n),!0)}));return mp(a)}}]),e}();function wp(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 _p(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 xp(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=Yh(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=Yh(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 Cp(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 Op(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=Cp(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 Ep(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new Zr,new Ot,new Zr,new Zr,new Uint8Array(1);function Tp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return ut(e,0,t)/t*2-1}function Sp(e){return e<0?-1:1}function kp(e,t,r,n){if(Ep(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=Tp(e,r),n.y=Tp(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))*Sp(i),n.y=(1-Math.abs(i))*Sp(n.y)}return n.normalize()}function Mp(e,t,r){return kp(e,t,255,r)}var Ip=new Ot;function Rp(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){for(var r=new Ot,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 Pp(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 Fp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pp(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Dp(e,t,r,n,i){return Lp.apply(this,arguments)}function Lp(){return(Lp=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=wp(t,r,n),n=_p(t,r,n),n=xp(t,r,n),jp(t),o=Gp(t),s=o.featureTable,u=o.batchTable,e.next=7,Jp(t,s,u,i,a);case 7:return Up(t,s,i),Np(t,s,u),Hp(t,s),e.abrupt("return",n);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jp(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function Gp(e){var t=new lp(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 Bp(i,a,n)}return r}(e,t);return{featureTable:t,batchTable:n}}function Up(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=Rp(e,n,r)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Np(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=Op(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",5121,4))}function Hp(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++)Mp(t[2*n],t[2*n+1],Ip),Ip.toArray(r,3*n);return{type:5126,size:2,value:r}}return{type:5126,size:2,value:t}}(e,r)}}function Jp(e,t,r,n,i){return Vp.apply(this,arguments)}function Vp(){return(Vp=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h,d;return Pe.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:Fp(Fp({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},e.next=20,zp(t,d,i,a);case 20:return e.abrupt("return",e.sent);case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function zp(e,t,r,n){return Kp.apply(this,arguments)}function Kp(){return(Kp=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,v,y,g,m,b;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.parse,delete(o=Fp(Fp({},n),{},{draco:Fp(Fp({},n.draco),{},{extraAttributes:r.batchTableProperties||{}})}))["3d-tiles"],e.next=5,a(r.buffer,ip,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,v=p.range,t.quantizedVolumeScale=new Ot(v,v,v),t.quantizedVolumeOffset=new Ot(p.minValues),t.quantizedRange=(1<<p.quantizationBits)-1,t.isQuantizedDraco=!0),d&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0),y={},r.batchTableProperties)for(g=0,m=Object.keys(r.batchTableProperties);g<m.length;g++)b=m[g],s.attributes[b]&&s.attributes[b].value&&(y[b.toLowerCase()]=s.attributes[b].value);t.attributes=Fp({positions:u,colors:Op(t,c,void 0),normals:l,batchIds:f},y);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qp,Xp,Qp="https://unpkg.com/@loaders.gl/textures@".concat("3.2.3","/dist/libs/basis_encoder.wasm"),Wp="https://unpkg.com/@loaders.gl/textures@".concat("3.2.3","/dist/libs/basis_encoder.js");function Zp(e){return Yp.apply(this,arguments)}function Yp(){return(Yp=Ie()(Pe.a.mark((function e(t){var r;return Pe.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 qp=qp||$p(t),e.next=6,qp;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $p(e){return ev.apply(this,arguments)}function ev(){return(ev=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,Gd("basis_transcoder.js","textures",t);case 5:return e.t1=e.sent,e.next=8,Gd("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=M()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,tv(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tv(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 rv(e){return nv.apply(this,arguments)}function nv(){return(nv=Ie()(Pe.a.mark((function e(t){var r;return Pe.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 Xp=Xp||iv(t),e.next=6,Xp;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function iv(e){return av.apply(this,arguments)}function av(){return(av=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,Gd(Wp,"textures",t);case 5:return e.t1=e.sent,e.next=8,Gd(Qp,"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=M()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,ov(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ov(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 sv={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 uv(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 cv(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 cv(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 cv(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 lv=["","WEBKIT_","MOZ_"],fv={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"},hv=null;function dv(e){if(!hv){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,hv=new Set;var t,r=uv(lv);try{for(r.s();!(t=r.n()).done;){var n=t.value;for(var i in fv)if(e&&e.getExtension("".concat(n).concat(i))){var a=fv[i];hv.add(a)}}}catch(e){r.e(e)}finally{r.f()}}return hv}new Uint8Array([0]);var pv,vv,yv,gv,mv,bv,Av,Bv,wv;(wv=pv||(pv={}))[wv.NONE=0]="NONE",wv[wv.BASISLZ=1]="BASISLZ",wv[wv.ZSTD=2]="ZSTD",wv[wv.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(vv||(vv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(yv||(yv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(gv||(gv={})),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"}(mv||(mv={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(bv||(bv={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(Av||(Av={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Bv||(Bv={}));var _v=[171,75,84,88,32,50,48,187,13,10,26,10];function xv(e){var t=new Uint8Array(e);return!(t.byteLength<_v.length||t[0]!==_v[0]||t[1]!==_v[1]||t[2]!==_v[2]||t[3]!==_v[3]||t[4]!==_v[4]||t[5]!==_v[5]||t[6]!==_v[6]||t[7]!==_v[7]||t[8]!==_v[8]||t[9]!==_v[9]||t[10]!==_v[10]||t[11]!==_v[11])}var Cv={etc1:{basisFormat:0,compressed:!0,format:sv.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:sv.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:sv.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:sv.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:sv.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:sv.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 Ov(){return(Ov=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("auto"!==r.basis.containerFormat){e.next=11;break}if(!xv(t)){e.next=6;break}return e.next=4,rv(r);case 4:return n=e.sent,e.abrupt("return",Sv(n.KTX2File,t,r));case 6:return e.next=8,Zp(r);case 8:return i=e.sent,a=i.BasisFile,e.abrupt("return",Ev(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,rv(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",Sv(o.KTX2File,t,r));case 21:return e.abrupt("return",Ev(o.BasisFile,t,r));case 22:return e.next=24,Zp(r);case 24:return s=e.sent,u=s.BasisFile,e.abrupt("return",Ev(u,t,r));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ev(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");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(Tv(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function Tv(e,t,r,n){var i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),s=Mv(n,o),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,r,l),h=new Uint8Array(f);if(!e.transcodeImage(h,t,r,l,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:h,compressed:u,format:c,hasAlpha:o}}function Sv(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var i=n.getLevels(),a=[],o=0;o<i;o++){a.push(kv(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function kv(e,t,r){var n=e.getImageLevelInfo(t,0,0),i=n.alphaFlag,a=n.height,o=n.width,s=Mv(r,i),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,0,0,l),h=new Uint8Array(f);if(!e.transcodeImage(h,t,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:a,data:h,compressed:u,hasAlpha:i,format:c}}function Mv(e,t){var r=e&&e.basis&&e.basis.format;return"auto"===r&&(r=Iv()),"object"===yi()(r)&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Cv[r]}function Iv(){var e=dv();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 Rv(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 Pv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rv(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fv={name:"Basis",id:"basis",module:"textures",version:"3.2.3",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"}}},Dv=Pv(Pv({},Fv),{},{parse:function(e,t){return Ov.apply(this,arguments)}}),Lv=globalThis._parseImageNode,jv="undefined"!=typeof Image,Gv="undefined"!=typeof ImageBitmap,Uv=Boolean(Lv),Nv=!!Ru||Uv;function Hv(e){var t=Vv(e);if(!t)throw new Error("Not an image");return t}function Jv(e){switch(Hv(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 Vv(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"===yi()(e)&&e.data&&e.width&&e.height?"data":null}var zv=/^data:image\/svg\+xml/,Kv=/\.svg((\?|#).*)?$/;function qv(e){return e&&(zv.test(e)||Kv.test(e))}function Xv(e,t){if(qv(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 Qv(e,t)}function Qv(e,t){if(qv(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function Wv(e,t,r){return Zv.apply(this,arguments)}function Zv(){return(Zv=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Xv(t,n),a=self.URL||self.webkitURL,o="string"!=typeof i&&a.createObjectURL(i),e.prev=3,e.next=6,Yv(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 Yv(e,t){return $v.apply(this,arguments)}function $v(){return($v=Ie()(Pe.a.mark((function e(t,r){var n;return Pe.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 ey={},ty=!0;function ry(e,t,r){return ny.apply(this,arguments)}function ny(){return(ny=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!qv(n)){e.next=7;break}return e.next=3,Wv(t,r,n);case 3:a=e.sent,i=a,e.next=8;break;case 7:i=Qv(t,n);case 8:return o=r&&r.imagebitmap,e.next=11,iy(i,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function iy(e){return ay.apply(this,arguments)}function ay(){return(ay=Ie()(Pe.a.mark((function e(t){var r,n=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oy(r=n.length>1&&void 0!==n[1]?n[1]:null)&&ty||(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),ty=!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 oy(e){for(var t in e||ey)return!1;return!0}function sy(e){var t=uy(e);return function(e){var t=uy(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=uy(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=uy(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=uy(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 uy(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 cy(e,t){return ly.apply(this,arguments)}function ly(){return(ly=Ie()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=sy(t)||{},i=n.mimeType,nu(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 fy(){return(fy=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=(r=r||{}).image||{},a=i.type||"auto",o=(n||{}).url,s=hy(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,ry(t,r,o);case 10:return u=e.sent,e.abrupt("break",21);case 12:return e.next=14,Wv(t,r,o);case 14:return u=e.sent,e.abrupt("break",21);case 16:return e.next=18,cy(t,r);case 18:return u=e.sent,e.abrupt("break",21);case 20:nu(!1);case 21:return"data"===a&&(u=Jv(u)),e.abrupt("return",u);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hy(e){switch(e){case"auto":case"data":return function(){if(Gv)return"imagebitmap";if(jv)return"image";if(Nv)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return Gv||jv||Nv;case"imagebitmap":return Gv;case"image":return jv;case"data":return Nv;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var dy={id:"image",module:"images",name:"Images",version:"3.2.3",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 fy.apply(this,arguments)},tests:[function(e){return Boolean(sy(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}};function py(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 vy(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 py(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return py(e,r,t)}return""}(e),'"'))}}function yy(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function gy(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 my(e,t,r){var n=e.bufferViews[r];yy(n);var i=t[n.buffer];yy(i);var a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}function by(e,t){return nu(e>=0),nu(t>0),e+(t-1)&~(t-1)}function Ay(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+by(n.byteLength,4)}var By=["SCALAR","VEC2","VEC3","VEC4"],wy=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],_y=new Map(wy),xy={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cy={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Oy={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Ey(e){return By[e-1]||By[0]}function Ty(e){var t=_y.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Sy(e,t){var r=Oy[e.componentType],n=xy[e.type],i=Cy[e.componentType],a=e.count*n,o=e.count*n*i;return yy(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function ky(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 My(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 My(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 My(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 Iy(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 Ry(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Iy(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Py,Fy={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Dy=function(){function e(t){h()(this,e),Un(this,"gltf",void 0),Un(this,"sourceBuffers",void 0),Un(this,"byteLength",void 0),this.gltf=t||{json:Ry({},Fy),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 C()(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"===yi()(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];yy(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=Sy(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 yy(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 yy(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=sy(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;yy(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=by(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:Ey(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:Ty(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=ky(this.sourceBuffers||[]);try{for(s.s();!(r=s.n()).done;){o=Ay(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=ky(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}(),Ly=("undefined"==typeof WebAssembly||yi()(WebAssembly),"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"),jy="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",Gy=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]),Uy=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]),Ny={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Hy={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function Jy(e,t,r,n,i){return Vy.apply(this,arguments)}function Vy(){return(Vy=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u=arguments;return Pe.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:Wy(s=e.sent,s.exports[Hy[a]],t,r,n,i,s.exports[Ny[o||"NONE"]]);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function zy(){return Ky.apply(this,arguments)}function Ky(){return(Ky=Ie()(Pe.a.mark((function e(){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Py||(Py=qy()),e.abrupt("return",Py);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qy(){return Xy.apply(this,arguments)}function Xy(){return(Xy=Ie()(Pe.a.mark((function e(){var t,r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Ly,WebAssembly.validate(Gy)&&(t=jy,console.log("Warning: meshopt_decoder is using experimental SIMD support")),e.next=4,WebAssembly.instantiate(Qy(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 Qy(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?Uy[t[a]]:64*(t[a]-60)+t[++a];return t.buffer.slice(0,i)}function Wy(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 Zy(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 Yy(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 Yy(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 Yy(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 $y="EXT_meshopt_compression";function eg(e,t){return tg.apply(this,arguments)}function tg(){return(tg=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=new Dy(t),null!=r&&null!==(n=r.gltf)&&void 0!==n&&n.decompressMeshes){e.next=3;break}return e.abrupt("return");case 3:a=[],o=Zy(t.json.bufferViews||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,a.push(rg(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 rg(e,t){return ng.apply(this,arguments)}function ng(){return(ng=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v,y;return Pe.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=n.byteOffset,a=void 0===i?0:i,o=n.byteLength,s=void 0===o?0:o,u=n.byteStride,c=n.count,l=n.mode,f=n.filter,h=void 0===f?"NONE":f,d=n.buffer,p=t.gltf.buffers[d],v=new Uint8Array(p.arrayBuffer,p.byteOffset+a,s),y=new Uint8Array(t.gltf.buffers[r.buffer].arrayBuffer,r.byteOffset,r.byteLength),e.next=8,Jy(y,c,u,v,l,h);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 ig=["image/png","image/jpeg","image/gif"],ag={};function og(e){return void 0===ag[e]&&(ag[e]=function(e){switch(e){case"image/webp":return function(){if(!Ru)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch(e){return!1}}();case"image/svg":return Ru;default:if(!Ru){var t=globalThis._parseImageNode;return Boolean(t)&&ig.includes(e)}return!0}}(e)),ag[e]}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="EXT_texture_webp";function lg(e,t){var r=new Dy(e);if(og("image/webp")){var n,i=sg(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 fg(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 hg(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 hg(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 hg(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 dg="KHR_texture_basisu";function pg(e,t){var r,n=new Dy(e),i=fg(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 vg(e){var t={};for(var r in e){var n=e[r];if("indices"!==r){var i=yg(n);t[r]=i}}return t}function yg(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:Ey(n),componentType:Ty(r)}}function gg(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 mg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gg(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bg=Pe.a.mark(Mg);function Ag(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 Bg(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 Bg(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 Bg(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 wg="KHR_draco_mesh_compression";function _g(e,t,r){var n,i=new Dy(e),a=Ag(Mg(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 xg(e,t,r){return Cg.apply(this,arguments)}function Cg(){return(Cg=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c;return Pe.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 Dy(t),o=[],s=Ag(Mg(a));try{for(s.s();!(u=s.n()).done;)c=u.value,a.getObjectExtension(c,"KHR_draco_mesh_compression")&&o.push(Eg(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 Og(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Dy(e),i=Ag(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value;Sg(a,r),n.addRequiredExtension("KHR_draco_mesh_compression")}}catch(e){i.e(e)}finally{i.f()}}function Eg(e,t,r,n){return Tg.apply(this,arguments)}function Tg(){return(Tg=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,v,y,g,m;return Pe.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=Rc(o.buffer,o.byteOffset),u=i.parse,delete(c=mg({},n))["3d-tiles"],e.next=10,u(s,ip,c,i);case 10:for(l=e.sent,f=vg(l.attributes),h=0,d=Object.entries(f);h<d.length;h++)p=M()(d[h],2),v=p[0],y=p[1],v in r.attributes&&(g=r.attributes[v],null!=(m=t.getAccessor(g))&&m.min&&null!=m&&m.max&&(y.min=m.min,y.max=m.max));r.attributes=f,l.indices&&(r.indices=yg(l.indices)),kg(r);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sg(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:A()({},"KHR_draco_mesh_compression",{bufferView:c,attributes:u})}]};return l}function kg(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function Mg(e){var t,r,n,i,a,o;return Pe.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:t=Ag(e.json.meshes||[]),s.prev=1,t.s();case 3:if((r=t.n()).done){s.next=24;break}n=r.value,i=Ag(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()}}),bg,null,[[1,26,29,32],[6,16,19,22]])}function Ig(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 Rg(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 Rg(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 Rg(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 Pg="KHR_lights_punctual";function Fg(e){return Dg.apply(this,arguments)}function Dg(){return(Dg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new Dy(t),n=r.json,(i=r.getExtension("KHR_lights_punctual"))&&(r.json.lights=i.lights,r.removeExtension("KHR_lights_punctual")),a=Ig(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 Lg(e){return jg.apply(this,arguments)}function jg(){return(jg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new Dy(t),(n=r.json).lights&&(yy(!(i=r.addExtension("KHR_lights_punctual")).lights),i.lights=n.lights,delete n.lights),r.json.lights){a=Ig(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 Gg(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 Ng="KHR_materials_unlit";function Hg(e){return Jg.apply(this,arguments)}function Jg(){return(Jg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new Dy(t),n=r.json,r.removeExtension("KHR_materials_unlit"),i=Gg(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 Vg(e){var t=new Dy(e),r=t.json;if(t.materials){var n,i=Gg(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 zg(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 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=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 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 qg="KHR_techniques_webgl";function Xg(e){return Qg.apply(this,arguments)}function Qg(){return(Qg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new Dy(t),n=r.json,i=r.getExtension("KHR_techniques_webgl")){a=Yg(i,r),o=zg(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=$g(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 Wg(e,t){return Zg.apply(this,arguments)}function Zg(){return(Zg=Ie()(Pe.a.mark((function e(t,r){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yg(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 $g(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"===yi()(r[e])&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))})),r}function em(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 tm(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 tm(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 tm(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 rm=[i,a,o,s,u,c,l];function nm(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=rm.filter((function(e){return om(e.name,r)})),a=em(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 im(e){return am.apply(this,arguments)}function am(){return(am=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c=arguments;return Pe.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=rm.filter((function(e){return om(e.name,r)})),a=em(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 om(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 sm(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 um(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 um(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 um(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 cm(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 lm(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 lm(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 lm(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 fm,hm={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},dm={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},pm=function(){function e(){h()(this,e),Un(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Un(this,"json",void 0)}return C()(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 Dy(e),n=r.json,i=sm(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 hm)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 hm)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var r,n=cm(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=cm(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=cm(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=cm(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=cm(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=cm(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=dm[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=cm(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=cm(e.materials);try{var n=function(){var r=t.value;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var n=(null===(i=r.values)||void 0===i?void 0:i.tex)||(null===(a=r.values)||void 0===a?void 0:a.texture2d_0),o=e.textures.findIndex((function(e){return e.id===n}));-1!==o&&(r.pbrMetallicRoughness.baseColorTexture={index:o})};for(r.s();!(t=r.n()).done;){var i,a;n()}}catch(e){r.e(e)}finally{r.f()}}}]),e}();function vm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new pm).normalize(e,t)}function ym(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 gm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ym(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ym(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var mm={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},bm={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Am=10240,Bm=10241,wm=10242,_m=10243,xm=10497,Cm=9729,Om=9986,Em={magFilter:Am,minFilter:Bm,wrapS:wm,wrapT:_m},Tm=(fm={},A()(fm,Am,Cm),A()(fm,Bm,Om),A()(fm,wm,xm),A()(fm,_m,xm),fm);var Sm=function(){function e(){h()(this,e),Un(this,"baseUri",""),Un(this,"json",{}),Un(this,"buffers",[]),Un(this,"images",[])}return C()(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 yy(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"===yi()(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=gm({},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=gm({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=gm({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=gm({},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=gm({},e.pbrMetallicRoughness);var r=e.pbrMetallicRoughness;r.baseColorTexture&&(r.baseColorTexture=gm({},r.baseColorTexture),r.baseColorTexture.texture=this.getTexture(r.baseColorTexture.index)),r.metallicRoughnessTexture&&(r.metallicRoughnessTexture=gm({},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,bm[r]),e.components=(n=e.type,mm[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var i=e.bufferView.buffer,a=Sy(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):Tm,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 Em[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=gm(gm({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 km(e,t){return(new Sm).postProcess(e,t)}function Mm(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 Im(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 Rm(e,t,r){nu(e.header.byteLength>20);var n=t.getUint32(r+0,!0),i=t.getUint32(r+4,!0);return r+=8,nu(0===i),Fm(e,t,r,n),r+=n,r+=Dm(e,t,r,e.header.byteLength)}function Pm(e,t,r,n){return nu(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:Fm(e,t,r,i);break;case 5130562:Dm(e,t,r,i);break;case 0:n.strict||Fm(e,t,r,i);break;case 1:n.strict||Dm(e,t,r,i)}r+=by(i,4)}}(e,t,r,n),r+e.header.byteLength}function Fm(e,t,r,n){var i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),by(n,4)}function Dm(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),by(n,4)}function Lm(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 Gm(e,t){return Um.apply(this,arguments)}function Um(){return(Um=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d=arguments;return Pe.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,Nm(t,r,n,i),vm(t,{normalize:null==i?void 0:null===(o=i.gltf)||void 0===o?void 0:o.normalize}),nm(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,Hm(t,i,a);case 10:return null!=i&&null!==(u=i.gltf)&&void 0!==u&&u.loadImages&&(f=Vm(t,i,a),l.push(f)),h=im(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?km(t,i):t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nm(e,t,r,n){(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Im(t,r,n))&&(t=(new TextDecoder).decode(t));if("string"==typeof t)e.json=vy(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=Mm(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 Rm(e,n,r);case 2:return Pm(e,n,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}(i,t,r,n.glb),yy("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else yy(!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 Hm(e,t,r){return Jm.apply(this,arguments)}function Jm(){return(Jm=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c,l,f;return Pe.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=22;break}if(!(o=i[a]).uri){e.next=18;break}return yy(n.fetch),c=gy(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,e.next=19;break;case 18:null===t.buffers[a]&&(t.buffers[a]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength});case 19:++a,e.next=2;break;case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vm(e,t,r){return zm.apply(this,arguments)}function zm(){return(zm=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Km(t),a=t.json.images||[],o=[],s=Lm(i);try{for(s.s();!(u=s.n()).done;)c=u.value,o.push(qm(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 Km(e){var t,r=new Set,n=Lm(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 qm(e,t,r,n,i){return Xm.apply(this,arguments)}function Xm(){return(Xm=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h;return Pe.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=gy(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=my(t.json,t.buffers,r.bufferView),u=Rc(f.buffer,f.byteOffset,f.byteLength)),yy(u,"glTF image has no data"),e.next=13,s(u,[dy,Dv],{mimeType:r.mimeType,basis:i.basis||{format:Iv()}},a);case 13:(h=e.sent)&&h[0]&&(h={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h[0]}),t.images=t.images||[],t.images[n]=h;case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qm(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?Qm(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Zm={name:"glTF",id:"gltf",module:"gltf",version:"3.2.3",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(e){return Ym.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 Ym(){return(Ym=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s=arguments;return Pe.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=Wm(Wm({},Zm.options),r)).gltf=Wm(Wm({},Zm.options.gltf),r.gltf),i=r.byteOffset,a=void 0===i?0:i,o={},e.next=8,Gm(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 $m=0,eb=1;function tb(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=Rc(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 rb(e,t,r,n){return nb.apply(this,arguments)}function nb(){return(nb=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n["3d-tiles"]||{},ib(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,Zm,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 ib(e,t,r){switch(t){case $m: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 eb:break;default:throw new Error("b3dm: Illegal glTF format field")}}function ab(e,t,r,n,i){return ob.apply(this,arguments)}function ob(){return(ob=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=sb(t,r,n,i,a),e.next=3,rb(t,eb,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 sb(e,t,r,n,i){r=tb(e,t,r=xp(e,t,r=_p(e,t,r=wp(e,t,r))),n);var a=new lp(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),r}function ub(e,t,r,n,i){return cb.apply(this,arguments)}function cb(){return(cb=Ie()(Pe.a.mark((function e(t,r,n,i,a){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=lb(t,r,n,i,a),e.next=3,rb(t,t.gltfFormat,i,a);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lb(e,t,r,n,i){if(r=wp(e,t,r),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));r=_p(e,t,r);var a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r=tb(e,t,r=xp(e,t,r+=4),n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new lp(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 Bp(e.batchTableJson,e.batchTableBinary,s);return function(e,t,r,n){for(var i=[new Array(n),e._batchTable][0],a=new Ot,o=(new Ot,new Ot,new Ot,new zt),s=new vr,u=new Ot,c={},l=new Xr,f=[],h=[],d=new Ot,p=new Ot,v=0;v<n;v++){var y=void 0;if(t.hasProperty("POSITION"))y=t.getProperty("POSITION",5126,3,v,a);else if(t.hasProperty("POSITION_QUANTIZED")){y=t.getProperty("POSITION_QUANTIZED",5123,3,v,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++)y[b]=y[b]/65535*m[b]+g[b]}if(!y)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(y),c.translation=a,e.normalUp=t.getProperty("NORMAL_UP",5126,3,v,f),e.normalRight=t.getProperty("NORMAL_RIGHT",5126,3,v,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?(kf.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,v);Number.isFinite(A)&&u.multiplyByScalar(A);var B=t.getProperty("SCALE_NON_UNIFORM",5126,3,v,f);B&&u.scale(B),c.scale=u;var w=t.getProperty("BATCH_ID",5123,1,v);void 0===w&&(w=v);var _=(new Xr).fromQuaternion(c.rotation);l.identity(),l.translate(c.translation),l.multiplyRight(_),l.scale(c.scale);var x=l.clone();i[v]={modelMatrix:x,batchId:w}}e.instances=i}(e,o,0,s),r}function fb(e,t,r,n,i,a){return hb.apply(this,arguments)}function hb(){return(hb=Ie()(Pe.a.mark((function e(t,r,n,i,a,o){var s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=wp(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 db(e,t,r,n){return pb.apply(this,arguments)}function pb(){return(pb=Ie()(Pe.a.mark((function e(t,r,n,i){var a;return Pe.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,Zm,n,i);case 5:t.gltf=e.sent;case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vb(e){return yb.apply(this,arguments)}function yb(){return(yb=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o=arguments;return Pe.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=$h(t,r),e.t0=a.type,e.next=e.t0===Zh.COMPOSITE?9:e.t0===Zh.BATCHED_3D_MODEL?12:e.t0===Zh.GLTF?15:e.t0===Zh.INSTANCED_3D_MODEL?18:e.t0===Zh.POINT_CLOUD?21:24;break;case 9:return e.next=11,fb(a,t,r,n,i,vb);case 11:return e.abrupt("return",e.sent);case 12:return e.next=14,ab(a,t,r,n,i);case 14:return e.abrupt("return",e.sent);case 15:return e.next=17,db(a,t,n,i);case 17:return e.abrupt("return",e.sent);case 18:return e.next=20,ub(a,t,r,n,i);case 20:return e.abrupt("return",e.sent);case 21:return e.next=23,Dp(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 gb(){return(gb=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.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=Ab(t.slice(8,16)),n=new Uint8Array(t,24,r),i=new TextDecoder("utf8"),a=i.decode(n),o=JSON.parse(a),s=Ab(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,mb(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,mb(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,mb(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 mb(e,t,r){return bb.apply(this,arguments)}function bb(){return(bb=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u;return Pe.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,Tu(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 Ab(e){var t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+Math.pow(2,32)*n}var Bb={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.2.3",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:function(e){return gb.apply(this,arguments)},options:{}},wb={QUADTREE:4,OCTREE:8};function _b(e){return xb.apply(this,arguments)}function xb(){return(xb=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v,y,g,m,b,A,B,w,_,x,C,O,E,T,S,k,M,I,R,P,F,D,L,j,G,U,N;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.options,n=t.parentData,i=void 0===n?{mortonIndex:0,x:0,y:0,z:0}:n,a=t.childIndex,o=void 0===a?0:a,s=t.globalData,u=void 0===s?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,c=t.subtree,l=t.level,f=void 0===l?0:l,h=r.subdivisionScheme,d=r.subtreeLevels,p=r.maximumLevel,v=r.contentUrlTemplate,y=r.subtreesUriTemplate,g=r.basePath,m={children:[],lodMetricValue:0,contentUrl:""},b=wb[h],A=1&o,B=o>>1&1,w=o>>2&1,_=(Math.pow(b,f)-1)/(b-1),x=Eb(i.mortonIndex,o),C=_+x,O=Eb(i.x,A),E=Eb(i.y,B),T=Eb(i.z,w),S=!1,f+1>d&&(S=Cb(c.childSubtreeAvailability,x)),k=Eb(u.x,O),M=Eb(u.y,E),I=Eb(u.z,T),R=f+u.level,!S){e.next=38;break}return P="".concat(g,"/").concat(y),F=Tb(P,R,k,M,I),e.next=25,Yl(F,Bb);case 25:D=e.sent,c=D,u.mortonIndex=x,u.x=O,u.y=E,u.z=T,u.level=f,x=0,C=0,O=0,E=0,T=0,f=0;case 38:if(Cb(c.tileAvailability,C)&&!(f>p)){e.next=41;break}return e.abrupt("return",m);case 41:Cb(c.contentAvailability,C)&&(m.contentUrl=Tb(v,R,k,M,I)),L=f+1,j={mortonIndex:x,x:O,y:E,z:T},G=0;case 46:if(!(G<b)){e.next=54;break}return e.next=49,_b({subtree:c,options:r,parentData:j,childIndex:G,level:L,globalData:u});case 49:((U=e.sent).contentUrl||U.children.length)&&(N=Ob(U,R+1,{childTileX:O,childTileY:E,childTileZ:T},r),m.children.push(N));case 51:G++,e.next=46;break;case 54:return e.abrupt("return",m);case 55:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cb(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 Ob(e,t,r,n){var i=n.basePath,a=n.refine,o=n.getRefine,s=n.lodMetricType,u=n.getTileType,c=n.rootLodMetricValue,l=n.rootBoundingVolume,f=e.contentUrl&&e.contentUrl.replace("".concat(i,"/"),""),h=c/Math.pow(2,t),d=function(e,t,r){if(t.region){var n=r.childTileX,i=r.childTileY,a=r.childTileZ,o=M()(t.region,6),s=o[0],u=o[1],c=o[2],l=o[3],f=o[4],h=o[5],d=Math.pow(2,e),p=(c-s)/d,v=(l-u)/d,y=(h-f)/d;return{region:[s+p*n,u+v*i,s+p*(n+1),u+v*(i+1),f+y*a,f+y*(a+1)]}}return console.warn("Unsupported bounding volume type: ",t),null}(t,l,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:f},id:e.contentUrl,refine:o(a),type:u(e),lodMetricType:s,lodMetricValue:h,boundingVolume:d}}function Eb(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function Tb(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 Sb(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 kb(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 kb(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 kb(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 Mb(e){if(!e.contentUrl)return Zf;var t=e.contentUrl.split(".").pop();switch(t){case"pnts":return $f;case"i3dm":case"b3dm":case"glb":case"gltf":return Yf;default:return t}}function Ib(e){switch(e){case"REPLACE":case"replace":return Wf;case"ADD":case"add":return Qf;default:return e}}function Rb(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=nh,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=Mb(e),e.refine=Ib(e.refine),e}function Pb(e){var t=e.basePath,r=Rb(e.root,e),n=[];for(n.push(r);n.length>0;){var i,a=Sb((n.pop()||{}).children||[]);try{for(a.s();!(i=a.n()).done;){var o=i.value;Rb(o,{basePath:t}),n.push(o)}}catch(e){a.e(e)}finally{a.f()}}return r}function Fb(e){return Db.apply(this,arguments)}function Db(){return(Db=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v;return Pe.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=Tb(s,0,0,0,0),c="".concat(r,"/").concat(u),e.next=9,Yl(c,Bb);case 9:return l=e.sent,f="".concat(r,"/").concat(t.root.content.uri),h=t.root.refine,d=t.root.geometricError,p=t.root.boundingVolume,v={contentUrlTemplate:f,subtreesUriTemplate:s,subdivisionScheme:i,subtreeLevels:o,maximumLevel:a,refine:h,basePath:r,lodMetricType:nh,rootLodMetricValue:d,rootBoundingVolume:p,getTileType:Mb,getRefine:Ib},e.next=17,Lb(t.root,l,v);case 17:return e.abrupt("return",e.sent);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lb(e,t,r){return jb.apply(this,arguments)}function jb(){return(jb=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.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=nh,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,e.next=7,_b({subtree:r,options: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=Ib(t.refine),t.type=Mb(t),t.children=a,t.id=t.contentUrl,e.abrupt("return",t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Gb={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.2.3",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(e,t,r){return zb.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function Ub(e){return n.dirname(e.url)}function Nb(e,t,r){return Hb.apply(this,arguments)}function Hb(){return(Hb=Ie()(Pe.a.mark((function e(t,r,n){var i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={content:{featureIds:null}},0,e.next=4,vb(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 Jb(e,t,r){return Vb.apply(this,arguments)}function Vb(){return(Vb=Ie()(Pe.a.mark((function e(t,r,n){var i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=JSON.parse((new TextDecoder).decode(t))).loader=r.loader||Gb,a.url=n.url,a.basePath=Ub(a),!Kb(a)){e.next=10;break}return e.next=7,Fb(a);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=Pb(a);case 11:return a.root=e.t0,a.type=rh,a.lodMetricType=nh,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 zb(){return(zb=Ie()(Pe.a.mark((function e(t,r,n){var i;return Pe.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,Jb(t,r,n);case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,Nb(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 Kb(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 qb(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 Xb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qb(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Qb(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 y()(this,r)}}var Wb=[0],Zb={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:Gb,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}},Yb=function(e){p()(n,e);var t,r=Qb(n);function n(){var e;h()(this,n);for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return e=r.call.apply(r,[this].concat(i)),A()(pi()(e),"state",void 0),e}return C()(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 null!==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=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.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:Xb({},n)},!i.preload){e.next=10;break}return e.next=7,i.preload(t,n);case 7:(o=e.sent).headers&&(a.loadOptions.fetch=Xb(Xb({},a.loadOptions.fetch),{},{headers:o.headers})),Object.assign(a,o);case 10:return e.next=12,Yl(t,i,a.loadOptions);case 12:s=e.sent,u=new Wh(s,Xb({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError: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;if(e){var r=this.state.tileset3d,n=this.context.timeline,i=Object.keys(e).length;n&&i&&r&&r.selectTiles(Object.values(e)).then((function(e){t.state.frameNumber!==e&&t.setState({frameNumber:e})}))}}},{key:"_getSubLayer",value:function(e,t){if(!e.content)return null;switch(e.type){case $f:return this._makePointCloudLayer(e,t);case Yf:return this._make3DModelLayer(e);case eh: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||Wb,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 Ii.Geometry({drawMode:4,attributes:$b(n),indices:i});return new(this.getSubLayerClass("mesh",qs))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:h,data:Wb,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 $b(e){var t={};return t.positions=Xb(Xb({},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}A()(Yb,"defaultProps",Zb),A()(Yb,"layerName","Tile3DLayer");var eA={name:"Terrain",id:"terrain",module:"terrain",version:"3.2.3",worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};function tA(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 y()(this,r)}}function rA(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 nA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rA(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var iA=[1],aA=nA(nA({},ai.defaultProps),{},{elevationData:kn,texture:nA(nA({},kn),{},{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:[eA]});function oA(e){return Array.isArray(e)?e.join(";"):e||""}var sA,uA=function(e){p()(r,e);var t=tA(r);function r(){var e;h()(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i)),A()(pi()(e),"state",void 0),e}return C()(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=nA(nA({},s),{},{terrain:nA(nA({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=In(r,e),c=i&&In(i,e),l=e.signal,f=[0,0],h=[0,0];if(s.isGeospatial){var d=e.bbox;f=s.projectFlat([d.west,d.south]),h=s.projectFlat([d.east,d.north])}else{var p=e.bbox;f=[p.left,p.bottom],h=[p.right,p.top]}var v=[f[0],f[1],h[0],h[1]],y=this.loadTerrain({elevationData:u,bounds:v,elevationDecoder:a,meshMaxError:o,signal:l}),g=c?n(c,{propName:"texture",layer:this,loaders:[],signal:l}).catch((function(e){return null})):Promise.resolve(null);return Promise.all([y,g])}},{key:"renderSubLayers",value:function(e){var t=this.getSubLayerClass("mesh",B.SimpleMeshLayer),r=this.props,n=r.color,i=r.wireframe,a=r.material,o=e.data;if(!o)return null;var s=M()(o,2),u=s[0],c=s[1];return new t(e,{data:iA,mesh:u,texture:c,_instanced:!1,coordinateSystem:B.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(e){return[0,0,0]},getColor:n,wireframe:i,material:a})}},{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,Le()(r.map((function(e){return e[0]})))),i=Math.max.apply(Math,Le()(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,v=e.onTileError,y=e.maxCacheSize,g=e.maxCacheByteSize,m=e.refinementStrategy;return this.state.isTiled?new ai(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:oA(n),texture:oA(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:v,maxCacheSize:y,maxCacheByteSize:g,refinementStrategy:m}):new(this.getSubLayerClass("mesh",B.SimpleMeshLayer))(this.getSubLayerProps({id:"mesh"}),{data:iA,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 cA(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}A()(uA,"defaultProps",aA),A()(uA,"layerName","TerrainLayer"),function(e){e[e.CLOCKWISE=1]="CLOCKWISE",e[e.COUNTER_CLOCKWISE=-1]="COUNTER_CLOCKWISE"}(sA||(sA={}));function lA(e,t,r,n,i,a){var o,s;if(void 0===a&&(a=cA(e,{start:t,end:r,size:n})),i===a<0)for(o=t;o<r;o+=n)s=IA(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=IA(o,e[o],e[o+1],s);return s&&OA(s,s.next)&&(RA(s),s=s.next),s}function fA(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!OA(n,n.next)&&0!==CA(n.prev,n,n.next))n=n.next;else{if(RA(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function hA(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=BA(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?pA(e,n,i,a):dA(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),RA(e),e=u.next,c=u.next;else if((e=u)===c){o?1===o?hA(e=vA(fA(e),t,r),t,r,n,i,a,2):2===o&&yA(e,t,r,n,i,a):hA(fA(e),t,r,n,i,a,1);break}}}function dA(e){var t=e.prev,r=e,n=e.next;if(CA(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(_A(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&CA(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function pA(e,t,r,n){var i=e.prev,a=e,o=e.next;if(CA(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=BA(s,u,t,r,n),h=BA(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&&_A(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&CA(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&_A(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&CA(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&_A(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&CA(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&_A(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&CA(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function vA(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!OA(i,a)&&EA(i,n,n.next,a)&&kA(i,a)&&kA(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),RA(n),RA(n.next),n=e=a),n=n.next}while(n!==e);return fA(n)}function yA(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&xA(o,s)){var u=MA(o,s);return o=fA(o,o.next),u=fA(u,u.next),hA(o,t,r,n,i,a),void hA(u,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function gA(e,t,r,n,i){var a,o,s,u=[];for(a=0,o=t.length;a<o;a++)(s=lA(e,t[a]*n,a<o-1?t[a+1]*n:e.length,n,!1,i&&i[a+1]))===s.next&&(s.steiner=!0),u.push(wA(s));for(u.sort(mA),a=0;a<u.length;a++)bA(u[a],r),r=fA(r,r.next);return r}function mA(e,t){return e.x-t.x}function bA(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&&_A(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),kA(n,e)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&AA(r,n)))&&(r=n,h=u)),n=n.next}while(n!==c);return r}(e,t)){var r=MA(t,e);fA(t,t.next),fA(r,r.next)}}function AA(e,t){return CA(e.prev,e,t.prev)<0&&CA(t.next,e,e.next)<0}function BA(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 wA(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 _A(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 xA(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&&EA(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(kA(e,t)&&kA(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)&&(CA(e.prev,e,t.prev)||CA(e,t.prev,t))||OA(e,t)&&CA(e.prev,e,e.next)>0&&CA(t.prev,t,t.next)>0)}function CA(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function OA(e,t){return e.x===t.x&&e.y===t.y}function EA(e,t,r,n){var i=SA(CA(e,t,r)),a=SA(CA(e,t,n)),o=SA(CA(r,n,e)),s=SA(CA(r,n,t));return i!==a&&o!==s||(!(0!==i||!TA(e,r,t))||(!(0!==a||!TA(e,n,t))||(!(0!==o||!TA(r,e,n))||!(0!==s||!TA(r,t,n)))))}function TA(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 SA(e){return e>0?1:e<0?-1:0}function kA(e,t){return CA(e.prev,e,e.next)<0?CA(e,t,e.next)>=0&&CA(e,e.prev,t)>=0:CA(e,t,e.prev)<0||CA(e,e.next,t)<0}function MA(e,t){var r=new PA(e.i,e.x,e.y),n=new PA(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 IA(e,t,r,n){var i=new PA(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 RA(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 PA(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}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 DA(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 DA(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 DA(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){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 jA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?LA(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function GA(e,t,r){var n=UA(e),i=Object.keys(n).filter((function(e){return n[e]!==Array}));return function(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=t.propArrayTypes,d=t.coordLength,p=r.numericPropKeys,v=void 0===p?[]:p,y=r.PositionDataType,g=void 0===y?Float32Array:y,m=(e[0]&&"id"in e[0]),b=e.length>65535?Uint32Array:Uint16Array,A={type:"Point",positions:new g(n*d),globalFeatureIds:new b(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},B={type:"LineString",pathIndices:a>65535?new Uint32Array(o+1):new Uint16Array(o+1),positions:new g(a*d),globalFeatureIds:new b(a),featureIds:s>65535?new Uint32Array(a):new Uint16Array(a),numericProps:{},properties:[],fields:[]},w={type:"Polygon",polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new g(u*d),triangles:[],globalFeatureIds:new b(u),featureIds:f>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]},_=0,x=[A,B,w];_<x.length;_++){var C,O=x[_],E=FA(v);try{for(E.s();!(C=E.n()).done;){var T=C.value,S=h[T];O.numericProps[T]=new S(O.positions.length/d)}}catch(e){E.e(e)}finally{E.f()}}B.pathIndices[o]=a,w.polygonIndices[c]=u,w.primitivePolygonIndices[l]=u;var k,M={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},I=FA(e);try{for(I.s();!(k=I.n()).done;){var R=k.value,P=R.geometry,F=R.properties||{};switch(P.type){case"Point":NA(P,A,M,d,F),A.properties.push(qA(F,v)),m&&A.fields.push({id:R.id}),M.pointFeature++;break;case"LineString":HA(P,B,M,d,F),B.properties.push(qA(F,v)),m&&B.fields.push({id:R.id}),M.lineFeature++;break;case"Polygon":JA(P,w,M,d,F),w.properties.push(qA(F,v)),m&&w.fields.push({id:R.id}),M.polygonFeature++;break;default:throw new Error("Invalid geometry type")}M.feature++}}catch(e){I.e(e)}finally{I.f()}return function(e,t,r,n){return{points:jA(jA({},e),{},{positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:zA(e.numericProps,1)}),lines:jA(jA({},t),{},{positions:{value:t.positions,size:n},pathIndices:{value:t.pathIndices,size:1},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:zA(t.numericProps,1)}),polygons:jA(jA({},r),{},{positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},triangles:{value:new Uint32Array(r.triangles),size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:zA(r.numericProps,1)})}}(A,B,w,d)}(e,jA({propArrayTypes:n},t),{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array})}function UA(e){var t,r={},n=FA(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}function NA(e,t,r,n,i){t.positions.set(e.data,r.pointPosition*n);var a=e.data.length/n;KA(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 HA(e,t,r,n,i){t.positions.set(e.data,r.linePosition*n);var a=e.data.length/n;KA(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.indices.length;o<s;++o){var u=e.indices[o],c=o===s-1?e.data.length:e.indices[o+1];t.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-u)/n}}function JA(e,t,r,n,i){t.positions.set(e.data,r.polygonPosition*n);var a=e.data.length/n;KA(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.indices.length;o<s;++o){var u=r.polygonPosition;t.polygonIndices[r.polygonObject++]=u;for(var c=e.areas[o],l=e.indices[o],f=e.indices[o+1],h=0,d=l.length;h<d;++h){var p=l[h],v=h===d-1?void 0===f?e.data.length:f[0]:l[h+1];t.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(v-p)/n}VA(t,c,l,{startPosition:u,endPosition:r.polygonPosition,coordLength:n})}}function VA(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=function(e,t){var r,n,i,a,o,s,u,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=arguments.length>3?arguments[3]:void 0,f=t&&t.length,h=f?t[0]*c:e.length,d=lA(e,0,h,c,!0,l&&l[0]),p=[];if(!d||d.next===d.prev)return p;if(f&&(d=gA(e,t,d,c,l)),e.length>80*c){a=n=e[0],o=i=e[1];for(var v=c;v<h;v+=c)(s=e[v])<a&&(a=s),(u=e[v+1])<o&&(o=u),s>n&&(n=s),u>i&&(i=u);r=0!==(r=Math.max(n-a,i-o))?1/r:0}return hA(d,p,c,a,o,r),p}(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 zA(e,t){var r={};for(var n in e)r[n]={value:e[n],size:t};return r}function KA(e,t,r,n){for(var i in e.numericProps)if(i in t){var a=t[i];e.numericProps[i].fill(a,r,r+n)}}function qA(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 QA=r(41),WA=r.n(QA);function ZA(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 YA(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))}var $A=function(){function e(t,r,n,i,a){h()(this,e),Un(this,"properties",void 0),Un(this,"extent",void 0),Un(this,"type",void 0),Un(this,"id",void 0),Un(this,"_pbf",void 0),Un(this,"_geometry",void 0),Un(this,"_keys",void 0),Un(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(YA,this,r)}return C()(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=ZA(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}(),eB=function(){function e(t,r){h()(this,e),Un(this,"version",void 0),Un(this,"name",void 0),Un(this,"extent",void 0),Un(this,"length",void 0),Un(this,"_pbf",void 0),Un(this,"_keys",void 0),Un(this,"_values",void 0),Un(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(tB,this,r),this.length=this._features.length}return C()(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 $A(this._pbf,t,this.extent,this._keys,this._values)}}]),e}();function tB(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 rB,nB,iB,aB,oB,sB,uB,cB=function e(t,r){h()(this,e),Un(this,"layers",void 0),this.layers=t.readFields(lB,{},r)};function lB(e,t,r){if(3===e&&r){var n=new eB(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function fB(e){var t=e.indices.length;if(t<=1)return{type:"Polygon",data:e.data,areas:[[cA(e.data)]],indices:[e.indices]};for(var r,n,i,a=[],o=[],s=[],u=[],c=0,l=0;l<t;l++){i=e.indices[l]-c,n=e.indices[l+1]-c||e.data.length;var f=cA(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),{type:"Polygon",areas:a,indices:o,data:e.data}}function hB(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 dB(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 pB(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 pB(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 pB(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 vB(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 yB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var gB=function(){function e(t,r,n,i,a,o){h()(this,e),Un(this,"properties",void 0),Un(this,"extent",void 0),Un(this,"type",void 0),Un(this,"id",void 0),Un(this,"_pbf",void 0),Un(this,"_geometry",void 0),Un(this,"_keys",void 0),Un(this,"_values",void 0),Un(this,"_geometryInfo",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._geometryInfo=o,t.readFields(hB,this,r)}return C()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry,rB=e.readVarint()+e.pos,nB=1,aB=0,oB=0,sB=0,uB=0;for(var t=[],r=[];e.pos<rB;)if(aB<=0&&(iB=e.readVarint(),nB=7&iB,aB=iB>>3),aB--,1===nB||2===nB)oB+=e.readSVarint(),sB+=e.readSVarint(),1===nB&&t.push(uB),r.push(oB,sB),uB+=2;else{if(7!==nB)throw new Error("unknown command ".concat(nB));if(uB>0){var n=t[t.length-1];r.push(r[n],r[n+1]),uB+=2}}return{data:r,indices:t}}},{key:"_toBinaryCoordinates",value:function(e){var t,r=this.loadGeometry();e(r.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,t=yB({type:"Point"},r);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/2,t=yB({type:"LineString"},r);break;case 3:t=fB(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=t.indices.length;var n,i=dB(t.indices);try{for(i.s();!(n=i.n()).done;){var a=n.value;this._geometryInfo.polygonRingsCount+=a.length}}catch(e){i.e(e)}finally{i.f()}this._geometryInfo.polygonPositionsCount+=t.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var o={type:"Feature",geometry:t,properties:this.properties};return null!==this.id&&(o.id=this.id),o}},{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){return function(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}}(e,a,o,i)}))}}]),e}(),mB=function(){function e(t,r){h()(this,e),Un(this,"version",void 0),Un(this,"name",void 0),Un(this,"extent",void 0),Un(this,"length",void 0),Un(this,"_pbf",void 0),Un(this,"_keys",void 0),Un(this,"_values",void 0),Un(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 C()(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 gB(this._pbf,r,this.extent,this._keys,this._values,t)}}]),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),Un(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,t){var r,n,i=function(e){var t;if(null==e||!e.mvt)throw new Error("mvt options required");var r="wgs84"===(null===(t=e.mvt)||void 0===t?void 0:t.coordinates),n=e.mvt.tileIndex,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(r&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return e.mvt}(t),a=(null==t?void 0:null===(r=t.gis)||void 0===r?void 0:r.format)||(null==t?void 0:null===(n=t.mvt)||void 0===n?void 0:n.shape);switch(a){case"columnar-table":return{shape:"columnar-table",data:_B(e,i)};case"geojson-row-table":return{shape:"geojson-row-table",data:xB(e,i)};case"geojson":return xB(e,i);case"binary-geometry":case"binary":return _B(e,i);default:throw new Error(a)}}function _B(e,t){var r=function(e,t){var r=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength<=0)return[r,n];var i=new AB(new WA.a(e));return(t&&Array.isArray(t.layers)?t.layers:Object.keys(i.layers)).forEach((function(e){var a=i.layers[e];if(a)for(var o=0;o<a.length;o++){var s=OB(a.feature(o,n),t,e);r.push(s)}})),[r,n]}(e,t),n=M()(r,2),i=GA(n[0],n[1]);return i.byteLength=e.byteLength,i}function xB(e,t){if(e.byteLength<=0)return[];var r=[],n=new cB(new WA.a(e));return(Array.isArray(t.layers)?t.layers:Object.keys(n.layers)).forEach((function(e){var i=n.layers[e];if(i)for(var a=0;a<i.length;a++){var o=CB(i.feature(a),t,e);r.push(o)}})),r}function CB(e,t,r){var n=e.toGeoJSON("wgs84"===t.coordinates?t.tileIndex:EB);return t.layerProperty&&(n.properties[t.layerProperty]=r),n}function OB(e,t,r){var n=e.toBinaryCoordinates("wgs84"===t.coordinates?t.tileIndex:TB);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=r),n}function EB(e,t){for(var r=t.extent,n=0;n<e.length;n++){var i=e[n];i[0]/=r,i[1]/=r}}function TB(e,t){for(var r=t.extent,n=0,i=e.length;n<i;++n)e[n]/=r}function SB(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 kB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?SB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var MB,IB={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.2.3",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}};kB(kB({},IB),{},{parse:(MB=Ie()(Pe.a.mark((function e(t,r){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",wB(t,r));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return MB.apply(this,arguments)}),parseSync:wB,binary:!0});function RB(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 PB(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 FB(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 FB(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 FB(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 DB(e,t){var r=null==t?void 0:t.globalFeatureId;return void 0!==r?function(e,t){var r,n=PB(GB(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 UB(i,a,s);a=s,o=u}}if(t===i.globalFeatureIds.value[a])return UB(i,a,i.featureIds.value.length)}}catch(e){n.e(e)}finally{n.f()}throw new Error("featureId:".concat(t," not found"))}(e,r):LB(e,null==t?void 0:t.type)}function LB(e,t){return function(e){var t,r=[],n=PB(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(UB(i,a,s)),a=s,o=u)}r.push(UB(i,a,i.featureIds.value.length))}}}catch(e){n.e(e)}finally{n.f()}return r}(GB(e,t))}function jB(e,t,r){switch(e.type){case"Point":return function(e,t,r){var n=NB(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=NB(n,i[0],i[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<i.length-1;u++){var c=NB(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=NB(i,l,f);u.push(h)}return{type:"Polygon",coordinates:u}}for(var d=[],p=0;p<a.length-1;p++){var v=a[p],y=a[p+1],g=e(t,v,y).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 GB(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 UB(e,t,r){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?RB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({type:"Feature",geometry:jB(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 NB(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 HB(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 JB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?HB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var VB={Point:zB,MultiPoint:function(e,t,r){return KB(e,t,r)},LineString:qB,MultiLineString:function(e,t,r){return e.map((function(e){return qB(e,t,r)}))},Polygon:XB,MultiPolygon:function(e,t,r){return e.map((function(e){return XB(e,t,r)}))}};function zB(e,t,r){var n=M()(e,2),i=n[0],a=n[1],o=M()(t,2),s=o[0],u=o[1],c=ct(s[0],u[0],i),l=ct(s[1],u[1],a);return r.unprojectFlat([c,l])}function KB(e,t,r){return e.map((function(e){return zB(e,t,r)}))}function qB(e,t,r){return KB(e,t,r)}function XB(e,t,r){return e.map((function(e){return KB(e,t,r)}))}function QB(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 WB(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 WB(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 WB(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 ZB=["points","lines","polygons"];function YB(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 t?u=$B(e.properties,(function(e){return e[t]===r}),a,o):e.fields&&(u=$B(e.fields,(function(e){return e.id===r}),a,o)),u>=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 $B(e,t,r,n){for(var i=r;i<n;i++)if(t(e[i],i))return i;return-1}function ew(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 tw(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 tw(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 tw(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 rw(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 y()(this,r)}}function nw(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 iw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nw(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nw(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var aw=iw(iw({},B.GeoJsonLayer.defaultProps),{},{onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[IB],binary:!0}),ow=function(e){p()(n,e);var t,r=rw(n);function n(){return h()(this,n),r.apply(this,arguments)}return C()(n,[{key:"initializeState",value:function(){si()(m()(n.prototype),"initializeState",this).call(this);var e=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:e,data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&si()(m()(n.prototype),"isLoaded",this)}},{key:"updateState",value:function(e){var t,r=e.props,i=e.oldProps,a=e.context,o=e.changeFlags;o.dataChanged&&this._updateTileData(),null!==(t=this.state)&&void 0!==t&&t.data&&(si()(m()(n.prototype),"updateState",this).call(this,{props:r,oldProps:i,context:a,changeFlags:o}),this._setWGS84PropertyForTiles());var s=r.highlightColor;s!==i.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}},{key:"_updateTileData",value:(t=Ie()(Pe.a.mark((function e(){var t,r,n,i,a;return Pe.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,{propName:"data",layer:this}),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(){var e=si()(m()(n.prototype),"_getTilesetOptions",this).call(this),t=this.state.tileJSON,r=this.props,i=r.minZoom,a=r.maxZoom;return t&&(Number.isFinite(t.minzoom)&&t.minzoom>i&&(e.minZoom=t.minzoom),Number.isFinite(t.maxzoom)&&(!Number.isFinite(a)||t.maxzoom<a)&&(e.maxZoom=t.maxzoom)),e}},{key:"renderLayers",value:function(){var e;return null!==(e=this.state)&&void 0!==e&&e.data?si()(m()(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(e){var t,r=this.state,n=r.data,i=r.binary,a=e.index,o=e.signal,s=In(n,e);if(!s)return Promise.reject("Invalid URL");var u=this.getLoadOptions();return(0,this.props.fetch)(s,{propName:"data",layer:this,loadOptions:u=iw(iw({},u),{},{mimeType:"application/x-protobuf",mvt:iw(iw({},null===(t=u)||void 0===t?void 0:t.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:a}),gis:i?{format:"binary"}:{}}),signal:o})}},{key:"renderSubLayers",value:function(e){var t=e.tile.index,r=t.x,i=t.y,a=t.z,o=Math.pow(2,a),s=512/o,u=-s,c=512*r/o,l=512*(1-i/o),f=(new Xr).scale([s,u,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=f,e.coordinateOrigin=[c,l,0],e.coordinateSystem=B.COORDINATE_SYSTEM.CARTESIAN,e.extensions=[].concat(Le()(e.extensions||[]),[new B.ClipExtension]));var h=si()(m()(n.prototype),"renderSubLayers",this).call(this,e);return!this.state.binary||h instanceof B.GeoJsonLayer||B.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),h}},{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=sw(s,n),r=uw(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=si()(m()(n.prototype),"getPickingInfo",this).call(this,e),r=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==t.index){var i=e.sourceLayer.props.data;t.object=DB(i,{globalFeatureId:t.index})}return t.object&&!r&&(t.object=lw(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=t.binary,a=this.props,o=a.uniqueIdProperty,s=a.highlightedFeatureId,u=e.content,c=cw(s);if(!(cw(r)||c))return-1;var l=c?s:r;return Array.isArray(u)?u.findIndex((function(e){var t=sw(e,o)===l,r=c||uw(e)===n;return t&&r})):u&&i?function(e,t,r,n){var i,a=QB(ZB);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e[o]&&YB(e[o],t,r,n);if(s>=0)return s}}catch(e){a.e(e)}finally{a.f()}return-1}(u,o,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=ew(r);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=sw(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.state.binary&&Array.isArray(t.content)&&!t.content.length)return[];var r,n=t.bbox;if(void 0===t._contentWGS84&&(r=n,Number.isFinite(r.west)&&Number.isFinite(r.north)&&Number.isFinite(r.east)&&Number.isFinite(r.south))){var i=e.state.binary?DB(t.content):t.content;t._contentWGS84=i.map((function(t){return lw(t,n,e.context.viewport)}))}return t._contentWGS84}})}))}}]),n}(ai);function sw(e,t){return e.properties&&t?e.properties[t]:"id"in e?e.id:void 0}function uw(e){var t;return(null===(t=e.properties)||void 0===t?void 0:t.layerName)||null}function cw(e){return null!=e&&""!==e}function lw(e,t,r){var n=iw(iw({},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 JB(JB({},e),{},{coordinates:VB[e.type](e.coordinates,n,r)})}(e.geometry,t,r).coordinates}}),n}A()(ow,"layerName","MVTLayer"),A()(ow,"defaultProps",aw);for(var fw={},hw=0;hw<"0123456789bcdefghjkmnpqrstuvwxyz".length;hw++)fw["0123456789bcdefghjkmnpqrstuvwxyz".charAt(hw)]=hw;function dw(e){var t=function(e){for(var t,r=!0,n=90,i=-90,a=180,o=-180,s=0,u=0,c=e.length;u<c;u++){var l=e[u].toLowerCase();s=fw[l];for(var f=4;f>=0;f--){var h=s>>f&1;r?(t=(a+o)/2,1===h?o=t:a=t):(t=(n+i)/2,1===h?i=t:n=t),r=!r}}return[i,o,n,a]}(e),r=M()(t,4),n=r[0],i=r[1],a=r[2],o=r[3];return[o,a,o,n,i,n,i,a,o,a]}function pw(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 y()(this,r)}}var vw=function(e){p()(r,e);var t=pw(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getGeohash;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return dw(r(e,t))}}}}]),r}(S);A()(vw,"layerName","GeohashLayer"),A()(vw,"defaultProps",{getGeohash:{type:"accessor",value:function(e){return e.geohash}}}),r.d(t,"GreatCircleLayer",(function(){return _})),r.d(t,"S2Layer",(function(){return J})),r.d(t,"QuadkeyLayer",(function(){return Se})),r.d(t,"TileLayer",(function(){return ai})),r.d(t,"TripsLayer",(function(){return fi})),r.d(t,"H3ClusterLayer",(function(){return Mi})),r.d(t,"H3HexagonLayer",(function(){return Ei})),r.d(t,"Tile3DLayer",(function(){return Yb})),r.d(t,"TerrainLayer",(function(){return uA})),r.d(t,"MVTLayer",(function(){return ow})),r.d(t,"GeohashLayer",(function(){return vw})),r.d(t,"_GeoCellLayer",(function(){return S})),r.d(t,"_getURLFromTemplate",(function(){return In})),r.d(t,"_Tileset2D",(function(){return Yn})),r.d(t,"_Tile2DHeader",(function(){return Fe}))}])}));