@loaders.gl/tile-converter 3.2.6 → 3.3.0-alpha.2

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 (77) hide show
  1. package/dist/3d-tiles-attributes-worker.js +3 -3
  2. package/dist/3d-tiles-attributes-worker.js.map +1 -1
  3. package/dist/converter-cli.js +30 -7
  4. package/dist/converter.min.js +1 -1
  5. package/dist/dist.min.js +1123 -624
  6. package/dist/es5/3d-tiles-attributes-worker.js +1 -1
  7. package/dist/es5/3d-tiles-attributes-worker.js.map +1 -1
  8. package/dist/es5/converter-cli.js +42 -12
  9. package/dist/es5/converter-cli.js.map +1 -1
  10. package/dist/es5/i3s-attributes-worker.js +1 -1
  11. package/dist/es5/i3s-attributes-worker.js.map +1 -1
  12. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +146 -0
  13. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
  14. package/dist/es5/i3s-converter/helpers/feature-attributes.js +60 -0
  15. package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -0
  16. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +39 -7
  17. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  18. package/dist/es5/i3s-converter/helpers/geometry-converter.js +177 -59
  19. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  20. package/dist/es5/i3s-converter/helpers/gltf-attributes.js +15 -1
  21. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  22. package/dist/es5/i3s-converter/i3s-converter.js +50 -51
  23. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  24. package/dist/es5/lib/utils/write-queue.js +3 -5
  25. package/dist/es5/lib/utils/write-queue.js.map +1 -1
  26. package/dist/es5/pgm-loader.js +1 -1
  27. package/dist/es5/pgm-loader.js.map +1 -1
  28. package/dist/esm/3d-tiles-attributes-worker.js +1 -1
  29. package/dist/esm/3d-tiles-attributes-worker.js.map +1 -1
  30. package/dist/esm/converter-cli.js +37 -7
  31. package/dist/esm/converter-cli.js.map +1 -1
  32. package/dist/esm/i3s-attributes-worker.js +1 -1
  33. package/dist/esm/i3s-attributes-worker.js.map +1 -1
  34. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +128 -0
  35. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
  36. package/dist/esm/i3s-converter/helpers/feature-attributes.js +34 -0
  37. package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -0
  38. package/dist/esm/i3s-converter/helpers/geometry-attributes.js +23 -7
  39. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  40. package/dist/esm/i3s-converter/helpers/geometry-converter.js +145 -38
  41. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  42. package/dist/esm/i3s-converter/helpers/gltf-attributes.js +15 -1
  43. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  44. package/dist/esm/i3s-converter/i3s-converter.js +21 -27
  45. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  46. package/dist/esm/lib/utils/write-queue.js +3 -5
  47. package/dist/esm/lib/utils/write-queue.js.map +1 -1
  48. package/dist/esm/pgm-loader.js +1 -1
  49. package/dist/esm/pgm-loader.js.map +1 -1
  50. package/dist/i3s-attributes-worker.js +3 -3
  51. package/dist/i3s-attributes-worker.js.map +3 -3
  52. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +12 -0
  53. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -0
  54. package/dist/i3s-converter/helpers/batch-ids-extensions.js +138 -0
  55. package/dist/i3s-converter/helpers/feature-attributes.d.ts +24 -0
  56. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -0
  57. package/dist/i3s-converter/helpers/feature-attributes.js +55 -0
  58. package/dist/i3s-converter/helpers/geometry-attributes.js +26 -7
  59. package/dist/i3s-converter/helpers/geometry-converter.d.ts +9 -2
  60. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  61. package/dist/i3s-converter/helpers/geometry-converter.js +140 -44
  62. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -1
  63. package/dist/i3s-converter/helpers/gltf-attributes.js +13 -0
  64. package/dist/i3s-converter/i3s-converter.d.ts +7 -14
  65. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  66. package/dist/i3s-converter/i3s-converter.js +44 -35
  67. package/dist/lib/utils/write-queue.d.ts.map +1 -1
  68. package/dist/lib/utils/write-queue.js +3 -4
  69. package/package.json +15 -15
  70. package/src/converter-cli.ts +33 -7
  71. package/src/i3s-converter/helpers/batch-ids-extensions.ts +199 -0
  72. package/src/i3s-converter/helpers/feature-attributes.ts +65 -0
  73. package/src/i3s-converter/helpers/geometry-attributes.ts +30 -7
  74. package/src/i3s-converter/helpers/geometry-converter.ts +187 -48
  75. package/src/i3s-converter/helpers/gltf-attributes.ts +15 -0
  76. package/src/i3s-converter/i3s-converter.ts +38 -41
  77. package/src/lib/utils/write-queue.ts +7 -5
