@loaders.gl/3d-tiles 3.0.12 → 3.0.13

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 (87) hide show
  1. package/dist/dist.es5.min.js +1 -1
  2. package/dist/dist.es5.min.js.map +1 -1
  3. package/dist/dist.min.js +1 -1
  4. package/dist/dist.min.js.map +1 -1
  5. package/dist/es5/bundle.js +2 -2
  6. package/dist/es5/bundle.js.map +1 -1
  7. package/dist/es5/cesium-ion-loader.js +23 -78
  8. package/dist/es5/cesium-ion-loader.js.map +1 -1
  9. package/dist/es5/index.js +7 -7
  10. package/dist/es5/lib/classes/helpers/tile-3d-accessor-utils.js +30 -42
  11. package/dist/es5/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
  12. package/dist/es5/lib/classes/tile-3d-batch-table-hierarchy.js +57 -59
  13. package/dist/es5/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
  14. package/dist/es5/lib/classes/tile-3d-batch-table.js +201 -240
  15. package/dist/es5/lib/classes/tile-3d-batch-table.js.map +1 -1
  16. package/dist/es5/lib/classes/tile-3d-feature-table.js +62 -80
  17. package/dist/es5/lib/classes/tile-3d-feature-table.js.map +1 -1
  18. package/dist/es5/lib/constants.js +4 -4
  19. package/dist/es5/lib/constants.js.map +1 -1
  20. package/dist/es5/lib/encoders/encode-3d-tile-batched-model.js +15 -22
  21. package/dist/es5/lib/encoders/encode-3d-tile-batched-model.js.map +1 -1
  22. package/dist/es5/lib/encoders/encode-3d-tile-composite.js +6 -13
  23. package/dist/es5/lib/encoders/encode-3d-tile-composite.js.map +1 -1
  24. package/dist/es5/lib/encoders/encode-3d-tile-instanced-model.js +14 -23
  25. package/dist/es5/lib/encoders/encode-3d-tile-instanced-model.js.map +1 -1
  26. package/dist/es5/lib/encoders/encode-3d-tile-point-cloud.js +15 -22
  27. package/dist/es5/lib/encoders/encode-3d-tile-point-cloud.js.map +1 -1
  28. package/dist/es5/lib/encoders/encode-3d-tile.js +3 -3
  29. package/dist/es5/lib/encoders/encode-3d-tile.js.map +1 -1
  30. package/dist/es5/lib/encoders/helpers/encode-3d-tile-header.js +6 -6
  31. package/dist/es5/lib/encoders/helpers/encode-3d-tile-header.js.map +1 -1
  32. package/dist/es5/lib/ion/ion.js +69 -197
  33. package/dist/es5/lib/ion/ion.js.map +1 -1
  34. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js +17 -18
  35. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
  36. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-normals.js +3 -3
  37. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
  38. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-positions.js +3 -3
  39. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
  40. package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js +26 -66
  41. package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
  42. package/dist/es5/lib/parsers/helpers/parse-3d-tile-header.js +3 -4
  43. package/dist/es5/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
  44. package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js +19 -17
  45. package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
  46. package/dist/es5/lib/parsers/helpers/parse-utils.js +7 -8
  47. package/dist/es5/lib/parsers/helpers/parse-utils.js.map +1 -1
  48. package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js +10 -36
  49. package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
  50. package/dist/es5/lib/parsers/parse-3d-tile-composite.js +12 -48
  51. package/dist/es5/lib/parsers/parse-3d-tile-composite.js.map +1 -1
  52. package/dist/es5/lib/parsers/parse-3d-tile-header.js +14 -30
  53. package/dist/es5/lib/parsers/parse-3d-tile-header.js.map +1 -1
  54. package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js +38 -63
  55. package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  56. package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js +117 -198
  57. package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
  58. package/dist/es5/lib/parsers/parse-3d-tile.js +15 -65
  59. package/dist/es5/lib/parsers/parse-3d-tile.js.map +1 -1
  60. package/dist/es5/lib/utils/version.js +1 -1
  61. package/dist/es5/lib/utils/version.js.map +1 -1
  62. package/dist/es5/tile-3d-writer.js +5 -5
  63. package/dist/es5/tile-3d-writer.js.map +1 -1
  64. package/dist/es5/tiles-3d-loader.js +35 -115
  65. package/dist/es5/tiles-3d-loader.js.map +1 -1
  66. package/dist/esm/lib/classes/tile-3d-batch-table-hierarchy.js +1 -1
  67. package/dist/esm/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
  68. package/dist/esm/lib/classes/tile-3d-batch-table.js +4 -4
  69. package/dist/esm/lib/classes/tile-3d-batch-table.js.map +1 -1
  70. package/dist/esm/lib/ion/ion.js +6 -6
  71. package/dist/esm/lib/ion/ion.js.map +1 -1
  72. package/dist/esm/lib/parsers/helpers/parse-3d-tile-gltf-view.js +2 -2
  73. package/dist/esm/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
  74. package/dist/esm/lib/parsers/helpers/parse-3d-tile-header.js +1 -1
  75. package/dist/esm/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
  76. package/dist/esm/lib/parsers/helpers/parse-3d-tile-tables.js +1 -1
  77. package/dist/esm/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
  78. package/dist/esm/lib/parsers/helpers/parse-utils.js +1 -5
  79. package/dist/esm/lib/parsers/helpers/parse-utils.js.map +1 -1
  80. package/dist/esm/lib/parsers/parse-3d-tile-header.js +1 -1
  81. package/dist/esm/lib/parsers/parse-3d-tile-header.js.map +1 -1
  82. package/dist/esm/lib/parsers/parse-3d-tile-instanced-model.js +1 -1
  83. package/dist/esm/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  84. package/dist/esm/lib/parsers/parse-3d-tile.js +1 -1
  85. package/dist/esm/lib/parsers/parse-3d-tile.js.map +1 -1
  86. package/dist/esm/lib/utils/version.js +1 -1
  87. package/package.json +8 -8