@@ -1,4 +1,4 @@
1
- var ms=Object.create;var Ar=Object.defineProperty,gs=Object.defineProperties,ys=Object.getOwnPropertyDescriptor,Ms=Object.getOwnPropertyDescriptors,xs=Object.getOwnPropertyNames,mn=Object.getOwnPropertySymbols,bs=Object.getPrototypeOf,gn=Object.prototype.hasOwnProperty,_s=Object.prototype.propertyIsEnumerable;var yn=(e,r,t)=>r in e?Ar(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Q=(e,r)=>{for(var t in r||(r={}))gn.call(r,t)&&yn(e,t,r[t]);if(mn)for(var t of mn(r))_s.call(r,t)&&yn(e,t,r[t]);return e},Mn=(e,r)=>gs(e,Ms(r)),Ts=e=>Ar(e,"__esModule",{value:!0});var R=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ks=(e,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of xs(r))!gn.call(e,a)&&a!=="default"&&Ar(e,a,{get:()=>r[a],enumerable:!(t=ys(r,a))||t.enumerable});return e},xn=e=>ks(Ts(Ar(e!=null?ms(bs(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var G=R((np,An)=>{function Us(e){return e&&e.__esModule?e:{default:e}}An.exports=Us});var te=R((ap,Ir)=>{function Lr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ir.exports=Lr=function(t){return typeof t}:Ir.exports=Lr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lr(e)}Ir.exports=Lr});var qt=R((ip,wt)=>{function Pt(e,r){return wt.exports=Pt=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},Pt(e,r)}wt.exports=Pt});var Pn=R((sp,En)=>{function Gs(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}En.exports=Gs});var wn=R((op,Cr)=>{var js=qt(),Zs=Pn();function Nr(e,r,t){return Zs()?Cr.exports=Nr=Reflect.construct:Cr.exports=Nr=function(n,i,s){var o=[null];o.push.apply(o,i);var c=Function.bind.apply(n,o),u=new c;return s&&js(u,s.prototype),u},Nr.apply(null,arguments)}Cr.exports=Nr});var Lt=R((cp,qn)=>{function Xs(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}qn.exports=Xs});var In=R((up,Ln)=>{var Qs=Lt();function $s(e){if(Array.isArray(e))return Qs(e)}Ln.exports=$s});var Cn=R((lp,Nn)=>{function Js(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}Nn.exports=Js});var It=R((fp,Wn)=>{var Dn=Lt();function Hs(e,r){if(!!e){if(typeof e=="string")return Dn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Dn(e,r)}}Wn.exports=Hs});var Fn=R((hp,Bn)=>{function Ks(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Bn.exports=Ks});var Yn=R((dp,zn)=>{var eo=In(),ro=Cn(),to=It(),no=Fn();function ao(e){return eo(e)||ro(e)||to(e)||no()}zn.exports=ao});var ze=R(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.default=io;function io(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}});var ge=R(F=>{"use strict";var Dr=G();Object.defineProperty(F,"__esModule",{value:!0});F.configure=fo;F.formatValue=po;F.isArray=Ye;F.clone=mo;F.toRadians=go;F.toDegrees=yo;F.radians=Un;F.degrees=Gn;F.sin=Mo;F.cos=xo;F.tan=bo;F.asin=_o;F.acos=To;F.atan=ko;F.clamp=Oo;F.lerp=jn;F.equals=Zn;F.exactEquals=Xn;F.withEpsilon=Ro;F.config=void 0;var Vn=Dr(te()),so=Dr(wn()),oo=Dr(Yn()),co=Dr(ze()),uo=1/Math.PI*180,lo=1/180*Math.PI,V={};F.config=V;V.EPSILON=1e-12;V.debug=!1;V.precision=4;V.printTypes=!1;V.printDegrees=!1;V.printRowMajor=!0;function fo(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};for(var r in e)(0,co.default)(r in V),V[r]=e[r];return V}function ho(e){return Math.round(e/V.EPSILON)*V.EPSILON}function po(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.precision,a=t===void 0?V.precision||4:t;return e=ho(e),"".concat(parseFloat(e.toPrecision(a)))}function Ye(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vo(e){return e.clone?e.clone():new Array(e.length)}function mo(e){return e.clone?e.clone():(0,so.default)(Array,(0,oo.default)(e))}function _e(e,r,t){if(Ye(e)){t=t||vo(e);for(var a=0;a<t.length&&a<e.length;++a)t[a]=r(e[a],a,t);return t}return r(e)}function go(e){return Un(e)}function yo(e){return Gn(e)}function Un(e,r){return _e(e,function(t){return t*lo},r)}function Gn(e,r){return _e(e,function(t){return t*uo},r)}function Mo(e){return _e(e,function(r){return Math.sin(r)})}function xo(e){return _e(e,function(r){return Math.cos(r)})}function bo(e){return _e(e,function(r){return Math.tan(r)})}function _o(e){return _e(e,function(r){return Math.asin(r)})}function To(e){return _e(e,function(r){return Math.acos(r)})}function ko(e){return _e(e,function(r){return Math.atan(r)})}function Oo(e,r,t){return _e(e,function(a){return Math.max(r,Math.min(t,a))})}function jn(e,r,t){return Ye(e)?e.map(function(a,n){return jn(a,r[n],t)}):t*r+(1-t)*e}function Zn(e,r,t){var a=V.EPSILON;t&&(V.EPSILON=t);try{if(e===r)return!0;if(Ye(e)&&Ye(r)){if(e.length!==r.length)return!1;for(var n=0;n<e.length;++n)if(!Zn(e[n],r[n]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):Number.isFinite(e)&&Number.isFinite(r)?Math.abs(e-r)<=V.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{V.EPSILON=a}}function Xn(e,r){if(e===r)return!0;if(e&&(0,Vn.default)(e)==="object"&&r&&(0,Vn.default)(r)==="object"){if(e.constructor!==r.constructor)return!1;if(e.exactEquals)return e.exactEquals(r)}if(Ye(e)&&Ye(r)){if(e.length!==r.length)return!1;for(var t=0;t<e.length;++t)if(!Xn(e[t],r[t]))return!1;return!0}return!1}function Ro(e,r){var t=V.EPSILON;V.EPSILON=e;var a;try{a=r()}finally{V.EPSILON=t}return a}});var $=R((mp,Qn)=>{function So(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}Qn.exports=So});var J=R((gp,Jn)=>{function $n(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ao(e,r,t){return r&&$n(e.prototype,r),t&&$n(e,t),e}Jn.exports=Ao});var se=R((yp,Hn)=>{var Eo=qt();function Po(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&Eo(e,r)}Hn.exports=Po});var ea=R((Mp,Kn)=>{function wo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Kn.exports=wo});var oe=R((xp,ra)=>{var qo=te(),Lo=ea();function Io(e,r){return r&&(qo(r)==="object"||typeof r=="function")?r:Lo(e)}ra.exports=Io});var ce=R((bp,Dt)=>{function Ct(e){return Dt.exports=Ct=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ct(e)}Dt.exports=Ct});var br=R(Wr=>{"use strict";var rr=G();Object.defineProperty(Wr,"__esModule",{value:!0});Wr.default=void 0;var No=rr($()),Co=rr(J()),Do=rr(se()),Wo=rr(oe()),ta=rr(ce()),xr=ge(),Bo=rr(ze());function Fo(e){var r=zo();return function(){var a=(0,ta.default)(e),n;if(r){var i=(0,ta.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Wo.default)(this,n)}}function zo(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yo(e){function r(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var Vo=function(e){(0,Do.default)(t,e);var r=Fo(t);function t(){return(0,No.default)(this,t),r.apply(this,arguments)}return(0,Co.default)(t,[{key:"ELEMENTS",get:function(){return(0,Bo.default)(!1),0}},{key:"clone",value:function(){return new this.constructor().copy(this)}},{key:"from",value:function(n){return Array.isArray(n)?this.copy(n):this.fromObject(n)}},{key:"fromArray",value:function(n){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)this[s]=n[s+i];return this.check()}},{key:"to",value:function(n){return n===this?this:(0,xr.isArray)(n)?this.toArray(n):this.toObject(n)}},{key:"toTarget",value:function(n){return n?this.to(n):this}},{key:"toArray",value:function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)n[i+s]=this[s];return n}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(xr.config)}},{key:"formatString",value:function(n){for(var i="",s=0;s<this.ELEMENTS;++s)i+=(s>0?", ":"")+(0,xr.formatValue)(this[s],n);return"".concat(n.printTypes?this.constructor.name:"","[").concat(i,"]")}},{key:"equals",value:function(n){if(!n||this.length!==n.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(!(0,xr.equals)(this[i],n[i]))return!1;return!0}},{key:"exactEquals",value:function(n){if(!n||this.length!==n.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(this[i]!==n[i])return!1;return!0}},{key:"negate",value:function(){for(var n=0;n<this.ELEMENTS;++n)this[n]=-this[n];return this.check()}},{key:"lerp",value:function(n,i,s){s===void 0&&(s=i,i=n,n=this);for(var o=0;o<this.ELEMENTS;++o){var c=n[o];this[o]=c+s*(i[o]-c)}return this.check()}},{key:"min",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.min(n[i],this[i]);return this.check()}},{key:"max",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.max(n[i],this[i]);return this.check()}},{key:"clamp",value:function(n,i){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],n[s]),i[s]);return this.check()}},{key:"add",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]+=u[l];return this.check()}},{key:"subtract",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]-=u[l];return this.check()}},{key:"scale",value:function(n){if(Array.isArray(n))return this.multiply(n);for(var i=0;i<this.ELEMENTS;++i)this[i]*=n;return this.check()}},{key:"sub",value:function(n){return this.subtract(n)}},{key:"setScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=n;return this.check()}},{key:"addScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]+=n;return this.check()}},{key:"subScalar",value:function(n){return this.addScalar(-n)}},{key:"multiplyScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]*=n;return this.check()}},{key:"divideScalar",value:function(n){return this.scale(1/n)}},{key:"clampScalar",value:function(n,i){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],n),i);return this.check()}},{key:"multiplyByScalar",value:function(n){return this.scale(n)}},{key:"elements",get:function(){return this}},{key:"check",value:function(){if(xr.config.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var n=this.length===this.ELEMENTS,i=0;i<this.ELEMENTS;++i)n=n&&Number.isFinite(this[i]);return n}}]),t}(Yo(Array));Wr.default=Vo});var ue=R(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.validateVector=na;tr.checkNumber=Go;tr.checkVector=jo;tr.deprecated=Zo;var Uo=ge();function na(e,r){if(e.length!==r)return!1;for(var t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function Go(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function jo(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(Uo.config.debug&&!na(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}var aa={};function Zo(e,r){aa[e]||(aa[e]=!0,console.warn("".concat(e," has been removed in version ").concat(r,", see upgrade guide for more information")))}});var zr=R(Fr=>{"use strict";var Ve=G();Object.defineProperty(Fr,"__esModule",{value:!0});Fr.default=void 0;var Xo=Ve($()),Qo=Ve(J()),$o=Ve(se()),Jo=Ve(oe()),ia=Ve(ce()),Ho=Ve(br()),_r=ue(),Br=Ve(ze());function Ko(e){var r=ec();return function(){var a=(0,ia.default)(e),n;if(r){var i=(0,ia.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Jo.default)(this,n)}}function ec(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var rc=function(e){(0,$o.default)(t,e);var r=Ko(t);function t(){return(0,Xo.default)(this,t),r.apply(this,arguments)}return(0,Qo.default)(t,[{key:"ELEMENTS",get:function(){return(0,Br.default)(!1),0}},{key:"copy",value:function(n){return(0,Br.default)(!1),this}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,_r.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,_r.checkNumber)(n)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var n=0,i=0;i<this.ELEMENTS;++i)n+=this[i]*this[i];return n}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(n){return Math.sqrt(this.distanceSquared(n))}},{key:"distanceSquared",value:function(n){for(var i=0,s=0;s<this.ELEMENTS;++s){var o=this[s]-n[s];i+=o*o}return(0,_r.checkNumber)(i)}},{key:"dot",value:function(n){for(var i=0,s=0;s<this.ELEMENTS;++s)i+=this[s]*n[s];return(0,_r.checkNumber)(i)}},{key:"normalize",value:function(){var n=this.magnitude();if(n!==0)for(var i=0;i<this.ELEMENTS;++i)this[i]/=n;return this.check()}},{key:"multiply",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]*=u[l];return this.check()}},{key:"divide",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]/=u[l];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(n){return this.distance(n)}},{key:"distanceToSquared",value:function(n){return this.distanceSquared(n)}},{key:"getComponent",value:function(n){return(0,Br.default)(n>=0&&n<this.ELEMENTS,"index is out of range"),(0,_r.checkNumber)(this[n])}},{key:"setComponent",value:function(n,i){return(0,Br.default)(n>=0&&n<this.ELEMENTS,"index is out of range"),this[n]=i,this.check()}},{key:"addVectors",value:function(n,i){return this.copy(n).add(i)}},{key:"subVectors",value:function(n,i){return this.copy(n).subtract(i)}},{key:"multiplyVectors",value:function(n,i){return this.copy(n).multiply(i)}},{key:"addScaledVector",value:function(n,i){return this.add(new this.constructor(n).multiplyScalar(i))}}]),t}(Ho.default);Fr.default=rc});var Ue=R(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.setMatrixArrayType=nc;ne.toRadian=ic;ne.equals=sc;ne.RANDOM=ne.ARRAY_TYPE=ne.EPSILON=void 0;var sa=1e-6;ne.EPSILON=sa;var oa=typeof Float32Array!="undefined"?Float32Array:Array;ne.ARRAY_TYPE=oa;var tc=Math.random;ne.RANDOM=tc;function nc(e){ne.ARRAY_TYPE=oa=e}var ac=Math.PI/180;function ic(e){return e*ac}function sc(e,r){return Math.abs(e-r)<=sa*Math.max(1,Math.abs(e),Math.abs(r))}Math.hypot||(Math.hypot=function(){for(var e=0,r=arguments.length;r--;)e+=arguments[r]*arguments[r];return Math.sqrt(e)})});var Vr=R(O=>{"use strict";function Yr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yr=function(t){return typeof t}:Yr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(e)}Object.defineProperty(O,"__esModule",{value:!0});O.create=ua;O.clone=cc;O.fromValues=uc;O.copy=lc;O.set=fc;O.add=hc;O.subtract=la;O.multiply=fa;O.divide=ha;O.ceil=dc;O.floor=pc;O.min=vc;O.max=mc;O.round=gc;O.scale=yc;O.scaleAndAdd=Mc;O.distance=da;O.squaredDistance=pa;O.length=va;O.squaredLength=ma;O.negate=xc;O.inverse=bc;O.normalize=_c;O.dot=Tc;O.cross=kc;O.lerp=Oc;O.random=Rc;O.transformMat2=Sc;O.transformMat2d=Ac;O.transformMat3=Ec;O.transformMat4=Pc;O.rotate=wc;O.angle=qc;O.zero=Lc;O.str=Ic;O.exactEquals=Nc;O.equals=Cc;O.forEach=O.sqrLen=O.sqrDist=O.dist=O.div=O.mul=O.sub=O.len=void 0;var Ge=oc(Ue());function ca(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return ca=function(){return e},e}function oc(e){if(e&&e.__esModule)return e;if(e===null||Yr(e)!=="object"&&typeof e!="function")return{default:e};var r=ca();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function ua(){var e=new Ge.ARRAY_TYPE(2);return Ge.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function cc(e){var r=new Ge.ARRAY_TYPE(2);return r[0]=e[0],r[1]=e[1],r}function uc(e,r){var t=new Ge.ARRAY_TYPE(2);return t[0]=e,t[1]=r,t}function lc(e,r){return e[0]=r[0],e[1]=r[1],e}function fc(e,r,t){return e[0]=r,e[1]=t,e}function hc(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e}function la(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e}function fa(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e}function ha(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e}function dc(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e}function pc(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e}function vc(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e}function mc(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e}function gc(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e}function yc(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e}function Mc(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e}function da(e,r){var t=r[0]-e[0],a=r[1]-e[1];return Math.hypot(t,a)}function pa(e,r){var t=r[0]-e[0],a=r[1]-e[1];return t*t+a*a}function va(e){var r=e[0],t=e[1];return Math.hypot(r,t)}function ma(e){var r=e[0],t=e[1];return r*r+t*t}function xc(e,r){return e[0]=-r[0],e[1]=-r[1],e}function bc(e,r){return e[0]=1/r[0],e[1]=1/r[1],e}function _c(e,r){var t=r[0],a=r[1],n=t*t+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=r[0]*n,e[1]=r[1]*n,e}function Tc(e,r){return e[0]*r[0]+e[1]*r[1]}function kc(e,r,t){var a=r[0]*t[1]-r[1]*t[0];return e[0]=e[1]=0,e[2]=a,e}function Oc(e,r,t,a){var n=r[0],i=r[1];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e}function Rc(e,r){r=r||1;var t=Ge.RANDOM()*2*Math.PI;return e[0]=Math.cos(t)*r,e[1]=Math.sin(t)*r,e}function Sc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e}function Ac(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n+t[4],e[1]=t[1]*a+t[3]*n+t[5],e}function Ec(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[3]*n+t[6],e[1]=t[1]*a+t[4]*n+t[7],e}function Pc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[4]*n+t[12],e[1]=t[1]*a+t[5]*n+t[13],e}function wc(e,r,t,a){var n=r[0]-t[0],i=r[1]-t[1],s=Math.sin(a),o=Math.cos(a);return e[0]=n*o-i*s+t[0],e[1]=n*s+i*o+t[1],e}function qc(e,r){var t=e[0],a=e[1],n=r[0],i=r[1],s=Math.sqrt(t*t+a*a)*Math.sqrt(n*n+i*i),o=s&&(t*n+a*i)/s;return Math.acos(Math.min(Math.max(o,-1),1))}function Lc(e){return e[0]=0,e[1]=0,e}function Ic(e){return"vec2("+e[0]+", "+e[1]+")"}function Nc(e,r){return e[0]===r[0]&&e[1]===r[1]}function Cc(e,r){var t=e[0],a=e[1],n=r[0],i=r[1];return Math.abs(t-n)<=Ge.EPSILON*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(a-i)<=Ge.EPSILON*Math.max(1,Math.abs(a),Math.abs(i))}var Dc=va;O.len=Dc;var Wc=la;O.sub=Wc;var Bc=fa;O.mul=Bc;var Fc=ha;O.div=Fc;var zc=da;O.dist=zc;var Yc=pa;O.sqrDist=Yc;var Vc=ma;O.sqrLen=Vc;var Uc=function(){var e=ua();return function(r,t,a,n,i,s){var o,c;for(t||(t=2),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],i(e,e,s),r[o]=e[0],r[o+1]=e[1];return r}}();O.forEach=Uc});var nr=R(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.vec2_transformMat4AsVector=Gc;je.vec3_transformMat4AsVector=jc;je.vec3_transformMat2=Zc;je.vec4_transformMat2=Xc;je.vec4_transformMat3=Qc;function Gc(e,r,t){var a=r[0],n=r[1],i=t[3]*a+t[7]*n||1;return e[0]=(t[0]*a+t[4]*n)/i,e[1]=(t[1]*a+t[5]*n)/i,e}function jc(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[3]*a+t[7]*n+t[11]*i||1;return e[0]=(t[0]*a+t[4]*n+t[8]*i)/s,e[1]=(t[1]*a+t[5]*n+t[9]*i)/s,e[2]=(t[2]*a+t[6]*n+t[10]*i)/s,e}function Zc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e[2]=r[2],e}function Xc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e[2]=r[2],e[3]=r[3],e}function Qc(e,r,t){var a=r[0],n=r[1],i=r[2];return e[0]=t[0]*a+t[3]*n+t[6]*i,e[1]=t[1]*a+t[4]*n+t[7]*i,e[2]=t[2]*a+t[5]*n+t[8]*i,e[3]=r[3],e}});var Ma=R(jr=>{"use strict";var ar=G(),$c=te();Object.defineProperty(jr,"__esModule",{value:!0});jr.default=void 0;var Jc=ar($()),Hc=ar(J()),Kc=ar(se()),eu=ar(oe()),ga=ar(ce()),ru=ar(zr()),Wt=ge(),Ur=ue(),Gr=nu(Vr()),tu=nr();function ya(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ya=function(n){return n?t:r})(e)}function nu(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||$c(e)!=="object"&&typeof e!="function")return{default:e};var t=ya(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function au(e){var r=iu();return function(){var a=(0,ga.default)(e),n;if(r){var i=(0,ga.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,eu.default)(this,n)}}function iu(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var su=function(e){(0,Kc.default)(t,e);var r=au(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(0,Jc.default)(this,t),a=r.call(this,2),(0,Wt.isArray)(n)&&arguments.length===1?a.copy(n):(Wt.config.debug&&((0,Ur.checkNumber)(n),(0,Ur.checkNumber)(i)),a[0]=n,a[1]=i),a}return(0,Hc.default)(t,[{key:"set",value:function(n,i){return this[0]=n,this[1]=i,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this.check()}},{key:"fromObject",value:function(n){return Wt.config.debug&&((0,Ur.checkNumber)(n.x),(0,Ur.checkNumber)(n.y)),this[0]=n.x,this[1]=n.y,this.check()}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(n){return this.transformAsPoint(n)}},{key:"transformAsPoint",value:function(n){return Gr.transformMat4(this,this,n),this.check()}},{key:"transformAsVector",value:function(n){return(0,tu.vec2_transformMat4AsVector)(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return Gr.transformMat3(this,this,n),this.check()}},{key:"transformByMatrix2x3",value:function(n){return Gr.transformMat2d(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return Gr.transformMat2(this,this,n),this.check()}}]),t}(ru.default);jr.default=su});var ke=R(T=>{"use strict";function Zr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Zr=function(t){return typeof t}:Zr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zr(e)}Object.defineProperty(T,"__esModule",{value:!0});T.create=ba;T.clone=cu;T.length=_a;T.fromValues=uu;T.copy=lu;T.set=fu;T.add=hu;T.subtract=Ta;T.multiply=ka;T.divide=Oa;T.ceil=du;T.floor=pu;T.min=vu;T.max=mu;T.round=gu;T.scale=yu;T.scaleAndAdd=Mu;T.distance=Ra;T.squaredDistance=Sa;T.squaredLength=Aa;T.negate=xu;T.inverse=bu;T.normalize=_u;T.dot=Ea;T.cross=Tu;T.lerp=ku;T.hermite=Ou;T.bezier=Ru;T.random=Su;T.transformMat4=Au;T.transformMat3=Eu;T.transformQuat=Pu;T.rotateX=wu;T.rotateY=qu;T.rotateZ=Lu;T.angle=Iu;T.zero=Nu;T.str=Cu;T.exactEquals=Du;T.equals=Wu;T.forEach=T.sqrLen=T.len=T.sqrDist=T.dist=T.div=T.mul=T.sub=void 0;var Te=ou(Ue());function xa(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return xa=function(){return e},e}function ou(e){if(e&&e.__esModule)return e;if(e===null||Zr(e)!=="object"&&typeof e!="function")return{default:e};var r=xa();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function ba(){var e=new Te.ARRAY_TYPE(3);return Te.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function cu(e){var r=new Te.ARRAY_TYPE(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function _a(e){var r=e[0],t=e[1],a=e[2];return Math.hypot(r,t,a)}function uu(e,r,t){var a=new Te.ARRAY_TYPE(3);return a[0]=e,a[1]=r,a[2]=t,a}function lu(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function fu(e,r,t,a){return e[0]=r,e[1]=t,e[2]=a,e}function hu(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function Ta(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function ka(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function Oa(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function du(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function pu(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function vu(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e}function mu(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e}function gu(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e}function yu(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function Mu(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e}function Ra(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2];return Math.hypot(t,a,n)}function Sa(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2];return t*t+a*a+n*n}function Aa(e){var r=e[0],t=e[1],a=e[2];return r*r+t*t+a*a}function xu(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function bu(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function _u(e,r){var t=r[0],a=r[1],n=r[2],i=t*t+a*a+n*n;return i>0&&(i=1/Math.sqrt(i)),e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e}function Ea(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function Tu(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[0],o=t[1],c=t[2];return e[0]=n*c-i*o,e[1]=i*s-a*c,e[2]=a*o-n*s,e}function ku(e,r,t,a){var n=r[0],i=r[1],s=r[2];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e[2]=s+a*(t[2]-s),e}function Ou(e,r,t,a,n,i){var s=i*i,o=s*(2*i-3)+1,c=s*(i-2)+i,u=s*(i-1),l=s*(3-2*i);return e[0]=r[0]*o+t[0]*c+a[0]*u+n[0]*l,e[1]=r[1]*o+t[1]*c+a[1]*u+n[1]*l,e[2]=r[2]*o+t[2]*c+a[2]*u+n[2]*l,e}function Ru(e,r,t,a,n,i){var s=1-i,o=s*s,c=i*i,u=o*s,l=3*i*o,h=3*c*s,f=c*i;return e[0]=r[0]*u+t[0]*l+a[0]*h+n[0]*f,e[1]=r[1]*u+t[1]*l+a[1]*h+n[1]*f,e[2]=r[2]*u+t[2]*l+a[2]*h+n[2]*f,e}function Su(e,r){r=r||1;var t=Te.RANDOM()*2*Math.PI,a=Te.RANDOM()*2-1,n=Math.sqrt(1-a*a)*r;return e[0]=Math.cos(t)*n,e[1]=Math.sin(t)*n,e[2]=a*r,e}function Au(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[3]*a+t[7]*n+t[11]*i+t[15];return s=s||1,e[0]=(t[0]*a+t[4]*n+t[8]*i+t[12])/s,e[1]=(t[1]*a+t[5]*n+t[9]*i+t[13])/s,e[2]=(t[2]*a+t[6]*n+t[10]*i+t[14])/s,e}function Eu(e,r,t){var a=r[0],n=r[1],i=r[2];return e[0]=a*t[0]+n*t[3]+i*t[6],e[1]=a*t[1]+n*t[4]+i*t[7],e[2]=a*t[2]+n*t[5]+i*t[8],e}function Pu(e,r,t){var a=t[0],n=t[1],i=t[2],s=t[3],o=r[0],c=r[1],u=r[2],l=n*u-i*c,h=i*o-a*u,f=a*c-n*o,d=n*f-i*h,p=i*l-a*f,m=a*h-n*l,v=s*2;return l*=v,h*=v,f*=v,d*=2,p*=2,m*=2,e[0]=o+l+d,e[1]=c+h+p,e[2]=u+f+m,e}function wu(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[0],i[1]=n[1]*Math.cos(a)-n[2]*Math.sin(a),i[2]=n[1]*Math.sin(a)+n[2]*Math.cos(a),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function qu(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[2]*Math.sin(a)+n[0]*Math.cos(a),i[1]=n[1],i[2]=n[2]*Math.cos(a)-n[0]*Math.sin(a),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function Lu(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[0]*Math.cos(a)-n[1]*Math.sin(a),i[1]=n[0]*Math.sin(a)+n[1]*Math.cos(a),i[2]=n[2],e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function Iu(e,r){var t=e[0],a=e[1],n=e[2],i=r[0],s=r[1],o=r[2],c=Math.sqrt(t*t+a*a+n*n),u=Math.sqrt(i*i+s*s+o*o),l=c*u,h=l&&Ea(e,r)/l;return Math.acos(Math.min(Math.max(h,-1),1))}function Nu(e){return e[0]=0,e[1]=0,e[2]=0,e}function Cu(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function Du(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function Wu(e,r){var t=e[0],a=e[1],n=e[2],i=r[0],s=r[1],o=r[2];return Math.abs(t-i)<=Te.EPSILON*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(a-s)<=Te.EPSILON*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(n-o)<=Te.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))}var Bu=Ta;T.sub=Bu;var Fu=ka;T.mul=Fu;var zu=Oa;T.div=zu;var Yu=Ra;T.dist=Yu;var Vu=Sa;T.sqrDist=Vu;var Uu=_a;T.len=Uu;var Gu=Aa;T.sqrLen=Gu;var ju=function(){var e=ba();return function(r,t,a,n,i,s){var o,c;for(t||(t=3),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],e[2]=r[o+2],i(e,e,s),r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2];return r}}();T.forEach=ju});var Qr=R(Xr=>{"use strict";var ir=G(),Zu=te();Object.defineProperty(Xr,"__esModule",{value:!0});Xr.default=void 0;var Xu=ir($()),Qu=ir(J()),$u=ir(se()),Ju=ir(oe()),Pa=ir(ce()),Hu=ir(zr()),Bt=ge(),Ze=ue(),Ee=Ku(ke()),wa=nr();function qa(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(qa=function(n){return n?t:r})(e)}function Ku(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Zu(e)!=="object"&&typeof e!="function")return{default:e};var t=qa(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function el(e){var r=rl();return function(){var a=(0,Pa.default)(e),n;if(r){var i=(0,Pa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Ju.default)(this,n)}}function rl(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ft=[0,0,0],La={},tl=function(e){(0,$u.default)(t,e);var r=el(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return(0,Xu.default)(this,t),a=r.call(this,-0,-0,-0),arguments.length===1&&(0,Bt.isArray)(n)?a.copy(n):(Bt.config.debug&&((0,Ze.checkNumber)(n),(0,Ze.checkNumber)(i),(0,Ze.checkNumber)(s)),a[0]=n,a[1]=i,a[2]=s),a}return(0,Qu.default)(t,[{key:"set",value:function(n,i,s){return this[0]=n,this[1]=i,this[2]=s,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this.check()}},{key:"fromObject",value:function(n){return Bt.config.debug&&((0,Ze.checkNumber)(n.x),(0,Ze.checkNumber)(n.y),(0,Ze.checkNumber)(n.z)),this[0]=n.x,this[1]=n.y,this[2]=n.z,this.check()}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n.z=this[2],n}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,Ze.checkNumber)(n)}},{key:"angle",value:function(n){return Ee.angle(this,n)}},{key:"cross",value:function(n){return Ee.cross(this,this,n),this.check()}},{key:"rotateX",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?Ft:s;return Ee.rotateX(this,this,o,i),this.check()}},{key:"rotateY",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?Ft:s;return Ee.rotateY(this,this,o,i),this.check()}},{key:"rotateZ",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?Ft:s;return Ee.rotateZ(this,this,o,i),this.check()}},{key:"transform",value:function(n){return this.transformAsPoint(n)}},{key:"transformAsPoint",value:function(n){return Ee.transformMat4(this,this,n),this.check()}},{key:"transformAsVector",value:function(n){return(0,wa.vec3_transformMat4AsVector)(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return Ee.transformMat3(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return(0,wa.vec3_transformMat2)(this,this,n),this.check()}},{key:"transformByQuaternion",value:function(n){return Ee.transformQuat(this,this,n),this.check()}}],[{key:"ZERO",get:function(){return La.ZERO=La.ZERO||Object.freeze(new t(0,0,0,0))}}]),t}(Hu.default);Xr.default=tl});var Ba=R($r=>{"use strict";var sr=G(),nl=te();Object.defineProperty($r,"__esModule",{value:!0});$r.default=void 0;var al=sr($()),il=sr(J()),sl=sr(se()),ol=sr(oe()),Ia=sr(ce()),cl=sr(zr()),zt=ge(),ye=ue(),Na=ul(ke()),Ca=nr();function Da(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Da=function(n){return n?t:r})(e)}function ul(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||nl(e)!=="object"&&typeof e!="function")return{default:e};var t=Da(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function ll(e){var r=fl();return function(){var a=(0,Ia.default)(e),n;if(r){var i=(0,Ia.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,ol.default)(this,n)}}function fl(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Wa={},hl=function(e){(0,sl.default)(t,e);var r=ll(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return(0,al.default)(this,t),a=r.call(this,-0,-0,-0,-0),(0,zt.isArray)(n)&&arguments.length===1?a.copy(n):(zt.config.debug&&((0,ye.checkNumber)(n),(0,ye.checkNumber)(i),(0,ye.checkNumber)(s),(0,ye.checkNumber)(o)),a[0]=n,a[1]=i,a[2]=s,a[3]=o),a}return(0,il.default)(t,[{key:"set",value:function(n,i,s,o){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this.check()}},{key:"fromObject",value:function(n){return zt.config.debug&&((0,ye.checkNumber)(n.x),(0,ye.checkNumber)(n.y),(0,ye.checkNumber)(n.z),(0,ye.checkNumber)(n.w)),this[0]=n.x,this[1]=n.y,this[2]=n.z,this[3]=n.w,this}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n.z=this[2],n.w=this[3],n}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,ye.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,ye.checkNumber)(n)}},{key:"transform",value:function(n){return Na.transformMat4(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return(0,Ca.vec4_transformMat3)(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return(0,Ca.vec4_transformMat2)(this,this,n),this.check()}},{key:"transformByQuaternion",value:function(n){return Na.transformQuat(this,this,n),this.check()}},{key:"applyMatrix4",value:function(n){return n.transform(this,this),this}}],[{key:"ZERO",get:function(){return Wa.ZERO=Wa.ZERO||Object.freeze(new t(0,0,0,0))}}]),t}(cl.default);$r.default=hl});var Yt=R(Jr=>{"use strict";var Xe=G();Object.defineProperty(Jr,"__esModule",{value:!0});Jr.default=void 0;var dl=Xe($()),pl=Xe(J()),vl=Xe(se()),ml=Xe(oe()),Fa=Xe(ce()),gl=Xe(br()),yl=ue(),Ml=ge(),za=Xe(ze());function xl(e){var r=bl();return function(){var a=(0,Fa.default)(e),n;if(r){var i=(0,Fa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,ml.default)(this,n)}}function bl(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var _l=function(e){(0,vl.default)(t,e);var r=xl(t);function t(){return(0,dl.default)(this,t),r.apply(this,arguments)}return(0,pl.default)(t,[{key:"ELEMENTS",get:function(){return(0,za.default)(!1),0}},{key:"RANK",get:function(){return(0,za.default)(!1),0}},{key:"toString",value:function(){var n="[";if(Ml.config.printRowMajor){n+="row-major:";for(var i=0;i<this.RANK;++i)for(var s=0;s<this.RANK;++s)n+=" ".concat(this[s*this.RANK+i])}else{n+="column-major:";for(var o=0;o<this.ELEMENTS;++o)n+=" ".concat(this[o])}return n+="]",n}},{key:"getElementIndex",value:function(n,i){return i*this.RANK+n}},{key:"getElement",value:function(n,i){return this[i*this.RANK+n]}},{key:"setElement",value:function(n,i,s){return this[i*this.RANK+n]=(0,yl.checkNumber)(s),this}},{key:"getColumn",value:function(n){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Array(this.RANK).fill(-0),s=n*this.RANK,o=0;o<this.RANK;++o)i[o]=this[s+o];return i}},{key:"setColumn",value:function(n,i){for(var s=n*this.RANK,o=0;o<this.RANK;++o)this[s+o]=i[o];return this}}]),t}(gl.default);Jr.default=_l});var Vt=R(q=>{"use strict";function Hr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Hr=function(t){return typeof t}:Hr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(e)}Object.defineProperty(q,"__esModule",{value:!0});q.create=kl;q.fromMat4=Ol;q.clone=Rl;q.copy=Sl;q.fromValues=Al;q.set=El;q.identity=Pl;q.transpose=wl;q.invert=ql;q.adjoint=Ll;q.determinant=Il;q.multiply=Va;q.translate=Nl;q.rotate=Cl;q.scale=Dl;q.fromTranslation=Wl;q.fromRotation=Bl;q.fromScaling=Fl;q.fromMat2d=zl;q.fromQuat=Yl;q.normalFromMat4=Vl;q.projection=Ul;q.str=Gl;q.frob=jl;q.add=Zl;q.subtract=Ua;q.multiplyScalar=Xl;q.multiplyScalarAndAdd=Ql;q.exactEquals=$l;q.equals=Jl;q.sub=q.mul=void 0;var K=Tl(Ue());function Ya(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Ya=function(){return e},e}function Tl(e){if(e&&e.__esModule)return e;if(e===null||Hr(e)!=="object"&&typeof e!="function")return{default:e};var r=Ya();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function kl(){var e=new K.ARRAY_TYPE(9);return K.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Ol(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[4],e[4]=r[5],e[5]=r[6],e[6]=r[8],e[7]=r[9],e[8]=r[10],e}function Rl(e){var r=new K.ARRAY_TYPE(9);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function Sl(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function Al(e,r,t,a,n,i,s,o,c){var u=new K.ARRAY_TYPE(9);return u[0]=e,u[1]=r,u[2]=t,u[3]=a,u[4]=n,u[5]=i,u[6]=s,u[7]=o,u[8]=c,u}function El(e,r,t,a,n,i,s,o,c,u){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e[4]=i,e[5]=s,e[6]=o,e[7]=c,e[8]=u,e}function Pl(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function wl(e,r){if(e===r){var t=r[1],a=r[2],n=r[5];e[1]=r[3],e[2]=r[6],e[3]=t,e[5]=r[7],e[6]=a,e[7]=n}else e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8];return e}function ql(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=l*s-o*u,f=-l*i+o*c,d=u*i-s*c,p=t*h+a*f+n*d;return p?(p=1/p,e[0]=h*p,e[1]=(-l*a+n*u)*p,e[2]=(o*a-n*s)*p,e[3]=f*p,e[4]=(l*t-n*c)*p,e[5]=(-o*t+n*i)*p,e[6]=d*p,e[7]=(-u*t+a*c)*p,e[8]=(s*t-a*i)*p,e):null}function Ll(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8];return e[0]=s*l-o*u,e[1]=n*u-a*l,e[2]=a*o-n*s,e[3]=o*c-i*l,e[4]=t*l-n*c,e[5]=n*i-t*o,e[6]=i*u-s*c,e[7]=a*c-t*u,e[8]=t*s-a*i,e}function Il(e){var r=e[0],t=e[1],a=e[2],n=e[3],i=e[4],s=e[5],o=e[6],c=e[7],u=e[8];return r*(u*i-s*c)+t*(-u*n+s*o)+a*(c*n-i*o)}function Va(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=t[0],d=t[1],p=t[2],m=t[3],v=t[4],g=t[5],b=t[6],y=t[7],M=t[8];return e[0]=f*a+d*s+p*u,e[1]=f*n+d*o+p*l,e[2]=f*i+d*c+p*h,e[3]=m*a+v*s+g*u,e[4]=m*n+v*o+g*l,e[5]=m*i+v*c+g*h,e[6]=b*a+y*s+M*u,e[7]=b*n+y*o+M*l,e[8]=b*i+y*c+M*h,e}function Nl(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=t[0],d=t[1];return e[0]=a,e[1]=n,e[2]=i,e[3]=s,e[4]=o,e[5]=c,e[6]=f*a+d*s+u,e[7]=f*n+d*o+l,e[8]=f*i+d*c+h,e}function Cl(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=Math.sin(t),d=Math.cos(t);return e[0]=d*a+f*s,e[1]=d*n+f*o,e[2]=d*i+f*c,e[3]=d*s-f*a,e[4]=d*o-f*n,e[5]=d*c-f*i,e[6]=u,e[7]=l,e[8]=h,e}function Dl(e,r,t){var a=t[0],n=t[1];return e[0]=a*r[0],e[1]=a*r[1],e[2]=a*r[2],e[3]=n*r[3],e[4]=n*r[4],e[5]=n*r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function Wl(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=r[0],e[7]=r[1],e[8]=1,e}function Bl(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=t,e[2]=0,e[3]=-t,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Fl(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=r[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function zl(e,r){return e[0]=r[0],e[1]=r[1],e[2]=0,e[3]=r[2],e[4]=r[3],e[5]=0,e[6]=r[4],e[7]=r[5],e[8]=1,e}function Yl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t+t,o=a+a,c=n+n,u=t*s,l=a*s,h=a*o,f=n*s,d=n*o,p=n*c,m=i*s,v=i*o,g=i*c;return e[0]=1-h-p,e[3]=l-g,e[6]=f+v,e[1]=l+g,e[4]=1-u-p,e[7]=d-m,e[2]=f-v,e[5]=d+m,e[8]=1-u-h,e}function Vl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=r[9],f=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15],b=t*o-a*s,y=t*c-n*s,M=t*u-i*s,k=a*c-n*o,_=a*u-i*o,C=n*u-i*c,L=l*m-h*p,I=l*v-f*p,w=l*g-d*p,D=h*v-f*m,N=h*g-d*m,W=f*g-d*v,E=b*W-y*N+M*D+k*w-_*I+C*L;return E?(E=1/E,e[0]=(o*W-c*N+u*D)*E,e[1]=(c*w-s*W-u*I)*E,e[2]=(s*N-o*w+u*L)*E,e[3]=(n*N-a*W-i*D)*E,e[4]=(t*W-n*w+i*I)*E,e[5]=(a*w-t*N-i*L)*E,e[6]=(m*C-v*_+g*k)*E,e[7]=(v*M-p*C-g*y)*E,e[8]=(p*_-m*M+g*b)*E,e):null}function Ul(e,r,t){return e[0]=2/r,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/t,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Gl(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function jl(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Zl(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e[4]=r[4]+t[4],e[5]=r[5]+t[5],e[6]=r[6]+t[6],e[7]=r[7]+t[7],e[8]=r[8]+t[8],e}function Ua(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e[4]=r[4]-t[4],e[5]=r[5]-t[5],e[6]=r[6]-t[6],e[7]=r[7]-t[7],e[8]=r[8]-t[8],e}function Xl(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e[4]=r[4]*t,e[5]=r[5]*t,e[6]=r[6]*t,e[7]=r[7]*t,e[8]=r[8]*t,e}function Ql(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e[4]=r[4]+t[4]*a,e[5]=r[5]+t[5]*a,e[6]=r[6]+t[6]*a,e[7]=r[7]+t[7]*a,e[8]=r[8]+t[8]*a,e}function $l(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]}function Jl(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],h=r[0],f=r[1],d=r[2],p=r[3],m=r[4],v=r[5],g=r[6],b=r[7],y=r[8];return Math.abs(t-h)<=K.EPSILON*Math.max(1,Math.abs(t),Math.abs(h))&&Math.abs(a-f)<=K.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(n-d)<=K.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-p)<=K.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=K.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-v)<=K.EPSILON*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(c-g)<=K.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(u-b)<=K.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(l-y)<=K.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))}var Hl=Va;q.mul=Hl;var Kl=Ua;q.sub=Kl});var Xa=R(et=>{"use strict";var or=G(),ef=te();Object.defineProperty(et,"__esModule",{value:!0});et.default=void 0;var rf=or($()),tf=or(J()),nf=or(se()),af=or(oe()),Ga=or(ce()),sf=or(Yt()),Kr=ue(),of=nr(),Me=Ut(Vt()),cf=Ut(Vr()),uf=Ut(ke());function ja(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ja=function(n){return n?t:r})(e)}function Ut(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||ef(e)!=="object"&&typeof e!="function")return{default:e};var t=ja(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function lf(e){var r=ff();return function(){var a=(0,Ga.default)(e),n;if(r){var i=(0,Ga.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,af.default)(this,n)}}function ff(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Za=Object.freeze([1,0,0,0,1,0,0,0,1]),hf=Object.freeze([0,0,0,0,0,0,0,0,0]),df=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),cr={},pf=function(e){(0,nf.default)(t,e);var r=lf(t);function t(a){var n;return(0,rf.default)(this,t),n=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(a)?n.copy(a):n.identity(),n}return(0,tf.default)(t,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return df}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this[4]=n[4],this[5]=n[5],this[6]=n[6],this[7]=n[7],this[8]=n[8],this.check()}},{key:"set",value:function(n,i,s,o,c,u,l,h,f){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this[4]=c,this[5]=u,this[6]=l,this[7]=h,this[8]=f,this.check()}},{key:"setRowMajor",value:function(n,i,s,o,c,u,l,h,f){return this[0]=n,this[1]=o,this[2]=l,this[3]=i,this[4]=c,this[5]=h,this[6]=s,this[7]=u,this[8]=f,this.check()}},{key:"determinant",value:function(){return Me.determinant(this)}},{key:"identity",value:function(){return this.copy(Za)}},{key:"fromQuaternion",value:function(n){return Me.fromQuat(this,n),this.check()}},{key:"transpose",value:function(){return Me.transpose(this,this),this.check()}},{key:"invert",value:function(){return Me.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(n){return Me.multiply(this,n,this),this.check()}},{key:"multiplyRight",value:function(n){return Me.multiply(this,this,n),this.check()}},{key:"rotate",value:function(n){return Me.rotate(this,this,n),this.check()}},{key:"scale",value:function(n){return Array.isArray(n)?Me.scale(this,this,n):Me.scale(this,this,[n,n,n]),this.check()}},{key:"translate",value:function(n){return Me.translate(this,this,n),this.check()}},{key:"transform",value:function(n,i){switch(n.length){case 2:i=cf.transformMat3(i||[-0,-0],n,this);break;case 3:i=uf.transformMat3(i||[-0,-0,-0],n,this);break;case 4:i=(0,of.vec4_transformMat3)(i||[-0,-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,Kr.checkVector)(i,n.length),i}},{key:"transformVector",value:function(n,i){return(0,Kr.deprecated)("Matrix3.transformVector"),this.transform(n,i)}},{key:"transformVector2",value:function(n,i){return(0,Kr.deprecated)("Matrix3.transformVector"),this.transform(n,i)}},{key:"transformVector3",value:function(n,i){return(0,Kr.deprecated)("Matrix3.transformVector"),this.transform(n,i)}}],[{key:"IDENTITY",get:function(){return cr.IDENTITY=cr.IDENTITY||Object.freeze(new t(Za)),cr.IDENTITY}},{key:"ZERO",get:function(){return cr.ZERO=cr.ZERO||Object.freeze(new t(hf)),cr.ZERO}}]),t}(sf.default);et.default=pf});var $a=R((Np,Qa)=>{function vf(e){if(Array.isArray(e))return e}Qa.exports=vf});var Ha=R((Cp,Ja)=>{function mf(e,r){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(e)))){var t=[],a=!0,n=!1,i=void 0;try{for(var s=e[Symbol.iterator](),o;!(a=(o=s.next()).done)&&(t.push(o.value),!(r&&t.length===r));a=!0);}catch(c){n=!0,i=c}finally{try{!a&&s.return!=null&&s.return()}finally{if(n)throw i}}return t}}Ja.exports=mf});var ei=R((Dp,Ka)=>{function gf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Ka.exports=gf});var Tr=R((Wp,ri)=>{var yf=$a(),Mf=Ha(),xf=It(),bf=ei();function _f(e,r){return yf(e)||Mf(e,r)||xf(e,r)||bf()}ri.exports=_f});var ci=R(S=>{"use strict";function rt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rt=function(t){return typeof t}:rt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rt(e)}Object.defineProperty(S,"__esModule",{value:!0});S.create=kf;S.clone=Of;S.copy=Rf;S.fromValues=Sf;S.set=Af;S.identity=ni;S.transpose=Ef;S.invert=Pf;S.adjoint=wf;S.determinant=qf;S.multiply=ai;S.translate=Lf;S.scale=If;S.rotate=Nf;S.rotateX=Cf;S.rotateY=Df;S.rotateZ=Wf;S.fromTranslation=Bf;S.fromScaling=Ff;S.fromRotation=zf;S.fromXRotation=Yf;S.fromYRotation=Vf;S.fromZRotation=Uf;S.fromRotationTranslation=ii;S.fromQuat2=Gf;S.getTranslation=jf;S.getScaling=si;S.getRotation=Zf;S.fromRotationTranslationScale=Xf;S.fromRotationTranslationScaleOrigin=Qf;S.fromQuat=$f;S.frustum=Jf;S.perspective=Hf;S.perspectiveFromFieldOfView=Kf;S.ortho=eh;S.lookAt=rh;S.targetTo=th;S.str=nh;S.frob=ah;S.add=ih;S.subtract=oi;S.multiplyScalar=sh;S.multiplyScalarAndAdd=oh;S.exactEquals=ch;S.equals=uh;S.sub=S.mul=void 0;var B=Tf(Ue());function ti(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return ti=function(){return e},e}function Tf(e){if(e&&e.__esModule)return e;if(e===null||rt(e)!=="object"&&typeof e!="function")return{default:e};var r=ti();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function kf(){var e=new B.ARRAY_TYPE(16);return B.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Of(e){var r=new B.ARRAY_TYPE(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function Rf(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Sf(e,r,t,a,n,i,s,o,c,u,l,h,f,d,p,m){var v=new B.ARRAY_TYPE(16);return v[0]=e,v[1]=r,v[2]=t,v[3]=a,v[4]=n,v[5]=i,v[6]=s,v[7]=o,v[8]=c,v[9]=u,v[10]=l,v[11]=h,v[12]=f,v[13]=d,v[14]=p,v[15]=m,v}function Af(e,r,t,a,n,i,s,o,c,u,l,h,f,d,p,m,v){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e[4]=i,e[5]=s,e[6]=o,e[7]=c,e[8]=u,e[9]=l,e[10]=h,e[11]=f,e[12]=d,e[13]=p,e[14]=m,e[15]=v,e}function ni(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ef(e,r){if(e===r){var t=r[1],a=r[2],n=r[3],i=r[6],s=r[7],o=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=a,e[9]=i,e[11]=r[14],e[12]=n,e[13]=s,e[14]=o}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function Pf(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=r[9],f=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15],b=t*o-a*s,y=t*c-n*s,M=t*u-i*s,k=a*c-n*o,_=a*u-i*o,C=n*u-i*c,L=l*m-h*p,I=l*v-f*p,w=l*g-d*p,D=h*v-f*m,N=h*g-d*m,W=f*g-d*v,E=b*W-y*N+M*D+k*w-_*I+C*L;return E?(E=1/E,e[0]=(o*W-c*N+u*D)*E,e[1]=(n*N-a*W-i*D)*E,e[2]=(m*C-v*_+g*k)*E,e[3]=(f*_-h*C-d*k)*E,e[4]=(c*w-s*W-u*I)*E,e[5]=(t*W-n*w+i*I)*E,e[6]=(v*M-p*C-g*y)*E,e[7]=(l*C-f*M+d*y)*E,e[8]=(s*N-o*w+u*L)*E,e[9]=(a*w-t*N-i*L)*E,e[10]=(p*_-m*M+g*b)*E,e[11]=(h*M-l*_-d*b)*E,e[12]=(o*I-s*D-c*L)*E,e[13]=(t*D-a*I+n*L)*E,e[14]=(m*y-p*k-v*b)*E,e[15]=(l*k-h*y+f*b)*E,e):null}function wf(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=r[9],f=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15];return e[0]=o*(f*g-d*v)-h*(c*g-u*v)+m*(c*d-u*f),e[1]=-(a*(f*g-d*v)-h*(n*g-i*v)+m*(n*d-i*f)),e[2]=a*(c*g-u*v)-o*(n*g-i*v)+m*(n*u-i*c),e[3]=-(a*(c*d-u*f)-o*(n*d-i*f)+h*(n*u-i*c)),e[4]=-(s*(f*g-d*v)-l*(c*g-u*v)+p*(c*d-u*f)),e[5]=t*(f*g-d*v)-l*(n*g-i*v)+p*(n*d-i*f),e[6]=-(t*(c*g-u*v)-s*(n*g-i*v)+p*(n*u-i*c)),e[7]=t*(c*d-u*f)-s*(n*d-i*f)+l*(n*u-i*c),e[8]=s*(h*g-d*m)-l*(o*g-u*m)+p*(o*d-u*h),e[9]=-(t*(h*g-d*m)-l*(a*g-i*m)+p*(a*d-i*h)),e[10]=t*(o*g-u*m)-s*(a*g-i*m)+p*(a*u-i*o),e[11]=-(t*(o*d-u*h)-s*(a*d-i*h)+l*(a*u-i*o)),e[12]=-(s*(h*v-f*m)-l*(o*v-c*m)+p*(o*f-c*h)),e[13]=t*(h*v-f*m)-l*(a*v-n*m)+p*(a*f-n*h),e[14]=-(t*(o*v-c*m)-s*(a*v-n*m)+p*(a*c-n*o)),e[15]=t*(o*f-c*h)-s*(a*f-n*h)+l*(a*c-n*o),e}function qf(e){var r=e[0],t=e[1],a=e[2],n=e[3],i=e[4],s=e[5],o=e[6],c=e[7],u=e[8],l=e[9],h=e[10],f=e[11],d=e[12],p=e[13],m=e[14],v=e[15],g=r*s-t*i,b=r*o-a*i,y=r*c-n*i,M=t*o-a*s,k=t*c-n*s,_=a*c-n*o,C=u*p-l*d,L=u*m-h*d,I=u*v-f*d,w=l*m-h*p,D=l*v-f*p,N=h*v-f*m;return g*N-b*D+y*w+M*I-k*L+_*C}function ai(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=r[9],d=r[10],p=r[11],m=r[12],v=r[13],g=r[14],b=r[15],y=t[0],M=t[1],k=t[2],_=t[3];return e[0]=y*a+M*o+k*h+_*m,e[1]=y*n+M*c+k*f+_*v,e[2]=y*i+M*u+k*d+_*g,e[3]=y*s+M*l+k*p+_*b,y=t[4],M=t[5],k=t[6],_=t[7],e[4]=y*a+M*o+k*h+_*m,e[5]=y*n+M*c+k*f+_*v,e[6]=y*i+M*u+k*d+_*g,e[7]=y*s+M*l+k*p+_*b,y=t[8],M=t[9],k=t[10],_=t[11],e[8]=y*a+M*o+k*h+_*m,e[9]=y*n+M*c+k*f+_*v,e[10]=y*i+M*u+k*d+_*g,e[11]=y*s+M*l+k*p+_*b,y=t[12],M=t[13],k=t[14],_=t[15],e[12]=y*a+M*o+k*h+_*m,e[13]=y*n+M*c+k*f+_*v,e[14]=y*i+M*u+k*d+_*g,e[15]=y*s+M*l+k*p+_*b,e}function Lf(e,r,t){var a=t[0],n=t[1],i=t[2],s,o,c,u,l,h,f,d,p,m,v,g;return r===e?(e[12]=r[0]*a+r[4]*n+r[8]*i+r[12],e[13]=r[1]*a+r[5]*n+r[9]*i+r[13],e[14]=r[2]*a+r[6]*n+r[10]*i+r[14],e[15]=r[3]*a+r[7]*n+r[11]*i+r[15]):(s=r[0],o=r[1],c=r[2],u=r[3],l=r[4],h=r[5],f=r[6],d=r[7],p=r[8],m=r[9],v=r[10],g=r[11],e[0]=s,e[1]=o,e[2]=c,e[3]=u,e[4]=l,e[5]=h,e[6]=f,e[7]=d,e[8]=p,e[9]=m,e[10]=v,e[11]=g,e[12]=s*a+l*n+p*i+r[12],e[13]=o*a+h*n+m*i+r[13],e[14]=c*a+f*n+v*i+r[14],e[15]=u*a+d*n+g*i+r[15]),e}function If(e,r,t){var a=t[0],n=t[1],i=t[2];return e[0]=r[0]*a,e[1]=r[1]*a,e[2]=r[2]*a,e[3]=r[3]*a,e[4]=r[4]*n,e[5]=r[5]*n,e[6]=r[6]*n,e[7]=r[7]*n,e[8]=r[8]*i,e[9]=r[9]*i,e[10]=r[10]*i,e[11]=r[11]*i,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Nf(e,r,t,a){var n=a[0],i=a[1],s=a[2],o=Math.hypot(n,i,s),c,u,l,h,f,d,p,m,v,g,b,y,M,k,_,C,L,I,w,D,N,W,E,Z;return o<B.EPSILON?null:(o=1/o,n*=o,i*=o,s*=o,c=Math.sin(t),u=Math.cos(t),l=1-u,h=r[0],f=r[1],d=r[2],p=r[3],m=r[4],v=r[5],g=r[6],b=r[7],y=r[8],M=r[9],k=r[10],_=r[11],C=n*n*l+u,L=i*n*l+s*c,I=s*n*l-i*c,w=n*i*l-s*c,D=i*i*l+u,N=s*i*l+n*c,W=n*s*l+i*c,E=i*s*l-n*c,Z=s*s*l+u,e[0]=h*C+m*L+y*I,e[1]=f*C+v*L+M*I,e[2]=d*C+g*L+k*I,e[3]=p*C+b*L+_*I,e[4]=h*w+m*D+y*N,e[5]=f*w+v*D+M*N,e[6]=d*w+g*D+k*N,e[7]=p*w+b*D+_*N,e[8]=h*W+m*E+y*Z,e[9]=f*W+v*E+M*Z,e[10]=d*W+g*E+k*Z,e[11]=p*W+b*E+_*Z,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function Cf(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[4],s=r[5],o=r[6],c=r[7],u=r[8],l=r[9],h=r[10],f=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=i*n+u*a,e[5]=s*n+l*a,e[6]=o*n+h*a,e[7]=c*n+f*a,e[8]=u*n-i*a,e[9]=l*n-s*a,e[10]=h*n-o*a,e[11]=f*n-c*a,e}function Df(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[0],s=r[1],o=r[2],c=r[3],u=r[8],l=r[9],h=r[10],f=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*n-u*a,e[1]=s*n-l*a,e[2]=o*n-h*a,e[3]=c*n-f*a,e[8]=i*a+u*n,e[9]=s*a+l*n,e[10]=o*a+h*n,e[11]=c*a+f*n,e}function Wf(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[0],s=r[1],o=r[2],c=r[3],u=r[4],l=r[5],h=r[6],f=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*n+u*a,e[1]=s*n+l*a,e[2]=o*n+h*a,e[3]=c*n+f*a,e[4]=u*n-i*a,e[5]=l*n-s*a,e[6]=h*n-o*a,e[7]=f*n-c*a,e}function Bf(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function Ff(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=r[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function zf(e,r,t){var a=t[0],n=t[1],i=t[2],s=Math.hypot(a,n,i),o,c,u;return s<B.EPSILON?null:(s=1/s,a*=s,n*=s,i*=s,o=Math.sin(r),c=Math.cos(r),u=1-c,e[0]=a*a*u+c,e[1]=n*a*u+i*o,e[2]=i*a*u-n*o,e[3]=0,e[4]=a*n*u-i*o,e[5]=n*n*u+c,e[6]=i*n*u+a*o,e[7]=0,e[8]=a*i*u+n*o,e[9]=n*i*u-a*o,e[10]=i*i*u+c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function Yf(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=t,e[7]=0,e[8]=0,e[9]=-t,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Vf(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=0,e[2]=-t,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=t,e[9]=0,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Uf(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=t,e[2]=0,e[3]=0,e[4]=-t,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ii(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=a+a,c=n+n,u=i+i,l=a*o,h=a*c,f=a*u,d=n*c,p=n*u,m=i*u,v=s*o,g=s*c,b=s*u;return e[0]=1-(d+m),e[1]=h+b,e[2]=f-g,e[3]=0,e[4]=h-b,e[5]=1-(l+m),e[6]=p+v,e[7]=0,e[8]=f+g,e[9]=p-v,e[10]=1-(l+d),e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function Gf(e,r){var t=new B.ARRAY_TYPE(3),a=-r[0],n=-r[1],i=-r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=a*a+n*n+i*i+s*s;return h>0?(t[0]=(o*s+l*a+c*i-u*n)*2/h,t[1]=(c*s+l*n+u*a-o*i)*2/h,t[2]=(u*s+l*i+o*n-c*a)*2/h):(t[0]=(o*s+l*a+c*i-u*n)*2,t[1]=(c*s+l*n+u*a-o*i)*2,t[2]=(u*s+l*i+o*n-c*a)*2),ii(e,r,t),e}function jf(e,r){return e[0]=r[12],e[1]=r[13],e[2]=r[14],e}function si(e,r){var t=r[0],a=r[1],n=r[2],i=r[4],s=r[5],o=r[6],c=r[8],u=r[9],l=r[10];return e[0]=Math.hypot(t,a,n),e[1]=Math.hypot(i,s,o),e[2]=Math.hypot(c,u,l),e}function Zf(e,r){var t=new B.ARRAY_TYPE(3);si(t,r);var a=1/t[0],n=1/t[1],i=1/t[2],s=r[0]*a,o=r[1]*n,c=r[2]*i,u=r[4]*a,l=r[5]*n,h=r[6]*i,f=r[8]*a,d=r[9]*n,p=r[10]*i,m=s+l+p,v=0;return m>0?(v=Math.sqrt(m+1)*2,e[3]=.25*v,e[0]=(h-d)/v,e[1]=(f-c)/v,e[2]=(o-u)/v):s>l&&s>p?(v=Math.sqrt(1+s-l-p)*2,e[3]=(h-d)/v,e[0]=.25*v,e[1]=(o+u)/v,e[2]=(f+c)/v):l>p?(v=Math.sqrt(1+l-s-p)*2,e[3]=(f-c)/v,e[0]=(o+u)/v,e[1]=.25*v,e[2]=(h+d)/v):(v=Math.sqrt(1+p-s-l)*2,e[3]=(o-u)/v,e[0]=(f+c)/v,e[1]=(h+d)/v,e[2]=.25*v),e}function Xf(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3],c=n+n,u=i+i,l=s+s,h=n*c,f=n*u,d=n*l,p=i*u,m=i*l,v=s*l,g=o*c,b=o*u,y=o*l,M=a[0],k=a[1],_=a[2];return e[0]=(1-(p+v))*M,e[1]=(f+y)*M,e[2]=(d-b)*M,e[3]=0,e[4]=(f-y)*k,e[5]=(1-(h+v))*k,e[6]=(m+g)*k,e[7]=0,e[8]=(d+b)*_,e[9]=(m-g)*_,e[10]=(1-(h+p))*_,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function Qf(e,r,t,a,n){var i=r[0],s=r[1],o=r[2],c=r[3],u=i+i,l=s+s,h=o+o,f=i*u,d=i*l,p=i*h,m=s*l,v=s*h,g=o*h,b=c*u,y=c*l,M=c*h,k=a[0],_=a[1],C=a[2],L=n[0],I=n[1],w=n[2],D=(1-(m+g))*k,N=(d+M)*k,W=(p-y)*k,E=(d-M)*_,Z=(1-(f+g))*_,de=(v+b)*_,pe=(p+y)*C,De=(v-b)*C,We=(1-(f+m))*C;return e[0]=D,e[1]=N,e[2]=W,e[3]=0,e[4]=E,e[5]=Z,e[6]=de,e[7]=0,e[8]=pe,e[9]=De,e[10]=We,e[11]=0,e[12]=t[0]+L-(D*L+E*I+pe*w),e[13]=t[1]+I-(N*L+Z*I+De*w),e[14]=t[2]+w-(W*L+de*I+We*w),e[15]=1,e}function $f(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t+t,o=a+a,c=n+n,u=t*s,l=a*s,h=a*o,f=n*s,d=n*o,p=n*c,m=i*s,v=i*o,g=i*c;return e[0]=1-h-p,e[1]=l+g,e[2]=f-v,e[3]=0,e[4]=l-g,e[5]=1-u-p,e[6]=d+m,e[7]=0,e[8]=f+v,e[9]=d-m,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Jf(e,r,t,a,n,i,s){var o=1/(t-r),c=1/(n-a),u=1/(i-s);return e[0]=i*2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*c,e[6]=0,e[7]=0,e[8]=(t+r)*o,e[9]=(n+a)*c,e[10]=(s+i)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i*2*u,e[15]=0,e}function Hf(e,r,t,a,n){var i=1/Math.tan(r/2),s;return e[0]=i/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,n!=null&&n!==1/0?(s=1/(a-n),e[10]=(n+a)*s,e[14]=2*n*a*s):(e[10]=-1,e[14]=-2*a),e}function Kf(e,r,t,a){var n=Math.tan(r.upDegrees*Math.PI/180),i=Math.tan(r.downDegrees*Math.PI/180),s=Math.tan(r.leftDegrees*Math.PI/180),o=Math.tan(r.rightDegrees*Math.PI/180),c=2/(s+o),u=2/(n+i);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-((s-o)*c*.5),e[9]=(n-i)*u*.5,e[10]=a/(t-a),e[11]=-1,e[12]=0,e[13]=0,e[14]=a*t/(t-a),e[15]=0,e}function eh(e,r,t,a,n,i,s){var o=1/(r-t),c=1/(a-n),u=1/(i-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*o,e[13]=(n+a)*c,e[14]=(s+i)*u,e[15]=1,e}function rh(e,r,t,a){var n,i,s,o,c,u,l,h,f,d,p=r[0],m=r[1],v=r[2],g=a[0],b=a[1],y=a[2],M=t[0],k=t[1],_=t[2];return Math.abs(p-M)<B.EPSILON&&Math.abs(m-k)<B.EPSILON&&Math.abs(v-_)<B.EPSILON?ni(e):(l=p-M,h=m-k,f=v-_,d=1/Math.hypot(l,h,f),l*=d,h*=d,f*=d,n=b*f-y*h,i=y*l-g*f,s=g*h-b*l,d=Math.hypot(n,i,s),d?(d=1/d,n*=d,i*=d,s*=d):(n=0,i=0,s=0),o=h*s-f*i,c=f*n-l*s,u=l*i-h*n,d=Math.hypot(o,c,u),d?(d=1/d,o*=d,c*=d,u*=d):(o=0,c=0,u=0),e[0]=n,e[1]=o,e[2]=l,e[3]=0,e[4]=i,e[5]=c,e[6]=h,e[7]=0,e[8]=s,e[9]=u,e[10]=f,e[11]=0,e[12]=-(n*p+i*m+s*v),e[13]=-(o*p+c*m+u*v),e[14]=-(l*p+h*m+f*v),e[15]=1,e)}function th(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=a[0],c=a[1],u=a[2],l=n-t[0],h=i-t[1],f=s-t[2],d=l*l+h*h+f*f;d>0&&(d=1/Math.sqrt(d),l*=d,h*=d,f*=d);var p=c*f-u*h,m=u*l-o*f,v=o*h-c*l;return d=p*p+m*m+v*v,d>0&&(d=1/Math.sqrt(d),p*=d,m*=d,v*=d),e[0]=p,e[1]=m,e[2]=v,e[3]=0,e[4]=h*v-f*m,e[5]=f*p-l*v,e[6]=l*m-h*p,e[7]=0,e[8]=l,e[9]=h,e[10]=f,e[11]=0,e[12]=n,e[13]=i,e[14]=s,e[15]=1,e}function nh(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function ah(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function ih(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e[4]=r[4]+t[4],e[5]=r[5]+t[5],e[6]=r[6]+t[6],e[7]=r[7]+t[7],e[8]=r[8]+t[8],e[9]=r[9]+t[9],e[10]=r[10]+t[10],e[11]=r[11]+t[11],e[12]=r[12]+t[12],e[13]=r[13]+t[13],e[14]=r[14]+t[14],e[15]=r[15]+t[15],e}function oi(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e[4]=r[4]-t[4],e[5]=r[5]-t[5],e[6]=r[6]-t[6],e[7]=r[7]-t[7],e[8]=r[8]-t[8],e[9]=r[9]-t[9],e[10]=r[10]-t[10],e[11]=r[11]-t[11],e[12]=r[12]-t[12],e[13]=r[13]-t[13],e[14]=r[14]-t[14],e[15]=r[15]-t[15],e}function sh(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e[4]=r[4]*t,e[5]=r[5]*t,e[6]=r[6]*t,e[7]=r[7]*t,e[8]=r[8]*t,e[9]=r[9]*t,e[10]=r[10]*t,e[11]=r[11]*t,e[12]=r[12]*t,e[13]=r[13]*t,e[14]=r[14]*t,e[15]=r[15]*t,e}function oh(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e[4]=r[4]+t[4]*a,e[5]=r[5]+t[5]*a,e[6]=r[6]+t[6]*a,e[7]=r[7]+t[7]*a,e[8]=r[8]+t[8]*a,e[9]=r[9]+t[9]*a,e[10]=r[10]+t[10]*a,e[11]=r[11]+t[11]*a,e[12]=r[12]+t[12]*a,e[13]=r[13]+t[13]*a,e[14]=r[14]+t[14]*a,e[15]=r[15]+t[15]*a,e}function ch(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}function uh(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],b=r[0],y=r[1],M=r[2],k=r[3],_=r[4],C=r[5],L=r[6],I=r[7],w=r[8],D=r[9],N=r[10],W=r[11],E=r[12],Z=r[13],de=r[14],pe=r[15];return Math.abs(t-b)<=B.EPSILON*Math.max(1,Math.abs(t),Math.abs(b))&&Math.abs(a-y)<=B.EPSILON*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(n-M)<=B.EPSILON*Math.max(1,Math.abs(n),Math.abs(M))&&Math.abs(i-k)<=B.EPSILON*Math.max(1,Math.abs(i),Math.abs(k))&&Math.abs(s-_)<=B.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-C)<=B.EPSILON*Math.max(1,Math.abs(o),Math.abs(C))&&Math.abs(c-L)<=B.EPSILON*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(u-I)<=B.EPSILON*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(l-w)<=B.EPSILON*Math.max(1,Math.abs(l),Math.abs(w))&&Math.abs(h-D)<=B.EPSILON*Math.max(1,Math.abs(h),Math.abs(D))&&Math.abs(f-N)<=B.EPSILON*Math.max(1,Math.abs(f),Math.abs(N))&&Math.abs(d-W)<=B.EPSILON*Math.max(1,Math.abs(d),Math.abs(W))&&Math.abs(p-E)<=B.EPSILON*Math.max(1,Math.abs(p),Math.abs(E))&&Math.abs(m-Z)<=B.EPSILON*Math.max(1,Math.abs(m),Math.abs(Z))&&Math.abs(v-de)<=B.EPSILON*Math.max(1,Math.abs(v),Math.abs(de))&&Math.abs(g-pe)<=B.EPSILON*Math.max(1,Math.abs(g),Math.abs(pe))}var lh=ai;S.mul=lh;var fh=oi;S.sub=fh});var nt=R(A=>{"use strict";function tt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tt=function(t){return typeof t}:tt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(e)}Object.defineProperty(A,"__esModule",{value:!0});A.create=li;A.clone=dh;A.fromValues=ph;A.copy=vh;A.set=mh;A.add=gh;A.subtract=fi;A.multiply=hi;A.divide=di;A.ceil=yh;A.floor=Mh;A.min=xh;A.max=bh;A.round=_h;A.scale=Th;A.scaleAndAdd=kh;A.distance=pi;A.squaredDistance=vi;A.length=mi;A.squaredLength=gi;A.negate=Oh;A.inverse=Rh;A.normalize=Sh;A.dot=Ah;A.cross=Eh;A.lerp=Ph;A.random=wh;A.transformMat4=qh;A.transformQuat=Lh;A.zero=Ih;A.str=Nh;A.exactEquals=Ch;A.equals=Dh;A.forEach=A.sqrLen=A.len=A.sqrDist=A.dist=A.div=A.mul=A.sub=void 0;var ae=hh(Ue());function ui(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return ui=function(){return e},e}function hh(e){if(e&&e.__esModule)return e;if(e===null||tt(e)!=="object"&&typeof e!="function")return{default:e};var r=ui();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function li(){var e=new ae.ARRAY_TYPE(4);return ae.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function dh(e){var r=new ae.ARRAY_TYPE(4);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function ph(e,r,t,a){var n=new ae.ARRAY_TYPE(4);return n[0]=e,n[1]=r,n[2]=t,n[3]=a,n}function vh(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function mh(e,r,t,a,n){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e}function gh(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e}function fi(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e}function hi(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e[3]=r[3]*t[3],e}function di(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e[3]=r[3]/t[3],e}function yh(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e[3]=Math.ceil(r[3]),e}function Mh(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e[3]=Math.floor(r[3]),e}function xh(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e[3]=Math.min(r[3],t[3]),e}function bh(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e[3]=Math.max(r[3],t[3]),e}function _h(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e[3]=Math.round(r[3]),e}function Th(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e}function kh(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e}function pi(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2],i=r[3]-e[3];return Math.hypot(t,a,n,i)}function vi(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2],i=r[3]-e[3];return t*t+a*a+n*n+i*i}function mi(e){var r=e[0],t=e[1],a=e[2],n=e[3];return Math.hypot(r,t,a,n)}function gi(e){var r=e[0],t=e[1],a=e[2],n=e[3];return r*r+t*t+a*a+n*n}function Oh(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=-r[3],e}function Rh(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e[3]=1/r[3],e}function Sh(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t*t+a*a+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),e[0]=t*s,e[1]=a*s,e[2]=n*s,e[3]=i*s,e}function Ah(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]}function Eh(e,r,t,a){var n=t[0]*a[1]-t[1]*a[0],i=t[0]*a[2]-t[2]*a[0],s=t[0]*a[3]-t[3]*a[0],o=t[1]*a[2]-t[2]*a[1],c=t[1]*a[3]-t[3]*a[1],u=t[2]*a[3]-t[3]*a[2],l=r[0],h=r[1],f=r[2],d=r[3];return e[0]=h*u-f*c+d*o,e[1]=-(l*u)+f*s-d*i,e[2]=l*c-h*s+d*n,e[3]=-(l*o)+h*i-f*n,e}function Ph(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e[2]=s+a*(t[2]-s),e[3]=o+a*(t[3]-o),e}function wh(e,r){r=r||1;var t,a,n,i,s,o;do t=ae.RANDOM()*2-1,a=ae.RANDOM()*2-1,s=t*t+a*a;while(s>=1);do n=ae.RANDOM()*2-1,i=ae.RANDOM()*2-1,o=n*n+i*i;while(o>=1);var c=Math.sqrt((1-s)/o);return e[0]=r*t,e[1]=r*a,e[2]=r*n*c,e[3]=r*i*c,e}function qh(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3];return e[0]=t[0]*a+t[4]*n+t[8]*i+t[12]*s,e[1]=t[1]*a+t[5]*n+t[9]*i+t[13]*s,e[2]=t[2]*a+t[6]*n+t[10]*i+t[14]*s,e[3]=t[3]*a+t[7]*n+t[11]*i+t[15]*s,e}function Lh(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[0],o=t[1],c=t[2],u=t[3],l=u*a+o*i-c*n,h=u*n+c*a-s*i,f=u*i+s*n-o*a,d=-s*a-o*n-c*i;return e[0]=l*u+d*-s+h*-c-f*-o,e[1]=h*u+d*-o+f*-s-l*-c,e[2]=f*u+d*-c+l*-o-h*-s,e[3]=r[3],e}function Ih(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function Nh(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function Ch(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function Dh(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=r[0],o=r[1],c=r[2],u=r[3];return Math.abs(t-s)<=ae.EPSILON*Math.max(1,Math.abs(t),Math.abs(s))&&Math.abs(a-o)<=ae.EPSILON*Math.max(1,Math.abs(a),Math.abs(o))&&Math.abs(n-c)<=ae.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=ae.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))}var Wh=fi;A.sub=Wh;var Bh=hi;A.mul=Bh;var Fh=di;A.div=Fh;var zh=pi;A.dist=zh;var Yh=vi;A.sqrDist=Yh;var Vh=mi;A.len=Vh;var Uh=gi;A.sqrLen=Uh;var Gh=function(){var e=li();return function(r,t,a,n,i,s){var o,c;for(t||(t=4),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],e[2]=r[o+2],e[3]=r[o+3],i(e,e,s),r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2],r[o+3]=e[3];return r}}();A.forEach=Gh});var Gt=R(it=>{"use strict";var Qe=G(),jh=te();Object.defineProperty(it,"__esModule",{value:!0});it.default=void 0;var Zh=Qe(Tr()),Xh=Qe($()),Qh=Qe(J()),$h=Qe(se()),Jh=Qe(oe()),yi=Qe(ce()),ur=ue(),Hh=Qe(Yt()),Mi=nr(),j=at(ci()),Kh=at(Vr()),e0=at(ke()),r0=at(nt());function xi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(xi=function(n){return n?t:r})(e)}function at(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||jh(e)!=="object"&&typeof e!="function")return{default:e};var t=xi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function t0(e){var r=n0();return function(){var a=(0,yi.default)(e),n;if(r){var i=(0,yi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Jh.default)(this,n)}}function n0(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var bi=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),a0=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),i0=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}),lr={},s0=function(e){(0,$h.default)(t,e);var r=t0(t);function t(a){var n;return(0,Xh.default)(this,t),n=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(a)?n.copy(a):n.identity(),n}return(0,Qh.default)(t,[{key:"INDICES",get:function(){return i0}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this[4]=n[4],this[5]=n[5],this[6]=n[6],this[7]=n[7],this[8]=n[8],this[9]=n[9],this[10]=n[10],this[11]=n[11],this[12]=n[12],this[13]=n[13],this[14]=n[14],this[15]=n[15],this.check()}},{key:"set",value:function(n,i,s,o,c,u,l,h,f,d,p,m,v,g,b,y){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this[4]=c,this[5]=u,this[6]=l,this[7]=h,this[8]=f,this[9]=d,this[10]=p,this[11]=m,this[12]=v,this[13]=g,this[14]=b,this[15]=y,this.check()}},{key:"setRowMajor",value:function(n,i,s,o,c,u,l,h,f,d,p,m,v,g,b,y){return this[0]=n,this[1]=c,this[2]=f,this[3]=v,this[4]=i,this[5]=u,this[6]=d,this[7]=g,this[8]=s,this[9]=l,this[10]=p,this[11]=b,this[12]=o,this[13]=h,this[14]=m,this[15]=y,this.check()}},{key:"toRowMajor",value:function(n){return n[0]=this[0],n[1]=this[4],n[2]=this[8],n[3]=this[12],n[4]=this[1],n[5]=this[5],n[6]=this[9],n[7]=this[13],n[8]=this[2],n[9]=this[6],n[10]=this[10],n[11]=this[14],n[12]=this[3],n[13]=this[7],n[14]=this[11],n[15]=this[15],n}},{key:"identity",value:function(){return this.copy(bi)}},{key:"fromQuaternion",value:function(n){return j.fromQuat(this,n),this.check()}},{key:"frustum",value:function(n){var i=n.left,s=n.right,o=n.bottom,c=n.top,u=n.near,l=n.far;return l===1/0?t._computeInfinitePerspectiveOffCenter(this,i,s,o,c,u):j.frustum(this,i,s,o,c,u,l),this.check()}},{key:"lookAt",value:function(n,i,s){if(arguments.length===1){var o=n;n=o.eye,i=o.center,s=o.up}return i=i||[0,0,0],s=s||[0,1,0],j.lookAt(this,n,i,s),this.check()}},{key:"ortho",value:function(n){var i=n.left,s=n.right,o=n.bottom,c=n.top,u=n.near,l=u===void 0?.1:u,h=n.far,f=h===void 0?500:h;return j.ortho(this,i,s,o,c,l,f),this.check()}},{key:"orthographic",value:function(n){var i=n.fovy,s=i===void 0?45*Math.PI/180:i,o=n.aspect,c=o===void 0?1:o,u=n.focalDistance,l=u===void 0?1:u,h=n.near,f=h===void 0?.1:h,d=n.far,p=d===void 0?500:d;if(s>Math.PI*2)throw Error("radians");var m=s/2,v=l*Math.tan(m),g=v*c;return new t().ortho({left:-g,right:g,bottom:-v,top:v,near:f,far:p})}},{key:"perspective",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.fovy,s=i===void 0?void 0:i,o=n.fov,c=o===void 0?45*Math.PI/180:o,u=n.aspect,l=u===void 0?1:u,h=n.near,f=h===void 0?.1:h,d=n.far,p=d===void 0?500:d;if(s=s||c,s>Math.PI*2)throw Error("radians");return j.perspective(this,s,l,f,p),this.check()}},{key:"determinant",value:function(){return j.determinant(this)}},{key:"getScale",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),n[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),n[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),n}},{key:"getTranslation",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=this[12],n[1]=this[13],n[2]=this[14],n}},{key:"getRotation",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=this.getScale(i||[-0,-0,-0]),o=1/s[0],c=1/s[1],u=1/s[2];return n[0]=this[0]*o,n[1]=this[1]*c,n[2]=this[2]*u,n[3]=0,n[4]=this[4]*o,n[5]=this[5]*c,n[6]=this[6]*u,n[7]=0,n[8]=this[8]*o,n[9]=this[9]*c,n[10]=this[10]*u,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}},{key:"getRotationMatrix3",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=this.getScale(i||[-0,-0,-0]),o=1/s[0],c=1/s[1],u=1/s[2];return n[0]=this[0]*o,n[1]=this[1]*c,n[2]=this[2]*u,n[3]=this[4]*o,n[4]=this[5]*c,n[5]=this[6]*u,n[6]=this[8]*o,n[7]=this[9]*c,n[8]=this[10]*u,n}},{key:"transpose",value:function(){return j.transpose(this,this),this.check()}},{key:"invert",value:function(){return j.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(n){return j.multiply(this,n,this),this.check()}},{key:"multiplyRight",value:function(n){return j.multiply(this,this,n),this.check()}},{key:"rotateX",value:function(n){return j.rotateX(this,this,n),this.check()}},{key:"rotateY",value:function(n){return j.rotateY(this,this,n),this.check()}},{key:"rotateZ",value:function(n){return j.rotateZ(this,this,n),this.check()}},{key:"rotateXYZ",value:function(n){var i=(0,Zh.default)(n,3),s=i[0],o=i[1],c=i[2];return this.rotateX(s).rotateY(o).rotateZ(c)}},{key:"rotateAxis",value:function(n,i){return j.rotate(this,this,n,i),this.check()}},{key:"scale",value:function(n){return Array.isArray(n)?j.scale(this,this,n):j.scale(this,this,[n,n,n]),this.check()}},{key:"translate",value:function(n){return j.translate(this,this,n),this.check()}},{key:"transform",value:function(n,i){return n.length===4?(i=r0.transformMat4(i||[-0,-0,-0,-0],n,this),(0,ur.checkVector)(i,4),i):this.transformAsPoint(n,i)}},{key:"transformAsPoint",value:function(n,i){var s=n.length;switch(s){case 2:i=Kh.transformMat4(i||[-0,-0],n,this);break;case 3:i=e0.transformMat4(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,ur.checkVector)(i,n.length),i}},{key:"transformAsVector",value:function(n,i){switch(n.length){case 2:i=(0,Mi.vec2_transformMat4AsVector)(i||[-0,-0],n,this);break;case 3:i=(0,Mi.vec3_transformMat4AsVector)(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,ur.checkVector)(i,n.length),i}},{key:"makeRotationX",value:function(n){return this.identity().rotateX(n)}},{key:"makeTranslation",value:function(n,i,s){return this.identity().translate([n,i,s])}},{key:"transformPoint",value:function(n,i){return(0,ur.deprecated)("Matrix4.transformPoint","3.0"),this.transformAsPoint(n,i)}},{key:"transformVector",value:function(n,i){return(0,ur.deprecated)("Matrix4.transformVector","3.0"),this.transformAsPoint(n,i)}},{key:"transformDirection",value:function(n,i){return(0,ur.deprecated)("Matrix4.transformDirection","3.0"),this.transformAsVector(n,i)}}],[{key:"IDENTITY",get:function(){return lr.IDENTITY=lr.IDENTITY||Object.freeze(new t(bi)),lr.IDENTITY}},{key:"ZERO",get:function(){return lr.ZERO=lr.ZERO||Object.freeze(new t(a0)),lr.ZERO}},{key:"_computeInfinitePerspectiveOffCenter",value:function(n,i,s,o,c,u){var l=2*u/(s-i),h=2*u/(c-o),f=(s+i)/(s-i),d=(c+o)/(c-o),p=-1,m=-1,v=-2*u;return n[0]=l,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=h,n[6]=0,n[7]=0,n[8]=f,n[9]=d,n[10]=p,n[11]=m,n[12]=0,n[13]=0,n[14]=v,n[15]=0,n}}]),t}(Hh.default);it.default=s0});var qi=R(x=>{"use strict";function st(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?st=function(t){return typeof t}:st=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(e)}Object.defineProperty(x,"__esModule",{value:!0});x.create=jt;x.identity=c0;x.setAxisAngle=Ti;x.getAxisAngle=u0;x.getAngle=l0;x.multiply=ki;x.rotateX=f0;x.rotateY=h0;x.rotateZ=d0;x.calculateW=p0;x.exp=Oi;x.ln=Ri;x.pow=v0;x.slerp=ct;x.random=m0;x.invert=g0;x.conjugate=y0;x.fromMat3=Si;x.fromEuler=M0;x.str=x0;x.setAxes=x.sqlerp=x.rotationTo=x.equals=x.exactEquals=x.normalize=x.sqrLen=x.squaredLength=x.len=x.length=x.lerp=x.dot=x.scale=x.mul=x.add=x.set=x.copy=x.fromValues=x.clone=void 0;var $e=ot(Ue()),o0=ot(Vt()),Oe=ot(ke()),ee=ot(nt());function _i(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return _i=function(){return e},e}function ot(e){if(e&&e.__esModule)return e;if(e===null||st(e)!=="object"&&typeof e!="function")return{default:e};var r=_i();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function jt(){var e=new $e.ARRAY_TYPE(4);return $e.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function c0(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Ti(e,r,t){t=t*.5;var a=Math.sin(t);return e[0]=a*r[0],e[1]=a*r[1],e[2]=a*r[2],e[3]=Math.cos(t),e}function u0(e,r){var t=Math.acos(r[3])*2,a=Math.sin(t/2);return a>$e.EPSILON?(e[0]=r[0]/a,e[1]=r[1]/a,e[2]=r[2]/a):(e[0]=1,e[1]=0,e[2]=0),t}function l0(e,r){var t=Ei(e,r);return Math.acos(2*t*t-1)}function ki(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=t[0],c=t[1],u=t[2],l=t[3];return e[0]=a*l+s*o+n*u-i*c,e[1]=n*l+s*c+i*o-a*u,e[2]=i*l+s*u+a*c-n*o,e[3]=s*l-a*o-n*c-i*u,e}function f0(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c+s*o,e[1]=n*c+i*o,e[2]=i*c-n*o,e[3]=s*c-a*o,e}function h0(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c-i*o,e[1]=n*c+s*o,e[2]=i*c+a*o,e[3]=s*c-n*o,e}function d0(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c+n*o,e[1]=n*c-a*o,e[2]=i*c+s*o,e[3]=s*c-i*o,e}function p0(e,r){var t=r[0],a=r[1],n=r[2];return e[0]=t,e[1]=a,e[2]=n,e[3]=Math.sqrt(Math.abs(1-t*t-a*a-n*n)),e}function Oi(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=Math.sqrt(t*t+a*a+n*n),o=Math.exp(i),c=s>0?o*Math.sin(s)/s:0;return e[0]=t*c,e[1]=a*c,e[2]=n*c,e[3]=o*Math.cos(s),e}function Ri(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=Math.sqrt(t*t+a*a+n*n),o=s>0?Math.atan2(s,i)/s:0;return e[0]=t*o,e[1]=a*o,e[2]=n*o,e[3]=.5*Math.log(t*t+a*a+n*n+i*i),e}function v0(e,r,t){return Ri(e,r),Ai(e,e,t),Oi(e,e),e}function ct(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3],c=t[0],u=t[1],l=t[2],h=t[3],f,d,p,m,v;return d=n*c+i*u+s*l+o*h,d<0&&(d=-d,c=-c,u=-u,l=-l,h=-h),1-d>$e.EPSILON?(f=Math.acos(d),p=Math.sin(f),m=Math.sin((1-a)*f)/p,v=Math.sin(a*f)/p):(m=1-a,v=a),e[0]=m*n+v*c,e[1]=m*i+v*u,e[2]=m*s+v*l,e[3]=m*o+v*h,e}function m0(e){var r=$e.RANDOM(),t=$e.RANDOM(),a=$e.RANDOM(),n=Math.sqrt(1-r),i=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*t),e[1]=n*Math.cos(2*Math.PI*t),e[2]=i*Math.sin(2*Math.PI*a),e[3]=i*Math.cos(2*Math.PI*a),e}function g0(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t*t+a*a+n*n+i*i,o=s?1/s:0;return e[0]=-t*o,e[1]=-a*o,e[2]=-n*o,e[3]=i*o,e}function y0(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e}function Si(e,r){var t=r[0]+r[4]+r[8],a;if(t>0)a=Math.sqrt(t+1),e[3]=.5*a,a=.5/a,e[0]=(r[5]-r[7])*a,e[1]=(r[6]-r[2])*a,e[2]=(r[1]-r[3])*a;else{var n=0;r[4]>r[0]&&(n=1),r[8]>r[n*3+n]&&(n=2);var i=(n+1)%3,s=(n+2)%3;a=Math.sqrt(r[n*3+n]-r[i*3+i]-r[s*3+s]+1),e[n]=.5*a,a=.5/a,e[3]=(r[i*3+s]-r[s*3+i])*a,e[i]=(r[i*3+n]+r[n*3+i])*a,e[s]=(r[s*3+n]+r[n*3+s])*a}return e}function M0(e,r,t,a){var n=.5*Math.PI/180;r*=n,t*=n,a*=n;var i=Math.sin(r),s=Math.cos(r),o=Math.sin(t),c=Math.cos(t),u=Math.sin(a),l=Math.cos(a);return e[0]=i*c*l-s*o*u,e[1]=s*o*l+i*c*u,e[2]=s*c*u-i*o*l,e[3]=s*c*l+i*o*u,e}function x0(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var b0=ee.clone;x.clone=b0;var _0=ee.fromValues;x.fromValues=_0;var T0=ee.copy;x.copy=T0;var k0=ee.set;x.set=k0;var O0=ee.add;x.add=O0;var R0=ki;x.mul=R0;var Ai=ee.scale;x.scale=Ai;var Ei=ee.dot;x.dot=Ei;var S0=ee.lerp;x.lerp=S0;var Pi=ee.length;x.length=Pi;var A0=Pi;x.len=A0;var wi=ee.squaredLength;x.squaredLength=wi;var E0=wi;x.sqrLen=E0;var Zt=ee.normalize;x.normalize=Zt;var P0=ee.exactEquals;x.exactEquals=P0;var w0=ee.equals;x.equals=w0;var q0=function(){var e=Oe.create(),r=Oe.fromValues(1,0,0),t=Oe.fromValues(0,1,0);return function(a,n,i){var s=Oe.dot(n,i);return s<-.999999?(Oe.cross(e,r,n),Oe.len(e)<1e-6&&Oe.cross(e,t,n),Oe.normalize(e,e),Ti(a,e,Math.PI),a):s>.999999?(a[0]=0,a[1]=0,a[2]=0,a[3]=1,a):(Oe.cross(e,n,i),a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=1+s,Zt(a,a))}}();x.rotationTo=q0;var L0=function(){var e=jt(),r=jt();return function(t,a,n,i,s,o){return ct(e,a,s,o),ct(r,n,i,o),ct(t,e,r,2*o*(1-o)),t}}();x.sqlerp=L0;var I0=function(){var e=o0.create();return function(r,t,a,n){return e[0]=a[0],e[3]=a[1],e[6]=a[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-t[0],e[5]=-t[1],e[8]=-t[2],Zt(r,Si(r,e))}}();x.setAxes=I0});var Xt=R(ut=>{"use strict";var Je=G(),N0=te();Object.defineProperty(ut,"__esModule",{value:!0});ut.default=void 0;var C0=Je($()),D0=Je(J()),W0=Je(se()),B0=Je(oe()),Li=Je(ce()),F0=Je(br()),kr=ue(),Ii=Je(ze()),U=Ci(qi()),z0=Ci(nt());function Ni(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ni=function(n){return n?t:r})(e)}function Ci(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||N0(e)!=="object"&&typeof e!="function")return{default:e};var t=Ni(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Y0(e){var r=V0();return function(){var a=(0,Li.default)(e),n;if(r){var i=(0,Li.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,B0.default)(this,n)}}function V0(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var U0=[0,0,0,1],G0=function(e){(0,W0.default)(t,e);var r=Y0(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return(0,C0.default)(this,t),a=r.call(this,-0,-0,-0,-0),Array.isArray(n)&&arguments.length===1?a.copy(n):a.set(n,i,s,o),a}return(0,D0.default)(t,[{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this.check()}},{key:"set",value:function(n,i,s,o){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this.check()}},{key:"fromMatrix3",value:function(n){return U.fromMat3(this,n),this.check()}},{key:"identity",value:function(){return U.identity(this),this.check()}},{key:"fromAxisRotation",value:function(n,i){return U.setAxisAngle(this,n,i),this.check()}},{key:"setAxisAngle",value:function(n,i){return this.fromAxisRotation(n,i)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,kr.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,kr.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,kr.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,kr.checkNumber)(n)}},{key:"len",value:function(){return U.length(this)}},{key:"lengthSquared",value:function(){return U.squaredLength(this)}},{key:"dot",value:function(n,i){if(i!==void 0)throw new Error("Quaternion.dot only takes one argument");return U.dot(this,n)}},{key:"rotationTo",value:function(n,i){return U.rotationTo(this,n,i),this.check()}},{key:"add",value:function(n,i){if(i!==void 0)throw new Error("Quaternion.add only takes one argument");return U.add(this,this,n),this.check()}},{key:"calculateW",value:function(){return U.calculateW(this,this),this.check()}},{key:"conjugate",value:function(){return U.conjugate(this,this),this.check()}},{key:"invert",value:function(){return U.invert(this,this),this.check()}},{key:"lerp",value:function(n,i,s){return U.lerp(this,n,i,s),this.check()}},{key:"multiplyRight",value:function(n,i){return(0,Ii.default)(!i),U.multiply(this,this,n),this.check()}},{key:"multiplyLeft",value:function(n,i){return(0,Ii.default)(!i),U.multiply(this,n,this),this.check()}},{key:"normalize",value:function(){var n=this.len(),i=n>0?1/n:0;return this[0]=this[0]*i,this[1]=this[1]*i,this[2]=this[2]*i,this[3]=this[3]*i,n===0&&(this[3]=1),this.check()}},{key:"rotateX",value:function(n){return U.rotateX(this,this,n),this.check()}},{key:"rotateY",value:function(n){return U.rotateY(this,this,n),this.check()}},{key:"rotateZ",value:function(n){return U.rotateZ(this,this,n),this.check()}},{key:"scale",value:function(n){return U.scale(this,this,n),this.check()}},{key:"slerp",value:function(n,i,s){switch(arguments.length){case 1:var o=arguments[0],c=o.start;n=c===void 0?U0:c,i=o.target,s=o.ratio;break;case 2:var u=Array.prototype.slice.call(arguments);i=u[0],s=u[1],n=this;break;default:}return U.slerp(this,n,i,s),this.check()}},{key:"transformVector4",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return z0.transformQuat(i,n,this),(0,kr.checkVector)(i,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(n,i){return this.setAxisAngle(n,i)}},{key:"premultiply",value:function(n,i){return this.multiplyLeft(n,i)}},{key:"multiply",value:function(n,i){return this.multiplyRight(n,i)}}]),t}(F0.default);ut.default=G0});var Di=R(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.default=void 0;var j0={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:Math.PI*2};lt.default=j0});var Fi=R(ht=>{"use strict";var ft=G(),Z0=te();Object.defineProperty(ht,"__esModule",{value:!0});ht.default=void 0;var X0=ft(Tr()),Q0=ft($()),$0=ft(J()),X=ge(),J0=ft(Qr()),H0=K0(ke());function Wi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Wi=function(n){return n?t:r})(e)}function K0(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Z0(e)!=="object"&&typeof e!="function")return{default:e};var t=Wi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var Bi=1e-6,e1=6371e3,r1=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.phi,a=t===void 0?0:t,n=r.theta,i=n===void 0?0:n,s=r.radius,o=s===void 0?1:s,c=r.bearing,u=c===void 0?void 0:c,l=r.pitch,h=l===void 0?void 0:l,f=r.altitude,d=f===void 0?void 0:f,p=r.radiusScale,m=p===void 0?e1:p;(0,Q0.default)(this,e),this.phi=a,this.theta=i,this.radius=o||d||1,this.radiusScale=m||1,u!==void 0&&(this.bearing=u),h!==void 0&&(this.pitch=h),this.check()}return(0,$0.default)(e,[{key:"toString",value:function(){return this.formatString(X.config)}},{key:"formatString",value:function(t){var a=t.printTypes,n=a===void 0?!1:a,i=X.formatValue;return"".concat(n?"Spherical":"","[rho:").concat(i(this.radius),",theta:").concat(i(this.theta),",phi:").concat(i(this.phi),"]")}},{key:"equals",value:function(t){return(0,X.equals)(this.radius,t.radius)&&(0,X.equals)(this.theta,t.theta)&&(0,X.equals)(this.phi,t.phi)}},{key:"exactEquals",value:function(t){return this.radius===t.radius&&this.theta===t.theta&&this.phi===t.phi}},{key:"bearing",get:function(){return 180-(0,X.degrees)(this.phi)},set:function(t){this.phi=Math.PI-(0,X.radians)(t)}},{key:"pitch",get:function(){return(0,X.degrees)(this.theta)},set:function(t){this.theta=(0,X.radians)(t)}},{key:"longitude",get:function(){return(0,X.degrees)(this.phi)}},{key:"latitude",get:function(){return(0,X.degrees)(this.theta)}},{key:"lng",get:function(){return(0,X.degrees)(this.phi)}},{key:"lat",get:function(){return(0,X.degrees)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}},{key:"set",value:function(t,a,n){return this.radius=t,this.phi=a,this.theta=n,this.check()}},{key:"clone",value:function(){return new e().copy(this)}},{key:"copy",value:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this.check()}},{key:"fromLngLatZ",value:function(t){var a=(0,X0.default)(t,3),n=a[0],i=a[1],s=a[2];this.radius=1+s/this.radiusScale,this.phi=(0,X.radians)(i),this.theta=(0,X.radians)(n)}},{key:"fromVector3",value:function(t){return this.radius=H0.length(t),this.radius>0&&(this.theta=Math.atan2(t[0],t[1]),this.phi=Math.acos((0,X.clamp)(t[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new J0.default(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){return this.phi=Math.max(Bi,Math.min(Math.PI-Bi,this.phi)),this}},{key:"check",value:function(){if(!Number.isFinite(this.phi)||!Number.isFinite(this.theta)||!(this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}}]),e}();ht.default=r1});var Qt=R(pt=>{"use strict";var Pe=G();Object.defineProperty(pt,"__esModule",{value:!0});pt.default=void 0;var t1=Pe(Tr()),n1=Pe($()),a1=Pe(J()),i1=Pe(se()),s1=Pe(oe()),zi=Pe(ce()),o1=Pe(br()),fr=ge(),ie=ue(),Yi=Pe(Xt());function c1(e){var r=u1();return function(){var a=(0,zi.default)(e),n;if(r){var i=(0,zi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,s1.default)(this,n)}}function u1(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var dt="Unknown Euler angle order",hr=.99999;function l1(e){return e>=0&&e<6}function f1(e){if(e<0&&e>=6)throw new Error(dt);return e}var h1=function(e){(0,i1.default)(t,e);var r=c1(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t.DefaultOrder;if((0,n1.default)(this,t),a=r.call(this,-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])){var c;(c=a).fromVector3.apply(c,arguments)}else a.set(n,i,s,o);return a}return(0,a1.default)(t,[{key:"ELEMENTS",get:function(){return 4}},{key:"fromQuaternion",value:function(n){var i=(0,t1.default)(n,4),s=i[0],o=i[1],c=i[2],u=i[3],l=o*o,h=-2*(l+c*c)+1,f=2*(s*o+u*c),d=-2*(s*c-u*o),p=2*(o*c+u*s),m=-2*(s*s+l)+1;d=d>1?1:d,d=d<-1?-1:d;var v=Math.atan2(p,m),g=Math.asin(d),b=Math.atan2(f,h);return new t(v,g,b,t.RollPitchYaw)}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=Number.isFinite(n[3])||this.order,this.check()}},{key:"set",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0;return this[0]=n,this[1]=i,this[2]=s,this[3]=Number.isFinite(o)?o:this[3],this.check()}},{key:"validate",value:function(){return l1(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}},{key:"toArray",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return n[i]=this[0],n[i+1]=this[1],n[i+2]=this[2],n}},{key:"toArray4",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return n[i]=this[0],n[i+1]=this[1],n[i+2]=this[2],n[i+3]=this[3],n}},{key:"toVector3",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=this[0],n[1]=this[1],n[2]=this[2],n}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"alpha",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"beta",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"gamma",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"phi",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"theta",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"psi",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"roll",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"pitch",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"yaw",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"order",get:function(){return this[3]},set:function(n){this[3]=f1(n)}},{key:"fromVector3",value:function(n,i){return this.set(n[0],n[1],n[2],Number.isFinite(i)?i:this[3])}},{key:"fromArray",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this[0]=n[0+i],this[1]=n[1+i],this[2]=n[2+i],n[3]!==void 0&&(this[3]=n[3]),this.check()}},{key:"fromRollPitchYaw",value:function(n,i,s){return this.set(n,i,s,t.ZYX)}},{key:"fromRotationMatrix",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.DefaultOrder;return this._fromRotationMatrix(n,i),this.check()}},{key:"getRotationMatrix",value:function(n){return this._getRotationMatrix(n)}},{key:"getQuaternion",value:function(){var n=new Yi.default;switch(this[4]){case t.XYZ:return n.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case t.YXZ:return n.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case t.ZXY:return n.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case t.ZYX:return n.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case t.YZX:return n.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case t.XZY:return n.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(dt)}}},{key:"_fromRotationMatrix",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.DefaultOrder,s=n.elements,o=s[0],c=s[4],u=s[8],l=s[1],h=s[5],f=s[9],d=s[2],p=s[6],m=s[10];switch(i=i||this[3],i){case t.XYZ:this[1]=Math.asin((0,fr.clamp)(u,-1,1)),Math.abs(u)<hr?(this[0]=Math.atan2(-f,m),this[2]=Math.atan2(-c,o)):(this[0]=Math.atan2(p,h),this[2]=0);break;case t.YXZ:this[0]=Math.asin(-(0,fr.clamp)(f,-1,1)),Math.abs(f)<hr?(this[1]=Math.atan2(u,m),this[2]=Math.atan2(l,h)):(this[1]=Math.atan2(-d,o),this[2]=0);break;case t.ZXY:this[0]=Math.asin((0,fr.clamp)(p,-1,1)),Math.abs(p)<hr?(this[1]=Math.atan2(-d,m),this[2]=Math.atan2(-c,h)):(this[1]=0,this[2]=Math.atan2(l,o));break;case t.ZYX:this[1]=Math.asin(-(0,fr.clamp)(d,-1,1)),Math.abs(d)<hr?(this[0]=Math.atan2(p,m),this[2]=Math.atan2(l,o)):(this[0]=0,this[2]=Math.atan2(-c,h));break;case t.YZX:this[2]=Math.asin((0,fr.clamp)(l,-1,1)),Math.abs(l)<hr?(this[0]=Math.atan2(-f,h),this[1]=Math.atan2(-d,o)):(this[0]=0,this[1]=Math.atan2(u,m));break;case t.XZY:this[2]=Math.asin(-(0,fr.clamp)(c,-1,1)),Math.abs(c)<hr?(this[0]=Math.atan2(p,h),this[1]=Math.atan2(u,o)):(this[0]=Math.atan2(-f,m),this[1]=0);break;default:throw new Error(dt)}return this[3]=i,this}},{key:"_getRotationMatrix",value:function(n){var i=n||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],s=this.x,o=this.y,c=this.z,u=Math.cos(s),l=Math.cos(o),h=Math.cos(c),f=Math.sin(s),d=Math.sin(o),p=Math.sin(c);switch(this[3]){case t.XYZ:{var m=u*h,v=u*p,g=f*h,b=f*p;i[0]=l*h,i[4]=-l*p,i[8]=d,i[1]=v+g*d,i[5]=m-b*d,i[9]=-f*l,i[2]=b-m*d,i[6]=g+v*d,i[10]=u*l;break}case t.YXZ:{var y=l*h,M=l*p,k=d*h,_=d*p;i[0]=y+_*f,i[4]=k*f-M,i[8]=u*d,i[1]=u*p,i[5]=u*h,i[9]=-f,i[2]=M*f-k,i[6]=_+y*f,i[10]=u*l;break}case t.ZXY:{var C=l*h,L=l*p,I=d*h,w=d*p;i[0]=C-w*f,i[4]=-u*p,i[8]=I+L*f,i[1]=L+I*f,i[5]=u*h,i[9]=w-C*f,i[2]=-u*d,i[6]=f,i[10]=u*l;break}case t.ZYX:{var D=u*h,N=u*p,W=f*h,E=f*p;i[0]=l*h,i[4]=W*d-N,i[8]=D*d+E,i[1]=l*p,i[5]=E*d+D,i[9]=N*d-W,i[2]=-d,i[6]=f*l,i[10]=u*l;break}case t.YZX:{var Z=u*l,de=u*d,pe=f*l,De=f*d;i[0]=l*h,i[4]=De-Z*p,i[8]=pe*p+de,i[1]=p,i[5]=u*h,i[9]=-f*h,i[2]=-d*h,i[6]=de*p+pe,i[10]=Z-De*p;break}case t.XZY:{var We=u*l,dn=u*d,pn=f*l,vn=f*d;i[0]=l*h,i[4]=-p,i[8]=d*h,i[1]=We*p+vn,i[5]=u*h,i[9]=dn*p-pn,i[2]=pn*p-dn,i[6]=f*h,i[10]=vn*p+We;break}default:throw new Error(dt)}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{key:"toQuaternion",value:function(){var n=Math.cos(this.yaw*.5),i=Math.sin(this.yaw*.5),s=Math.cos(this.roll*.5),o=Math.sin(this.roll*.5),c=Math.cos(this.pitch*.5),u=Math.sin(this.pitch*.5),l=n*s*c+i*o*u,h=n*o*c-i*s*u,f=n*s*u+i*o*c,d=i*s*c-n*o*u;return new Yi.default(h,f,d,l)}}],[{key:"ZYX",get:function(){return 0}},{key:"YXZ",get:function(){return 1}},{key:"XZY",get:function(){return 2}},{key:"ZXY",get:function(){return 3}},{key:"YZX",get:function(){return 4}},{key:"XYZ",get:function(){return 5}},{key:"RollPitchYaw",get:function(){return 0}},{key:"DefaultOrder",get:function(){return t.ZYX}},{key:"RotationOrders",get:function(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}},{key:"rotationOrder",value:function(n){return t.RotationOrders[n]}}]),t}(o1.default);pt.default=h1});var Ui=R(vt=>{"use strict";var Or=G();Object.defineProperty(vt,"__esModule",{value:!0});vt.default=void 0;var d1=Or($()),p1=Or(J()),$t=Or(Gt()),Vi=Or(Qr()),Jt=Or(Qt()),v1=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.x,a=t===void 0?0:t,n=r.y,i=n===void 0?0:n,s=r.z,o=s===void 0?0:s,c=r.roll,u=c===void 0?0:c,l=r.pitch,h=l===void 0?0:l,f=r.yaw,d=f===void 0?0:f,p=r.position,m=p===void 0?void 0:p,v=r.orientation,g=v===void 0?void 0:v;(0,d1.default)(this,e),Array.isArray(m)&&m.length===3?this.position=new Vi.default(m):this.position=new Vi.default(a,i,o),Array.isArray(g)&&g.length===4?this.orientation=new Jt.default(g,g[3]):this.orientation=new Jt.default(u,h,d,Jt.default.RollPitchYaw)}return(0,p1.default)(e,[{key:"x",get:function(){return this.position.x},set:function(t){this.position.x=t}},{key:"y",get:function(){return this.position.y},set:function(t){this.position.y=t}},{key:"z",get:function(){return this.position.z},set:function(t){this.position.z=t}},{key:"roll",get:function(){return this.orientation.roll},set:function(t){this.orientation.roll=t}},{key:"pitch",get:function(){return this.orientation.pitch},set:function(t){this.orientation.pitch=t}},{key:"yaw",get:function(){return this.orientation.yaw},set:function(t){this.orientation.yaw=t}},{key:"getPosition",value:function(){return this.position}},{key:"getOrientation",value:function(){return this.orientation}},{key:"equals",value:function(t){return t?this.position.equals(t.position)&&this.orientation.equals(t.orientation):!1}},{key:"exactEquals",value:function(t){return t?this.position.exactEquals(t.position)&&this.orientation.exactEquals(t.orientation):!1}},{key:"getTransformationMatrix",value:function(){var t=Math.sin(this.roll),a=Math.sin(this.pitch),n=Math.sin(this.yaw),i=Math.cos(this.roll),s=Math.cos(this.pitch),o=Math.cos(this.yaw),c=new $t.default().setRowMajor(o*s,-n*i+o*a*t,n*t+o*a*i,this.x,n*s,o*i+n*a*t,-o*t+n*a*i,this.y,-a,s*t,s*i,this.z,0,0,0,1);return c}},{key:"getTransformationMatrixFromPose",value:function(t){return new $t.default().multiplyRight(this.getTransformationMatrix()).multiplyRight(t.getTransformationMatrix().invert())}},{key:"getTransformationMatrixToPose",value:function(t){return new $t.default().multiplyRight(t.getTransformationMatrix()).multiplyRight(this.getTransformationMatrix().invert())}}]),e}();vt.default=v1});var dr=R(P=>{"use strict";var le=G();Object.defineProperty(P,"__esModule",{value:!0});Object.defineProperty(P,"config",{enumerable:!0,get:function(){return z.config}});Object.defineProperty(P,"configure",{enumerable:!0,get:function(){return z.configure}});Object.defineProperty(P,"formatValue",{enumerable:!0,get:function(){return z.formatValue}});Object.defineProperty(P,"isArray",{enumerable:!0,get:function(){return z.isArray}});Object.defineProperty(P,"clone",{enumerable:!0,get:function(){return z.clone}});Object.defineProperty(P,"equals",{enumerable:!0,get:function(){return z.equals}});Object.defineProperty(P,"exactEquals",{enumerable:!0,get:function(){return z.exactEquals}});Object.defineProperty(P,"toRadians",{enumerable:!0,get:function(){return z.toRadians}});Object.defineProperty(P,"toDegrees",{enumerable:!0,get:function(){return z.toDegrees}});Object.defineProperty(P,"radians",{enumerable:!0,get:function(){return z.radians}});Object.defineProperty(P,"degrees",{enumerable:!0,get:function(){return z.degrees}});Object.defineProperty(P,"sin",{enumerable:!0,get:function(){return z.sin}});Object.defineProperty(P,"cos",{enumerable:!0,get:function(){return z.cos}});Object.defineProperty(P,"tan",{enumerable:!0,get:function(){return z.tan}});Object.defineProperty(P,"asin",{enumerable:!0,get:function(){return z.asin}});Object.defineProperty(P,"acos",{enumerable:!0,get:function(){return z.acos}});Object.defineProperty(P,"atan",{enumerable:!0,get:function(){return z.atan}});Object.defineProperty(P,"clamp",{enumerable:!0,get:function(){return z.clamp}});Object.defineProperty(P,"lerp",{enumerable:!0,get:function(){return z.lerp}});Object.defineProperty(P,"withEpsilon",{enumerable:!0,get:function(){return z.withEpsilon}});Object.defineProperty(P,"Vector2",{enumerable:!0,get:function(){return m1.default}});Object.defineProperty(P,"Vector3",{enumerable:!0,get:function(){return g1.default}});Object.defineProperty(P,"Vector4",{enumerable:!0,get:function(){return y1.default}});Object.defineProperty(P,"Matrix3",{enumerable:!0,get:function(){return M1.default}});Object.defineProperty(P,"Matrix4",{enumerable:!0,get:function(){return x1.default}});Object.defineProperty(P,"Quaternion",{enumerable:!0,get:function(){return b1.default}});Object.defineProperty(P,"checkNumber",{enumerable:!0,get:function(){return _1.checkNumber}});Object.defineProperty(P,"_MathUtils",{enumerable:!0,get:function(){return T1.default}});Object.defineProperty(P,"SphericalCoordinates",{enumerable:!0,get:function(){return Gi.default}});Object.defineProperty(P,"_SphericalCoordinates",{enumerable:!0,get:function(){return Gi.default}});Object.defineProperty(P,"Pose",{enumerable:!0,get:function(){return ji.default}});Object.defineProperty(P,"_Pose",{enumerable:!0,get:function(){return ji.default}});Object.defineProperty(P,"Euler",{enumerable:!0,get:function(){return Zi.default}});Object.defineProperty(P,"_Euler",{enumerable:!0,get:function(){return Zi.default}});Object.defineProperty(P,"assert",{enumerable:!0,get:function(){return k1.default}});var z=ge(),m1=le(Ma()),g1=le(Qr()),y1=le(Ba()),M1=le(Xa()),x1=le(Gt()),b1=le(Xt()),_1=ue(),T1=le(Di()),Gi=le(Fi()),ji=le(Ui()),Zi=le(Qt()),k1=le(ze()),Ht={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global},O1=Ht.global||Ht.self||Ht.window;O1.mathgl={config:z.config}});var Kt=R(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.WGS84_CONSTANTS=xe.WGS84_RADIUS_Z=xe.WGS84_RADIUS_Y=xe.WGS84_RADIUS_X=void 0;var we=6378137;xe.WGS84_RADIUS_X=we;var qe=6378137;xe.WGS84_RADIUS_Y=qe;var Le=6356752314245179e-9;xe.WGS84_RADIUS_Z=Le;var R1={radii:[we,qe,Le],radiiSquared:[we*we,qe*qe,Le*Le],oneOverRadii:[1/we,1/qe,1/Le],oneOverRadiiSquared:[1/(we*we),1/(qe*qe),1/(Le*Le)],maximumRadius:Math.max(we,qe,Le),centerToleranceSquared:.1};xe.WGS84_CONSTANTS=R1});var nn=R(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.fromCartographic=rn;Re.fromCartographicToRadians=S1;Re.fromCartographicToDegrees=A1;Re.toCartographic=tn;Re.toCartographicFromRadians=E1;Re.toCartographicFromDegrees=P1;Re.isWGS84=w1;var fe=dr(),Xi=Kt(),pr=function(r){return r},en=new fe.Vector3;function rn(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pr;return(0,fe.isArray)(e)?(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]):"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z),r}function S1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:en;return rn(e,r,fe.config._cartographicRadians?pr:fe.toRadians)}function A1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:en;return rn(e,r,fe.config._cartographicRadians?fe.toDegrees:pr)}function tn(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pr;return(0,fe.isArray)(r)?(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]):"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]),r}function E1(e,r){return tn(e,r,fe.config._cartographicRadians?pr:fe.toDegrees)}function P1(e,r){return tn(e,r,fe.config._cartographicRadians?fe.toRadians:pr)}function w1(e){if(!e)return!1;en.from(e);var r=Xi.WGS84_CONSTANTS.oneOverRadiiSquared,t=Xi.WGS84_CONSTANTS.centerToleranceSquared,a=e[0]*e[0]*r[0],n=e[1]*e[1]*r[1],i=e[2]*e[2]*r[2];return Math.abs(a+n+i-1)<t}});var Ji=R(an=>{"use strict";var q1=te();Object.defineProperty(an,"__esModule",{value:!0});an.default=C1;var Rr=dr(),Jp=L1(ke());function Qi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Qi=function(n){return n?t:r})(e)}function L1(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||q1(e)!=="object"&&typeof e!="function")return{default:e};var t=Qi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var $i=new Rr.Vector3,I1=new Rr.Vector3,N1=new Rr.Vector3;function C1(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Rr.Vector3,a=r.oneOverRadii,n=r.oneOverRadiiSquared,i=r.centerToleranceSquared;$i.from(e);var s=e.x,o=e.y,c=e.z,u=a.x,l=a.y,h=a.z,f=s*s*u*u,d=o*o*l*l,p=c*c*h*h,m=f+d+p,v=Math.sqrt(1/m);if(!!Number.isFinite(v)){var g=I1;if(g.copy(e).scale(v),m<i)return g.to(t);var b=n.x,y=n.y,M=n.z,k=N1;k.set(g.x*b*2,g.y*y*2,g.z*M*2);var _=(1-v)*e.len()/(.5*k.len()),C=0,L,I,w,D;do{_-=C,L=1/(1+_*b),I=1/(1+_*y),w=1/(1+_*M);var N=L*L,W=I*I,E=w*w,Z=N*L,de=W*I,pe=E*w;D=f*N+d*W+p*E-1;var De=f*Z*b+d*de*y+p*pe*M,We=-2*De;C=D/We}while(Math.abs(D)>Rr._MathUtils.EPSILON12);return $i.scale([L,I,w]).to(t)}}});var es=R(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.default=z1;var re=dr(),Hi=1e-14,D1=new re.Vector3,Ki={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"}},sn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Se={east:new re.Vector3,north:new re.Vector3,up:new re.Vector3,west:new re.Vector3,south:new re.Vector3,down:new re.Vector3},W1=new re.Vector3,B1=new re.Vector3,F1=new re.Vector3;function z1(e,r,t,a,n,i){var s=Ki[r]&&Ki[r][t];(0,re.assert)(s&&(!a||a===s));var o,c,u,l=D1.copy(n),h=(0,re.equals)(l.x,0,Hi)&&(0,re.equals)(l.y,0,Hi);if(h){var f=Math.sign(l.z);o=W1.fromArray(sn[r]),r!=="east"&&r!=="west"&&o.scale(f),c=B1.fromArray(sn[t]),t!=="east"&&t!=="west"&&c.scale(f),u=F1.fromArray(sn[a]),a!=="east"&&a!=="west"&&u.scale(f)}else{var d=Se.up,p=Se.east,m=Se.north;p.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,d),m.copy(d).cross(p);var v=Se.down,g=Se.west,b=Se.south;v.copy(d).scale(-1),g.copy(p).scale(-1),b.copy(m).scale(-1),o=Se[r],c=Se[t],u=Se[a]}return i[0]=o.x,i[1]=o.y,i[2]=o.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]=l.x,i[13]=l.y,i[14]=l.z,i[15]=1,i}});var ss=R(yt=>{"use strict";var Sr=G(),Y1=te();Object.defineProperty(yt,"__esModule",{value:!0});yt.default=void 0;var V1=Sr(Tr()),U1=Sr($()),G1=Sr(J()),Y=dr(),rs=Z1(ke()),cn=Kt(),ts=nn(),j1=Sr(Ji()),ns=Sr(es());function as(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(as=function(n){return n?t:r})(e)}function Z1(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Y1(e)!=="object"&&typeof e!="function")return{default:e};var t=as(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var mt=new Y.Vector3,is=new Y.Vector3,X1=new Y.Vector3,he=new Y.Vector3,Q1=new Y.Vector3,gt=new Y.Vector3,un,$1=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;(0,U1.default)(this,e),(0,Y.assert)(r>=0),(0,Y.assert)(t>=0),(0,Y.assert)(a>=0),this.radii=new Y.Vector3(r,t,a),this.radiiSquared=new Y.Vector3(r*r,t*t,a*a),this.radiiToTheFourth=new Y.Vector3(r*r*r*r,t*t*t*t,a*a*a*a),this.oneOverRadii=new Y.Vector3(r===0?0:1/r,t===0?0:1/t,a===0?0:1/a),this.oneOverRadiiSquared=new Y.Vector3(r===0?0:1/(r*r),t===0?0:1/(t*t),a===0?0:1/(a*a)),this.minimumRadius=Math.min(r,t,a),this.maximumRadius=Math.max(r,t,a),this.centerToleranceSquared=Y._MathUtils.EPSILON1,this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return(0,G1.default)(e,[{key:"equals",value:function(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=is,i=X1,s=(0,V1.default)(t,3),o=s[2];this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);var c=Math.sqrt(n.dot(i));return i.scale(1/c),n.scale(o),i.add(n),i.to(a)}},{key:"cartesianToCartographic",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];gt.from(t);var n=this.scaleToGeodeticSurface(gt,he);if(!!n){var i=this.geodeticSurfaceNormal(n,is),s=Q1;s.copy(gt).subtract(n);var o=Math.atan2(i.y,i.x),c=Math.asin(i.z),u=Math.sign(rs.dot(s,gt))*rs.length(s);return(0,ts.toCartographicFromRadians)([o,c,u],a)}}},{key:"eastNorthUpToFixedFrame",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Y.Matrix4;return(0,ns.default)(this,"east","north","up",t,a)}},{key:"localFrameToFixedFrame",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new Y.Matrix4;return(0,ns.default)(this,t,a,n,i,s)}},{key:"geocentricSurfaceNormal",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return mt.from(t).normalize().to(a)}},{key:"geodeticSurfaceNormalCartographic",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=(0,ts.fromCartographicToRadians)(t),i=n[0],s=n[1],o=Math.cos(s);return mt.set(o*Math.cos(i),o*Math.sin(i),Math.sin(s)).normalize(),mt.to(a)}},{key:"geodeticSurfaceNormal",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return mt.from(t).scale(this.oneOverRadiiSquared).normalize().to(a)}},{key:"scaleToGeodeticSurface",value:function(t,a){return(0,j1.default)(t,this,a)}},{key:"scaleToGeocentricSurface",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];he.from(t);var n=he.x,i=he.y,s=he.z,o=this.oneOverRadiiSquared,c=1/Math.sqrt(n*n*o.x+i*i*o.y+s*s*o.z);return he.multiplyScalar(c).to(a)}},{key:"transformPositionToScaledSpace",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return he.from(t).scale(this.oneOverRadii).to(a)}},{key:"transformPositionFromScaledSpace",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return he.from(t).scale(this.radii).to(a)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,0];(0,Y.assert)((0,Y.equals)(this.radii.x,this.radii.y,Y._MathUtils.EPSILON15)),(0,Y.assert)(this.radii.z>0),he.from(t);var i=he.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-a))return he.set(0,0,i).to(n)}}],[{key:"WGS84",get:function(){return un=un||new e(cn.WGS84_RADIUS_X,cn.WGS84_RADIUS_Y,cn.WGS84_RADIUS_Z),un}}]),e}();yt.default=$1});var os=R(Mt=>{"use strict";var J1=G();Object.defineProperty(Mt,"__esModule",{value:!0});Object.defineProperty(Mt,"Ellipsoid",{enumerable:!0,get:function(){return H1.default}});Object.defineProperty(Mt,"isWGS84",{enumerable:!0,get:function(){return K1.isWGS84}});var H1=J1(ss()),K1=nn()});function bt(e,r=!0,t){let a=t||new Set;if(e){if(bn(e))a.add(e);else if(bn(e.buffer))a.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let n in e)bt(e[n],r,a)}}return t===void 0?Array.from(a):[]}function bn(e){return e?e instanceof ArrayBuffer||typeof MessagePort!="undefined"&&e instanceof MessagePort||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas:!1}function Be(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{}return parentPort}var _t=new Map,H=class{static inWorkerThread(){return typeof self!="undefined"||Boolean(Be())}static set onmessage(r){function t(n){let i=Be(),{type:s,payload:o}=i?n:n.data;r(s,o)}let a=Be();a?(a.on("message",t),a.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t}static addEventListener(r){let t=_t.get(r);t||(t=n=>{if(!Os(n))return;let i=Be(),{type:s,payload:o}=i?n:n.data;r(s,o)}),Be()?console.error("not implemented"):globalThis.addEventListener("message",t)}static removeEventListener(r){let t=_t.get(r);_t.delete(r),Be()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static postMessage(r,t){let a={source:"loaders.gl",type:r,payload:t},n=bt(t),i=Be();i?i.postMessage(a,n):globalThis.postMessage(a,n)}};function Os(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}var Er=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(r){return this.enqueue(r)}enqueue(r){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let t=this._settlers.shift();r instanceof Error?t.reject(r):t.resolve({value:r})}else this._values.push(r)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let r=this._values.shift();return r instanceof Error?Promise.reject(r):Promise.resolve({done:!1,value:r})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((r,t)=>{this._settlers.push({resolve:r,reject:t})})}};var Rs=0,Pr,_n;function Tt(e,r){if(!H.inWorkerThread())return;let t={process:Ss};H.onmessage=async(a,n)=>{try{switch(a){case"process":if(!e)throw new Error("Worker does not support atomic processing");let i=await e(n.input,n.options||{},t);H.postMessage("done",{result:i});break;case"process-in-batches":if(!r)throw new Error("Worker does not support batched processing");Pr=new Er,_n=n.options||{};let s=r(Pr,_n,t);for await(let o of s)H.postMessage("output-batch",{result:o});H.postMessage("done",{});break;case"input-batch":Pr.push(n.input);break;case"input-done":Pr.close();break;default:}}catch(i){let s=i instanceof Error?i.message:"";H.postMessage("error",{error:s})}}}function Ss(e,r={}){return new Promise((t,a)=>{let n=Rs++,i=(o,c)=>{if(c.id===n)switch(o){case"done":H.removeEventListener(i),t(c.result);break;case"error":H.removeEventListener(i),a(c.error);break;default:}};H.addEventListener(i);let s={id:n,input:e,options:r};H.postMessage("process",s)})}function Ae(e,r){if(!e)throw new Error(r||"loader assertion failed.")}function be(e,r){return Ae(e>=0),Ae(r>0),e+(r-1)&~(r-1)}function kt(e,r,t){let a;if(e instanceof ArrayBuffer)a=new Uint8Array(e);else{let n=e.byteOffset,i=e.byteLength;a=new Uint8Array(e.buffer||e.arrayBuffer,n,i)}return r.set(a,t),t+be(a.byteLength,4)}function wr(e,r,t,a){let n=be(t.byteLength,a),i=n-t.byteLength;if(e){let s=new Uint8Array(e.buffer,e.byteOffset+r,t.byteLength),o=new Uint8Array(t);s.set(o);for(let c=0;c<i;++c)e.setUint8(r+t.byteLength+c,32)}return r+=n,r}function Ke(e,r,t,a){let i=new TextEncoder().encode(t);return r=wr(e,r,i,a),r}function Ot(e,r){let t=e.length,n=Math.ceil(t/r)*r-t,i="";for(let s=0;s<n;++s)i+=" ";return e+i}function er(e,r,t,a){if(e)for(let n=0;n<a;n++)e.setUint8(r+n,t.charCodeAt(n));return r+a}function mr(e,r,t,a){if(e)for(let n=0;n<a;n++)e.setUint8(r+n,t[n]);return r+a}function qr(e,r,t){if(r.encodeSync)return r.encodeSync(e,t);throw new Error("Writer could not synchronously encode data")}var Tn="3.2.6";var ve=!1,gr=!0;function Rt(e){let r=yr(e);return As(r)||ws(r)||Es(r)||Ps(r)}function As(e){let r=yr(e);return r.byteLength>=24&&r.getUint32(0,ve)===2303741511?{mimeType:"image/png",width:r.getUint32(16,ve),height:r.getUint32(20,ve)}:null}function Es(e){let r=yr(e);return r.byteLength>=10&&r.getUint32(0,ve)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,gr),height:r.getUint16(8,gr)}:null}function Ps(e){let r=yr(e);return r.byteLength>=14&&r.getUint16(0,ve)===16973&&r.getUint32(2,gr)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,gr),height:r.getUint32(22,gr)}:null}function ws(e){let r=yr(e);if(!(r.byteLength>=3&&r.getUint16(0,ve)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:a,sofMarkers:n}=qs(),i=2;for(;i+9<r.byteLength;){let s=r.getUint16(i,ve);if(n.has(s))return{mimeType:"image/jpeg",height:r.getUint16(i+5,ve),width:r.getUint16(i+7,ve)};if(!a.has(s))return null;i+=2,i+=r.getUint16(i,ve)}return null}function qs(){let e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);let r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:r}}function yr(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function Fe(e,r){if(!e)throw new Error(r||"assert failed: gltf")}var kn=["SCALAR","VEC2","VEC3","VEC4"],Ls=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Is=new Map(Ls),Ns={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cs={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ds={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function On(e){return kn[e-1]||kn[0]}function Rn(e){let r=Is.get(e.constructor);if(!r)throw new Error("Illegal typed array");return r}function Sn(e,r){let t=Ds[e.componentType],a=Ns[e.type],n=Cs[e.componentType],i=e.count*a,s=e.count*a*n;return Fe(s>=0&&s<=r.byteLength),{ArrayType:t,length:i,byteLength:s}}var Ws={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Mr=class{constructor(r){this.gltf=r||{json:Q({},Ws),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(r){return this.json[r]}getExtraData(r){return(this.json.extras||{})[r]}getExtension(r){let t=this.getUsedExtensions().find(n=>n===r),a=this.json.extensions||{};return t?a[r]||!0:null}getRequiredExtension(r){return this.getRequiredExtensions().find(a=>a===r)?this.getExtension(r):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(r,t){return(r.extensions||{})[t]}getScene(r){return this.getObject("scenes",r)}getNode(r){return this.getObject("nodes",r)}getSkin(r){return this.getObject("skins",r)}getMesh(r){return this.getObject("meshes",r)}getMaterial(r){return this.getObject("materials",r)}getAccessor(r){return this.getObject("accessors",r)}getTexture(r){return this.getObject("textures",r)}getSampler(r){return this.getObject("samplers",r)}getImage(r){return this.getObject("images",r)}getBufferView(r){return this.getObject("bufferViews",r)}getBuffer(r){return this.getObject("buffers",r)}getObject(r,t){if(typeof t=="object")return t;let a=this.json[r]&&this.json[r][t];if(!a)throw new Error(`glTF file error: Could not find ${r}[${t}]`);return a}getTypedArrayForBufferView(r){r=this.getBufferView(r);let t=r.buffer,a=this.gltf.buffers[t];Fe(a);let n=(r.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,n,r.byteLength)}getTypedArrayForAccessor(r){r=this.getAccessor(r);let t=this.getBufferView(r.bufferView),n=this.getBuffer(t.buffer).data,{ArrayType:i,length:s}=Sn(r,t),o=t.byteOffset+r.byteOffset;return new i(n,o,s)}getTypedArrayForImageData(r){r=this.getAccessor(r);let t=this.getBufferView(r.bufferView),n=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(n,i,t.byteLength)}addApplicationData(r,t){return this.json[r]=t,this}addExtraData(r,t){return this.json.extras=this.json.extras||{},this.json.extras[r]=t,this}addObjectExtension(r,t,a){return r.extensions=r.extensions||{},r.extensions[t]=a,this.registerUsedExtension(t),this}setObjectExtension(r,t,a){let n=r.extensions||{};n[t]=a}removeObjectExtension(r,t){let a=r.extensions||{},n=a[t];return delete a[t],n}addExtension(r,t={}){return Fe(t),this.json.extensions=this.json.extensions||{},this.json.extensions[r]=t,this.registerUsedExtension(r),t}addRequiredExtension(r,t={}){return Fe(t),this.addExtension(r,t),this.registerRequiredExtension(r),t}registerUsedExtension(r){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===r)||this.json.extensionsUsed.push(r)}registerRequiredExtension(r){this.registerUsedExtension(r),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===r)||this.json.extensionsRequired.push(r)}removeExtension(r){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,r),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,r),this.json.extensions&&delete this.json.extensions[r]}setDefaultScene(r){this.json.scene=r}addScene(r){let{nodeIndices:t}=r;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(r){let{meshIndex:t,matrix:a}=r;this.json.nodes=this.json.nodes||[];let n={mesh:t};return a&&(n.matrix=a),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(r){let{attributes:t,indices:a,material:n,mode:i=4}=r,o={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(a){let c=this._addIndices(a);o.primitives[0].indices=c}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(r){let a={primitives:[{attributes:this._addAttributes(r),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addImage(r,t){let a=Rt(r),n=t||(a==null?void 0:a.mimeType),s={bufferView:this.addBufferView(r),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}addBufferView(r){let t=r.byteLength;Fe(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(r);let a={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=be(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(r,t){let a={bufferView:r,type:On(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(a),this.json.accessors.length-1}addBinaryBuffer(r,t={size:3}){let a=this.addBufferView(r),n={min:t.min,max:t.max};(!n.min||!n.max)&&(n=this._getAccessorMinMax(r,t.size));let i={size:t.size,componentType:Rn(r),count:Math.round(r.length/t.size),min:n.min,max:n.max};return this.addAccessor(a,Object.assign(i,t))}addTexture(r){let{imageIndex:t}=r,a={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(a),this.json.textures.length-1}addMaterial(r){return this.json.materials=this.json.materials||[],this.json.materials.push(r),this.json.materials.length-1}createBinaryChunk(){var i,s;this.gltf.buffers=[];let r=this.byteLength,t=new ArrayBuffer(r),a=new Uint8Array(t),n=0;for(let o of this.sourceBuffers||[])n=kt(o,a,n);((s=(i=this.json)==null?void 0:i.buffers)==null?void 0:s[0])?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=t,this.sourceBuffers=[t]}_removeStringFromArray(r,t){let a=!0;for(;a;){let n=r.indexOf(t);n>-1?r.splice(n,1):a=!1}}_addAttributes(r={}){let t={};for(let a in r){let n=r[a],i=this._getGltfAttributeName(a),s=this.addBinaryBuffer(n.value,n);t[i]=s}return t}_addIndices(r){return this.addBinaryBuffer(r,{size:1})}_getGltfAttributeName(r){switch(r.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 r}}_getAccessorMinMax(r,t){let a={min:null,max:null};if(r.length<t)return a;a.min=[],a.max=[];let n=r.subarray(0,t);for(let i of n)a.min.push(i),a.max.push(i);for(let i=t;i<r.length;i+=t)for(let s=0;s<t;s++)a.min[0+s]=Math.min(a.min[0+s],r[i+s]),a.max[0+s]=Math.max(a.max[0+s],r[i+s]);return a}};var Bs=1179937895,Fs=1313821514,zs=5130562,me=!0;function St(e,r,t=0,a={}){let{magic:n=Bs,version:i=2,json:s={},binary:o}=e,c=t;r&&(r.setUint32(t+0,n,me),r.setUint32(t+4,i,me),r.setUint32(t+8,0,me));let u=t+8;t+=12;let l=t;r&&(r.setUint32(t+0,0,me),r.setUint32(t+4,Fs,me)),t+=8;let h=JSON.stringify(s);if(t=Ke(r,t,h,4),r){let f=t-l-8;r.setUint32(l+0,f,me)}if(o){let f=t;if(r&&(r.setUint32(t+0,0,me),r.setUint32(t+4,zs,me)),t+=8,t=wr(r,t,o,4),r){let d=t-f-8;r.setUint32(f+0,d,me)}}if(r){let f=t-c;r.setUint32(u,f,me)}return t}function At(e,r,t,a){return Ys(e),St(e,r,t,a)}function Ys(e,{firstBuffer:r=0}={}){if(e.buffers&&e.buffers.length>r)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Et={name:"glTF",id:"gltf",module:"gltf",version:Tn,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:Vs,options:{gltf:{}}};function Vs(e,r={}){let{byteOffset:t=0}=r,a=At(e,null,t,r),n=new ArrayBuffer(a),i=new DataView(n);return At(e,i,t,r),n}var cs="3.2.6";var vr={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},nv=Object.keys(vr),Ie={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function Ne(e,r,t){let a=12;if(!r)return t+a;let{magic:n,version:i=1,byteLength:s=12}=e;return Ae(Array.isArray(n)&&Number.isFinite(i)&&Number.isFinite(s)),r.setUint8(t+0,n[0]),r.setUint8(t+1,n[1]),r.setUint8(t+2,n[2]),r.setUint8(t+3,n[3]),r.setUint32(t+4,i,!0),r.setUint32(t+8,s,!0),t+=a,t}function Ce(e,r,t){!e||e.setUint32(r+8,t,!0)}function us(e,r,t,a,n){e=Q({magic:Ie.COMPOSITE,tiles:[]},e);let i=t;t+=Ne(e,r,t),r&&r.setUint32(t,e.tiles.length,!0),t+=4;for(let s=0;s<e.tiles.length;++s)t+=n(e.tiles[s],r,t,a);return Ce(r,i,t-i),t}function ls(e,r,t,a){let{featuresLength:n=0,batchTable:i}=e,s={BATCH_LENGTH:n},o=JSON.stringify(s),c=i?JSON.stringify(i):"",u=be(o.length,8),l=c?be(c.length,8):0;e=Q({magic:Ie.BATCHED_MODEL},e);let h=t;t=Ne(e,r,t),r&&(r.setUint32(12,u,!0),r.setUint32(16,0,!0),r.setUint32(20,l,!0),r.setUint32(24,0,!0)),t+=16,t=Ke(r,t,o,8),i&&(t=Ke(r,t,c,8));let f=e.gltfEncoded;return f&&(t=mr(r,t,f,f.byteLength)),Ce(r,h,t-h),t}function fs(e,r,t,a){let{featuresLength:n=1,gltfFormat:i=1,gltfUri:s=""}=e,o=s.length,c={INSTANCES_LENGTH:n,POSITION:new Array(n*3).fill(0)},u=JSON.stringify(c),l=u.length;e=Q({magic:Ie.INSTANCED_MODEL},e);let h=t;return t=Ne(e,r,0),r&&(r.setUint32(12,l,!0),r.setUint32(16,0,!0),r.setUint32(20,0,!0),r.setUint32(24,0,!0),r.setUint32(28,i,!0)),t+=20,t+=er(r,t,u,l),t+=er(r,t,s,o),Ce(r,h,t-h),t}var ed={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function hs(e,r,t,a){let{featureTableJson:n=ed}=e,i=JSON.stringify(n);i=Ot(i,4);let{featureTableJsonByteLength:s=i.length}=e,o=new ArrayBuffer(12),c=o.byteLength;e=Q({magic:Ie.POINT_CLOUD},e);let u=t;return t+=Ne(e,r,0),r&&(r.setUint32(t+0,s,!0),r.setUint32(t+4,c,!0),r.setUint32(t+8,0,!0),r.setUint32(t+12,0,!0)),t+=16,t+=er(r,t,i,s),t+=mr(r,t,o,c),Ce(r,u,t-u),t}function ln(e,r){let t=fn(e,null,0,r),a=new ArrayBuffer(t),n=new DataView(a);return fn(e,n,0,r),a}function fn(e,r,t,a){switch(Ae(typeof e.type=="string"),e.type){case vr.COMPOSITE:return us(e,r,t,a,fn);case vr.POINT_CLOUD:return hs(e,r,t,a);case vr.BATCHED_3D_MODEL:return ls(e,r,t,a);case vr.INSTANCED_3D_MODEL:return fs(e,r,t,a);default:throw new Error("3D Tiles: unknown tile type")}}var hn={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:cs,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:rd,binary:!0,options:{["3d-tiles"]:{}}};function rd(e,r){return ln(e,r)}var He=xn(dr()),ps=xn(os());function ds(e,r){let t=new Float32Array(e.length),a=nd(r);for(let n=0;n<e.length;n+=2){let i=e.subarray(n,n+2),s=a.slice(n*2,n*2+4),o=td([i[0],i[1]]),c=[s[2]-s[0],s[3]-s[1]],u=[o[0]*c[0],o[1]*c[1]],l=[u[0]+s[0],u[1]+s[1]];t[n]=l[0],t[n+1]=l[1]}return t}function td(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function nd(e){let r=65535,t=[];for(let a=0;a<e.length;a++)t[a]=e[a]/r;return t}var ad=new He.Matrix4([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),vs=new He.Vector3,xt=class{async convert(r,t=null){let a=await this.buildGltf(r);return qr({gltfEncoded:new Uint8Array(a),type:"b3dm",featuresLength:this._getFeaturesLength(t),batchTable:t},hn)}async buildGltf(r){let{tileContent:t,textureFormat:a}=r,{material:n,attributes:i,indices:s,cartesianOrigin:o,cartographicOrigin:c,modelMatrix:u}=t,l=new Mr,h=await this._addI3sTextureToGltf(t,a,l),f=this._convertI3sMaterialToGltfMaterial(n,h),d=l.addMaterial(f),p=i.positions,m=p.value;i.uvRegions&&i.texCoords&&(i.texCoords.value=ds(i.texCoords.value,i.uvRegions.value)),i.positions.value=this._normalizePositions(m,o,c,u),i.normals&&!this._checkNormals(i.normals.value)&&delete i.normals;let v=s||this._generateSynteticIndices(m.length/p.size),g=l.addMesh({attributes:i,indices:v,material:d,mode:4}),b=this._generateTransformMatrix(o),y=l.addNode({meshIndex:g,matrix:b}),M=l.addScene({nodeIndices:[y]});return l.setDefaultScene(M),l.createBinaryChunk(),qr(l.gltf,Et)}async _addI3sTextureToGltf(r,t,a){let{texture:n,material:i,attributes:s}=r,o=null,c=n;if(!n&&i&&(c=i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorTexture&&i.pbrMetallicRoughness.baseColorTexture.texture.source.image),c){let u=this._deduceMimeTypeFromFormat(t),l=a.addImage(c,u);o=a.addTexture({imageIndex:l}),delete s.colors}return o}_normalizePositions(r,t,a,n){let i=new Float32Array(r.length);for(let s=0;s<r.length;s+=3){let o=r.subarray(s,s+3),c=new He.Vector3(t),u=new He.Vector3(Array.from(o)).transform(n).add(a);ps.Ellipsoid.WGS84.cartographicToCartesian(u,vs),u=vs.subtract(c),i.set(u,s)}return i}_generateTransformMatrix(r){return new He.Matrix4().translate(r).multiplyLeft(ad)}_generateBatchId(r){let t=(r[r.length-1]+1)*3,a=new Float32Array(t),n=0,i=0;for(let s=0;s<r.length/2;s++){let o=r[n]*3,c=(r[n+1]+1)*3;a.fill(i,o,c),n+=2,i+=1}return a}_generateSynteticIndices(r){let t=new Uint32Array(r);for(let a=0;a<r;a++)t.set([a],a);return t}_deduceMimeTypeFromFormat(r){switch(r){case"jpg":return"image/jpeg";case"png":return"image/png";case"ktx2":return"image/ktx2";default:return console.warn(`Unexpected texture format in I3S: ${r}`),"image/jpeg"}}_convertI3sMaterialToGltfMaterial(r,t){let a=t!==null;return r?(t!==null&&(r=this._setGltfTexture(r,t)),r):(r={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},a?r.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],r)}_setGltfTexture(r,t){let a=Mn(Q({},r),{pbrMetallicRoughness:Q({},r.pbrMetallicRoughness)});return r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorTexture?a.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:r.emissiveTexture?a.emissiveTexture={index:t,texCoord:0}:r.pbrMetallicRoughness&&r.pbrMetallicRoughness.metallicRoughnessTexture?a.pbrMetallicRoughness.metallicRoughnessTexture={index:t,texCoord:0}:r.normalTexture?a.normalTexture={index:t,texCoord:0}:r.occlusionTexture&&(a.occlusionTexture={index:t,texCoord:0}),a}_getFeaturesLength(r){if(!r)return 0;let t=Object.keys(r)[0];return t?r[t].length:0}_checkNormals(r){return r.find(t=>t)}};var id=new xt;Tt(async(e,r={})=>id.convert(e,r.attributes));
1
+ var ms=Object.create;var Ar=Object.defineProperty,gs=Object.defineProperties,ys=Object.getOwnPropertyDescriptor,Ms=Object.getOwnPropertyDescriptors,xs=Object.getOwnPropertyNames,mn=Object.getOwnPropertySymbols,bs=Object.getPrototypeOf,gn=Object.prototype.hasOwnProperty,_s=Object.prototype.propertyIsEnumerable;var yn=(e,r,t)=>r in e?Ar(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Q=(e,r)=>{for(var t in r||(r={}))gn.call(r,t)&&yn(e,t,r[t]);if(mn)for(var t of mn(r))_s.call(r,t)&&yn(e,t,r[t]);return e},Mn=(e,r)=>gs(e,Ms(r)),Ts=e=>Ar(e,"__esModule",{value:!0});var R=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ks=(e,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of xs(r))!gn.call(e,a)&&a!=="default"&&Ar(e,a,{get:()=>r[a],enumerable:!(t=ys(r,a))||t.enumerable});return e},xn=e=>ks(Ts(Ar(e!=null?ms(bs(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var U=R((Zd,An)=>{function Bs(e){return e&&e.__esModule?e:{default:e}}An.exports=Bs});var te=R((Xd,Ir)=>{function Lr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ir.exports=Lr=function(t){return typeof t}:Ir.exports=Lr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lr(e)}Ir.exports=Lr});var Et=R((Qd,At)=>{function St(e,r){return At.exports=St=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},St(e,r)}At.exports=St});var Pn=R(($d,En)=>{function Fs(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}En.exports=Fs});var wn=R((Jd,Cr)=>{var zs=Et(),Ys=Pn();function Nr(e,r,t){return Ys()?Cr.exports=Nr=Reflect.construct:Cr.exports=Nr=function(n,i,s){var o=[null];o.push.apply(o,i);var c=Function.bind.apply(n,o),u=new c;return s&&zs(u,s.prototype),u},Nr.apply(null,arguments)}Cr.exports=Nr});var Pt=R((Hd,qn)=>{function Vs(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}qn.exports=Vs});var In=R((Kd,Ln)=>{var Gs=Pt();function Us(e){if(Array.isArray(e))return Gs(e)}Ln.exports=Us});var Cn=R((ep,Nn)=>{function js(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}Nn.exports=js});var wt=R((rp,Wn)=>{var Dn=Pt();function Zs(e,r){if(!!e){if(typeof e=="string")return Dn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Dn(e,r)}}Wn.exports=Zs});var Fn=R((tp,Bn)=>{function Xs(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Bn.exports=Xs});var Yn=R((np,zn)=>{var Qs=In(),$s=Cn(),Js=wt(),Hs=Fn();function Ks(e){return Qs(e)||$s(e)||Js(e)||Hs()}zn.exports=Ks});var ze=R(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.default=eo;function eo(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}});var me=R(F=>{"use strict";var Dr=U();Object.defineProperty(F,"__esModule",{value:!0});F.configure=so;F.formatValue=co;F.isArray=Ye;F.clone=lo;F.toRadians=fo;F.toDegrees=ho;F.radians=Gn;F.degrees=Un;F.sin=po;F.cos=vo;F.tan=mo;F.asin=go;F.acos=yo;F.atan=Mo;F.clamp=xo;F.lerp=jn;F.equals=Zn;F.exactEquals=Xn;F.withEpsilon=bo;F.config=void 0;var Vn=Dr(te()),ro=Dr(wn()),to=Dr(Yn()),no=Dr(ze()),ao=1/Math.PI*180,io=1/180*Math.PI,V={};F.config=V;V.EPSILON=1e-12;V.debug=!1;V.precision=4;V.printTypes=!1;V.printDegrees=!1;V.printRowMajor=!0;function so(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};for(var r in e)(0,no.default)(r in V),V[r]=e[r];return V}function oo(e){return Math.round(e/V.EPSILON)*V.EPSILON}function co(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.precision,a=t===void 0?V.precision||4:t;return e=oo(e),"".concat(parseFloat(e.toPrecision(a)))}function Ye(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function uo(e){return e.clone?e.clone():new Array(e.length)}function lo(e){return e.clone?e.clone():(0,ro.default)(Array,(0,to.default)(e))}function _e(e,r,t){if(Ye(e)){t=t||uo(e);for(var a=0;a<t.length&&a<e.length;++a)t[a]=r(e[a],a,t);return t}return r(e)}function fo(e){return Gn(e)}function ho(e){return Un(e)}function Gn(e,r){return _e(e,function(t){return t*io},r)}function Un(e,r){return _e(e,function(t){return t*ao},r)}function po(e){return _e(e,function(r){return Math.sin(r)})}function vo(e){return _e(e,function(r){return Math.cos(r)})}function mo(e){return _e(e,function(r){return Math.tan(r)})}function go(e){return _e(e,function(r){return Math.asin(r)})}function yo(e){return _e(e,function(r){return Math.acos(r)})}function Mo(e){return _e(e,function(r){return Math.atan(r)})}function xo(e,r,t){return _e(e,function(a){return Math.max(r,Math.min(t,a))})}function jn(e,r,t){return Ye(e)?e.map(function(a,n){return jn(a,r[n],t)}):t*r+(1-t)*e}function Zn(e,r,t){var a=V.EPSILON;t&&(V.EPSILON=t);try{if(e===r)return!0;if(Ye(e)&&Ye(r)){if(e.length!==r.length)return!1;for(var n=0;n<e.length;++n)if(!Zn(e[n],r[n]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):Number.isFinite(e)&&Number.isFinite(r)?Math.abs(e-r)<=V.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{V.EPSILON=a}}function Xn(e,r){if(e===r)return!0;if(e&&(0,Vn.default)(e)==="object"&&r&&(0,Vn.default)(r)==="object"){if(e.constructor!==r.constructor)return!1;if(e.exactEquals)return e.exactEquals(r)}if(Ye(e)&&Ye(r)){if(e.length!==r.length)return!1;for(var t=0;t<e.length;++t)if(!Xn(e[t],r[t]))return!1;return!0}return!1}function bo(e,r){var t=V.EPSILON;V.EPSILON=e;var a;try{a=r()}finally{V.EPSILON=t}return a}});var $=R((sp,Qn)=>{function _o(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}Qn.exports=_o});var J=R((op,Jn)=>{function $n(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function To(e,r,t){return r&&$n(e.prototype,r),t&&$n(e,t),e}Jn.exports=To});var se=R((cp,Hn)=>{var ko=Et();function Oo(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&ko(e,r)}Hn.exports=Oo});var ea=R((up,Kn)=>{function Ro(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Kn.exports=Ro});var oe=R((lp,ra)=>{var So=te(),Ao=ea();function Eo(e,r){return r&&(So(r)==="object"||typeof r=="function")?r:Ao(e)}ra.exports=Eo});var ce=R((fp,It)=>{function Lt(e){return It.exports=Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Lt(e)}It.exports=Lt});var br=R(Wr=>{"use strict";var rr=U();Object.defineProperty(Wr,"__esModule",{value:!0});Wr.default=void 0;var Po=rr($()),wo=rr(J()),qo=rr(se()),Lo=rr(oe()),ta=rr(ce()),xr=me(),Io=rr(ze());function No(e){var r=Co();return function(){var a=(0,ta.default)(e),n;if(r){var i=(0,ta.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Lo.default)(this,n)}}function Co(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Do(e){function r(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var Wo=function(e){(0,qo.default)(t,e);var r=No(t);function t(){return(0,Po.default)(this,t),r.apply(this,arguments)}return(0,wo.default)(t,[{key:"ELEMENTS",get:function(){return(0,Io.default)(!1),0}},{key:"clone",value:function(){return new this.constructor().copy(this)}},{key:"from",value:function(n){return Array.isArray(n)?this.copy(n):this.fromObject(n)}},{key:"fromArray",value:function(n){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)this[s]=n[s+i];return this.check()}},{key:"to",value:function(n){return n===this?this:(0,xr.isArray)(n)?this.toArray(n):this.toObject(n)}},{key:"toTarget",value:function(n){return n?this.to(n):this}},{key:"toArray",value:function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)n[i+s]=this[s];return n}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(xr.config)}},{key:"formatString",value:function(n){for(var i="",s=0;s<this.ELEMENTS;++s)i+=(s>0?", ":"")+(0,xr.formatValue)(this[s],n);return"".concat(n.printTypes?this.constructor.name:"","[").concat(i,"]")}},{key:"equals",value:function(n){if(!n||this.length!==n.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(!(0,xr.equals)(this[i],n[i]))return!1;return!0}},{key:"exactEquals",value:function(n){if(!n||this.length!==n.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(this[i]!==n[i])return!1;return!0}},{key:"negate",value:function(){for(var n=0;n<this.ELEMENTS;++n)this[n]=-this[n];return this.check()}},{key:"lerp",value:function(n,i,s){s===void 0&&(s=i,i=n,n=this);for(var o=0;o<this.ELEMENTS;++o){var c=n[o];this[o]=c+s*(i[o]-c)}return this.check()}},{key:"min",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.min(n[i],this[i]);return this.check()}},{key:"max",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.max(n[i],this[i]);return this.check()}},{key:"clamp",value:function(n,i){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],n[s]),i[s]);return this.check()}},{key:"add",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]+=u[l];return this.check()}},{key:"subtract",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]-=u[l];return this.check()}},{key:"scale",value:function(n){if(Array.isArray(n))return this.multiply(n);for(var i=0;i<this.ELEMENTS;++i)this[i]*=n;return this.check()}},{key:"sub",value:function(n){return this.subtract(n)}},{key:"setScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=n;return this.check()}},{key:"addScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]+=n;return this.check()}},{key:"subScalar",value:function(n){return this.addScalar(-n)}},{key:"multiplyScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]*=n;return this.check()}},{key:"divideScalar",value:function(n){return this.scale(1/n)}},{key:"clampScalar",value:function(n,i){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],n),i);return this.check()}},{key:"multiplyByScalar",value:function(n){return this.scale(n)}},{key:"elements",get:function(){return this}},{key:"check",value:function(){if(xr.config.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var n=this.length===this.ELEMENTS,i=0;i<this.ELEMENTS;++i)n=n&&Number.isFinite(this[i]);return n}}]),t}(Do(Array));Wr.default=Wo});var ue=R(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.validateVector=na;tr.checkNumber=Fo;tr.checkVector=zo;tr.deprecated=Yo;var Bo=me();function na(e,r){if(e.length!==r)return!1;for(var t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function Fo(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function zo(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(Bo.config.debug&&!na(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}var aa={};function Yo(e,r){aa[e]||(aa[e]=!0,console.warn("".concat(e," has been removed in version ").concat(r,", see upgrade guide for more information")))}});var zr=R(Fr=>{"use strict";var Ve=U();Object.defineProperty(Fr,"__esModule",{value:!0});Fr.default=void 0;var Vo=Ve($()),Go=Ve(J()),Uo=Ve(se()),jo=Ve(oe()),ia=Ve(ce()),Zo=Ve(br()),_r=ue(),Br=Ve(ze());function Xo(e){var r=Qo();return function(){var a=(0,ia.default)(e),n;if(r){var i=(0,ia.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,jo.default)(this,n)}}function Qo(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $o=function(e){(0,Uo.default)(t,e);var r=Xo(t);function t(){return(0,Vo.default)(this,t),r.apply(this,arguments)}return(0,Go.default)(t,[{key:"ELEMENTS",get:function(){return(0,Br.default)(!1),0}},{key:"copy",value:function(n){return(0,Br.default)(!1),this}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,_r.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,_r.checkNumber)(n)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var n=0,i=0;i<this.ELEMENTS;++i)n+=this[i]*this[i];return n}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(n){return Math.sqrt(this.distanceSquared(n))}},{key:"distanceSquared",value:function(n){for(var i=0,s=0;s<this.ELEMENTS;++s){var o=this[s]-n[s];i+=o*o}return(0,_r.checkNumber)(i)}},{key:"dot",value:function(n){for(var i=0,s=0;s<this.ELEMENTS;++s)i+=this[s]*n[s];return(0,_r.checkNumber)(i)}},{key:"normalize",value:function(){var n=this.magnitude();if(n!==0)for(var i=0;i<this.ELEMENTS;++i)this[i]/=n;return this.check()}},{key:"multiply",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]*=u[l];return this.check()}},{key:"divide",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]/=u[l];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(n){return this.distance(n)}},{key:"distanceToSquared",value:function(n){return this.distanceSquared(n)}},{key:"getComponent",value:function(n){return(0,Br.default)(n>=0&&n<this.ELEMENTS,"index is out of range"),(0,_r.checkNumber)(this[n])}},{key:"setComponent",value:function(n,i){return(0,Br.default)(n>=0&&n<this.ELEMENTS,"index is out of range"),this[n]=i,this.check()}},{key:"addVectors",value:function(n,i){return this.copy(n).add(i)}},{key:"subVectors",value:function(n,i){return this.copy(n).subtract(i)}},{key:"multiplyVectors",value:function(n,i){return this.copy(n).multiply(i)}},{key:"addScaledVector",value:function(n,i){return this.add(new this.constructor(n).multiplyScalar(i))}}]),t}(Zo.default);Fr.default=$o});var Ge=R(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.setMatrixArrayType=Ho;ne.toRadian=ec;ne.equals=rc;ne.RANDOM=ne.ARRAY_TYPE=ne.EPSILON=void 0;var sa=1e-6;ne.EPSILON=sa;var oa=typeof Float32Array!="undefined"?Float32Array:Array;ne.ARRAY_TYPE=oa;var Jo=Math.random;ne.RANDOM=Jo;function Ho(e){ne.ARRAY_TYPE=oa=e}var Ko=Math.PI/180;function ec(e){return e*Ko}function rc(e,r){return Math.abs(e-r)<=sa*Math.max(1,Math.abs(e),Math.abs(r))}Math.hypot||(Math.hypot=function(){for(var e=0,r=arguments.length;r--;)e+=arguments[r]*arguments[r];return Math.sqrt(e)})});var Vr=R(O=>{"use strict";function Yr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yr=function(t){return typeof t}:Yr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(e)}Object.defineProperty(O,"__esModule",{value:!0});O.create=ua;O.clone=nc;O.fromValues=ac;O.copy=ic;O.set=sc;O.add=oc;O.subtract=la;O.multiply=fa;O.divide=ha;O.ceil=cc;O.floor=uc;O.min=lc;O.max=fc;O.round=hc;O.scale=dc;O.scaleAndAdd=pc;O.distance=da;O.squaredDistance=pa;O.length=va;O.squaredLength=ma;O.negate=vc;O.inverse=mc;O.normalize=gc;O.dot=yc;O.cross=Mc;O.lerp=xc;O.random=bc;O.transformMat2=_c;O.transformMat2d=Tc;O.transformMat3=kc;O.transformMat4=Oc;O.rotate=Rc;O.angle=Sc;O.zero=Ac;O.str=Ec;O.exactEquals=Pc;O.equals=wc;O.forEach=O.sqrLen=O.sqrDist=O.dist=O.div=O.mul=O.sub=O.len=void 0;var Ue=tc(Ge());function ca(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return ca=function(){return e},e}function tc(e){if(e&&e.__esModule)return e;if(e===null||Yr(e)!=="object"&&typeof e!="function")return{default:e};var r=ca();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function ua(){var e=new Ue.ARRAY_TYPE(2);return Ue.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function nc(e){var r=new Ue.ARRAY_TYPE(2);return r[0]=e[0],r[1]=e[1],r}function ac(e,r){var t=new Ue.ARRAY_TYPE(2);return t[0]=e,t[1]=r,t}function ic(e,r){return e[0]=r[0],e[1]=r[1],e}function sc(e,r,t){return e[0]=r,e[1]=t,e}function oc(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e}function la(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e}function fa(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e}function ha(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e}function cc(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e}function uc(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e}function lc(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e}function fc(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e}function hc(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e}function dc(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e}function pc(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e}function da(e,r){var t=r[0]-e[0],a=r[1]-e[1];return Math.hypot(t,a)}function pa(e,r){var t=r[0]-e[0],a=r[1]-e[1];return t*t+a*a}function va(e){var r=e[0],t=e[1];return Math.hypot(r,t)}function ma(e){var r=e[0],t=e[1];return r*r+t*t}function vc(e,r){return e[0]=-r[0],e[1]=-r[1],e}function mc(e,r){return e[0]=1/r[0],e[1]=1/r[1],e}function gc(e,r){var t=r[0],a=r[1],n=t*t+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=r[0]*n,e[1]=r[1]*n,e}function yc(e,r){return e[0]*r[0]+e[1]*r[1]}function Mc(e,r,t){var a=r[0]*t[1]-r[1]*t[0];return e[0]=e[1]=0,e[2]=a,e}function xc(e,r,t,a){var n=r[0],i=r[1];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e}function bc(e,r){r=r||1;var t=Ue.RANDOM()*2*Math.PI;return e[0]=Math.cos(t)*r,e[1]=Math.sin(t)*r,e}function _c(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e}function Tc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n+t[4],e[1]=t[1]*a+t[3]*n+t[5],e}function kc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[3]*n+t[6],e[1]=t[1]*a+t[4]*n+t[7],e}function Oc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[4]*n+t[12],e[1]=t[1]*a+t[5]*n+t[13],e}function Rc(e,r,t,a){var n=r[0]-t[0],i=r[1]-t[1],s=Math.sin(a),o=Math.cos(a);return e[0]=n*o-i*s+t[0],e[1]=n*s+i*o+t[1],e}function Sc(e,r){var t=e[0],a=e[1],n=r[0],i=r[1],s=Math.sqrt(t*t+a*a)*Math.sqrt(n*n+i*i),o=s&&(t*n+a*i)/s;return Math.acos(Math.min(Math.max(o,-1),1))}function Ac(e){return e[0]=0,e[1]=0,e}function Ec(e){return"vec2("+e[0]+", "+e[1]+")"}function Pc(e,r){return e[0]===r[0]&&e[1]===r[1]}function wc(e,r){var t=e[0],a=e[1],n=r[0],i=r[1];return Math.abs(t-n)<=Ue.EPSILON*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(a-i)<=Ue.EPSILON*Math.max(1,Math.abs(a),Math.abs(i))}var qc=va;O.len=qc;var Lc=la;O.sub=Lc;var Ic=fa;O.mul=Ic;var Nc=ha;O.div=Nc;var Cc=da;O.dist=Cc;var Dc=pa;O.sqrDist=Dc;var Wc=ma;O.sqrLen=Wc;var Bc=function(){var e=ua();return function(r,t,a,n,i,s){var o,c;for(t||(t=2),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],i(e,e,s),r[o]=e[0],r[o+1]=e[1];return r}}();O.forEach=Bc});var nr=R(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.vec2_transformMat4AsVector=Fc;je.vec3_transformMat4AsVector=zc;je.vec3_transformMat2=Yc;je.vec4_transformMat2=Vc;je.vec4_transformMat3=Gc;function Fc(e,r,t){var a=r[0],n=r[1],i=t[3]*a+t[7]*n||1;return e[0]=(t[0]*a+t[4]*n)/i,e[1]=(t[1]*a+t[5]*n)/i,e}function zc(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[3]*a+t[7]*n+t[11]*i||1;return e[0]=(t[0]*a+t[4]*n+t[8]*i)/s,e[1]=(t[1]*a+t[5]*n+t[9]*i)/s,e[2]=(t[2]*a+t[6]*n+t[10]*i)/s,e}function Yc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e[2]=r[2],e}function Vc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e[2]=r[2],e[3]=r[3],e}function Gc(e,r,t){var a=r[0],n=r[1],i=r[2];return e[0]=t[0]*a+t[3]*n+t[6]*i,e[1]=t[1]*a+t[4]*n+t[7]*i,e[2]=t[2]*a+t[5]*n+t[8]*i,e[3]=r[3],e}});var Ma=R(jr=>{"use strict";var ar=U(),Uc=te();Object.defineProperty(jr,"__esModule",{value:!0});jr.default=void 0;var jc=ar($()),Zc=ar(J()),Xc=ar(se()),Qc=ar(oe()),ga=ar(ce()),$c=ar(zr()),Nt=me(),Gr=ue(),Ur=Hc(Vr()),Jc=nr();function ya(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ya=function(n){return n?t:r})(e)}function Hc(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Uc(e)!=="object"&&typeof e!="function")return{default:e};var t=ya(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Kc(e){var r=eu();return function(){var a=(0,ga.default)(e),n;if(r){var i=(0,ga.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Qc.default)(this,n)}}function eu(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ru=function(e){(0,Xc.default)(t,e);var r=Kc(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(0,jc.default)(this,t),a=r.call(this,2),(0,Nt.isArray)(n)&&arguments.length===1?a.copy(n):(Nt.config.debug&&((0,Gr.checkNumber)(n),(0,Gr.checkNumber)(i)),a[0]=n,a[1]=i),a}return(0,Zc.default)(t,[{key:"set",value:function(n,i){return this[0]=n,this[1]=i,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this.check()}},{key:"fromObject",value:function(n){return Nt.config.debug&&((0,Gr.checkNumber)(n.x),(0,Gr.checkNumber)(n.y)),this[0]=n.x,this[1]=n.y,this.check()}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(n){return this.transformAsPoint(n)}},{key:"transformAsPoint",value:function(n){return Ur.transformMat4(this,this,n),this.check()}},{key:"transformAsVector",value:function(n){return(0,Jc.vec2_transformMat4AsVector)(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return Ur.transformMat3(this,this,n),this.check()}},{key:"transformByMatrix2x3",value:function(n){return Ur.transformMat2d(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return Ur.transformMat2(this,this,n),this.check()}}]),t}($c.default);jr.default=ru});var ke=R(T=>{"use strict";function Zr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Zr=function(t){return typeof t}:Zr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zr(e)}Object.defineProperty(T,"__esModule",{value:!0});T.create=ba;T.clone=nu;T.length=_a;T.fromValues=au;T.copy=iu;T.set=su;T.add=ou;T.subtract=Ta;T.multiply=ka;T.divide=Oa;T.ceil=cu;T.floor=uu;T.min=lu;T.max=fu;T.round=hu;T.scale=du;T.scaleAndAdd=pu;T.distance=Ra;T.squaredDistance=Sa;T.squaredLength=Aa;T.negate=vu;T.inverse=mu;T.normalize=gu;T.dot=Ea;T.cross=yu;T.lerp=Mu;T.hermite=xu;T.bezier=bu;T.random=_u;T.transformMat4=Tu;T.transformMat3=ku;T.transformQuat=Ou;T.rotateX=Ru;T.rotateY=Su;T.rotateZ=Au;T.angle=Eu;T.zero=Pu;T.str=wu;T.exactEquals=qu;T.equals=Lu;T.forEach=T.sqrLen=T.len=T.sqrDist=T.dist=T.div=T.mul=T.sub=void 0;var Te=tu(Ge());function xa(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return xa=function(){return e},e}function tu(e){if(e&&e.__esModule)return e;if(e===null||Zr(e)!=="object"&&typeof e!="function")return{default:e};var r=xa();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function ba(){var e=new Te.ARRAY_TYPE(3);return Te.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function nu(e){var r=new Te.ARRAY_TYPE(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function _a(e){var r=e[0],t=e[1],a=e[2];return Math.hypot(r,t,a)}function au(e,r,t){var a=new Te.ARRAY_TYPE(3);return a[0]=e,a[1]=r,a[2]=t,a}function iu(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function su(e,r,t,a){return e[0]=r,e[1]=t,e[2]=a,e}function ou(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function Ta(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function ka(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function Oa(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function cu(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function uu(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function lu(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e}function fu(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e}function hu(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e}function du(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function pu(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e}function Ra(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2];return Math.hypot(t,a,n)}function Sa(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2];return t*t+a*a+n*n}function Aa(e){var r=e[0],t=e[1],a=e[2];return r*r+t*t+a*a}function vu(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function mu(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function gu(e,r){var t=r[0],a=r[1],n=r[2],i=t*t+a*a+n*n;return i>0&&(i=1/Math.sqrt(i)),e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e}function Ea(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function yu(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[0],o=t[1],c=t[2];return e[0]=n*c-i*o,e[1]=i*s-a*c,e[2]=a*o-n*s,e}function Mu(e,r,t,a){var n=r[0],i=r[1],s=r[2];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e[2]=s+a*(t[2]-s),e}function xu(e,r,t,a,n,i){var s=i*i,o=s*(2*i-3)+1,c=s*(i-2)+i,u=s*(i-1),l=s*(3-2*i);return e[0]=r[0]*o+t[0]*c+a[0]*u+n[0]*l,e[1]=r[1]*o+t[1]*c+a[1]*u+n[1]*l,e[2]=r[2]*o+t[2]*c+a[2]*u+n[2]*l,e}function bu(e,r,t,a,n,i){var s=1-i,o=s*s,c=i*i,u=o*s,l=3*i*o,h=3*c*s,f=c*i;return e[0]=r[0]*u+t[0]*l+a[0]*h+n[0]*f,e[1]=r[1]*u+t[1]*l+a[1]*h+n[1]*f,e[2]=r[2]*u+t[2]*l+a[2]*h+n[2]*f,e}function _u(e,r){r=r||1;var t=Te.RANDOM()*2*Math.PI,a=Te.RANDOM()*2-1,n=Math.sqrt(1-a*a)*r;return e[0]=Math.cos(t)*n,e[1]=Math.sin(t)*n,e[2]=a*r,e}function Tu(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[3]*a+t[7]*n+t[11]*i+t[15];return s=s||1,e[0]=(t[0]*a+t[4]*n+t[8]*i+t[12])/s,e[1]=(t[1]*a+t[5]*n+t[9]*i+t[13])/s,e[2]=(t[2]*a+t[6]*n+t[10]*i+t[14])/s,e}function ku(e,r,t){var a=r[0],n=r[1],i=r[2];return e[0]=a*t[0]+n*t[3]+i*t[6],e[1]=a*t[1]+n*t[4]+i*t[7],e[2]=a*t[2]+n*t[5]+i*t[8],e}function Ou(e,r,t){var a=t[0],n=t[1],i=t[2],s=t[3],o=r[0],c=r[1],u=r[2],l=n*u-i*c,h=i*o-a*u,f=a*c-n*o,d=n*f-i*h,p=i*l-a*f,m=a*h-n*l,v=s*2;return l*=v,h*=v,f*=v,d*=2,p*=2,m*=2,e[0]=o+l+d,e[1]=c+h+p,e[2]=u+f+m,e}function Ru(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[0],i[1]=n[1]*Math.cos(a)-n[2]*Math.sin(a),i[2]=n[1]*Math.sin(a)+n[2]*Math.cos(a),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function Su(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[2]*Math.sin(a)+n[0]*Math.cos(a),i[1]=n[1],i[2]=n[2]*Math.cos(a)-n[0]*Math.sin(a),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function Au(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[0]*Math.cos(a)-n[1]*Math.sin(a),i[1]=n[0]*Math.sin(a)+n[1]*Math.cos(a),i[2]=n[2],e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function Eu(e,r){var t=e[0],a=e[1],n=e[2],i=r[0],s=r[1],o=r[2],c=Math.sqrt(t*t+a*a+n*n),u=Math.sqrt(i*i+s*s+o*o),l=c*u,h=l&&Ea(e,r)/l;return Math.acos(Math.min(Math.max(h,-1),1))}function Pu(e){return e[0]=0,e[1]=0,e[2]=0,e}function wu(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function qu(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function Lu(e,r){var t=e[0],a=e[1],n=e[2],i=r[0],s=r[1],o=r[2];return Math.abs(t-i)<=Te.EPSILON*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(a-s)<=Te.EPSILON*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(n-o)<=Te.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))}var Iu=Ta;T.sub=Iu;var Nu=ka;T.mul=Nu;var Cu=Oa;T.div=Cu;var Du=Ra;T.dist=Du;var Wu=Sa;T.sqrDist=Wu;var Bu=_a;T.len=Bu;var Fu=Aa;T.sqrLen=Fu;var zu=function(){var e=ba();return function(r,t,a,n,i,s){var o,c;for(t||(t=3),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],e[2]=r[o+2],i(e,e,s),r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2];return r}}();T.forEach=zu});var Qr=R(Xr=>{"use strict";var ir=U(),Yu=te();Object.defineProperty(Xr,"__esModule",{value:!0});Xr.default=void 0;var Vu=ir($()),Gu=ir(J()),Uu=ir(se()),ju=ir(oe()),Pa=ir(ce()),Zu=ir(zr()),Ct=me(),Ze=ue(),Ee=Xu(ke()),wa=nr();function qa(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(qa=function(n){return n?t:r})(e)}function Xu(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Yu(e)!=="object"&&typeof e!="function")return{default:e};var t=qa(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Qu(e){var r=$u();return function(){var a=(0,Pa.default)(e),n;if(r){var i=(0,Pa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,ju.default)(this,n)}}function $u(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Dt=[0,0,0],La={},Ju=function(e){(0,Uu.default)(t,e);var r=Qu(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return(0,Vu.default)(this,t),a=r.call(this,-0,-0,-0),arguments.length===1&&(0,Ct.isArray)(n)?a.copy(n):(Ct.config.debug&&((0,Ze.checkNumber)(n),(0,Ze.checkNumber)(i),(0,Ze.checkNumber)(s)),a[0]=n,a[1]=i,a[2]=s),a}return(0,Gu.default)(t,[{key:"set",value:function(n,i,s){return this[0]=n,this[1]=i,this[2]=s,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this.check()}},{key:"fromObject",value:function(n){return Ct.config.debug&&((0,Ze.checkNumber)(n.x),(0,Ze.checkNumber)(n.y),(0,Ze.checkNumber)(n.z)),this[0]=n.x,this[1]=n.y,this[2]=n.z,this.check()}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n.z=this[2],n}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,Ze.checkNumber)(n)}},{key:"angle",value:function(n){return Ee.angle(this,n)}},{key:"cross",value:function(n){return Ee.cross(this,this,n),this.check()}},{key:"rotateX",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?Dt:s;return Ee.rotateX(this,this,o,i),this.check()}},{key:"rotateY",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?Dt:s;return Ee.rotateY(this,this,o,i),this.check()}},{key:"rotateZ",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?Dt:s;return Ee.rotateZ(this,this,o,i),this.check()}},{key:"transform",value:function(n){return this.transformAsPoint(n)}},{key:"transformAsPoint",value:function(n){return Ee.transformMat4(this,this,n),this.check()}},{key:"transformAsVector",value:function(n){return(0,wa.vec3_transformMat4AsVector)(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return Ee.transformMat3(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return(0,wa.vec3_transformMat2)(this,this,n),this.check()}},{key:"transformByQuaternion",value:function(n){return Ee.transformQuat(this,this,n),this.check()}}],[{key:"ZERO",get:function(){return La.ZERO=La.ZERO||Object.freeze(new t(0,0,0,0))}}]),t}(Zu.default);Xr.default=Ju});var Ba=R($r=>{"use strict";var sr=U(),Hu=te();Object.defineProperty($r,"__esModule",{value:!0});$r.default=void 0;var Ku=sr($()),el=sr(J()),rl=sr(se()),tl=sr(oe()),Ia=sr(ce()),nl=sr(zr()),Wt=me(),ge=ue(),Na=al(ke()),Ca=nr();function Da(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Da=function(n){return n?t:r})(e)}function al(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Hu(e)!=="object"&&typeof e!="function")return{default:e};var t=Da(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function il(e){var r=sl();return function(){var a=(0,Ia.default)(e),n;if(r){var i=(0,Ia.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,tl.default)(this,n)}}function sl(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Wa={},ol=function(e){(0,rl.default)(t,e);var r=il(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return(0,Ku.default)(this,t),a=r.call(this,-0,-0,-0,-0),(0,Wt.isArray)(n)&&arguments.length===1?a.copy(n):(Wt.config.debug&&((0,ge.checkNumber)(n),(0,ge.checkNumber)(i),(0,ge.checkNumber)(s),(0,ge.checkNumber)(o)),a[0]=n,a[1]=i,a[2]=s,a[3]=o),a}return(0,el.default)(t,[{key:"set",value:function(n,i,s,o){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this.check()}},{key:"fromObject",value:function(n){return Wt.config.debug&&((0,ge.checkNumber)(n.x),(0,ge.checkNumber)(n.y),(0,ge.checkNumber)(n.z),(0,ge.checkNumber)(n.w)),this[0]=n.x,this[1]=n.y,this[2]=n.z,this[3]=n.w,this}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n.z=this[2],n.w=this[3],n}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,ge.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,ge.checkNumber)(n)}},{key:"transform",value:function(n){return Na.transformMat4(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return(0,Ca.vec4_transformMat3)(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return(0,Ca.vec4_transformMat2)(this,this,n),this.check()}},{key:"transformByQuaternion",value:function(n){return Na.transformQuat(this,this,n),this.check()}},{key:"applyMatrix4",value:function(n){return n.transform(this,this),this}}],[{key:"ZERO",get:function(){return Wa.ZERO=Wa.ZERO||Object.freeze(new t(0,0,0,0))}}]),t}(nl.default);$r.default=ol});var Bt=R(Jr=>{"use strict";var Xe=U();Object.defineProperty(Jr,"__esModule",{value:!0});Jr.default=void 0;var cl=Xe($()),ul=Xe(J()),ll=Xe(se()),fl=Xe(oe()),Fa=Xe(ce()),hl=Xe(br()),dl=ue(),pl=me(),za=Xe(ze());function vl(e){var r=ml();return function(){var a=(0,Fa.default)(e),n;if(r){var i=(0,Fa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,fl.default)(this,n)}}function ml(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var gl=function(e){(0,ll.default)(t,e);var r=vl(t);function t(){return(0,cl.default)(this,t),r.apply(this,arguments)}return(0,ul.default)(t,[{key:"ELEMENTS",get:function(){return(0,za.default)(!1),0}},{key:"RANK",get:function(){return(0,za.default)(!1),0}},{key:"toString",value:function(){var n="[";if(pl.config.printRowMajor){n+="row-major:";for(var i=0;i<this.RANK;++i)for(var s=0;s<this.RANK;++s)n+=" ".concat(this[s*this.RANK+i])}else{n+="column-major:";for(var o=0;o<this.ELEMENTS;++o)n+=" ".concat(this[o])}return n+="]",n}},{key:"getElementIndex",value:function(n,i){return i*this.RANK+n}},{key:"getElement",value:function(n,i){return this[i*this.RANK+n]}},{key:"setElement",value:function(n,i,s){return this[i*this.RANK+n]=(0,dl.checkNumber)(s),this}},{key:"getColumn",value:function(n){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Array(this.RANK).fill(-0),s=n*this.RANK,o=0;o<this.RANK;++o)i[o]=this[s+o];return i}},{key:"setColumn",value:function(n,i){for(var s=n*this.RANK,o=0;o<this.RANK;++o)this[s+o]=i[o];return this}}]),t}(hl.default);Jr.default=gl});var Ft=R(q=>{"use strict";function Hr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Hr=function(t){return typeof t}:Hr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(e)}Object.defineProperty(q,"__esModule",{value:!0});q.create=Ml;q.fromMat4=xl;q.clone=bl;q.copy=_l;q.fromValues=Tl;q.set=kl;q.identity=Ol;q.transpose=Rl;q.invert=Sl;q.adjoint=Al;q.determinant=El;q.multiply=Va;q.translate=Pl;q.rotate=wl;q.scale=ql;q.fromTranslation=Ll;q.fromRotation=Il;q.fromScaling=Nl;q.fromMat2d=Cl;q.fromQuat=Dl;q.normalFromMat4=Wl;q.projection=Bl;q.str=Fl;q.frob=zl;q.add=Yl;q.subtract=Ga;q.multiplyScalar=Vl;q.multiplyScalarAndAdd=Gl;q.exactEquals=Ul;q.equals=jl;q.sub=q.mul=void 0;var K=yl(Ge());function Ya(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Ya=function(){return e},e}function yl(e){if(e&&e.__esModule)return e;if(e===null||Hr(e)!=="object"&&typeof e!="function")return{default:e};var r=Ya();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function Ml(){var e=new K.ARRAY_TYPE(9);return K.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function xl(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[4],e[4]=r[5],e[5]=r[6],e[6]=r[8],e[7]=r[9],e[8]=r[10],e}function bl(e){var r=new K.ARRAY_TYPE(9);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function _l(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function Tl(e,r,t,a,n,i,s,o,c){var u=new K.ARRAY_TYPE(9);return u[0]=e,u[1]=r,u[2]=t,u[3]=a,u[4]=n,u[5]=i,u[6]=s,u[7]=o,u[8]=c,u}function kl(e,r,t,a,n,i,s,o,c,u){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e[4]=i,e[5]=s,e[6]=o,e[7]=c,e[8]=u,e}function Ol(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Rl(e,r){if(e===r){var t=r[1],a=r[2],n=r[5];e[1]=r[3],e[2]=r[6],e[3]=t,e[5]=r[7],e[6]=a,e[7]=n}else e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8];return e}function Sl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=l*s-o*u,f=-l*i+o*c,d=u*i-s*c,p=t*h+a*f+n*d;return p?(p=1/p,e[0]=h*p,e[1]=(-l*a+n*u)*p,e[2]=(o*a-n*s)*p,e[3]=f*p,e[4]=(l*t-n*c)*p,e[5]=(-o*t+n*i)*p,e[6]=d*p,e[7]=(-u*t+a*c)*p,e[8]=(s*t-a*i)*p,e):null}function Al(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8];return e[0]=s*l-o*u,e[1]=n*u-a*l,e[2]=a*o-n*s,e[3]=o*c-i*l,e[4]=t*l-n*c,e[5]=n*i-t*o,e[6]=i*u-s*c,e[7]=a*c-t*u,e[8]=t*s-a*i,e}function El(e){var r=e[0],t=e[1],a=e[2],n=e[3],i=e[4],s=e[5],o=e[6],c=e[7],u=e[8];return r*(u*i-s*c)+t*(-u*n+s*o)+a*(c*n-i*o)}function Va(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=t[0],d=t[1],p=t[2],m=t[3],v=t[4],g=t[5],b=t[6],y=t[7],M=t[8];return e[0]=f*a+d*s+p*u,e[1]=f*n+d*o+p*l,e[2]=f*i+d*c+p*h,e[3]=m*a+v*s+g*u,e[4]=m*n+v*o+g*l,e[5]=m*i+v*c+g*h,e[6]=b*a+y*s+M*u,e[7]=b*n+y*o+M*l,e[8]=b*i+y*c+M*h,e}function Pl(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=t[0],d=t[1];return e[0]=a,e[1]=n,e[2]=i,e[3]=s,e[4]=o,e[5]=c,e[6]=f*a+d*s+u,e[7]=f*n+d*o+l,e[8]=f*i+d*c+h,e}function wl(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=Math.sin(t),d=Math.cos(t);return e[0]=d*a+f*s,e[1]=d*n+f*o,e[2]=d*i+f*c,e[3]=d*s-f*a,e[4]=d*o-f*n,e[5]=d*c-f*i,e[6]=u,e[7]=l,e[8]=h,e}function ql(e,r,t){var a=t[0],n=t[1];return e[0]=a*r[0],e[1]=a*r[1],e[2]=a*r[2],e[3]=n*r[3],e[4]=n*r[4],e[5]=n*r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function Ll(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=r[0],e[7]=r[1],e[8]=1,e}function Il(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=t,e[2]=0,e[3]=-t,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Nl(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=r[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Cl(e,r){return e[0]=r[0],e[1]=r[1],e[2]=0,e[3]=r[2],e[4]=r[3],e[5]=0,e[6]=r[4],e[7]=r[5],e[8]=1,e}function Dl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t+t,o=a+a,c=n+n,u=t*s,l=a*s,h=a*o,f=n*s,d=n*o,p=n*c,m=i*s,v=i*o,g=i*c;return e[0]=1-h-p,e[3]=l-g,e[6]=f+v,e[1]=l+g,e[4]=1-u-p,e[7]=d-m,e[2]=f-v,e[5]=d+m,e[8]=1-u-h,e}function Wl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=r[9],f=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15],b=t*o-a*s,y=t*c-n*s,M=t*u-i*s,k=a*c-n*o,_=a*u-i*o,C=n*u-i*c,L=l*m-h*p,I=l*v-f*p,w=l*g-d*p,D=h*v-f*m,N=h*g-d*m,W=f*g-d*v,E=b*W-y*N+M*D+k*w-_*I+C*L;return E?(E=1/E,e[0]=(o*W-c*N+u*D)*E,e[1]=(c*w-s*W-u*I)*E,e[2]=(s*N-o*w+u*L)*E,e[3]=(n*N-a*W-i*D)*E,e[4]=(t*W-n*w+i*I)*E,e[5]=(a*w-t*N-i*L)*E,e[6]=(m*C-v*_+g*k)*E,e[7]=(v*M-p*C-g*y)*E,e[8]=(p*_-m*M+g*b)*E,e):null}function Bl(e,r,t){return e[0]=2/r,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/t,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Fl(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function zl(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Yl(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e[4]=r[4]+t[4],e[5]=r[5]+t[5],e[6]=r[6]+t[6],e[7]=r[7]+t[7],e[8]=r[8]+t[8],e}function Ga(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e[4]=r[4]-t[4],e[5]=r[5]-t[5],e[6]=r[6]-t[6],e[7]=r[7]-t[7],e[8]=r[8]-t[8],e}function Vl(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e[4]=r[4]*t,e[5]=r[5]*t,e[6]=r[6]*t,e[7]=r[7]*t,e[8]=r[8]*t,e}function Gl(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e[4]=r[4]+t[4]*a,e[5]=r[5]+t[5]*a,e[6]=r[6]+t[6]*a,e[7]=r[7]+t[7]*a,e[8]=r[8]+t[8]*a,e}function Ul(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]}function jl(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],h=r[0],f=r[1],d=r[2],p=r[3],m=r[4],v=r[5],g=r[6],b=r[7],y=r[8];return Math.abs(t-h)<=K.EPSILON*Math.max(1,Math.abs(t),Math.abs(h))&&Math.abs(a-f)<=K.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(n-d)<=K.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-p)<=K.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=K.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-v)<=K.EPSILON*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(c-g)<=K.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(u-b)<=K.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(l-y)<=K.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))}var Zl=Va;q.mul=Zl;var Xl=Ga;q.sub=Xl});var Xa=R(et=>{"use strict";var or=U(),Ql=te();Object.defineProperty(et,"__esModule",{value:!0});et.default=void 0;var $l=or($()),Jl=or(J()),Hl=or(se()),Kl=or(oe()),Ua=or(ce()),ef=or(Bt()),Kr=ue(),rf=nr(),ye=zt(Ft()),tf=zt(Vr()),nf=zt(ke());function ja(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ja=function(n){return n?t:r})(e)}function zt(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Ql(e)!=="object"&&typeof e!="function")return{default:e};var t=ja(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function af(e){var r=sf();return function(){var a=(0,Ua.default)(e),n;if(r){var i=(0,Ua.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Kl.default)(this,n)}}function sf(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Za=Object.freeze([1,0,0,0,1,0,0,0,1]),of=Object.freeze([0,0,0,0,0,0,0,0,0]),cf=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),cr={},uf=function(e){(0,Hl.default)(t,e);var r=af(t);function t(a){var n;return(0,$l.default)(this,t),n=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(a)?n.copy(a):n.identity(),n}return(0,Jl.default)(t,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return cf}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this[4]=n[4],this[5]=n[5],this[6]=n[6],this[7]=n[7],this[8]=n[8],this.check()}},{key:"set",value:function(n,i,s,o,c,u,l,h,f){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this[4]=c,this[5]=u,this[6]=l,this[7]=h,this[8]=f,this.check()}},{key:"setRowMajor",value:function(n,i,s,o,c,u,l,h,f){return this[0]=n,this[1]=o,this[2]=l,this[3]=i,this[4]=c,this[5]=h,this[6]=s,this[7]=u,this[8]=f,this.check()}},{key:"determinant",value:function(){return ye.determinant(this)}},{key:"identity",value:function(){return this.copy(Za)}},{key:"fromQuaternion",value:function(n){return ye.fromQuat(this,n),this.check()}},{key:"transpose",value:function(){return ye.transpose(this,this),this.check()}},{key:"invert",value:function(){return ye.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(n){return ye.multiply(this,n,this),this.check()}},{key:"multiplyRight",value:function(n){return ye.multiply(this,this,n),this.check()}},{key:"rotate",value:function(n){return ye.rotate(this,this,n),this.check()}},{key:"scale",value:function(n){return Array.isArray(n)?ye.scale(this,this,n):ye.scale(this,this,[n,n,n]),this.check()}},{key:"translate",value:function(n){return ye.translate(this,this,n),this.check()}},{key:"transform",value:function(n,i){switch(n.length){case 2:i=tf.transformMat3(i||[-0,-0],n,this);break;case 3:i=nf.transformMat3(i||[-0,-0,-0],n,this);break;case 4:i=(0,rf.vec4_transformMat3)(i||[-0,-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,Kr.checkVector)(i,n.length),i}},{key:"transformVector",value:function(n,i){return(0,Kr.deprecated)("Matrix3.transformVector"),this.transform(n,i)}},{key:"transformVector2",value:function(n,i){return(0,Kr.deprecated)("Matrix3.transformVector"),this.transform(n,i)}},{key:"transformVector3",value:function(n,i){return(0,Kr.deprecated)("Matrix3.transformVector"),this.transform(n,i)}}],[{key:"IDENTITY",get:function(){return cr.IDENTITY=cr.IDENTITY||Object.freeze(new t(Za)),cr.IDENTITY}},{key:"ZERO",get:function(){return cr.ZERO=cr.ZERO||Object.freeze(new t(of)),cr.ZERO}}]),t}(ef.default);et.default=uf});var $a=R((Op,Qa)=>{function lf(e){if(Array.isArray(e))return e}Qa.exports=lf});var Ha=R((Rp,Ja)=>{function ff(e,r){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(e)))){var t=[],a=!0,n=!1,i=void 0;try{for(var s=e[Symbol.iterator](),o;!(a=(o=s.next()).done)&&(t.push(o.value),!(r&&t.length===r));a=!0);}catch(c){n=!0,i=c}finally{try{!a&&s.return!=null&&s.return()}finally{if(n)throw i}}return t}}Ja.exports=ff});var ei=R((Sp,Ka)=>{function hf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Ka.exports=hf});var Tr=R((Ap,ri)=>{var df=$a(),pf=Ha(),vf=wt(),mf=ei();function gf(e,r){return df(e)||pf(e,r)||vf(e,r)||mf()}ri.exports=gf});var ci=R(S=>{"use strict";function rt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rt=function(t){return typeof t}:rt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rt(e)}Object.defineProperty(S,"__esModule",{value:!0});S.create=Mf;S.clone=xf;S.copy=bf;S.fromValues=_f;S.set=Tf;S.identity=ni;S.transpose=kf;S.invert=Of;S.adjoint=Rf;S.determinant=Sf;S.multiply=ai;S.translate=Af;S.scale=Ef;S.rotate=Pf;S.rotateX=wf;S.rotateY=qf;S.rotateZ=Lf;S.fromTranslation=If;S.fromScaling=Nf;S.fromRotation=Cf;S.fromXRotation=Df;S.fromYRotation=Wf;S.fromZRotation=Bf;S.fromRotationTranslation=ii;S.fromQuat2=Ff;S.getTranslation=zf;S.getScaling=si;S.getRotation=Yf;S.fromRotationTranslationScale=Vf;S.fromRotationTranslationScaleOrigin=Gf;S.fromQuat=Uf;S.frustum=jf;S.perspective=Zf;S.perspectiveFromFieldOfView=Xf;S.ortho=Qf;S.lookAt=$f;S.targetTo=Jf;S.str=Hf;S.frob=Kf;S.add=eh;S.subtract=oi;S.multiplyScalar=rh;S.multiplyScalarAndAdd=th;S.exactEquals=nh;S.equals=ah;S.sub=S.mul=void 0;var B=yf(Ge());function ti(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return ti=function(){return e},e}function yf(e){if(e&&e.__esModule)return e;if(e===null||rt(e)!=="object"&&typeof e!="function")return{default:e};var r=ti();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function Mf(){var e=new B.ARRAY_TYPE(16);return B.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function xf(e){var r=new B.ARRAY_TYPE(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function bf(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function _f(e,r,t,a,n,i,s,o,c,u,l,h,f,d,p,m){var v=new B.ARRAY_TYPE(16);return v[0]=e,v[1]=r,v[2]=t,v[3]=a,v[4]=n,v[5]=i,v[6]=s,v[7]=o,v[8]=c,v[9]=u,v[10]=l,v[11]=h,v[12]=f,v[13]=d,v[14]=p,v[15]=m,v}function Tf(e,r,t,a,n,i,s,o,c,u,l,h,f,d,p,m,v){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e[4]=i,e[5]=s,e[6]=o,e[7]=c,e[8]=u,e[9]=l,e[10]=h,e[11]=f,e[12]=d,e[13]=p,e[14]=m,e[15]=v,e}function ni(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function kf(e,r){if(e===r){var t=r[1],a=r[2],n=r[3],i=r[6],s=r[7],o=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=a,e[9]=i,e[11]=r[14],e[12]=n,e[13]=s,e[14]=o}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function Of(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=r[9],f=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15],b=t*o-a*s,y=t*c-n*s,M=t*u-i*s,k=a*c-n*o,_=a*u-i*o,C=n*u-i*c,L=l*m-h*p,I=l*v-f*p,w=l*g-d*p,D=h*v-f*m,N=h*g-d*m,W=f*g-d*v,E=b*W-y*N+M*D+k*w-_*I+C*L;return E?(E=1/E,e[0]=(o*W-c*N+u*D)*E,e[1]=(n*N-a*W-i*D)*E,e[2]=(m*C-v*_+g*k)*E,e[3]=(f*_-h*C-d*k)*E,e[4]=(c*w-s*W-u*I)*E,e[5]=(t*W-n*w+i*I)*E,e[6]=(v*M-p*C-g*y)*E,e[7]=(l*C-f*M+d*y)*E,e[8]=(s*N-o*w+u*L)*E,e[9]=(a*w-t*N-i*L)*E,e[10]=(p*_-m*M+g*b)*E,e[11]=(h*M-l*_-d*b)*E,e[12]=(o*I-s*D-c*L)*E,e[13]=(t*D-a*I+n*L)*E,e[14]=(m*y-p*k-v*b)*E,e[15]=(l*k-h*y+f*b)*E,e):null}function Rf(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=r[9],f=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15];return e[0]=o*(f*g-d*v)-h*(c*g-u*v)+m*(c*d-u*f),e[1]=-(a*(f*g-d*v)-h*(n*g-i*v)+m*(n*d-i*f)),e[2]=a*(c*g-u*v)-o*(n*g-i*v)+m*(n*u-i*c),e[3]=-(a*(c*d-u*f)-o*(n*d-i*f)+h*(n*u-i*c)),e[4]=-(s*(f*g-d*v)-l*(c*g-u*v)+p*(c*d-u*f)),e[5]=t*(f*g-d*v)-l*(n*g-i*v)+p*(n*d-i*f),e[6]=-(t*(c*g-u*v)-s*(n*g-i*v)+p*(n*u-i*c)),e[7]=t*(c*d-u*f)-s*(n*d-i*f)+l*(n*u-i*c),e[8]=s*(h*g-d*m)-l*(o*g-u*m)+p*(o*d-u*h),e[9]=-(t*(h*g-d*m)-l*(a*g-i*m)+p*(a*d-i*h)),e[10]=t*(o*g-u*m)-s*(a*g-i*m)+p*(a*u-i*o),e[11]=-(t*(o*d-u*h)-s*(a*d-i*h)+l*(a*u-i*o)),e[12]=-(s*(h*v-f*m)-l*(o*v-c*m)+p*(o*f-c*h)),e[13]=t*(h*v-f*m)-l*(a*v-n*m)+p*(a*f-n*h),e[14]=-(t*(o*v-c*m)-s*(a*v-n*m)+p*(a*c-n*o)),e[15]=t*(o*f-c*h)-s*(a*f-n*h)+l*(a*c-n*o),e}function Sf(e){var r=e[0],t=e[1],a=e[2],n=e[3],i=e[4],s=e[5],o=e[6],c=e[7],u=e[8],l=e[9],h=e[10],f=e[11],d=e[12],p=e[13],m=e[14],v=e[15],g=r*s-t*i,b=r*o-a*i,y=r*c-n*i,M=t*o-a*s,k=t*c-n*s,_=a*c-n*o,C=u*p-l*d,L=u*m-h*d,I=u*v-f*d,w=l*m-h*p,D=l*v-f*p,N=h*v-f*m;return g*N-b*D+y*w+M*I-k*L+_*C}function ai(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=r[9],d=r[10],p=r[11],m=r[12],v=r[13],g=r[14],b=r[15],y=t[0],M=t[1],k=t[2],_=t[3];return e[0]=y*a+M*o+k*h+_*m,e[1]=y*n+M*c+k*f+_*v,e[2]=y*i+M*u+k*d+_*g,e[3]=y*s+M*l+k*p+_*b,y=t[4],M=t[5],k=t[6],_=t[7],e[4]=y*a+M*o+k*h+_*m,e[5]=y*n+M*c+k*f+_*v,e[6]=y*i+M*u+k*d+_*g,e[7]=y*s+M*l+k*p+_*b,y=t[8],M=t[9],k=t[10],_=t[11],e[8]=y*a+M*o+k*h+_*m,e[9]=y*n+M*c+k*f+_*v,e[10]=y*i+M*u+k*d+_*g,e[11]=y*s+M*l+k*p+_*b,y=t[12],M=t[13],k=t[14],_=t[15],e[12]=y*a+M*o+k*h+_*m,e[13]=y*n+M*c+k*f+_*v,e[14]=y*i+M*u+k*d+_*g,e[15]=y*s+M*l+k*p+_*b,e}function Af(e,r,t){var a=t[0],n=t[1],i=t[2],s,o,c,u,l,h,f,d,p,m,v,g;return r===e?(e[12]=r[0]*a+r[4]*n+r[8]*i+r[12],e[13]=r[1]*a+r[5]*n+r[9]*i+r[13],e[14]=r[2]*a+r[6]*n+r[10]*i+r[14],e[15]=r[3]*a+r[7]*n+r[11]*i+r[15]):(s=r[0],o=r[1],c=r[2],u=r[3],l=r[4],h=r[5],f=r[6],d=r[7],p=r[8],m=r[9],v=r[10],g=r[11],e[0]=s,e[1]=o,e[2]=c,e[3]=u,e[4]=l,e[5]=h,e[6]=f,e[7]=d,e[8]=p,e[9]=m,e[10]=v,e[11]=g,e[12]=s*a+l*n+p*i+r[12],e[13]=o*a+h*n+m*i+r[13],e[14]=c*a+f*n+v*i+r[14],e[15]=u*a+d*n+g*i+r[15]),e}function Ef(e,r,t){var a=t[0],n=t[1],i=t[2];return e[0]=r[0]*a,e[1]=r[1]*a,e[2]=r[2]*a,e[3]=r[3]*a,e[4]=r[4]*n,e[5]=r[5]*n,e[6]=r[6]*n,e[7]=r[7]*n,e[8]=r[8]*i,e[9]=r[9]*i,e[10]=r[10]*i,e[11]=r[11]*i,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Pf(e,r,t,a){var n=a[0],i=a[1],s=a[2],o=Math.hypot(n,i,s),c,u,l,h,f,d,p,m,v,g,b,y,M,k,_,C,L,I,w,D,N,W,E,Z;return o<B.EPSILON?null:(o=1/o,n*=o,i*=o,s*=o,c=Math.sin(t),u=Math.cos(t),l=1-u,h=r[0],f=r[1],d=r[2],p=r[3],m=r[4],v=r[5],g=r[6],b=r[7],y=r[8],M=r[9],k=r[10],_=r[11],C=n*n*l+u,L=i*n*l+s*c,I=s*n*l-i*c,w=n*i*l-s*c,D=i*i*l+u,N=s*i*l+n*c,W=n*s*l+i*c,E=i*s*l-n*c,Z=s*s*l+u,e[0]=h*C+m*L+y*I,e[1]=f*C+v*L+M*I,e[2]=d*C+g*L+k*I,e[3]=p*C+b*L+_*I,e[4]=h*w+m*D+y*N,e[5]=f*w+v*D+M*N,e[6]=d*w+g*D+k*N,e[7]=p*w+b*D+_*N,e[8]=h*W+m*E+y*Z,e[9]=f*W+v*E+M*Z,e[10]=d*W+g*E+k*Z,e[11]=p*W+b*E+_*Z,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function wf(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[4],s=r[5],o=r[6],c=r[7],u=r[8],l=r[9],h=r[10],f=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=i*n+u*a,e[5]=s*n+l*a,e[6]=o*n+h*a,e[7]=c*n+f*a,e[8]=u*n-i*a,e[9]=l*n-s*a,e[10]=h*n-o*a,e[11]=f*n-c*a,e}function qf(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[0],s=r[1],o=r[2],c=r[3],u=r[8],l=r[9],h=r[10],f=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*n-u*a,e[1]=s*n-l*a,e[2]=o*n-h*a,e[3]=c*n-f*a,e[8]=i*a+u*n,e[9]=s*a+l*n,e[10]=o*a+h*n,e[11]=c*a+f*n,e}function Lf(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[0],s=r[1],o=r[2],c=r[3],u=r[4],l=r[5],h=r[6],f=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*n+u*a,e[1]=s*n+l*a,e[2]=o*n+h*a,e[3]=c*n+f*a,e[4]=u*n-i*a,e[5]=l*n-s*a,e[6]=h*n-o*a,e[7]=f*n-c*a,e}function If(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function Nf(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=r[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Cf(e,r,t){var a=t[0],n=t[1],i=t[2],s=Math.hypot(a,n,i),o,c,u;return s<B.EPSILON?null:(s=1/s,a*=s,n*=s,i*=s,o=Math.sin(r),c=Math.cos(r),u=1-c,e[0]=a*a*u+c,e[1]=n*a*u+i*o,e[2]=i*a*u-n*o,e[3]=0,e[4]=a*n*u-i*o,e[5]=n*n*u+c,e[6]=i*n*u+a*o,e[7]=0,e[8]=a*i*u+n*o,e[9]=n*i*u-a*o,e[10]=i*i*u+c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function Df(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=t,e[7]=0,e[8]=0,e[9]=-t,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Wf(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=0,e[2]=-t,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=t,e[9]=0,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Bf(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=t,e[2]=0,e[3]=0,e[4]=-t,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ii(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=a+a,c=n+n,u=i+i,l=a*o,h=a*c,f=a*u,d=n*c,p=n*u,m=i*u,v=s*o,g=s*c,b=s*u;return e[0]=1-(d+m),e[1]=h+b,e[2]=f-g,e[3]=0,e[4]=h-b,e[5]=1-(l+m),e[6]=p+v,e[7]=0,e[8]=f+g,e[9]=p-v,e[10]=1-(l+d),e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function Ff(e,r){var t=new B.ARRAY_TYPE(3),a=-r[0],n=-r[1],i=-r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=a*a+n*n+i*i+s*s;return h>0?(t[0]=(o*s+l*a+c*i-u*n)*2/h,t[1]=(c*s+l*n+u*a-o*i)*2/h,t[2]=(u*s+l*i+o*n-c*a)*2/h):(t[0]=(o*s+l*a+c*i-u*n)*2,t[1]=(c*s+l*n+u*a-o*i)*2,t[2]=(u*s+l*i+o*n-c*a)*2),ii(e,r,t),e}function zf(e,r){return e[0]=r[12],e[1]=r[13],e[2]=r[14],e}function si(e,r){var t=r[0],a=r[1],n=r[2],i=r[4],s=r[5],o=r[6],c=r[8],u=r[9],l=r[10];return e[0]=Math.hypot(t,a,n),e[1]=Math.hypot(i,s,o),e[2]=Math.hypot(c,u,l),e}function Yf(e,r){var t=new B.ARRAY_TYPE(3);si(t,r);var a=1/t[0],n=1/t[1],i=1/t[2],s=r[0]*a,o=r[1]*n,c=r[2]*i,u=r[4]*a,l=r[5]*n,h=r[6]*i,f=r[8]*a,d=r[9]*n,p=r[10]*i,m=s+l+p,v=0;return m>0?(v=Math.sqrt(m+1)*2,e[3]=.25*v,e[0]=(h-d)/v,e[1]=(f-c)/v,e[2]=(o-u)/v):s>l&&s>p?(v=Math.sqrt(1+s-l-p)*2,e[3]=(h-d)/v,e[0]=.25*v,e[1]=(o+u)/v,e[2]=(f+c)/v):l>p?(v=Math.sqrt(1+l-s-p)*2,e[3]=(f-c)/v,e[0]=(o+u)/v,e[1]=.25*v,e[2]=(h+d)/v):(v=Math.sqrt(1+p-s-l)*2,e[3]=(o-u)/v,e[0]=(f+c)/v,e[1]=(h+d)/v,e[2]=.25*v),e}function Vf(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3],c=n+n,u=i+i,l=s+s,h=n*c,f=n*u,d=n*l,p=i*u,m=i*l,v=s*l,g=o*c,b=o*u,y=o*l,M=a[0],k=a[1],_=a[2];return e[0]=(1-(p+v))*M,e[1]=(f+y)*M,e[2]=(d-b)*M,e[3]=0,e[4]=(f-y)*k,e[5]=(1-(h+v))*k,e[6]=(m+g)*k,e[7]=0,e[8]=(d+b)*_,e[9]=(m-g)*_,e[10]=(1-(h+p))*_,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function Gf(e,r,t,a,n){var i=r[0],s=r[1],o=r[2],c=r[3],u=i+i,l=s+s,h=o+o,f=i*u,d=i*l,p=i*h,m=s*l,v=s*h,g=o*h,b=c*u,y=c*l,M=c*h,k=a[0],_=a[1],C=a[2],L=n[0],I=n[1],w=n[2],D=(1-(m+g))*k,N=(d+M)*k,W=(p-y)*k,E=(d-M)*_,Z=(1-(f+g))*_,de=(v+b)*_,pe=(p+y)*C,De=(v-b)*C,We=(1-(f+m))*C;return e[0]=D,e[1]=N,e[2]=W,e[3]=0,e[4]=E,e[5]=Z,e[6]=de,e[7]=0,e[8]=pe,e[9]=De,e[10]=We,e[11]=0,e[12]=t[0]+L-(D*L+E*I+pe*w),e[13]=t[1]+I-(N*L+Z*I+De*w),e[14]=t[2]+w-(W*L+de*I+We*w),e[15]=1,e}function Uf(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t+t,o=a+a,c=n+n,u=t*s,l=a*s,h=a*o,f=n*s,d=n*o,p=n*c,m=i*s,v=i*o,g=i*c;return e[0]=1-h-p,e[1]=l+g,e[2]=f-v,e[3]=0,e[4]=l-g,e[5]=1-u-p,e[6]=d+m,e[7]=0,e[8]=f+v,e[9]=d-m,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function jf(e,r,t,a,n,i,s){var o=1/(t-r),c=1/(n-a),u=1/(i-s);return e[0]=i*2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*c,e[6]=0,e[7]=0,e[8]=(t+r)*o,e[9]=(n+a)*c,e[10]=(s+i)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i*2*u,e[15]=0,e}function Zf(e,r,t,a,n){var i=1/Math.tan(r/2),s;return e[0]=i/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,n!=null&&n!==1/0?(s=1/(a-n),e[10]=(n+a)*s,e[14]=2*n*a*s):(e[10]=-1,e[14]=-2*a),e}function Xf(e,r,t,a){var n=Math.tan(r.upDegrees*Math.PI/180),i=Math.tan(r.downDegrees*Math.PI/180),s=Math.tan(r.leftDegrees*Math.PI/180),o=Math.tan(r.rightDegrees*Math.PI/180),c=2/(s+o),u=2/(n+i);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-((s-o)*c*.5),e[9]=(n-i)*u*.5,e[10]=a/(t-a),e[11]=-1,e[12]=0,e[13]=0,e[14]=a*t/(t-a),e[15]=0,e}function Qf(e,r,t,a,n,i,s){var o=1/(r-t),c=1/(a-n),u=1/(i-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*o,e[13]=(n+a)*c,e[14]=(s+i)*u,e[15]=1,e}function $f(e,r,t,a){var n,i,s,o,c,u,l,h,f,d,p=r[0],m=r[1],v=r[2],g=a[0],b=a[1],y=a[2],M=t[0],k=t[1],_=t[2];return Math.abs(p-M)<B.EPSILON&&Math.abs(m-k)<B.EPSILON&&Math.abs(v-_)<B.EPSILON?ni(e):(l=p-M,h=m-k,f=v-_,d=1/Math.hypot(l,h,f),l*=d,h*=d,f*=d,n=b*f-y*h,i=y*l-g*f,s=g*h-b*l,d=Math.hypot(n,i,s),d?(d=1/d,n*=d,i*=d,s*=d):(n=0,i=0,s=0),o=h*s-f*i,c=f*n-l*s,u=l*i-h*n,d=Math.hypot(o,c,u),d?(d=1/d,o*=d,c*=d,u*=d):(o=0,c=0,u=0),e[0]=n,e[1]=o,e[2]=l,e[3]=0,e[4]=i,e[5]=c,e[6]=h,e[7]=0,e[8]=s,e[9]=u,e[10]=f,e[11]=0,e[12]=-(n*p+i*m+s*v),e[13]=-(o*p+c*m+u*v),e[14]=-(l*p+h*m+f*v),e[15]=1,e)}function Jf(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=a[0],c=a[1],u=a[2],l=n-t[0],h=i-t[1],f=s-t[2],d=l*l+h*h+f*f;d>0&&(d=1/Math.sqrt(d),l*=d,h*=d,f*=d);var p=c*f-u*h,m=u*l-o*f,v=o*h-c*l;return d=p*p+m*m+v*v,d>0&&(d=1/Math.sqrt(d),p*=d,m*=d,v*=d),e[0]=p,e[1]=m,e[2]=v,e[3]=0,e[4]=h*v-f*m,e[5]=f*p-l*v,e[6]=l*m-h*p,e[7]=0,e[8]=l,e[9]=h,e[10]=f,e[11]=0,e[12]=n,e[13]=i,e[14]=s,e[15]=1,e}function Hf(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Kf(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function eh(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e[4]=r[4]+t[4],e[5]=r[5]+t[5],e[6]=r[6]+t[6],e[7]=r[7]+t[7],e[8]=r[8]+t[8],e[9]=r[9]+t[9],e[10]=r[10]+t[10],e[11]=r[11]+t[11],e[12]=r[12]+t[12],e[13]=r[13]+t[13],e[14]=r[14]+t[14],e[15]=r[15]+t[15],e}function oi(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e[4]=r[4]-t[4],e[5]=r[5]-t[5],e[6]=r[6]-t[6],e[7]=r[7]-t[7],e[8]=r[8]-t[8],e[9]=r[9]-t[9],e[10]=r[10]-t[10],e[11]=r[11]-t[11],e[12]=r[12]-t[12],e[13]=r[13]-t[13],e[14]=r[14]-t[14],e[15]=r[15]-t[15],e}function rh(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e[4]=r[4]*t,e[5]=r[5]*t,e[6]=r[6]*t,e[7]=r[7]*t,e[8]=r[8]*t,e[9]=r[9]*t,e[10]=r[10]*t,e[11]=r[11]*t,e[12]=r[12]*t,e[13]=r[13]*t,e[14]=r[14]*t,e[15]=r[15]*t,e}function th(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e[4]=r[4]+t[4]*a,e[5]=r[5]+t[5]*a,e[6]=r[6]+t[6]*a,e[7]=r[7]+t[7]*a,e[8]=r[8]+t[8]*a,e[9]=r[9]+t[9]*a,e[10]=r[10]+t[10]*a,e[11]=r[11]+t[11]*a,e[12]=r[12]+t[12]*a,e[13]=r[13]+t[13]*a,e[14]=r[14]+t[14]*a,e[15]=r[15]+t[15]*a,e}function nh(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}function ah(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],b=r[0],y=r[1],M=r[2],k=r[3],_=r[4],C=r[5],L=r[6],I=r[7],w=r[8],D=r[9],N=r[10],W=r[11],E=r[12],Z=r[13],de=r[14],pe=r[15];return Math.abs(t-b)<=B.EPSILON*Math.max(1,Math.abs(t),Math.abs(b))&&Math.abs(a-y)<=B.EPSILON*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(n-M)<=B.EPSILON*Math.max(1,Math.abs(n),Math.abs(M))&&Math.abs(i-k)<=B.EPSILON*Math.max(1,Math.abs(i),Math.abs(k))&&Math.abs(s-_)<=B.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-C)<=B.EPSILON*Math.max(1,Math.abs(o),Math.abs(C))&&Math.abs(c-L)<=B.EPSILON*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(u-I)<=B.EPSILON*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(l-w)<=B.EPSILON*Math.max(1,Math.abs(l),Math.abs(w))&&Math.abs(h-D)<=B.EPSILON*Math.max(1,Math.abs(h),Math.abs(D))&&Math.abs(f-N)<=B.EPSILON*Math.max(1,Math.abs(f),Math.abs(N))&&Math.abs(d-W)<=B.EPSILON*Math.max(1,Math.abs(d),Math.abs(W))&&Math.abs(p-E)<=B.EPSILON*Math.max(1,Math.abs(p),Math.abs(E))&&Math.abs(m-Z)<=B.EPSILON*Math.max(1,Math.abs(m),Math.abs(Z))&&Math.abs(v-de)<=B.EPSILON*Math.max(1,Math.abs(v),Math.abs(de))&&Math.abs(g-pe)<=B.EPSILON*Math.max(1,Math.abs(g),Math.abs(pe))}var ih=ai;S.mul=ih;var sh=oi;S.sub=sh});var nt=R(A=>{"use strict";function tt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tt=function(t){return typeof t}:tt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(e)}Object.defineProperty(A,"__esModule",{value:!0});A.create=li;A.clone=ch;A.fromValues=uh;A.copy=lh;A.set=fh;A.add=hh;A.subtract=fi;A.multiply=hi;A.divide=di;A.ceil=dh;A.floor=ph;A.min=vh;A.max=mh;A.round=gh;A.scale=yh;A.scaleAndAdd=Mh;A.distance=pi;A.squaredDistance=vi;A.length=mi;A.squaredLength=gi;A.negate=xh;A.inverse=bh;A.normalize=_h;A.dot=Th;A.cross=kh;A.lerp=Oh;A.random=Rh;A.transformMat4=Sh;A.transformQuat=Ah;A.zero=Eh;A.str=Ph;A.exactEquals=wh;A.equals=qh;A.forEach=A.sqrLen=A.len=A.sqrDist=A.dist=A.div=A.mul=A.sub=void 0;var ae=oh(Ge());function ui(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return ui=function(){return e},e}function oh(e){if(e&&e.__esModule)return e;if(e===null||tt(e)!=="object"&&typeof e!="function")return{default:e};var r=ui();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function li(){var e=new ae.ARRAY_TYPE(4);return ae.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function ch(e){var r=new ae.ARRAY_TYPE(4);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function uh(e,r,t,a){var n=new ae.ARRAY_TYPE(4);return n[0]=e,n[1]=r,n[2]=t,n[3]=a,n}function lh(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function fh(e,r,t,a,n){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e}function hh(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e}function fi(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e}function hi(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e[3]=r[3]*t[3],e}function di(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e[3]=r[3]/t[3],e}function dh(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e[3]=Math.ceil(r[3]),e}function ph(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e[3]=Math.floor(r[3]),e}function vh(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e[3]=Math.min(r[3],t[3]),e}function mh(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e[3]=Math.max(r[3],t[3]),e}function gh(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e[3]=Math.round(r[3]),e}function yh(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e}function Mh(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e}function pi(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2],i=r[3]-e[3];return Math.hypot(t,a,n,i)}function vi(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2],i=r[3]-e[3];return t*t+a*a+n*n+i*i}function mi(e){var r=e[0],t=e[1],a=e[2],n=e[3];return Math.hypot(r,t,a,n)}function gi(e){var r=e[0],t=e[1],a=e[2],n=e[3];return r*r+t*t+a*a+n*n}function xh(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=-r[3],e}function bh(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e[3]=1/r[3],e}function _h(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t*t+a*a+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),e[0]=t*s,e[1]=a*s,e[2]=n*s,e[3]=i*s,e}function Th(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]}function kh(e,r,t,a){var n=t[0]*a[1]-t[1]*a[0],i=t[0]*a[2]-t[2]*a[0],s=t[0]*a[3]-t[3]*a[0],o=t[1]*a[2]-t[2]*a[1],c=t[1]*a[3]-t[3]*a[1],u=t[2]*a[3]-t[3]*a[2],l=r[0],h=r[1],f=r[2],d=r[3];return e[0]=h*u-f*c+d*o,e[1]=-(l*u)+f*s-d*i,e[2]=l*c-h*s+d*n,e[3]=-(l*o)+h*i-f*n,e}function Oh(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e[2]=s+a*(t[2]-s),e[3]=o+a*(t[3]-o),e}function Rh(e,r){r=r||1;var t,a,n,i,s,o;do t=ae.RANDOM()*2-1,a=ae.RANDOM()*2-1,s=t*t+a*a;while(s>=1);do n=ae.RANDOM()*2-1,i=ae.RANDOM()*2-1,o=n*n+i*i;while(o>=1);var c=Math.sqrt((1-s)/o);return e[0]=r*t,e[1]=r*a,e[2]=r*n*c,e[3]=r*i*c,e}function Sh(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3];return e[0]=t[0]*a+t[4]*n+t[8]*i+t[12]*s,e[1]=t[1]*a+t[5]*n+t[9]*i+t[13]*s,e[2]=t[2]*a+t[6]*n+t[10]*i+t[14]*s,e[3]=t[3]*a+t[7]*n+t[11]*i+t[15]*s,e}function Ah(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[0],o=t[1],c=t[2],u=t[3],l=u*a+o*i-c*n,h=u*n+c*a-s*i,f=u*i+s*n-o*a,d=-s*a-o*n-c*i;return e[0]=l*u+d*-s+h*-c-f*-o,e[1]=h*u+d*-o+f*-s-l*-c,e[2]=f*u+d*-c+l*-o-h*-s,e[3]=r[3],e}function Eh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function Ph(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function wh(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function qh(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=r[0],o=r[1],c=r[2],u=r[3];return Math.abs(t-s)<=ae.EPSILON*Math.max(1,Math.abs(t),Math.abs(s))&&Math.abs(a-o)<=ae.EPSILON*Math.max(1,Math.abs(a),Math.abs(o))&&Math.abs(n-c)<=ae.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=ae.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))}var Lh=fi;A.sub=Lh;var Ih=hi;A.mul=Ih;var Nh=di;A.div=Nh;var Ch=pi;A.dist=Ch;var Dh=vi;A.sqrDist=Dh;var Wh=mi;A.len=Wh;var Bh=gi;A.sqrLen=Bh;var Fh=function(){var e=li();return function(r,t,a,n,i,s){var o,c;for(t||(t=4),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],e[2]=r[o+2],e[3]=r[o+3],i(e,e,s),r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2],r[o+3]=e[3];return r}}();A.forEach=Fh});var Yt=R(it=>{"use strict";var Qe=U(),zh=te();Object.defineProperty(it,"__esModule",{value:!0});it.default=void 0;var Yh=Qe(Tr()),Vh=Qe($()),Gh=Qe(J()),Uh=Qe(se()),jh=Qe(oe()),yi=Qe(ce()),ur=ue(),Zh=Qe(Bt()),Mi=nr(),j=at(ci()),Xh=at(Vr()),Qh=at(ke()),$h=at(nt());function xi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(xi=function(n){return n?t:r})(e)}function at(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||zh(e)!=="object"&&typeof e!="function")return{default:e};var t=xi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Jh(e){var r=Hh();return function(){var a=(0,yi.default)(e),n;if(r){var i=(0,yi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,jh.default)(this,n)}}function Hh(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var bi=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Kh=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),e0=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}),lr={},r0=function(e){(0,Uh.default)(t,e);var r=Jh(t);function t(a){var n;return(0,Vh.default)(this,t),n=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(a)?n.copy(a):n.identity(),n}return(0,Gh.default)(t,[{key:"INDICES",get:function(){return e0}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this[4]=n[4],this[5]=n[5],this[6]=n[6],this[7]=n[7],this[8]=n[8],this[9]=n[9],this[10]=n[10],this[11]=n[11],this[12]=n[12],this[13]=n[13],this[14]=n[14],this[15]=n[15],this.check()}},{key:"set",value:function(n,i,s,o,c,u,l,h,f,d,p,m,v,g,b,y){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this[4]=c,this[5]=u,this[6]=l,this[7]=h,this[8]=f,this[9]=d,this[10]=p,this[11]=m,this[12]=v,this[13]=g,this[14]=b,this[15]=y,this.check()}},{key:"setRowMajor",value:function(n,i,s,o,c,u,l,h,f,d,p,m,v,g,b,y){return this[0]=n,this[1]=c,this[2]=f,this[3]=v,this[4]=i,this[5]=u,this[6]=d,this[7]=g,this[8]=s,this[9]=l,this[10]=p,this[11]=b,this[12]=o,this[13]=h,this[14]=m,this[15]=y,this.check()}},{key:"toRowMajor",value:function(n){return n[0]=this[0],n[1]=this[4],n[2]=this[8],n[3]=this[12],n[4]=this[1],n[5]=this[5],n[6]=this[9],n[7]=this[13],n[8]=this[2],n[9]=this[6],n[10]=this[10],n[11]=this[14],n[12]=this[3],n[13]=this[7],n[14]=this[11],n[15]=this[15],n}},{key:"identity",value:function(){return this.copy(bi)}},{key:"fromQuaternion",value:function(n){return j.fromQuat(this,n),this.check()}},{key:"frustum",value:function(n){var i=n.left,s=n.right,o=n.bottom,c=n.top,u=n.near,l=n.far;return l===1/0?t._computeInfinitePerspectiveOffCenter(this,i,s,o,c,u):j.frustum(this,i,s,o,c,u,l),this.check()}},{key:"lookAt",value:function(n,i,s){if(arguments.length===1){var o=n;n=o.eye,i=o.center,s=o.up}return i=i||[0,0,0],s=s||[0,1,0],j.lookAt(this,n,i,s),this.check()}},{key:"ortho",value:function(n){var i=n.left,s=n.right,o=n.bottom,c=n.top,u=n.near,l=u===void 0?.1:u,h=n.far,f=h===void 0?500:h;return j.ortho(this,i,s,o,c,l,f),this.check()}},{key:"orthographic",value:function(n){var i=n.fovy,s=i===void 0?45*Math.PI/180:i,o=n.aspect,c=o===void 0?1:o,u=n.focalDistance,l=u===void 0?1:u,h=n.near,f=h===void 0?.1:h,d=n.far,p=d===void 0?500:d;if(s>Math.PI*2)throw Error("radians");var m=s/2,v=l*Math.tan(m),g=v*c;return new t().ortho({left:-g,right:g,bottom:-v,top:v,near:f,far:p})}},{key:"perspective",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.fovy,s=i===void 0?void 0:i,o=n.fov,c=o===void 0?45*Math.PI/180:o,u=n.aspect,l=u===void 0?1:u,h=n.near,f=h===void 0?.1:h,d=n.far,p=d===void 0?500:d;if(s=s||c,s>Math.PI*2)throw Error("radians");return j.perspective(this,s,l,f,p),this.check()}},{key:"determinant",value:function(){return j.determinant(this)}},{key:"getScale",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),n[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),n[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),n}},{key:"getTranslation",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=this[12],n[1]=this[13],n[2]=this[14],n}},{key:"getRotation",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=this.getScale(i||[-0,-0,-0]),o=1/s[0],c=1/s[1],u=1/s[2];return n[0]=this[0]*o,n[1]=this[1]*c,n[2]=this[2]*u,n[3]=0,n[4]=this[4]*o,n[5]=this[5]*c,n[6]=this[6]*u,n[7]=0,n[8]=this[8]*o,n[9]=this[9]*c,n[10]=this[10]*u,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}},{key:"getRotationMatrix3",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=this.getScale(i||[-0,-0,-0]),o=1/s[0],c=1/s[1],u=1/s[2];return n[0]=this[0]*o,n[1]=this[1]*c,n[2]=this[2]*u,n[3]=this[4]*o,n[4]=this[5]*c,n[5]=this[6]*u,n[6]=this[8]*o,n[7]=this[9]*c,n[8]=this[10]*u,n}},{key:"transpose",value:function(){return j.transpose(this,this),this.check()}},{key:"invert",value:function(){return j.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(n){return j.multiply(this,n,this),this.check()}},{key:"multiplyRight",value:function(n){return j.multiply(this,this,n),this.check()}},{key:"rotateX",value:function(n){return j.rotateX(this,this,n),this.check()}},{key:"rotateY",value:function(n){return j.rotateY(this,this,n),this.check()}},{key:"rotateZ",value:function(n){return j.rotateZ(this,this,n),this.check()}},{key:"rotateXYZ",value:function(n){var i=(0,Yh.default)(n,3),s=i[0],o=i[1],c=i[2];return this.rotateX(s).rotateY(o).rotateZ(c)}},{key:"rotateAxis",value:function(n,i){return j.rotate(this,this,n,i),this.check()}},{key:"scale",value:function(n){return Array.isArray(n)?j.scale(this,this,n):j.scale(this,this,[n,n,n]),this.check()}},{key:"translate",value:function(n){return j.translate(this,this,n),this.check()}},{key:"transform",value:function(n,i){return n.length===4?(i=$h.transformMat4(i||[-0,-0,-0,-0],n,this),(0,ur.checkVector)(i,4),i):this.transformAsPoint(n,i)}},{key:"transformAsPoint",value:function(n,i){var s=n.length;switch(s){case 2:i=Xh.transformMat4(i||[-0,-0],n,this);break;case 3:i=Qh.transformMat4(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,ur.checkVector)(i,n.length),i}},{key:"transformAsVector",value:function(n,i){switch(n.length){case 2:i=(0,Mi.vec2_transformMat4AsVector)(i||[-0,-0],n,this);break;case 3:i=(0,Mi.vec3_transformMat4AsVector)(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,ur.checkVector)(i,n.length),i}},{key:"makeRotationX",value:function(n){return this.identity().rotateX(n)}},{key:"makeTranslation",value:function(n,i,s){return this.identity().translate([n,i,s])}},{key:"transformPoint",value:function(n,i){return(0,ur.deprecated)("Matrix4.transformPoint","3.0"),this.transformAsPoint(n,i)}},{key:"transformVector",value:function(n,i){return(0,ur.deprecated)("Matrix4.transformVector","3.0"),this.transformAsPoint(n,i)}},{key:"transformDirection",value:function(n,i){return(0,ur.deprecated)("Matrix4.transformDirection","3.0"),this.transformAsVector(n,i)}}],[{key:"IDENTITY",get:function(){return lr.IDENTITY=lr.IDENTITY||Object.freeze(new t(bi)),lr.IDENTITY}},{key:"ZERO",get:function(){return lr.ZERO=lr.ZERO||Object.freeze(new t(Kh)),lr.ZERO}},{key:"_computeInfinitePerspectiveOffCenter",value:function(n,i,s,o,c,u){var l=2*u/(s-i),h=2*u/(c-o),f=(s+i)/(s-i),d=(c+o)/(c-o),p=-1,m=-1,v=-2*u;return n[0]=l,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=h,n[6]=0,n[7]=0,n[8]=f,n[9]=d,n[10]=p,n[11]=m,n[12]=0,n[13]=0,n[14]=v,n[15]=0,n}}]),t}(Zh.default);it.default=r0});var qi=R(x=>{"use strict";function st(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?st=function(t){return typeof t}:st=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(e)}Object.defineProperty(x,"__esModule",{value:!0});x.create=Vt;x.identity=n0;x.setAxisAngle=Ti;x.getAxisAngle=a0;x.getAngle=i0;x.multiply=ki;x.rotateX=s0;x.rotateY=o0;x.rotateZ=c0;x.calculateW=u0;x.exp=Oi;x.ln=Ri;x.pow=l0;x.slerp=ct;x.random=f0;x.invert=h0;x.conjugate=d0;x.fromMat3=Si;x.fromEuler=p0;x.str=v0;x.setAxes=x.sqlerp=x.rotationTo=x.equals=x.exactEquals=x.normalize=x.sqrLen=x.squaredLength=x.len=x.length=x.lerp=x.dot=x.scale=x.mul=x.add=x.set=x.copy=x.fromValues=x.clone=void 0;var $e=ot(Ge()),t0=ot(Ft()),Oe=ot(ke()),ee=ot(nt());function _i(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return _i=function(){return e},e}function ot(e){if(e&&e.__esModule)return e;if(e===null||st(e)!=="object"&&typeof e!="function")return{default:e};var r=_i();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function Vt(){var e=new $e.ARRAY_TYPE(4);return $e.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function n0(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Ti(e,r,t){t=t*.5;var a=Math.sin(t);return e[0]=a*r[0],e[1]=a*r[1],e[2]=a*r[2],e[3]=Math.cos(t),e}function a0(e,r){var t=Math.acos(r[3])*2,a=Math.sin(t/2);return a>$e.EPSILON?(e[0]=r[0]/a,e[1]=r[1]/a,e[2]=r[2]/a):(e[0]=1,e[1]=0,e[2]=0),t}function i0(e,r){var t=Ei(e,r);return Math.acos(2*t*t-1)}function ki(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=t[0],c=t[1],u=t[2],l=t[3];return e[0]=a*l+s*o+n*u-i*c,e[1]=n*l+s*c+i*o-a*u,e[2]=i*l+s*u+a*c-n*o,e[3]=s*l-a*o-n*c-i*u,e}function s0(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c+s*o,e[1]=n*c+i*o,e[2]=i*c-n*o,e[3]=s*c-a*o,e}function o0(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c-i*o,e[1]=n*c+s*o,e[2]=i*c+a*o,e[3]=s*c-n*o,e}function c0(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c+n*o,e[1]=n*c-a*o,e[2]=i*c+s*o,e[3]=s*c-i*o,e}function u0(e,r){var t=r[0],a=r[1],n=r[2];return e[0]=t,e[1]=a,e[2]=n,e[3]=Math.sqrt(Math.abs(1-t*t-a*a-n*n)),e}function Oi(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=Math.sqrt(t*t+a*a+n*n),o=Math.exp(i),c=s>0?o*Math.sin(s)/s:0;return e[0]=t*c,e[1]=a*c,e[2]=n*c,e[3]=o*Math.cos(s),e}function Ri(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=Math.sqrt(t*t+a*a+n*n),o=s>0?Math.atan2(s,i)/s:0;return e[0]=t*o,e[1]=a*o,e[2]=n*o,e[3]=.5*Math.log(t*t+a*a+n*n+i*i),e}function l0(e,r,t){return Ri(e,r),Ai(e,e,t),Oi(e,e),e}function ct(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3],c=t[0],u=t[1],l=t[2],h=t[3],f,d,p,m,v;return d=n*c+i*u+s*l+o*h,d<0&&(d=-d,c=-c,u=-u,l=-l,h=-h),1-d>$e.EPSILON?(f=Math.acos(d),p=Math.sin(f),m=Math.sin((1-a)*f)/p,v=Math.sin(a*f)/p):(m=1-a,v=a),e[0]=m*n+v*c,e[1]=m*i+v*u,e[2]=m*s+v*l,e[3]=m*o+v*h,e}function f0(e){var r=$e.RANDOM(),t=$e.RANDOM(),a=$e.RANDOM(),n=Math.sqrt(1-r),i=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*t),e[1]=n*Math.cos(2*Math.PI*t),e[2]=i*Math.sin(2*Math.PI*a),e[3]=i*Math.cos(2*Math.PI*a),e}function h0(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t*t+a*a+n*n+i*i,o=s?1/s:0;return e[0]=-t*o,e[1]=-a*o,e[2]=-n*o,e[3]=i*o,e}function d0(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e}function Si(e,r){var t=r[0]+r[4]+r[8],a;if(t>0)a=Math.sqrt(t+1),e[3]=.5*a,a=.5/a,e[0]=(r[5]-r[7])*a,e[1]=(r[6]-r[2])*a,e[2]=(r[1]-r[3])*a;else{var n=0;r[4]>r[0]&&(n=1),r[8]>r[n*3+n]&&(n=2);var i=(n+1)%3,s=(n+2)%3;a=Math.sqrt(r[n*3+n]-r[i*3+i]-r[s*3+s]+1),e[n]=.5*a,a=.5/a,e[3]=(r[i*3+s]-r[s*3+i])*a,e[i]=(r[i*3+n]+r[n*3+i])*a,e[s]=(r[s*3+n]+r[n*3+s])*a}return e}function p0(e,r,t,a){var n=.5*Math.PI/180;r*=n,t*=n,a*=n;var i=Math.sin(r),s=Math.cos(r),o=Math.sin(t),c=Math.cos(t),u=Math.sin(a),l=Math.cos(a);return e[0]=i*c*l-s*o*u,e[1]=s*o*l+i*c*u,e[2]=s*c*u-i*o*l,e[3]=s*c*l+i*o*u,e}function v0(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var m0=ee.clone;x.clone=m0;var g0=ee.fromValues;x.fromValues=g0;var y0=ee.copy;x.copy=y0;var M0=ee.set;x.set=M0;var x0=ee.add;x.add=x0;var b0=ki;x.mul=b0;var Ai=ee.scale;x.scale=Ai;var Ei=ee.dot;x.dot=Ei;var _0=ee.lerp;x.lerp=_0;var Pi=ee.length;x.length=Pi;var T0=Pi;x.len=T0;var wi=ee.squaredLength;x.squaredLength=wi;var k0=wi;x.sqrLen=k0;var Gt=ee.normalize;x.normalize=Gt;var O0=ee.exactEquals;x.exactEquals=O0;var R0=ee.equals;x.equals=R0;var S0=function(){var e=Oe.create(),r=Oe.fromValues(1,0,0),t=Oe.fromValues(0,1,0);return function(a,n,i){var s=Oe.dot(n,i);return s<-.999999?(Oe.cross(e,r,n),Oe.len(e)<1e-6&&Oe.cross(e,t,n),Oe.normalize(e,e),Ti(a,e,Math.PI),a):s>.999999?(a[0]=0,a[1]=0,a[2]=0,a[3]=1,a):(Oe.cross(e,n,i),a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=1+s,Gt(a,a))}}();x.rotationTo=S0;var A0=function(){var e=Vt(),r=Vt();return function(t,a,n,i,s,o){return ct(e,a,s,o),ct(r,n,i,o),ct(t,e,r,2*o*(1-o)),t}}();x.sqlerp=A0;var E0=function(){var e=t0.create();return function(r,t,a,n){return e[0]=a[0],e[3]=a[1],e[6]=a[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-t[0],e[5]=-t[1],e[8]=-t[2],Gt(r,Si(r,e))}}();x.setAxes=E0});var Ut=R(ut=>{"use strict";var Je=U(),P0=te();Object.defineProperty(ut,"__esModule",{value:!0});ut.default=void 0;var w0=Je($()),q0=Je(J()),L0=Je(se()),I0=Je(oe()),Li=Je(ce()),N0=Je(br()),kr=ue(),Ii=Je(ze()),G=Ci(qi()),C0=Ci(nt());function Ni(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ni=function(n){return n?t:r})(e)}function Ci(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||P0(e)!=="object"&&typeof e!="function")return{default:e};var t=Ni(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function D0(e){var r=W0();return function(){var a=(0,Li.default)(e),n;if(r){var i=(0,Li.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,I0.default)(this,n)}}function W0(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var B0=[0,0,0,1],F0=function(e){(0,L0.default)(t,e);var r=D0(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return(0,w0.default)(this,t),a=r.call(this,-0,-0,-0,-0),Array.isArray(n)&&arguments.length===1?a.copy(n):a.set(n,i,s,o),a}return(0,q0.default)(t,[{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this.check()}},{key:"set",value:function(n,i,s,o){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this.check()}},{key:"fromMatrix3",value:function(n){return G.fromMat3(this,n),this.check()}},{key:"identity",value:function(){return G.identity(this),this.check()}},{key:"fromAxisRotation",value:function(n,i){return G.setAxisAngle(this,n,i),this.check()}},{key:"setAxisAngle",value:function(n,i){return this.fromAxisRotation(n,i)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,kr.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,kr.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,kr.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,kr.checkNumber)(n)}},{key:"len",value:function(){return G.length(this)}},{key:"lengthSquared",value:function(){return G.squaredLength(this)}},{key:"dot",value:function(n,i){if(i!==void 0)throw new Error("Quaternion.dot only takes one argument");return G.dot(this,n)}},{key:"rotationTo",value:function(n,i){return G.rotationTo(this,n,i),this.check()}},{key:"add",value:function(n,i){if(i!==void 0)throw new Error("Quaternion.add only takes one argument");return G.add(this,this,n),this.check()}},{key:"calculateW",value:function(){return G.calculateW(this,this),this.check()}},{key:"conjugate",value:function(){return G.conjugate(this,this),this.check()}},{key:"invert",value:function(){return G.invert(this,this),this.check()}},{key:"lerp",value:function(n,i,s){return G.lerp(this,n,i,s),this.check()}},{key:"multiplyRight",value:function(n,i){return(0,Ii.default)(!i),G.multiply(this,this,n),this.check()}},{key:"multiplyLeft",value:function(n,i){return(0,Ii.default)(!i),G.multiply(this,n,this),this.check()}},{key:"normalize",value:function(){var n=this.len(),i=n>0?1/n:0;return this[0]=this[0]*i,this[1]=this[1]*i,this[2]=this[2]*i,this[3]=this[3]*i,n===0&&(this[3]=1),this.check()}},{key:"rotateX",value:function(n){return G.rotateX(this,this,n),this.check()}},{key:"rotateY",value:function(n){return G.rotateY(this,this,n),this.check()}},{key:"rotateZ",value:function(n){return G.rotateZ(this,this,n),this.check()}},{key:"scale",value:function(n){return G.scale(this,this,n),this.check()}},{key:"slerp",value:function(n,i,s){switch(arguments.length){case 1:var o=arguments[0],c=o.start;n=c===void 0?B0:c,i=o.target,s=o.ratio;break;case 2:var u=Array.prototype.slice.call(arguments);i=u[0],s=u[1],n=this;break;default:}return G.slerp(this,n,i,s),this.check()}},{key:"transformVector4",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return C0.transformQuat(i,n,this),(0,kr.checkVector)(i,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(n,i){return this.setAxisAngle(n,i)}},{key:"premultiply",value:function(n,i){return this.multiplyLeft(n,i)}},{key:"multiply",value:function(n,i){return this.multiplyRight(n,i)}}]),t}(N0.default);ut.default=F0});var Di=R(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.default=void 0;var z0={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:Math.PI*2};lt.default=z0});var Fi=R(ht=>{"use strict";var ft=U(),Y0=te();Object.defineProperty(ht,"__esModule",{value:!0});ht.default=void 0;var V0=ft(Tr()),G0=ft($()),U0=ft(J()),X=me(),j0=ft(Qr()),Z0=X0(ke());function Wi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Wi=function(n){return n?t:r})(e)}function X0(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Y0(e)!=="object"&&typeof e!="function")return{default:e};var t=Wi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var Bi=1e-6,Q0=6371e3,$0=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.phi,a=t===void 0?0:t,n=r.theta,i=n===void 0?0:n,s=r.radius,o=s===void 0?1:s,c=r.bearing,u=c===void 0?void 0:c,l=r.pitch,h=l===void 0?void 0:l,f=r.altitude,d=f===void 0?void 0:f,p=r.radiusScale,m=p===void 0?Q0:p;(0,G0.default)(this,e),this.phi=a,this.theta=i,this.radius=o||d||1,this.radiusScale=m||1,u!==void 0&&(this.bearing=u),h!==void 0&&(this.pitch=h),this.check()}return(0,U0.default)(e,[{key:"toString",value:function(){return this.formatString(X.config)}},{key:"formatString",value:function(t){var a=t.printTypes,n=a===void 0?!1:a,i=X.formatValue;return"".concat(n?"Spherical":"","[rho:").concat(i(this.radius),",theta:").concat(i(this.theta),",phi:").concat(i(this.phi),"]")}},{key:"equals",value:function(t){return(0,X.equals)(this.radius,t.radius)&&(0,X.equals)(this.theta,t.theta)&&(0,X.equals)(this.phi,t.phi)}},{key:"exactEquals",value:function(t){return this.radius===t.radius&&this.theta===t.theta&&this.phi===t.phi}},{key:"bearing",get:function(){return 180-(0,X.degrees)(this.phi)},set:function(t){this.phi=Math.PI-(0,X.radians)(t)}},{key:"pitch",get:function(){return(0,X.degrees)(this.theta)},set:function(t){this.theta=(0,X.radians)(t)}},{key:"longitude",get:function(){return(0,X.degrees)(this.phi)}},{key:"latitude",get:function(){return(0,X.degrees)(this.theta)}},{key:"lng",get:function(){return(0,X.degrees)(this.phi)}},{key:"lat",get:function(){return(0,X.degrees)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}},{key:"set",value:function(t,a,n){return this.radius=t,this.phi=a,this.theta=n,this.check()}},{key:"clone",value:function(){return new e().copy(this)}},{key:"copy",value:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this.check()}},{key:"fromLngLatZ",value:function(t){var a=(0,V0.default)(t,3),n=a[0],i=a[1],s=a[2];this.radius=1+s/this.radiusScale,this.phi=(0,X.radians)(i),this.theta=(0,X.radians)(n)}},{key:"fromVector3",value:function(t){return this.radius=Z0.length(t),this.radius>0&&(this.theta=Math.atan2(t[0],t[1]),this.phi=Math.acos((0,X.clamp)(t[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new j0.default(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){return this.phi=Math.max(Bi,Math.min(Math.PI-Bi,this.phi)),this}},{key:"check",value:function(){if(!Number.isFinite(this.phi)||!Number.isFinite(this.theta)||!(this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}}]),e}();ht.default=$0});var jt=R(pt=>{"use strict";var Pe=U();Object.defineProperty(pt,"__esModule",{value:!0});pt.default=void 0;var J0=Pe(Tr()),H0=Pe($()),K0=Pe(J()),e1=Pe(se()),r1=Pe(oe()),zi=Pe(ce()),t1=Pe(br()),fr=me(),ie=ue(),Yi=Pe(Ut());function n1(e){var r=a1();return function(){var a=(0,zi.default)(e),n;if(r){var i=(0,zi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,r1.default)(this,n)}}function a1(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var dt="Unknown Euler angle order",hr=.99999;function i1(e){return e>=0&&e<6}function s1(e){if(e<0&&e>=6)throw new Error(dt);return e}var o1=function(e){(0,e1.default)(t,e);var r=n1(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t.DefaultOrder;if((0,H0.default)(this,t),a=r.call(this,-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])){var c;(c=a).fromVector3.apply(c,arguments)}else a.set(n,i,s,o);return a}return(0,K0.default)(t,[{key:"ELEMENTS",get:function(){return 4}},{key:"fromQuaternion",value:function(n){var i=(0,J0.default)(n,4),s=i[0],o=i[1],c=i[2],u=i[3],l=o*o,h=-2*(l+c*c)+1,f=2*(s*o+u*c),d=-2*(s*c-u*o),p=2*(o*c+u*s),m=-2*(s*s+l)+1;d=d>1?1:d,d=d<-1?-1:d;var v=Math.atan2(p,m),g=Math.asin(d),b=Math.atan2(f,h);return new t(v,g,b,t.RollPitchYaw)}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=Number.isFinite(n[3])||this.order,this.check()}},{key:"set",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0;return this[0]=n,this[1]=i,this[2]=s,this[3]=Number.isFinite(o)?o:this[3],this.check()}},{key:"validate",value:function(){return i1(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}},{key:"toArray",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return n[i]=this[0],n[i+1]=this[1],n[i+2]=this[2],n}},{key:"toArray4",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return n[i]=this[0],n[i+1]=this[1],n[i+2]=this[2],n[i+3]=this[3],n}},{key:"toVector3",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=this[0],n[1]=this[1],n[2]=this[2],n}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"alpha",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"beta",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"gamma",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"phi",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"theta",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"psi",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"roll",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"pitch",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"yaw",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"order",get:function(){return this[3]},set:function(n){this[3]=s1(n)}},{key:"fromVector3",value:function(n,i){return this.set(n[0],n[1],n[2],Number.isFinite(i)?i:this[3])}},{key:"fromArray",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this[0]=n[0+i],this[1]=n[1+i],this[2]=n[2+i],n[3]!==void 0&&(this[3]=n[3]),this.check()}},{key:"fromRollPitchYaw",value:function(n,i,s){return this.set(n,i,s,t.ZYX)}},{key:"fromRotationMatrix",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.DefaultOrder;return this._fromRotationMatrix(n,i),this.check()}},{key:"getRotationMatrix",value:function(n){return this._getRotationMatrix(n)}},{key:"getQuaternion",value:function(){var n=new Yi.default;switch(this[4]){case t.XYZ:return n.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case t.YXZ:return n.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case t.ZXY:return n.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case t.ZYX:return n.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case t.YZX:return n.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case t.XZY:return n.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(dt)}}},{key:"_fromRotationMatrix",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.DefaultOrder,s=n.elements,o=s[0],c=s[4],u=s[8],l=s[1],h=s[5],f=s[9],d=s[2],p=s[6],m=s[10];switch(i=i||this[3],i){case t.XYZ:this[1]=Math.asin((0,fr.clamp)(u,-1,1)),Math.abs(u)<hr?(this[0]=Math.atan2(-f,m),this[2]=Math.atan2(-c,o)):(this[0]=Math.atan2(p,h),this[2]=0);break;case t.YXZ:this[0]=Math.asin(-(0,fr.clamp)(f,-1,1)),Math.abs(f)<hr?(this[1]=Math.atan2(u,m),this[2]=Math.atan2(l,h)):(this[1]=Math.atan2(-d,o),this[2]=0);break;case t.ZXY:this[0]=Math.asin((0,fr.clamp)(p,-1,1)),Math.abs(p)<hr?(this[1]=Math.atan2(-d,m),this[2]=Math.atan2(-c,h)):(this[1]=0,this[2]=Math.atan2(l,o));break;case t.ZYX:this[1]=Math.asin(-(0,fr.clamp)(d,-1,1)),Math.abs(d)<hr?(this[0]=Math.atan2(p,m),this[2]=Math.atan2(l,o)):(this[0]=0,this[2]=Math.atan2(-c,h));break;case t.YZX:this[2]=Math.asin((0,fr.clamp)(l,-1,1)),Math.abs(l)<hr?(this[0]=Math.atan2(-f,h),this[1]=Math.atan2(-d,o)):(this[0]=0,this[1]=Math.atan2(u,m));break;case t.XZY:this[2]=Math.asin(-(0,fr.clamp)(c,-1,1)),Math.abs(c)<hr?(this[0]=Math.atan2(p,h),this[1]=Math.atan2(u,o)):(this[0]=Math.atan2(-f,m),this[1]=0);break;default:throw new Error(dt)}return this[3]=i,this}},{key:"_getRotationMatrix",value:function(n){var i=n||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],s=this.x,o=this.y,c=this.z,u=Math.cos(s),l=Math.cos(o),h=Math.cos(c),f=Math.sin(s),d=Math.sin(o),p=Math.sin(c);switch(this[3]){case t.XYZ:{var m=u*h,v=u*p,g=f*h,b=f*p;i[0]=l*h,i[4]=-l*p,i[8]=d,i[1]=v+g*d,i[5]=m-b*d,i[9]=-f*l,i[2]=b-m*d,i[6]=g+v*d,i[10]=u*l;break}case t.YXZ:{var y=l*h,M=l*p,k=d*h,_=d*p;i[0]=y+_*f,i[4]=k*f-M,i[8]=u*d,i[1]=u*p,i[5]=u*h,i[9]=-f,i[2]=M*f-k,i[6]=_+y*f,i[10]=u*l;break}case t.ZXY:{var C=l*h,L=l*p,I=d*h,w=d*p;i[0]=C-w*f,i[4]=-u*p,i[8]=I+L*f,i[1]=L+I*f,i[5]=u*h,i[9]=w-C*f,i[2]=-u*d,i[6]=f,i[10]=u*l;break}case t.ZYX:{var D=u*h,N=u*p,W=f*h,E=f*p;i[0]=l*h,i[4]=W*d-N,i[8]=D*d+E,i[1]=l*p,i[5]=E*d+D,i[9]=N*d-W,i[2]=-d,i[6]=f*l,i[10]=u*l;break}case t.YZX:{var Z=u*l,de=u*d,pe=f*l,De=f*d;i[0]=l*h,i[4]=De-Z*p,i[8]=pe*p+de,i[1]=p,i[5]=u*h,i[9]=-f*h,i[2]=-d*h,i[6]=de*p+pe,i[10]=Z-De*p;break}case t.XZY:{var We=u*l,dn=u*d,pn=f*l,vn=f*d;i[0]=l*h,i[4]=-p,i[8]=d*h,i[1]=We*p+vn,i[5]=u*h,i[9]=dn*p-pn,i[2]=pn*p-dn,i[6]=f*h,i[10]=vn*p+We;break}default:throw new Error(dt)}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{key:"toQuaternion",value:function(){var n=Math.cos(this.yaw*.5),i=Math.sin(this.yaw*.5),s=Math.cos(this.roll*.5),o=Math.sin(this.roll*.5),c=Math.cos(this.pitch*.5),u=Math.sin(this.pitch*.5),l=n*s*c+i*o*u,h=n*o*c-i*s*u,f=n*s*u+i*o*c,d=i*s*c-n*o*u;return new Yi.default(h,f,d,l)}}],[{key:"ZYX",get:function(){return 0}},{key:"YXZ",get:function(){return 1}},{key:"XZY",get:function(){return 2}},{key:"ZXY",get:function(){return 3}},{key:"YZX",get:function(){return 4}},{key:"XYZ",get:function(){return 5}},{key:"RollPitchYaw",get:function(){return 0}},{key:"DefaultOrder",get:function(){return t.ZYX}},{key:"RotationOrders",get:function(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}},{key:"rotationOrder",value:function(n){return t.RotationOrders[n]}}]),t}(t1.default);pt.default=o1});var Gi=R(vt=>{"use strict";var Or=U();Object.defineProperty(vt,"__esModule",{value:!0});vt.default=void 0;var c1=Or($()),u1=Or(J()),Zt=Or(Yt()),Vi=Or(Qr()),Xt=Or(jt()),l1=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.x,a=t===void 0?0:t,n=r.y,i=n===void 0?0:n,s=r.z,o=s===void 0?0:s,c=r.roll,u=c===void 0?0:c,l=r.pitch,h=l===void 0?0:l,f=r.yaw,d=f===void 0?0:f,p=r.position,m=p===void 0?void 0:p,v=r.orientation,g=v===void 0?void 0:v;(0,c1.default)(this,e),Array.isArray(m)&&m.length===3?this.position=new Vi.default(m):this.position=new Vi.default(a,i,o),Array.isArray(g)&&g.length===4?this.orientation=new Xt.default(g,g[3]):this.orientation=new Xt.default(u,h,d,Xt.default.RollPitchYaw)}return(0,u1.default)(e,[{key:"x",get:function(){return this.position.x},set:function(t){this.position.x=t}},{key:"y",get:function(){return this.position.y},set:function(t){this.position.y=t}},{key:"z",get:function(){return this.position.z},set:function(t){this.position.z=t}},{key:"roll",get:function(){return this.orientation.roll},set:function(t){this.orientation.roll=t}},{key:"pitch",get:function(){return this.orientation.pitch},set:function(t){this.orientation.pitch=t}},{key:"yaw",get:function(){return this.orientation.yaw},set:function(t){this.orientation.yaw=t}},{key:"getPosition",value:function(){return this.position}},{key:"getOrientation",value:function(){return this.orientation}},{key:"equals",value:function(t){return t?this.position.equals(t.position)&&this.orientation.equals(t.orientation):!1}},{key:"exactEquals",value:function(t){return t?this.position.exactEquals(t.position)&&this.orientation.exactEquals(t.orientation):!1}},{key:"getTransformationMatrix",value:function(){var t=Math.sin(this.roll),a=Math.sin(this.pitch),n=Math.sin(this.yaw),i=Math.cos(this.roll),s=Math.cos(this.pitch),o=Math.cos(this.yaw),c=new Zt.default().setRowMajor(o*s,-n*i+o*a*t,n*t+o*a*i,this.x,n*s,o*i+n*a*t,-o*t+n*a*i,this.y,-a,s*t,s*i,this.z,0,0,0,1);return c}},{key:"getTransformationMatrixFromPose",value:function(t){return new Zt.default().multiplyRight(this.getTransformationMatrix()).multiplyRight(t.getTransformationMatrix().invert())}},{key:"getTransformationMatrixToPose",value:function(t){return new Zt.default().multiplyRight(t.getTransformationMatrix()).multiplyRight(this.getTransformationMatrix().invert())}}]),e}();vt.default=l1});var dr=R(P=>{"use strict";var le=U();Object.defineProperty(P,"__esModule",{value:!0});Object.defineProperty(P,"config",{enumerable:!0,get:function(){return z.config}});Object.defineProperty(P,"configure",{enumerable:!0,get:function(){return z.configure}});Object.defineProperty(P,"formatValue",{enumerable:!0,get:function(){return z.formatValue}});Object.defineProperty(P,"isArray",{enumerable:!0,get:function(){return z.isArray}});Object.defineProperty(P,"clone",{enumerable:!0,get:function(){return z.clone}});Object.defineProperty(P,"equals",{enumerable:!0,get:function(){return z.equals}});Object.defineProperty(P,"exactEquals",{enumerable:!0,get:function(){return z.exactEquals}});Object.defineProperty(P,"toRadians",{enumerable:!0,get:function(){return z.toRadians}});Object.defineProperty(P,"toDegrees",{enumerable:!0,get:function(){return z.toDegrees}});Object.defineProperty(P,"radians",{enumerable:!0,get:function(){return z.radians}});Object.defineProperty(P,"degrees",{enumerable:!0,get:function(){return z.degrees}});Object.defineProperty(P,"sin",{enumerable:!0,get:function(){return z.sin}});Object.defineProperty(P,"cos",{enumerable:!0,get:function(){return z.cos}});Object.defineProperty(P,"tan",{enumerable:!0,get:function(){return z.tan}});Object.defineProperty(P,"asin",{enumerable:!0,get:function(){return z.asin}});Object.defineProperty(P,"acos",{enumerable:!0,get:function(){return z.acos}});Object.defineProperty(P,"atan",{enumerable:!0,get:function(){return z.atan}});Object.defineProperty(P,"clamp",{enumerable:!0,get:function(){return z.clamp}});Object.defineProperty(P,"lerp",{enumerable:!0,get:function(){return z.lerp}});Object.defineProperty(P,"withEpsilon",{enumerable:!0,get:function(){return z.withEpsilon}});Object.defineProperty(P,"Vector2",{enumerable:!0,get:function(){return f1.default}});Object.defineProperty(P,"Vector3",{enumerable:!0,get:function(){return h1.default}});Object.defineProperty(P,"Vector4",{enumerable:!0,get:function(){return d1.default}});Object.defineProperty(P,"Matrix3",{enumerable:!0,get:function(){return p1.default}});Object.defineProperty(P,"Matrix4",{enumerable:!0,get:function(){return v1.default}});Object.defineProperty(P,"Quaternion",{enumerable:!0,get:function(){return m1.default}});Object.defineProperty(P,"checkNumber",{enumerable:!0,get:function(){return g1.checkNumber}});Object.defineProperty(P,"_MathUtils",{enumerable:!0,get:function(){return y1.default}});Object.defineProperty(P,"SphericalCoordinates",{enumerable:!0,get:function(){return Ui.default}});Object.defineProperty(P,"_SphericalCoordinates",{enumerable:!0,get:function(){return Ui.default}});Object.defineProperty(P,"Pose",{enumerable:!0,get:function(){return ji.default}});Object.defineProperty(P,"_Pose",{enumerable:!0,get:function(){return ji.default}});Object.defineProperty(P,"Euler",{enumerable:!0,get:function(){return Zi.default}});Object.defineProperty(P,"_Euler",{enumerable:!0,get:function(){return Zi.default}});Object.defineProperty(P,"assert",{enumerable:!0,get:function(){return M1.default}});var z=me(),f1=le(Ma()),h1=le(Qr()),d1=le(Ba()),p1=le(Xa()),v1=le(Yt()),m1=le(Ut()),g1=ue(),y1=le(Di()),Ui=le(Fi()),ji=le(Gi()),Zi=le(jt()),M1=le(ze()),Qt={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global},x1=Qt.global||Qt.self||Qt.window;x1.mathgl={config:z.config}});var Kt=R(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.WGS84_CONSTANTS=xe.WGS84_RADIUS_Z=xe.WGS84_RADIUS_Y=xe.WGS84_RADIUS_X=void 0;var we=6378137;xe.WGS84_RADIUS_X=we;var qe=6378137;xe.WGS84_RADIUS_Y=qe;var Le=6356752314245179e-9;xe.WGS84_RADIUS_Z=Le;var R1={radii:[we,qe,Le],radiiSquared:[we*we,qe*qe,Le*Le],oneOverRadii:[1/we,1/qe,1/Le],oneOverRadiiSquared:[1/(we*we),1/(qe*qe),1/(Le*Le)],maximumRadius:Math.max(we,qe,Le),centerToleranceSquared:.1};xe.WGS84_CONSTANTS=R1});var nn=R(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.fromCartographic=rn;Re.fromCartographicToRadians=S1;Re.fromCartographicToDegrees=A1;Re.toCartographic=tn;Re.toCartographicFromRadians=E1;Re.toCartographicFromDegrees=P1;Re.isWGS84=w1;var fe=dr(),Xi=Kt(),pr=function(r){return r},en=new fe.Vector3;function rn(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pr;return(0,fe.isArray)(e)?(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]):"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z),r}function S1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:en;return rn(e,r,fe.config._cartographicRadians?pr:fe.toRadians)}function A1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:en;return rn(e,r,fe.config._cartographicRadians?fe.toDegrees:pr)}function tn(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pr;return(0,fe.isArray)(r)?(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]):"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]),r}function E1(e,r){return tn(e,r,fe.config._cartographicRadians?pr:fe.toDegrees)}function P1(e,r){return tn(e,r,fe.config._cartographicRadians?fe.toRadians:pr)}function w1(e){if(!e)return!1;en.from(e);var r=Xi.WGS84_CONSTANTS.oneOverRadiiSquared,t=Xi.WGS84_CONSTANTS.centerToleranceSquared,a=e[0]*e[0]*r[0],n=e[1]*e[1]*r[1],i=e[2]*e[2]*r[2];return Math.abs(a+n+i-1)<t}});var Ji=R(an=>{"use strict";var q1=te();Object.defineProperty(an,"__esModule",{value:!0});an.default=C1;var Rr=dr(),Jp=L1(ke());function Qi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Qi=function(n){return n?t:r})(e)}function L1(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||q1(e)!=="object"&&typeof e!="function")return{default:e};var t=Qi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var $i=new Rr.Vector3,I1=new Rr.Vector3,N1=new Rr.Vector3;function C1(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Rr.Vector3,a=r.oneOverRadii,n=r.oneOverRadiiSquared,i=r.centerToleranceSquared;$i.from(e);var s=e.x,o=e.y,c=e.z,u=a.x,l=a.y,h=a.z,f=s*s*u*u,d=o*o*l*l,p=c*c*h*h,m=f+d+p,v=Math.sqrt(1/m);if(!!Number.isFinite(v)){var g=I1;if(g.copy(e).scale(v),m<i)return g.to(t);var b=n.x,y=n.y,M=n.z,k=N1;k.set(g.x*b*2,g.y*y*2,g.z*M*2);var _=(1-v)*e.len()/(.5*k.len()),C=0,L,I,w,D;do{_-=C,L=1/(1+_*b),I=1/(1+_*y),w=1/(1+_*M);var N=L*L,W=I*I,E=w*w,Z=N*L,de=W*I,pe=E*w;D=f*N+d*W+p*E-1;var De=f*Z*b+d*de*y+p*pe*M,We=-2*De;C=D/We}while(Math.abs(D)>Rr._MathUtils.EPSILON12);return $i.scale([L,I,w]).to(t)}}});var es=R(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.default=z1;var re=dr(),Hi=1e-14,D1=new re.Vector3,Ki={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"}},sn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Se={east:new re.Vector3,north:new re.Vector3,up:new re.Vector3,west:new re.Vector3,south:new re.Vector3,down:new re.Vector3},W1=new re.Vector3,B1=new re.Vector3,F1=new re.Vector3;function z1(e,r,t,a,n,i){var s=Ki[r]&&Ki[r][t];(0,re.assert)(s&&(!a||a===s));var o,c,u,l=D1.copy(n),h=(0,re.equals)(l.x,0,Hi)&&(0,re.equals)(l.y,0,Hi);if(h){var f=Math.sign(l.z);o=W1.fromArray(sn[r]),r!=="east"&&r!=="west"&&o.scale(f),c=B1.fromArray(sn[t]),t!=="east"&&t!=="west"&&c.scale(f),u=F1.fromArray(sn[a]),a!=="east"&&a!=="west"&&u.scale(f)}else{var d=Se.up,p=Se.east,m=Se.north;p.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,d),m.copy(d).cross(p);var v=Se.down,g=Se.west,b=Se.south;v.copy(d).scale(-1),g.copy(p).scale(-1),b.copy(m).scale(-1),o=Se[r],c=Se[t],u=Se[a]}return i[0]=o.x,i[1]=o.y,i[2]=o.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]=l.x,i[13]=l.y,i[14]=l.z,i[15]=1,i}});var ss=R(yt=>{"use strict";var Sr=U(),Y1=te();Object.defineProperty(yt,"__esModule",{value:!0});yt.default=void 0;var V1=Sr(Tr()),G1=Sr($()),U1=Sr(J()),Y=dr(),rs=Z1(ke()),cn=Kt(),ts=nn(),j1=Sr(Ji()),ns=Sr(es());function as(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(as=function(n){return n?t:r})(e)}function Z1(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Y1(e)!=="object"&&typeof e!="function")return{default:e};var t=as(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var mt=new Y.Vector3,is=new Y.Vector3,X1=new Y.Vector3,he=new Y.Vector3,Q1=new Y.Vector3,gt=new Y.Vector3,un,$1=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;(0,G1.default)(this,e),(0,Y.assert)(r>=0),(0,Y.assert)(t>=0),(0,Y.assert)(a>=0),this.radii=new Y.Vector3(r,t,a),this.radiiSquared=new Y.Vector3(r*r,t*t,a*a),this.radiiToTheFourth=new Y.Vector3(r*r*r*r,t*t*t*t,a*a*a*a),this.oneOverRadii=new Y.Vector3(r===0?0:1/r,t===0?0:1/t,a===0?0:1/a),this.oneOverRadiiSquared=new Y.Vector3(r===0?0:1/(r*r),t===0?0:1/(t*t),a===0?0:1/(a*a)),this.minimumRadius=Math.min(r,t,a),this.maximumRadius=Math.max(r,t,a),this.centerToleranceSquared=Y._MathUtils.EPSILON1,this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return(0,U1.default)(e,[{key:"equals",value:function(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=is,i=X1,s=(0,V1.default)(t,3),o=s[2];this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);var c=Math.sqrt(n.dot(i));return i.scale(1/c),n.scale(o),i.add(n),i.to(a)}},{key:"cartesianToCartographic",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];gt.from(t);var n=this.scaleToGeodeticSurface(gt,he);if(!!n){var i=this.geodeticSurfaceNormal(n,is),s=Q1;s.copy(gt).subtract(n);var o=Math.atan2(i.y,i.x),c=Math.asin(i.z),u=Math.sign(rs.dot(s,gt))*rs.length(s);return(0,ts.toCartographicFromRadians)([o,c,u],a)}}},{key:"eastNorthUpToFixedFrame",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Y.Matrix4;return(0,ns.default)(this,"east","north","up",t,a)}},{key:"localFrameToFixedFrame",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new Y.Matrix4;return(0,ns.default)(this,t,a,n,i,s)}},{key:"geocentricSurfaceNormal",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return mt.from(t).normalize().to(a)}},{key:"geodeticSurfaceNormalCartographic",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=(0,ts.fromCartographicToRadians)(t),i=n[0],s=n[1],o=Math.cos(s);return mt.set(o*Math.cos(i),o*Math.sin(i),Math.sin(s)).normalize(),mt.to(a)}},{key:"geodeticSurfaceNormal",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return mt.from(t).scale(this.oneOverRadiiSquared).normalize().to(a)}},{key:"scaleToGeodeticSurface",value:function(t,a){return(0,j1.default)(t,this,a)}},{key:"scaleToGeocentricSurface",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];he.from(t);var n=he.x,i=he.y,s=he.z,o=this.oneOverRadiiSquared,c=1/Math.sqrt(n*n*o.x+i*i*o.y+s*s*o.z);return he.multiplyScalar(c).to(a)}},{key:"transformPositionToScaledSpace",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return he.from(t).scale(this.oneOverRadii).to(a)}},{key:"transformPositionFromScaledSpace",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return he.from(t).scale(this.radii).to(a)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,0];(0,Y.assert)((0,Y.equals)(this.radii.x,this.radii.y,Y._MathUtils.EPSILON15)),(0,Y.assert)(this.radii.z>0),he.from(t);var i=he.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-a))return he.set(0,0,i).to(n)}}],[{key:"WGS84",get:function(){return un=un||new e(cn.WGS84_RADIUS_X,cn.WGS84_RADIUS_Y,cn.WGS84_RADIUS_Z),un}}]),e}();yt.default=$1});var os=R(Mt=>{"use strict";var J1=U();Object.defineProperty(Mt,"__esModule",{value:!0});Object.defineProperty(Mt,"Ellipsoid",{enumerable:!0,get:function(){return H1.default}});Object.defineProperty(Mt,"isWGS84",{enumerable:!0,get:function(){return K1.isWGS84}});var H1=J1(ss()),K1=nn()});function bt(e,r=!0,t){let a=t||new Set;if(e){if(bn(e))a.add(e);else if(bn(e.buffer))a.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let n in e)bt(e[n],r,a)}}return t===void 0?Array.from(a):[]}function bn(e){return e?e instanceof ArrayBuffer||typeof MessagePort!="undefined"&&e instanceof MessagePort||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas:!1}function Be(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{}return parentPort}var _t=new Map,H=class{static inWorkerThread(){return typeof self!="undefined"||Boolean(Be())}static set onmessage(r){function t(n){let i=Be(),{type:s,payload:o}=i?n:n.data;r(s,o)}let a=Be();a?(a.on("message",t),a.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t}static addEventListener(r){let t=_t.get(r);t||(t=n=>{if(!Os(n))return;let i=Be(),{type:s,payload:o}=i?n:n.data;r(s,o)}),Be()?console.error("not implemented"):globalThis.addEventListener("message",t)}static removeEventListener(r){let t=_t.get(r);_t.delete(r),Be()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static postMessage(r,t){let a={source:"loaders.gl",type:r,payload:t},n=bt(t),i=Be();i?i.postMessage(a,n):globalThis.postMessage(a,n)}};function Os(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}var Er=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(r){return this.enqueue(r)}enqueue(r){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let t=this._settlers.shift();r instanceof Error?t.reject(r):t.resolve({value:r})}else this._values.push(r)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let r=this._values.shift();return r instanceof Error?Promise.reject(r):Promise.resolve({done:!1,value:r})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((r,t)=>{this._settlers.push({resolve:r,reject:t})})}};var Rs=0,Pr,_n;function Tt(e,r){if(!H.inWorkerThread())return;let t={process:Ss};H.onmessage=async(a,n)=>{try{switch(a){case"process":if(!e)throw new Error("Worker does not support atomic processing");let i=await e(n.input,n.options||{},t);H.postMessage("done",{result:i});break;case"process-in-batches":if(!r)throw new Error("Worker does not support batched processing");Pr=new Er,_n=n.options||{};let s=r(Pr,_n,t);for await(let o of s)H.postMessage("output-batch",{result:o});H.postMessage("done",{});break;case"input-batch":Pr.push(n.input);break;case"input-done":Pr.close();break;default:}}catch(i){let s=i instanceof Error?i.message:"";H.postMessage("error",{error:s})}}}function Ss(e,r={}){return new Promise((t,a)=>{let n=Rs++,i=(o,c)=>{if(c.id===n)switch(o){case"done":H.removeEventListener(i),t(c.result);break;case"error":H.removeEventListener(i),a(c.error);break;default:}};H.addEventListener(i);let s={id:n,input:e,options:r};H.postMessage("process",s)})}function Ae(e,r){if(!e)throw new Error(r||"loader assertion failed.")}function be(e,r){return Ae(e>=0),Ae(r>0),e+(r-1)&~(r-1)}function kt(e,r,t){let a;if(e instanceof ArrayBuffer)a=new Uint8Array(e);else{let n=e.byteOffset,i=e.byteLength;a=new Uint8Array(e.buffer||e.arrayBuffer,n,i)}return r.set(a,t),t+be(a.byteLength,4)}function wr(e,r,t,a){let n=be(t.byteLength,a),i=n-t.byteLength;if(e){let s=new Uint8Array(e.buffer,e.byteOffset+r,t.byteLength),o=new Uint8Array(t);s.set(o);for(let c=0;c<i;++c)e.setUint8(r+t.byteLength+c,32)}return r+=n,r}function Ke(e,r,t,a){let i=new TextEncoder().encode(t);return r=wr(e,r,i,a),r}function Ot(e,r){let t=e.length,n=Math.ceil(t/r)*r-t,i="";for(let s=0;s<n;++s)i+=" ";return e+i}function er(e,r,t,a){if(e)for(let n=0;n<a;n++)e.setUint8(r+n,t.charCodeAt(n));return r+a}function mr(e,r,t,a){if(e)for(let n=0;n<a;n++)e.setUint8(r+n,t[n]);return r+a}function qr(e,r,t){if(r.encodeSync)return r.encodeSync(e,t);throw new Error("Writer could not synchronously encode data")}var Tn="3.3.0-alpha.2";var ve=!1,gr=!0;function Rt(e){let r=yr(e);return As(r)||ws(r)||Es(r)||Ps(r)}function As(e){let r=yr(e);return r.byteLength>=24&&r.getUint32(0,ve)===2303741511?{mimeType:"image/png",width:r.getUint32(16,ve),height:r.getUint32(20,ve)}:null}function Es(e){let r=yr(e);return r.byteLength>=10&&r.getUint32(0,ve)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,gr),height:r.getUint16(8,gr)}:null}function Ps(e){let r=yr(e);return r.byteLength>=14&&r.getUint16(0,ve)===16973&&r.getUint32(2,gr)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,gr),height:r.getUint32(22,gr)}:null}function ws(e){let r=yr(e);if(!(r.byteLength>=3&&r.getUint16(0,ve)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:a,sofMarkers:n}=qs(),i=2;for(;i+9<r.byteLength;){let s=r.getUint16(i,ve);if(n.has(s))return{mimeType:"image/jpeg",height:r.getUint16(i+5,ve),width:r.getUint16(i+7,ve)};if(!a.has(s))return null;i+=2,i+=r.getUint16(i,ve)}return null}function qs(){let e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);let r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:r}}function yr(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function Fe(e,r){if(!e)throw new Error(r||"assert failed: gltf")}var kn=["SCALAR","VEC2","VEC3","VEC4"],Ls=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Is=new Map(Ls),Ns={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cs={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ds={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function On(e){return kn[e-1]||kn[0]}function Rn(e){let r=Is.get(e.constructor);if(!r)throw new Error("Illegal typed array");return r}function Sn(e,r){let t=Ds[e.componentType],a=Ns[e.type],n=Cs[e.componentType],i=e.count*a,s=e.count*a*n;return Fe(s>=0&&s<=r.byteLength),{ArrayType:t,length:i,byteLength:s}}var Ws={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Mr=class{constructor(r){this.gltf=r||{json:Q({},Ws),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(r){return this.json[r]}getExtraData(r){return(this.json.extras||{})[r]}getExtension(r){let t=this.getUsedExtensions().find(n=>n===r),a=this.json.extensions||{};return t?a[r]||!0:null}getRequiredExtension(r){return this.getRequiredExtensions().find(a=>a===r)?this.getExtension(r):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(r,t){return(r.extensions||{})[t]}getScene(r){return this.getObject("scenes",r)}getNode(r){return this.getObject("nodes",r)}getSkin(r){return this.getObject("skins",r)}getMesh(r){return this.getObject("meshes",r)}getMaterial(r){return this.getObject("materials",r)}getAccessor(r){return this.getObject("accessors",r)}getTexture(r){return this.getObject("textures",r)}getSampler(r){return this.getObject("samplers",r)}getImage(r){return this.getObject("images",r)}getBufferView(r){return this.getObject("bufferViews",r)}getBuffer(r){return this.getObject("buffers",r)}getObject(r,t){if(typeof t=="object")return t;let a=this.json[r]&&this.json[r][t];if(!a)throw new Error(`glTF file error: Could not find ${r}[${t}]`);return a}getTypedArrayForBufferView(r){r=this.getBufferView(r);let t=r.buffer,a=this.gltf.buffers[t];Fe(a);let n=(r.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,n,r.byteLength)}getTypedArrayForAccessor(r){r=this.getAccessor(r);let t=this.getBufferView(r.bufferView),n=this.getBuffer(t.buffer).data,{ArrayType:i,length:s}=Sn(r,t),o=t.byteOffset+r.byteOffset;return new i(n,o,s)}getTypedArrayForImageData(r){r=this.getAccessor(r);let t=this.getBufferView(r.bufferView),n=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(n,i,t.byteLength)}addApplicationData(r,t){return this.json[r]=t,this}addExtraData(r,t){return this.json.extras=this.json.extras||{},this.json.extras[r]=t,this}addObjectExtension(r,t,a){return r.extensions=r.extensions||{},r.extensions[t]=a,this.registerUsedExtension(t),this}setObjectExtension(r,t,a){let n=r.extensions||{};n[t]=a}removeObjectExtension(r,t){let a=r.extensions||{},n=a[t];return delete a[t],n}addExtension(r,t={}){return Fe(t),this.json.extensions=this.json.extensions||{},this.json.extensions[r]=t,this.registerUsedExtension(r),t}addRequiredExtension(r,t={}){return Fe(t),this.addExtension(r,t),this.registerRequiredExtension(r),t}registerUsedExtension(r){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===r)||this.json.extensionsUsed.push(r)}registerRequiredExtension(r){this.registerUsedExtension(r),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===r)||this.json.extensionsRequired.push(r)}removeExtension(r){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,r),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,r),this.json.extensions&&delete this.json.extensions[r]}setDefaultScene(r){this.json.scene=r}addScene(r){let{nodeIndices:t}=r;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(r){let{meshIndex:t,matrix:a}=r;this.json.nodes=this.json.nodes||[];let n={mesh:t};return a&&(n.matrix=a),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(r){let{attributes:t,indices:a,material:n,mode:i=4}=r,o={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(a){let c=this._addIndices(a);o.primitives[0].indices=c}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(r){let a={primitives:[{attributes:this._addAttributes(r),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addImage(r,t){let a=Rt(r),n=t||(a==null?void 0:a.mimeType),s={bufferView:this.addBufferView(r),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}addBufferView(r){let t=r.byteLength;Fe(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(r);let a={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=be(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(r,t){let a={bufferView:r,type:On(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(a),this.json.accessors.length-1}addBinaryBuffer(r,t={size:3}){let a=this.addBufferView(r),n={min:t.min,max:t.max};(!n.min||!n.max)&&(n=this._getAccessorMinMax(r,t.size));let i={size:t.size,componentType:Rn(r),count:Math.round(r.length/t.size),min:n.min,max:n.max};return this.addAccessor(a,Object.assign(i,t))}addTexture(r){let{imageIndex:t}=r,a={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(a),this.json.textures.length-1}addMaterial(r){return this.json.materials=this.json.materials||[],this.json.materials.push(r),this.json.materials.length-1}createBinaryChunk(){var i,s;this.gltf.buffers=[];let r=this.byteLength,t=new ArrayBuffer(r),a=new Uint8Array(t),n=0;for(let o of this.sourceBuffers||[])n=kt(o,a,n);((s=(i=this.json)==null?void 0:i.buffers)==null?void 0:s[0])?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=t,this.sourceBuffers=[t]}_removeStringFromArray(r,t){let a=!0;for(;a;){let n=r.indexOf(t);n>-1?r.splice(n,1):a=!1}}_addAttributes(r={}){let t={};for(let a in r){let n=r[a],i=this._getGltfAttributeName(a),s=this.addBinaryBuffer(n.value,n);t[i]=s}return t}_addIndices(r){return this.addBinaryBuffer(r,{size:1})}_getGltfAttributeName(r){switch(r.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 r}}_getAccessorMinMax(r,t){let a={min:null,max:null};if(r.length<t)return a;a.min=[],a.max=[];let n=r.subarray(0,t);for(let i of n)a.min.push(i),a.max.push(i);for(let i=t;i<r.length;i+=t)for(let s=0;s<t;s++)a.min[0+s]=Math.min(a.min[0+s],r[i+s]),a.max[0+s]=Math.max(a.max[0+s],r[i+s]);return a}};var b1=1179937895,_1=1313821514,T1=5130562,Me=!0;function $t(e,r,t=0,a={}){let{magic:n=b1,version:i=2,json:s={},binary:o}=e,c=t;r&&(r.setUint32(t+0,n,Me),r.setUint32(t+4,i,Me),r.setUint32(t+8,0,Me));let u=t+8;t+=12;let l=t;r&&(r.setUint32(t+0,0,Me),r.setUint32(t+4,_1,Me)),t+=8;let h=JSON.stringify(s);if(t=Ke(r,t,h,4),r){let f=t-l-8;r.setUint32(l+0,f,Me)}if(o){let f=t;if(r&&(r.setUint32(t+0,0,Me),r.setUint32(t+4,T1,Me)),t+=8,t=wr(r,t,o,4),r){let d=t-f-8;r.setUint32(f+0,d,Me)}}if(r){let f=t-c;r.setUint32(u,f,Me)}return t}function Jt(e,r,t,a){return k1(e),$t(e,r,t,a)}function k1(e,{firstBuffer:r=0}={}){if(e.buffers&&e.buffers.length>r)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Ht={name:"glTF",id:"gltf",module:"gltf",version:Tn,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:O1,options:{gltf:{}}};function O1(e,r={}){let{byteOffset:t=0}=r,a=Jt(e,null,t,r),n=new ArrayBuffer(a),i=new DataView(n);return Jt(e,i,t,r),n}var cs="3.3.0-alpha.2";var vr={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},nv=Object.keys(vr),Ie={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function Ne(e,r,t){let a=12;if(!r)return t+a;let{magic:n,version:i=1,byteLength:s=12}=e;return Ae(Array.isArray(n)&&Number.isFinite(i)&&Number.isFinite(s)),r.setUint8(t+0,n[0]),r.setUint8(t+1,n[1]),r.setUint8(t+2,n[2]),r.setUint8(t+3,n[3]),r.setUint32(t+4,i,!0),r.setUint32(t+8,s,!0),t+=a,t}function Ce(e,r,t){!e||e.setUint32(r+8,t,!0)}function us(e,r,t,a,n){e=Q({magic:Ie.COMPOSITE,tiles:[]},e);let i=t;t+=Ne(e,r,t),r&&r.setUint32(t,e.tiles.length,!0),t+=4;for(let s=0;s<e.tiles.length;++s)t+=n(e.tiles[s],r,t,a);return Ce(r,i,t-i),t}function ls(e,r,t,a){let{featuresLength:n=0,batchTable:i}=e,s={BATCH_LENGTH:n},o=JSON.stringify(s),c=i?JSON.stringify(i):"",u=be(o.length,8),l=c?be(c.length,8):0;e=Q({magic:Ie.BATCHED_MODEL},e);let h=t;t=Ne(e,r,t),r&&(r.setUint32(12,u,!0),r.setUint32(16,0,!0),r.setUint32(20,l,!0),r.setUint32(24,0,!0)),t+=16,t=Ke(r,t,o,8),i&&(t=Ke(r,t,c,8));let f=e.gltfEncoded;return f&&(t=mr(r,t,f,f.byteLength)),Ce(r,h,t-h),t}function fs(e,r,t,a){let{featuresLength:n=1,gltfFormat:i=1,gltfUri:s=""}=e,o=s.length,c={INSTANCES_LENGTH:n,POSITION:new Array(n*3).fill(0)},u=JSON.stringify(c),l=u.length;e=Q({magic:Ie.INSTANCED_MODEL},e);let h=t;return t=Ne(e,r,0),r&&(r.setUint32(12,l,!0),r.setUint32(16,0,!0),r.setUint32(20,0,!0),r.setUint32(24,0,!0),r.setUint32(28,i,!0)),t+=20,t+=er(r,t,u,l),t+=er(r,t,s,o),Ce(r,h,t-h),t}var ed={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function hs(e,r,t,a){let{featureTableJson:n=ed}=e,i=JSON.stringify(n);i=Ot(i,4);let{featureTableJsonByteLength:s=i.length}=e,o=new ArrayBuffer(12),c=o.byteLength;e=Q({magic:Ie.POINT_CLOUD},e);let u=t;return t+=Ne(e,r,0),r&&(r.setUint32(t+0,s,!0),r.setUint32(t+4,c,!0),r.setUint32(t+8,0,!0),r.setUint32(t+12,0,!0)),t+=16,t+=er(r,t,i,s),t+=mr(r,t,o,c),Ce(r,u,t-u),t}function ln(e,r){let t=fn(e,null,0,r),a=new ArrayBuffer(t),n=new DataView(a);return fn(e,n,0,r),a}function fn(e,r,t,a){switch(Ae(typeof e.type=="string"),e.type){case vr.COMPOSITE:return us(e,r,t,a,fn);case vr.POINT_CLOUD:return hs(e,r,t,a);case vr.BATCHED_3D_MODEL:return ls(e,r,t,a);case vr.INSTANCED_3D_MODEL:return fs(e,r,t,a);default:throw new Error("3D Tiles: unknown tile type")}}var hn={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:cs,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:rd,binary:!0,options:{["3d-tiles"]:{}}};function rd(e,r){return ln(e,r)}var He=xn(dr()),ps=xn(os());function ds(e,r){let t=new Float32Array(e.length),a=nd(r);for(let n=0;n<e.length;n+=2){let i=e.subarray(n,n+2),s=a.slice(n*2,n*2+4),o=td([i[0],i[1]]),c=[s[2]-s[0],s[3]-s[1]],u=[o[0]*c[0],o[1]*c[1]],l=[u[0]+s[0],u[1]+s[1]];t[n]=l[0],t[n+1]=l[1]}return t}function td(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function nd(e){let r=65535,t=[];for(let a=0;a<e.length;a++)t[a]=e[a]/r;return t}var ad=new He.Matrix4([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),vs=new He.Vector3,xt=class{async convert(r,t=null){let a=await this.buildGltf(r);return qr({gltfEncoded:new Uint8Array(a),type:"b3dm",featuresLength:this._getFeaturesLength(t),batchTable:t},hn)}async buildGltf(r){let{tileContent:t,textureFormat:a}=r,{material:n,attributes:i,indices:s,cartesianOrigin:o,cartographicOrigin:c,modelMatrix:u}=t,l=new Mr,h=await this._addI3sTextureToGltf(t,a,l),f=this._convertI3sMaterialToGltfMaterial(n,h),d=l.addMaterial(f),p=i.positions,m=p.value;i.uvRegions&&i.texCoords&&(i.texCoords.value=ds(i.texCoords.value,i.uvRegions.value)),i.positions.value=this._normalizePositions(m,o,c,u),i.normals&&!this._checkNormals(i.normals.value)&&delete i.normals;let v=s||this._generateSynteticIndices(m.length/p.size),g=l.addMesh({attributes:i,indices:v,material:d,mode:4}),b=this._generateTransformMatrix(o),y=l.addNode({meshIndex:g,matrix:b}),M=l.addScene({nodeIndices:[y]});return l.setDefaultScene(M),l.createBinaryChunk(),qr(l.gltf,Ht)}async _addI3sTextureToGltf(r,t,a){let{texture:n,material:i,attributes:s}=r,o=null,c=n;if(!n&&i&&(c=i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorTexture&&i.pbrMetallicRoughness.baseColorTexture.texture.source.image),c){let u=this._deduceMimeTypeFromFormat(t),l=a.addImage(c,u);o=a.addTexture({imageIndex:l}),delete s.colors}return o}_normalizePositions(r,t,a,n){let i=new Float32Array(r.length);for(let s=0;s<r.length;s+=3){let o=r.subarray(s,s+3),c=new He.Vector3(t),u=new He.Vector3(Array.from(o)).transform(n).add(a);ps.Ellipsoid.WGS84.cartographicToCartesian(u,vs),u=vs.subtract(c),i.set(u,s)}return i}_generateTransformMatrix(r){return new He.Matrix4().translate(r).multiplyLeft(ad)}_generateBatchId(r){let t=(r[r.length-1]+1)*3,a=new Float32Array(t),n=0,i=0;for(let s=0;s<r.length/2;s++){let o=r[n]*3,c=(r[n+1]+1)*3;a.fill(i,o,c),n+=2,i+=1}return a}_generateSynteticIndices(r){let t=new Uint32Array(r);for(let a=0;a<r;a++)t.set([a],a);return t}_deduceMimeTypeFromFormat(r){switch(r){case"jpg":return"image/jpeg";case"png":return"image/png";case"ktx2":return"image/ktx2";default:return console.warn(`Unexpected texture format in I3S: ${r}`),"image/jpeg"}}_convertI3sMaterialToGltfMaterial(r,t){let a=t!==null;return r?(t!==null&&(r=this._setGltfTexture(r,t)),r):(r={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},a?r.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],r)}_setGltfTexture(r,t){let a=Mn(Q({},r),{pbrMetallicRoughness:Q({},r.pbrMetallicRoughness)});return r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorTexture?a.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:r.emissiveTexture?a.emissiveTexture={index:t,texCoord:0}:r.pbrMetallicRoughness&&r.pbrMetallicRoughness.metallicRoughnessTexture?a.pbrMetallicRoughness.metallicRoughnessTexture={index:t,texCoord:0}:r.normalTexture?a.normalTexture={index:t,texCoord:0}:r.occlusionTexture&&(a.occlusionTexture={index:t,texCoord:0}),a}_getFeaturesLength(r){if(!r)return 0;let t=Object.keys(r)[0];return t?r[t].length:0}_checkNormals(r){return r.find(t=>t)}};var id=new xt;Tt(async(e,r={})=>id.convert(e,r.attributes));
4
4
  //# sourceMappingURL=3d-tiles-attributes-worker.js.map