package/dist/dist.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)r.d(n,s,function(e){return t[e]}.bind(null,s));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=27)}([function(t,e,r){"use strict";r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return s})),r.d(e,"c",(function(){return i}));var n=1e-6,s="undefined"!=typeof Float32Array?Float32Array:Array,i=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return a}));var n=r(3);function s(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function i(t,e,r=""){if(n.b.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}const o={};function a(t,e){o[t]||(o[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}},function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"g",(function(){return i})),r.d(e,"e",(function(){return o})),r.d(e,"h",(function(){return a})),r.d(e,"d",(function(){return c})),r.d(e,"c",(function(){return u})),r.d(e,"m",(function(){return h})),r.d(e,"l",(function(){return f})),r.d(e,"n",(function(){return l})),r.d(e,"i",(function(){return d})),r.d(e,"j",(function(){return m})),r.d(e,"k",(function(){return y})),r.d(e,"a",(function(){return g})),r.d(e,"f",(function(){return b}));var n=r(0);function s(){var t=new n.a(3);return n.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function i(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function o(t,e,r){var s=new n.a(3);return s[0]=t,s[1]=e,s[2]=r,s}function a(t,e){var r=e[0],n=e[1],s=e[2],i=r*r+n*n+s*s;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function c(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function u(t,e,r){var n=e[0],s=e[1],i=e[2],o=r[0],a=r[1],c=r[2];return t[0]=s*c-i*a,t[1]=i*o-n*c,t[2]=n*a-s*o,t}function h(t,e,r){var n=e[0],s=e[1],i=e[2],o=r[3]*n+r[7]*s+r[11]*i+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*s+r[8]*i+r[12])/o,t[1]=(r[1]*n+r[5]*s+r[9]*i+r[13])/o,t[2]=(r[2]*n+r[6]*s+r[10]*i+r[14])/o,t}function f(t,e,r){var n=e[0],s=e[1],i=e[2];return t[0]=n*r[0]+s*r[3]+i*r[6],t[1]=n*r[1]+s*r[4]+i*r[7],t[2]=n*r[2]+s*r[5]+i*r[8],t}function l(t,e,r){var n=r[0],s=r[1],i=r[2],o=r[3],a=e[0],c=e[1],u=e[2],h=s*u-i*c,f=i*a-n*u,l=n*c-s*a,d=s*l-i*f,m=i*h-n*l,y=n*f-s*h,g=2*o;return h*=g,f*=g,l*=g,d*=2,m*=2,y*=2,t[0]=a+h+d,t[1]=c+f+m,t[2]=u+l+y,t}function d(t,e,r,n){var s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[0],i[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),i[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function m(t,e,r,n){var s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),i[1]=s[1],i[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function y(t,e,r,n){var s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),i[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),i[2]=s[2],t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function g(t,e){var r=t[0],n=t[1],s=t[2],i=e[0],o=e[1],a=e[2],u=Math.sqrt(r*r+n*n+s*s)*Math.sqrt(i*i+o*o+a*a),h=u&&c(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}var p,b=i;p=s()},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"d",(function(){return o})),r.d(e,"e",(function(){return a})),r.d(e,"g",(function(){return u})),r.d(e,"f",(function(){return h})),r.d(e,"a",(function(){return f})),r.d(e,"c",(function(){return l}));r(6);const n=1/Math.PI*180,s=1/180*Math.PI,i={};function o(t,{precision:e=i.precision||4}={}){return t=function(t){return Math.round(t/i.EPSILON)*i.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function c(t,e,r){if(a(t)){r=r||((n=t).clone?n.clone():new Array(n.length));for(let n=0;n<r.length&&n<t.length;++n)r[n]=e(t[n],n,r);return r}var n;return e(t)}function u(t){return function(t,e){return c(t,t=>t*s,e)}(t)}function h(t){return function(t,e){return c(t,t=>t*n,e)}(t)}function f(t,e,r){return c(t,t=>Math.max(e,Math.min(r,t)))}function l(t,e,r){const n=i.EPSILON;r&&(i.EPSILON=r);try{if(t===e)return!0;if(a(t)&&a(e)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!l(t[r],e[r]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=i.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{i.EPSILON=n}}i.EPSILON=1e-12,i.debug=!1,i.precision=4,i.printTypes=!1,i.printDegrees=!1,i.printRowMajor=!0},function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"g",(function(){return i})),r.d(e,"c",(function(){return o})),r.d(e,"l",(function(){return a})),r.d(e,"a",(function(){return c})),r.d(e,"k",(function(){return u})),r.d(e,"h",(function(){return h})),r.d(e,"m",(function(){return f})),r.d(e,"j",(function(){return l})),r.d(e,"d",(function(){return d})),r.d(e,"i",(function(){return m})),r.d(e,"n",(function(){return y})),r.d(e,"o",(function(){return g})),r.d(e,"f",(function(){return p})),r.d(e,"e",(function(){return b}));var n=r(0);function s(t){var e=new n.a(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function i(t,e,r,s){var i=new n.a(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=s,i}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t,e,r,n,s){return t[0]=e,t[1]=r,t[2]=n,t[3]=s,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function u(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function h(t){var e=t[0],r=t[1],n=t[2],s=t[3];return Math.hypot(e,r,n,s)}function f(t){var e=t[0],r=t[1],n=t[2],s=t[3];return e*e+r*r+n*n+s*s}function l(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],o=r*r+n*n+s*s+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=s*o,t[3]=i*o,t}function d(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function m(t,e,r,n){var s=e[0],i=e[1],o=e[2],a=e[3];return t[0]=s+n*(r[0]-s),t[1]=i+n*(r[1]-i),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function y(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*s+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*s+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*s+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*s+r[11]*i+r[15]*o,t}function g(t,e,r){var n=e[0],s=e[1],i=e[2],o=r[0],a=r[1],c=r[2],u=r[3],h=u*n+a*i-c*s,f=u*s+c*n-o*i,l=u*i+o*s-a*n,d=-o*n-a*s-c*i;return t[0]=h*u+d*-o+f*-c-l*-a,t[1]=f*u+d*-a+l*-o-h*-c,t[2]=l*u+d*-c+h*-a-f*-o,t[3]=e[3],t}function p(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function b(t,e){var r=t[0],s=t[1],i=t[2],o=t[3],a=e[0],c=e[1],u=e[2],h=e[3];return Math.abs(r-a)<=n.b*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(s-c)<=n.b*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(i-u)<=n.b*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=n.b*Math.max(1,Math.abs(o),Math.abs(h))}var T,w;T=new n.a(4),n.a!=Float32Array&&(T[0]=0,T[1]=0,T[2]=0,T[3]=0),w=T},function(t,e,r){"use strict";r.d(e,"o",(function(){return s})),r.d(e,"d",(function(){return i})),r.d(e,"a",(function(){return o})),r.d(e,"f",(function(){return a})),r.d(e,"n",(function(){return c})),r.d(e,"m",(function(){return u})),r.d(e,"i",(function(){return h})),r.d(e,"j",(function(){return f})),r.d(e,"k",(function(){return l})),r.d(e,"l",(function(){return d})),r.d(e,"b",(function(){return m})),r.d(e,"c",(function(){return y})),r.d(e,"h",(function(){return g})),r.d(e,"g",(function(){return p})),r.d(e,"e",(function(){return b}));var n=r(0);function s(t,e){if(t===e){var r=e[1],n=e[2],s=e[3],i=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[11]=e[14],t[12]=s,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function i(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],y=e[13],g=e[14],p=e[15],b=r*a-n*o,T=r*c-s*o,w=r*u-i*o,E=n*c-s*a,O=n*u-i*a,_=s*u-i*c,A=h*y-f*m,I=h*g-l*m,v=h*p-d*m,S=f*g-l*y,N=f*p-d*y,x=l*p-d*g,M=b*x-T*N+w*S+E*v-O*I+_*A;return M?(M=1/M,t[0]=(a*x-c*N+u*S)*M,t[1]=(s*N-n*x-i*S)*M,t[2]=(y*_-g*O+p*E)*M,t[3]=(l*O-f*_-d*E)*M,t[4]=(c*v-o*x-u*I)*M,t[5]=(r*x-s*v+i*I)*M,t[6]=(g*w-m*_-p*T)*M,t[7]=(h*_-l*w+d*T)*M,t[8]=(o*N-a*v+u*A)*M,t[9]=(n*v-r*N-i*A)*M,t[10]=(m*O-y*w+p*b)*M,t[11]=(f*w-h*O-d*b)*M,t[12]=(a*I-o*S-c*A)*M,t[13]=(r*S-n*I+s*A)*M,t[14]=(y*T-m*E-g*b)*M,t[15]=(h*E-f*T+l*b)*M,t):null}function o(t){var e=t[0],r=t[1],n=t[2],s=t[3],i=t[4],o=t[5],a=t[6],c=t[7],u=t[8],h=t[9],f=t[10],l=t[11],d=t[12],m=t[13],y=t[14],g=t[15];return(e*o-r*i)*(f*g-l*y)-(e*a-n*i)*(h*g-l*m)+(e*c-s*i)*(h*y-f*m)+(r*a-n*o)*(u*g-l*d)-(r*c-s*o)*(u*y-f*d)+(n*c-s*a)*(u*m-h*d)}function a(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],h=e[7],f=e[8],l=e[9],d=e[10],m=e[11],y=e[12],g=e[13],p=e[14],b=e[15],T=r[0],w=r[1],E=r[2],O=r[3];return t[0]=T*n+w*a+E*f+O*y,t[1]=T*s+w*c+E*l+O*g,t[2]=T*i+w*u+E*d+O*p,t[3]=T*o+w*h+E*m+O*b,T=r[4],w=r[5],E=r[6],O=r[7],t[4]=T*n+w*a+E*f+O*y,t[5]=T*s+w*c+E*l+O*g,t[6]=T*i+w*u+E*d+O*p,t[7]=T*o+w*h+E*m+O*b,T=r[8],w=r[9],E=r[10],O=r[11],t[8]=T*n+w*a+E*f+O*y,t[9]=T*s+w*c+E*l+O*g,t[10]=T*i+w*u+E*d+O*p,t[11]=T*o+w*h+E*m+O*b,T=r[12],w=r[13],E=r[14],O=r[15],t[12]=T*n+w*a+E*f+O*y,t[13]=T*s+w*c+E*l+O*g,t[14]=T*i+w*u+E*d+O*p,t[15]=T*o+w*h+E*m+O*b,t}function c(t,e,r){var n,s,i,o,a,c,u,h,f,l,d,m,y=r[0],g=r[1],p=r[2];return e===t?(t[12]=e[0]*y+e[4]*g+e[8]*p+e[12],t[13]=e[1]*y+e[5]*g+e[9]*p+e[13],t[14]=e[2]*y+e[6]*g+e[10]*p+e[14],t[15]=e[3]*y+e[7]*g+e[11]*p+e[15]):(n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],h=e[7],f=e[8],l=e[9],d=e[10],m=e[11],t[0]=n,t[1]=s,t[2]=i,t[3]=o,t[4]=a,t[5]=c,t[6]=u,t[7]=h,t[8]=f,t[9]=l,t[10]=d,t[11]=m,t[12]=n*y+a*g+f*p+e[12],t[13]=s*y+c*g+l*p+e[13],t[14]=i*y+u*g+d*p+e[14],t[15]=o*y+h*g+m*p+e[15]),t}function u(t,e,r){var n=r[0],s=r[1],i=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function h(t,e,r,s){var i,o,a,c,u,h,f,l,d,m,y,g,p,b,T,w,E,O,_,A,I,v,S,N,x=s[0],M=s[1],L=s[2],j=Math.hypot(x,M,L);return j<n.b?null:(x*=j=1/j,M*=j,L*=j,i=Math.sin(r),a=1-(o=Math.cos(r)),c=e[0],u=e[1],h=e[2],f=e[3],l=e[4],d=e[5],m=e[6],y=e[7],g=e[8],p=e[9],b=e[10],T=e[11],w=x*x*a+o,E=M*x*a+L*i,O=L*x*a-M*i,_=x*M*a-L*i,A=M*M*a+o,I=L*M*a+x*i,v=x*L*a+M*i,S=M*L*a-x*i,N=L*L*a+o,t[0]=c*w+l*E+g*O,t[1]=u*w+d*E+p*O,t[2]=h*w+m*E+b*O,t[3]=f*w+y*E+T*O,t[4]=c*_+l*A+g*I,t[5]=u*_+d*A+p*I,t[6]=h*_+m*A+b*I,t[7]=f*_+y*A+T*I,t[8]=c*v+l*S+g*N,t[9]=u*v+d*S+p*N,t[10]=h*v+m*S+b*N,t[11]=f*v+y*S+T*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function f(t,e,r){var n=Math.sin(r),s=Math.cos(r),i=e[4],o=e[5],a=e[6],c=e[7],u=e[8],h=e[9],f=e[10],l=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*s+u*n,t[5]=o*s+h*n,t[6]=a*s+f*n,t[7]=c*s+l*n,t[8]=u*s-i*n,t[9]=h*s-o*n,t[10]=f*s-a*n,t[11]=l*s-c*n,t}function l(t,e,r){var n=Math.sin(r),s=Math.cos(r),i=e[0],o=e[1],a=e[2],c=e[3],u=e[8],h=e[9],f=e[10],l=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*s-u*n,t[1]=o*s-h*n,t[2]=a*s-f*n,t[3]=c*s-l*n,t[8]=i*n+u*s,t[9]=o*n+h*s,t[10]=a*n+f*s,t[11]=c*n+l*s,t}function d(t,e,r){var n=Math.sin(r),s=Math.cos(r),i=e[0],o=e[1],a=e[2],c=e[3],u=e[4],h=e[5],f=e[6],l=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*s+u*n,t[1]=o*s+h*n,t[2]=a*s+f*n,t[3]=c*s+l*n,t[4]=u*s-i*n,t[5]=h*s-o*n,t[6]=f*s-a*n,t[7]=l*s-c*n,t}function m(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],o=r+r,a=n+n,c=s+s,u=r*o,h=n*o,f=n*a,l=s*o,d=s*a,m=s*c,y=i*o,g=i*a,p=i*c;return t[0]=1-f-m,t[1]=h+p,t[2]=l-g,t[3]=0,t[4]=h-p,t[5]=1-u-m,t[6]=d+y,t[7]=0,t[8]=l+g,t[9]=d-y,t[10]=1-u-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function y(t,e,r,n,s,i,o){var a=1/(r-e),c=1/(s-n),u=1/(i-o);return t[0]=2*i*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*c,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(s+n)*c,t[10]=(o+i)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*u,t[15]=0,t}function g(t,e,r,n,s){var i,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=s&&s!==1/0?(i=1/(n-s),t[10]=(s+n)*i,t[14]=2*s*n*i):(t[10]=-1,t[14]=-2*n),t}function p(t,e,r,n,s,i,o){var a=1/(e-r),c=1/(n-s),u=1/(i-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(s+n)*c,t[14]=(o+i)*u,t[15]=1,t}function b(t,e,r,s){var i,o,a,c,u,h,f,l,d,m,y=e[0],g=e[1],p=e[2],b=s[0],T=s[1],w=s[2],E=r[0],O=r[1],_=r[2];return Math.abs(y-E)<n.b&&Math.abs(g-O)<n.b&&Math.abs(p-_)<n.b?function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(t):(f=y-E,l=g-O,d=p-_,i=T*(d*=m=1/Math.hypot(f,l,d))-w*(l*=m),o=w*(f*=m)-b*d,a=b*l-T*f,(m=Math.hypot(i,o,a))?(i*=m=1/m,o*=m,a*=m):(i=0,o=0,a=0),c=l*a-d*o,u=d*i-f*a,h=f*o-l*i,(m=Math.hypot(c,u,h))?(c*=m=1/m,u*=m,h*=m):(c=0,u=0,h=0),t[0]=i,t[1]=c,t[2]=f,t[3]=0,t[4]=o,t[5]=u,t[6]=l,t[7]=0,t[8]=a,t[9]=h,t[10]=d,t[11]=0,t[12]=-(i*y+o*g+a*p),t[13]=-(c*y+u*g+h*p),t[14]=-(f*y+l*g+d*p),t[15]=1,t)}},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"i",(function(){return i})),r.d(e,"d",(function(){return o})),r.d(e,"b",(function(){return a})),r.d(e,"e",(function(){return c})),r.d(e,"h",(function(){return u})),r.d(e,"f",(function(){return h})),r.d(e,"g",(function(){return f})),r.d(e,"c",(function(){return l}));var n=r(0);function s(){var t=new n.a(9);return n.a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function i(t,e){if(t===e){var r=e[1],n=e[2],s=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=s}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function o(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],h=e[8],f=h*o-a*u,l=-h*i+a*c,d=u*i-o*c,m=r*f+n*l+s*d;return m?(m=1/m,t[0]=f*m,t[1]=(-h*n+s*u)*m,t[2]=(a*n-s*o)*m,t[3]=l*m,t[4]=(h*r-s*c)*m,t[5]=(-a*r+s*i)*m,t[6]=d*m,t[7]=(-u*r+n*c)*m,t[8]=(o*r-n*i)*m,t):null}function a(t){var e=t[0],r=t[1],n=t[2],s=t[3],i=t[4],o=t[5],a=t[6],c=t[7],u=t[8];return e*(u*i-o*c)+r*(-u*s+o*a)+n*(c*s-i*a)}function c(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],h=e[7],f=e[8],l=r[0],d=r[1],m=r[2],y=r[3],g=r[4],p=r[5],b=r[6],T=r[7],w=r[8];return t[0]=l*n+d*o+m*u,t[1]=l*s+d*a+m*h,t[2]=l*i+d*c+m*f,t[3]=y*n+g*o+p*u,t[4]=y*s+g*a+p*h,t[5]=y*i+g*c+p*f,t[6]=b*n+T*o+w*u,t[7]=b*s+T*a+w*h,t[8]=b*i+T*c+w*f,t}function u(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],h=e[7],f=e[8],l=r[0],d=r[1];return t[0]=n,t[1]=s,t[2]=i,t[3]=o,t[4]=a,t[5]=c,t[6]=l*n+d*o+u,t[7]=l*s+d*a+h,t[8]=l*i+d*c+f,t}function h(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],h=e[7],f=e[8],l=Math.sin(r),d=Math.cos(r);return t[0]=d*n+l*o,t[1]=d*s+l*a,t[2]=d*i+l*c,t[3]=d*o-l*n,t[4]=d*a-l*s,t[5]=d*c-l*i,t[6]=u,t[7]=h,t[8]=f,t}function f(t,e,r){var n=r[0],s=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=s*e[3],t[4]=s*e[4],t[5]=s*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function l(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],o=r+r,a=n+n,c=s+s,u=r*o,h=n*o,f=n*a,l=s*o,d=s*a,m=s*c,y=i*o,g=i*a,p=i*c;return t[0]=1-f-m,t[3]=h-p,t[6]=l+g,t[1]=h+p,t[4]=1-u-m,t[7]=d-y,t[2]=l-g,t[5]=d+y,t[8]=1-u-f,t}},function(t,e,r){"use strict";function n(t,e,r){const n=e[0],s=e[1],i=r[3]*n+r[7]*s||1;return t[0]=(r[0]*n+r[4]*s)/i,t[1]=(r[1]*n+r[5]*s)/i,t}function s(t,e,r){const n=e[0],s=e[1],i=e[2],o=r[3]*n+r[7]*s+r[11]*i||1;return t[0]=(r[0]*n+r[4]*s+r[8]*i)/o,t[1]=(r[1]*n+r[5]*s+r[9]*i)/o,t[2]=(r[2]*n+r[6]*s+r[10]*i)/o,t}function i(t,e,r){const n=e[0],s=e[1];return t[0]=r[0]*n+r[2]*s,t[1]=r[1]*n+r[3]*s,t[2]=e[2],t}function o(t,e,r){const n=e[0],s=e[1],i=e[2];return t[0]=r[0]*n+r[3]*s+r[6]*i,t[1]=r[1]*n+r[4]*s+r[7]*i,t[2]=r[2]*n+r[5]*s+r[8]*i,t[3]=e[3],t}r.d(e,"a",(function(){return n})),r.d(e,"c",(function(){return s})),r.d(e,"b",(function(){return i})),r.d(e,"d",(function(){return o}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return o})),r.d(e,"d",(function(){return a}));var n=r(0);function s(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[2]*s,t[1]=r[1]*n+r[3]*s,t}function i(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[2]*s+r[4],t[1]=r[1]*n+r[3]*s+r[5],t}function o(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[3]*s+r[6],t[1]=r[1]*n+r[4]*s+r[7],t}function a(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[4]*s+r[12],t[1]=r[1]*n+r[5]*s+r[13],t}var c,u;c=new n.a(2),n.a!=Float32Array&&(c[0]=0,c[1]=0),u=c},,function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return a}));const s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},i=s.global||s.self||s.window||{},o="object"!=typeof n||"[object process]"!==String(n)||n.browser,a="function"==typeof importScripts,c=("undefined"!=typeof window&&window.orientation,void 0!==n&&n.version&&/v([0-9]*)/.exec(n.version));c&&parseFloat(c[1])}).call(this,r(22),r(26))},,,function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(3),s=r(6);class i extends(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array)){get ELEMENTS(){return Object(s.a)(!1),0}clone(){return(new this.constructor).copy(this)}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}fromArray(t,e=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=t[r+e];return this.check()}to(t){return t===this?this:Object(n.e)(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toArray(t=[],e=0){for(let r=0;r<this.ELEMENTS;++r)t[e+r]=this[r];return t}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(n.b)}formatString(t){let e="";for(let r=0;r<this.ELEMENTS;++r)e+=(r>0?", ":"")+Object(n.d)(this[r],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!Object(n.c)(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,r){void 0===r&&(r=e,e=t,t=this);for(let n=0;n<this.ELEMENTS;++n){const s=t[n];this[n]=s+r*(e[n]-s)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t[r]),e[r]);return this.check()}add(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]+=e[t];return this.check()}subtract(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]-=e[t];return this.check()}scale(t){if(Array.isArray(t))return this.multiply(t);for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.scale(1/t)}clampScalar(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t),e);return this.check()}multiplyByScalar(t){return this.scale(t)}get elements(){return this}check(){if(n.b.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}}},function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o}));const s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},i=s.global||s.self||s.window,o="object"!=typeof n||"[object process]"!==String(n)||n.browser,a=void 0!==n&&n.version&&/v([0-9]*)/.exec(n.version);a&&parseFloat(a[1])}).call(this,r(22),r(26))},function(t,e){},function(t,e){},,function(t,e){},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(14),s=r(1),i=r(6);class o extends n.a{get ELEMENTS(){return Object(i.a)(!1),0}copy(t){return Object(i.a)(!1),this}get x(){return this[0]}set x(t){this[0]=Object(s.a)(t)}get y(){return this[1]}set y(t){this[1]=Object(s.a)(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let r=0;r<this.ELEMENTS;++r){const n=this[r]-t[r];e+=n*n}return Object(s.a)(e)}dot(t){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*t[r];return Object(s.a)(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e[t];return this.check()}divide(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Object(i.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),Object(s.a)(this[t])}setComponent(t,e){return Object(i.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(14),s=r(1),i=r(3),o=r(6);class a extends n.a{get ELEMENTS(){return Object(o.a)(!1),0}get RANK(){return Object(o.a)(!1),0}toString(){let t="[";if(i.b.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let r=0;r<this.RANK;++r)t+=" ".concat(this[r*this.RANK+e])}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=" ".concat(this[e])}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,r){return this[e*this.RANK+t]=Object(s.a)(r),this}getColumn(t,e=new Array(this.RANK).fill(-0)){const r=t*this.RANK;for(let t=0;t<this.RANK;++t)e[t]=this[r+t];return e}setColumn(t,e){const r=t*this.RANK;for(let t=0;t<this.RANK;++t)this[r+t]=e[t];return this}}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},,,function(t,e){},function(t,e){var r,n,s=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var c,u=[],h=!1,f=-1;function l(){h&&c&&(h=!1,c.length?u=c.concat(u):f=-1,u.length&&d())}function d(){if(!h){var t=a(l);h=!0;for(var e=u.length;e;){for(c=u,u=[];++f<e;)c&&c[f].run();f=-1,e=u.length}c=null,h=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function y(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new m(t,e)),1!==u.length||h||a(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=y,s.addListener=y,s.once=y,s.off=y,s.removeListener=y,s.removeAllListeners=y,s.emit=y,s.prependListener=y,s.prependOnceListener=y,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(t,e,r){(function(e){const n=r(36),s="undefined"==typeof window?e:window;s.loaders=s.loaders||{},t.exports=Object.assign(s.loaders,n)}).call(this,r(22))},,,,,,,,,function(t,e,r){"use strict";r.r(e),r.d(e,"Tiles3DLoader",(function(){return Wr})),r.d(e,"CesiumIonLoader",(function(){return an})),r.d(e,"Tile3DWriter",(function(){return gn})),r.d(e,"Tile3DFeatureTable",(function(){return yt})),r.d(e,"Tile3DBatchTable",(function(){return vt})),r.d(e,"TILE3D_TYPE",(function(){return p})),r.d(e,"_getIonTilesetMetadata",(function(){return on}));var n={};r.r(n),r.d(n,"dirname",(function(){return c})),r.d(n,"join",(function(){return u}));var s={};r.r(s),r.d(s,"decode",(function(){return Pe})),r.d(s,"encode",(function(){return Be}));var i={};r.r(i),r.d(i,"decode",(function(){return ke})),r.d(i,"encode",(function(){return Fe}));var o={};r.r(o),r.d(o,"decode",(function(){return ze})),r.d(o,"encode",(function(){return Ve}));var a={};function c(t){const e=t&&t.lastIndexOf("/");return e>=0?t.substr(0,e):""}function u(...t){return(t=t.map((e,r)=>(r&&(e=e.replace(new RegExp("^/"),"")),r!==t.length-1&&(e=e.replace(new RegExp("/$"),"")),e))).join("/")}r.r(a),r.d(a,"decode",(function(){return Ge})),r.d(a,"encode",(function(){return qe}));r(19),r(25);const h=1,f=2,l="empty",d="scenegraph",m="pointcloud",y="TILES3D",g="geometricError",p={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect"},b=(Object.keys(p),{BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]});function T(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function w(t,e,r){T(t instanceof ArrayBuffer);const n=new TextDecoder("utf8"),s=new Uint8Array(t,e,r);return n.decode(s)}const E={name:"Draco",id:"draco",module:"draco",version:"3.0.12",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"==typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function O(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class _{constructor(t,e){O(this,"fields",void 0),O(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const r of t)e[r.name]&&console.warn("Schema: duplicated field name",r.name,r),e[r.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(...t){const e=Object.create(null);for(const r of t)e[r]=!0;const r=this.fields.filter(t=>e[t.name]);return new _(r,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new _(e,this.metadata)}assign(t){let e,r=this.metadata;if(t instanceof _){const n=t;e=n.fields,r=A(A(new Map,this.metadata),n.metadata)}else e=t;const n=Object.create(null);for(const t of this.fields)n[t.name]=t;for(const t of e)n[t.name]=t;const s=Object.values(n);return new _(s,r)}}function A(t,e){return new Map([...t||new Map,...e||new Map])}let I,v,S,N,x,M,L,j;function R(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(I||(I={}));class U{static isNull(t){return t&&t.typeId===I.Null}static isInt(t){return t&&t.typeId===I.Int}static isFloat(t){return t&&t.typeId===I.Float}static isBinary(t){return t&&t.typeId===I.Binary}static isUtf8(t){return t&&t.typeId===I.Utf8}static isBool(t){return t&&t.typeId===I.Bool}static isDecimal(t){return t&&t.typeId===I.Decimal}static isDate(t){return t&&t.typeId===I.Date}static isTime(t){return t&&t.typeId===I.Time}static isTimestamp(t){return t&&t.typeId===I.Timestamp}static isInterval(t){return t&&t.typeId===I.Interval}static isList(t){return t&&t.typeId===I.List}static isStruct(t){return t&&t.typeId===I.Struct}static isUnion(t){return t&&t.typeId===I.Union}static isFixedSizeBinary(t){return t&&t.typeId===I.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===I.FixedSizeList}static isMap(t){return t&&t.typeId===I.Map}static isDictionary(t){return t&&t.typeId===I.Dictionary}get typeId(){return I.NONE}compareTo(t){return this===t}}Symbol.toStringTag;Symbol.toStringTag;v=Symbol.toStringTag;class P extends U{constructor(t,e){super(),R(this,"isSigned",void 0),R(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return I.Int}get[v](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class B extends P{constructor(){super(!0,8)}}class D extends P{constructor(){super(!0,16)}}class C extends P{constructor(){super(!0,32)}}class k extends P{constructor(){super(!1,8)}}class F extends P{constructor(){super(!1,16)}}class z extends P{constructor(){super(!1,32)}}const V=32,G=64;S=Symbol.toStringTag;class q extends U{constructor(t){super(),R(this,"precision",void 0),this.precision=t}get typeId(){return I.Float}get[S](){return"Float"}toString(){return"Float"+this.precision}}class H extends q{constructor(){super(V)}}class W extends q{constructor(){super(G)}}Symbol.toStringTag;Symbol.toStringTag;N=Symbol.toStringTag;x=Symbol.toStringTag;M=Symbol.toStringTag;L=Symbol.toStringTag;j=Symbol.toStringTag;class $ extends U{constructor(t,e){super(),R(this,"listSize",void 0),R(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return I.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[j](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}function K(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Q{constructor(t,e,r=!1,n=new Map){K(this,"name",void 0),K(this,"type",void 0),K(this,"nullable",void 0),K(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=r,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new Q(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?", metadata: "+this.metadata:""}`}}function Y(t,e,r){const n=r?Z(r.metadata):void 0,s=function(t){switch(t.constructor){case Int8Array:return new B;case Uint8Array:return new k;case Int16Array:return new D;case Uint16Array:return new F;case Int32Array:return new C;case Uint32Array:return new z;case Float32Array:return new H;case Float64Array:return new W;default:throw new Error("array type not supported")}}(e.value);return new Q(t,new $(e.size,new Q("value",s)),!1,n)}function Z(t){const e=new Map;for(const r in t)e.set(r+".string",JSON.stringify(t[r]));return e}function J(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const X={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},tt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class et{constructor(t){J(this,"draco",void 0),J(this,"decoder",void 0),J(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,e={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const n=this.decoder.GetEncodedGeometryType(r),s=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(n){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(r,s);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(r,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!s.ptr){const e="DRACO decompression failed: "+t.error_msg();throw new Error(e)}const i=this._getDracoLoaderData(s,n,e),o=this._getMeshData(s,i,e),a=function(t){let e=1/0,r=1/0,n=1/0,s=-1/0,i=-1/0,o=-1/0;const a=t.POSITION?t.POSITION.value:[],c=a&&a.length;for(let t=0;t<c;t+=3){const c=a[t],u=a[t+1],h=a[t+2];e=c<e?c:e,r=u<r?u:r,n=h<n?h:n,s=c>s?c:s,i=u>i?u:i,o=h>o?h:o}return[[e,r,n],[s,i,o]]}(o.attributes),c=function(t,e,r){const n=Z(e.metadata),s=[],i=function(t){const e={};for(const r in t){const n=t[r];e[n.name||"undefined"]=n}return e}(e.attributes);for(const e in t){const r=Y(e,t[e],i[e]);s.push(r)}if(r){const t=Y("indices",r);s.push(t)}return new _(s,n)}(o.attributes,i,o.indices);return{loader:"draco",loaderData:i,header:{vertexCount:s.num_points(),boundingBox:a},...o,schema:c}}finally{this.draco.destroy(r),s&&this.draco.destroy(s)}}_getDracoLoaderData(t,e,r){const n=this._getTopLevelMetadata(t),s=this._getDracoAttributes(t,r);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:n,attributes:s}}_getDracoAttributes(t,e){const r={};for(let n=0;n<t.num_attributes();n++){const s=this.decoder.GetAttribute(t,n),i=this._getAttributeMetadata(t,n);r[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:n,metadata:i};const o=this._getQuantizationTransform(s,e);o&&(r[s.unique_id()].quantization_transform=o);const a=this._getOctahedronTransform(s,e);a&&(r[s.unique_id()].octahedron_transform=a)}return r}_getMeshData(t,e,r){const n=this._getMeshAttributes(e,t,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(t,e,r){const n={};for(const s of Object.values(t.attributes)){const t=this._deduceAttributeName(s,r);s.name=t;const{value:i,size:o}=this._getAttributeValues(e,s);n[t]={value:i,size:o,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}return n}_getTriangleListIndices(t){const e=3*t.num_faces(),r=4*e,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(t,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,e).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(t){const e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){const e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){const r=tt[e.data_type],n=e.num_components,s=t.num_points()*n,i=s*r.BYTES_PER_ELEMENT,o=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}(this.draco,r);let a;const c=this.draco._malloc(i);try{const n=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,n,o,i,c),a=new r(this.draco.HEAPF32.buffer,c,s).slice()}finally{this.draco._free(c)}return{value:a,size:n}}_deduceAttributeName(t,e){const r=t.unique_id;for(const[t,n]of Object.entries(e.extraAttributes||{}))if(n===r)return t;const n=t.attribute_type;for(const t in X){if(this.draco[t]===n)return X[t]}const s=e.attributeNameEntry||"name";return t.metadata[s]?t.metadata[s].string:"CUSTOM_ATTRIBUTE_"+r}_getTopLevelMetadata(t){const e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){const r=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(r)}_getDracoMetadata(t){if(!t||!t.ptr)return{};const e={},r=this.metadataQuerier.NumEntries(t);for(let n=0;n<r;n++){const r=this.metadataQuerier.GetEntryName(t,n);e[r]=this._getDracoMetadataField(t,r)}return e}_getDracoMetadataField(t,e){const r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,r);const n=function(t){const e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:n}}finally{this.draco.destroy(r)}}_disableAttributeTransforms(t){const{quantizedAttributes:e=[],octahedronAttributes:r=[]}=t,n=[...e,...r];for(const t of n)this.decoder.SkipAttributeTransform(this.draco[t])}_getQuantizationTransform(t,e){const{quantizedAttributes:r=[]}=e,n=t.attribute_type();if(r.map(t=>this.decoder[t]).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map(t=>e.min_value(t))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:r=[]}=e,n=t.attribute_type();if(r.map(t=>this.decoder[t]).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}var rt=r(11),nt=r(17);const st={};async function it(t,e=null,r={}){return e&&(t=function(t,e,r){if(t.startsWith("http"))return t;const n=r.modules||{};if(n[t])return n[t];if(!rt.b)return`modules/${e}/dist/libs/${t}`;if(r.CDN)return function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(r.CDN.startsWith("http")),`${r.CDN}/${e}@3.0.12/dist/libs/${t}`;if(rt.c)return"../src/libs/"+t;return`modules/${e}/src/libs/${t}`}(t,e,r)),st[t]=st[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!rt.b)return nt.requireFromFile&&await nt.requireFromFile(t);if(rt.c)return importScripts(t);const e=await fetch(t);return function(t,e){if(!rt.b)return nt.requireFromString&&nt.requireFromString(t,e);if(rt.c)return eval.call(rt.a,t),null;const r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch(e){r.text=t}return document.body.appendChild(r),null}(await e.text(),t)}(t),await st[t]}let ot;async function at(t){const e=t.modules||{};return ot=e.draco3d?ot||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):ot||async function(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await it("https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js","draco",t);break;case"wasm":default:[e,r]=await Promise.all([await it("https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js","draco",t),await it("https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm","draco",t)])}return e=e||globalThis.DracoDecoderModule,await function(t,e){const r={};e&&(r.wasmBinary=e);return new Promise(e=>{t({...r,onModuleLoaded:t=>e({draco:t})})})}(e,r)}(t),await ot}const ct={...E,parse:async function(t,e){const{draco:r}=await at(e),n=new et(r);try{return n.parseSync(t,null==e?void 0:e.draco)}finally{n.destroy()}}};const ut={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ht={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...ut};var ft=r(42);const lt={[ut.DOUBLE]:Float64Array,[ut.FLOAT]:Float32Array,[ut.UNSIGNED_SHORT]:Uint16Array,[ut.UNSIGNED_INT]:Uint32Array,[ut.UNSIGNED_BYTE]:Uint8Array,[ut.BYTE]:Int8Array,[ut.SHORT]:Int16Array,[ut.INT]:Int32Array},dt={DOUBLE:ut.DOUBLE,FLOAT:ut.FLOAT,UNSIGNED_SHORT:ut.UNSIGNED_SHORT,UNSIGNED_INT:ut.UNSIGNED_INT,UNSIGNED_BYTE:ut.UNSIGNED_BYTE,BYTE:ut.BYTE,SHORT:ut.SHORT,INT:ut.INT};class mt{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(const e in lt){if(lt[e]===t)return e}throw new Error("Failed to convert GL type")}static fromName(t){const e=dt[t];if(!e)throw new Error("Failed to convert GL type");return e}static getArrayType(t){switch(t){case ut.UNSIGNED_SHORT_5_6_5:case ut.UNSIGNED_SHORT_4_4_4_4:case ut.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const e=lt[t];if(!e)throw new Error("Failed to convert GL type");return e}}static getByteSize(t){return mt.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(mt.getArrayType(t))}static createTypedArray(t,e,r=0,n){void 0===n&&(n=(e.byteLength-r)/mt.getByteSize(t));return new(mt.getArrayType(t))(e,r,n)}}class yt{constructor(t,e){this.json=t,this.buffer=e,this.featuresLength=0,this._cachedTypedArrays={}}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,e=ht.UNSIGNED_INT,r=1){const n=this.json[t];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(t,e,r,1,n.byteOffset):n}getPropertyArray(t,e,r){const n=this.json[t];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(e=mt.fromName(n.componentType)),this._getTypedArrayFromBinary(t,e,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(t,e,n)}getProperty(t,e,r,n,s){const i=this.json[t];if(!i)return i;const o=this.getPropertyArray(t,e,r);if(1===r)return o[n];for(let t=0;t<r;++t)s[t]=o[r*n+t];return s}_getTypedArrayFromBinary(t,e,r,n,s){const i=this._cachedTypedArrays;let o=i[t];return o||(o=mt.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+s,n*r),i[t]=o),o}_getTypedArrayFromArray(t,e,r){const n=this._cachedTypedArrays;let s=n[t];return s||(s=mt.createTypedArray(e,r),n[t]=s),s}}const gt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},pt={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},bt={SCALAR:(t,e,r)=>{e[r]=t},VEC2:(t,e,r)=>{e[2*r+0]=t[0],e[2*r+1]=t[1]},VEC3:(t,e,r)=>{e[3*r+0]=t[0],e[3*r+1]=t[1],e[3*r+2]=t[2]},VEC4:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT2:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT3:(t,e,r)=>{e[9*r+0]=t[0],e[9*r+1]=t[1],e[9*r+2]=t[2],e[9*r+3]=t[3],e[9*r+4]=t[4],e[9*r+5]=t[5],e[9*r+6]=t[6],e[9*r+7]=t[7],e[9*r+8]=t[8],e[9*r+9]=t[9]},MAT4:(t,e,r)=>{e[16*r+0]=t[0],e[16*r+1]=t[1],e[16*r+2]=t[2],e[16*r+3]=t[3],e[16*r+4]=t[4],e[16*r+5]=t[5],e[16*r+6]=t[6],e[16*r+7]=t[7],e[16*r+8]=t[8],e[16*r+9]=t[9],e[16*r+10]=t[10],e[16*r+11]=t[11],e[16*r+12]=t[12],e[16*r+13]=t[13],e[16*r+14]=t[14],e[16*r+15]=t[15]}};const Tt=t=>void 0!==t;function wt(t,e,r){if(!e)return null;let n=t.getExtension("3DTILES_batch_table_hierarchy");const s=e.HIERARCHY;return s&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=s,n=s),n?function(t,e){let r,n,s;const i=t.instancesLength,o=t.classes;let a,c=t.classIds,u=t.parentCounts,h=t.parentIds,f=i;Tt(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,s=getBinaryAccessor(c),c=s.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,i));if(Tt(u))for(Tt(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,s=getBinaryAccessor(u),u=s.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,i)),a=new Uint16Array(i),f=0,r=0;r<i;++r)a[r]=f,f+=u[r];Tt(h)&&Tt(h.byteOffset)&&(h.componentType=defaultValue(h.componentType,GL.UNSIGNED_SHORT),h.type=AttributeType.SCALAR,s=getBinaryAccessor(h),h=s.createArrayBufferView(e.buffer,e.byteOffset+h.byteOffset,f));const l=o.length;for(r=0;r<l;++r){const t=o[r].length,n=o[r].instances,s=getBinaryProperties(t,n,e);o[r].instances=combine(s,n)}const d=new Array(l).fill(0),m=new Uint16Array(i);for(r=0;r<i;++r)n=c[r],m[r]=d[n],++d[n];const y={classes:o,classIds:c,classIndexes:m,parentCounts:u,parentIndexes:a,parentIds:h};return function(t){const e=t.classIds.length;for(let r=0;r<e;++r)Ot(t,r,stack)}(y),y}(n,r):null}function Et(t,e,r){if(!t)return;const n=t.parentCounts;return t.parentIds?r(t,e):n>0?function(t,e,r){const n=t.classIds,s=t.parentCounts,i=t.parentIds,o=t.parentIndexes,a=n.length,c=scratchVisited;c.length=Math.max(c.length,a);const u=++marker,h=scratchStack;h.length=0,h.push(e);for(;h.length>0;){if(e=h.pop(),c[e]===u)continue;c[e]=u;const n=r(t,e);if(Tt(n))return n;const a=s[e],f=o[e];for(let t=0;t<a;++t){const r=i[f+t];r!==e&&h.push(r)}}return null}(t,e,r):function(t,e,r){let n=!0;for(;n;){const s=r(t,e);if(Tt(s))return s;const i=t.parentIds[e];n=i!==e,e=i}throw new Error("traverseHierarchySingleParent")}(t,e,r)}function Ot(t,e,r){const n=t.parentCounts,s=t.parentIds,i=t.parentIndexes,o=t.classIds.length;if(!Tt(s))return;assert(e<o,`Parent index ${e} exceeds the total number of instances: ${o}`),assert(-1===r.indexOf(e),"Circular dependency detected in the batch table hierarchy."),r.push(e);const a=Tt(n)?n[e]:1,c=Tt(n)?i[e]:e;for(let n=0;n<a;++n){const i=s[c+n];i!==e&&Ot(t,i,r)}r.pop(e)}function _t(t){return null!=t}const At=(t,e)=>t,It={HIERARCHY:!0,extensions:!0,extras:!0};class vt{constructor(t,e,r,n={}){var s;T(r>=0),this.json=t||{},this.binary=e,this.featureCount=r,this._extensions=(null===(s=this.json)||void 0===s?void 0:s.extensions)||{},this._properties={};for(const t in this.json)It[t]||(this._properties[t]=this.json[t]);this._binaryProperties=this._initializeBinaryProperties(),n["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=wt(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,e){if(this._checkBatchId(t),T("string"==typeof e,e),this._hierarchy){return _t(Et(this._hierarchy,t,(t,r)=>{const n=t.classIds[r];return t.classes[n].name===e}))}return!1}isExactClass(t,e){return T("string"==typeof e,e),this.getExactClassName(t)===e}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){const e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}hasProperty(t,e){return this._checkBatchId(t),T("string"==typeof e,e),_t(this._properties[e])||this._hasPropertyInHierarchy(t,e)}getPropertyNames(t,e){this._checkBatchId(t),(e=_t(e)?e:[]).length=0;const r=Object.keys(this._properties);return e.push(...r),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}getProperty(t,e){if(this._checkBatchId(t),T("string"==typeof e,e),this._binaryProperties){const r=this._binaryProperties[e];if(_t(r))return this._getBinaryProperty(r,t)}const r=this._properties[e];if(_t(r))return At(r[t]);if(this._hierarchy){const r=this._getHierarchyProperty(t,e);if(_t(r))return r}}setProperty(t,e,r){const n=this.featureCount;if(this._checkBatchId(t),T("string"==typeof e,e),this._binaryProperties){const n=this._binaryProperties[e];if(n)return void this._setBinaryProperty(n,t,r)}if(this._hierarchy&&this._setHierarchyProperty(this,t,e,r))return;let s=this._properties[e];_t(s)||(this._properties[e]=new Array(n),s=this._properties[e]),s[t]=At(r)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,e){return t.unpack(t.typedArray,e)}_setBinaryProperty(t,e,r){t.pack(r,t.typedArray,e)}_initializeBinaryProperties(){let t=null;for(const e in this._properties){const r=this._properties[e],n=this._initializeBinaryProperty(e,r);n&&(t=t||{},t[e]=n)}return t}_initializeBinaryProperty(t,e){if("byteOffset"in e){const r=e;T(this.binary,`Property ${t} requires a batch table binary.`),T(r.type,`Property ${t} requires a type.`);const n=function(t,e,r,n){const{componentType:s}=t;T(t.componentType);const i="string"==typeof s?mt.fromName(s):s,o=gt[t.type],a=pt[t.type],c=bt[t.type];return r+=t.byteOffset,{values:mt.createTypedArray(i,e,r,o*n),type:i,size:o,unpacker:a,packer:c}}(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}_hasPropertyInHierarchy(t,e){if(!this._hierarchy)return!1;const r=Et(this._hierarchy,t,(t,r)=>{const n=t.classIds[r];return _t(t.classes[n].instances[e])});return _t(r)}_getPropertyNamesInHierarchy(t,e){Et(this._hierarchy,t,(t,r)=>{const n=t.classIds[r],s=t.classes[n].instances;for(const t in s)s.hasOwnProperty(t)&&-1===e.indexOf(t)&&e.push(t)})}_getHierarchyProperty(t,e){return Et(this._hierarchy,t,(t,r)=>{const n=t.classIds[r],s=t.classes[n],i=t.classIndexes[r],o=s.instances[e];return _t(o)?_t(o.typedArray)?this._getBinaryProperty(o,i):At(o[i]):null})}_setHierarchyProperty(t,e,r,n){const s=Et(this._hierarchy,e,(t,s)=>{const i=t.classIds[s],o=t.classes[i],a=t.classIndexes[s],c=o.instances[r];return!!_t(c)&&(T(s===e,`Inherited property "${r}" is read-only.`),_t(c.typedArray)?this._setBinaryProperty(c,a,n):c[a]=At(n),!0)});return _t(s)}}function St(t,e,r=0){const n=new DataView(e);if(t.magic=n.getUint32(r,!0),r+=4,t.version=n.getUint32(r,!0),r+=4,t.byteLength=n.getUint32(r,!0),r+=4,1!==t.version)throw new Error(`3D Tile Version ${t.version} not supported`);return r}function Nt(t,e,r){const n=new DataView(e);let s;t.header=t.header||{};let i=n.getUint32(r,!0);r+=4;let o=n.getUint32(r,!0);r+=4;let a=n.getUint32(r,!0);r+=4;let c=n.getUint32(r,!0);return r+=4,a>=570425344?(r-=8,s=i,a=o,c=0,i=0,o=0,console.warn("b3dm tile in legacy format.")):c>=570425344&&(r-=4,s=a,a=i,c=o,i=0,o=0,console.warn("b3dm tile in legacy format.")),t.header.featureTableJsonByteLength=i,t.header.featureTableBinaryByteLength=o,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=c,t.header.batchLength=s,r}function xt(t,e,r,n){return r=function(t,e,r,n){const{featureTableJsonByteLength:s,featureTableBinaryByteLength:i,batchLength:o}=t.header;if(t.featureTableJson={BATCH_LENGTH:o||0},s>0){const n=w(e,r,s);t.featureTableJson=JSON.parse(n)}return r+=s,t.featureTableBinary=new Uint8Array(e,r,i),r+=i}(t,e,r),r=function(t,e,r,n){const{batchTableJsonByteLength:s,batchTableBinaryByteLength:i}=t.header;if(s>0){const n=w(e,r,s);t.batchTableJson=JSON.parse(n),r+=s,i>0&&(t.batchTableBinary=new Uint8Array(e,r,i),t.batchTableBinary=new Uint8Array(t.batchTableBinary),r+=i)}return r}(t,e,r)}function Mt(t,e=[0,0,0]){const r=t>>11&31,n=t>>5&63,s=31&t;return e[0]=r<<3,e[1]=n<<2,e[2]=s<<3,e}function Lt(t,e,r){if(!(e||t&&t.batchIds&&r))return null;const{batchIds:n,isRGB565:s,pointCount:i}=t;if(n&&r){const t=new Uint8ClampedArray(3*i);for(let e=0;e<i;e++){const s=n[e],i=r.getProperty(s,"dimensions").map(t=>255*t);t[3*e]=i[0],t[3*e+1]=i[1],t[3*e+2]=i[2]}return{type:ht.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}if(s){const t=new Uint8ClampedArray(3*i);for(let r=0;r<i;r++){const n=Mt(e[r]);t[3*r]=n[0],t[3*r+1]=n[1],t[3*r+2]=n[2]}return{type:ht.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}return e&&e.length===3*i?{type:ht.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:ht.UNSIGNED_BYTE,value:e,size:4,normalized:!0}}var jt=r(20),Rt=r(3),Ut=r(1),Pt=r(9),Bt=r(8);class Dt extends jt.a{constructor(t=0,e=0){super(2),Object(Rt.e)(t)&&1===arguments.length?this.copy(t):(Rt.b.debug&&(Object(Ut.a)(t),Object(Ut.a)(e)),this[0]=t,this[1]=e)}set(t,e){return this[0]=t,this[1]=e,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Rt.b.debug&&(Object(Ut.a)(t.x),Object(Ut.a)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Pt.d(this,this,t),this.check()}transformAsVector(t){return Object(Bt.a)(this,this,t),this.check()}transformByMatrix3(t){return Pt.c(this,this,t),this.check()}transformByMatrix2x3(t){return Pt.b(this,this,t),this.check()}transformByMatrix2(t){return Pt.a(this,this,t),this.check()}}var Ct=r(43);function kt(t,e){if(!t)throw new Error("math.gl assertion failed. "+e)}new Dt,new ft.a,new Dt,new Dt,new Uint8Array(1);function Ft(t,e=255){return Object(Rt.a)(t,0,e)/e*2-1}function zt(t){return t<0?-1:1}function Vt(t,e,r,n){if(kt(n),t<0||t>r||e<0||e>r)throw new Error("x and y must be unsigned normalized integers between 0 and "+r);if(n.x=Ft(t,r),n.y=Ft(e,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const t=n.x;n.x=(1-Math.abs(n.y))*zt(t),n.y=(1-Math.abs(t))*zt(n.y)}return n.normalize()}function Gt(t,e,r){return Vt(t,e,255,r)}const qt=new ft.a;function Ht(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){const r=new ft.a,n=new Float32Array(3*t.pointCount);for(let s=0;s<t.pointCount;s++)r.set(e[3*s],e[3*s+1],e[3*s+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,3*s);return n}(t,e)):{type:ht.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}async function Wt(t,e,r,n,s){r=xt(t,e,r=Nt(t,e,r=St(t,e,r))),function(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}(t);const{featureTable:i,batchTable:o}=function(t){const e=new yt(t.featureTableJson,t.featureTableBinary),r=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=r,t.featuresLength=r,t.pointsLength=r,t.pointCount=r,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",ht.FLOAT,3);const n=function(t,e){let r=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",ht.UNSIGNED_SHORT,1),t.batchIds)){const n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:s,batchTableBinary:i}=t;r=new vt(s,i,n)}return r}(t,e);return{featureTable:e,batchTable:n}}(t);return await async function(t,e,r,n,s){let i,o,a;const c=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];c&&(a=c.properties);const u=e.getExtension("3DTILES_draco_point_compression");if(u){o=u.properties;const e=u.byteOffset,r=u.byteLength;if(!o||!Number.isFinite(e)||!r)throw new Error("Draco properties, byteOffset, and byteLength must be defined");i=t.featureTableBinary.slice(e,e+r),t.hasPositions=Number.isFinite(o.POSITION),t.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),t.hasNormals=Number.isFinite(o.NORMAL),t.hasBatchIds=Number.isFinite(o.BATCH_ID),t.isTranslucent=Number.isFinite(o.RGBA)}if(!i)return!0;const h={buffer:i,properties:{...o,...a},featureTableProperties:o,batchTableProperties:a,dequantizeInShader:!1};return await async function(t,e,r,n){const{parse:s}=n,i={...r,draco:{...r.draco,extraAttributes:e.batchTableProperties||{}}};delete i["3d-tiles"];const o=await s(e.buffer,ct,i),a=o.attributes.POSITION&&o.attributes.POSITION.value,c=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,u=o.attributes.NORMAL&&o.attributes.NORMAL.value,h=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,f=a&&o.attributes.POSITION.value.quantization,l=u&&o.attributes.NORMAL.value.quantization;if(f){const e=o.POSITION.data.quantization,r=e.range;t.quantizedVolumeScale=new ft.a(r,r,r),t.quantizedVolumeOffset=new ft.a(e.minValues),t.quantizedRange=(1<<e.quantizationBits)-1,t.isQuantizedDraco=!0}l&&(t.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);const d={};if(e.batchTableProperties)for(const t of Object.keys(e.batchTableProperties))o.attributes[t]&&o.attributes[t].value&&(d[t.toLowerCase()]=o.attributes[t].value);t.attributes={positions:a,colors:Lt(t,c),normals:u,batchIds:h,...d}}(t,h,n,s)}(t,i,0,n,s),function(t,e,r){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",ht.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){const n=e.getPropertyArray("POSITION_QUANTIZED",ht.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ht.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ht.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Ht(t,n,r)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(t,i,n),function(t,e,r){if(!t.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",ht.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",ht.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",ht.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=Lt(t,n,r)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",ht.UNSIGNED_BYTE,4))}(t,i,o),function(t,e){if(!t.attributes.normals){let r=null;e.hasProperty("NORMAL")?r=e.getPropertyArray("NORMAL",ht.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(r=e.getPropertyArray("NORMAL_OCT16P",ht.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){const r=new Float32Array(3*t.pointsLength);for(let n=0;n<t.pointsLength;n++)Gt(e[2*n],e[2*n+1],qt),qt.toArray(r,3*n);return{type:ht.FLOAT,size:2,value:r}}return{type:ht.FLOAT,size:2,value:e}}(t,r)}}(t,i),r}function $t(t,e){if(!t)throw new Error(e)}var Kt=r(15);const{_parseImageNode:Qt}=Kt.a,Yt="undefined"!=typeof Image,Zt="undefined"!=typeof ImageBitmap,Jt=Boolean(Qt),Xt=!!Kt.b||Jt;function te(t){const e=re(t);if(!e)throw new Error("Not an image");return e}function ee(t){switch(te(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function re(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}const ne=/^data:image\/svg\+xml/,se=/\.svg((\?|#).*)?$/;function ie(t){return t&&(ne.test(t)||se.test(t))}function oe(t,e){if(ie(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function ae(t,e,r){const n=function(t,e){if(ie(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(t){throw new Error(t.message)}return"data:image/svg+xml;base64,"+btoa(e)}return oe(t,e)}(t,r),s=self.URL||self.webkitURL,i="string"!=typeof n&&s.createObjectURL(n);try{return await async function(t,e){const r=new Image;if(r.src=t,e.image&&e.image.decode&&r.decode)return await r.decode(),r;return await new Promise((e,n)=>{try{r.onload=()=>e(r),r.onerror=e=>n(new Error(`Could not load image ${t}: ${e}`))}catch(t){n(t)}})}(i||n,e)}finally{i&&s.revokeObjectURL(i)}}const ce={};let ue=!0;async function he(t,e,r){let n;if(ie(r)){n=await ae(t,e,r)}else n=oe(t,r);const s=e&&e.imagebitmap;return await async function(t,e=null){!function(t){for(const e in t||ce)return!1;return!0}(e)&&ue||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(t){console.warn(t),ue=!1}return await createImageBitmap(t)}(n,s)}function fe(t){const e=le(t);return function(t){const e=le(t);if(!(e.byteLength>=24&&2303741511===e.getUint32(0,!1)))return null;return{mimeType:"image/png",width:e.getUint32(16,!1),height:e.getUint32(20,!1)}}(e)||function(t){const e=le(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,!1)&&255===e.getUint8(2)))return null;const{tableMarkers:r,sofMarkers:n}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let s=2;for(;s+9<e.byteLength;){const t=e.getUint16(s,!1);if(n.has(t))return{mimeType:"image/jpeg",height:e.getUint16(s+5,!1),width:e.getUint16(s+7,!1)};if(!r.has(t))return null;s+=2,s+=e.getUint16(s,!1)}return null}(e)||function(t){const e=le(t);if(!(e.byteLength>=10&&1195984440===e.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:e.getUint16(6,!0),height:e.getUint16(8,!0)}}(e)||function(t){const e=le(t);if(!(e.byteLength>=14&&16973===e.getUint16(0,!1)&&e.getUint32(2,!0)===e.byteLength))return null;return{mimeType:"image/bmp",width:e.getUint32(18,!0),height:e.getUint32(22,!0)}}(e)}function le(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}const de={id:"image",module:"images",name:"Images",version:"3.0.12",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:async function(t,e,r){const n=((e=e||{}).image||{}).type||"auto",{url:s}=r||{};let i;switch(function(t){switch(t){case"auto":case"data":return function(){if(Zt)return"imagebitmap";if(Yt)return"image";if(Xt)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return Zt||Yt||Xt;case"imagebitmap":return Zt;case"image":return Yt;case"data":return Xt;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}(n)){case"imagebitmap":i=await he(t,e,s);break;case"image":i=await ae(t,e,s);break;case"data":i=await function(t,e){const{mimeType:r}=fe(t)||{},{_parseImageNode:n}=Kt.a;return $t(n),n(t,r,e)}(t,e);break;default:$t(!1)}return"data"===n&&(i=ee(i)),i},tests:[t=>Boolean(fe(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};function me(t,e,r){if(t.byteLength<=e+r)return"";const n=new DataView(t);let s="";for(let t=0;t<r;t++)s+=String.fromCharCode(n.getUint8(e+t));return s}function ye(t){try{return JSON.parse(t)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(t,e=5){if("string"==typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return me(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return me(t,0,e)}return""}(t)}"`)}}r(16);function ge(t,e,r){const n=void 0!==r?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function pe(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function be(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const r=e.baseUri||e.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url "+t);return r.substr(0,r.lastIndexOf("/")+1)+t}function Te(t,e,r){const n=t.bufferViews[r];pe(n);const s=e[n.buffer];pe(s);const i=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,i,n.byteLength)}function we(t,e){return T(t>=0),T(e>0),t+(e-1)&~(e-1)}function Ee(t,e,r){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{const e=t.byteOffset,r=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,e,r)}return e.set(n,r),r+we(n.byteLength,4)}const Oe=["SCALAR","VEC2","VEC3","VEC4"],_e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ae=new Map(_e),Ie={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ve={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Se={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Ne(t){return Oe[t-1]||Oe[0]}function xe(t){const e=Ae.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Me(t,e){const r=Se[t.componentType],n=Ie[t.type],s=ve[t.componentType],i=t.count*n,o=t.count*n*s;return pe(o>=0&&o<=e.byteLength),{ArrayType:r,length:i,byteLength:o}}function Le(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const je={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class Re{constructor(t){Le(this,"gltf",void 0),Le(this,"sourceBuffers",void 0),Le(this,"byteLength",void 0),this.gltf=t||{json:{...je},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]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){const e=this.getUsedExtensions().find(e=>e===t),r=this.json.extensions||{};return e?r[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find(e=>e===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"==typeof e)return e;const r=this.json[t]&&this.json[t][e];if(!r)throw new Error(`glTF file error: Could not find ${t}[${e}]`);return r}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,r=this.gltf.buffers[e];pe(r);const n=(t.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),r=this.getBuffer(e.buffer).data,{ArrayType:n,length:s}=Me(t,e);return new n(r,e.byteOffset+t.byteOffset,s)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),r=this.getBuffer(e.buffer).data,n=e.byteOffset||0;return new Uint8Array(r,n,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,r){return t.extensions=t.extensions||{},t.extensions[e]=r,this.registerUsedExtension(e),this}setObjectExtension(t,e,r){(t.extensions||{})[e]=r}removeObjectExtension(t,e){const r=t.extensions||{},n=r[e];return delete r[e],n}addExtension(t,e={}){return pe(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return pe(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(e=>e===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(e=>e===t)||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:r}=t;this.json.nodes=this.json.nodes||[];const n={mesh:e};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:r,material:n,mode:s=4}=t,i={primitives:[{attributes:this._addAttributes(e),mode:s}]};if(r){const t=this._addIndices(r);i.primitives[0].indices=t}return Number.isFinite(n)&&(i.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const r=fe(t),n=e||(null==r?void 0:r.mimeType),s={bufferView:this.addBufferView(t),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}addBufferView(t){const e=t.byteLength;pe(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const r={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=we(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}addAccessor(t,e){const r={bufferView:t,type:Ne(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}addBinaryBuffer(t,e={size:3}){const r=this.addBufferView(t);let n={min:e.min,max:e.max};n.min&&n.max||(n=this._getAccessorMinMax(t,e.size));const s={size:e.size,componentType:xe(t),count:Math.round(t.length/e.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(s,e))}addTexture(t){const{imageIndex:e}=t,r={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(r),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const r=this.byteLength,n=new ArrayBuffer(r),s=new Uint8Array(n);let i=0;for(const t of this.sourceBuffers||[])i=Ee(t,s,i);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(t,e){let r=!0;for(;r;){const n=t.indexOf(e);n>-1?t.splice(n,1):r=!1}}_addAttributes(t={}){const e={};for(const r in t){const n=t[r],s=this._getGltfAttributeName(r),i=this.addBinaryBuffer(n.value,n);e[s]=i}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.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 t}}_getAccessorMinMax(t,e){const r={min:null,max:null};if(t.length<e)return r;r.min=[],r.max=[];const n=t.subarray(0,e);for(const t of n)r.min.push(t),r.max.push(t);for(let n=e;n<t.length;n+=e)for(let s=0;s<e;s++)r.min[0+s]=Math.min(r.min[0+s],t[n+s]),r.max[0+s]=Math.max(r.max[0+s],t[n+s]);return r}}function Ue(t){const{buffer:e,size:r,count:n}=function(t){let e=t,r=1,n=0;t&&t.value&&(e=t.value,r=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e,r=!1){if(!t)return null;if(Array.isArray(t))return new e(t);if(r&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),n=e.length/r);return{buffer:e,size:r,count:n}}(t);return{value:e,size:r,byteOffset:0,count:n,type:Ne(r),componentType:xe(e)}}async function Pe(t,e,r){var n;if(null==e||null===(n=e.gltf)||void 0===n||!n.decompressMeshes)return;const s=new Re(t),i=[];for(const t of function*(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}(s))s.getObjectExtension(t,"KHR_draco_mesh_compression")&&i.push(De(s,t,e,r));await Promise.all(i),s.removeExtension("KHR_draco_mesh_compression")}function Be(t,e={}){const r=new Re(t);for(const t of r.json.meshes||[])Ce(t,e),r.addRequiredExtension("KHR_draco_mesh_compression")}async function De(t,e,r,n){const s=t.getObjectExtension(e,"KHR_draco_mesh_compression");if(!s)return;const i=t.getTypedArrayForBufferView(s.bufferView),o=ge(i.buffer,i.byteOffset),{parse:a}=n,c={...r};delete c["3d-tiles"];const u=await a(o,ct,c,n),h=function(t){const e={};for(const r in t){const n=t[r];if("indices"!==r){const t=Ue(n);e[r]=t}}return e}(u.attributes);for(const[r,n]of Object.entries(h))if(r in e.attributes){const s=e.attributes[r],i=t.getAccessor(s);null!=i&&i.min&&null!=i&&i.max&&(n.min=i.min,n.max=i.max)}e.attributes=h,u.indices&&(e.indices=Ue(u.indices)),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function Ce(t,e,r=4,n,s){var i;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const o=n.DracoWriter.encodeSync({attributes:t}),a=null==s||null===(i=s.parseSync)||void 0===i?void 0:i.call(s,{attributes:t}),c=n._addFauxAttributes(a.attributes);return{primitives:[{attributes:c,mode:r,extensions:{KHR_draco_mesh_compression:{bufferView:n.addBufferView(o),attributes:c}}}]}}async function ke(t){const e=new Re(t),{json:r}=e;e.removeExtension("KHR_materials_unlit");for(const t of r.materials||[]){t.extensions&&t.extensions.KHR_materials_unlit&&(t.unlit=!0),e.removeObjectExtension(t,"KHR_materials_unlit")}}function Fe(t){const e=new Re(t),{json:r}=e;if(e.materials)for(const t of r.materials||[])t.unlit&&(delete t.unlit,e.addObjectExtension(t,"KHR_materials_unlit",{}),e.addExtension("KHR_materials_unlit"))}async function ze(t){const e=new Re(t),{json:r}=e,n=e.getExtension("KHR_lights_punctual");n&&(e.json.lights=n.lights,e.removeExtension("KHR_lights_punctual"));for(const t of r.nodes||[]){const r=e.getObjectExtension(t,"KHR_lights_punctual");r&&(t.light=r.light),e.removeObjectExtension(t,"KHR_lights_punctual")}}async function Ve(t){const e=new Re(t),{json:r}=e;if(r.lights){const t=e.addExtension("KHR_lights_punctual");pe(!t.lights),t.lights=r.lights,delete r.lights}if(e.json.lights){for(const t of e.json.lights){const r=t.node;e.addObjectExtension(r,"KHR_lights_punctual",t)}delete e.json.lights}}async function Ge(t){const e=new Re(t),{json:r}=e,n=e.getExtension("KHR_techniques_webgl");if(n){const t=function(t,e){const{programs:r=[],shaders:n=[],techniques:s=[]}=t,i=new TextDecoder;return n.forEach(t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=i.decode(e.getTypedArrayForBufferView(t.bufferView))}),r.forEach(t=>{t.fragmentShader=n[t.fragmentShader],t.vertexShader=n[t.vertexShader]}),s.forEach(t=>{t.program=r[t.program]}),s}(n,e);for(const n of r.materials||[]){const r=e.getObjectExtension(n,"KHR_techniques_webgl");r&&(n.technique=Object.assign({},r,t[r.technique]),n.technique.values=He(n.technique,e)),e.removeObjectExtension(n,"KHR_techniques_webgl")}e.removeExtension("KHR_techniques_webgl")}}async function qe(t,e){}function He(t,e){const r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(e=>{t.uniforms[e].value&&!(e in r)&&(r[e]=t.uniforms[e].value)}),Object.keys(r).forEach(t=>{"object"==typeof r[t]&&void 0!==r[t].index&&(r[t].texture=e.getTexture(r[t].index))}),r}const We={KHR_draco_mesh_compression:s,KHR_materials_unlit:i,KHR_lights_punctual:o,KHR_techniques_webgl:a};const $e={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Ke={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Qe{constructor(t){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(t,e){this.json=t.json;const r=t.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 "+r.asset.version)}if(!e.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(t){const e=new Re(t),{json:r}=e;for(const t of r.images||[]){const r=e.removeObjectExtension(t,"KHR_binary_glTF");r&&Object.assign(t,r)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,e.removeExtension("KHR_binary_glTF")}(t),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in $e)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const r=t[e];if(r&&!Array.isArray(r)){t[e]=[];for(const n in r){const s=r[n];s.id=s.id||n;const i=t[e].length;t[e].push(s),this.idToIndexMap[e][n]=i}}}_convertObjectIdsToArrayIndices(t){for(const e in $e)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:r,material:n}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");r&&(e.indices=this._convertIdToIndex(r,"accessor")),n&&(e.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(t=>this._convertIdToIndex(t,"node"))),t.meshes&&(t.meshes=t.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute "+e),t[e]=[]);for(const r of t[e])for(const t in r){const e=r[t],n=this._convertIdToIndex(e,t);r[t]=n}}_convertIdToIndex(t,e){const r=Ke[e];if(r in this.idToIndexMap){const n=this.idToIndexMap[r][t];if(!Number.isFinite(n))throw new Error(`gltf v1: failed to resolve ${e} with id ${t}`);return n}return t}_updateObjects(t){for(const t of this.json.buffers)delete t.type}_updateMaterial(t){for(const e of t.materials){e.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=e.values&&e.values.tex,n=t.textures.findIndex(t=>t.id===r);-1!==n&&(e.pbrMetallicRoughness.baseColorTexture={index:n})}}}const Ye={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ze={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Je={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Xe={magFilter:Je.TEXTURE_MAG_FILTER,minFilter:Je.TEXTURE_MIN_FILTER,wrapS:Je.TEXTURE_WRAP_S,wrapT:Je.TEXTURE_WRAP_T},tr={[Je.TEXTURE_MAG_FILTER]:Je.LINEAR,[Je.TEXTURE_MIN_FILTER]:Je.NEAREST_MIPMAP_LINEAR,[Je.TEXTURE_WRAP_S]:Je.REPEAT,[Je.TEXTURE_WRAP_]:Je.REPEAT};class er{postProcess(t,e={}){const{json:r,buffers:n=[],images:s=[],baseUri:i=""}=t;return pe(r),this.baseUri=i,this.json=r,this.buffers=n,this.images=s,this._resolveTree(this.json,e),this.json}_resolveTree(t,e={}){t.bufferViews&&(t.bufferViews=t.bufferViews.map((t,e)=>this._resolveBufferView(t,e))),t.images&&(t.images=t.images.map((t,e)=>this._resolveImage(t,e))),t.samplers&&(t.samplers=t.samplers.map((t,e)=>this._resolveSampler(t,e))),t.textures&&(t.textures=t.textures.map((t,e)=>this._resolveTexture(t,e))),t.accessors&&(t.accessors=t.accessors.map((t,e)=>this._resolveAccessor(t,e))),t.materials&&(t.materials=t.materials.map((t,e)=>this._resolveMaterial(t,e))),t.meshes&&(t.meshes=t.meshes.map((t,e)=>this._resolveMesh(t,e))),t.nodes&&(t.nodes=t.nodes.map((t,e)=>this._resolveNode(t,e))),t.skins&&(t.skins=t.skins.map((t,e)=>this._resolveSkin(t,e))),t.scenes&&(t.scenes=t.scenes.map((t,e)=>this._resolveScene(t,e))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"==typeof e)return e;const r=this.json[t]&&this.json[t][e];return r||console.warn(`glTF file error: Could not find ${t}[${e}]`),r}_resolveScene(t,e){return t.id=t.id||"scene-"+e,t.nodes=(t.nodes||[]).map(t=>this.getNode(t)),t}_resolveNode(t,e){return t.id=t.id||"node-"+e,t.children&&(t.children=t.children.map(t=>this.getNode(t))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((t,e)=>{const r=this.getMesh(e);return t.id=r.id,t.primitives=t.primitives.concat(r.primitives),t},{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||"skin-"+e,t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||"mesh-"+e,t.primitives&&(t.primitives=t.primitives.map(t=>{const e=(t={...t}).attributes;t.attributes={};for(const r in e)t.attributes[r]=this.getAccessor(e[r]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t})),t}_resolveMaterial(t,e){if(t.id=t.id||"material-"+e,t.normalTexture&&(t.normalTexture={...t.normalTexture},t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture={...t.occlustionTexture},t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture={...t.emmisiveTexture},t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness={...t.pbrMetallicRoughness};const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){var r,n;if(t.id=t.id||"accessor-"+e,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(r=t.componentType,Ze[r]),t.components=(n=t.type,Ye[n]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:r,byteLength:n}=Me(t,t.bufferView),s=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset,i=e.arrayBuffer.slice(s,s+n);t.value=new r(i)}return t}_resolveTexture(t,e){return t.id=t.id||"texture-"+e,t.sampler="sampler"in t?this.getSampler(t.sampler):tr,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||"sampler-"+e,t.parameters={};for(const e in t){const r=this._enumSamplerParameter(e);void 0!==r&&(t.parameters[r]=t[e])}return t}_enumSamplerParameter(t){return Xe[t]}_resolveImage(t,e){t.id=t.id||"image-"+e,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const r=this.images[e];return r&&(t.image=r),t}_resolveBufferView(t,e){t.id=t.id||"bufferView-"+e;const r=t.buffer;t.buffer=this.buffers[r];const n=this.buffers[r].arrayBuffer;let s=this.buffers[r].byteOffset||0;return"byteOffset"in t&&(s+=t.byteOffset),t.data=new Uint8Array(n,s,t.byteLength),t}_resolveCamera(t,e){return t.id=t.id||"camera-"+e,t.perspective,t.orthographic,t}}const rr=1735152710;function nr(t,e=0,r={}){const n=new DataView(t),{magic:s=rr}=r,i=n.getUint32(e,!1);return i===s||i===rr}function sr(t,e,r=0,n={}){const s=new DataView(e),i=function(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}(s,r+0),o=s.getUint32(r+4,!0),a=s.getUint32(r+8,!0);switch(Object.assign(t,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},binChunks:[]}),r+=12,t.version){case 1:return function(t,e,r){T(t.header.byteLength>20);const n=e.getUint32(r+0,!0),s=e.getUint32(r+4,!0);return r+=8,T(0===s),ir(t,e,r,n),r+=n,r+=or(t,e,r,t.header.byteLength)}(t,s,r);case 2:return function(t,e,r,n){return T(t.header.byteLength>20),function(t,e,r,n){for(;r+8<=t.header.byteLength;){const s=e.getUint32(r+0,!0),i=e.getUint32(r+4,!0);switch(r+=8,i){case 1313821514:ir(t,e,r,s);break;case 5130562:or(t,e,r,s);break;case 0:n.strict||ir(t,e,r,s);break;case 1:n.strict||or(t,e,r,s)}r+=we(s,4)}}(t,e,r,n),r+t.header.byteLength}(t,s,r,{});default:throw new Error(`Invalid GLB version ${t.version}. Only supports v1 and v2.`)}}function ir(t,e,r,n){const s=new Uint8Array(e.buffer,r,n),i=new TextDecoder("utf8").decode(s);return t.json=JSON.parse(i),we(n,4)}function or(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),we(n,4)}async function ar(t,e,r=0,n,s){var i,o,a,c;!function(t,e,r,n){n.uri&&(t.baseUri=n.uri);if(e instanceof ArrayBuffer&&!nr(e,r,n)){const t=new TextDecoder;e=t.decode(e)}if("string"==typeof e)t.json=ye(e);else if(e instanceof ArrayBuffer){const s={};r=sr(s,e,r,n.glb),pe("glTF"===s.type,"Invalid GLB magic string "+s.type),t._glb=s,t.json=s.json}else pe(!1,"GLTF: must be ArrayBuffer or string");const s=t.json.buffers||[];if(t.buffers=new Array(s.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const i=t.json.images||[];t.images=new Array(i.length).fill({})}(t,e,r,n),function(t,e={}){(new Qe).normalize(t,e)}(t,{normalize:null==n||null===(i=n.gltf)||void 0===i?void 0:i.normalize});const u=[];if(null!=n&&null!==(o=n.gltf)&&void 0!==o&&o.loadBuffers&&t.json.buffers&&await async function(t,e,r){for(let i=0;i<t.json.buffers.length;++i){const o=t.json.buffers[i];if(o.uri){var n,s;const{fetch:a}=r;pe(a);const c=be(o.uri,e),u=await(null==r||null===(n=r.fetch)||void 0===n?void 0:n.call(r,c)),h=await(null==u||null===(s=u.arrayBuffer)||void 0===s?void 0:s.call(u));t.buffers[i]={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength},delete o.uri}}}(t,n,s),null!=n&&null!==(a=n.gltf)&&void 0!==a&&a.loadImages){const e=async function(t,e,r){const n=t.json.images||[],s=[];for(let i=0;i<n.length;++i)s.push(cr(t,n[i],i,e,r));return await Promise.all(s)}(t,n,s);u.push(e)}const h=async function(t,e={},r){for(const s in We){var n;const i=(null==e||null===(n=e.gltf)||void 0===n?void 0:n.excludeExtensions)||{};if(!(s in i&&!i[s])){const n=We[s];await n.decode(t,e,r)}}}(t,n,s);return u.push(h),await Promise.all(u),null!=n&&null!==(c=n.gltf)&&void 0!==c&&c.postProcess?function(t,e){return(new er).postProcess(t,e)}(t,n):t}async function cr(t,e,r,n,s){const{fetch:i,parse:o}=s;let a;if(e.uri){const t=be(e.uri,n),r=await i(t);a=await r.arrayBuffer()}if(Number.isFinite(e.bufferView)){const r=Te(t.json,t.buffers,e.bufferView);a=ge(r.buffer,r.byteOffset,r.byteLength)}pe(a,"glTF image has no data");const c=await o(a,de,{},s);t.images[r]=c}const ur={name:"glTF",id:"gltf",module:"gltf",version:"3.0.12",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t,e={},r){(e={...ur.options,...e}).gltf={...ur.options.gltf,...e.gltf};const{byteOffset:n=0}=e;return await ar({},t,n,e,r)},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"}}};const hr=0,fr=1;function lr(t,e,r,n){t.rotateYtoZ=!0;const s=t.byteOffset+t.byteLength-r;if(0===s)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=ge(e,r,s),t.gltfByteOffset=0,t.gltfByteLength=s,r%4==0||console.warn(t.type+": embedded glb is not aligned to a 4-byte boundary."),t.byteOffset+t.byteLength}async function dr(t,e,r,n){const s=r["3d-tiles"]||{};if(function(t,e,r){switch(e){case hr:const e=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),r=(new TextDecoder).decode(e);t.gltfUrl=r.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case fr:break;default:throw new Error("b3dm: Illegal glTF format field")}}(t,e),s.loadGLTF){const{parse:e,fetch:s}=n;t.gltfUrl&&(t.gltfArrayBuffer=await s(t.gltfUrl,r),t.gltfByteOffset=0),t.gltfArrayBuffer&&(t.gltf=await e(t.gltfArrayBuffer,ur,r,n),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength)}}async function mr(t,e,r,n,s){var i;r=function(t,e,r,n,s){r=St(t,e,r),r=Nt(t,e,r),r=xt(t,e,r),r=lr(t,e,r,n);const i=new yt(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=i.getGlobalProperty("RTC_CENTER",ht.FLOAT,3),r}(t,e,r,n),await dr(t,fr,n,s);const o=null==t||null===(i=t.gltf)||void 0===i?void 0:i.extensions;return o&&o.CESIUM_RTC&&(t.rtcCenter=o.CESIUM_RTC.center),r}var yr=r(45),gr=r(46),pr=r(44),br=r(6),Tr=r(2);Math.max(6378137,6378137,6356752.314245179);const wr=t=>t,Er=new ft.a;function Or(t,e,r=wr){return Object(Rt.e)(t)?(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]):"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z),e}function _r(t,e,r=wr){return Object(Rt.e)(e)?(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]):"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]),e}const Ar=new ft.a,Ir=new ft.a,vr=new ft.a;const Sr=new ft.a,Nr={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"}},xr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Mr={east:new ft.a,north:new ft.a,up:new ft.a,west:new ft.a,south:new ft.a,down:new ft.a},Lr=new ft.a,jr=new ft.a,Rr=new ft.a;function Ur(t,e,r,n,s,i){const o=Nr[e]&&Nr[e][r];let a,c,u;Object(br.a)(o&&(!n||n===o));const h=Sr.copy(s);if(Object(Rt.c)(h.x,0,1e-14)&&Object(Rt.c)(h.y,0,1e-14)){const t=Math.sign(h.z);a=Lr.fromArray(xr[e]),"east"!==e&&"west"!==e&&a.scale(t),c=jr.fromArray(xr[r]),"east"!==r&&"west"!==r&&c.scale(t),u=Rr.fromArray(xr[n]),"east"!==n&&"west"!==n&&u.scale(t)}else{const{up:s,east:i,north:o}=Mr;i.set(-h.y,h.x,0).normalize(),t.geodeticSurfaceNormal(h,s),o.copy(s).cross(i);const{down:f,west:l,south:d}=Mr;f.copy(s).scale(-1),l.copy(i).scale(-1),d.copy(o).scale(-1),a=Mr[e],c=Mr[r],u=Mr[n]}return i[0]=a.x,i[1]=a.y,i[2]=a.z,i[3]=0,i[4]=c.x,i[5]=c.y,i[6]=c.z,i[7]=0,i[8]=u.x,i[9]=u.y,i[10]=u.z,i[11]=0,i[12]=h.x,i[13]=h.y,i[14]=h.z,i[15]=1,i}const Pr=new ft.a,Br=new ft.a,Dr=new ft.a,Cr=new ft.a,kr=new ft.a,Fr=new ft.a;let zr;class Vr{static get WGS84(){return zr=zr||new Vr(6378137,6378137,6356752.314245179),zr}constructor(t=0,e=0,r=0){Object(br.a)(t>=0),Object(br.a)(e>=0),Object(br.a)(r>=0),this.radii=new ft.a(t,e,r),this.radiiSquared=new ft.a(t*t,e*e,r*r),this.radiiToTheFourth=new ft.a(t*t*t*t,e*e*e*e,r*r*r*r),this.oneOverRadii=new ft.a(0===t?0:1/t,0===e?0:1/e,0===r?0:1/r),this.oneOverRadiiSquared=new ft.a(0===t?0:1/(t*t),0===e?0:1/(e*e),0===r?0:1/(r*r)),this.minimumRadius=Math.min(t,e,r),this.maximumRadius=Math.max(t,e,r),this.centerToleranceSquared=Ct.a.EPSILON1,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,e=[0,0,0]){const r=Br,n=Dr,[,,s]=t;this.geodeticSurfaceNormalCartographic(t,r),n.copy(this.radiiSquared).scale(r);const i=Math.sqrt(r.dot(n));return n.scale(1/i),r.scale(s),n.add(r),n.to(e)}cartesianToCartographic(t,e=[0,0,0]){Fr.from(t);const r=this.scaleToGeodeticSurface(Fr,Cr);if(!r)return;const n=this.geodeticSurfaceNormal(r,Br),s=kr;s.copy(Fr).subtract(r);const i=Math.atan2(n.y,n.x),o=Math.asin(n.z),a=Math.sign(Tr.d(s,Fr))*Tr.g(s);return _r([i,o,a],e,Rt.b._cartographicRadians?wr:Rt.f)}eastNorthUpToFixedFrame(t,e=new pr.a){return Ur(this,"east","north","up",t,e)}localFrameToFixedFrame(t,e,r,n,s=new pr.a){return Ur(this,t,e,r,n,s)}geocentricSurfaceNormal(t,e=[0,0,0]){return Pr.from(t).normalize().to(e)}geodeticSurfaceNormalCartographic(t,e=[0,0,0]){const r=function(t,e=Er){return Or(t,e,Rt.b._cartographicRadians?wr:Rt.g)}(t),n=r[0],s=r[1],i=Math.cos(s);return Pr.set(i*Math.cos(n),i*Math.sin(n),Math.sin(s)).normalize(),Pr.to(e)}geodeticSurfaceNormal(t,e=[0,0,0]){return Pr.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}scaleToGeodeticSurface(t,e){return function(t,e,r=new ft.a){const{oneOverRadii:n,oneOverRadiiSquared:s,centerToleranceSquared:i}=e;Ar.from(t);const o=t.x,a=t.y,c=t.z,u=n.x,h=n.y,f=n.z,l=o*o*u*u,d=a*a*h*h,m=c*c*f*f,y=l+d+m,g=Math.sqrt(1/y);if(!Number.isFinite(g))return;const p=Ir;if(p.copy(t).scale(g),y<i)return p.to(r);const b=s.x,T=s.y,w=s.z,E=vr;E.set(p.x*b*2,p.y*T*2,p.z*w*2);let O,_,A,I,v=(1-g)*t.len()/(.5*E.len()),S=0;do{v-=S,O=1/(1+v*b),_=1/(1+v*T),A=1/(1+v*w);const t=O*O,e=_*_,r=A*A;I=l*t+d*e+m*r-1;S=I/(-2*(l*(t*O)*b+d*(e*_)*T+m*(r*A)*w))}while(Math.abs(I)>Ct.a.EPSILON12);return Ar.scale([O,_,A]).to(r)}(t,this,e)}scaleToGeocentricSurface(t,e=[0,0,0]){Cr.from(t);const r=Cr.x,n=Cr.y,s=Cr.z,i=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*i.x+n*n*i.y+s*s*i.z);return Cr.multiplyScalar(o).to(e)}transformPositionToScaledSpace(t,e=[0,0,0]){return Cr.from(t).scale(this.oneOverRadii).to(e)}transformPositionFromScaledSpace(t,e=[0,0,0]){return Cr.from(t).scale(this.radii).to(e)}getSurfaceNormalIntersectionWithZAxis(t,e=0,r=[0,0,0]){Object(br.a)(Object(Rt.c)(this.radii.x,this.radii.y,Ct.a.EPSILON15)),Object(br.a)(this.radii.z>0),Cr.from(t);const n=Cr.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-e))return Cr.set(0,0,n).to(r)}}async function Gr(t,e,r,n,s){return r=function(t,e,r,n,s){if(r=St(t,e,r),1!==t.version)throw new Error(`Instanced 3D Model version ${t.version} is not supported`);r=Nt(t,e,r);const i=new DataView(e);if(t.gltfFormat=i.getUint32(r,!0),r=xt(t,e,r+=4),r=lr(t,e,r,n),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const o=new yt(t.featureTableJson,t.featureTableBinary),a=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=o.getGlobalProperty("RTC_CENTER",ht.FLOAT,3);new vt(t.batchTableJson,t.batchTableBinary,a);return function(t,e,r,n){const s=[new Array(n),t._batchTable][0],i=new ft.a,o=new ft.a,a=new ft.a,c=new ft.a,u=new yr.a,h=new gr.a,f=new ft.a,l={},d=new pr.a,m=[],y=[],g=new ft.a,p=new ft.a;for(let r=0;r<n;r++){let n;if(e.hasProperty("POSITION"))n=e.getProperty("POSITION",ht.FLOAT,3,r,i);else if(e.hasProperty("POSITION_QUANTIZED")){n=e.getProperty("POSITION_QUANTIZED",ht.UNSIGNED_SHORT,3,r,i);const t=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ht.FLOAT,3,g);if(!t)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const s=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ht.FLOAT,3,p);if(!s)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const o=65535;for(let e=0;e<3;e++)n[e]=n[e]/o*s[e]+t[e]}if(!n)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");i.copy(n),l.translation=i,t.normalUp=e.getProperty("NORMAL_UP",ht.FLOAT,3,r,m),t.normalRight=e.getProperty("NORMAL_RIGHT",ht.FLOAT,3,r,y);const b=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",ht.UNSIGNED_SHORT,2,m),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",ht.UNSIGNED_SHORT,2,y),t.octNormalUp){if(!t.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")}t.eastNorthUp?(Vr.WGS84.eastNorthUpToFixedFrame(i,d),d.getRotationMatrix3(u)):u.identity()}b&&(c.copy(o).cross(a).normalize(),u.setColumn(0,o),u.setColumn(1,a),u.setColumn(2,c)),h.fromMatrix3(u),l.rotation=h,f.set(1,1,1);const T=e.getProperty("SCALE",ht.FLOAT,1,r);Number.isFinite(T)&&f.multiplyByScalar(T);const w=e.getProperty("SCALE_NON_UNIFORM",ht.FLOAT,3,r,m);w&&f.scale(w),l.scale=f;let E=e.getProperty("BATCH_ID",ht.UNSIGNED_SHORT,1,r);void 0===E&&(E=r);const O=(new pr.a).fromQuaternion(l.rotation);d.identity(),d.translate(l.translation),d.multiplyRight(O),d.scale(l.scale);const _=d.clone();s[r]={modelMatrix:_,batchId:E}}t.instances=s}(t,o,0,a),r}(t,e,r,n),await dr(t,t.gltfFormat,n,s),r}async function qr(t,e=0,r,n,s={}){switch(s.byteOffset=e,s.type=function(t,e=0){const r=new DataView(t);return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}(t,e),s.type){case p.COMPOSITE:return await async function(t,e,r,n,s,i){r=St(t,e,r);const o=new DataView(e);for(t.tilesLength=o.getUint32(r,!0),r+=4,t.tiles=[];t.tiles.length<t.tilesLength&&t.byteLength-r>12;){const o={};t.tiles.push(o),r=await i(e,r,n,s,o)}return r}(s,t,e,r,n,qr);case p.BATCHED_3D_MODEL:return await mr(s,t,e,r,n);case p.INSTANCED_3D_MODEL:return await Gr(s,t,e,r,n);case p.POINT_CLOUD:return await Wt(s,t,e,r,n);default:throw new Error("3DTileLoader: unknown type "+s.type)}}function Hr(t,e){if(t.content){const r=t.content.uri||t.content.url;t.contentUrl=`${e.basePath}/${r}`}return t.id=t.contentUrl,t.lodMetricType=g,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=function(t){if(!t.contentUrl)return l;const e=t.contentUrl.split(".").pop();switch(e){case"pnts":return m;case"i3dm":case"b3dm":return d;default:return e}}(t),t.refine=function(t){switch(t){case"REPLACE":case"replace":return f;case"ADD":case"add":return h;default:return t}}(t.refine),t}const Wr={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.0.12",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(t,e,r){const s=e["3d-tiles"]||{};let i;i="auto"===s.isTileset?r.url&&-1!==r.url.indexOf(".json"):s.isTileset;t=i?await async function(t,e,r){const s=JSON.parse((new TextDecoder).decode(t));return s.loader=e.loader||Wr,s.url=r.url,s.basePath=function(t){return n.dirname(t.url)}(s),s.root=function(t){const e=t.basePath,r=Hr(t.root,t),n=[];for(n.push(r);n.length>0;){const t=n.pop().children||[];for(const r of t)Hr(r,{basePath:e}),n.push(r)}return r}(s),s.type=y,s.lodMetricType=g,s.lodMetricValue=s.root.lodMetricValue,s}(t,e,r):await async function(t,e,r){const n={content:{featureIds:null}};return await qr(t,0,e,r,n.content),n.content}(t,e,r);return t},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};let $r="";const Kr={};const Qr=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Yr=t=>"undefined"!=typeof Blob&&t instanceof Blob,Zr=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Jr=/^([-\w.]+\/[-\w.+]+)/;function Xr(t){const e=Jr.exec(t);return e?e[1]:t}function tn(t){const e=Zr.exec(t);return e?e[1]:""}const en=/\?.*/;function rn(t){return t.replace(en,"")}async function nn(t){if(Qr(t))return t;const e={},r=function(t){return Qr(t)?t.headers["content-length"]||-1:Yr(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}(t);r>=0&&(e["content-length"]=String(r));const{url:n,type:s}=function(t){if(Qr(t)){const e=rn(t.url||"");return{url:e,type:Xr(t.headers.get("content-type")||"")||tn(e)}}return Yr(t)?{url:rn(t.name||""),type:t.type||""}:"string"==typeof t?{url:rn(t),type:tn(t)}:{url:"",type:""}}(t);s&&(e["content-type"]=s);const i=await async function(t){if("string"==typeof t)return"data:,"+t.slice(0,5);if(t instanceof Blob){const e=t.slice(0,5);return await new Promise(t=>{const r=new FileReader;r.onload=e=>{var r;return t(null==e||null===(r=e.target)||void 0===r?void 0:r.result)},r.readAsDataURL(e)})}if(t instanceof ArrayBuffer){const e=t.slice(0,5);return"data:base64,"+function(t){let e="";const r=new Uint8Array(t);for(let t=0;t<r.byteLength;t++)e+=String.fromCharCode(r[t]);return btoa(e)}(e)}return null}(t);i&&(e["x-first-bytes"]=i),"string"==typeof t&&(t=(new TextEncoder).encode(t));const o=new Response(t,{headers:e});return Object.defineProperty(o,"url",{value:n}),o}async function sn(t,e){if("string"==typeof t){t=function(t){for(const e in Kr)if(t.startsWith(e)){const r=Kr[e];t=t.replace(e,r)}return t.startsWith("http://")||t.startsWith("https://")||(t=`${$r}${t}`),t}(t);let r=e;return null!=e&&e.fetch&&"function"!=typeof(null==e?void 0:e.fetch)&&(r=e.fetch),await fetch(t,r)}return await nn(t)}async function on(t,e){if(!e){const r=await async function(t){T(t);const e={Authorization:"Bearer "+t},r=await sn("https://api.cesium.com/v1/assets",{fetch:{headers:e}});if(!r.ok)throw new Error(r.statusText);return await r.json()}(t);for(const t of r.items)"3DTILES"===t.type&&(e=t.id)}const r=await async function(t,e){T(t,e);const r={Authorization:"Bearer "+t},n="https://api.cesium.com/v1/assets/"+e;let s=await sn(""+n,{fetch:{headers:r}});if(!s.ok)throw new Error(s.statusText);let i=await s.json();if(s=await sn(n+"/endpoint",{fetch:{headers:r}}),!s.ok)throw new Error(s.statusText);const o=await s.json();return i={...i,...o},i}(t,e),{type:n,url:s}=r;return T("3DTILES"===n&&s),r.headers={Authorization:"Bearer "+r.accessToken},r}const an={...Wr,id:"cesium-ion",name:"Cesium Ion",preload:async function(t,e={}){e=e["cesium-ion"]||{};const{accessToken:r}=e;let n=e.assetId;if(!Number.isFinite(n)){const e=t.match(/\/([0-9]+)\/tileset.json/);n=e&&e[1]}return on(r,n)},parse:async(t,e,r)=>((e={...e})["3d-tiles"]=e["cesium-ion"],e.loader=an,Wr.parse(t,e,r)),options:{"cesium-ion":{...Wr.options["3d-tiles"],accessToken:null}}};function cn(t,e,r){if(!e)return r+12;const{magic:n,version:s=1,byteLength:i=12}=t;return T(Array.isArray(n)&&Number.isFinite(s)&&Number.isFinite(i)),e.setUint8(r+0,n[0]),e.setUint8(r+1,n[1]),e.setUint8(r+2,n[2]),e.setUint8(r+3,n[3]),e.setUint32(r+4,s,!0),e.setUint32(r+8,i,!0),r+=12}function un(t,e,r){t&&t.setUint32(e+8,r,!0)}function hn(t,e,r,n){return e=function(t,e,r,n){const s=we(r.byteLength,n),i=s-r.byteLength;if(t){const n=new Uint8Array(t.buffer,t.byteOffset+e,r.byteLength),s=new Uint8Array(r);n.set(s);for(let n=0;n<i;++n)t.setUint8(e+r.byteLength+n,32)}return e+=s}(t,e,(new TextEncoder).encode(r),n)}function fn(t,e,r,n){if(t)for(let s=0;s<n;s++)t.setUint8(e+s,r.charCodeAt(s));return e+n}function ln(t,e,r,n){if(t)for(let s=0;s<n;s++)t.setUint8(e+s,r[s]);return e+n}const dn={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function mn(t,e,r,n){const{featureTableJson:s=dn}=t;let i=JSON.stringify(s);i=function(t,e){const r=t.length,n=Math.ceil(r/e)*e-r;let s="";for(let t=0;t<n;++t)s+=" ";return t+s}(i,4);const{featureTableJsonByteLength:o=i.length}=t,a=new ArrayBuffer(12),c=a.byteLength,u=r;return r+=cn(t={magic:b.POINT_CLOUD,...t},e,0),e&&(e.setUint32(r+0,o,!0),e.setUint32(r+4,c,!0),e.setUint32(r+8,0,!0),e.setUint32(r+12,0,!0)),r+=16,r+=fn(e,r,i,o),un(e,u,(r+=ln(e,r,a,c))-u),r}function yn(t,e,r,n){switch(T("string"==typeof t.type),t.type){case p.COMPOSITE:return function(t,e,r,n,s){const i=r;r+=cn(t={magic:b.COMPOSITE,tiles:[],...t},e,r),e&&e.setUint32(r,t.tiles.length,!0),r+=4;for(let i=0;i<t.tiles.length;++i)r+=s(t.tiles[i],e,r,n);return un(e,i,r-i),r}(t,e,r,n,yn);case p.POINT_CLOUD:return mn(t,e,r);case p.BATCHED_3D_MODEL:return function(t,e,r,n){const{featuresLength:s=0,batchTable:i}=t,o={BATCH_LENGTH:s},a=JSON.stringify(o),c=i?JSON.stringify(i):"",u=we(a.length,8),h=c?we(c.length,8):0,f=r;r=cn(t={magic:b.BATCHED_MODEL,...t},e,r),e&&(e.setUint32(12,u,!0),e.setUint32(16,0,!0),e.setUint32(20,h,!0),e.setUint32(24,0,!0)),r=hn(e,r+=16,a,8),i&&(r=hn(e,r,c,8));const l=t.gltfEncoded;return l&&(r=ln(e,r,l,l.byteLength)),un(e,f,r-f),r}(t,e,r);case p.INSTANCED_3D_MODEL:return function(t,e,r,n){const{featuresLength:s=1,gltfFormat:i=1,gltfUri:o=""}=t,a=o.length,c={INSTANCES_LENGTH:s,POSITION:new Array(3*s).fill(0)},u=JSON.stringify(c),h=u.length,f=r;return r=cn(t={magic:b.INSTANCED_MODEL,...t},e,0),e&&(e.setUint32(12,h,!0),e.setUint32(16,0,!0),e.setUint32(20,0,!0),e.setUint32(24,0,!0),e.setUint32(28,i,!0)),r+=20,r+=fn(e,r,u,h),un(e,f,(r+=fn(e,r,o,a))-f),r}(t,e,r);default:throw new Error("3D Tiles: unknown tile type")}}const gn={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:"3.0.12",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:function(t,e){return function(t,e){const r=yn(t,null,0,e),n=new ArrayBuffer(r);return yn(t,new DataView(n),0,e),n}(t,e)},binary:!0,options:{"3d-tiles":{}}}},,,,,,function(t,e,r){"use strict";r.d(e,"a",(function(){return h}));var n=r(20),s=r(3),i=r(1),o=r(2),a=r(8);const c=[0,0,0],u={};class h extends n.a{static get ZERO(){return u.ZERO=u.ZERO||Object.freeze(new h(0,0,0,0))}constructor(t=0,e=0,r=0){super(-0,-0,-0),1===arguments.length&&Object(s.e)(t)?this.copy(t):(s.b.debug&&(Object(i.a)(t),Object(i.a)(e),Object(i.a)(r)),this[0]=t,this[1]=e,this[2]=r)}set(t,e,r){return this[0]=t,this[1]=e,this[2]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return s.b.debug&&(Object(i.a)(t.x),Object(i.a)(t.y),Object(i.a)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Object(i.a)(t)}angle(t){return o.a(this,t)}cross(t){return o.c(this,this,t),this.check()}rotateX({radians:t,origin:e=c}){return o.i(this,this,e,t),this.check()}rotateY({radians:t,origin:e=c}){return o.j(this,this,e,t),this.check()}rotateZ({radians:t,origin:e=c}){return o.k(this,this,e,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return o.m(this,this,t),this.check()}transformAsVector(t){return Object(a.c)(this,this,t),this.check()}transformByMatrix3(t){return o.l(this,this,t),this.check()}transformByMatrix2(t){return Object(a.b)(this,this,t),this.check()}transformByQuaternion(t){return o.n(this,this,t),this.check()}}},function(t,e,r){"use strict";e.a={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:2*Math.PI}},function(t,e,r){"use strict";r.d(e,"a",(function(){return m}));var n=r(1),s=r(21),i=r(8),o=r(5),a=r(9),c=r(2),u=r(4);const h=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),f=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),l=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),d={};class m extends s.a{static get IDENTITY(){return d.IDENTITY=d.IDENTITY||Object.freeze(new m(h)),d.IDENTITY}static get ZERO(){return d.ZERO=d.ZERO||Object.freeze(new m(f)),d.ZERO}get INDICES(){return l}get ELEMENTS(){return 16}get RANK(){return 4}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,r,n,s,i,o,a,c,u,h,f,l,d,m,y){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=s,this[5]=i,this[6]=o,this[7]=a,this[8]=c,this[9]=u,this[10]=h,this[11]=f,this[12]=l,this[13]=d,this[14]=m,this[15]=y,this.check()}setRowMajor(t,e,r,n,s,i,o,a,c,u,h,f,l,d,m,y){return this[0]=t,this[1]=s,this[2]=c,this[3]=l,this[4]=e,this[5]=i,this[6]=u,this[7]=d,this[8]=r,this[9]=o,this[10]=h,this[11]=m,this[12]=n,this[13]=a,this[14]=f,this[15]=y,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(h)}fromQuaternion(t){return o.b(this,t),this.check()}frustum({left:t,right:e,bottom:r,top:n,near:s,far:i}){return i===1/0?m._computeInfinitePerspectiveOffCenter(this,t,e,r,n,s):o.c(this,t,e,r,n,s,i),this.check()}static _computeInfinitePerspectiveOffCenter(t,e,r,n,s,i){const o=2*i/(r-e),a=2*i/(s-n),c=(r+e)/(r-e),u=(s+n)/(s-n),h=-2*i;return t[0]=o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=c,t[9]=u,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}lookAt(t,e,r){return 1===arguments.length&&({eye:t,center:e,up:r}=t),e=e||[0,0,0],r=r||[0,1,0],o.e(this,t,e,r),this.check()}ortho({left:t,right:e,bottom:r,top:n,near:s=.1,far:i=500}){return o.g(this,t,e,r,n,s,i),this.check()}orthographic({fovy:t=45*Math.PI/180,aspect:e=1,focalDistance:r=1,near:n=.1,far:s=500}){if(t>2*Math.PI)throw Error("radians");const i=t/2,o=r*Math.tan(i),a=o*e;return(new m).ortho({left:-a,right:a,bottom:-o,top:o,near:n,far:s})}perspective({fovy:t,fov:e=45*Math.PI/180,aspect:r=1,near:n=.1,far:s=500}={}){if((t=t||e)>2*Math.PI)throw Error("radians");return o.h(this,t,r,n,s),this.check()}determinant(){return o.a(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const r=this.getScale(e||[-0,-0,-0]),n=1/r[0],s=1/r[1],i=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*s,t[2]=this[2]*i,t[3]=0,t[4]=this[4]*n,t[5]=this[5]*s,t[6]=this[6]*i,t[7]=0,t[8]=this[8]*n,t[9]=this[9]*s,t[10]=this[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const r=this.getScale(e||[-0,-0,-0]),n=1/r[0],s=1/r[1],i=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*s,t[2]=this[2]*i,t[3]=this[4]*n,t[4]=this[5]*s,t[5]=this[6]*i,t[6]=this[8]*n,t[7]=this[9]*s,t[8]=this[10]*i,t}transpose(){return o.o(this,this),this.check()}invert(){return o.d(this,this),this.check()}multiplyLeft(t){return o.f(this,t,this),this.check()}multiplyRight(t){return o.f(this,this,t),this.check()}rotateX(t){return o.j(this,this,t),this.check()}rotateY(t){return o.k(this,this,t),this.check()}rotateZ(t){return o.l(this,this,t),this.check()}rotateXYZ([t,e,r]){return this.rotateX(t).rotateY(e).rotateZ(r)}rotateAxis(t,e){return o.i(this,this,t,e),this.check()}scale(t){return Array.isArray(t)?o.m(this,this,t):o.m(this,this,[t,t,t]),this.check()}translate(t){return o.n(this,this,t),this.check()}transform(t,e){return 4===t.length?(e=u.n(e||[-0,-0,-0,-0],t,this),Object(n.b)(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:r}=t;switch(r){case 2:e=a.d(e||[-0,-0],t,this);break;case 3:e=c.m(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(n.b)(e,t.length),e}transformAsVector(t,e){switch(t.length){case 2:e=Object(i.a)(e||[-0,-0],t,this);break;case 3:e=Object(i.c)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(n.b)(e,t.length),e}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,r){return this.identity().translate([t,e,r])}transformPoint(t,e){return Object(n.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}transformVector(t,e){return Object(n.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}transformDirection(t,e){return Object(n.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return d}));var n=r(21),s=r(1),i=r(8),o=r(7),a=r(9),c=r(2);const u=Object.freeze([1,0,0,0,1,0,0,0,1]),h=Object.freeze([0,0,0,0,0,0,0,0,0]),f=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),l={};class d extends n.a{static get IDENTITY(){return l.IDENTITY=l.IDENTITY||Object.freeze(new d(u)),l.IDENTITY}static get ZERO(){return l.ZERO=l.ZERO||Object.freeze(new d(h)),l.ZERO}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return f}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}set(t,e,r,n,s,i,o,a,c){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=s,this[5]=i,this[6]=o,this[7]=a,this[8]=c,this.check()}setRowMajor(t,e,r,n,s,i,o,a,c){return this[0]=t,this[1]=n,this[2]=o,this[3]=e,this[4]=s,this[5]=a,this[6]=r,this[7]=i,this[8]=c,this.check()}determinant(){return o.b(this)}identity(){return this.copy(u)}fromQuaternion(t){return o.c(this,t),this.check()}transpose(){return o.i(this,this),this.check()}invert(){return o.d(this,this),this.check()}multiplyLeft(t){return o.e(this,t,this),this.check()}multiplyRight(t){return o.e(this,this,t),this.check()}rotate(t){return o.f(this,this,t),this.check()}scale(t){return Array.isArray(t)?o.g(this,this,t):o.g(this,this,[t,t,t]),this.check()}translate(t){return o.h(this,this,t),this.check()}transform(t,e){switch(t.length){case 2:e=a.c(e||[-0,-0],t,this);break;case 3:e=c.l(e||[-0,-0,-0],t,this);break;case 4:e=Object(i.d)(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(s.b)(e,t.length),e}transformVector(t,e){return Object(s.c)("Matrix3.transformVector"),this.transform(t,e)}transformVector2(t,e){return Object(s.c)("Matrix3.transformVector"),this.transform(t,e)}transformVector3(t,e){return Object(s.c)("Matrix3.transformVector"),this.transform(t,e)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return M}));var n=r(14),s=r(1),i=r(6),o=r(0),a=r(7),c=r(2),u=r(4);function h(){var t=new o.a(4);return o.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function f(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function l(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3],a=r[0],c=r[1],u=r[2],h=r[3];return t[0]=n*h+o*a+s*u-i*c,t[1]=s*h+o*c+i*a-n*u,t[2]=i*h+o*u+n*c-s*a,t[3]=o*h-n*a-s*c-i*u,t}function d(t,e,r,n){var s,i,a,c,u,h=e[0],f=e[1],l=e[2],d=e[3],m=r[0],y=r[1],g=r[2],p=r[3];return(i=h*m+f*y+l*g+d*p)<0&&(i=-i,m=-m,y=-y,g=-g,p=-p),1-i>o.b?(s=Math.acos(i),a=Math.sin(s),c=Math.sin((1-n)*s)/a,u=Math.sin(n*s)/a):(c=1-n,u=n),t[0]=c*h+u*m,t[1]=c*f+u*y,t[2]=c*l+u*g,t[3]=c*d+u*p,t}function m(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var s=0;e[4]>e[0]&&(s=1),e[8]>e[3*s+s]&&(s=2);var i=(s+1)%3,o=(s+2)%3;r=Math.sqrt(e[3*s+s]-e[3*i+i]-e[3*o+o]+1),t[s]=.5*r,r=.5/r,t[3]=(e[3*i+o]-e[3*o+i])*r,t[i]=(e[3*i+s]+e[3*s+i])*r,t[o]=(e[3*o+s]+e[3*s+o])*r}return t}u.b,u.g,u.c,u.l;var y,g,p,b,T,w,E=u.a,O=u.k,_=u.d,A=u.i,I=u.h,v=u.m,S=u.j,N=(u.f,u.e,y=c.b(),g=c.e(1,0,0),p=c.e(0,1,0),function(t,e,r){var n=c.d(e,r);return n<-.999999?(c.c(y,g,e),c.f(y)<1e-6&&c.c(y,p,e),c.h(y,y),f(t,y,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(c.c(y,e,r),t[0]=y[0],t[1]=y[1],t[2]=y[2],t[3]=1+n,S(t,t))});b=h(),T=h(),w=a.a();const x=[0,0,0,1];class M extends n.a{constructor(t=0,e=0,r=0,n=1){super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,r,n)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,r,n){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this.check()}fromMatrix3(t){return m(this,t),this.check()}identity(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.check()}fromAxisRotation(t,e){return f(this,t,e),this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Object(s.a)(t)}get y(){return this[1]}set y(t){this[1]=Object(s.a)(t)}get z(){return this[2]}set z(t){this[2]=Object(s.a)(t)}get w(){return this[3]}set w(t){this[3]=Object(s.a)(t)}len(){return I(this)}lengthSquared(){return v(this)}dot(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return _(this,t)}rotationTo(t,e){return N(this,t,e),this.check()}add(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return E(this,this,t),this.check()}calculateW(){var t,e,r,n,s;return t=this,r=(e=this)[0],n=e[1],s=e[2],t[0]=r,t[1]=n,t[2]=s,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-s*s)),this.check()}conjugate(){var t,e;return e=this,(t=this)[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],this.check()}invert(){var t,e,r,n,s,i,o,a;return t=this,r=(e=this)[0],n=e[1],s=e[2],i=e[3],a=(o=r*r+n*n+s*s+i*i)?1/o:0,t[0]=-r*a,t[1]=-n*a,t[2]=-s*a,t[3]=i*a,this.check()}lerp(t,e,r){return A(this,t,e,r),this.check()}multiplyRight(t,e){return Object(i.a)(!e),l(this,this,t),this.check()}multiplyLeft(t,e){return Object(i.a)(!e),l(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,r){r*=.5;var n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(r),c=Math.cos(r);t[0]=n*c+o*a,t[1]=s*c+i*a,t[2]=i*c-s*a,t[3]=o*c-n*a}(this,this,t),this.check()}rotateY(t){return function(t,e,r){r*=.5;var n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(r),c=Math.cos(r);t[0]=n*c-i*a,t[1]=s*c+o*a,t[2]=i*c+n*a,t[3]=o*c-s*a}(this,this,t),this.check()}rotateZ(t){return function(t,e,r){r*=.5;var n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(r),c=Math.cos(r);t[0]=n*c+s*a,t[1]=s*c-n*a,t[2]=i*c+o*a,t[3]=o*c-i*a}(this,this,t),this.check()}scale(t){return O(this,this,t),this.check()}slerp(t,e,r){switch(arguments.length){case 1:({start:t=x,target:e,ratio:r}=arguments[0]);break;case 2:[e,r]=arguments,t=this}return d(this,t,e,r),this.check()}transformVector4(t,e=t){return u.o(e,t,this),Object(s.b)(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t,e){return this.multiplyLeft(t,e)}multiply(t,e){return this.multiplyRight(t,e)}}}])}));
1
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)r.d(n,s,function(e){return t[e]}.bind(null,s));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=27)}([function(t,e,r){"use strict";r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return s})),r.d(e,"c",(function(){return i}));var n=1e-6,s="undefined"!=typeof Float32Array?Float32Array:Array,i=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return a}));var n=r(3);function s(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function i(t,e,r=""){if(n.b.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}const o={};function a(t,e){o[t]||(o[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}},function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"g",(function(){return i})),r.d(e,"e",(function(){return o})),r.d(e,"h",(function(){return a})),r.d(e,"d",(function(){return c})),r.d(e,"c",(function(){return u})),r.d(e,"m",(function(){return h})),r.d(e,"l",(function(){return f})),r.d(e,"n",(function(){return l})),r.d(e,"i",(function(){return d})),r.d(e,"j",(function(){return m})),r.d(e,"k",(function(){return y})),r.d(e,"a",(function(){return g})),r.d(e,"f",(function(){return b}));var n=r(0);function s(){var t=new n.a(3);return n.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function i(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function o(t,e,r){var s=new n.a(3);return s[0]=t,s[1]=e,s[2]=r,s}function a(t,e){var r=e[0],n=e[1],s=e[2],i=r*r+n*n+s*s;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function c(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function u(t,e,r){var n=e[0],s=e[1],i=e[2],o=r[0],a=r[1],c=r[2];return t[0]=s*c-i*a,t[1]=i*o-n*c,t[2]=n*a-s*o,t}function h(t,e,r){var n=e[0],s=e[1],i=e[2],o=r[3]*n+r[7]*s+r[11]*i+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*s+r[8]*i+r[12])/o,t[1]=(r[1]*n+r[5]*s+r[9]*i+r[13])/o,t[2]=(r[2]*n+r[6]*s+r[10]*i+r[14])/o,t}function f(t,e,r){var n=e[0],s=e[1],i=e[2];return t[0]=n*r[0]+s*r[3]+i*r[6],t[1]=n*r[1]+s*r[4]+i*r[7],t[2]=n*r[2]+s*r[5]+i*r[8],t}function l(t,e,r){var n=r[0],s=r[1],i=r[2],o=r[3],a=e[0],c=e[1],u=e[2],h=s*u-i*c,f=i*a-n*u,l=n*c-s*a,d=s*l-i*f,m=i*h-n*l,y=n*f-s*h,g=2*o;return h*=g,f*=g,l*=g,d*=2,m*=2,y*=2,t[0]=a+h+d,t[1]=c+f+m,t[2]=u+l+y,t}function d(t,e,r,n){var s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[0],i[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),i[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function m(t,e,r,n){var s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),i[1]=s[1],i[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function y(t,e,r,n){var s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),i[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),i[2]=s[2],t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function g(t,e){var r=t[0],n=t[1],s=t[2],i=e[0],o=e[1],a=e[2],u=Math.sqrt(r*r+n*n+s*s)*Math.sqrt(i*i+o*o+a*a),h=u&&c(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}var p,b=i;p=s()},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"d",(function(){return o})),r.d(e,"e",(function(){return a})),r.d(e,"g",(function(){return u})),r.d(e,"f",(function(){return h})),r.d(e,"a",(function(){return f})),r.d(e,"c",(function(){return l}));r(6);const n=1/Math.PI*180,s=1/180*Math.PI,i={};function o(t,{precision:e=i.precision||4}={}){return t=function(t){return Math.round(t/i.EPSILON)*i.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function c(t,e,r){if(a(t)){r=r||((n=t).clone?n.clone():new Array(n.length));for(let n=0;n<r.length&&n<t.length;++n)r[n]=e(t[n],n,r);return r}var n;return e(t)}function u(t){return function(t,e){return c(t,t=>t*s,e)}(t)}function h(t){return function(t,e){return c(t,t=>t*n,e)}(t)}function f(t,e,r){return c(t,t=>Math.max(e,Math.min(r,t)))}function l(t,e,r){const n=i.EPSILON;r&&(i.EPSILON=r);try{if(t===e)return!0;if(a(t)&&a(e)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!l(t[r],e[r]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=i.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{i.EPSILON=n}}i.EPSILON=1e-12,i.debug=!1,i.precision=4,i.printTypes=!1,i.printDegrees=!1,i.printRowMajor=!0},function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"g",(function(){return i})),r.d(e,"c",(function(){return o})),r.d(e,"l",(function(){return a})),r.d(e,"a",(function(){return c})),r.d(e,"k",(function(){return u})),r.d(e,"h",(function(){return h})),r.d(e,"m",(function(){return f})),r.d(e,"j",(function(){return l})),r.d(e,"d",(function(){return d})),r.d(e,"i",(function(){return m})),r.d(e,"n",(function(){return y})),r.d(e,"o",(function(){return g})),r.d(e,"f",(function(){return p})),r.d(e,"e",(function(){return b}));var n=r(0);function s(t){var e=new n.a(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function i(t,e,r,s){var i=new n.a(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=s,i}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t,e,r,n,s){return t[0]=e,t[1]=r,t[2]=n,t[3]=s,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function u(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function h(t){var e=t[0],r=t[1],n=t[2],s=t[3];return Math.hypot(e,r,n,s)}function f(t){var e=t[0],r=t[1],n=t[2],s=t[3];return e*e+r*r+n*n+s*s}function l(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],o=r*r+n*n+s*s+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=s*o,t[3]=i*o,t}function d(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function m(t,e,r,n){var s=e[0],i=e[1],o=e[2],a=e[3];return t[0]=s+n*(r[0]-s),t[1]=i+n*(r[1]-i),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function y(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*s+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*s+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*s+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*s+r[11]*i+r[15]*o,t}function g(t,e,r){var n=e[0],s=e[1],i=e[2],o=r[0],a=r[1],c=r[2],u=r[3],h=u*n+a*i-c*s,f=u*s+c*n-o*i,l=u*i+o*s-a*n,d=-o*n-a*s-c*i;return t[0]=h*u+d*-o+f*-c-l*-a,t[1]=f*u+d*-a+l*-o-h*-c,t[2]=l*u+d*-c+h*-a-f*-o,t[3]=e[3],t}function p(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function b(t,e){var r=t[0],s=t[1],i=t[2],o=t[3],a=e[0],c=e[1],u=e[2],h=e[3];return Math.abs(r-a)<=n.b*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(s-c)<=n.b*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(i-u)<=n.b*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=n.b*Math.max(1,Math.abs(o),Math.abs(h))}var T,w;T=new n.a(4),n.a!=Float32Array&&(T[0]=0,T[1]=0,T[2]=0,T[3]=0),w=T},function(t,e,r){"use strict";r.d(e,"o",(function(){return s})),r.d(e,"d",(function(){return i})),r.d(e,"a",(function(){return o})),r.d(e,"f",(function(){return a})),r.d(e,"n",(function(){return c})),r.d(e,"m",(function(){return u})),r.d(e,"i",(function(){return h})),r.d(e,"j",(function(){return f})),r.d(e,"k",(function(){return l})),r.d(e,"l",(function(){return d})),r.d(e,"b",(function(){return m})),r.d(e,"c",(function(){return y})),r.d(e,"h",(function(){return g})),r.d(e,"g",(function(){return p})),r.d(e,"e",(function(){return b}));var n=r(0);function s(t,e){if(t===e){var r=e[1],n=e[2],s=e[3],i=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[11]=e[14],t[12]=s,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function i(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],y=e[13],g=e[14],p=e[15],b=r*a-n*o,T=r*c-s*o,w=r*u-i*o,E=n*c-s*a,O=n*u-i*a,_=s*u-i*c,A=h*y-f*m,I=h*g-l*m,v=h*p-d*m,S=f*g-l*y,N=f*p-d*y,x=l*p-d*g,M=b*x-T*N+w*S+E*v-O*I+_*A;return M?(M=1/M,t[0]=(a*x-c*N+u*S)*M,t[1]=(s*N-n*x-i*S)*M,t[2]=(y*_-g*O+p*E)*M,t[3]=(l*O-f*_-d*E)*M,t[4]=(c*v-o*x-u*I)*M,t[5]=(r*x-s*v+i*I)*M,t[6]=(g*w-m*_-p*T)*M,t[7]=(h*_-l*w+d*T)*M,t[8]=(o*N-a*v+u*A)*M,t[9]=(n*v-r*N-i*A)*M,t[10]=(m*O-y*w+p*b)*M,t[11]=(f*w-h*O-d*b)*M,t[12]=(a*I-o*S-c*A)*M,t[13]=(r*S-n*I+s*A)*M,t[14]=(y*T-m*E-g*b)*M,t[15]=(h*E-f*T+l*b)*M,t):null}function o(t){var e=t[0],r=t[1],n=t[2],s=t[3],i=t[4],o=t[5],a=t[6],c=t[7],u=t[8],h=t[9],f=t[10],l=t[11],d=t[12],m=t[13],y=t[14],g=t[15];return(e*o-r*i)*(f*g-l*y)-(e*a-n*i)*(h*g-l*m)+(e*c-s*i)*(h*y-f*m)+(r*a-n*o)*(u*g-l*d)-(r*c-s*o)*(u*y-f*d)+(n*c-s*a)*(u*m-h*d)}function a(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],h=e[7],f=e[8],l=e[9],d=e[10],m=e[11],y=e[12],g=e[13],p=e[14],b=e[15],T=r[0],w=r[1],E=r[2],O=r[3];return t[0]=T*n+w*a+E*f+O*y,t[1]=T*s+w*c+E*l+O*g,t[2]=T*i+w*u+E*d+O*p,t[3]=T*o+w*h+E*m+O*b,T=r[4],w=r[5],E=r[6],O=r[7],t[4]=T*n+w*a+E*f+O*y,t[5]=T*s+w*c+E*l+O*g,t[6]=T*i+w*u+E*d+O*p,t[7]=T*o+w*h+E*m+O*b,T=r[8],w=r[9],E=r[10],O=r[11],t[8]=T*n+w*a+E*f+O*y,t[9]=T*s+w*c+E*l+O*g,t[10]=T*i+w*u+E*d+O*p,t[11]=T*o+w*h+E*m+O*b,T=r[12],w=r[13],E=r[14],O=r[15],t[12]=T*n+w*a+E*f+O*y,t[13]=T*s+w*c+E*l+O*g,t[14]=T*i+w*u+E*d+O*p,t[15]=T*o+w*h+E*m+O*b,t}function c(t,e,r){var n,s,i,o,a,c,u,h,f,l,d,m,y=r[0],g=r[1],p=r[2];return e===t?(t[12]=e[0]*y+e[4]*g+e[8]*p+e[12],t[13]=e[1]*y+e[5]*g+e[9]*p+e[13],t[14]=e[2]*y+e[6]*g+e[10]*p+e[14],t[15]=e[3]*y+e[7]*g+e[11]*p+e[15]):(n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],h=e[7],f=e[8],l=e[9],d=e[10],m=e[11],t[0]=n,t[1]=s,t[2]=i,t[3]=o,t[4]=a,t[5]=c,t[6]=u,t[7]=h,t[8]=f,t[9]=l,t[10]=d,t[11]=m,t[12]=n*y+a*g+f*p+e[12],t[13]=s*y+c*g+l*p+e[13],t[14]=i*y+u*g+d*p+e[14],t[15]=o*y+h*g+m*p+e[15]),t}function u(t,e,r){var n=r[0],s=r[1],i=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function h(t,e,r,s){var i,o,a,c,u,h,f,l,d,m,y,g,p,b,T,w,E,O,_,A,I,v,S,N,x=s[0],M=s[1],L=s[2],j=Math.hypot(x,M,L);return j<n.b?null:(x*=j=1/j,M*=j,L*=j,i=Math.sin(r),a=1-(o=Math.cos(r)),c=e[0],u=e[1],h=e[2],f=e[3],l=e[4],d=e[5],m=e[6],y=e[7],g=e[8],p=e[9],b=e[10],T=e[11],w=x*x*a+o,E=M*x*a+L*i,O=L*x*a-M*i,_=x*M*a-L*i,A=M*M*a+o,I=L*M*a+x*i,v=x*L*a+M*i,S=M*L*a-x*i,N=L*L*a+o,t[0]=c*w+l*E+g*O,t[1]=u*w+d*E+p*O,t[2]=h*w+m*E+b*O,t[3]=f*w+y*E+T*O,t[4]=c*_+l*A+g*I,t[5]=u*_+d*A+p*I,t[6]=h*_+m*A+b*I,t[7]=f*_+y*A+T*I,t[8]=c*v+l*S+g*N,t[9]=u*v+d*S+p*N,t[10]=h*v+m*S+b*N,t[11]=f*v+y*S+T*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function f(t,e,r){var n=Math.sin(r),s=Math.cos(r),i=e[4],o=e[5],a=e[6],c=e[7],u=e[8],h=e[9],f=e[10],l=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*s+u*n,t[5]=o*s+h*n,t[6]=a*s+f*n,t[7]=c*s+l*n,t[8]=u*s-i*n,t[9]=h*s-o*n,t[10]=f*s-a*n,t[11]=l*s-c*n,t}function l(t,e,r){var n=Math.sin(r),s=Math.cos(r),i=e[0],o=e[1],a=e[2],c=e[3],u=e[8],h=e[9],f=e[10],l=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*s-u*n,t[1]=o*s-h*n,t[2]=a*s-f*n,t[3]=c*s-l*n,t[8]=i*n+u*s,t[9]=o*n+h*s,t[10]=a*n+f*s,t[11]=c*n+l*s,t}function d(t,e,r){var n=Math.sin(r),s=Math.cos(r),i=e[0],o=e[1],a=e[2],c=e[3],u=e[4],h=e[5],f=e[6],l=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*s+u*n,t[1]=o*s+h*n,t[2]=a*s+f*n,t[3]=c*s+l*n,t[4]=u*s-i*n,t[5]=h*s-o*n,t[6]=f*s-a*n,t[7]=l*s-c*n,t}function m(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],o=r+r,a=n+n,c=s+s,u=r*o,h=n*o,f=n*a,l=s*o,d=s*a,m=s*c,y=i*o,g=i*a,p=i*c;return t[0]=1-f-m,t[1]=h+p,t[2]=l-g,t[3]=0,t[4]=h-p,t[5]=1-u-m,t[6]=d+y,t[7]=0,t[8]=l+g,t[9]=d-y,t[10]=1-u-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function y(t,e,r,n,s,i,o){var a=1/(r-e),c=1/(s-n),u=1/(i-o);return t[0]=2*i*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*c,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(s+n)*c,t[10]=(o+i)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*u,t[15]=0,t}function g(t,e,r,n,s){var i,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=s&&s!==1/0?(i=1/(n-s),t[10]=(s+n)*i,t[14]=2*s*n*i):(t[10]=-1,t[14]=-2*n),t}function p(t,e,r,n,s,i,o){var a=1/(e-r),c=1/(n-s),u=1/(i-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(s+n)*c,t[14]=(o+i)*u,t[15]=1,t}function b(t,e,r,s){var i,o,a,c,u,h,f,l,d,m,y=e[0],g=e[1],p=e[2],b=s[0],T=s[1],w=s[2],E=r[0],O=r[1],_=r[2];return Math.abs(y-E)<n.b&&Math.abs(g-O)<n.b&&Math.abs(p-_)<n.b?function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(t):(f=y-E,l=g-O,d=p-_,i=T*(d*=m=1/Math.hypot(f,l,d))-w*(l*=m),o=w*(f*=m)-b*d,a=b*l-T*f,(m=Math.hypot(i,o,a))?(i*=m=1/m,o*=m,a*=m):(i=0,o=0,a=0),c=l*a-d*o,u=d*i-f*a,h=f*o-l*i,(m=Math.hypot(c,u,h))?(c*=m=1/m,u*=m,h*=m):(c=0,u=0,h=0),t[0]=i,t[1]=c,t[2]=f,t[3]=0,t[4]=o,t[5]=u,t[6]=l,t[7]=0,t[8]=a,t[9]=h,t[10]=d,t[11]=0,t[12]=-(i*y+o*g+a*p),t[13]=-(c*y+u*g+h*p),t[14]=-(f*y+l*g+d*p),t[15]=1,t)}},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"i",(function(){return i})),r.d(e,"d",(function(){return o})),r.d(e,"b",(function(){return a})),r.d(e,"e",(function(){return c})),r.d(e,"h",(function(){return u})),r.d(e,"f",(function(){return h})),r.d(e,"g",(function(){return f})),r.d(e,"c",(function(){return l}));var n=r(0);function s(){var t=new n.a(9);return n.a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function i(t,e){if(t===e){var r=e[1],n=e[2],s=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=s}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function o(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],h=e[8],f=h*o-a*u,l=-h*i+a*c,d=u*i-o*c,m=r*f+n*l+s*d;return m?(m=1/m,t[0]=f*m,t[1]=(-h*n+s*u)*m,t[2]=(a*n-s*o)*m,t[3]=l*m,t[4]=(h*r-s*c)*m,t[5]=(-a*r+s*i)*m,t[6]=d*m,t[7]=(-u*r+n*c)*m,t[8]=(o*r-n*i)*m,t):null}function a(t){var e=t[0],r=t[1],n=t[2],s=t[3],i=t[4],o=t[5],a=t[6],c=t[7],u=t[8];return e*(u*i-o*c)+r*(-u*s+o*a)+n*(c*s-i*a)}function c(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],h=e[7],f=e[8],l=r[0],d=r[1],m=r[2],y=r[3],g=r[4],p=r[5],b=r[6],T=r[7],w=r[8];return t[0]=l*n+d*o+m*u,t[1]=l*s+d*a+m*h,t[2]=l*i+d*c+m*f,t[3]=y*n+g*o+p*u,t[4]=y*s+g*a+p*h,t[5]=y*i+g*c+p*f,t[6]=b*n+T*o+w*u,t[7]=b*s+T*a+w*h,t[8]=b*i+T*c+w*f,t}function u(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],h=e[7],f=e[8],l=r[0],d=r[1];return t[0]=n,t[1]=s,t[2]=i,t[3]=o,t[4]=a,t[5]=c,t[6]=l*n+d*o+u,t[7]=l*s+d*a+h,t[8]=l*i+d*c+f,t}function h(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],h=e[7],f=e[8],l=Math.sin(r),d=Math.cos(r);return t[0]=d*n+l*o,t[1]=d*s+l*a,t[2]=d*i+l*c,t[3]=d*o-l*n,t[4]=d*a-l*s,t[5]=d*c-l*i,t[6]=u,t[7]=h,t[8]=f,t}function f(t,e,r){var n=r[0],s=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=s*e[3],t[4]=s*e[4],t[5]=s*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function l(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],o=r+r,a=n+n,c=s+s,u=r*o,h=n*o,f=n*a,l=s*o,d=s*a,m=s*c,y=i*o,g=i*a,p=i*c;return t[0]=1-f-m,t[3]=h-p,t[6]=l+g,t[1]=h+p,t[4]=1-u-m,t[7]=d-y,t[2]=l-g,t[5]=d+y,t[8]=1-u-f,t}},function(t,e,r){"use strict";function n(t,e,r){const n=e[0],s=e[1],i=r[3]*n+r[7]*s||1;return t[0]=(r[0]*n+r[4]*s)/i,t[1]=(r[1]*n+r[5]*s)/i,t}function s(t,e,r){const n=e[0],s=e[1],i=e[2],o=r[3]*n+r[7]*s+r[11]*i||1;return t[0]=(r[0]*n+r[4]*s+r[8]*i)/o,t[1]=(r[1]*n+r[5]*s+r[9]*i)/o,t[2]=(r[2]*n+r[6]*s+r[10]*i)/o,t}function i(t,e,r){const n=e[0],s=e[1];return t[0]=r[0]*n+r[2]*s,t[1]=r[1]*n+r[3]*s,t[2]=e[2],t}function o(t,e,r){const n=e[0],s=e[1],i=e[2];return t[0]=r[0]*n+r[3]*s+r[6]*i,t[1]=r[1]*n+r[4]*s+r[7]*i,t[2]=r[2]*n+r[5]*s+r[8]*i,t[3]=e[3],t}r.d(e,"a",(function(){return n})),r.d(e,"c",(function(){return s})),r.d(e,"b",(function(){return i})),r.d(e,"d",(function(){return o}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return o})),r.d(e,"d",(function(){return a}));var n=r(0);function s(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[2]*s,t[1]=r[1]*n+r[3]*s,t}function i(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[2]*s+r[4],t[1]=r[1]*n+r[3]*s+r[5],t}function o(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[3]*s+r[6],t[1]=r[1]*n+r[4]*s+r[7],t}function a(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[4]*s+r[12],t[1]=r[1]*n+r[5]*s+r[13],t}var c,u;c=new n.a(2),n.a!=Float32Array&&(c[0]=0,c[1]=0),u=c},,function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return a}));const s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},i=s.global||s.self||s.window||{},o="object"!=typeof n||"[object process]"!==String(n)||n.browser,a="function"==typeof importScripts,c=("undefined"!=typeof window&&window.orientation,void 0!==n&&n.version&&/v([0-9]*)/.exec(n.version));c&&parseFloat(c[1])}).call(this,r(22),r(26))},,,function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(3),s=r(6);class i extends(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array)){get ELEMENTS(){return Object(s.a)(!1),0}clone(){return(new this.constructor).copy(this)}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}fromArray(t,e=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=t[r+e];return this.check()}to(t){return t===this?this:Object(n.e)(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toArray(t=[],e=0){for(let r=0;r<this.ELEMENTS;++r)t[e+r]=this[r];return t}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(n.b)}formatString(t){let e="";for(let r=0;r<this.ELEMENTS;++r)e+=(r>0?", ":"")+Object(n.d)(this[r],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!Object(n.c)(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,r){void 0===r&&(r=e,e=t,t=this);for(let n=0;n<this.ELEMENTS;++n){const s=t[n];this[n]=s+r*(e[n]-s)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t[r]),e[r]);return this.check()}add(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]+=e[t];return this.check()}subtract(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]-=e[t];return this.check()}scale(t){if(Array.isArray(t))return this.multiply(t);for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.scale(1/t)}clampScalar(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t),e);return this.check()}multiplyByScalar(t){return this.scale(t)}get elements(){return this}check(){if(n.b.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}}},function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o}));const s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},i=s.global||s.self||s.window,o="object"!=typeof n||"[object process]"!==String(n)||n.browser,a=void 0!==n&&n.version&&/v([0-9]*)/.exec(n.version);a&&parseFloat(a[1])}).call(this,r(22),r(26))},function(t,e){},function(t,e){},,function(t,e){},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(14),s=r(1),i=r(6);class o extends n.a{get ELEMENTS(){return Object(i.a)(!1),0}copy(t){return Object(i.a)(!1),this}get x(){return this[0]}set x(t){this[0]=Object(s.a)(t)}get y(){return this[1]}set y(t){this[1]=Object(s.a)(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let r=0;r<this.ELEMENTS;++r){const n=this[r]-t[r];e+=n*n}return Object(s.a)(e)}dot(t){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*t[r];return Object(s.a)(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e[t];return this.check()}divide(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Object(i.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),Object(s.a)(this[t])}setComponent(t,e){return Object(i.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(14),s=r(1),i=r(3),o=r(6);class a extends n.a{get ELEMENTS(){return Object(o.a)(!1),0}get RANK(){return Object(o.a)(!1),0}toString(){let t="[";if(i.b.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let r=0;r<this.RANK;++r)t+=" ".concat(this[r*this.RANK+e])}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=" ".concat(this[e])}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,r){return this[e*this.RANK+t]=Object(s.a)(r),this}getColumn(t,e=new Array(this.RANK).fill(-0)){const r=t*this.RANK;for(let t=0;t<this.RANK;++t)e[t]=this[r+t];return e}setColumn(t,e){const r=t*this.RANK;for(let t=0;t<this.RANK;++t)this[r+t]=e[t];return this}}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},,,function(t,e){},function(t,e){var r,n,s=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var c,u=[],h=!1,f=-1;function l(){h&&c&&(h=!1,c.length?u=c.concat(u):f=-1,u.length&&d())}function d(){if(!h){var t=a(l);h=!0;for(var e=u.length;e;){for(c=u,u=[];++f<e;)c&&c[f].run();f=-1,e=u.length}c=null,h=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function y(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new m(t,e)),1!==u.length||h||a(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=y,s.addListener=y,s.once=y,s.off=y,s.removeListener=y,s.removeAllListeners=y,s.emit=y,s.prependListener=y,s.prependOnceListener=y,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(t,e,r){(function(e){const n=r(36),s="undefined"==typeof window?e:window;s.loaders=s.loaders||{},t.exports=Object.assign(s.loaders,n)}).call(this,r(22))},,,,,,,,,function(t,e,r){"use strict";r.r(e),r.d(e,"Tiles3DLoader",(function(){return Wr})),r.d(e,"CesiumIonLoader",(function(){return an})),r.d(e,"Tile3DWriter",(function(){return gn})),r.d(e,"Tile3DFeatureTable",(function(){return yt})),r.d(e,"Tile3DBatchTable",(function(){return vt})),r.d(e,"TILE3D_TYPE",(function(){return p})),r.d(e,"_getIonTilesetMetadata",(function(){return on}));var n={};r.r(n),r.d(n,"dirname",(function(){return c})),r.d(n,"join",(function(){return u}));var s={};r.r(s),r.d(s,"decode",(function(){return Pe})),r.d(s,"encode",(function(){return Be}));var i={};r.r(i),r.d(i,"decode",(function(){return ke})),r.d(i,"encode",(function(){return Fe}));var o={};r.r(o),r.d(o,"decode",(function(){return ze})),r.d(o,"encode",(function(){return Ve}));var a={};function c(t){const e=t&&t.lastIndexOf("/");return e>=0?t.substr(0,e):""}function u(...t){return(t=t.map((e,r)=>(r&&(e=e.replace(new RegExp("^/"),"")),r!==t.length-1&&(e=e.replace(new RegExp("/$"),"")),e))).join("/")}r.r(a),r.d(a,"decode",(function(){return Ge})),r.d(a,"encode",(function(){return qe}));r(19),r(25);const h=1,f=2,l="empty",d="scenegraph",m="pointcloud",y="TILES3D",g="geometricError",p={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect"},b=(Object.keys(p),{BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]});function T(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function w(t,e,r){T(t instanceof ArrayBuffer);const n=new TextDecoder("utf8"),s=new Uint8Array(t,e,r);return n.decode(s)}const E={name:"Draco",id:"draco",module:"draco",version:"3.0.13",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"==typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function O(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class _{constructor(t,e){O(this,"fields",void 0),O(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const r of t)e[r.name]&&console.warn("Schema: duplicated field name",r.name,r),e[r.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(...t){const e=Object.create(null);for(const r of t)e[r]=!0;const r=this.fields.filter(t=>e[t.name]);return new _(r,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new _(e,this.metadata)}assign(t){let e,r=this.metadata;if(t instanceof _){const n=t;e=n.fields,r=A(A(new Map,this.metadata),n.metadata)}else e=t;const n=Object.create(null);for(const t of this.fields)n[t.name]=t;for(const t of e)n[t.name]=t;const s=Object.values(n);return new _(s,r)}}function A(t,e){return new Map([...t||new Map,...e||new Map])}let I,v,S,N,x,M,L,j;function R(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(I||(I={}));class U{static isNull(t){return t&&t.typeId===I.Null}static isInt(t){return t&&t.typeId===I.Int}static isFloat(t){return t&&t.typeId===I.Float}static isBinary(t){return t&&t.typeId===I.Binary}static isUtf8(t){return t&&t.typeId===I.Utf8}static isBool(t){return t&&t.typeId===I.Bool}static isDecimal(t){return t&&t.typeId===I.Decimal}static isDate(t){return t&&t.typeId===I.Date}static isTime(t){return t&&t.typeId===I.Time}static isTimestamp(t){return t&&t.typeId===I.Timestamp}static isInterval(t){return t&&t.typeId===I.Interval}static isList(t){return t&&t.typeId===I.List}static isStruct(t){return t&&t.typeId===I.Struct}static isUnion(t){return t&&t.typeId===I.Union}static isFixedSizeBinary(t){return t&&t.typeId===I.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===I.FixedSizeList}static isMap(t){return t&&t.typeId===I.Map}static isDictionary(t){return t&&t.typeId===I.Dictionary}get typeId(){return I.NONE}compareTo(t){return this===t}}Symbol.toStringTag;Symbol.toStringTag;v=Symbol.toStringTag;class P extends U{constructor(t,e){super(),R(this,"isSigned",void 0),R(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return I.Int}get[v](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class B extends P{constructor(){super(!0,8)}}class D extends P{constructor(){super(!0,16)}}class C extends P{constructor(){super(!0,32)}}class k extends P{constructor(){super(!1,8)}}class F extends P{constructor(){super(!1,16)}}class z extends P{constructor(){super(!1,32)}}const V=32,G=64;S=Symbol.toStringTag;class q extends U{constructor(t){super(),R(this,"precision",void 0),this.precision=t}get typeId(){return I.Float}get[S](){return"Float"}toString(){return"Float"+this.precision}}class H extends q{constructor(){super(V)}}class W extends q{constructor(){super(G)}}Symbol.toStringTag;Symbol.toStringTag;N=Symbol.toStringTag;x=Symbol.toStringTag;M=Symbol.toStringTag;L=Symbol.toStringTag;j=Symbol.toStringTag;class $ extends U{constructor(t,e){super(),R(this,"listSize",void 0),R(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return I.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[j](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}function K(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Q{constructor(t,e,r=!1,n=new Map){K(this,"name",void 0),K(this,"type",void 0),K(this,"nullable",void 0),K(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=r,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new Q(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?", metadata: "+this.metadata:""}`}}function Y(t,e,r){const n=r?Z(r.metadata):void 0,s=function(t){switch(t.constructor){case Int8Array:return new B;case Uint8Array:return new k;case Int16Array:return new D;case Uint16Array:return new F;case Int32Array:return new C;case Uint32Array:return new z;case Float32Array:return new H;case Float64Array:return new W;default:throw new Error("array type not supported")}}(e.value);return new Q(t,new $(e.size,new Q("value",s)),!1,n)}function Z(t){const e=new Map;for(const r in t)e.set(r+".string",JSON.stringify(t[r]));return e}function J(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const X={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},tt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class et{constructor(t){J(this,"draco",void 0),J(this,"decoder",void 0),J(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,e={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const n=this.decoder.GetEncodedGeometryType(r),s=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(n){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(r,s);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(r,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!s.ptr){const e="DRACO decompression failed: "+t.error_msg();throw new Error(e)}const i=this._getDracoLoaderData(s,n,e),o=this._getMeshData(s,i,e),a=function(t){let e=1/0,r=1/0,n=1/0,s=-1/0,i=-1/0,o=-1/0;const a=t.POSITION?t.POSITION.value:[],c=a&&a.length;for(let t=0;t<c;t+=3){const c=a[t],u=a[t+1],h=a[t+2];e=c<e?c:e,r=u<r?u:r,n=h<n?h:n,s=c>s?c:s,i=u>i?u:i,o=h>o?h:o}return[[e,r,n],[s,i,o]]}(o.attributes),c=function(t,e,r){const n=Z(e.metadata),s=[],i=function(t){const e={};for(const r in t){const n=t[r];e[n.name||"undefined"]=n}return e}(e.attributes);for(const e in t){const r=Y(e,t[e],i[e]);s.push(r)}if(r){const t=Y("indices",r);s.push(t)}return new _(s,n)}(o.attributes,i,o.indices);return{loader:"draco",loaderData:i,header:{vertexCount:s.num_points(),boundingBox:a},...o,schema:c}}finally{this.draco.destroy(r),s&&this.draco.destroy(s)}}_getDracoLoaderData(t,e,r){const n=this._getTopLevelMetadata(t),s=this._getDracoAttributes(t,r);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:n,attributes:s}}_getDracoAttributes(t,e){const r={};for(let n=0;n<t.num_attributes();n++){const s=this.decoder.GetAttribute(t,n),i=this._getAttributeMetadata(t,n);r[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:n,metadata:i};const o=this._getQuantizationTransform(s,e);o&&(r[s.unique_id()].quantization_transform=o);const a=this._getOctahedronTransform(s,e);a&&(r[s.unique_id()].octahedron_transform=a)}return r}_getMeshData(t,e,r){const n=this._getMeshAttributes(e,t,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(t,e,r){const n={};for(const s of Object.values(t.attributes)){const t=this._deduceAttributeName(s,r);s.name=t;const{value:i,size:o}=this._getAttributeValues(e,s);n[t]={value:i,size:o,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}return n}_getTriangleListIndices(t){const e=3*t.num_faces(),r=4*e,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(t,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,e).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(t){const e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){const e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){const r=tt[e.data_type],n=e.num_components,s=t.num_points()*n,i=s*r.BYTES_PER_ELEMENT,o=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}(this.draco,r);let a;const c=this.draco._malloc(i);try{const n=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,n,o,i,c),a=new r(this.draco.HEAPF32.buffer,c,s).slice()}finally{this.draco._free(c)}return{value:a,size:n}}_deduceAttributeName(t,e){const r=t.unique_id;for(const[t,n]of Object.entries(e.extraAttributes||{}))if(n===r)return t;const n=t.attribute_type;for(const t in X){if(this.draco[t]===n)return X[t]}const s=e.attributeNameEntry||"name";return t.metadata[s]?t.metadata[s].string:"CUSTOM_ATTRIBUTE_"+r}_getTopLevelMetadata(t){const e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){const r=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(r)}_getDracoMetadata(t){if(!t||!t.ptr)return{};const e={},r=this.metadataQuerier.NumEntries(t);for(let n=0;n<r;n++){const r=this.metadataQuerier.GetEntryName(t,n);e[r]=this._getDracoMetadataField(t,r)}return e}_getDracoMetadataField(t,e){const r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,r);const n=function(t){const e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:n}}finally{this.draco.destroy(r)}}_disableAttributeTransforms(t){const{quantizedAttributes:e=[],octahedronAttributes:r=[]}=t,n=[...e,...r];for(const t of n)this.decoder.SkipAttributeTransform(this.draco[t])}_getQuantizationTransform(t,e){const{quantizedAttributes:r=[]}=e,n=t.attribute_type();if(r.map(t=>this.decoder[t]).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map(t=>e.min_value(t))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:r=[]}=e,n=t.attribute_type();if(r.map(t=>this.decoder[t]).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}var rt=r(11),nt=r(17);const st={};async function it(t,e=null,r={}){return e&&(t=function(t,e,r){if(t.startsWith("http"))return t;const n=r.modules||{};if(n[t])return n[t];if(!rt.b)return`modules/${e}/dist/libs/${t}`;if(r.CDN)return function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(r.CDN.startsWith("http")),`${r.CDN}/${e}@3.0.13/dist/libs/${t}`;if(rt.c)return"../src/libs/"+t;return`modules/${e}/src/libs/${t}`}(t,e,r)),st[t]=st[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!rt.b)return nt.requireFromFile&&await nt.requireFromFile(t);if(rt.c)return importScripts(t);const e=await fetch(t);return function(t,e){if(!rt.b)return nt.requireFromString&&nt.requireFromString(t,e);if(rt.c)return eval.call(rt.a,t),null;const r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch(e){r.text=t}return document.body.appendChild(r),null}(await e.text(),t)}(t),await st[t]}let ot;async function at(t){const e=t.modules||{};return ot=e.draco3d?ot||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):ot||async function(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await it("https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js","draco",t);break;case"wasm":default:[e,r]=await Promise.all([await it("https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js","draco",t),await it("https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm","draco",t)])}return e=e||globalThis.DracoDecoderModule,await function(t,e){const r={};e&&(r.wasmBinary=e);return new Promise(e=>{t({...r,onModuleLoaded:t=>e({draco:t})})})}(e,r)}(t),await ot}const ct={...E,parse:async function(t,e){const{draco:r}=await at(e),n=new et(r);try{return n.parseSync(t,null==e?void 0:e.draco)}finally{n.destroy()}}};const ut={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ht={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...ut};var ft=r(42);const lt={[ut.DOUBLE]:Float64Array,[ut.FLOAT]:Float32Array,[ut.UNSIGNED_SHORT]:Uint16Array,[ut.UNSIGNED_INT]:Uint32Array,[ut.UNSIGNED_BYTE]:Uint8Array,[ut.BYTE]:Int8Array,[ut.SHORT]:Int16Array,[ut.INT]:Int32Array},dt={DOUBLE:ut.DOUBLE,FLOAT:ut.FLOAT,UNSIGNED_SHORT:ut.UNSIGNED_SHORT,UNSIGNED_INT:ut.UNSIGNED_INT,UNSIGNED_BYTE:ut.UNSIGNED_BYTE,BYTE:ut.BYTE,SHORT:ut.SHORT,INT:ut.INT};class mt{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(const e in lt){if(lt[e]===t)return e}throw new Error("Failed to convert GL type")}static fromName(t){const e=dt[t];if(!e)throw new Error("Failed to convert GL type");return e}static getArrayType(t){switch(t){case ut.UNSIGNED_SHORT_5_6_5:case ut.UNSIGNED_SHORT_4_4_4_4:case ut.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const e=lt[t];if(!e)throw new Error("Failed to convert GL type");return e}}static getByteSize(t){return mt.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(mt.getArrayType(t))}static createTypedArray(t,e,r=0,n){void 0===n&&(n=(e.byteLength-r)/mt.getByteSize(t));return new(mt.getArrayType(t))(e,r,n)}}class yt{constructor(t,e){this.json=t,this.buffer=e,this.featuresLength=0,this._cachedTypedArrays={}}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,e=ht.UNSIGNED_INT,r=1){const n=this.json[t];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(t,e,r,1,n.byteOffset):n}getPropertyArray(t,e,r){const n=this.json[t];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(e=mt.fromName(n.componentType)),this._getTypedArrayFromBinary(t,e,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(t,e,n)}getProperty(t,e,r,n,s){const i=this.json[t];if(!i)return i;const o=this.getPropertyArray(t,e,r);if(1===r)return o[n];for(let t=0;t<r;++t)s[t]=o[r*n+t];return s}_getTypedArrayFromBinary(t,e,r,n,s){const i=this._cachedTypedArrays;let o=i[t];return o||(o=mt.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+s,n*r),i[t]=o),o}_getTypedArrayFromArray(t,e,r){const n=this._cachedTypedArrays;let s=n[t];return s||(s=mt.createTypedArray(e,r),n[t]=s),s}}const gt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},pt={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},bt={SCALAR:(t,e,r)=>{e[r]=t},VEC2:(t,e,r)=>{e[2*r+0]=t[0],e[2*r+1]=t[1]},VEC3:(t,e,r)=>{e[3*r+0]=t[0],e[3*r+1]=t[1],e[3*r+2]=t[2]},VEC4:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT2:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT3:(t,e,r)=>{e[9*r+0]=t[0],e[9*r+1]=t[1],e[9*r+2]=t[2],e[9*r+3]=t[3],e[9*r+4]=t[4],e[9*r+5]=t[5],e[9*r+6]=t[6],e[9*r+7]=t[7],e[9*r+8]=t[8],e[9*r+9]=t[9]},MAT4:(t,e,r)=>{e[16*r+0]=t[0],e[16*r+1]=t[1],e[16*r+2]=t[2],e[16*r+3]=t[3],e[16*r+4]=t[4],e[16*r+5]=t[5],e[16*r+6]=t[6],e[16*r+7]=t[7],e[16*r+8]=t[8],e[16*r+9]=t[9],e[16*r+10]=t[10],e[16*r+11]=t[11],e[16*r+12]=t[12],e[16*r+13]=t[13],e[16*r+14]=t[14],e[16*r+15]=t[15]}};const Tt=t=>void 0!==t;function wt(t,e,r){if(!e)return null;let n=t.getExtension("3DTILES_batch_table_hierarchy");const s=e.HIERARCHY;return s&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=s,n=s),n?function(t,e){let r,n,s;const i=t.instancesLength,o=t.classes;let a,c=t.classIds,u=t.parentCounts,h=t.parentIds,f=i;Tt(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,s=getBinaryAccessor(c),c=s.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,i));if(Tt(u))for(Tt(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,s=getBinaryAccessor(u),u=s.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,i)),a=new Uint16Array(i),f=0,r=0;r<i;++r)a[r]=f,f+=u[r];Tt(h)&&Tt(h.byteOffset)&&(h.componentType=defaultValue(h.componentType,GL.UNSIGNED_SHORT),h.type=AttributeType.SCALAR,s=getBinaryAccessor(h),h=s.createArrayBufferView(e.buffer,e.byteOffset+h.byteOffset,f));const l=o.length;for(r=0;r<l;++r){const t=o[r].length,n=o[r].instances,s=getBinaryProperties(t,n,e);o[r].instances=combine(s,n)}const d=new Array(l).fill(0),m=new Uint16Array(i);for(r=0;r<i;++r)n=c[r],m[r]=d[n],++d[n];const y={classes:o,classIds:c,classIndexes:m,parentCounts:u,parentIndexes:a,parentIds:h};return function(t){const e=t.classIds.length;for(let r=0;r<e;++r)Ot(t,r,stack)}(y),y}(n,r):null}function Et(t,e,r){if(!t)return;const n=t.parentCounts;return t.parentIds?r(t,e):n>0?function(t,e,r){const n=t.classIds,s=t.parentCounts,i=t.parentIds,o=t.parentIndexes,a=n.length,c=scratchVisited;c.length=Math.max(c.length,a);const u=++marker,h=scratchStack;h.length=0,h.push(e);for(;h.length>0;){if(e=h.pop(),c[e]===u)continue;c[e]=u;const n=r(t,e);if(Tt(n))return n;const a=s[e],f=o[e];for(let t=0;t<a;++t){const r=i[f+t];r!==e&&h.push(r)}}return null}(t,e,r):function(t,e,r){let n=!0;for(;n;){const s=r(t,e);if(Tt(s))return s;const i=t.parentIds[e];n=i!==e,e=i}throw new Error("traverseHierarchySingleParent")}(t,e,r)}function Ot(t,e,r){const n=t.parentCounts,s=t.parentIds,i=t.parentIndexes,o=t.classIds.length;if(!Tt(s))return;assert(e<o,`Parent index ${e} exceeds the total number of instances: ${o}`),assert(-1===r.indexOf(e),"Circular dependency detected in the batch table hierarchy."),r.push(e);const a=Tt(n)?n[e]:1,c=Tt(n)?i[e]:e;for(let n=0;n<a;++n){const i=s[c+n];i!==e&&Ot(t,i,r)}r.pop(e)}function _t(t){return null!=t}const At=(t,e)=>t,It={HIERARCHY:!0,extensions:!0,extras:!0};class vt{constructor(t,e,r,n={}){var s;T(r>=0),this.json=t||{},this.binary=e,this.featureCount=r,this._extensions=(null===(s=this.json)||void 0===s?void 0:s.extensions)||{},this._properties={};for(const t in this.json)It[t]||(this._properties[t]=this.json[t]);this._binaryProperties=this._initializeBinaryProperties(),n["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=wt(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,e){if(this._checkBatchId(t),T("string"==typeof e,e),this._hierarchy){return _t(Et(this._hierarchy,t,(t,r)=>{const n=t.classIds[r];return t.classes[n].name===e}))}return!1}isExactClass(t,e){return T("string"==typeof e,e),this.getExactClassName(t)===e}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){const e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}hasProperty(t,e){return this._checkBatchId(t),T("string"==typeof e,e),_t(this._properties[e])||this._hasPropertyInHierarchy(t,e)}getPropertyNames(t,e){this._checkBatchId(t),(e=_t(e)?e:[]).length=0;const r=Object.keys(this._properties);return e.push(...r),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}getProperty(t,e){if(this._checkBatchId(t),T("string"==typeof e,e),this._binaryProperties){const r=this._binaryProperties[e];if(_t(r))return this._getBinaryProperty(r,t)}const r=this._properties[e];if(_t(r))return At(r[t]);if(this._hierarchy){const r=this._getHierarchyProperty(t,e);if(_t(r))return r}}setProperty(t,e,r){const n=this.featureCount;if(this._checkBatchId(t),T("string"==typeof e,e),this._binaryProperties){const n=this._binaryProperties[e];if(n)return void this._setBinaryProperty(n,t,r)}if(this._hierarchy&&this._setHierarchyProperty(this,t,e,r))return;let s=this._properties[e];_t(s)||(this._properties[e]=new Array(n),s=this._properties[e]),s[t]=At(r)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,e){return t.unpack(t.typedArray,e)}_setBinaryProperty(t,e,r){t.pack(r,t.typedArray,e)}_initializeBinaryProperties(){let t=null;for(const e in this._properties){const r=this._properties[e],n=this._initializeBinaryProperty(e,r);n&&(t=t||{},t[e]=n)}return t}_initializeBinaryProperty(t,e){if("byteOffset"in e){const r=e;T(this.binary,`Property ${t} requires a batch table binary.`),T(r.type,`Property ${t} requires a type.`);const n=function(t,e,r,n){const{componentType:s}=t;T(t.componentType);const i="string"==typeof s?mt.fromName(s):s,o=gt[t.type],a=pt[t.type],c=bt[t.type];return r+=t.byteOffset,{values:mt.createTypedArray(i,e,r,o*n),type:i,size:o,unpacker:a,packer:c}}(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}_hasPropertyInHierarchy(t,e){if(!this._hierarchy)return!1;const r=Et(this._hierarchy,t,(t,r)=>{const n=t.classIds[r];return _t(t.classes[n].instances[e])});return _t(r)}_getPropertyNamesInHierarchy(t,e){Et(this._hierarchy,t,(t,r)=>{const n=t.classIds[r],s=t.classes[n].instances;for(const t in s)s.hasOwnProperty(t)&&-1===e.indexOf(t)&&e.push(t)})}_getHierarchyProperty(t,e){return Et(this._hierarchy,t,(t,r)=>{const n=t.classIds[r],s=t.classes[n],i=t.classIndexes[r],o=s.instances[e];return _t(o)?_t(o.typedArray)?this._getBinaryProperty(o,i):At(o[i]):null})}_setHierarchyProperty(t,e,r,n){const s=Et(this._hierarchy,e,(t,s)=>{const i=t.classIds[s],o=t.classes[i],a=t.classIndexes[s],c=o.instances[r];return!!_t(c)&&(T(s===e,`Inherited property "${r}" is read-only.`),_t(c.typedArray)?this._setBinaryProperty(c,a,n):c[a]=At(n),!0)});return _t(s)}}function St(t,e,r=0){const n=new DataView(e);if(t.magic=n.getUint32(r,!0),r+=4,t.version=n.getUint32(r,!0),r+=4,t.byteLength=n.getUint32(r,!0),r+=4,1!==t.version)throw new Error(`3D Tile Version ${t.version} not supported`);return r}function Nt(t,e,r){const n=new DataView(e);let s;t.header=t.header||{};let i=n.getUint32(r,!0);r+=4;let o=n.getUint32(r,!0);r+=4;let a=n.getUint32(r,!0);r+=4;let c=n.getUint32(r,!0);return r+=4,a>=570425344?(r-=8,s=i,a=o,c=0,i=0,o=0,console.warn("b3dm tile in legacy format.")):c>=570425344&&(r-=4,s=a,a=i,c=o,i=0,o=0,console.warn("b3dm tile in legacy format.")),t.header.featureTableJsonByteLength=i,t.header.featureTableBinaryByteLength=o,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=c,t.header.batchLength=s,r}function xt(t,e,r,n){return r=function(t,e,r,n){const{featureTableJsonByteLength:s,featureTableBinaryByteLength:i,batchLength:o}=t.header;if(t.featureTableJson={BATCH_LENGTH:o||0},s>0){const n=w(e,r,s);t.featureTableJson=JSON.parse(n)}return r+=s,t.featureTableBinary=new Uint8Array(e,r,i),r+=i}(t,e,r),r=function(t,e,r,n){const{batchTableJsonByteLength:s,batchTableBinaryByteLength:i}=t.header;if(s>0){const n=w(e,r,s);t.batchTableJson=JSON.parse(n),r+=s,i>0&&(t.batchTableBinary=new Uint8Array(e,r,i),t.batchTableBinary=new Uint8Array(t.batchTableBinary),r+=i)}return r}(t,e,r)}function Mt(t,e=[0,0,0]){const r=t>>11&31,n=t>>5&63,s=31&t;return e[0]=r<<3,e[1]=n<<2,e[2]=s<<3,e}function Lt(t,e,r){if(!(e||t&&t.batchIds&&r))return null;const{batchIds:n,isRGB565:s,pointCount:i}=t;if(n&&r){const t=new Uint8ClampedArray(3*i);for(let e=0;e<i;e++){const s=n[e],i=r.getProperty(s,"dimensions").map(t=>255*t);t[3*e]=i[0],t[3*e+1]=i[1],t[3*e+2]=i[2]}return{type:ht.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}if(s){const t=new Uint8ClampedArray(3*i);for(let r=0;r<i;r++){const n=Mt(e[r]);t[3*r]=n[0],t[3*r+1]=n[1],t[3*r+2]=n[2]}return{type:ht.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}return e&&e.length===3*i?{type:ht.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:ht.UNSIGNED_BYTE,value:e,size:4,normalized:!0}}var jt=r(20),Rt=r(3),Ut=r(1),Pt=r(9),Bt=r(8);class Dt extends jt.a{constructor(t=0,e=0){super(2),Object(Rt.e)(t)&&1===arguments.length?this.copy(t):(Rt.b.debug&&(Object(Ut.a)(t),Object(Ut.a)(e)),this[0]=t,this[1]=e)}set(t,e){return this[0]=t,this[1]=e,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Rt.b.debug&&(Object(Ut.a)(t.x),Object(Ut.a)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Pt.d(this,this,t),this.check()}transformAsVector(t){return Object(Bt.a)(this,this,t),this.check()}transformByMatrix3(t){return Pt.c(this,this,t),this.check()}transformByMatrix2x3(t){return Pt.b(this,this,t),this.check()}transformByMatrix2(t){return Pt.a(this,this,t),this.check()}}var Ct=r(43);function kt(t,e){if(!t)throw new Error("math.gl assertion failed. "+e)}new Dt,new ft.a,new Dt,new Dt,new Uint8Array(1);function Ft(t,e=255){return Object(Rt.a)(t,0,e)/e*2-1}function zt(t){return t<0?-1:1}function Vt(t,e,r,n){if(kt(n),t<0||t>r||e<0||e>r)throw new Error("x and y must be unsigned normalized integers between 0 and "+r);if(n.x=Ft(t,r),n.y=Ft(e,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const t=n.x;n.x=(1-Math.abs(n.y))*zt(t),n.y=(1-Math.abs(t))*zt(n.y)}return n.normalize()}function Gt(t,e,r){return Vt(t,e,255,r)}const qt=new ft.a;function Ht(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){const r=new ft.a,n=new Float32Array(3*t.pointCount);for(let s=0;s<t.pointCount;s++)r.set(e[3*s],e[3*s+1],e[3*s+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,3*s);return n}(t,e)):{type:ht.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}async function Wt(t,e,r,n,s){r=xt(t,e,r=Nt(t,e,r=St(t,e,r))),function(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}(t);const{featureTable:i,batchTable:o}=function(t){const e=new yt(t.featureTableJson,t.featureTableBinary),r=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=r,t.featuresLength=r,t.pointsLength=r,t.pointCount=r,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",ht.FLOAT,3);const n=function(t,e){let r=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",ht.UNSIGNED_SHORT,1),t.batchIds)){const n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:s,batchTableBinary:i}=t;r=new vt(s,i,n)}return r}(t,e);return{featureTable:e,batchTable:n}}(t);return await async function(t,e,r,n,s){let i,o,a;const c=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];c&&(a=c.properties);const u=e.getExtension("3DTILES_draco_point_compression");if(u){o=u.properties;const e=u.byteOffset,r=u.byteLength;if(!o||!Number.isFinite(e)||!r)throw new Error("Draco properties, byteOffset, and byteLength must be defined");i=t.featureTableBinary.slice(e,e+r),t.hasPositions=Number.isFinite(o.POSITION),t.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),t.hasNormals=Number.isFinite(o.NORMAL),t.hasBatchIds=Number.isFinite(o.BATCH_ID),t.isTranslucent=Number.isFinite(o.RGBA)}if(!i)return!0;const h={buffer:i,properties:{...o,...a},featureTableProperties:o,batchTableProperties:a,dequantizeInShader:!1};return await async function(t,e,r,n){const{parse:s}=n,i={...r,draco:{...r.draco,extraAttributes:e.batchTableProperties||{}}};delete i["3d-tiles"];const o=await s(e.buffer,ct,i),a=o.attributes.POSITION&&o.attributes.POSITION.value,c=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,u=o.attributes.NORMAL&&o.attributes.NORMAL.value,h=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,f=a&&o.attributes.POSITION.value.quantization,l=u&&o.attributes.NORMAL.value.quantization;if(f){const e=o.POSITION.data.quantization,r=e.range;t.quantizedVolumeScale=new ft.a(r,r,r),t.quantizedVolumeOffset=new ft.a(e.minValues),t.quantizedRange=(1<<e.quantizationBits)-1,t.isQuantizedDraco=!0}l&&(t.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);const d={};if(e.batchTableProperties)for(const t of Object.keys(e.batchTableProperties))o.attributes[t]&&o.attributes[t].value&&(d[t.toLowerCase()]=o.attributes[t].value);t.attributes={positions:a,colors:Lt(t,c),normals:u,batchIds:h,...d}}(t,h,n,s)}(t,i,0,n,s),function(t,e,r){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",ht.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){const n=e.getPropertyArray("POSITION_QUANTIZED",ht.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ht.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ht.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Ht(t,n,r)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(t,i,n),function(t,e,r){if(!t.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",ht.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",ht.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",ht.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=Lt(t,n,r)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",ht.UNSIGNED_BYTE,4))}(t,i,o),function(t,e){if(!t.attributes.normals){let r=null;e.hasProperty("NORMAL")?r=e.getPropertyArray("NORMAL",ht.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(r=e.getPropertyArray("NORMAL_OCT16P",ht.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){const r=new Float32Array(3*t.pointsLength);for(let n=0;n<t.pointsLength;n++)Gt(e[2*n],e[2*n+1],qt),qt.toArray(r,3*n);return{type:ht.FLOAT,size:2,value:r}}return{type:ht.FLOAT,size:2,value:e}}(t,r)}}(t,i),r}function $t(t,e){if(!t)throw new Error(e)}var Kt=r(15);const{_parseImageNode:Qt}=Kt.a,Yt="undefined"!=typeof Image,Zt="undefined"!=typeof ImageBitmap,Jt=Boolean(Qt),Xt=!!Kt.b||Jt;function te(t){const e=re(t);if(!e)throw new Error("Not an image");return e}function ee(t){switch(te(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function re(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}const ne=/^data:image\/svg\+xml/,se=/\.svg((\?|#).*)?$/;function ie(t){return t&&(ne.test(t)||se.test(t))}function oe(t,e){if(ie(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function ae(t,e,r){const n=function(t,e){if(ie(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(t){throw new Error(t.message)}return"data:image/svg+xml;base64,"+btoa(e)}return oe(t,e)}(t,r),s=self.URL||self.webkitURL,i="string"!=typeof n&&s.createObjectURL(n);try{return await async function(t,e){const r=new Image;if(r.src=t,e.image&&e.image.decode&&r.decode)return await r.decode(),r;return await new Promise((e,n)=>{try{r.onload=()=>e(r),r.onerror=e=>n(new Error(`Could not load image ${t}: ${e}`))}catch(t){n(t)}})}(i||n,e)}finally{i&&s.revokeObjectURL(i)}}const ce={};let ue=!0;async function he(t,e,r){let n;if(ie(r)){n=await ae(t,e,r)}else n=oe(t,r);const s=e&&e.imagebitmap;return await async function(t,e=null){!function(t){for(const e in t||ce)return!1;return!0}(e)&&ue||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(t){console.warn(t),ue=!1}return await createImageBitmap(t)}(n,s)}function fe(t){const e=le(t);return function(t){const e=le(t);if(!(e.byteLength>=24&&2303741511===e.getUint32(0,!1)))return null;return{mimeType:"image/png",width:e.getUint32(16,!1),height:e.getUint32(20,!1)}}(e)||function(t){const e=le(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,!1)&&255===e.getUint8(2)))return null;const{tableMarkers:r,sofMarkers:n}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let s=2;for(;s+9<e.byteLength;){const t=e.getUint16(s,!1);if(n.has(t))return{mimeType:"image/jpeg",height:e.getUint16(s+5,!1),width:e.getUint16(s+7,!1)};if(!r.has(t))return null;s+=2,s+=e.getUint16(s,!1)}return null}(e)||function(t){const e=le(t);if(!(e.byteLength>=10&&1195984440===e.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:e.getUint16(6,!0),height:e.getUint16(8,!0)}}(e)||function(t){const e=le(t);if(!(e.byteLength>=14&&16973===e.getUint16(0,!1)&&e.getUint32(2,!0)===e.byteLength))return null;return{mimeType:"image/bmp",width:e.getUint32(18,!0),height:e.getUint32(22,!0)}}(e)}function le(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}const de={id:"image",module:"images",name:"Images",version:"3.0.13",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:async function(t,e,r){const n=((e=e||{}).image||{}).type||"auto",{url:s}=r||{};let i;switch(function(t){switch(t){case"auto":case"data":return function(){if(Zt)return"imagebitmap";if(Yt)return"image";if(Xt)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return Zt||Yt||Xt;case"imagebitmap":return Zt;case"image":return Yt;case"data":return Xt;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}(n)){case"imagebitmap":i=await he(t,e,s);break;case"image":i=await ae(t,e,s);break;case"data":i=await function(t,e){const{mimeType:r}=fe(t)||{},{_parseImageNode:n}=Kt.a;return $t(n),n(t,r,e)}(t,e);break;default:$t(!1)}return"data"===n&&(i=ee(i)),i},tests:[t=>Boolean(fe(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};function me(t,e,r){if(t.byteLength<=e+r)return"";const n=new DataView(t);let s="";for(let t=0;t<r;t++)s+=String.fromCharCode(n.getUint8(e+t));return s}function ye(t){try{return JSON.parse(t)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(t,e=5){if("string"==typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return me(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return me(t,0,e)}return""}(t)}"`)}}r(16);function ge(t,e,r){const n=void 0!==r?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function pe(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function be(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const r=e.baseUri||e.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url "+t);return r.substr(0,r.lastIndexOf("/")+1)+t}function Te(t,e,r){const n=t.bufferViews[r];pe(n);const s=e[n.buffer];pe(s);const i=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,i,n.byteLength)}function we(t,e){return T(t>=0),T(e>0),t+(e-1)&~(e-1)}function Ee(t,e,r){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{const e=t.byteOffset,r=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,e,r)}return e.set(n,r),r+we(n.byteLength,4)}const Oe=["SCALAR","VEC2","VEC3","VEC4"],_e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ae=new Map(_e),Ie={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ve={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Se={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Ne(t){return Oe[t-1]||Oe[0]}function xe(t){const e=Ae.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Me(t,e){const r=Se[t.componentType],n=Ie[t.type],s=ve[t.componentType],i=t.count*n,o=t.count*n*s;return pe(o>=0&&o<=e.byteLength),{ArrayType:r,length:i,byteLength:o}}function Le(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const je={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class Re{constructor(t){Le(this,"gltf",void 0),Le(this,"sourceBuffers",void 0),Le(this,"byteLength",void 0),this.gltf=t||{json:{...je},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]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){const e=this.getUsedExtensions().find(e=>e===t),r=this.json.extensions||{};return e?r[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find(e=>e===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"==typeof e)return e;const r=this.json[t]&&this.json[t][e];if(!r)throw new Error(`glTF file error: Could not find ${t}[${e}]`);return r}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,r=this.gltf.buffers[e];pe(r);const n=(t.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),r=this.getBuffer(e.buffer).data,{ArrayType:n,length:s}=Me(t,e);return new n(r,e.byteOffset+t.byteOffset,s)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),r=this.getBuffer(e.buffer).data,n=e.byteOffset||0;return new Uint8Array(r,n,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,r){return t.extensions=t.extensions||{},t.extensions[e]=r,this.registerUsedExtension(e),this}setObjectExtension(t,e,r){(t.extensions||{})[e]=r}removeObjectExtension(t,e){const r=t.extensions||{},n=r[e];return delete r[e],n}addExtension(t,e={}){return pe(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return pe(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(e=>e===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(e=>e===t)||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:r}=t;this.json.nodes=this.json.nodes||[];const n={mesh:e};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:r,material:n,mode:s=4}=t,i={primitives:[{attributes:this._addAttributes(e),mode:s}]};if(r){const t=this._addIndices(r);i.primitives[0].indices=t}return Number.isFinite(n)&&(i.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const r=fe(t),n=e||(null==r?void 0:r.mimeType),s={bufferView:this.addBufferView(t),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}addBufferView(t){const e=t.byteLength;pe(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const r={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=we(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}addAccessor(t,e){const r={bufferView:t,type:Ne(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}addBinaryBuffer(t,e={size:3}){const r=this.addBufferView(t);let n={min:e.min,max:e.max};n.min&&n.max||(n=this._getAccessorMinMax(t,e.size));const s={size:e.size,componentType:xe(t),count:Math.round(t.length/e.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(s,e))}addTexture(t){const{imageIndex:e}=t,r={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(r),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const r=this.byteLength,n=new ArrayBuffer(r),s=new Uint8Array(n);let i=0;for(const t of this.sourceBuffers||[])i=Ee(t,s,i);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(t,e){let r=!0;for(;r;){const n=t.indexOf(e);n>-1?t.splice(n,1):r=!1}}_addAttributes(t={}){const e={};for(const r in t){const n=t[r],s=this._getGltfAttributeName(r),i=this.addBinaryBuffer(n.value,n);e[s]=i}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.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 t}}_getAccessorMinMax(t,e){const r={min:null,max:null};if(t.length<e)return r;r.min=[],r.max=[];const n=t.subarray(0,e);for(const t of n)r.min.push(t),r.max.push(t);for(let n=e;n<t.length;n+=e)for(let s=0;s<e;s++)r.min[0+s]=Math.min(r.min[0+s],t[n+s]),r.max[0+s]=Math.max(r.max[0+s],t[n+s]);return r}}function Ue(t){const{buffer:e,size:r,count:n}=function(t){let e=t,r=1,n=0;t&&t.value&&(e=t.value,r=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e,r=!1){if(!t)return null;if(Array.isArray(t))return new e(t);if(r&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),n=e.length/r);return{buffer:e,size:r,count:n}}(t);return{value:e,size:r,byteOffset:0,count:n,type:Ne(r),componentType:xe(e)}}async function Pe(t,e,r){var n;if(null==e||null===(n=e.gltf)||void 0===n||!n.decompressMeshes)return;const s=new Re(t),i=[];for(const t of function*(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}(s))s.getObjectExtension(t,"KHR_draco_mesh_compression")&&i.push(De(s,t,e,r));await Promise.all(i),s.removeExtension("KHR_draco_mesh_compression")}function Be(t,e={}){const r=new Re(t);for(const t of r.json.meshes||[])Ce(t,e),r.addRequiredExtension("KHR_draco_mesh_compression")}async function De(t,e,r,n){const s=t.getObjectExtension(e,"KHR_draco_mesh_compression");if(!s)return;const i=t.getTypedArrayForBufferView(s.bufferView),o=ge(i.buffer,i.byteOffset),{parse:a}=n,c={...r};delete c["3d-tiles"];const u=await a(o,ct,c,n),h=function(t){const e={};for(const r in t){const n=t[r];if("indices"!==r){const t=Ue(n);e[r]=t}}return e}(u.attributes);for(const[r,n]of Object.entries(h))if(r in e.attributes){const s=e.attributes[r],i=t.getAccessor(s);null!=i&&i.min&&null!=i&&i.max&&(n.min=i.min,n.max=i.max)}e.attributes=h,u.indices&&(e.indices=Ue(u.indices)),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function Ce(t,e,r=4,n,s){var i;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const o=n.DracoWriter.encodeSync({attributes:t}),a=null==s||null===(i=s.parseSync)||void 0===i?void 0:i.call(s,{attributes:t}),c=n._addFauxAttributes(a.attributes);return{primitives:[{attributes:c,mode:r,extensions:{KHR_draco_mesh_compression:{bufferView:n.addBufferView(o),attributes:c}}}]}}async function ke(t){const e=new Re(t),{json:r}=e;e.removeExtension("KHR_materials_unlit");for(const t of r.materials||[]){t.extensions&&t.extensions.KHR_materials_unlit&&(t.unlit=!0),e.removeObjectExtension(t,"KHR_materials_unlit")}}function Fe(t){const e=new Re(t),{json:r}=e;if(e.materials)for(const t of r.materials||[])t.unlit&&(delete t.unlit,e.addObjectExtension(t,"KHR_materials_unlit",{}),e.addExtension("KHR_materials_unlit"))}async function ze(t){const e=new Re(t),{json:r}=e,n=e.getExtension("KHR_lights_punctual");n&&(e.json.lights=n.lights,e.removeExtension("KHR_lights_punctual"));for(const t of r.nodes||[]){const r=e.getObjectExtension(t,"KHR_lights_punctual");r&&(t.light=r.light),e.removeObjectExtension(t,"KHR_lights_punctual")}}async function Ve(t){const e=new Re(t),{json:r}=e;if(r.lights){const t=e.addExtension("KHR_lights_punctual");pe(!t.lights),t.lights=r.lights,delete r.lights}if(e.json.lights){for(const t of e.json.lights){const r=t.node;e.addObjectExtension(r,"KHR_lights_punctual",t)}delete e.json.lights}}async function Ge(t){const e=new Re(t),{json:r}=e,n=e.getExtension("KHR_techniques_webgl");if(n){const t=function(t,e){const{programs:r=[],shaders:n=[],techniques:s=[]}=t,i=new TextDecoder;return n.forEach(t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=i.decode(e.getTypedArrayForBufferView(t.bufferView))}),r.forEach(t=>{t.fragmentShader=n[t.fragmentShader],t.vertexShader=n[t.vertexShader]}),s.forEach(t=>{t.program=r[t.program]}),s}(n,e);for(const n of r.materials||[]){const r=e.getObjectExtension(n,"KHR_techniques_webgl");r&&(n.technique=Object.assign({},r,t[r.technique]),n.technique.values=He(n.technique,e)),e.removeObjectExtension(n,"KHR_techniques_webgl")}e.removeExtension("KHR_techniques_webgl")}}async function qe(t,e){}function He(t,e){const r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(e=>{t.uniforms[e].value&&!(e in r)&&(r[e]=t.uniforms[e].value)}),Object.keys(r).forEach(t=>{"object"==typeof r[t]&&void 0!==r[t].index&&(r[t].texture=e.getTexture(r[t].index))}),r}const We={KHR_draco_mesh_compression:s,KHR_materials_unlit:i,KHR_lights_punctual:o,KHR_techniques_webgl:a};const $e={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Ke={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Qe{constructor(t){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(t,e){this.json=t.json;const r=t.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 "+r.asset.version)}if(!e.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(t){const e=new Re(t),{json:r}=e;for(const t of r.images||[]){const r=e.removeObjectExtension(t,"KHR_binary_glTF");r&&Object.assign(t,r)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,e.removeExtension("KHR_binary_glTF")}(t),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in $e)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const r=t[e];if(r&&!Array.isArray(r)){t[e]=[];for(const n in r){const s=r[n];s.id=s.id||n;const i=t[e].length;t[e].push(s),this.idToIndexMap[e][n]=i}}}_convertObjectIdsToArrayIndices(t){for(const e in $e)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:r,material:n}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");r&&(e.indices=this._convertIdToIndex(r,"accessor")),n&&(e.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(t=>this._convertIdToIndex(t,"node"))),t.meshes&&(t.meshes=t.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute "+e),t[e]=[]);for(const r of t[e])for(const t in r){const e=r[t],n=this._convertIdToIndex(e,t);r[t]=n}}_convertIdToIndex(t,e){const r=Ke[e];if(r in this.idToIndexMap){const n=this.idToIndexMap[r][t];if(!Number.isFinite(n))throw new Error(`gltf v1: failed to resolve ${e} with id ${t}`);return n}return t}_updateObjects(t){for(const t of this.json.buffers)delete t.type}_updateMaterial(t){for(const e of t.materials){e.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=e.values&&e.values.tex,n=t.textures.findIndex(t=>t.id===r);-1!==n&&(e.pbrMetallicRoughness.baseColorTexture={index:n})}}}const Ye={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ze={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Je={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Xe={magFilter:Je.TEXTURE_MAG_FILTER,minFilter:Je.TEXTURE_MIN_FILTER,wrapS:Je.TEXTURE_WRAP_S,wrapT:Je.TEXTURE_WRAP_T},tr={[Je.TEXTURE_MAG_FILTER]:Je.LINEAR,[Je.TEXTURE_MIN_FILTER]:Je.NEAREST_MIPMAP_LINEAR,[Je.TEXTURE_WRAP_S]:Je.REPEAT,[Je.TEXTURE_WRAP_]:Je.REPEAT};class er{postProcess(t,e={}){const{json:r,buffers:n=[],images:s=[],baseUri:i=""}=t;return pe(r),this.baseUri=i,this.json=r,this.buffers=n,this.images=s,this._resolveTree(this.json,e),this.json}_resolveTree(t,e={}){t.bufferViews&&(t.bufferViews=t.bufferViews.map((t,e)=>this._resolveBufferView(t,e))),t.images&&(t.images=t.images.map((t,e)=>this._resolveImage(t,e))),t.samplers&&(t.samplers=t.samplers.map((t,e)=>this._resolveSampler(t,e))),t.textures&&(t.textures=t.textures.map((t,e)=>this._resolveTexture(t,e))),t.accessors&&(t.accessors=t.accessors.map((t,e)=>this._resolveAccessor(t,e))),t.materials&&(t.materials=t.materials.map((t,e)=>this._resolveMaterial(t,e))),t.meshes&&(t.meshes=t.meshes.map((t,e)=>this._resolveMesh(t,e))),t.nodes&&(t.nodes=t.nodes.map((t,e)=>this._resolveNode(t,e))),t.skins&&(t.skins=t.skins.map((t,e)=>this._resolveSkin(t,e))),t.scenes&&(t.scenes=t.scenes.map((t,e)=>this._resolveScene(t,e))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"==typeof e)return e;const r=this.json[t]&&this.json[t][e];return r||console.warn(`glTF file error: Could not find ${t}[${e}]`),r}_resolveScene(t,e){return t.id=t.id||"scene-"+e,t.nodes=(t.nodes||[]).map(t=>this.getNode(t)),t}_resolveNode(t,e){return t.id=t.id||"node-"+e,t.children&&(t.children=t.children.map(t=>this.getNode(t))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((t,e)=>{const r=this.getMesh(e);return t.id=r.id,t.primitives=t.primitives.concat(r.primitives),t},{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||"skin-"+e,t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||"mesh-"+e,t.primitives&&(t.primitives=t.primitives.map(t=>{const e=(t={...t}).attributes;t.attributes={};for(const r in e)t.attributes[r]=this.getAccessor(e[r]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t})),t}_resolveMaterial(t,e){if(t.id=t.id||"material-"+e,t.normalTexture&&(t.normalTexture={...t.normalTexture},t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture={...t.occlustionTexture},t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture={...t.emmisiveTexture},t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness={...t.pbrMetallicRoughness};const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){var r,n;if(t.id=t.id||"accessor-"+e,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(r=t.componentType,Ze[r]),t.components=(n=t.type,Ye[n]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:r,byteLength:n}=Me(t,t.bufferView),s=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset,i=e.arrayBuffer.slice(s,s+n);t.value=new r(i)}return t}_resolveTexture(t,e){return t.id=t.id||"texture-"+e,t.sampler="sampler"in t?this.getSampler(t.sampler):tr,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||"sampler-"+e,t.parameters={};for(const e in t){const r=this._enumSamplerParameter(e);void 0!==r&&(t.parameters[r]=t[e])}return t}_enumSamplerParameter(t){return Xe[t]}_resolveImage(t,e){t.id=t.id||"image-"+e,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const r=this.images[e];return r&&(t.image=r),t}_resolveBufferView(t,e){t.id=t.id||"bufferView-"+e;const r=t.buffer;t.buffer=this.buffers[r];const n=this.buffers[r].arrayBuffer;let s=this.buffers[r].byteOffset||0;return"byteOffset"in t&&(s+=t.byteOffset),t.data=new Uint8Array(n,s,t.byteLength),t}_resolveCamera(t,e){return t.id=t.id||"camera-"+e,t.perspective,t.orthographic,t}}const rr=1735152710;function nr(t,e=0,r={}){const n=new DataView(t),{magic:s=rr}=r,i=n.getUint32(e,!1);return i===s||i===rr}function sr(t,e,r=0,n={}){const s=new DataView(e),i=function(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}(s,r+0),o=s.getUint32(r+4,!0),a=s.getUint32(r+8,!0);switch(Object.assign(t,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},binChunks:[]}),r+=12,t.version){case 1:return function(t,e,r){T(t.header.byteLength>20);const n=e.getUint32(r+0,!0),s=e.getUint32(r+4,!0);return r+=8,T(0===s),ir(t,e,r,n),r+=n,r+=or(t,e,r,t.header.byteLength)}(t,s,r);case 2:return function(t,e,r,n){return T(t.header.byteLength>20),function(t,e,r,n){for(;r+8<=t.header.byteLength;){const s=e.getUint32(r+0,!0),i=e.getUint32(r+4,!0);switch(r+=8,i){case 1313821514:ir(t,e,r,s);break;case 5130562:or(t,e,r,s);break;case 0:n.strict||ir(t,e,r,s);break;case 1:n.strict||or(t,e,r,s)}r+=we(s,4)}}(t,e,r,n),r+t.header.byteLength}(t,s,r,{});default:throw new Error(`Invalid GLB version ${t.version}. Only supports v1 and v2.`)}}function ir(t,e,r,n){const s=new Uint8Array(e.buffer,r,n),i=new TextDecoder("utf8").decode(s);return t.json=JSON.parse(i),we(n,4)}function or(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),we(n,4)}async function ar(t,e,r=0,n,s){var i,o,a,c;!function(t,e,r,n){n.uri&&(t.baseUri=n.uri);if(e instanceof ArrayBuffer&&!nr(e,r,n)){const t=new TextDecoder;e=t.decode(e)}if("string"==typeof e)t.json=ye(e);else if(e instanceof ArrayBuffer){const s={};r=sr(s,e,r,n.glb),pe("glTF"===s.type,"Invalid GLB magic string "+s.type),t._glb=s,t.json=s.json}else pe(!1,"GLTF: must be ArrayBuffer or string");const s=t.json.buffers||[];if(t.buffers=new Array(s.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const i=t.json.images||[];t.images=new Array(i.length).fill({})}(t,e,r,n),function(t,e={}){(new Qe).normalize(t,e)}(t,{normalize:null==n||null===(i=n.gltf)||void 0===i?void 0:i.normalize});const u=[];if(null!=n&&null!==(o=n.gltf)&&void 0!==o&&o.loadBuffers&&t.json.buffers&&await async function(t,e,r){for(let i=0;i<t.json.buffers.length;++i){const o=t.json.buffers[i];if(o.uri){var n,s;const{fetch:a}=r;pe(a);const c=be(o.uri,e),u=await(null==r||null===(n=r.fetch)||void 0===n?void 0:n.call(r,c)),h=await(null==u||null===(s=u.arrayBuffer)||void 0===s?void 0:s.call(u));t.buffers[i]={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength},delete o.uri}}}(t,n,s),null!=n&&null!==(a=n.gltf)&&void 0!==a&&a.loadImages){const e=async function(t,e,r){const n=t.json.images||[],s=[];for(let i=0;i<n.length;++i)s.push(cr(t,n[i],i,e,r));return await Promise.all(s)}(t,n,s);u.push(e)}const h=async function(t,e={},r){for(const s in We){var n;const i=(null==e||null===(n=e.gltf)||void 0===n?void 0:n.excludeExtensions)||{};if(!(s in i&&!i[s])){const n=We[s];await n.decode(t,e,r)}}}(t,n,s);return u.push(h),await Promise.all(u),null!=n&&null!==(c=n.gltf)&&void 0!==c&&c.postProcess?function(t,e){return(new er).postProcess(t,e)}(t,n):t}async function cr(t,e,r,n,s){const{fetch:i,parse:o}=s;let a;if(e.uri){const t=be(e.uri,n),r=await i(t);a=await r.arrayBuffer()}if(Number.isFinite(e.bufferView)){const r=Te(t.json,t.buffers,e.bufferView);a=ge(r.buffer,r.byteOffset,r.byteLength)}pe(a,"glTF image has no data");const c=await o(a,de,{},s);t.images[r]=c}const ur={name:"glTF",id:"gltf",module:"gltf",version:"3.0.13",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t,e={},r){(e={...ur.options,...e}).gltf={...ur.options.gltf,...e.gltf};const{byteOffset:n=0}=e;return await ar({},t,n,e,r)},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"}}};const hr=0,fr=1;function lr(t,e,r,n){t.rotateYtoZ=!0;const s=t.byteOffset+t.byteLength-r;if(0===s)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=ge(e,r,s),t.gltfByteOffset=0,t.gltfByteLength=s,r%4==0||console.warn(t.type+": embedded glb is not aligned to a 4-byte boundary."),t.byteOffset+t.byteLength}async function dr(t,e,r,n){const s=r["3d-tiles"]||{};if(function(t,e,r){switch(e){case hr:const e=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),r=(new TextDecoder).decode(e);t.gltfUrl=r.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case fr:break;default:throw new Error("b3dm: Illegal glTF format field")}}(t,e),s.loadGLTF){const{parse:e,fetch:s}=n;t.gltfUrl&&(t.gltfArrayBuffer=await s(t.gltfUrl,r),t.gltfByteOffset=0),t.gltfArrayBuffer&&(t.gltf=await e(t.gltfArrayBuffer,ur,r,n),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength)}}async function mr(t,e,r,n,s){var i;r=function(t,e,r,n,s){r=St(t,e,r),r=Nt(t,e,r),r=xt(t,e,r),r=lr(t,e,r,n);const i=new yt(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=i.getGlobalProperty("RTC_CENTER",ht.FLOAT,3),r}(t,e,r,n),await dr(t,fr,n,s);const o=null==t||null===(i=t.gltf)||void 0===i?void 0:i.extensions;return o&&o.CESIUM_RTC&&(t.rtcCenter=o.CESIUM_RTC.center),r}var yr=r(45),gr=r(46),pr=r(44),br=r(6),Tr=r(2);Math.max(6378137,6378137,6356752.314245179);const wr=t=>t,Er=new ft.a;function Or(t,e,r=wr){return Object(Rt.e)(t)?(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]):"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z),e}function _r(t,e,r=wr){return Object(Rt.e)(e)?(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]):"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]),e}const Ar=new ft.a,Ir=new ft.a,vr=new ft.a;const Sr=new ft.a,Nr={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"}},xr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Mr={east:new ft.a,north:new ft.a,up:new ft.a,west:new ft.a,south:new ft.a,down:new ft.a},Lr=new ft.a,jr=new ft.a,Rr=new ft.a;function Ur(t,e,r,n,s,i){const o=Nr[e]&&Nr[e][r];let a,c,u;Object(br.a)(o&&(!n||n===o));const h=Sr.copy(s);if(Object(Rt.c)(h.x,0,1e-14)&&Object(Rt.c)(h.y,0,1e-14)){const t=Math.sign(h.z);a=Lr.fromArray(xr[e]),"east"!==e&&"west"!==e&&a.scale(t),c=jr.fromArray(xr[r]),"east"!==r&&"west"!==r&&c.scale(t),u=Rr.fromArray(xr[n]),"east"!==n&&"west"!==n&&u.scale(t)}else{const{up:s,east:i,north:o}=Mr;i.set(-h.y,h.x,0).normalize(),t.geodeticSurfaceNormal(h,s),o.copy(s).cross(i);const{down:f,west:l,south:d}=Mr;f.copy(s).scale(-1),l.copy(i).scale(-1),d.copy(o).scale(-1),a=Mr[e],c=Mr[r],u=Mr[n]}return i[0]=a.x,i[1]=a.y,i[2]=a.z,i[3]=0,i[4]=c.x,i[5]=c.y,i[6]=c.z,i[7]=0,i[8]=u.x,i[9]=u.y,i[10]=u.z,i[11]=0,i[12]=h.x,i[13]=h.y,i[14]=h.z,i[15]=1,i}const Pr=new ft.a,Br=new ft.a,Dr=new ft.a,Cr=new ft.a,kr=new ft.a,Fr=new ft.a;let zr;class Vr{static get WGS84(){return zr=zr||new Vr(6378137,6378137,6356752.314245179),zr}constructor(t=0,e=0,r=0){Object(br.a)(t>=0),Object(br.a)(e>=0),Object(br.a)(r>=0),this.radii=new ft.a(t,e,r),this.radiiSquared=new ft.a(t*t,e*e,r*r),this.radiiToTheFourth=new ft.a(t*t*t*t,e*e*e*e,r*r*r*r),this.oneOverRadii=new ft.a(0===t?0:1/t,0===e?0:1/e,0===r?0:1/r),this.oneOverRadiiSquared=new ft.a(0===t?0:1/(t*t),0===e?0:1/(e*e),0===r?0:1/(r*r)),this.minimumRadius=Math.min(t,e,r),this.maximumRadius=Math.max(t,e,r),this.centerToleranceSquared=Ct.a.EPSILON1,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,e=[0,0,0]){const r=Br,n=Dr,[,,s]=t;this.geodeticSurfaceNormalCartographic(t,r),n.copy(this.radiiSquared).scale(r);const i=Math.sqrt(r.dot(n));return n.scale(1/i),r.scale(s),n.add(r),n.to(e)}cartesianToCartographic(t,e=[0,0,0]){Fr.from(t);const r=this.scaleToGeodeticSurface(Fr,Cr);if(!r)return;const n=this.geodeticSurfaceNormal(r,Br),s=kr;s.copy(Fr).subtract(r);const i=Math.atan2(n.y,n.x),o=Math.asin(n.z),a=Math.sign(Tr.d(s,Fr))*Tr.g(s);return _r([i,o,a],e,Rt.b._cartographicRadians?wr:Rt.f)}eastNorthUpToFixedFrame(t,e=new pr.a){return Ur(this,"east","north","up",t,e)}localFrameToFixedFrame(t,e,r,n,s=new pr.a){return Ur(this,t,e,r,n,s)}geocentricSurfaceNormal(t,e=[0,0,0]){return Pr.from(t).normalize().to(e)}geodeticSurfaceNormalCartographic(t,e=[0,0,0]){const r=function(t,e=Er){return Or(t,e,Rt.b._cartographicRadians?wr:Rt.g)}(t),n=r[0],s=r[1],i=Math.cos(s);return Pr.set(i*Math.cos(n),i*Math.sin(n),Math.sin(s)).normalize(),Pr.to(e)}geodeticSurfaceNormal(t,e=[0,0,0]){return Pr.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}scaleToGeodeticSurface(t,e){return function(t,e,r=new ft.a){const{oneOverRadii:n,oneOverRadiiSquared:s,centerToleranceSquared:i}=e;Ar.from(t);const o=t.x,a=t.y,c=t.z,u=n.x,h=n.y,f=n.z,l=o*o*u*u,d=a*a*h*h,m=c*c*f*f,y=l+d+m,g=Math.sqrt(1/y);if(!Number.isFinite(g))return;const p=Ir;if(p.copy(t).scale(g),y<i)return p.to(r);const b=s.x,T=s.y,w=s.z,E=vr;E.set(p.x*b*2,p.y*T*2,p.z*w*2);let O,_,A,I,v=(1-g)*t.len()/(.5*E.len()),S=0;do{v-=S,O=1/(1+v*b),_=1/(1+v*T),A=1/(1+v*w);const t=O*O,e=_*_,r=A*A;I=l*t+d*e+m*r-1;S=I/(-2*(l*(t*O)*b+d*(e*_)*T+m*(r*A)*w))}while(Math.abs(I)>Ct.a.EPSILON12);return Ar.scale([O,_,A]).to(r)}(t,this,e)}scaleToGeocentricSurface(t,e=[0,0,0]){Cr.from(t);const r=Cr.x,n=Cr.y,s=Cr.z,i=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*i.x+n*n*i.y+s*s*i.z);return Cr.multiplyScalar(o).to(e)}transformPositionToScaledSpace(t,e=[0,0,0]){return Cr.from(t).scale(this.oneOverRadii).to(e)}transformPositionFromScaledSpace(t,e=[0,0,0]){return Cr.from(t).scale(this.radii).to(e)}getSurfaceNormalIntersectionWithZAxis(t,e=0,r=[0,0,0]){Object(br.a)(Object(Rt.c)(this.radii.x,this.radii.y,Ct.a.EPSILON15)),Object(br.a)(this.radii.z>0),Cr.from(t);const n=Cr.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-e))return Cr.set(0,0,n).to(r)}}async function Gr(t,e,r,n,s){return r=function(t,e,r,n,s){if(r=St(t,e,r),1!==t.version)throw new Error(`Instanced 3D Model version ${t.version} is not supported`);r=Nt(t,e,r);const i=new DataView(e);if(t.gltfFormat=i.getUint32(r,!0),r=xt(t,e,r+=4),r=lr(t,e,r,n),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const o=new yt(t.featureTableJson,t.featureTableBinary),a=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=o.getGlobalProperty("RTC_CENTER",ht.FLOAT,3);new vt(t.batchTableJson,t.batchTableBinary,a);return function(t,e,r,n){const s=[new Array(n),t._batchTable][0],i=new ft.a,o=new ft.a,a=new ft.a,c=new ft.a,u=new yr.a,h=new gr.a,f=new ft.a,l={},d=new pr.a,m=[],y=[],g=new ft.a,p=new ft.a;for(let r=0;r<n;r++){let n;if(e.hasProperty("POSITION"))n=e.getProperty("POSITION",ht.FLOAT,3,r,i);else if(e.hasProperty("POSITION_QUANTIZED")){n=e.getProperty("POSITION_QUANTIZED",ht.UNSIGNED_SHORT,3,r,i);const t=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ht.FLOAT,3,g);if(!t)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const s=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ht.FLOAT,3,p);if(!s)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const o=65535;for(let e=0;e<3;e++)n[e]=n[e]/o*s[e]+t[e]}if(!n)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");i.copy(n),l.translation=i,t.normalUp=e.getProperty("NORMAL_UP",ht.FLOAT,3,r,m),t.normalRight=e.getProperty("NORMAL_RIGHT",ht.FLOAT,3,r,y);const b=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",ht.UNSIGNED_SHORT,2,m),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",ht.UNSIGNED_SHORT,2,y),t.octNormalUp){if(!t.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")}t.eastNorthUp?(Vr.WGS84.eastNorthUpToFixedFrame(i,d),d.getRotationMatrix3(u)):u.identity()}b&&(c.copy(o).cross(a).normalize(),u.setColumn(0,o),u.setColumn(1,a),u.setColumn(2,c)),h.fromMatrix3(u),l.rotation=h,f.set(1,1,1);const T=e.getProperty("SCALE",ht.FLOAT,1,r);Number.isFinite(T)&&f.multiplyByScalar(T);const w=e.getProperty("SCALE_NON_UNIFORM",ht.FLOAT,3,r,m);w&&f.scale(w),l.scale=f;let E=e.getProperty("BATCH_ID",ht.UNSIGNED_SHORT,1,r);void 0===E&&(E=r);const O=(new pr.a).fromQuaternion(l.rotation);d.identity(),d.translate(l.translation),d.multiplyRight(O),d.scale(l.scale);const _=d.clone();s[r]={modelMatrix:_,batchId:E}}t.instances=s}(t,o,0,a),r}(t,e,r,n),await dr(t,t.gltfFormat,n,s),r}async function qr(t,e=0,r,n,s={}){switch(s.byteOffset=e,s.type=function(t,e=0){const r=new DataView(t);return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}(t,e),s.type){case p.COMPOSITE:return await async function(t,e,r,n,s,i){r=St(t,e,r);const o=new DataView(e);for(t.tilesLength=o.getUint32(r,!0),r+=4,t.tiles=[];t.tiles.length<t.tilesLength&&t.byteLength-r>12;){const o={};t.tiles.push(o),r=await i(e,r,n,s,o)}return r}(s,t,e,r,n,qr);case p.BATCHED_3D_MODEL:return await mr(s,t,e,r,n);case p.INSTANCED_3D_MODEL:return await Gr(s,t,e,r,n);case p.POINT_CLOUD:return await Wt(s,t,e,r,n);default:throw new Error("3DTileLoader: unknown type "+s.type)}}function Hr(t,e){if(t.content){const r=t.content.uri||t.content.url;t.contentUrl=`${e.basePath}/${r}`}return t.id=t.contentUrl,t.lodMetricType=g,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=function(t){if(!t.contentUrl)return l;const e=t.contentUrl.split(".").pop();switch(e){case"pnts":return m;case"i3dm":case"b3dm":return d;default:return e}}(t),t.refine=function(t){switch(t){case"REPLACE":case"replace":return f;case"ADD":case"add":return h;default:return t}}(t.refine),t}const Wr={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.0.13",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(t,e,r){const s=e["3d-tiles"]||{};let i;i="auto"===s.isTileset?r.url&&-1!==r.url.indexOf(".json"):s.isTileset;t=i?await async function(t,e,r){const s=JSON.parse((new TextDecoder).decode(t));return s.loader=e.loader||Wr,s.url=r.url,s.basePath=function(t){return n.dirname(t.url)}(s),s.root=function(t){const e=t.basePath,r=Hr(t.root,t),n=[];for(n.push(r);n.length>0;){const t=n.pop().children||[];for(const r of t)Hr(r,{basePath:e}),n.push(r)}return r}(s),s.type=y,s.lodMetricType=g,s.lodMetricValue=s.root.lodMetricValue,s}(t,e,r):await async function(t,e,r){const n={content:{featureIds:null}};return await qr(t,0,e,r,n.content),n.content}(t,e,r);return t},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};let $r="";const Kr={};const Qr=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Yr=t=>"undefined"!=typeof Blob&&t instanceof Blob,Zr=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Jr=/^([-\w.]+\/[-\w.+]+)/;function Xr(t){const e=Jr.exec(t);return e?e[1]:t}function tn(t){const e=Zr.exec(t);return e?e[1]:""}const en=/\?.*/;function rn(t){return t.replace(en,"")}async function nn(t){if(Qr(t))return t;const e={},r=function(t){return Qr(t)?t.headers["content-length"]||-1:Yr(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}(t);r>=0&&(e["content-length"]=String(r));const{url:n,type:s}=function(t){if(Qr(t)){const e=rn(t.url||"");return{url:e,type:Xr(t.headers.get("content-type")||"")||tn(e)}}return Yr(t)?{url:rn(t.name||""),type:t.type||""}:"string"==typeof t?{url:rn(t),type:tn(t)}:{url:"",type:""}}(t);s&&(e["content-type"]=s);const i=await async function(t){if("string"==typeof t)return"data:,"+t.slice(0,5);if(t instanceof Blob){const e=t.slice(0,5);return await new Promise(t=>{const r=new FileReader;r.onload=e=>{var r;return t(null==e||null===(r=e.target)||void 0===r?void 0:r.result)},r.readAsDataURL(e)})}if(t instanceof ArrayBuffer){const e=t.slice(0,5);return"data:base64,"+function(t){let e="";const r=new Uint8Array(t);for(let t=0;t<r.byteLength;t++)e+=String.fromCharCode(r[t]);return btoa(e)}(e)}return null}(t);i&&(e["x-first-bytes"]=i),"string"==typeof t&&(t=(new TextEncoder).encode(t));const o=new Response(t,{headers:e});return Object.defineProperty(o,"url",{value:n}),o}async function sn(t,e){if("string"==typeof t){t=function(t){for(const e in Kr)if(t.startsWith(e)){const r=Kr[e];t=t.replace(e,r)}return t.startsWith("http://")||t.startsWith("https://")||(t=`${$r}${t}`),t}(t);let r=e;return null!=e&&e.fetch&&"function"!=typeof(null==e?void 0:e.fetch)&&(r=e.fetch),await fetch(t,r)}return await nn(t)}async function on(t,e){if(!e){const r=await async function(t){T(t);const e={Authorization:"Bearer "+t},r=await sn("https://api.cesium.com/v1/assets",{fetch:{headers:e}});if(!r.ok)throw new Error(r.statusText);return await r.json()}(t);for(const t of r.items)"3DTILES"===t.type&&(e=t.id)}const r=await async function(t,e){T(t,e);const r={Authorization:"Bearer "+t},n="https://api.cesium.com/v1/assets/"+e;let s=await sn(""+n,{fetch:{headers:r}});if(!s.ok)throw new Error(s.statusText);let i=await s.json();if(s=await sn(n+"/endpoint",{fetch:{headers:r}}),!s.ok)throw new Error(s.statusText);const o=await s.json();return i={...i,...o},i}(t,e),{type:n,url:s}=r;return T("3DTILES"===n&&s),r.headers={Authorization:"Bearer "+r.accessToken},r}const an={...Wr,id:"cesium-ion",name:"Cesium Ion",preload:async function(t,e={}){e=e["cesium-ion"]||{};const{accessToken:r}=e;let n=e.assetId;if(!Number.isFinite(n)){const e=t.match(/\/([0-9]+)\/tileset.json/);n=e&&e[1]}return on(r,n)},parse:async(t,e,r)=>((e={...e})["3d-tiles"]=e["cesium-ion"],e.loader=an,Wr.parse(t,e,r)),options:{"cesium-ion":{...Wr.options["3d-tiles"],accessToken:null}}};function cn(t,e,r){if(!e)return r+12;const{magic:n,version:s=1,byteLength:i=12}=t;return T(Array.isArray(n)&&Number.isFinite(s)&&Number.isFinite(i)),e.setUint8(r+0,n[0]),e.setUint8(r+1,n[1]),e.setUint8(r+2,n[2]),e.setUint8(r+3,n[3]),e.setUint32(r+4,s,!0),e.setUint32(r+8,i,!0),r+=12}function un(t,e,r){t&&t.setUint32(e+8,r,!0)}function hn(t,e,r,n){return e=function(t,e,r,n){const s=we(r.byteLength,n),i=s-r.byteLength;if(t){const n=new Uint8Array(t.buffer,t.byteOffset+e,r.byteLength),s=new Uint8Array(r);n.set(s);for(let n=0;n<i;++n)t.setUint8(e+r.byteLength+n,32)}return e+=s}(t,e,(new TextEncoder).encode(r),n)}function fn(t,e,r,n){if(t)for(let s=0;s<n;s++)t.setUint8(e+s,r.charCodeAt(s));return e+n}function ln(t,e,r,n){if(t)for(let s=0;s<n;s++)t.setUint8(e+s,r[s]);return e+n}const dn={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function mn(t,e,r,n){const{featureTableJson:s=dn}=t;let i=JSON.stringify(s);i=function(t,e){const r=t.length,n=Math.ceil(r/e)*e-r;let s="";for(let t=0;t<n;++t)s+=" ";return t+s}(i,4);const{featureTableJsonByteLength:o=i.length}=t,a=new ArrayBuffer(12),c=a.byteLength,u=r;return r+=cn(t={magic:b.POINT_CLOUD,...t},e,0),e&&(e.setUint32(r+0,o,!0),e.setUint32(r+4,c,!0),e.setUint32(r+8,0,!0),e.setUint32(r+12,0,!0)),r+=16,r+=fn(e,r,i,o),un(e,u,(r+=ln(e,r,a,c))-u),r}function yn(t,e,r,n){switch(T("string"==typeof t.type),t.type){case p.COMPOSITE:return function(t,e,r,n,s){const i=r;r+=cn(t={magic:b.COMPOSITE,tiles:[],...t},e,r),e&&e.setUint32(r,t.tiles.length,!0),r+=4;for(let i=0;i<t.tiles.length;++i)r+=s(t.tiles[i],e,r,n);return un(e,i,r-i),r}(t,e,r,n,yn);case p.POINT_CLOUD:return mn(t,e,r);case p.BATCHED_3D_MODEL:return function(t,e,r,n){const{featuresLength:s=0,batchTable:i}=t,o={BATCH_LENGTH:s},a=JSON.stringify(o),c=i?JSON.stringify(i):"",u=we(a.length,8),h=c?we(c.length,8):0,f=r;r=cn(t={magic:b.BATCHED_MODEL,...t},e,r),e&&(e.setUint32(12,u,!0),e.setUint32(16,0,!0),e.setUint32(20,h,!0),e.setUint32(24,0,!0)),r=hn(e,r+=16,a,8),i&&(r=hn(e,r,c,8));const l=t.gltfEncoded;return l&&(r=ln(e,r,l,l.byteLength)),un(e,f,r-f),r}(t,e,r);case p.INSTANCED_3D_MODEL:return function(t,e,r,n){const{featuresLength:s=1,gltfFormat:i=1,gltfUri:o=""}=t,a=o.length,c={INSTANCES_LENGTH:s,POSITION:new Array(3*s).fill(0)},u=JSON.stringify(c),h=u.length,f=r;return r=cn(t={magic:b.INSTANCED_MODEL,...t},e,0),e&&(e.setUint32(12,h,!0),e.setUint32(16,0,!0),e.setUint32(20,0,!0),e.setUint32(24,0,!0),e.setUint32(28,i,!0)),r+=20,r+=fn(e,r,u,h),un(e,f,(r+=fn(e,r,o,a))-f),r}(t,e,r);default:throw new Error("3D Tiles: unknown tile type")}}const gn={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:"3.0.13",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:function(t,e){return function(t,e){const r=yn(t,null,0,e),n=new ArrayBuffer(r);return yn(t,new DataView(n),0,e),n}(t,e)},binary:!0,options:{"3d-tiles":{}}}},,,,,,function(t,e,r){"use strict";r.d(e,"a",(function(){return h}));var n=r(20),s=r(3),i=r(1),o=r(2),a=r(8);const c=[0,0,0],u={};class h extends n.a{static get ZERO(){return u.ZERO=u.ZERO||Object.freeze(new h(0,0,0,0))}constructor(t=0,e=0,r=0){super(-0,-0,-0),1===arguments.length&&Object(s.e)(t)?this.copy(t):(s.b.debug&&(Object(i.a)(t),Object(i.a)(e),Object(i.a)(r)),this[0]=t,this[1]=e,this[2]=r)}set(t,e,r){return this[0]=t,this[1]=e,this[2]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return s.b.debug&&(Object(i.a)(t.x),Object(i.a)(t.y),Object(i.a)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Object(i.a)(t)}angle(t){return o.a(this,t)}cross(t){return o.c(this,this,t),this.check()}rotateX({radians:t,origin:e=c}){return o.i(this,this,e,t),this.check()}rotateY({radians:t,origin:e=c}){return o.j(this,this,e,t),this.check()}rotateZ({radians:t,origin:e=c}){return o.k(this,this,e,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return o.m(this,this,t),this.check()}transformAsVector(t){return Object(a.c)(this,this,t),this.check()}transformByMatrix3(t){return o.l(this,this,t),this.check()}transformByMatrix2(t){return Object(a.b)(this,this,t),this.check()}transformByQuaternion(t){return o.n(this,this,t),this.check()}}},function(t,e,r){"use strict";e.a={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:2*Math.PI}},function(t,e,r){"use strict";r.d(e,"a",(function(){return m}));var n=r(1),s=r(21),i=r(8),o=r(5),a=r(9),c=r(2),u=r(4);const h=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),f=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),l=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),d={};class m extends s.a{static get IDENTITY(){return d.IDENTITY=d.IDENTITY||Object.freeze(new m(h)),d.IDENTITY}static get ZERO(){return d.ZERO=d.ZERO||Object.freeze(new m(f)),d.ZERO}get INDICES(){return l}get ELEMENTS(){return 16}get RANK(){return 4}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,r,n,s,i,o,a,c,u,h,f,l,d,m,y){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=s,this[5]=i,this[6]=o,this[7]=a,this[8]=c,this[9]=u,this[10]=h,this[11]=f,this[12]=l,this[13]=d,this[14]=m,this[15]=y,this.check()}setRowMajor(t,e,r,n,s,i,o,a,c,u,h,f,l,d,m,y){return this[0]=t,this[1]=s,this[2]=c,this[3]=l,this[4]=e,this[5]=i,this[6]=u,this[7]=d,this[8]=r,this[9]=o,this[10]=h,this[11]=m,this[12]=n,this[13]=a,this[14]=f,this[15]=y,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(h)}fromQuaternion(t){return o.b(this,t),this.check()}frustum({left:t,right:e,bottom:r,top:n,near:s,far:i}){return i===1/0?m._computeInfinitePerspectiveOffCenter(this,t,e,r,n,s):o.c(this,t,e,r,n,s,i),this.check()}static _computeInfinitePerspectiveOffCenter(t,e,r,n,s,i){const o=2*i/(r-e),a=2*i/(s-n),c=(r+e)/(r-e),u=(s+n)/(s-n),h=-2*i;return t[0]=o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=c,t[9]=u,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}lookAt(t,e,r){return 1===arguments.length&&({eye:t,center:e,up:r}=t),e=e||[0,0,0],r=r||[0,1,0],o.e(this,t,e,r),this.check()}ortho({left:t,right:e,bottom:r,top:n,near:s=.1,far:i=500}){return o.g(this,t,e,r,n,s,i),this.check()}orthographic({fovy:t=45*Math.PI/180,aspect:e=1,focalDistance:r=1,near:n=.1,far:s=500}){if(t>2*Math.PI)throw Error("radians");const i=t/2,o=r*Math.tan(i),a=o*e;return(new m).ortho({left:-a,right:a,bottom:-o,top:o,near:n,far:s})}perspective({fovy:t,fov:e=45*Math.PI/180,aspect:r=1,near:n=.1,far:s=500}={}){if((t=t||e)>2*Math.PI)throw Error("radians");return o.h(this,t,r,n,s),this.check()}determinant(){return o.a(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const r=this.getScale(e||[-0,-0,-0]),n=1/r[0],s=1/r[1],i=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*s,t[2]=this[2]*i,t[3]=0,t[4]=this[4]*n,t[5]=this[5]*s,t[6]=this[6]*i,t[7]=0,t[8]=this[8]*n,t[9]=this[9]*s,t[10]=this[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const r=this.getScale(e||[-0,-0,-0]),n=1/r[0],s=1/r[1],i=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*s,t[2]=this[2]*i,t[3]=this[4]*n,t[4]=this[5]*s,t[5]=this[6]*i,t[6]=this[8]*n,t[7]=this[9]*s,t[8]=this[10]*i,t}transpose(){return o.o(this,this),this.check()}invert(){return o.d(this,this),this.check()}multiplyLeft(t){return o.f(this,t,this),this.check()}multiplyRight(t){return o.f(this,this,t),this.check()}rotateX(t){return o.j(this,this,t),this.check()}rotateY(t){return o.k(this,this,t),this.check()}rotateZ(t){return o.l(this,this,t),this.check()}rotateXYZ([t,e,r]){return this.rotateX(t).rotateY(e).rotateZ(r)}rotateAxis(t,e){return o.i(this,this,t,e),this.check()}scale(t){return Array.isArray(t)?o.m(this,this,t):o.m(this,this,[t,t,t]),this.check()}translate(t){return o.n(this,this,t),this.check()}transform(t,e){return 4===t.length?(e=u.n(e||[-0,-0,-0,-0],t,this),Object(n.b)(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:r}=t;switch(r){case 2:e=a.d(e||[-0,-0],t,this);break;case 3:e=c.m(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(n.b)(e,t.length),e}transformAsVector(t,e){switch(t.length){case 2:e=Object(i.a)(e||[-0,-0],t,this);break;case 3:e=Object(i.c)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(n.b)(e,t.length),e}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,r){return this.identity().translate([t,e,r])}transformPoint(t,e){return Object(n.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}transformVector(t,e){return Object(n.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}transformDirection(t,e){return Object(n.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return d}));var n=r(21),s=r(1),i=r(8),o=r(7),a=r(9),c=r(2);const u=Object.freeze([1,0,0,0,1,0,0,0,1]),h=Object.freeze([0,0,0,0,0,0,0,0,0]),f=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),l={};class d extends n.a{static get IDENTITY(){return l.IDENTITY=l.IDENTITY||Object.freeze(new d(u)),l.IDENTITY}static get ZERO(){return l.ZERO=l.ZERO||Object.freeze(new d(h)),l.ZERO}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return f}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}set(t,e,r,n,s,i,o,a,c){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=s,this[5]=i,this[6]=o,this[7]=a,this[8]=c,this.check()}setRowMajor(t,e,r,n,s,i,o,a,c){return this[0]=t,this[1]=n,this[2]=o,this[3]=e,this[4]=s,this[5]=a,this[6]=r,this[7]=i,this[8]=c,this.check()}determinant(){return o.b(this)}identity(){return this.copy(u)}fromQuaternion(t){return o.c(this,t),this.check()}transpose(){return o.i(this,this),this.check()}invert(){return o.d(this,this),this.check()}multiplyLeft(t){return o.e(this,t,this),this.check()}multiplyRight(t){return o.e(this,this,t),this.check()}rotate(t){return o.f(this,this,t),this.check()}scale(t){return Array.isArray(t)?o.g(this,this,t):o.g(this,this,[t,t,t]),this.check()}translate(t){return o.h(this,this,t),this.check()}transform(t,e){switch(t.length){case 2:e=a.c(e||[-0,-0],t,this);break;case 3:e=c.l(e||[-0,-0,-0],t,this);break;case 4:e=Object(i.d)(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(s.b)(e,t.length),e}transformVector(t,e){return Object(s.c)("Matrix3.transformVector"),this.transform(t,e)}transformVector2(t,e){return Object(s.c)("Matrix3.transformVector"),this.transform(t,e)}transformVector3(t,e){return Object(s.c)("Matrix3.transformVector"),this.transform(t,e)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return M}));var n=r(14),s=r(1),i=r(6),o=r(0),a=r(7),c=r(2),u=r(4);function h(){var t=new o.a(4);return o.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function f(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function l(t,e,r){var n=e[0],s=e[1],i=e[2],o=e[3],a=r[0],c=r[1],u=r[2],h=r[3];return t[0]=n*h+o*a+s*u-i*c,t[1]=s*h+o*c+i*a-n*u,t[2]=i*h+o*u+n*c-s*a,t[3]=o*h-n*a-s*c-i*u,t}function d(t,e,r,n){var s,i,a,c,u,h=e[0],f=e[1],l=e[2],d=e[3],m=r[0],y=r[1],g=r[2],p=r[3];return(i=h*m+f*y+l*g+d*p)<0&&(i=-i,m=-m,y=-y,g=-g,p=-p),1-i>o.b?(s=Math.acos(i),a=Math.sin(s),c=Math.sin((1-n)*s)/a,u=Math.sin(n*s)/a):(c=1-n,u=n),t[0]=c*h+u*m,t[1]=c*f+u*y,t[2]=c*l+u*g,t[3]=c*d+u*p,t}function m(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var s=0;e[4]>e[0]&&(s=1),e[8]>e[3*s+s]&&(s=2);var i=(s+1)%3,o=(s+2)%3;r=Math.sqrt(e[3*s+s]-e[3*i+i]-e[3*o+o]+1),t[s]=.5*r,r=.5/r,t[3]=(e[3*i+o]-e[3*o+i])*r,t[i]=(e[3*i+s]+e[3*s+i])*r,t[o]=(e[3*o+s]+e[3*s+o])*r}return t}u.b,u.g,u.c,u.l;var y,g,p,b,T,w,E=u.a,O=u.k,_=u.d,A=u.i,I=u.h,v=u.m,S=u.j,N=(u.f,u.e,y=c.b(),g=c.e(1,0,0),p=c.e(0,1,0),function(t,e,r){var n=c.d(e,r);return n<-.999999?(c.c(y,g,e),c.f(y)<1e-6&&c.c(y,p,e),c.h(y,y),f(t,y,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(c.c(y,e,r),t[0]=y[0],t[1]=y[1],t[2]=y[2],t[3]=1+n,S(t,t))});b=h(),T=h(),w=a.a();const x=[0,0,0,1];class M extends n.a{constructor(t=0,e=0,r=0,n=1){super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,r,n)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,r,n){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this.check()}fromMatrix3(t){return m(this,t),this.check()}identity(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.check()}fromAxisRotation(t,e){return f(this,t,e),this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Object(s.a)(t)}get y(){return this[1]}set y(t){this[1]=Object(s.a)(t)}get z(){return this[2]}set z(t){this[2]=Object(s.a)(t)}get w(){return this[3]}set w(t){this[3]=Object(s.a)(t)}len(){return I(this)}lengthSquared(){return v(this)}dot(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return _(this,t)}rotationTo(t,e){return N(this,t,e),this.check()}add(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return E(this,this,t),this.check()}calculateW(){var t,e,r,n,s;return t=this,r=(e=this)[0],n=e[1],s=e[2],t[0]=r,t[1]=n,t[2]=s,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-s*s)),this.check()}conjugate(){var t,e;return e=this,(t=this)[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],this.check()}invert(){var t,e,r,n,s,i,o,a;return t=this,r=(e=this)[0],n=e[1],s=e[2],i=e[3],a=(o=r*r+n*n+s*s+i*i)?1/o:0,t[0]=-r*a,t[1]=-n*a,t[2]=-s*a,t[3]=i*a,this.check()}lerp(t,e,r){return A(this,t,e,r),this.check()}multiplyRight(t,e){return Object(i.a)(!e),l(this,this,t),this.check()}multiplyLeft(t,e){return Object(i.a)(!e),l(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,r){r*=.5;var n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(r),c=Math.cos(r);t[0]=n*c+o*a,t[1]=s*c+i*a,t[2]=i*c-s*a,t[3]=o*c-n*a}(this,this,t),this.check()}rotateY(t){return function(t,e,r){r*=.5;var n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(r),c=Math.cos(r);t[0]=n*c-i*a,t[1]=s*c+o*a,t[2]=i*c+n*a,t[3]=o*c-s*a}(this,this,t),this.check()}rotateZ(t){return function(t,e,r){r*=.5;var n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(r),c=Math.cos(r);t[0]=n*c+s*a,t[1]=s*c-n*a,t[2]=i*c+o*a,t[3]=o*c-i*a}(this,this,t),this.check()}scale(t){return O(this,this,t),this.check()}slerp(t,e,r){switch(arguments.length){case 1:({start:t=x,target:e,ratio:r}=arguments[0]);break;case 2:[e,r]=arguments,t=this}return d(this,t,e,r),this.check()}transformVector4(t,e=t){return u.o(e,t,this),Object(s.b)(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t,e){return this.multiplyLeft(t,e)}multiply(t,e){return this.multiplyRight(t,e)}}}])}));
2
2
  //# sourceMappingURL=dist.min.js.map