@takram/three-geospatial 0.0.1-alpha.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/build/index.cjs +1 -1
- package/build/index.cjs.map +1 -1
- package/build/index.js +571 -581
- package/build/index.js.map +1 -1
- package/build/r3f.cjs.map +1 -1
- package/build/r3f.js.map +1 -1
- package/package.json +4 -3
- package/src/TypedArrayLoader.ts +1 -18
- package/src/bufferGeometry.ts +32 -6
- package/src/constants.ts +2 -2
- package/src/r3f/EllipsoidMesh.tsx +5 -7
- package/src/r3f/types.ts +8 -58
- package/src/typedArray.ts +0 -35
- package/types/ArrayBufferLoader.d.ts +0 -1
- package/types/DataLoader.d.ts +5 -6
- package/types/EXR3DLoader.d.ts +0 -1
- package/types/Ellipsoid.d.ts +1 -2
- package/types/EllipsoidGeometry.d.ts +0 -1
- package/types/Geodetic.d.ts +2 -3
- package/types/PointOfView.d.ts +1 -2
- package/types/Rectangle.d.ts +0 -1
- package/types/Texture3DLoader.d.ts +0 -1
- package/types/TilingScheme.d.ts +3 -4
- package/types/TypedArrayLoader.d.ts +3 -10
- package/types/bufferGeometry.d.ts +20 -3
- package/types/decorators.d.ts +0 -1
- package/types/defineShorthand.d.ts +0 -1
- package/types/helpers/projectOnEllipsoidSurface.d.ts +0 -1
- package/types/r3f/EastNorthUpFrame.d.ts +4 -5
- package/types/r3f/EllipsoidMesh.d.ts +4 -5
- package/types/r3f/types.d.ts +3 -17
- package/types/typedArray.d.ts +0 -5
- package/types/typedArrayParsers.d.ts +1 -2
- package/types/types.d.ts +0 -1
package/CHANGELOG.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [0.2.0] - 2025-03-09
|
4
|
+
|
5
|
+
Updated peer dependencies to React 19 and R3F v9. For React 18 and R3F v8, use version 0.1.x, which will continue to receive fixes.
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
- Migrated types and internal fields to R3F v9.
|
10
|
+
- Removed deprecated classes and properties.
|
11
|
+
|
12
|
+
## [0.1.0] - 2025-03-09
|
13
|
+
|
14
|
+
Compatibility release to continue support for React 18 and R3F v8.
|
package/build/index.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("three"),Ie=require("./shared.cjs");var gi=process.env.NODE_ENV==="production",Dr="Invariant failed";function Ar(r,e){if(!r){if(gi)throw new Error(Dr);var i=Dr;throw new Error(i)}}class tn extends S.Loader{load(e,i,o,s){const c=new S.FileLoader(this.manager);c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{Ar(l instanceof ArrayBuffer);try{i(l)}catch(y){s!=null?s(y):console.error(y),this.manager.itemError(e)}},o,s)}}function Si(r){}function Ei(r){var c;const{attributes:e,index:i,boundingBox:o,boundingSphere:s}=r;return[{attributes:e,index:i,boundingBox:o,boundingSphere:s},[...Object.values(r.attributes).map(l=>l.array.buffer),(c=r.index)==null?void 0:c.array.buffer].filter(l=>l!=null)]}function Ii(r,e=new S.BufferGeometry){for(const[i,o]of Object.entries(r.attributes))e.setAttribute(i,new S.BufferAttribute(o.array,o.itemSize,o.normalized));if(e.index=r.index!=null?new S.BufferAttribute(r.index.array,r.index.itemSize,r.index.normalized):null,r.boundingBox!=null){const{min:i,max:o}=r.boundingBox;e.boundingBox=new S.Box3(new S.Vector3(i.x,i.y,i.z),new S.Vector3(o.x,o.y,o.z))}if(r.boundingSphere!=null){const{center:i,radius:o}=r.boundingSphere;e.boundingSphere=new S.Sphere(new S.Vector3(i.x,i.y,i.z),o)}return e}const rn=128,nn=128,on=64,_i="https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/9627216cc50057994c98a2118f3c4a23765d43b9/packages/core/assets/stbn.bin",bi="This is not an object",Ni="This is not a Float16Array object",Br="This constructor is not a subclass of Float16Array",sn="The constructor property value is not an object",Ui="Species constructor didn't return TypedArray object",Oi="Derived constructor created TypedArray object which was too small length",ft="Attempting to access detached ArrayBuffer",cr="Cannot convert undefined or null to object",lr="Cannot mix BigInt and other types, use explicit conversions",zr="@@iterator property is not callable",Hr="Reduce of empty array with no initial value",mi="The comparison function must be either a function or undefined",er="Offset is out of bounds";function Z(r){return(e,...i)=>oe(r,e,i)}function Qe(r,e){return Z(Ve(r,e).get)}const{apply:oe,construct:ut,defineProperty:kr,get:tr,getOwnPropertyDescriptor:Ve,getPrototypeOf:At,has:ur,ownKeys:an,set:Zr,setPrototypeOf:cn}=Reflect,Ci=Proxy,{EPSILON:Ri,MAX_SAFE_INTEGER:Gr,isFinite:ln,isNaN:qe}=Number,{iterator:_e,species:Li,toStringTag:wr,for:Fi}=Symbol,Je=Object,{create:Wt,defineProperty:wt,freeze:xi,is:Wr}=Je,hr=Je.prototype,Mi=hr.__lookupGetter__?Z(hr.__lookupGetter__):(r,e)=>{if(r==null)throw Y(cr);let i=Je(r);do{const o=Ve(i,e);if(o!==void 0)return Re(o,"get")?o.get:void 0}while((i=At(i))!==null)},Re=Je.hasOwn||Z(hr.hasOwnProperty),un=Array,hn=un.isArray,Xt=un.prototype,Pi=Z(Xt.join),Di=Z(Xt.push),Bi=Z(Xt.toLocaleString),Tr=Xt[_e],zi=Z(Tr),{abs:Hi,trunc:fn}=Math,Yt=ArrayBuffer,ki=Yt.isView,yn=Yt.prototype,Zi=Z(yn.slice),Gi=Qe(yn,"byteLength"),fr=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null,Wi=fr&&Qe(fr.prototype,"byteLength"),gr=At(Uint8Array),Xi=gr.from,j=gr.prototype,Yi=j[_e],Vi=Z(j.keys),qi=Z(j.values),Ji=Z(j.entries),$i=Z(j.set),Xr=Z(j.reverse),Qi=Z(j.fill),ji=Z(j.copyWithin),Yr=Z(j.sort),at=Z(j.slice),Ki=Z(j.subarray),Q=Qe(j,"buffer"),Be=Qe(j,"byteOffset"),F=Qe(j,"length"),vn=Qe(j,wr),eo=Uint8Array,le=Uint16Array,Vr=(...r)=>oe(Xi,le,r),Sr=Uint32Array,to=Float32Array,ze=At([][_e]()),Vt=Z(ze.next),ro=Z(function*(){}().next),no=At(ze),io=DataView.prototype,oo=Z(io.getUint16),Y=TypeError,rr=RangeError,pn=WeakSet,dn=pn.prototype,so=Z(dn.add),ao=Z(dn.has),qt=WeakMap,Er=qt.prototype,Bt=Z(Er.get),co=Z(Er.has),Ir=Z(Er.set),An=new qt,lo=Wt(null,{next:{value:function(){const e=Bt(An,this);return Vt(e)}},[_e]:{value:function(){return this}}});function ht(r){if(r[_e]===Tr&&ze.next===Vt)return r;const e=Wt(lo);return Ir(An,e,zi(r)),e}const wn=new qt,Tn=Wt(no,{next:{value:function(){const e=Bt(wn,this);return ro(e)},writable:!0,configurable:!0}});for(const r of an(ze))r!=="next"&&wt(Tn,r,Ve(ze,r));function qr(r){const e=Wt(Tn);return Ir(wn,e,r),e}function zt(r){return r!==null&&typeof r=="object"||typeof r=="function"}function Jr(r){return r!==null&&typeof r=="object"}function Ht(r){return vn(r)!==void 0}function yr(r){const e=vn(r);return e==="BigInt64Array"||e==="BigUint64Array"}function uo(r){try{return hn(r)?!1:(Gi(r),!0)}catch{return!1}}function gn(r){if(fr===null)return!1;try{return Wi(r),!0}catch{return!1}}function ho(r){return uo(r)||gn(r)}function $r(r){return hn(r)?r[_e]===Tr&&ze.next===Vt:!1}function fo(r){return Ht(r)?r[_e]===Yi&&ze.next===Vt:!1}function Rt(r){if(typeof r!="string")return!1;const e=+r;return r!==e+""||!ln(e)?!1:e===fn(e)}const kt=Fi("__Float16Array__");function yo(r){if(!Jr(r))return!1;const e=At(r);if(!Jr(e))return!1;const i=e.constructor;if(i===void 0)return!1;if(!zt(i))throw Y(sn);return ur(i,kt)}const vr=1/Ri;function vo(r){return r+vr-vr}const Sn=6103515625e-14,po=65504,En=.0009765625,Qr=En*Sn,Ao=En*vr;function wo(r){const e=+r;if(!ln(e)||e===0)return e;const i=e>0?1:-1,o=Hi(e);if(o<Sn)return i*vo(o/Qr)*Qr;const s=(1+Ao)*o,c=s-(s-o);return c>po||qe(c)?i*(1/0):i*c}const In=new Yt(4),_n=new to(In),bn=new Sr(In),Ae=new le(512),we=new eo(512);for(let r=0;r<256;++r){const e=r-127;e<-24?(Ae[r]=0,Ae[r|256]=32768,we[r]=24,we[r|256]=24):e<-14?(Ae[r]=1024>>-e-14,Ae[r|256]=1024>>-e-14|32768,we[r]=-e-1,we[r|256]=-e-1):e<=15?(Ae[r]=e+15<<10,Ae[r|256]=e+15<<10|32768,we[r]=13,we[r|256]=13):e<128?(Ae[r]=31744,Ae[r|256]=64512,we[r]=24,we[r|256]=24):(Ae[r]=31744,Ae[r|256]=64512,we[r]=13,we[r|256]=13)}function Ee(r){_n[0]=wo(r);const e=bn[0],i=e>>23&511;return Ae[i]+((e&8388607)>>we[i])}const _r=new Sr(2048);for(let r=1;r<1024;++r){let e=r<<13,i=0;for(;!(e&8388608);)e<<=1,i-=8388608;e&=-8388609,i+=947912704,_r[r]=e|i}for(let r=1024;r<2048;++r)_r[r]=939524096+(r-1024<<13);const je=new Sr(64);for(let r=1;r<31;++r)je[r]=r<<23;je[31]=1199570944;je[32]=2147483648;for(let r=33;r<63;++r)je[r]=2147483648+(r-32<<23);je[63]=3347054592;const Nn=new le(64);for(let r=1;r<64;++r)r!==32&&(Nn[r]=1024);function M(r){const e=r>>10;return bn[0]=_r[Nn[e]+(r&1023)]+je[e],_n[0]}function Ce(r){const e=+r;return qe(e)||e===0?0:fn(e)}function nr(r){const e=Ce(r);return e<0?0:e<Gr?e:Gr}function Lt(r,e){if(!zt(r))throw Y(bi);const i=r.constructor;if(i===void 0)return e;if(!zt(i))throw Y(sn);const o=i[Li];return o??e}function yt(r){if(gn(r))return!1;try{return Zi(r,0,0),!1}catch{}return!0}function jr(r,e){const i=qe(r),o=qe(e);if(i&&o)return 0;if(i)return 1;if(o||r<e)return-1;if(r>e)return 1;if(r===0&&e===0){const s=Wr(r,0),c=Wr(e,0);if(!s&&c)return-1;if(s&&!c)return 1}return 0}const br=2,Zt=new qt;function Ye(r){return co(Zt,r)||!ki(r)&&yo(r)}function L(r){if(!Ye(r))throw Y(Ni)}function Ft(r,e){const i=Ye(r),o=Ht(r);if(!i&&!o)throw Y(Ui);if(typeof e=="number"){let s;if(i){const c=O(r);s=F(c)}else s=F(r);if(s<e)throw Y(Oi)}if(yr(r))throw Y(lr)}function O(r){const e=Bt(Zt,r);if(e!==void 0){const s=Q(e);if(yt(s))throw Y(ft);return e}const i=r.buffer;if(yt(i))throw Y(ft);const o=ut(P,[i,r.byteOffset,r.length],r.constructor);return Bt(Zt,o)}function Kr(r){const e=F(r),i=[];for(let o=0;o<e;++o)i[o]=M(r[o]);return i}const Un=new pn;for(const r of an(j)){if(r===wr)continue;const e=Ve(j,r);Re(e,"get")&&typeof e.get=="function"&&so(Un,e.get)}const To=xi({get(r,e,i){return Rt(e)&&Re(r,e)?M(tr(r,e)):ao(Un,Mi(r,e))?tr(r,e):tr(r,e,i)},set(r,e,i,o){return Rt(e)&&Re(r,e)?Zr(r,e,Ee(i)):Zr(r,e,i,o)},getOwnPropertyDescriptor(r,e){if(Rt(e)&&Re(r,e)){const i=Ve(r,e);return i.value=M(i.value),i}return Ve(r,e)},defineProperty(r,e,i){return Rt(e)&&Re(r,e)&&Re(i,"value")&&(i.value=Ee(i.value)),kr(r,e,i)}});class P{constructor(e,i,o){let s;if(Ye(e))s=ut(le,[O(e)],new.target);else if(zt(e)&&!ho(e)){let l,y;if(Ht(e)){l=e,y=F(e);const v=Q(e);if(yt(v))throw Y(ft);if(yr(e))throw Y(lr);const I=new Yt(y*br);s=ut(le,[I],new.target)}else{const v=e[_e];if(v!=null&&typeof v!="function")throw Y(zr);v!=null?$r(e)?(l=e,y=e.length):(l=[...e],y=l.length):(l=e,y=nr(l.length)),s=ut(le,[y],new.target)}for(let v=0;v<y;++v)s[v]=Ee(l[v])}else s=ut(le,arguments,new.target);const c=new Ci(s,To);return Ir(Zt,c,s),c}static from(e,...i){const o=this;if(!ur(o,kt))throw Y(Br);if(o===P){if(Ye(e)&&i.length===0){const N=O(e),C=new le(Q(N),Be(N),F(N));return new P(Q(at(C)))}if(i.length===0)return new P(Q(Vr(e,Ee)));const v=i[0],I=i[1];return new P(Q(Vr(e,function(N,...C){return Ee(oe(v,this,[N,...ht(C)]))},I)))}let s,c;const l=e[_e];if(l!=null&&typeof l!="function")throw Y(zr);if(l!=null)$r(e)?(s=e,c=e.length):fo(e)?(s=e,c=F(e)):(s=[...e],c=s.length);else{if(e==null)throw Y(cr);s=Je(e),c=nr(s.length)}const y=new o(c);if(i.length===0)for(let v=0;v<c;++v)y[v]=s[v];else{const v=i[0],I=i[1];for(let N=0;N<c;++N)y[N]=oe(v,I,[s[N],N])}return y}static of(...e){const i=this;if(!ur(i,kt))throw Y(Br);const o=e.length;if(i===P){const c=new P(o),l=O(c);for(let y=0;y<o;++y)l[y]=Ee(e[y]);return c}const s=new i(o);for(let c=0;c<o;++c)s[c]=e[c];return s}keys(){L(this);const e=O(this);return Vi(e)}values(){L(this);const e=O(this);return qr(function*(){for(const i of qi(e))yield M(i)}())}entries(){L(this);const e=O(this);return qr(function*(){for(const[i,o]of Ji(e))yield[i,M(o)]}())}at(e){L(this);const i=O(this),o=F(i),s=Ce(e),c=s>=0?s:o+s;if(!(c<0||c>=o))return M(i[c])}with(e,i){L(this);const o=O(this),s=F(o),c=Ce(e),l=c>=0?c:s+c,y=+i;if(l<0||l>=s)throw rr(er);const v=new le(Q(o),Be(o),F(o)),I=new P(Q(at(v))),N=O(I);return N[l]=Ee(y),I}map(e,...i){L(this);const o=O(this),s=F(o),c=i[0],l=Lt(o,P);if(l===P){const v=new P(s),I=O(v);for(let N=0;N<s;++N){const C=M(o[N]);I[N]=Ee(oe(e,c,[C,N,this]))}return v}const y=new l(s);Ft(y,s);for(let v=0;v<s;++v){const I=M(o[v]);y[v]=oe(e,c,[I,v,this])}return y}filter(e,...i){L(this);const o=O(this),s=F(o),c=i[0],l=[];for(let I=0;I<s;++I){const N=M(o[I]);oe(e,c,[N,I,this])&&Di(l,N)}const y=Lt(o,P),v=new y(l);return Ft(v),v}reduce(e,...i){L(this);const o=O(this),s=F(o);if(s===0&&i.length===0)throw Y(Hr);let c,l;i.length===0?(c=M(o[0]),l=1):(c=i[0],l=0);for(let y=l;y<s;++y)c=e(c,M(o[y]),y,this);return c}reduceRight(e,...i){L(this);const o=O(this),s=F(o);if(s===0&&i.length===0)throw Y(Hr);let c,l;i.length===0?(c=M(o[s-1]),l=s-2):(c=i[0],l=s-1);for(let y=l;y>=0;--y)c=e(c,M(o[y]),y,this);return c}forEach(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)oe(e,c,[M(o[l]),l,this])}find(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return y}}findIndex(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return l}return-1}findLast(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=s-1;l>=0;--l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return y}}findLastIndex(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=s-1;l>=0;--l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return l}return-1}every(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)if(!oe(e,c,[M(o[l]),l,this]))return!1;return!0}some(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)if(oe(e,c,[M(o[l]),l,this]))return!0;return!1}set(e,...i){L(this);const o=O(this),s=Ce(i[0]);if(s<0)throw rr(er);if(e==null)throw Y(cr);if(yr(e))throw Y(lr);if(Ye(e))return $i(O(this),O(e),s);if(Ht(e)){const v=Q(e);if(yt(v))throw Y(ft)}const c=F(o),l=Je(e),y=nr(l.length);if(s===1/0||y+s>c)throw rr(er);for(let v=0;v<y;++v)o[v+s]=Ee(l[v])}reverse(){L(this);const e=O(this);return Xr(e),this}toReversed(){L(this);const e=O(this),i=new le(Q(e),Be(e),F(e)),o=new P(Q(at(i))),s=O(o);return Xr(s),o}fill(e,...i){L(this);const o=O(this);return Qi(o,Ee(e),...ht(i)),this}copyWithin(e,i,...o){L(this);const s=O(this);return ji(s,e,i,...ht(o)),this}sort(e){L(this);const i=O(this),o=e!==void 0?e:jr;return Yr(i,(s,c)=>o(M(s),M(c))),this}toSorted(e){L(this);const i=O(this);if(e!==void 0&&typeof e!="function")throw new Y(mi);const o=e!==void 0?e:jr,s=new le(Q(i),Be(i),F(i)),c=new P(Q(at(s))),l=O(c);return Yr(l,(y,v)=>o(M(y),M(v))),c}slice(e,i){L(this);const o=O(this),s=Lt(o,P);if(s===P){const Ze=new le(Q(o),Be(o),F(o));return new P(Q(at(Ze,e,i)))}const c=F(o),l=Ce(e),y=i===void 0?c:Ce(i);let v;l===-1/0?v=0:l<0?v=c+l>0?c+l:0:v=c<l?c:l;let I;y===-1/0?I=0:y<0?I=c+y>0?c+y:0:I=c<y?c:y;const N=I-v>0?I-v:0,C=new s(N);if(Ft(C,N),N===0)return C;const q=Q(o);if(yt(q))throw Y(ft);let se=0;for(;v<I;)C[se]=M(o[v]),++v,++se;return C}subarray(e,i){L(this);const o=O(this),s=Lt(o,P),c=new le(Q(o),Be(o),F(o)),l=Ki(c,e,i),y=new s(Q(l),Be(l),F(l));return Ft(y),y}indexOf(e,...i){L(this);const o=O(this),s=F(o);let c=Ce(i[0]);if(c===1/0)return-1;c<0&&(c+=s,c<0&&(c=0));for(let l=c;l<s;++l)if(Re(o,l)&&M(o[l])===e)return l;return-1}lastIndexOf(e,...i){L(this);const o=O(this),s=F(o);let c=i.length>=1?Ce(i[0]):s-1;if(c===-1/0)return-1;c>=0?c=c<s-1?c:s-1:c+=s;for(let l=c;l>=0;--l)if(Re(o,l)&&M(o[l])===e)return l;return-1}includes(e,...i){L(this);const o=O(this),s=F(o);let c=Ce(i[0]);if(c===1/0)return!1;c<0&&(c+=s,c<0&&(c=0));const l=qe(e);for(let y=c;y<s;++y){const v=M(o[y]);if(l&&qe(v)||v===e)return!0}return!1}join(e){L(this);const i=O(this),o=Kr(i);return Pi(o,e)}toLocaleString(...e){L(this);const i=O(this),o=Kr(i);return Bi(o,...ht(e))}get[wr](){if(Ye(this))return"Float16Array"}}wt(P,"BYTES_PER_ELEMENT",{value:br});wt(P,kt,{});cn(P,gr);const Gt=P.prototype;wt(Gt,"BYTES_PER_ELEMENT",{value:br});wt(Gt,_e,{value:Gt.values,writable:!0,configurable:!0});cn(Gt,j);function go(r,e,...i){return M(oo(r,e,...ht(i)))}function So(r){const e=r instanceof Int8Array?"int8":r instanceof Uint8Array||r instanceof Uint8ClampedArray?"uint8":r instanceof Int16Array?"int16":r instanceof Uint16Array?"uint16":r instanceof Int32Array?"int32":r instanceof Uint32Array?"uint32":r instanceof P?"float16":r instanceof Float32Array?"float32":r instanceof Float64Array?"float64":null;return Ar(e!=null),e}function Eo(r){return r instanceof Int8Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof P||r instanceof Float32Array||r instanceof Float64Array}let xt;function Io(){if(xt!=null)return xt;const r=new Uint32Array([268435456]);return xt=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)[0]===0,xt}function ke(r,e,i,o=!0){if(o===Io())return new e(r);const s=Object.assign(new DataView(r),{getFloat16(l,y){return go(this,l,y)}}),c=new e(s.byteLength/e.BYTES_PER_ELEMENT);for(let l=0,y=0;l<c.length;++l,y+=e.BYTES_PER_ELEMENT)c[l]=s[i](y,o);return c}const On=r=>new Uint8Array(r),_o=r=>new Int8Array(r),mn=(r,e)=>ke(r,Uint16Array,"getUint16",e),Cn=(r,e)=>ke(r,Int16Array,"getInt16",e),bo=(r,e)=>ke(r,Int32Array,"getInt32",e),No=(r,e)=>ke(r,Uint32Array,"getUint32",e),Uo=(r,e)=>ke(r,P,"getFloat16",e),Rn=(r,e)=>ke(r,Float32Array,"getFloat32",e),Oo=(r,e)=>ke(r,Float64Array,"getFloat64",e);class Ln extends S.Loader{load(e,i,o,s){const c=new tn(this.manager);c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{try{i(this.parseTypedArray(l))}catch(y){s!=null?s(y):console.error(y),this.manager.itemError(e)}},o,s)}}function Ke(r){return class extends Ln{constructor(){super(...arguments),this.parseTypedArray=r}}}function mo(r){return new(Ke(r))}const Co=Ke(Cn),Ro=Ke(mn),Lo=Ke(Rn);function Fo(r){const e=r instanceof Int8Array?S.ByteType:r instanceof Uint8Array||r instanceof Uint8ClampedArray?S.UnsignedByteType:r instanceof Int16Array?S.ShortType:r instanceof Uint16Array?S.UnsignedShortType:r instanceof Int32Array?S.IntType:r instanceof Uint32Array?S.UnsignedIntType:r instanceof P?S.HalfFloatType:r instanceof Float32Array||r instanceof Float64Array?S.FloatType:null;return Ar(e!=null),e}const xo={format:S.RGBAFormat,minFilter:S.LinearFilter,magFilter:S.LinearFilter};class Fn extends S.Loader{constructor(){super(...arguments),this.parameters={}}load(e,i,o,s){const c=new this.Texture,l=new this.TypedArrayLoader(this.manager);l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(this.withCredentials),l.load(e,y=>{c.image.data=y instanceof P?new Uint16Array(y.buffer):y;const{width:v,height:I,depth:N,...C}=this.parameters;v!=null&&(c.image.width=v),I!=null&&(c.image.height=I),"depth"in c.image&&N!=null&&(c.image.depth=N),c.type=Fo(y),Object.assign(c,C),c.needsUpdate=!0,i(c)},o,s)}}function xn(r,e,i){return class extends Fn{constructor(){super(...arguments),this.Texture=r,this.TypedArrayLoader=Ke(e),this.parameters={...xo,...i}}}}function Nr(r,e){return xn(S.Data3DTexture,r,e)}function Mn(r,e){return xn(S.DataTexture,r,e)}function Mo(r,e){return new(Nr(r,e))}function Po(r,e){return new(Mn(r,e))}const He=S.MathUtils.clamp,Do=S.MathUtils.euclideanModulo,Bo=S.MathUtils.inverseLerp,zo=S.MathUtils.lerp,Ho=S.MathUtils.degToRad,ko=S.MathUtils.radToDeg,Zo=S.MathUtils.isPowerOfTwo,Go=S.MathUtils.ceilPowerOfTwo,Wo=S.MathUtils.floorPowerOfTwo,Xo=S.MathUtils.normalize;function Yo(r,e,i,o=0,s=1){return S.MathUtils.mapLinear(r,e,i,o,s)}function Vo(r,e,i,o=0,s=1){return He(S.MathUtils.mapLinear(r,e,i,o,s),o,s)}function qo(r,e,i){return i<=r?0:i>=e?1:(i=(i-r)/(e-r),i*i*(3-2*i))}function Jo(r){return Math.min(Math.max(r,0),1)}function $o(r,e,i,o=i){const s=Math.abs(r-e);return s<=o||s<=i*Math.max(Math.abs(r),Math.abs(e))}function Qo(r){return(e,i)=>{e instanceof S.Material?Object.defineProperty(e,i,{enumerable:!0,get(){var o;return((o=this.defines)==null?void 0:o[r])!=null},set(o){var s;o!==this[i]&&(o?(this.defines??(this.defines={}),this.defines[r]="1"):(s=this.defines)==null||delete s[r],this.needsUpdate=!0)}}):Object.defineProperty(e,i,{enumerable:!0,get(){return this.defines.has(r)},set(o){o!==this[i]&&(o?this.defines.set(r,"1"):this.defines.delete(r),this.setChanged())}})}}function jo(r,{min:e=Number.MIN_SAFE_INTEGER,max:i=Number.MAX_SAFE_INTEGER}={}){return(o,s)=>{o instanceof S.Material?Object.defineProperty(o,s,{enumerable:!0,get(){var l;const c=(l=this.defines)==null?void 0:l[r];return c!=null?parseInt(c):0},set(c){const l=this[s];c!==l&&(this.defines??(this.defines={}),this.defines[r]=He(c,e,i).toFixed(0),this.needsUpdate=!0)}}):Object.defineProperty(o,s,{enumerable:!0,get(){const c=this.defines.get(r);return c!=null?parseInt(c):0},set(c){const l=this[s];c!==l&&(this.defines.set(r,He(c,e,i).toFixed(0)),this.setChanged())}})}}function Ko(r,{min:e=-1/0,max:i=1/0,precision:o=7}={}){return(s,c)=>{s instanceof S.Material?Object.defineProperty(s,c,{enumerable:!0,get(){var y;const l=(y=this.defines)==null?void 0:y[r];return l!=null?parseFloat(l):0},set(l){const y=this[c];l!==y&&(this.defines??(this.defines={}),this.defines[r]=He(l,e,i).toFixed(o),this.needsUpdate=!0)}}):Object.defineProperty(s,c,{enumerable:!0,get(){const l=this.defines.get(r);return l!=null?parseFloat(l):0},set(l){const y=this[c];l!==y&&(this.defines.set(r,He(l,e,i).toFixed(o)),this.setChanged())}})}}function es(r,{validate:e}={}){return(i,o)=>{i instanceof S.Material?Object.defineProperty(i,o,{enumerable:!0,get(){var s;return((s=this.defines)==null?void 0:s[r])??""},set(s){if(s!==this[o]){if((e==null?void 0:e(s))===!1){console.error(`Expression validation failed: ${s}`);return}this.defines??(this.defines={}),this.defines[r]=s,this.needsUpdate=!0}}}):Object.defineProperty(i,o,{enumerable:!0,get(){return this.defines.get(r)??""},set(s){if(s!==this[o]){if((e==null?void 0:e(s))===!1){console.error(`Expression validation failed: ${s}`);return}this.defines.set(r,s),this.setChanged()}}})}}function ts(r,...e){const i={};for(let o=0;o<e.length;o+=2){const s=e[o],c=e[o+1];for(const l of c)i[l]={enumerable:!0,get:()=>s[l],set:y=>{s[l]=y}}}return Object.defineProperties(r,i),r}function rs(r,e,i){const o={};for(const s of i)o[s]={enumerable:!0,get:()=>e.uniforms[s].value,set:c=>{e.uniforms[s].value=c}};return Object.defineProperties(r,o),r}const ns=parseInt(S.REVISION.replace(/\D+/g,""));var ve=Uint8Array,xe=Uint16Array,pr=Uint32Array,Pn=new ve([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Dn=new ve([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),is=new ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bn=function(r,e){for(var i=new xe(31),o=0;o<31;++o)i[o]=e+=1<<r[o-1];for(var s=new pr(i[30]),o=1;o<30;++o)for(var c=i[o];c<i[o+1];++c)s[c]=c-i[o]<<5|o;return[i,s]},zn=Bn(Pn,2),Hn=zn[0],os=zn[1];Hn[28]=258,os[258]=28;var ss=Bn(Dn,0),as=ss[0],dr=new xe(32768);for(var W=0;W<32768;++W){var Fe=(W&43690)>>>1|(W&21845)<<1;Fe=(Fe&52428)>>>2|(Fe&13107)<<2,Fe=(Fe&61680)>>>4|(Fe&3855)<<4,dr[W]=((Fe&65280)>>>8|(Fe&255)<<8)>>>1}var vt=function(r,e,i){for(var o=r.length,s=0,c=new xe(e);s<o;++s)++c[r[s]-1];var l=new xe(e);for(s=0;s<e;++s)l[s]=l[s-1]+c[s-1]<<1;var y;if(i){y=new xe(1<<e);var v=15-e;for(s=0;s<o;++s)if(r[s])for(var I=s<<4|r[s],N=e-r[s],C=l[r[s]-1]++<<N,q=C|(1<<N)-1;C<=q;++C)y[dr[C]>>>v]=I}else for(y=new xe(o),s=0;s<o;++s)r[s]&&(y[s]=dr[l[r[s]-1]++]>>>15-r[s]);return y},Tt=new ve(288);for(var W=0;W<144;++W)Tt[W]=8;for(var W=144;W<256;++W)Tt[W]=9;for(var W=256;W<280;++W)Tt[W]=7;for(var W=280;W<288;++W)Tt[W]=8;var kn=new ve(32);for(var W=0;W<32;++W)kn[W]=5;var cs=vt(Tt,9,1),ls=vt(kn,5,1),ir=function(r){for(var e=r[0],i=1;i<r.length;++i)r[i]>e&&(e=r[i]);return e},de=function(r,e,i){var o=e/8|0;return(r[o]|r[o+1]<<8)>>(e&7)&i},or=function(r,e){var i=e/8|0;return(r[i]|r[i+1]<<8|r[i+2]<<16)>>(e&7)},us=function(r){return(r/8|0)+(r&7&&1)},hs=function(r,e,i){(i==null||i>r.length)&&(i=r.length);var o=new(r instanceof xe?xe:r instanceof pr?pr:ve)(i-e);return o.set(r.subarray(e,i)),o},fs=function(r,e,i){var o=r.length;if(!o||i&&!i.l&&o<5)return e||new ve(0);var s=!e||i,c=!i||i.i;i||(i={}),e||(e=new ve(o*3));var l=function(D){var Ne=e.length;if(D>Ne){var Ue=new ve(Math.max(Ne*2,D));Ue.set(e),e=Ue}},y=i.f||0,v=i.p||0,I=i.b||0,N=i.l,C=i.d,q=i.m,se=i.n,Ze=o*8;do{if(!N){i.f=y=de(r,v,1);var gt=de(r,v+1,3);if(v+=3,gt)if(gt==1)N=cs,C=ls,q=9,se=5;else if(gt==2){var It=de(r,v,31)+257,Jt=de(r,v+10,15)+4,$t=It+de(r,v+5,31)+1;v+=14;for(var Ge=new ve($t),_t=new ve(19),ae=0;ae<Jt;++ae)_t[is[ae]]=de(r,v+ae*3,7);v+=Jt*3;for(var bt=ir(_t),Qt=(1<<bt)-1,jt=vt(_t,bt,1),ae=0;ae<$t;){var ue=jt[de(r,v,Qt)];v+=ue&15;var pe=ue>>>4;if(pe<16)Ge[ae++]=pe;else{var be=0,Te=0;for(pe==16?(Te=3+de(r,v,3),v+=2,be=Ge[ae-1]):pe==17?(Te=3+de(r,v,7),v+=3):pe==18&&(Te=11+de(r,v,127),v+=7);Te--;)Ge[ae++]=be}}var Nt=Ge.subarray(0,It),ge=Ge.subarray(It);q=ir(Nt),se=ir(ge),N=vt(Nt,q,1),C=vt(ge,se,1)}else throw"invalid block type";else{var pe=us(v)+4,St=r[pe-4]|r[pe-3]<<8,Et=pe+St;if(Et>o){if(c)throw"unexpected EOF";break}s&&l(I+St),e.set(r.subarray(pe,Et),I),i.b=I+=St,i.p=v=Et*8;continue}if(v>Ze){if(c)throw"unexpected EOF";break}}s&&l(I+131072);for(var Ut=(1<<q)-1,Ot=(1<<se)-1,et=v;;et=v){var be=N[or(r,v)&Ut],te=be>>>4;if(v+=be&15,v>Ze){if(c)throw"unexpected EOF";break}if(!be)throw"invalid length/literal";if(te<256)e[I++]=te;else if(te==256){et=v,N=null;break}else{var We=te-254;if(te>264){var ae=te-257,ne=Pn[ae];We=de(r,v,(1<<ne)-1)+Hn[ae],v+=ne}var Me=C[or(r,v)&Ot],Pe=Me>>>4;if(!Me)throw"invalid distance";v+=Me&15;var ge=as[Pe];if(Pe>3){var ne=Dn[Pe];ge+=or(r,v)&(1<<ne)-1,v+=ne}if(v>Ze){if(c)throw"unexpected EOF";break}s&&l(I+131072);for(var tt=I+We;I<tt;I+=4)e[I]=e[I-ge],e[I+1]=e[I+1-ge],e[I+2]=e[I+2-ge],e[I+3]=e[I+3-ge];I=tt}}i.l=N,i.p=et,i.b=I,N&&(y=1,i.m=q,i.d=C,i.n=se)}while(!y);return I==e.length?e:hs(e,0,I)},ys=new ve(0),vs=function(r){if((r[0]&15)!=8||r[0]>>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Mt(r,e){return fs((vs(r),r.subarray(2,-4)),e)}var ps=typeof TextDecoder<"u"&&new TextDecoder,ds=0;try{ps.decode(ys,{stream:!0}),ds=1}catch{}const ct=ns>=152;class As extends S.DataTextureLoader{constructor(e){super(e),this.type=S.HalfFloatType}parse(e){const bt=Math.pow(2.7182818,2.2);function Qt(t,n){for(var a=0,u=0;u<65536;++u)(u==0||t[u>>3]&1<<(u&7))&&(n[a++]=u);for(var h=a-1;a<65536;)n[a++]=0;return h}function jt(t){for(var n=0;n<16384;n++)t[n]={},t[n].len=0,t[n].lit=0,t[n].p=null}const ue={l:0,c:0,lc:0};function be(t,n,a,u,h){for(;a<t;)n=n<<8|Mr(u,h),a+=8;a-=t,ue.l=n>>a&(1<<t)-1,ue.c=n,ue.lc=a}const Te=new Array(59);function Nt(t){for(var n=0;n<=58;++n)Te[n]=0;for(var n=0;n<65537;++n)Te[t[n]]+=1;for(var a=0,n=58;n>0;--n){var u=a+Te[n]>>1;Te[n]=a,a=u}for(var n=0;n<65537;++n){var h=t[n];h>0&&(t[n]=h|Te[h]++<<6)}}function ge(t,n,a,u,h,f,d){for(var p=a,T=0,w=0;h<=f;h++){if(p.value-a.value>u)return!1;be(6,T,w,t,p);var g=ue.l;if(T=ue.c,w=ue.lc,d[h]=g,g==63){if(p.value-a.value>u)throw"Something wrong with hufUnpackEncTable";be(8,T,w,t,p);var A=ue.l+6;if(T=ue.c,w=ue.lc,h+A>f+1)throw"Something wrong with hufUnpackEncTable";for(;A--;)d[h++]=0;h--}else if(g>=59){var A=g-59+2;if(h+A>f+1)throw"Something wrong with hufUnpackEncTable";for(;A--;)d[h++]=0;h--}}Nt(d)}function Ut(t){return t&63}function Ot(t){return t>>6}function et(t,n,a,u){for(;n<=a;n++){var h=Ot(t[n]),f=Ut(t[n]);if(h>>f)throw"Invalid table entry";if(f>14){var d=u[h>>f-14];if(d.len)throw"Invalid table entry";if(d.lit++,d.p){var p=d.p;d.p=new Array(d.lit);for(var T=0;T<d.lit-1;++T)d.p[T]=p[T]}else d.p=new Array(1);d.p[d.lit-1]=n}else if(f)for(var w=0,T=1<<14-f;T>0;T--){var d=u[(h<<14-f)+w];if(d.len||d.p)throw"Invalid table entry";d.len=f,d.lit=n,w++}}return!0}const te={c:0,lc:0};function We(t,n,a,u){t=t<<8|Mr(a,u),n+=8,te.c=t,te.lc=n}const ne={c:0,lc:0};function Me(t,n,a,u,h,f,d,p,T,w){if(t==n){u<8&&(We(a,u,h,d),a=te.c,u=te.lc),u-=8;var g=a>>u,g=new Uint8Array([g])[0];if(T.value+g>w)return!1;for(var A=p[T.value-1];g-- >0;)p[T.value++]=A}else if(T.value<w)p[T.value++]=t;else return!1;ne.c=a,ne.lc=u}function Pe(t){return t&65535}function tt(t){var n=Pe(t);return n>32767?n-65536:n}const D={a:0,b:0};function Ne(t,n){var a=tt(t),u=tt(n),h=u,f=a+(h&1)+(h>>1),d=f,p=f-h;D.a=d,D.b=p}function Ue(t,n){var a=Pe(t),u=Pe(n),h=a-(u>>1)&65535,f=u+h-32768&65535;D.a=f,D.b=h}function Wn(t,n,a,u,h,f,d){for(var p=d<16384,T=a>h?h:a,w=1,g;w<=T;)w<<=1;for(w>>=1,g=w,w>>=1;w>=1;){for(var A=0,V=A+f*(h-g),_=f*w,b=f*g,U=u*w,m=u*g,B,H,J,re;A<=V;A+=b){for(var k=A,Se=A+u*(a-g);k<=Se;k+=m){var G=k+U,$=k+_,Oe=$+U;p?(Ne(t[k+n],t[$+n]),B=D.a,J=D.b,Ne(t[G+n],t[Oe+n]),H=D.a,re=D.b,Ne(B,H),t[k+n]=D.a,t[G+n]=D.b,Ne(J,re),t[$+n]=D.a,t[Oe+n]=D.b):(Ue(t[k+n],t[$+n]),B=D.a,J=D.b,Ue(t[G+n],t[Oe+n]),H=D.a,re=D.b,Ue(B,H),t[k+n]=D.a,t[G+n]=D.b,Ue(J,re),t[$+n]=D.a,t[Oe+n]=D.b)}if(a&w){var $=k+_;p?Ne(t[k+n],t[$+n]):Ue(t[k+n],t[$+n]),B=D.a,t[$+n]=D.b,t[k+n]=B}}if(h&w)for(var k=A,Se=A+u*(a-g);k<=Se;k+=m){var G=k+U;p?Ne(t[k+n],t[G+n]):Ue(t[k+n],t[G+n]),B=D.a,t[G+n]=D.b,t[k+n]=B}g=w,w>>=1}return A}function Xn(t,n,a,u,h,f,d,p,T,w){for(var g=0,A=0,V=p,_=Math.trunc(h.value+(f+7)/8);h.value<_;)for(We(g,A,a,h),g=te.c,A=te.lc;A>=14;){var b=g>>A-14&16383,U=n[b];if(U.len)A-=U.len,Me(U.lit,d,g,A,a,u,h,T,w,V),g=ne.c,A=ne.lc;else{if(!U.p)throw"hufDecode issues";var m;for(m=0;m<U.lit;m++){for(var B=Ut(t[U.p[m]]);A<B&&h.value<_;)We(g,A,a,h),g=te.c,A=te.lc;if(A>=B&&Ot(t[U.p[m]])==(g>>A-B&(1<<B)-1)){A-=B,Me(U.p[m],d,g,A,a,u,h,T,w,V),g=ne.c,A=ne.lc;break}}if(m==U.lit)throw"hufDecode issues"}}var H=8-f&7;for(g>>=H,A-=H;A>0;){var U=n[g<<14-A&16383];if(U.len)A-=U.len,Me(U.lit,d,g,A,a,u,h,T,w,V),g=ne.c,A=ne.lc;else throw"hufDecode issues"}return!0}function mr(t,n,a,u,h,f){var d={value:0},p=a.value,T=ie(n,a),w=ie(n,a);a.value+=4;var g=ie(n,a);if(a.value+=4,T<0||T>=65537||w<0||w>=65537)throw"Something wrong with HUF_ENCSIZE";var A=new Array(65537),V=new Array(16384);jt(V);var _=u-(a.value-p);if(ge(t,n,a,_,T,w,A),g>8*(u-(a.value-p)))throw"Something wrong with hufUncompress";et(A,T,w,V),Xn(A,V,t,n,a,g,w,f,h,d)}function Yn(t,n,a){for(var u=0;u<a;++u)n[u]=t[n[u]]}function Cr(t){for(var n=1;n<t.length;n++){var a=t[n-1]+t[n]-128;t[n]=a}}function Rr(t,n){for(var a=0,u=Math.floor((t.length+1)/2),h=0,f=t.length-1;!(h>f||(n[h++]=t[a++],h>f));)n[h++]=t[u++]}function Lr(t){for(var n=t.byteLength,a=new Array,u=0,h=new DataView(t);n>0;){var f=h.getInt8(u++);if(f<0){var d=-f;n-=d+1;for(var p=0;p<d;p++)a.push(h.getUint8(u++))}else{var d=f;n-=2;for(var T=h.getUint8(u++),p=0;p<d+1;p++)a.push(T)}}return a}function Vn(t,n,a,u,h,f){var G=new DataView(f.buffer),d=a[t.idx[0]].width,p=a[t.idx[0]].height,T=3,w=Math.floor(d/8),g=Math.ceil(d/8),A=Math.ceil(p/8),V=d-(g-1)*8,_=p-(A-1)*8,b={value:0},U=new Array(T),m=new Array(T),B=new Array(T),H=new Array(T),J=new Array(T);for(let z=0;z<T;++z)J[z]=n[t.idx[z]],U[z]=z<1?0:U[z-1]+g*A,m[z]=new Float32Array(64),B[z]=new Uint16Array(64),H[z]=new Uint16Array(g*64);for(let z=0;z<A;++z){var re=8;z==A-1&&(re=_);var k=8;for(let X=0;X<g;++X){X==g-1&&(k=V);for(let x=0;x<T;++x)B[x].fill(0),B[x][0]=h[U[x]++],qn(b,u,B[x]),Jn(B[x],m[x]),$n(m[x]);Qn(m);for(let x=0;x<T;++x)jn(m[x],H[x],X*64)}let ee=0;for(let X=0;X<T;++X){const x=a[t.idx[X]].type;for(let ye=8*z;ye<8*z+re;++ye){ee=J[X][ye];for(let De=0;De<w;++De){const ce=De*64+(ye&7)*8;G.setUint16(ee+0*2*x,H[X][ce+0],!0),G.setUint16(ee+1*2*x,H[X][ce+1],!0),G.setUint16(ee+2*2*x,H[X][ce+2],!0),G.setUint16(ee+3*2*x,H[X][ce+3],!0),G.setUint16(ee+4*2*x,H[X][ce+4],!0),G.setUint16(ee+5*2*x,H[X][ce+5],!0),G.setUint16(ee+6*2*x,H[X][ce+6],!0),G.setUint16(ee+7*2*x,H[X][ce+7],!0),ee+=8*2*x}}if(w!=g)for(let ye=8*z;ye<8*z+re;++ye){const De=J[X][ye]+8*w*2*x,ce=w*64+(ye&7)*8;for(let Le=0;Le<k;++Le)G.setUint16(De+Le*2*x,H[X][ce+Le],!0)}}}for(var Se=new Uint16Array(d),G=new DataView(f.buffer),$=0;$<T;++$){a[t.idx[$]].decoded=!0;var Oe=a[t.idx[$]].type;if(a[$].type==2)for(var st=0;st<p;++st){const z=J[$][st];for(var fe=0;fe<d;++fe)Se[fe]=G.getUint16(z+fe*2*Oe,!0);for(var fe=0;fe<d;++fe)G.setFloat32(z+fe*2*Oe,E(Se[fe]),!0)}}}function qn(t,n,a){for(var u,h=1;h<64;)u=n[t.value],u==65280?h=64:u>>8==255?h+=u&255:(a[h]=u,h++),t.value++}function Jn(t,n){n[0]=E(t[0]),n[1]=E(t[1]),n[2]=E(t[5]),n[3]=E(t[6]),n[4]=E(t[14]),n[5]=E(t[15]),n[6]=E(t[27]),n[7]=E(t[28]),n[8]=E(t[2]),n[9]=E(t[4]),n[10]=E(t[7]),n[11]=E(t[13]),n[12]=E(t[16]),n[13]=E(t[26]),n[14]=E(t[29]),n[15]=E(t[42]),n[16]=E(t[3]),n[17]=E(t[8]),n[18]=E(t[12]),n[19]=E(t[17]),n[20]=E(t[25]),n[21]=E(t[30]),n[22]=E(t[41]),n[23]=E(t[43]),n[24]=E(t[9]),n[25]=E(t[11]),n[26]=E(t[18]),n[27]=E(t[24]),n[28]=E(t[31]),n[29]=E(t[40]),n[30]=E(t[44]),n[31]=E(t[53]),n[32]=E(t[10]),n[33]=E(t[19]),n[34]=E(t[23]),n[35]=E(t[32]),n[36]=E(t[39]),n[37]=E(t[45]),n[38]=E(t[52]),n[39]=E(t[54]),n[40]=E(t[20]),n[41]=E(t[22]),n[42]=E(t[33]),n[43]=E(t[38]),n[44]=E(t[46]),n[45]=E(t[51]),n[46]=E(t[55]),n[47]=E(t[60]),n[48]=E(t[21]),n[49]=E(t[34]),n[50]=E(t[37]),n[51]=E(t[47]),n[52]=E(t[50]),n[53]=E(t[56]),n[54]=E(t[59]),n[55]=E(t[61]),n[56]=E(t[35]),n[57]=E(t[36]),n[58]=E(t[48]),n[59]=E(t[49]),n[60]=E(t[57]),n[61]=E(t[58]),n[62]=E(t[62]),n[63]=E(t[63])}function $n(t){const n=.5*Math.cos(.7853975),a=.5*Math.cos(3.14159/16),u=.5*Math.cos(3.14159/8),h=.5*Math.cos(3*3.14159/16),f=.5*Math.cos(5*3.14159/16),d=.5*Math.cos(3*3.14159/8),p=.5*Math.cos(7*3.14159/16);for(var T=new Array(4),w=new Array(4),g=new Array(4),A=new Array(4),V=0;V<8;++V){var _=V*8;T[0]=u*t[_+2],T[1]=d*t[_+2],T[2]=u*t[_+6],T[3]=d*t[_+6],w[0]=a*t[_+1]+h*t[_+3]+f*t[_+5]+p*t[_+7],w[1]=h*t[_+1]-p*t[_+3]-a*t[_+5]-f*t[_+7],w[2]=f*t[_+1]-a*t[_+3]+p*t[_+5]+h*t[_+7],w[3]=p*t[_+1]-f*t[_+3]+h*t[_+5]-a*t[_+7],g[0]=n*(t[_+0]+t[_+4]),g[3]=n*(t[_+0]-t[_+4]),g[1]=T[0]+T[3],g[2]=T[1]-T[2],A[0]=g[0]+g[1],A[1]=g[3]+g[2],A[2]=g[3]-g[2],A[3]=g[0]-g[1],t[_+0]=A[0]+w[0],t[_+1]=A[1]+w[1],t[_+2]=A[2]+w[2],t[_+3]=A[3]+w[3],t[_+4]=A[3]-w[3],t[_+5]=A[2]-w[2],t[_+6]=A[1]-w[1],t[_+7]=A[0]-w[0]}for(var b=0;b<8;++b)T[0]=u*t[16+b],T[1]=d*t[16+b],T[2]=u*t[48+b],T[3]=d*t[48+b],w[0]=a*t[8+b]+h*t[24+b]+f*t[40+b]+p*t[56+b],w[1]=h*t[8+b]-p*t[24+b]-a*t[40+b]-f*t[56+b],w[2]=f*t[8+b]-a*t[24+b]+p*t[40+b]+h*t[56+b],w[3]=p*t[8+b]-f*t[24+b]+h*t[40+b]-a*t[56+b],g[0]=n*(t[b]+t[32+b]),g[3]=n*(t[b]-t[32+b]),g[1]=T[0]+T[3],g[2]=T[1]-T[2],A[0]=g[0]+g[1],A[1]=g[3]+g[2],A[2]=g[3]-g[2],A[3]=g[0]-g[1],t[0+b]=A[0]+w[0],t[8+b]=A[1]+w[1],t[16+b]=A[2]+w[2],t[24+b]=A[3]+w[3],t[32+b]=A[3]-w[3],t[40+b]=A[2]-w[2],t[48+b]=A[1]-w[1],t[56+b]=A[0]-w[0]}function Qn(t){for(var n=0;n<64;++n){var a=t[0][n],u=t[1][n],h=t[2][n];t[0][n]=a+1.5747*h,t[1][n]=a-.1873*u-.4682*h,t[2][n]=a+1.8556*u}}function jn(t,n,a){for(var u=0;u<64;++u)n[a+u]=S.DataUtils.toHalfFloat(Kn(t[u]))}function Kn(t){return t<=1?Math.sign(t)*Math.pow(Math.abs(t),2.2):Math.sign(t)*Math.pow(bt,Math.abs(t)-1)}function Fr(t){return new DataView(t.array.buffer,t.offset.value,t.size)}function ei(t){var n=t.viewer.buffer.slice(t.offset.value,t.offset.value+t.size),a=new Uint8Array(Lr(n)),u=new Uint8Array(a.length);return Cr(a),Rr(a,u),new DataView(u.buffer)}function Kt(t){var n=t.array.slice(t.offset.value,t.offset.value+t.size),a=Mt(n),u=new Uint8Array(a.length);return Cr(a),Rr(a,u),new DataView(u.buffer)}function ti(t){for(var n=t.viewer,a={value:t.offset.value},u=new Uint16Array(t.width*t.scanlineBlockSize*(t.channels*t.type)),h=new Uint8Array(8192),f=0,d=new Array(t.channels),p=0;p<t.channels;p++)d[p]={},d[p].start=f,d[p].end=d[p].start,d[p].nx=t.width,d[p].ny=t.lines,d[p].size=t.type,f+=d[p].nx*d[p].ny*d[p].size;var T=nt(n,a),w=nt(n,a);if(w>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(T<=w)for(var p=0;p<w-T+1;p++)h[p+T]=Xe(n,a);var g=new Uint16Array(65536),A=Qt(h,g),V=ie(n,a);mr(t.array,n,a,V,u,f);for(var p=0;p<t.channels;++p)for(var _=d[p],b=0;b<d[p].size;++b)Wn(u,_.start+b,_.nx,_.size,_.ny,_.nx*_.size,A);Yn(g,u,f);for(var U=0,m=new Uint8Array(u.buffer.byteLength),B=0;B<t.lines;B++)for(var H=0;H<t.channels;H++){var _=d[H],J=_.nx*_.size,re=new Uint8Array(u.buffer,_.end*2,J*2);m.set(re,U),U+=J*2,_.end+=J}return new DataView(m.buffer)}function ri(t){var n=t.array.slice(t.offset.value,t.offset.value+t.size),a=Mt(n);const u=t.lines*t.channels*t.width,h=t.type==1?new Uint16Array(u):new Uint32Array(u);let f=0,d=0;const p=new Array(4);for(let T=0;T<t.lines;T++)for(let w=0;w<t.channels;w++){let g=0;switch(t.type){case 1:p[0]=f,p[1]=p[0]+t.width,f=p[1]+t.width;for(let A=0;A<t.width;++A){const V=a[p[0]++]<<8|a[p[1]++];g+=V,h[d]=g,d++}break;case 2:p[0]=f,p[1]=p[0]+t.width,p[2]=p[1]+t.width,f=p[2]+t.width;for(let A=0;A<t.width;++A){const V=a[p[0]++]<<24|a[p[1]++]<<16|a[p[2]++]<<8;g+=V,h[d]=g,d++}break}}return new DataView(h.buffer)}function xr(t){var n=t.viewer,a={value:t.offset.value},u=new Uint8Array(t.width*t.lines*(t.channels*t.type*2)),h={version:he(n,a),unknownUncompressedSize:he(n,a),unknownCompressedSize:he(n,a),acCompressedSize:he(n,a),dcCompressedSize:he(n,a),rleCompressedSize:he(n,a),rleUncompressedSize:he(n,a),rleRawSize:he(n,a),totalAcUncompressedCount:he(n,a),totalDcUncompressedCount:he(n,a),acCompression:he(n,a)};if(h.version<2)throw"EXRLoader.parse: "+ot.compression+" version "+h.version+" is unsupported";for(var f=new Array,d=nt(n,a)-2;d>0;){var p=mt(n.buffer,a),T=Xe(n,a),w=T>>2&3,g=(T>>4)-1,A=new Int8Array([g])[0],V=Xe(n,a);f.push({name:p,index:A,type:V,compression:w}),d-=p.length+3}for(var _=ot.channels,b=new Array(t.channels),U=0;U<t.channels;++U){var m=b[U]={},B=_[U];m.name=B.name,m.compression=0,m.decoded=!1,m.type=B.pixelType,m.pLinear=B.pLinear,m.width=t.width,m.height=t.lines}for(var H={idx:new Array(3)},J=0;J<t.channels;++J)for(var m=b[J],U=0;U<f.length;++U){var re=f[U];m.name==re.name&&(m.compression=re.compression,re.index>=0&&(H.idx[re.index]=J),m.offset=J)}if(h.acCompressedSize>0)switch(h.acCompression){case 0:var G=new Uint16Array(h.totalAcUncompressedCount);mr(t.array,n,a,h.acCompressedSize,G,h.totalAcUncompressedCount);break;case 1:var k=t.array.slice(a.value,a.value+h.totalAcUncompressedCount),Se=Mt(k),G=new Uint16Array(Se.buffer);a.value+=h.totalAcUncompressedCount;break}if(h.dcCompressedSize>0){var $={array:t.array,offset:a,size:h.dcCompressedSize},Oe=new Uint16Array(Kt($).buffer);a.value+=h.dcCompressedSize}if(h.rleRawSize>0){var k=t.array.slice(a.value,a.value+h.rleCompressedSize),Se=Mt(k),st=Lr(Se.buffer);a.value+=h.rleCompressedSize}for(var fe=0,z=new Array(b.length),U=0;U<z.length;++U)z[U]=new Array;for(var ee=0;ee<t.lines;++ee)for(var X=0;X<b.length;++X)z[X].push(fe),fe+=b[X].width*t.type*2;Vn(H,z,b,G,Oe,u);for(var U=0;U<b.length;++U){var m=b[U];if(!m.decoded)switch(m.compression){case 2:for(var x=0,ye=0,ee=0;ee<t.lines;++ee){for(var De=z[U][x],ce=0;ce<m.width;++ce){for(var Le=0;Le<2*m.type;++Le)u[De++]=st[ye+Le*m.width*m.height];ye++}x++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(u.buffer)}function mt(t,n){for(var a=new Uint8Array(t),u=0;a[n.value+u]!=0;)u+=1;var h=new TextDecoder().decode(a.slice(n.value,n.value+u));return n.value=n.value+u+1,h}function ni(t,n,a){var u=new TextDecoder().decode(new Uint8Array(t).slice(n.value,n.value+a));return n.value=n.value+a,u}function ii(t,n){var a=rt(t,n),u=ie(t,n);return[a,u]}function oi(t,n){var a=ie(t,n),u=ie(t,n);return[a,u]}function rt(t,n){var a=t.getInt32(n.value,!0);return n.value=n.value+4,a}function ie(t,n){var a=t.getUint32(n.value,!0);return n.value=n.value+4,a}function Mr(t,n){var a=t[n.value];return n.value=n.value+1,a}function Xe(t,n){var a=t.getUint8(n.value);return n.value=n.value+1,a}const he=function(t,n){let a;return"getBigInt64"in DataView.prototype?a=Number(t.getBigInt64(n.value,!0)):a=t.getUint32(n.value+4,!0)+Number(t.getUint32(n.value,!0)<<32),n.value+=8,a};function K(t,n){var a=t.getFloat32(n.value,!0);return n.value+=4,a}function si(t,n){return S.DataUtils.toHalfFloat(K(t,n))}function E(t){var n=(t&31744)>>10,a=t&1023;return(t>>15?-1:1)*(n?n===31?a?NaN:1/0:Math.pow(2,n-15)*(1+a/1024):6103515625e-14*(a/1024))}function nt(t,n){var a=t.getUint16(n.value,!0);return n.value+=2,a}function ai(t,n){return E(nt(t,n))}function ci(t,n,a,u){for(var h=a.value,f=[];a.value<h+u-1;){var d=mt(n,a),p=rt(t,a),T=Xe(t,a);a.value+=3;var w=rt(t,a),g=rt(t,a);f.push({name:d,pixelType:p,pLinear:T,xSampling:w,ySampling:g})}return a.value+=1,f}function li(t,n){var a=K(t,n),u=K(t,n),h=K(t,n),f=K(t,n),d=K(t,n),p=K(t,n),T=K(t,n),w=K(t,n);return{redX:a,redY:u,greenX:h,greenY:f,blueX:d,blueY:p,whiteX:T,whiteY:w}}function ui(t,n){var a=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],u=Xe(t,n);return a[u]}function hi(t,n){var a=ie(t,n),u=ie(t,n),h=ie(t,n),f=ie(t,n);return{xMin:a,yMin:u,xMax:h,yMax:f}}function fi(t,n){var a=["INCREASING_Y"],u=Xe(t,n);return a[u]}function yi(t,n){var a=K(t,n),u=K(t,n);return[a,u]}function vi(t,n){var a=K(t,n),u=K(t,n),h=K(t,n);return[a,u,h]}function pi(t,n,a,u,h){if(u==="string"||u==="stringvector"||u==="iccProfile")return ni(n,a,h);if(u==="chlist")return ci(t,n,a,h);if(u==="chromaticities")return li(t,a);if(u==="compression")return ui(t,a);if(u==="box2i")return hi(t,a);if(u==="lineOrder")return fi(t,a);if(u==="float")return K(t,a);if(u==="v2f")return yi(t,a);if(u==="v3f")return vi(t,a);if(u==="int")return rt(t,a);if(u==="rational")return ii(t,a);if(u==="timecode")return oi(t,a);if(u==="preview")return a.value+=h,"skipped";a.value+=h}function di(t,n,a){const u={};if(t.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";u.version=t.getUint8(4);const h=t.getUint8(5);u.spec={singleTile:!!(h&2),longName:!!(h&4),deepFormat:!!(h&8),multiPart:!!(h&16)},a.value=8;for(var f=!0;f;){var d=mt(n,a);if(d==0)f=!1;else{var p=mt(n,a),T=ie(t,a),w=pi(t,n,a,p,T);w===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${p}'.`):u[d]=w}}if(h&-5)throw console.error("EXRHeader:",u),"THREE.EXRLoader: provided file is currently unsupported.";return u}function Ai(t,n,a,u,h){const f={size:0,viewer:n,array:a,offset:u,width:t.dataWindow.xMax-t.dataWindow.xMin+1,height:t.dataWindow.yMax-t.dataWindow.yMin+1,channels:t.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:t.channels[0].pixelType,uncompress:null,getter:null,format:null,[ct?"colorSpace":"encoding"]:null};switch(t.compression){case"NO_COMPRESSION":f.lines=1,f.uncompress=Fr;break;case"RLE_COMPRESSION":f.lines=1,f.uncompress=ei;break;case"ZIPS_COMPRESSION":f.lines=1,f.uncompress=Kt;break;case"ZIP_COMPRESSION":f.lines=16,f.uncompress=Kt;break;case"PIZ_COMPRESSION":f.lines=32,f.uncompress=ti;break;case"PXR24_COMPRESSION":f.lines=16,f.uncompress=ri;break;case"DWAA_COMPRESSION":f.lines=32,f.uncompress=xr;break;case"DWAB_COMPRESSION":f.lines=256,f.uncompress=xr;break;default:throw"EXRLoader.parse: "+t.compression+" is unsupported"}if(f.scanlineBlockSize=f.lines,f.type==1)switch(h){case S.FloatType:f.getter=ai,f.inputSize=2;break;case S.HalfFloatType:f.getter=nt,f.inputSize=2;break}else if(f.type==2)switch(h){case S.FloatType:f.getter=K,f.inputSize=4;break;case S.HalfFloatType:f.getter=si,f.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+f.type+" for "+t.compression+".";f.blockCount=(t.dataWindow.yMax+1)/f.scanlineBlockSize;for(var d=0;d<f.blockCount;d++)he(n,u);f.outputChannels=f.channels==3?4:f.channels;const p=f.width*f.height*f.outputChannels;switch(h){case S.FloatType:f.byteArray=new Float32Array(p),f.channels<f.outputChannels&&f.byteArray.fill(1,0,p);break;case S.HalfFloatType:f.byteArray=new Uint16Array(p),f.channels<f.outputChannels&&f.byteArray.fill(15360,0,p);break;default:console.error("THREE.EXRLoader: unsupported type: ",h);break}return f.bytesPerLine=f.width*f.inputSize*f.channels,f.outputChannels==4?f.format=S.RGBAFormat:f.format=S.RedFormat,ct?f.colorSpace="srgb-linear":f.encoding=3e3,f}const Ct=new DataView(e),wi=new Uint8Array(e),it={value:0},ot=di(Ct,e,it),R=Ai(ot,Ct,wi,it,this.type),Pr={value:0},Ti={R:0,G:1,B:2,A:3,Y:0};for(let t=0;t<R.height/R.scanlineBlockSize;t++){const n=ie(Ct,it);R.size=ie(Ct,it),R.lines=n+R.scanlineBlockSize>R.height?R.height-n:R.scanlineBlockSize;const u=R.size<R.lines*R.bytesPerLine?R.uncompress(R):Fr(R);it.value+=R.size;for(let h=0;h<R.scanlineBlockSize;h++){const f=h+t*R.scanlineBlockSize;if(f>=R.height)break;for(let d=0;d<R.channels;d++){const p=Ti[ot.channels[d].name];for(let T=0;T<R.width;T++){Pr.value=(h*(R.channels*R.width)+d*R.width+T)*R.inputSize;const w=(R.height-1-f)*(R.width*R.outputChannels)+T*R.outputChannels+p;R.byteArray[w]=R.getter(u,Pr)}}}}return{header:ot,width:R.width,height:R.height,data:R.byteArray,format:R.format,[ct?"colorSpace":"encoding"]:R[ct?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,i,o,s){function c(l,y){ct?l.colorSpace=y.colorSpace:l.encoding=y.encoding,l.minFilter=S.LinearFilter,l.magFilter=S.LinearFilter,l.generateMipmaps=!1,l.flipY=!1,i&&i(l,y)}return super.load(e,c,o,s)}}class ws extends S.Loader{setDepth(e){return this.depth=e,this}load(e,i,o,s){const c=new As(this.manager);c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{const{data:y,width:v,height:I}=l.image,N=this.depth??Math.sqrt(I),C=new S.Data3DTexture(y,v,I/N,N);C.type=l.type,C.format=l.format,C.colorSpace=l.colorSpace,C.needsUpdate=!0;try{i(C)}catch(q){s!=null?s(q):console.error(q),this.manager.itemError(e)}},o,s)}}const sr=1e-6,Pt=new S.Vector3,Dt=new S.Vector3,me=new S.Vector3,lt=new S.Vector3,ar=new S.Vector3,Ts=new S.Vector3,gs=new S.Matrix4,Ss=new S.Quaternion,Es=new S.Ray;class Ur{constructor(e=0,i=0,o=0,s=0){this.distance=e,this.heading=i,this.pitch=o,this.roll=s}get distance(){return this._distance}set distance(e){this._distance=Math.max(e,sr)}get pitch(){return this._pitch}set pitch(e){this._pitch=He(e,-Math.PI/2+sr,Math.PI/2-sr)}set(e,i,o,s){return this.distance=e,this.heading=i,this.pitch=o,s!=null&&(this.roll=s),this}clone(){return new Ur(this.distance,this.heading,this.pitch,this.roll)}copy(e){return this.distance=e.distance,this.heading=e.heading,this.pitch=e.pitch,this.roll=e.roll,this}equals(e){return e.distance===this.distance&&e.heading===this.heading&&e.pitch===this.pitch&&e.roll===this.roll}decompose(e,i,o,s,c=Ie.Ellipsoid.WGS84){c.getEastNorthUpVectors(e,Pt,Dt,me),s==null||s.copy(me);const l=lt.copy(Pt).multiplyScalar(Math.cos(this.heading)).add(ar.copy(Dt).multiplyScalar(Math.sin(this.heading))).multiplyScalar(Math.cos(this.pitch)).add(ar.copy(me).multiplyScalar(Math.sin(this.pitch))).normalize().multiplyScalar(this.distance);if(i.copy(e).sub(l),this.roll!==0){const y=lt.copy(e).sub(i).normalize();me.applyQuaternion(Ss.setFromAxisAngle(y,this.roll))}o.setFromRotationMatrix(gs.lookAt(i,e,me))}setFromCamera(e,i=Ie.Ellipsoid.WGS84){const o=lt.setFromMatrixPosition(e.matrixWorld),s=ar.set(0,0,.5).unproject(e).sub(o).normalize(),c=i.getIntersection(Es.set(o,s));if(c==null)return;this.distance=o.distanceTo(c),i.getEastNorthUpVectors(c,Pt,Dt,me),this.heading=Math.atan2(Dt.dot(s),Pt.dot(s)),this.pitch=Math.asin(me.dot(s));const l=lt.copy(e.up).applyQuaternion(e.quaternion),y=Ts.copy(s).multiplyScalar(-l.dot(s)).add(l).normalize(),v=lt.copy(s).multiplyScalar(-me.dot(s)).add(me).normalize(),I=v.dot(y),N=s.dot(v.cross(y));return this.roll=Math.atan2(N,I),this}}const pt=class pt{constructor(e=0,i=0,o=0,s=0){this.west=e,this.south=i,this.east=o,this.north=s}get width(){let e=this.east;return e<this.west&&(e+=Math.PI*2),e-this.west}get height(){return this.north-this.south}set(e,i,o,s){return this.west=e,this.south=i,this.east=o,this.north=s,this}clone(){return new pt(this.west,this.south,this.east,this.north)}copy(e){return this.west=e.west,this.south=e.south,this.east=e.east,this.north=e.north,this}equals(e){return e.west===this.west&&e.south===this.south&&e.east===this.east&&e.north===this.north}at(e,i,o=new Ie.Geodetic){return o.set(this.west+(this.east-this.west)*e,this.north+(this.south-this.north)*i)}fromArray(e,i=0){return this.west=e[i],this.south=e[i+1],this.east=e[i+2],this.north=e[i+3],this}toArray(e=[],i=0){return e[i]=this.west,e[i+1]=this.south,e[i+2]=this.east,e[i+3]=this.north,e}*[Symbol.iterator](){yield this.west,yield this.south,yield this.east,yield this.north}};pt.MAX=new pt(Ie.Geodetic.MIN_LONGITUDE,Ie.Geodetic.MIN_LATITUDE,Ie.Geodetic.MAX_LONGITUDE,Ie.Geodetic.MAX_LATITUDE);let dt=pt;const Is=/^[ \t]*#include +"([\w\d./]+)"/gm;function Zn(r,e){return r.replace(Is,(i,o)=>{const c=o.split("/").reduce((l,y)=>typeof l!="string"&&l!=null?l[y]:void 0,e);if(typeof c!="string")throw new Error(`Could not find include for ${o}.`);return Zn(c,e)})}const _s=Nr(On,{format:S.RedFormat,minFilter:S.NearestFilter,magFilter:S.NearestFilter,wrapS:S.RepeatWrapping,wrapT:S.RepeatWrapping,wrapR:S.RepeatWrapping,width:rn,height:nn,depth:on});function*Gn(r,e,i,o,s){if(i>=o)return;const c=2**i,l=i+1,y=2**l,v=Math.floor(r/c*y),I=Math.floor(e/c*y),N=[[v,I,l],[v+1,I,l],[v,I+1,l],[v+1,I+1,l]];if(l<o)for(const C of N)for(const q of Gn(...C,o,s))yield q;else for(const C of N)yield(s??new $e).set(...C)}class $e{constructor(e=0,i=0,o=0){this.x=e,this.y=i,this.z=o}set(e,i,o){return this.x=e,this.y=i,o!=null&&(this.z=o),this}clone(){return new $e(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}getParent(e=new $e){const i=2**this.z,o=this.x/i,s=this.y/i,c=this.z-1,l=2**c;return e.set(Math.floor(o*l),Math.floor(s*l),c)}*traverseChildren(e,i){const{x:o,y:s,z:c}=this;for(const l of Gn(o,s,c,c+e,i))yield l}fromArray(e,i=0){return this.x=e[i],this.y=e[i+1],this.z=e[i+2],this}toArray(e=[],i=0){return e[i]=this.x,e[i+1]=this.y,e[i+2]=this.z,e}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const en=new S.Vector2;class Or{constructor(e=2,i=1,o=dt.MAX){this.width=e,this.height=i,this.rectangle=o}clone(){return new Or(this.width,this.height,this.rectangle.clone())}copy(e){return this.width=e.width,this.height=e.height,this.rectangle.copy(e.rectangle),this}getSize(e,i=new S.Vector2){return i.set(this.width<<e,this.height<<e)}getTile(e,i,o=new $e){const s=this.getSize(i,en),{rectangle:c}=this,l=c.width/s.x,y=c.height/s.y,{west:v,south:I,east:N}=c;let C=e.longitude;N<v&&(C+=Math.PI*2);let q=Math.floor((C-v)/l);q>=s.x&&(q=s.x-1);let se=Math.floor((e.latitude-I)/y);return se>=s.y&&(se=s.y-1),o.x=q,o.y=se,o.z=i,o}getRectangle(e,i=new dt){const o=this.getSize(e.z,en),{rectangle:s}=this,c=s.width/o.x,l=s.height/o.y,{west:y,north:v}=s;return i.west=e.x*c+y,i.east=(e.x+1)*c+y,i.north=v-(o.y-e.y-1)*l,i.south=v-(o.y-e.y)*l,i}}const bs=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*(?:i\s*\+\+|\+\+\s*i)\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Ns(r,e,i,o){let s="";for(let c=parseInt(e);c<parseInt(i);++c)s+=o.replace(/\[\s*i\s*\]/g,"["+c+"]").replace(/UNROLLED_LOOP_INDEX/g,`${c}`);return s}function Us(r){return r.replace(bs,Ns)}exports.Ellipsoid=Ie.Ellipsoid;exports.EllipsoidGeometry=Ie.EllipsoidGeometry;exports.Geodetic=Ie.Geodetic;exports.ArrayBufferLoader=tn;exports.DEFAULT_STBN_URL=_i;exports.DataLoader=Fn;exports.EXR3DLoader=ws;exports.Float16Array=P;exports.Float32ArrayLoader=Lo;exports.Int16ArrayLoader=Co;exports.PointOfView=Ur;exports.Rectangle=dt;exports.STBNLoader=_s;exports.STBN_TEXTURE_DEPTH=on;exports.STBN_TEXTURE_HEIGHT=nn;exports.STBN_TEXTURE_WIDTH=rn;exports.TileCoordinate=$e;exports.TilingScheme=Or;exports.TypedArrayLoader=Ln;exports.Uint16ArrayLoader=Ro;exports.assertType=Si;exports.ceilPowerOfTwo=Go;exports.clamp=He;exports.closeTo=$o;exports.createData3DTextureLoader=Mo;exports.createData3DTextureLoaderClass=Nr;exports.createDataTextureLoader=Po;exports.createDataTextureLoaderClass=Mn;exports.createTypedArrayLoader=mo;exports.createTypedArrayLoaderClass=Ke;exports.define=Qo;exports.defineExpression=es;exports.defineFloat=Ko;exports.defineInt=jo;exports.definePropertyShorthand=ts;exports.defineUniformShorthand=rs;exports.degrees=ko;exports.euclideanModulo=Do;exports.floorPowerOfTwo=Wo;exports.fromBufferGeometryLike=Ii;exports.getTypedArrayElementType=So;exports.inverseLerp=Bo;exports.isPowerOfTwo=Zo;exports.isTypedArray=Eo;exports.lerp=zo;exports.normalize=Xo;exports.parseFloat16Array=Uo;exports.parseFloat32Array=Rn;exports.parseFloat64Array=Oo;exports.parseInt16Array=Cn;exports.parseInt32Array=bo;exports.parseInt8Array=_o;exports.parseUint16Array=mn;exports.parseUint32Array=No;exports.parseUint8Array=On;exports.radians=Ho;exports.remap=Yo;exports.remapClamped=Vo;exports.resolveIncludes=Zn;exports.saturate=Jo;exports.smoothstep=qo;exports.toBufferGeometryLike=Ei;exports.unrollLoops=Us;
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("three"),Ie=require("./shared.cjs");var wi=process.env.NODE_ENV==="production",Pr="Invariant failed";function en(r,e){if(!r){if(wi)throw new Error(Pr);var i=Pr;throw new Error(i)}}class tn extends S.Loader{load(e,i,o,s){const c=new S.FileLoader(this.manager);c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{en(l instanceof ArrayBuffer);try{i(l)}catch(y){s!=null?s(y):console.error(y),this.manager.itemError(e)}},o,s)}}function Ai(r){}function Ti(r){var c;const{attributes:e,index:i,boundingBox:o,boundingSphere:s}=r;return[{attributes:e,index:i,boundingBox:o,boundingSphere:s},[...Object.values(r.attributes).map(l=>l.array.buffer),(c=r.index)==null?void 0:c.array.buffer].filter(l=>l!=null)]}function gi(r,e=new S.BufferGeometry){for(const[i,o]of Object.entries(r.attributes))e.setAttribute(i,new S.BufferAttribute(o.array,o.itemSize,o.normalized));if(e.index=r.index!=null?new S.BufferAttribute(r.index.array,r.index.itemSize,r.index.normalized):null,r.boundingBox!=null){const{min:i,max:o}=r.boundingBox;e.boundingBox=new S.Box3(new S.Vector3(i.x,i.y,i.z),new S.Vector3(o.x,o.y,o.z))}if(r.boundingSphere!=null){const{center:i,radius:o}=r.boundingSphere;e.boundingSphere=new S.Sphere(new S.Vector3(i.x,i.y,i.z),o)}return e}const rn=128,nn=128,on=64,Si="9627216cc50057994c98a2118f3c4a23765d43b9",Ei=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${Si}/packages/core/assets/stbn.bin`,Ii="This is not an object",_i="This is not a Float16Array object",Dr="This constructor is not a subclass of Float16Array",sn="The constructor property value is not an object",bi="Species constructor didn't return TypedArray object",Ni="Derived constructor created TypedArray object which was too small length",ht="Attempting to access detached ArrayBuffer",ar="Cannot convert undefined or null to object",cr="Cannot mix BigInt and other types, use explicit conversions",Br="@@iterator property is not callable",zr="Reduce of empty array with no initial value",Ui="The comparison function must be either a function or undefined",Kt="Offset is out of bounds";function Z(r){return(e,...i)=>oe(r,e,i)}function Qe(r,e){return Z(Ve(r,e).get)}const{apply:oe,construct:lt,defineProperty:Hr,get:er,getOwnPropertyDescriptor:Ve,getPrototypeOf:dt,has:lr,ownKeys:an,set:kr,setPrototypeOf:cn}=Reflect,Oi=Proxy,{EPSILON:mi,MAX_SAFE_INTEGER:Zr,isFinite:ln,isNaN:qe}=Number,{iterator:_e,species:Ci,toStringTag:dr,for:Ri}=Symbol,Je=Object,{create:Gt,defineProperty:wt,freeze:Li,is:Gr}=Je,ur=Je.prototype,Fi=ur.__lookupGetter__?Z(ur.__lookupGetter__):(r,e)=>{if(r==null)throw Y(ar);let i=Je(r);do{const o=Ve(i,e);if(o!==void 0)return Re(o,"get")?o.get:void 0}while((i=dt(i))!==null)},Re=Je.hasOwn||Z(ur.hasOwnProperty),un=Array,hn=un.isArray,Wt=un.prototype,xi=Z(Wt.join),Mi=Z(Wt.push),Pi=Z(Wt.toLocaleString),wr=Wt[_e],Di=Z(wr),{abs:Bi,trunc:fn}=Math,Xt=ArrayBuffer,zi=Xt.isView,yn=Xt.prototype,Hi=Z(yn.slice),ki=Qe(yn,"byteLength"),hr=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null,Zi=hr&&Qe(hr.prototype,"byteLength"),Ar=dt(Uint8Array),Gi=Ar.from,j=Ar.prototype,Wi=j[_e],Xi=Z(j.keys),Yi=Z(j.values),Vi=Z(j.entries),qi=Z(j.set),Wr=Z(j.reverse),Ji=Z(j.fill),$i=Z(j.copyWithin),Xr=Z(j.sort),st=Z(j.slice),Qi=Z(j.subarray),Q=Qe(j,"buffer"),Be=Qe(j,"byteOffset"),F=Qe(j,"length"),vn=Qe(j,dr),ji=Uint8Array,le=Uint16Array,Yr=(...r)=>oe(Gi,le,r),Tr=Uint32Array,Ki=Float32Array,ze=dt([][_e]()),Yt=Z(ze.next),eo=Z(function*(){}().next),to=dt(ze),ro=DataView.prototype,no=Z(ro.getUint16),Y=TypeError,tr=RangeError,pn=WeakSet,dn=pn.prototype,io=Z(dn.add),oo=Z(dn.has),Vt=WeakMap,gr=Vt.prototype,Dt=Z(gr.get),so=Z(gr.has),Sr=Z(gr.set),wn=new Vt,ao=Gt(null,{next:{value:function(){const e=Dt(wn,this);return Yt(e)}},[_e]:{value:function(){return this}}});function ut(r){if(r[_e]===wr&&ze.next===Yt)return r;const e=Gt(ao);return Sr(wn,e,Di(r)),e}const An=new Vt,Tn=Gt(to,{next:{value:function(){const e=Dt(An,this);return eo(e)},writable:!0,configurable:!0}});for(const r of an(ze))r!=="next"&&wt(Tn,r,Ve(ze,r));function Vr(r){const e=Gt(Tn);return Sr(An,e,r),e}function Bt(r){return r!==null&&typeof r=="object"||typeof r=="function"}function qr(r){return r!==null&&typeof r=="object"}function zt(r){return vn(r)!==void 0}function fr(r){const e=vn(r);return e==="BigInt64Array"||e==="BigUint64Array"}function co(r){try{return hn(r)?!1:(ki(r),!0)}catch{return!1}}function gn(r){if(hr===null)return!1;try{return Zi(r),!0}catch{return!1}}function lo(r){return co(r)||gn(r)}function Jr(r){return hn(r)?r[_e]===wr&&ze.next===Yt:!1}function uo(r){return zt(r)?r[_e]===Wi&&ze.next===Yt:!1}function Ct(r){if(typeof r!="string")return!1;const e=+r;return r!==e+""||!ln(e)?!1:e===fn(e)}const Ht=Ri("__Float16Array__");function ho(r){if(!qr(r))return!1;const e=dt(r);if(!qr(e))return!1;const i=e.constructor;if(i===void 0)return!1;if(!Bt(i))throw Y(sn);return lr(i,Ht)}const yr=1/mi;function fo(r){return r+yr-yr}const Sn=6103515625e-14,yo=65504,En=.0009765625,$r=En*Sn,vo=En*yr;function po(r){const e=+r;if(!ln(e)||e===0)return e;const i=e>0?1:-1,o=Bi(e);if(o<Sn)return i*fo(o/$r)*$r;const s=(1+vo)*o,c=s-(s-o);return c>yo||qe(c)?i*(1/0):i*c}const In=new Xt(4),_n=new Ki(In),bn=new Tr(In),we=new le(512),Ae=new ji(512);for(let r=0;r<256;++r){const e=r-127;e<-24?(we[r]=0,we[r|256]=32768,Ae[r]=24,Ae[r|256]=24):e<-14?(we[r]=1024>>-e-14,we[r|256]=1024>>-e-14|32768,Ae[r]=-e-1,Ae[r|256]=-e-1):e<=15?(we[r]=e+15<<10,we[r|256]=e+15<<10|32768,Ae[r]=13,Ae[r|256]=13):e<128?(we[r]=31744,we[r|256]=64512,Ae[r]=24,Ae[r|256]=24):(we[r]=31744,we[r|256]=64512,Ae[r]=13,Ae[r|256]=13)}function Ee(r){_n[0]=po(r);const e=bn[0],i=e>>23&511;return we[i]+((e&8388607)>>Ae[i])}const Er=new Tr(2048);for(let r=1;r<1024;++r){let e=r<<13,i=0;for(;(e&8388608)===0;)e<<=1,i-=8388608;e&=-8388609,i+=947912704,Er[r]=e|i}for(let r=1024;r<2048;++r)Er[r]=939524096+(r-1024<<13);const je=new Tr(64);for(let r=1;r<31;++r)je[r]=r<<23;je[31]=1199570944;je[32]=2147483648;for(let r=33;r<63;++r)je[r]=2147483648+(r-32<<23);je[63]=3347054592;const Nn=new le(64);for(let r=1;r<64;++r)r!==32&&(Nn[r]=1024);function M(r){const e=r>>10;return bn[0]=Er[Nn[e]+(r&1023)]+je[e],_n[0]}function Ce(r){const e=+r;return qe(e)||e===0?0:fn(e)}function rr(r){const e=Ce(r);return e<0?0:e<Zr?e:Zr}function Rt(r,e){if(!Bt(r))throw Y(Ii);const i=r.constructor;if(i===void 0)return e;if(!Bt(i))throw Y(sn);const o=i[Ci];return o??e}function ft(r){if(gn(r))return!1;try{return Hi(r,0,0),!1}catch{}return!0}function Qr(r,e){const i=qe(r),o=qe(e);if(i&&o)return 0;if(i)return 1;if(o||r<e)return-1;if(r>e)return 1;if(r===0&&e===0){const s=Gr(r,0),c=Gr(e,0);if(!s&&c)return-1;if(s&&!c)return 1}return 0}const Ir=2,kt=new Vt;function Ye(r){return so(kt,r)||!zi(r)&&ho(r)}function L(r){if(!Ye(r))throw Y(_i)}function Lt(r,e){const i=Ye(r),o=zt(r);if(!i&&!o)throw Y(bi);if(typeof e=="number"){let s;if(i){const c=O(r);s=F(c)}else s=F(r);if(s<e)throw Y(Ni)}if(fr(r))throw Y(cr)}function O(r){const e=Dt(kt,r);if(e!==void 0){const s=Q(e);if(ft(s))throw Y(ht);return e}const i=r.buffer;if(ft(i))throw Y(ht);const o=lt(P,[i,r.byteOffset,r.length],r.constructor);return Dt(kt,o)}function jr(r){const e=F(r),i=[];for(let o=0;o<e;++o)i[o]=M(r[o]);return i}const Un=new pn;for(const r of an(j)){if(r===dr)continue;const e=Ve(j,r);Re(e,"get")&&typeof e.get=="function"&&io(Un,e.get)}const wo=Li({get(r,e,i){return Ct(e)&&Re(r,e)?M(er(r,e)):oo(Un,Fi(r,e))?er(r,e):er(r,e,i)},set(r,e,i,o){return Ct(e)&&Re(r,e)?kr(r,e,Ee(i)):kr(r,e,i,o)},getOwnPropertyDescriptor(r,e){if(Ct(e)&&Re(r,e)){const i=Ve(r,e);return i.value=M(i.value),i}return Ve(r,e)},defineProperty(r,e,i){return Ct(e)&&Re(r,e)&&Re(i,"value")&&(i.value=Ee(i.value)),Hr(r,e,i)}});class P{constructor(e,i,o){let s;if(Ye(e))s=lt(le,[O(e)],new.target);else if(Bt(e)&&!lo(e)){let l,y;if(zt(e)){l=e,y=F(e);const v=Q(e);if(ft(v))throw Y(ht);if(fr(e))throw Y(cr);const I=new Xt(y*Ir);s=lt(le,[I],new.target)}else{const v=e[_e];if(v!=null&&typeof v!="function")throw Y(Br);v!=null?Jr(e)?(l=e,y=e.length):(l=[...e],y=l.length):(l=e,y=rr(l.length)),s=lt(le,[y],new.target)}for(let v=0;v<y;++v)s[v]=Ee(l[v])}else s=lt(le,arguments,new.target);const c=new Oi(s,wo);return Sr(kt,c,s),c}static from(e,...i){const o=this;if(!lr(o,Ht))throw Y(Dr);if(o===P){if(Ye(e)&&i.length===0){const N=O(e),C=new le(Q(N),Be(N),F(N));return new P(Q(st(C)))}if(i.length===0)return new P(Q(Yr(e,Ee)));const v=i[0],I=i[1];return new P(Q(Yr(e,function(N,...C){return Ee(oe(v,this,[N,...ut(C)]))},I)))}let s,c;const l=e[_e];if(l!=null&&typeof l!="function")throw Y(Br);if(l!=null)Jr(e)?(s=e,c=e.length):uo(e)?(s=e,c=F(e)):(s=[...e],c=s.length);else{if(e==null)throw Y(ar);s=Je(e),c=rr(s.length)}const y=new o(c);if(i.length===0)for(let v=0;v<c;++v)y[v]=s[v];else{const v=i[0],I=i[1];for(let N=0;N<c;++N)y[N]=oe(v,I,[s[N],N])}return y}static of(...e){const i=this;if(!lr(i,Ht))throw Y(Dr);const o=e.length;if(i===P){const c=new P(o),l=O(c);for(let y=0;y<o;++y)l[y]=Ee(e[y]);return c}const s=new i(o);for(let c=0;c<o;++c)s[c]=e[c];return s}keys(){L(this);const e=O(this);return Xi(e)}values(){L(this);const e=O(this);return Vr(function*(){for(const i of Yi(e))yield M(i)}())}entries(){L(this);const e=O(this);return Vr(function*(){for(const[i,o]of Vi(e))yield[i,M(o)]}())}at(e){L(this);const i=O(this),o=F(i),s=Ce(e),c=s>=0?s:o+s;if(!(c<0||c>=o))return M(i[c])}with(e,i){L(this);const o=O(this),s=F(o),c=Ce(e),l=c>=0?c:s+c,y=+i;if(l<0||l>=s)throw tr(Kt);const v=new le(Q(o),Be(o),F(o)),I=new P(Q(st(v))),N=O(I);return N[l]=Ee(y),I}map(e,...i){L(this);const o=O(this),s=F(o),c=i[0],l=Rt(o,P);if(l===P){const v=new P(s),I=O(v);for(let N=0;N<s;++N){const C=M(o[N]);I[N]=Ee(oe(e,c,[C,N,this]))}return v}const y=new l(s);Lt(y,s);for(let v=0;v<s;++v){const I=M(o[v]);y[v]=oe(e,c,[I,v,this])}return y}filter(e,...i){L(this);const o=O(this),s=F(o),c=i[0],l=[];for(let I=0;I<s;++I){const N=M(o[I]);oe(e,c,[N,I,this])&&Mi(l,N)}const y=Rt(o,P),v=new y(l);return Lt(v),v}reduce(e,...i){L(this);const o=O(this),s=F(o);if(s===0&&i.length===0)throw Y(zr);let c,l;i.length===0?(c=M(o[0]),l=1):(c=i[0],l=0);for(let y=l;y<s;++y)c=e(c,M(o[y]),y,this);return c}reduceRight(e,...i){L(this);const o=O(this),s=F(o);if(s===0&&i.length===0)throw Y(zr);let c,l;i.length===0?(c=M(o[s-1]),l=s-2):(c=i[0],l=s-1);for(let y=l;y>=0;--y)c=e(c,M(o[y]),y,this);return c}forEach(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)oe(e,c,[M(o[l]),l,this])}find(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return y}}findIndex(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return l}return-1}findLast(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=s-1;l>=0;--l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return y}}findLastIndex(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=s-1;l>=0;--l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return l}return-1}every(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)if(!oe(e,c,[M(o[l]),l,this]))return!1;return!0}some(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)if(oe(e,c,[M(o[l]),l,this]))return!0;return!1}set(e,...i){L(this);const o=O(this),s=Ce(i[0]);if(s<0)throw tr(Kt);if(e==null)throw Y(ar);if(fr(e))throw Y(cr);if(Ye(e))return qi(O(this),O(e),s);if(zt(e)){const v=Q(e);if(ft(v))throw Y(ht)}const c=F(o),l=Je(e),y=rr(l.length);if(s===1/0||y+s>c)throw tr(Kt);for(let v=0;v<y;++v)o[v+s]=Ee(l[v])}reverse(){L(this);const e=O(this);return Wr(e),this}toReversed(){L(this);const e=O(this),i=new le(Q(e),Be(e),F(e)),o=new P(Q(st(i))),s=O(o);return Wr(s),o}fill(e,...i){L(this);const o=O(this);return Ji(o,Ee(e),...ut(i)),this}copyWithin(e,i,...o){L(this);const s=O(this);return $i(s,e,i,...ut(o)),this}sort(e){L(this);const i=O(this),o=e!==void 0?e:Qr;return Xr(i,(s,c)=>o(M(s),M(c))),this}toSorted(e){L(this);const i=O(this);if(e!==void 0&&typeof e!="function")throw new Y(Ui);const o=e!==void 0?e:Qr,s=new le(Q(i),Be(i),F(i)),c=new P(Q(st(s))),l=O(c);return Xr(l,(y,v)=>o(M(y),M(v))),c}slice(e,i){L(this);const o=O(this),s=Rt(o,P);if(s===P){const Ze=new le(Q(o),Be(o),F(o));return new P(Q(st(Ze,e,i)))}const c=F(o),l=Ce(e),y=i===void 0?c:Ce(i);let v;l===-1/0?v=0:l<0?v=c+l>0?c+l:0:v=c<l?c:l;let I;y===-1/0?I=0:y<0?I=c+y>0?c+y:0:I=c<y?c:y;const N=I-v>0?I-v:0,C=new s(N);if(Lt(C,N),N===0)return C;const q=Q(o);if(ft(q))throw Y(ht);let se=0;for(;v<I;)C[se]=M(o[v]),++v,++se;return C}subarray(e,i){L(this);const o=O(this),s=Rt(o,P),c=new le(Q(o),Be(o),F(o)),l=Qi(c,e,i),y=new s(Q(l),Be(l),F(l));return Lt(y),y}indexOf(e,...i){L(this);const o=O(this),s=F(o);let c=Ce(i[0]);if(c===1/0)return-1;c<0&&(c+=s,c<0&&(c=0));for(let l=c;l<s;++l)if(Re(o,l)&&M(o[l])===e)return l;return-1}lastIndexOf(e,...i){L(this);const o=O(this),s=F(o);let c=i.length>=1?Ce(i[0]):s-1;if(c===-1/0)return-1;c>=0?c=c<s-1?c:s-1:c+=s;for(let l=c;l>=0;--l)if(Re(o,l)&&M(o[l])===e)return l;return-1}includes(e,...i){L(this);const o=O(this),s=F(o);let c=Ce(i[0]);if(c===1/0)return!1;c<0&&(c+=s,c<0&&(c=0));const l=qe(e);for(let y=c;y<s;++y){const v=M(o[y]);if(l&&qe(v)||v===e)return!0}return!1}join(e){L(this);const i=O(this),o=jr(i);return xi(o,e)}toLocaleString(...e){L(this);const i=O(this),o=jr(i);return Pi(o,...ut(e))}get[dr](){if(Ye(this))return"Float16Array"}}wt(P,"BYTES_PER_ELEMENT",{value:Ir});wt(P,Ht,{});cn(P,Ar);const Zt=P.prototype;wt(Zt,"BYTES_PER_ELEMENT",{value:Ir});wt(Zt,_e,{value:Zt.values,writable:!0,configurable:!0});cn(Zt,j);function Ao(r,e,...i){return M(no(r,e,...ut(i)))}function To(r){return r instanceof Int8Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof P||r instanceof Float32Array||r instanceof Float64Array}class On extends S.Loader{load(e,i,o,s){const c=new tn(this.manager);c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{try{i(this.parseTypedArray(l))}catch(y){s!=null?s(y):console.error(y),this.manager.itemError(e)}},o,s)}}function _r(r){return class extends On{constructor(){super(...arguments),this.parseTypedArray=r}}}function go(r){return new(_r(r))}function So(r){const e=r instanceof Int8Array?S.ByteType:r instanceof Uint8Array||r instanceof Uint8ClampedArray?S.UnsignedByteType:r instanceof Int16Array?S.ShortType:r instanceof Uint16Array?S.UnsignedShortType:r instanceof Int32Array?S.IntType:r instanceof Uint32Array?S.UnsignedIntType:r instanceof P?S.HalfFloatType:r instanceof Float32Array||r instanceof Float64Array?S.FloatType:null;return en(e!=null),e}const Eo={format:S.RGBAFormat,minFilter:S.LinearFilter,magFilter:S.LinearFilter};class mn extends S.Loader{constructor(){super(...arguments),this.parameters={}}load(e,i,o,s){const c=new this.Texture,l=new this.TypedArrayLoader(this.manager);l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(this.withCredentials),l.load(e,y=>{c.image.data=y instanceof P?new Uint16Array(y.buffer):y;const{width:v,height:I,depth:N,...C}=this.parameters;v!=null&&(c.image.width=v),I!=null&&(c.image.height=I),"depth"in c.image&&N!=null&&(c.image.depth=N),c.type=So(y),Object.assign(c,C),c.needsUpdate=!0,i(c)},o,s)}}function Cn(r,e,i){return class extends mn{constructor(){super(...arguments),this.Texture=r,this.TypedArrayLoader=_r(e),this.parameters={...Eo,...i}}}}function br(r,e){return Cn(S.Data3DTexture,r,e)}function Rn(r,e){return Cn(S.DataTexture,r,e)}function Io(r,e){return new(br(r,e))}function _o(r,e){return new(Rn(r,e))}const He=S.MathUtils.clamp,bo=S.MathUtils.euclideanModulo,No=S.MathUtils.inverseLerp,Uo=S.MathUtils.lerp,Oo=S.MathUtils.degToRad,mo=S.MathUtils.radToDeg,Co=S.MathUtils.isPowerOfTwo,Ro=S.MathUtils.ceilPowerOfTwo,Lo=S.MathUtils.floorPowerOfTwo,Fo=S.MathUtils.normalize;function xo(r,e,i,o=0,s=1){return S.MathUtils.mapLinear(r,e,i,o,s)}function Mo(r,e,i,o=0,s=1){return He(S.MathUtils.mapLinear(r,e,i,o,s),o,s)}function Po(r,e,i){return i<=r?0:i>=e?1:(i=(i-r)/(e-r),i*i*(3-2*i))}function Do(r){return Math.min(Math.max(r,0),1)}function Bo(r,e,i,o=i){const s=Math.abs(r-e);return s<=o||s<=i*Math.max(Math.abs(r),Math.abs(e))}function zo(r){return(e,i)=>{e instanceof S.Material?Object.defineProperty(e,i,{enumerable:!0,get(){var o;return((o=this.defines)==null?void 0:o[r])!=null},set(o){var s;o!==this[i]&&(o?(this.defines??(this.defines={}),this.defines[r]="1"):(s=this.defines)==null||delete s[r],this.needsUpdate=!0)}}):Object.defineProperty(e,i,{enumerable:!0,get(){return this.defines.has(r)},set(o){o!==this[i]&&(o?this.defines.set(r,"1"):this.defines.delete(r),this.setChanged())}})}}function Ho(r,{min:e=Number.MIN_SAFE_INTEGER,max:i=Number.MAX_SAFE_INTEGER}={}){return(o,s)=>{o instanceof S.Material?Object.defineProperty(o,s,{enumerable:!0,get(){var l;const c=(l=this.defines)==null?void 0:l[r];return c!=null?parseInt(c):0},set(c){const l=this[s];c!==l&&(this.defines??(this.defines={}),this.defines[r]=He(c,e,i).toFixed(0),this.needsUpdate=!0)}}):Object.defineProperty(o,s,{enumerable:!0,get(){const c=this.defines.get(r);return c!=null?parseInt(c):0},set(c){const l=this[s];c!==l&&(this.defines.set(r,He(c,e,i).toFixed(0)),this.setChanged())}})}}function ko(r,{min:e=-1/0,max:i=1/0,precision:o=7}={}){return(s,c)=>{s instanceof S.Material?Object.defineProperty(s,c,{enumerable:!0,get(){var y;const l=(y=this.defines)==null?void 0:y[r];return l!=null?parseFloat(l):0},set(l){const y=this[c];l!==y&&(this.defines??(this.defines={}),this.defines[r]=He(l,e,i).toFixed(o),this.needsUpdate=!0)}}):Object.defineProperty(s,c,{enumerable:!0,get(){const l=this.defines.get(r);return l!=null?parseFloat(l):0},set(l){const y=this[c];l!==y&&(this.defines.set(r,He(l,e,i).toFixed(o)),this.setChanged())}})}}function Zo(r,{validate:e}={}){return(i,o)=>{i instanceof S.Material?Object.defineProperty(i,o,{enumerable:!0,get(){var s;return((s=this.defines)==null?void 0:s[r])??""},set(s){if(s!==this[o]){if((e==null?void 0:e(s))===!1){console.error(`Expression validation failed: ${s}`);return}this.defines??(this.defines={}),this.defines[r]=s,this.needsUpdate=!0}}}):Object.defineProperty(i,o,{enumerable:!0,get(){return this.defines.get(r)??""},set(s){if(s!==this[o]){if((e==null?void 0:e(s))===!1){console.error(`Expression validation failed: ${s}`);return}this.defines.set(r,s),this.setChanged()}}})}}function Go(r,...e){const i={};for(let o=0;o<e.length;o+=2){const s=e[o],c=e[o+1];for(const l of c)i[l]={enumerable:!0,get:()=>s[l],set:y=>{s[l]=y}}}return Object.defineProperties(r,i),r}function Wo(r,e,i){const o={};for(const s of i)o[s]={enumerable:!0,get:()=>e.uniforms[s].value,set:c=>{e.uniforms[s].value=c}};return Object.defineProperties(r,o),r}const Xo=parseInt(S.REVISION.replace(/\D+/g,""));var ve=Uint8Array,xe=Uint16Array,vr=Uint32Array,Ln=new ve([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Fn=new ve([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Yo=new ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xn=function(r,e){for(var i=new xe(31),o=0;o<31;++o)i[o]=e+=1<<r[o-1];for(var s=new vr(i[30]),o=1;o<30;++o)for(var c=i[o];c<i[o+1];++c)s[c]=c-i[o]<<5|o;return[i,s]},Mn=xn(Ln,2),Pn=Mn[0],Vo=Mn[1];Pn[28]=258,Vo[258]=28;var qo=xn(Fn,0),Jo=qo[0],pr=new xe(32768);for(var W=0;W<32768;++W){var Fe=(W&43690)>>>1|(W&21845)<<1;Fe=(Fe&52428)>>>2|(Fe&13107)<<2,Fe=(Fe&61680)>>>4|(Fe&3855)<<4,pr[W]=((Fe&65280)>>>8|(Fe&255)<<8)>>>1}var yt=function(r,e,i){for(var o=r.length,s=0,c=new xe(e);s<o;++s)++c[r[s]-1];var l=new xe(e);for(s=0;s<e;++s)l[s]=l[s-1]+c[s-1]<<1;var y;if(i){y=new xe(1<<e);var v=15-e;for(s=0;s<o;++s)if(r[s])for(var I=s<<4|r[s],N=e-r[s],C=l[r[s]-1]++<<N,q=C|(1<<N)-1;C<=q;++C)y[pr[C]>>>v]=I}else for(y=new xe(o),s=0;s<o;++s)r[s]&&(y[s]=pr[l[r[s]-1]++]>>>15-r[s]);return y},At=new ve(288);for(var W=0;W<144;++W)At[W]=8;for(var W=144;W<256;++W)At[W]=9;for(var W=256;W<280;++W)At[W]=7;for(var W=280;W<288;++W)At[W]=8;var Dn=new ve(32);for(var W=0;W<32;++W)Dn[W]=5;var $o=yt(At,9,1),Qo=yt(Dn,5,1),nr=function(r){for(var e=r[0],i=1;i<r.length;++i)r[i]>e&&(e=r[i]);return e},de=function(r,e,i){var o=e/8|0;return(r[o]|r[o+1]<<8)>>(e&7)&i},ir=function(r,e){var i=e/8|0;return(r[i]|r[i+1]<<8|r[i+2]<<16)>>(e&7)},jo=function(r){return(r/8|0)+(r&7&&1)},Ko=function(r,e,i){(i==null||i>r.length)&&(i=r.length);var o=new(r instanceof xe?xe:r instanceof vr?vr:ve)(i-e);return o.set(r.subarray(e,i)),o},es=function(r,e,i){var o=r.length;if(!o||i&&!i.l&&o<5)return e||new ve(0);var s=!e||i,c=!i||i.i;i||(i={}),e||(e=new ve(o*3));var l=function(D){var Ne=e.length;if(D>Ne){var Ue=new ve(Math.max(Ne*2,D));Ue.set(e),e=Ue}},y=i.f||0,v=i.p||0,I=i.b||0,N=i.l,C=i.d,q=i.m,se=i.n,Ze=o*8;do{if(!N){i.f=y=de(r,v,1);var Tt=de(r,v+1,3);if(v+=3,Tt)if(Tt==1)N=$o,C=Qo,q=9,se=5;else if(Tt==2){var Et=de(r,v,31)+257,qt=de(r,v+10,15)+4,Jt=Et+de(r,v+5,31)+1;v+=14;for(var Ge=new ve(Jt),It=new ve(19),ae=0;ae<qt;++ae)It[Yo[ae]]=de(r,v+ae*3,7);v+=qt*3;for(var _t=nr(It),$t=(1<<_t)-1,Qt=yt(It,_t,1),ae=0;ae<Jt;){var ue=Qt[de(r,v,$t)];v+=ue&15;var pe=ue>>>4;if(pe<16)Ge[ae++]=pe;else{var be=0,Te=0;for(pe==16?(Te=3+de(r,v,3),v+=2,be=Ge[ae-1]):pe==17?(Te=3+de(r,v,7),v+=3):pe==18&&(Te=11+de(r,v,127),v+=7);Te--;)Ge[ae++]=be}}var bt=Ge.subarray(0,Et),ge=Ge.subarray(Et);q=nr(bt),se=nr(ge),N=yt(bt,q,1),C=yt(ge,se,1)}else throw"invalid block type";else{var pe=jo(v)+4,gt=r[pe-4]|r[pe-3]<<8,St=pe+gt;if(St>o){if(c)throw"unexpected EOF";break}s&&l(I+gt),e.set(r.subarray(pe,St),I),i.b=I+=gt,i.p=v=St*8;continue}if(v>Ze){if(c)throw"unexpected EOF";break}}s&&l(I+131072);for(var Nt=(1<<q)-1,Ut=(1<<se)-1,Ke=v;;Ke=v){var be=N[ir(r,v)&Nt],te=be>>>4;if(v+=be&15,v>Ze){if(c)throw"unexpected EOF";break}if(!be)throw"invalid length/literal";if(te<256)e[I++]=te;else if(te==256){Ke=v,N=null;break}else{var We=te-254;if(te>264){var ae=te-257,ne=Ln[ae];We=de(r,v,(1<<ne)-1)+Pn[ae],v+=ne}var Me=C[ir(r,v)&Ut],Pe=Me>>>4;if(!Me)throw"invalid distance";v+=Me&15;var ge=Jo[Pe];if(Pe>3){var ne=Fn[Pe];ge+=ir(r,v)&(1<<ne)-1,v+=ne}if(v>Ze){if(c)throw"unexpected EOF";break}s&&l(I+131072);for(var et=I+We;I<et;I+=4)e[I]=e[I-ge],e[I+1]=e[I+1-ge],e[I+2]=e[I+2-ge],e[I+3]=e[I+3-ge];I=et}}i.l=N,i.p=Ke,i.b=I,N&&(y=1,i.m=q,i.d=C,i.n=se)}while(!y);return I==e.length?e:Ko(e,0,I)},ts=new ve(0),rs=function(r){if((r[0]&15)!=8||r[0]>>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Ft(r,e){return es((rs(r),r.subarray(2,-4)),e)}var ns=typeof TextDecoder<"u"&&new TextDecoder,is=0;try{ns.decode(ts,{stream:!0}),is=1}catch{}const at=Xo>=152;class os extends S.DataTextureLoader{constructor(e){super(e),this.type=S.HalfFloatType}parse(e){const _t=Math.pow(2.7182818,2.2);function $t(t,n){for(var a=0,u=0;u<65536;++u)(u==0||t[u>>3]&1<<(u&7))&&(n[a++]=u);for(var h=a-1;a<65536;)n[a++]=0;return h}function Qt(t){for(var n=0;n<16384;n++)t[n]={},t[n].len=0,t[n].lit=0,t[n].p=null}const ue={l:0,c:0,lc:0};function be(t,n,a,u,h){for(;a<t;)n=n<<8|xr(u,h),a+=8;a-=t,ue.l=n>>a&(1<<t)-1,ue.c=n,ue.lc=a}const Te=new Array(59);function bt(t){for(var n=0;n<=58;++n)Te[n]=0;for(var n=0;n<65537;++n)Te[t[n]]+=1;for(var a=0,n=58;n>0;--n){var u=a+Te[n]>>1;Te[n]=a,a=u}for(var n=0;n<65537;++n){var h=t[n];h>0&&(t[n]=h|Te[h]++<<6)}}function ge(t,n,a,u,h,f,d){for(var p=a,T=0,A=0;h<=f;h++){if(p.value-a.value>u)return!1;be(6,T,A,t,p);var g=ue.l;if(T=ue.c,A=ue.lc,d[h]=g,g==63){if(p.value-a.value>u)throw"Something wrong with hufUnpackEncTable";be(8,T,A,t,p);var w=ue.l+6;if(T=ue.c,A=ue.lc,h+w>f+1)throw"Something wrong with hufUnpackEncTable";for(;w--;)d[h++]=0;h--}else if(g>=59){var w=g-59+2;if(h+w>f+1)throw"Something wrong with hufUnpackEncTable";for(;w--;)d[h++]=0;h--}}bt(d)}function Nt(t){return t&63}function Ut(t){return t>>6}function Ke(t,n,a,u){for(;n<=a;n++){var h=Ut(t[n]),f=Nt(t[n]);if(h>>f)throw"Invalid table entry";if(f>14){var d=u[h>>f-14];if(d.len)throw"Invalid table entry";if(d.lit++,d.p){var p=d.p;d.p=new Array(d.lit);for(var T=0;T<d.lit-1;++T)d.p[T]=p[T]}else d.p=new Array(1);d.p[d.lit-1]=n}else if(f)for(var A=0,T=1<<14-f;T>0;T--){var d=u[(h<<14-f)+A];if(d.len||d.p)throw"Invalid table entry";d.len=f,d.lit=n,A++}}return!0}const te={c:0,lc:0};function We(t,n,a,u){t=t<<8|xr(a,u),n+=8,te.c=t,te.lc=n}const ne={c:0,lc:0};function Me(t,n,a,u,h,f,d,p,T,A){if(t==n){u<8&&(We(a,u,h,d),a=te.c,u=te.lc),u-=8;var g=a>>u,g=new Uint8Array([g])[0];if(T.value+g>A)return!1;for(var w=p[T.value-1];g-- >0;)p[T.value++]=w}else if(T.value<A)p[T.value++]=t;else return!1;ne.c=a,ne.lc=u}function Pe(t){return t&65535}function et(t){var n=Pe(t);return n>32767?n-65536:n}const D={a:0,b:0};function Ne(t,n){var a=et(t),u=et(n),h=u,f=a+(h&1)+(h>>1),d=f,p=f-h;D.a=d,D.b=p}function Ue(t,n){var a=Pe(t),u=Pe(n),h=a-(u>>1)&65535,f=u+h-32768&65535;D.a=f,D.b=h}function kn(t,n,a,u,h,f,d){for(var p=d<16384,T=a>h?h:a,A=1,g;A<=T;)A<<=1;for(A>>=1,g=A,A>>=1;A>=1;){for(var w=0,V=w+f*(h-g),_=f*A,b=f*g,U=u*A,m=u*g,B,H,J,re;w<=V;w+=b){for(var k=w,Se=w+u*(a-g);k<=Se;k+=m){var G=k+U,$=k+_,Oe=$+U;p?(Ne(t[k+n],t[$+n]),B=D.a,J=D.b,Ne(t[G+n],t[Oe+n]),H=D.a,re=D.b,Ne(B,H),t[k+n]=D.a,t[G+n]=D.b,Ne(J,re),t[$+n]=D.a,t[Oe+n]=D.b):(Ue(t[k+n],t[$+n]),B=D.a,J=D.b,Ue(t[G+n],t[Oe+n]),H=D.a,re=D.b,Ue(B,H),t[k+n]=D.a,t[G+n]=D.b,Ue(J,re),t[$+n]=D.a,t[Oe+n]=D.b)}if(a&A){var $=k+_;p?Ne(t[k+n],t[$+n]):Ue(t[k+n],t[$+n]),B=D.a,t[$+n]=D.b,t[k+n]=B}}if(h&A)for(var k=w,Se=w+u*(a-g);k<=Se;k+=m){var G=k+U;p?Ne(t[k+n],t[G+n]):Ue(t[k+n],t[G+n]),B=D.a,t[G+n]=D.b,t[k+n]=B}g=A,A>>=1}return w}function Zn(t,n,a,u,h,f,d,p,T,A){for(var g=0,w=0,V=p,_=Math.trunc(h.value+(f+7)/8);h.value<_;)for(We(g,w,a,h),g=te.c,w=te.lc;w>=14;){var b=g>>w-14&16383,U=n[b];if(U.len)w-=U.len,Me(U.lit,d,g,w,a,u,h,T,A,V),g=ne.c,w=ne.lc;else{if(!U.p)throw"hufDecode issues";var m;for(m=0;m<U.lit;m++){for(var B=Nt(t[U.p[m]]);w<B&&h.value<_;)We(g,w,a,h),g=te.c,w=te.lc;if(w>=B&&Ut(t[U.p[m]])==(g>>w-B&(1<<B)-1)){w-=B,Me(U.p[m],d,g,w,a,u,h,T,A,V),g=ne.c,w=ne.lc;break}}if(m==U.lit)throw"hufDecode issues"}}var H=8-f&7;for(g>>=H,w-=H;w>0;){var U=n[g<<14-w&16383];if(U.len)w-=U.len,Me(U.lit,d,g,w,a,u,h,T,A,V),g=ne.c,w=ne.lc;else throw"hufDecode issues"}return!0}function Or(t,n,a,u,h,f){var d={value:0},p=a.value,T=ie(n,a),A=ie(n,a);a.value+=4;var g=ie(n,a);if(a.value+=4,T<0||T>=65537||A<0||A>=65537)throw"Something wrong with HUF_ENCSIZE";var w=new Array(65537),V=new Array(16384);Qt(V);var _=u-(a.value-p);if(ge(t,n,a,_,T,A,w),g>8*(u-(a.value-p)))throw"Something wrong with hufUncompress";Ke(w,T,A,V),Zn(w,V,t,n,a,g,A,f,h,d)}function Gn(t,n,a){for(var u=0;u<a;++u)n[u]=t[n[u]]}function mr(t){for(var n=1;n<t.length;n++){var a=t[n-1]+t[n]-128;t[n]=a}}function Cr(t,n){for(var a=0,u=Math.floor((t.length+1)/2),h=0,f=t.length-1;!(h>f||(n[h++]=t[a++],h>f));)n[h++]=t[u++]}function Rr(t){for(var n=t.byteLength,a=new Array,u=0,h=new DataView(t);n>0;){var f=h.getInt8(u++);if(f<0){var d=-f;n-=d+1;for(var p=0;p<d;p++)a.push(h.getUint8(u++))}else{var d=f;n-=2;for(var T=h.getUint8(u++),p=0;p<d+1;p++)a.push(T)}}return a}function Wn(t,n,a,u,h,f){var G=new DataView(f.buffer),d=a[t.idx[0]].width,p=a[t.idx[0]].height,T=3,A=Math.floor(d/8),g=Math.ceil(d/8),w=Math.ceil(p/8),V=d-(g-1)*8,_=p-(w-1)*8,b={value:0},U=new Array(T),m=new Array(T),B=new Array(T),H=new Array(T),J=new Array(T);for(let z=0;z<T;++z)J[z]=n[t.idx[z]],U[z]=z<1?0:U[z-1]+g*w,m[z]=new Float32Array(64),B[z]=new Uint16Array(64),H[z]=new Uint16Array(g*64);for(let z=0;z<w;++z){var re=8;z==w-1&&(re=_);var k=8;for(let X=0;X<g;++X){X==g-1&&(k=V);for(let x=0;x<T;++x)B[x].fill(0),B[x][0]=h[U[x]++],Xn(b,u,B[x]),Yn(B[x],m[x]),Vn(m[x]);qn(m);for(let x=0;x<T;++x)Jn(m[x],H[x],X*64)}let ee=0;for(let X=0;X<T;++X){const x=a[t.idx[X]].type;for(let ye=8*z;ye<8*z+re;++ye){ee=J[X][ye];for(let De=0;De<A;++De){const ce=De*64+(ye&7)*8;G.setUint16(ee+0*2*x,H[X][ce+0],!0),G.setUint16(ee+1*2*x,H[X][ce+1],!0),G.setUint16(ee+2*2*x,H[X][ce+2],!0),G.setUint16(ee+3*2*x,H[X][ce+3],!0),G.setUint16(ee+4*2*x,H[X][ce+4],!0),G.setUint16(ee+5*2*x,H[X][ce+5],!0),G.setUint16(ee+6*2*x,H[X][ce+6],!0),G.setUint16(ee+7*2*x,H[X][ce+7],!0),ee+=8*2*x}}if(A!=g)for(let ye=8*z;ye<8*z+re;++ye){const De=J[X][ye]+8*A*2*x,ce=A*64+(ye&7)*8;for(let Le=0;Le<k;++Le)G.setUint16(De+Le*2*x,H[X][ce+Le],!0)}}}for(var Se=new Uint16Array(d),G=new DataView(f.buffer),$=0;$<T;++$){a[t.idx[$]].decoded=!0;var Oe=a[t.idx[$]].type;if(a[$].type==2)for(var ot=0;ot<p;++ot){const z=J[$][ot];for(var fe=0;fe<d;++fe)Se[fe]=G.getUint16(z+fe*2*Oe,!0);for(var fe=0;fe<d;++fe)G.setFloat32(z+fe*2*Oe,E(Se[fe]),!0)}}}function Xn(t,n,a){for(var u,h=1;h<64;)u=n[t.value],u==65280?h=64:u>>8==255?h+=u&255:(a[h]=u,h++),t.value++}function Yn(t,n){n[0]=E(t[0]),n[1]=E(t[1]),n[2]=E(t[5]),n[3]=E(t[6]),n[4]=E(t[14]),n[5]=E(t[15]),n[6]=E(t[27]),n[7]=E(t[28]),n[8]=E(t[2]),n[9]=E(t[4]),n[10]=E(t[7]),n[11]=E(t[13]),n[12]=E(t[16]),n[13]=E(t[26]),n[14]=E(t[29]),n[15]=E(t[42]),n[16]=E(t[3]),n[17]=E(t[8]),n[18]=E(t[12]),n[19]=E(t[17]),n[20]=E(t[25]),n[21]=E(t[30]),n[22]=E(t[41]),n[23]=E(t[43]),n[24]=E(t[9]),n[25]=E(t[11]),n[26]=E(t[18]),n[27]=E(t[24]),n[28]=E(t[31]),n[29]=E(t[40]),n[30]=E(t[44]),n[31]=E(t[53]),n[32]=E(t[10]),n[33]=E(t[19]),n[34]=E(t[23]),n[35]=E(t[32]),n[36]=E(t[39]),n[37]=E(t[45]),n[38]=E(t[52]),n[39]=E(t[54]),n[40]=E(t[20]),n[41]=E(t[22]),n[42]=E(t[33]),n[43]=E(t[38]),n[44]=E(t[46]),n[45]=E(t[51]),n[46]=E(t[55]),n[47]=E(t[60]),n[48]=E(t[21]),n[49]=E(t[34]),n[50]=E(t[37]),n[51]=E(t[47]),n[52]=E(t[50]),n[53]=E(t[56]),n[54]=E(t[59]),n[55]=E(t[61]),n[56]=E(t[35]),n[57]=E(t[36]),n[58]=E(t[48]),n[59]=E(t[49]),n[60]=E(t[57]),n[61]=E(t[58]),n[62]=E(t[62]),n[63]=E(t[63])}function Vn(t){const n=.5*Math.cos(.7853975),a=.5*Math.cos(3.14159/16),u=.5*Math.cos(3.14159/8),h=.5*Math.cos(3*3.14159/16),f=.5*Math.cos(5*3.14159/16),d=.5*Math.cos(3*3.14159/8),p=.5*Math.cos(7*3.14159/16);for(var T=new Array(4),A=new Array(4),g=new Array(4),w=new Array(4),V=0;V<8;++V){var _=V*8;T[0]=u*t[_+2],T[1]=d*t[_+2],T[2]=u*t[_+6],T[3]=d*t[_+6],A[0]=a*t[_+1]+h*t[_+3]+f*t[_+5]+p*t[_+7],A[1]=h*t[_+1]-p*t[_+3]-a*t[_+5]-f*t[_+7],A[2]=f*t[_+1]-a*t[_+3]+p*t[_+5]+h*t[_+7],A[3]=p*t[_+1]-f*t[_+3]+h*t[_+5]-a*t[_+7],g[0]=n*(t[_+0]+t[_+4]),g[3]=n*(t[_+0]-t[_+4]),g[1]=T[0]+T[3],g[2]=T[1]-T[2],w[0]=g[0]+g[1],w[1]=g[3]+g[2],w[2]=g[3]-g[2],w[3]=g[0]-g[1],t[_+0]=w[0]+A[0],t[_+1]=w[1]+A[1],t[_+2]=w[2]+A[2],t[_+3]=w[3]+A[3],t[_+4]=w[3]-A[3],t[_+5]=w[2]-A[2],t[_+6]=w[1]-A[1],t[_+7]=w[0]-A[0]}for(var b=0;b<8;++b)T[0]=u*t[16+b],T[1]=d*t[16+b],T[2]=u*t[48+b],T[3]=d*t[48+b],A[0]=a*t[8+b]+h*t[24+b]+f*t[40+b]+p*t[56+b],A[1]=h*t[8+b]-p*t[24+b]-a*t[40+b]-f*t[56+b],A[2]=f*t[8+b]-a*t[24+b]+p*t[40+b]+h*t[56+b],A[3]=p*t[8+b]-f*t[24+b]+h*t[40+b]-a*t[56+b],g[0]=n*(t[b]+t[32+b]),g[3]=n*(t[b]-t[32+b]),g[1]=T[0]+T[3],g[2]=T[1]-T[2],w[0]=g[0]+g[1],w[1]=g[3]+g[2],w[2]=g[3]-g[2],w[3]=g[0]-g[1],t[0+b]=w[0]+A[0],t[8+b]=w[1]+A[1],t[16+b]=w[2]+A[2],t[24+b]=w[3]+A[3],t[32+b]=w[3]-A[3],t[40+b]=w[2]-A[2],t[48+b]=w[1]-A[1],t[56+b]=w[0]-A[0]}function qn(t){for(var n=0;n<64;++n){var a=t[0][n],u=t[1][n],h=t[2][n];t[0][n]=a+1.5747*h,t[1][n]=a-.1873*u-.4682*h,t[2][n]=a+1.8556*u}}function Jn(t,n,a){for(var u=0;u<64;++u)n[a+u]=S.DataUtils.toHalfFloat($n(t[u]))}function $n(t){return t<=1?Math.sign(t)*Math.pow(Math.abs(t),2.2):Math.sign(t)*Math.pow(_t,Math.abs(t)-1)}function Lr(t){return new DataView(t.array.buffer,t.offset.value,t.size)}function Qn(t){var n=t.viewer.buffer.slice(t.offset.value,t.offset.value+t.size),a=new Uint8Array(Rr(n)),u=new Uint8Array(a.length);return mr(a),Cr(a,u),new DataView(u.buffer)}function jt(t){var n=t.array.slice(t.offset.value,t.offset.value+t.size),a=Ft(n),u=new Uint8Array(a.length);return mr(a),Cr(a,u),new DataView(u.buffer)}function jn(t){for(var n=t.viewer,a={value:t.offset.value},u=new Uint16Array(t.width*t.scanlineBlockSize*(t.channels*t.type)),h=new Uint8Array(8192),f=0,d=new Array(t.channels),p=0;p<t.channels;p++)d[p]={},d[p].start=f,d[p].end=d[p].start,d[p].nx=t.width,d[p].ny=t.lines,d[p].size=t.type,f+=d[p].nx*d[p].ny*d[p].size;var T=rt(n,a),A=rt(n,a);if(A>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(T<=A)for(var p=0;p<A-T+1;p++)h[p+T]=Xe(n,a);var g=new Uint16Array(65536),w=$t(h,g),V=ie(n,a);Or(t.array,n,a,V,u,f);for(var p=0;p<t.channels;++p)for(var _=d[p],b=0;b<d[p].size;++b)kn(u,_.start+b,_.nx,_.size,_.ny,_.nx*_.size,w);Gn(g,u,f);for(var U=0,m=new Uint8Array(u.buffer.byteLength),B=0;B<t.lines;B++)for(var H=0;H<t.channels;H++){var _=d[H],J=_.nx*_.size,re=new Uint8Array(u.buffer,_.end*2,J*2);m.set(re,U),U+=J*2,_.end+=J}return new DataView(m.buffer)}function Kn(t){var n=t.array.slice(t.offset.value,t.offset.value+t.size),a=Ft(n);const u=t.lines*t.channels*t.width,h=t.type==1?new Uint16Array(u):new Uint32Array(u);let f=0,d=0;const p=new Array(4);for(let T=0;T<t.lines;T++)for(let A=0;A<t.channels;A++){let g=0;switch(t.type){case 1:p[0]=f,p[1]=p[0]+t.width,f=p[1]+t.width;for(let w=0;w<t.width;++w){const V=a[p[0]++]<<8|a[p[1]++];g+=V,h[d]=g,d++}break;case 2:p[0]=f,p[1]=p[0]+t.width,p[2]=p[1]+t.width,f=p[2]+t.width;for(let w=0;w<t.width;++w){const V=a[p[0]++]<<24|a[p[1]++]<<16|a[p[2]++]<<8;g+=V,h[d]=g,d++}break}}return new DataView(h.buffer)}function Fr(t){var n=t.viewer,a={value:t.offset.value},u=new Uint8Array(t.width*t.lines*(t.channels*t.type*2)),h={version:he(n,a),unknownUncompressedSize:he(n,a),unknownCompressedSize:he(n,a),acCompressedSize:he(n,a),dcCompressedSize:he(n,a),rleCompressedSize:he(n,a),rleUncompressedSize:he(n,a),rleRawSize:he(n,a),totalAcUncompressedCount:he(n,a),totalDcUncompressedCount:he(n,a),acCompression:he(n,a)};if(h.version<2)throw"EXRLoader.parse: "+it.compression+" version "+h.version+" is unsupported";for(var f=new Array,d=rt(n,a)-2;d>0;){var p=Ot(n.buffer,a),T=Xe(n,a),A=T>>2&3,g=(T>>4)-1,w=new Int8Array([g])[0],V=Xe(n,a);f.push({name:p,index:w,type:V,compression:A}),d-=p.length+3}for(var _=it.channels,b=new Array(t.channels),U=0;U<t.channels;++U){var m=b[U]={},B=_[U];m.name=B.name,m.compression=0,m.decoded=!1,m.type=B.pixelType,m.pLinear=B.pLinear,m.width=t.width,m.height=t.lines}for(var H={idx:new Array(3)},J=0;J<t.channels;++J)for(var m=b[J],U=0;U<f.length;++U){var re=f[U];m.name==re.name&&(m.compression=re.compression,re.index>=0&&(H.idx[re.index]=J),m.offset=J)}if(h.acCompressedSize>0)switch(h.acCompression){case 0:var G=new Uint16Array(h.totalAcUncompressedCount);Or(t.array,n,a,h.acCompressedSize,G,h.totalAcUncompressedCount);break;case 1:var k=t.array.slice(a.value,a.value+h.totalAcUncompressedCount),Se=Ft(k),G=new Uint16Array(Se.buffer);a.value+=h.totalAcUncompressedCount;break}if(h.dcCompressedSize>0){var $={array:t.array,offset:a,size:h.dcCompressedSize},Oe=new Uint16Array(jt($).buffer);a.value+=h.dcCompressedSize}if(h.rleRawSize>0){var k=t.array.slice(a.value,a.value+h.rleCompressedSize),Se=Ft(k),ot=Rr(Se.buffer);a.value+=h.rleCompressedSize}for(var fe=0,z=new Array(b.length),U=0;U<z.length;++U)z[U]=new Array;for(var ee=0;ee<t.lines;++ee)for(var X=0;X<b.length;++X)z[X].push(fe),fe+=b[X].width*t.type*2;Wn(H,z,b,G,Oe,u);for(var U=0;U<b.length;++U){var m=b[U];if(!m.decoded)switch(m.compression){case 2:for(var x=0,ye=0,ee=0;ee<t.lines;++ee){for(var De=z[U][x],ce=0;ce<m.width;++ce){for(var Le=0;Le<2*m.type;++Le)u[De++]=ot[ye+Le*m.width*m.height];ye++}x++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(u.buffer)}function Ot(t,n){for(var a=new Uint8Array(t),u=0;a[n.value+u]!=0;)u+=1;var h=new TextDecoder().decode(a.slice(n.value,n.value+u));return n.value=n.value+u+1,h}function ei(t,n,a){var u=new TextDecoder().decode(new Uint8Array(t).slice(n.value,n.value+a));return n.value=n.value+a,u}function ti(t,n){var a=tt(t,n),u=ie(t,n);return[a,u]}function ri(t,n){var a=ie(t,n),u=ie(t,n);return[a,u]}function tt(t,n){var a=t.getInt32(n.value,!0);return n.value=n.value+4,a}function ie(t,n){var a=t.getUint32(n.value,!0);return n.value=n.value+4,a}function xr(t,n){var a=t[n.value];return n.value=n.value+1,a}function Xe(t,n){var a=t.getUint8(n.value);return n.value=n.value+1,a}const he=function(t,n){let a;return"getBigInt64"in DataView.prototype?a=Number(t.getBigInt64(n.value,!0)):a=t.getUint32(n.value+4,!0)+Number(t.getUint32(n.value,!0)<<32),n.value+=8,a};function K(t,n){var a=t.getFloat32(n.value,!0);return n.value+=4,a}function ni(t,n){return S.DataUtils.toHalfFloat(K(t,n))}function E(t){var n=(t&31744)>>10,a=t&1023;return(t>>15?-1:1)*(n?n===31?a?NaN:1/0:Math.pow(2,n-15)*(1+a/1024):6103515625e-14*(a/1024))}function rt(t,n){var a=t.getUint16(n.value,!0);return n.value+=2,a}function ii(t,n){return E(rt(t,n))}function oi(t,n,a,u){for(var h=a.value,f=[];a.value<h+u-1;){var d=Ot(n,a),p=tt(t,a),T=Xe(t,a);a.value+=3;var A=tt(t,a),g=tt(t,a);f.push({name:d,pixelType:p,pLinear:T,xSampling:A,ySampling:g})}return a.value+=1,f}function si(t,n){var a=K(t,n),u=K(t,n),h=K(t,n),f=K(t,n),d=K(t,n),p=K(t,n),T=K(t,n),A=K(t,n);return{redX:a,redY:u,greenX:h,greenY:f,blueX:d,blueY:p,whiteX:T,whiteY:A}}function ai(t,n){var a=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],u=Xe(t,n);return a[u]}function ci(t,n){var a=ie(t,n),u=ie(t,n),h=ie(t,n),f=ie(t,n);return{xMin:a,yMin:u,xMax:h,yMax:f}}function li(t,n){var a=["INCREASING_Y"],u=Xe(t,n);return a[u]}function ui(t,n){var a=K(t,n),u=K(t,n);return[a,u]}function hi(t,n){var a=K(t,n),u=K(t,n),h=K(t,n);return[a,u,h]}function fi(t,n,a,u,h){if(u==="string"||u==="stringvector"||u==="iccProfile")return ei(n,a,h);if(u==="chlist")return oi(t,n,a,h);if(u==="chromaticities")return si(t,a);if(u==="compression")return ai(t,a);if(u==="box2i")return ci(t,a);if(u==="lineOrder")return li(t,a);if(u==="float")return K(t,a);if(u==="v2f")return ui(t,a);if(u==="v3f")return hi(t,a);if(u==="int")return tt(t,a);if(u==="rational")return ti(t,a);if(u==="timecode")return ri(t,a);if(u==="preview")return a.value+=h,"skipped";a.value+=h}function yi(t,n,a){const u={};if(t.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";u.version=t.getUint8(4);const h=t.getUint8(5);u.spec={singleTile:!!(h&2),longName:!!(h&4),deepFormat:!!(h&8),multiPart:!!(h&16)},a.value=8;for(var f=!0;f;){var d=Ot(n,a);if(d==0)f=!1;else{var p=Ot(n,a),T=ie(t,a),A=fi(t,n,a,p,T);A===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${p}'.`):u[d]=A}}if((h&-5)!=0)throw console.error("EXRHeader:",u),"THREE.EXRLoader: provided file is currently unsupported.";return u}function vi(t,n,a,u,h){const f={size:0,viewer:n,array:a,offset:u,width:t.dataWindow.xMax-t.dataWindow.xMin+1,height:t.dataWindow.yMax-t.dataWindow.yMin+1,channels:t.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:t.channels[0].pixelType,uncompress:null,getter:null,format:null,[at?"colorSpace":"encoding"]:null};switch(t.compression){case"NO_COMPRESSION":f.lines=1,f.uncompress=Lr;break;case"RLE_COMPRESSION":f.lines=1,f.uncompress=Qn;break;case"ZIPS_COMPRESSION":f.lines=1,f.uncompress=jt;break;case"ZIP_COMPRESSION":f.lines=16,f.uncompress=jt;break;case"PIZ_COMPRESSION":f.lines=32,f.uncompress=jn;break;case"PXR24_COMPRESSION":f.lines=16,f.uncompress=Kn;break;case"DWAA_COMPRESSION":f.lines=32,f.uncompress=Fr;break;case"DWAB_COMPRESSION":f.lines=256,f.uncompress=Fr;break;default:throw"EXRLoader.parse: "+t.compression+" is unsupported"}if(f.scanlineBlockSize=f.lines,f.type==1)switch(h){case S.FloatType:f.getter=ii,f.inputSize=2;break;case S.HalfFloatType:f.getter=rt,f.inputSize=2;break}else if(f.type==2)switch(h){case S.FloatType:f.getter=K,f.inputSize=4;break;case S.HalfFloatType:f.getter=ni,f.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+f.type+" for "+t.compression+".";f.blockCount=(t.dataWindow.yMax+1)/f.scanlineBlockSize;for(var d=0;d<f.blockCount;d++)he(n,u);f.outputChannels=f.channels==3?4:f.channels;const p=f.width*f.height*f.outputChannels;switch(h){case S.FloatType:f.byteArray=new Float32Array(p),f.channels<f.outputChannels&&f.byteArray.fill(1,0,p);break;case S.HalfFloatType:f.byteArray=new Uint16Array(p),f.channels<f.outputChannels&&f.byteArray.fill(15360,0,p);break;default:console.error("THREE.EXRLoader: unsupported type: ",h);break}return f.bytesPerLine=f.width*f.inputSize*f.channels,f.outputChannels==4?f.format=S.RGBAFormat:f.format=S.RedFormat,at?f.colorSpace="srgb-linear":f.encoding=3e3,f}const mt=new DataView(e),pi=new Uint8Array(e),nt={value:0},it=yi(mt,e,nt),R=vi(it,mt,pi,nt,this.type),Mr={value:0},di={R:0,G:1,B:2,A:3,Y:0};for(let t=0;t<R.height/R.scanlineBlockSize;t++){const n=ie(mt,nt);R.size=ie(mt,nt),R.lines=n+R.scanlineBlockSize>R.height?R.height-n:R.scanlineBlockSize;const u=R.size<R.lines*R.bytesPerLine?R.uncompress(R):Lr(R);nt.value+=R.size;for(let h=0;h<R.scanlineBlockSize;h++){const f=h+t*R.scanlineBlockSize;if(f>=R.height)break;for(let d=0;d<R.channels;d++){const p=di[it.channels[d].name];for(let T=0;T<R.width;T++){Mr.value=(h*(R.channels*R.width)+d*R.width+T)*R.inputSize;const A=(R.height-1-f)*(R.width*R.outputChannels)+T*R.outputChannels+p;R.byteArray[A]=R.getter(u,Mr)}}}}return{header:it,width:R.width,height:R.height,data:R.byteArray,format:R.format,[at?"colorSpace":"encoding"]:R[at?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,i,o,s){function c(l,y){at?l.colorSpace=y.colorSpace:l.encoding=y.encoding,l.minFilter=S.LinearFilter,l.magFilter=S.LinearFilter,l.generateMipmaps=!1,l.flipY=!1,i&&i(l,y)}return super.load(e,c,o,s)}}class ss extends S.Loader{setDepth(e){return this.depth=e,this}load(e,i,o,s){const c=new os(this.manager);c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{const{data:y,width:v,height:I}=l.image,N=this.depth??Math.sqrt(I),C=new S.Data3DTexture(y,v,I/N,N);C.type=l.type,C.format=l.format,C.colorSpace=l.colorSpace,C.needsUpdate=!0;try{i(C)}catch(q){s!=null?s(q):console.error(q),this.manager.itemError(e)}},o,s)}}const or=1e-6,xt=new S.Vector3,Mt=new S.Vector3,me=new S.Vector3,ct=new S.Vector3,sr=new S.Vector3,as=new S.Vector3,cs=new S.Matrix4,ls=new S.Quaternion,us=new S.Ray;class Nr{constructor(e=0,i=0,o=0,s=0){this.distance=e,this.heading=i,this.pitch=o,this.roll=s}get distance(){return this._distance}set distance(e){this._distance=Math.max(e,or)}get pitch(){return this._pitch}set pitch(e){this._pitch=He(e,-Math.PI/2+or,Math.PI/2-or)}set(e,i,o,s){return this.distance=e,this.heading=i,this.pitch=o,s!=null&&(this.roll=s),this}clone(){return new Nr(this.distance,this.heading,this.pitch,this.roll)}copy(e){return this.distance=e.distance,this.heading=e.heading,this.pitch=e.pitch,this.roll=e.roll,this}equals(e){return e.distance===this.distance&&e.heading===this.heading&&e.pitch===this.pitch&&e.roll===this.roll}decompose(e,i,o,s,c=Ie.Ellipsoid.WGS84){c.getEastNorthUpVectors(e,xt,Mt,me),s==null||s.copy(me);const l=ct.copy(xt).multiplyScalar(Math.cos(this.heading)).add(sr.copy(Mt).multiplyScalar(Math.sin(this.heading))).multiplyScalar(Math.cos(this.pitch)).add(sr.copy(me).multiplyScalar(Math.sin(this.pitch))).normalize().multiplyScalar(this.distance);if(i.copy(e).sub(l),this.roll!==0){const y=ct.copy(e).sub(i).normalize();me.applyQuaternion(ls.setFromAxisAngle(y,this.roll))}o.setFromRotationMatrix(cs.lookAt(i,e,me))}setFromCamera(e,i=Ie.Ellipsoid.WGS84){const o=ct.setFromMatrixPosition(e.matrixWorld),s=sr.set(0,0,.5).unproject(e).sub(o).normalize(),c=i.getIntersection(us.set(o,s));if(c==null)return;this.distance=o.distanceTo(c),i.getEastNorthUpVectors(c,xt,Mt,me),this.heading=Math.atan2(Mt.dot(s),xt.dot(s)),this.pitch=Math.asin(me.dot(s));const l=ct.copy(e.up).applyQuaternion(e.quaternion),y=as.copy(s).multiplyScalar(-l.dot(s)).add(l).normalize(),v=ct.copy(s).multiplyScalar(-me.dot(s)).add(me).normalize(),I=v.dot(y),N=s.dot(v.cross(y));return this.roll=Math.atan2(N,I),this}}const vt=class vt{constructor(e=0,i=0,o=0,s=0){this.west=e,this.south=i,this.east=o,this.north=s}get width(){let e=this.east;return e<this.west&&(e+=Math.PI*2),e-this.west}get height(){return this.north-this.south}set(e,i,o,s){return this.west=e,this.south=i,this.east=o,this.north=s,this}clone(){return new vt(this.west,this.south,this.east,this.north)}copy(e){return this.west=e.west,this.south=e.south,this.east=e.east,this.north=e.north,this}equals(e){return e.west===this.west&&e.south===this.south&&e.east===this.east&&e.north===this.north}at(e,i,o=new Ie.Geodetic){return o.set(this.west+(this.east-this.west)*e,this.north+(this.south-this.north)*i)}fromArray(e,i=0){return this.west=e[i],this.south=e[i+1],this.east=e[i+2],this.north=e[i+3],this}toArray(e=[],i=0){return e[i]=this.west,e[i+1]=this.south,e[i+2]=this.east,e[i+3]=this.north,e}*[Symbol.iterator](){yield this.west,yield this.south,yield this.east,yield this.north}};vt.MAX=new vt(Ie.Geodetic.MIN_LONGITUDE,Ie.Geodetic.MIN_LATITUDE,Ie.Geodetic.MAX_LONGITUDE,Ie.Geodetic.MAX_LATITUDE);let pt=vt;const hs=/^[ \t]*#include +"([\w\d./]+)"/gm;function Bn(r,e){return r.replace(hs,(i,o)=>{const c=o.split("/").reduce((l,y)=>typeof l!="string"&&l!=null?l[y]:void 0,e);if(typeof c!="string")throw new Error(`Could not find include for ${o}.`);return Bn(c,e)})}let Pt;function fs(){if(Pt!=null)return Pt;const r=new Uint32Array([268435456]);return Pt=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)[0]===0,Pt}function ke(r,e,i,o=!0){if(o===fs())return new e(r);const s=Object.assign(new DataView(r),{getFloat16(l,y){return Ao(this,l,y)}}),c=new e(s.byteLength/e.BYTES_PER_ELEMENT);for(let l=0,y=0;l<c.length;++l,y+=e.BYTES_PER_ELEMENT)c[l]=s[i](y,o);return c}const zn=r=>new Uint8Array(r),ys=r=>new Int8Array(r),vs=(r,e)=>ke(r,Uint16Array,"getUint16",e),ps=(r,e)=>ke(r,Int16Array,"getInt16",e),ds=(r,e)=>ke(r,Int32Array,"getInt32",e),ws=(r,e)=>ke(r,Uint32Array,"getUint32",e),As=(r,e)=>ke(r,P,"getFloat16",e),Ts=(r,e)=>ke(r,Float32Array,"getFloat32",e),gs=(r,e)=>ke(r,Float64Array,"getFloat64",e),Ss=br(zn,{format:S.RedFormat,minFilter:S.NearestFilter,magFilter:S.NearestFilter,wrapS:S.RepeatWrapping,wrapT:S.RepeatWrapping,wrapR:S.RepeatWrapping,width:rn,height:nn,depth:on});function*Hn(r,e,i,o,s){if(i>=o)return;const c=2**i,l=i+1,y=2**l,v=Math.floor(r/c*y),I=Math.floor(e/c*y),N=[[v,I,l],[v+1,I,l],[v,I+1,l],[v+1,I+1,l]];if(l<o)for(const C of N)for(const q of Hn(...C,o,s))yield q;else for(const C of N)yield(s??new $e).set(...C)}class $e{constructor(e=0,i=0,o=0){this.x=e,this.y=i,this.z=o}set(e,i,o){return this.x=e,this.y=i,o!=null&&(this.z=o),this}clone(){return new $e(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}getParent(e=new $e){const i=2**this.z,o=this.x/i,s=this.y/i,c=this.z-1,l=2**c;return e.set(Math.floor(o*l),Math.floor(s*l),c)}*traverseChildren(e,i){const{x:o,y:s,z:c}=this;for(const l of Hn(o,s,c,c+e,i))yield l}fromArray(e,i=0){return this.x=e[i],this.y=e[i+1],this.z=e[i+2],this}toArray(e=[],i=0){return e[i]=this.x,e[i+1]=this.y,e[i+2]=this.z,e}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Kr=new S.Vector2;class Ur{constructor(e=2,i=1,o=pt.MAX){this.width=e,this.height=i,this.rectangle=o}clone(){return new Ur(this.width,this.height,this.rectangle.clone())}copy(e){return this.width=e.width,this.height=e.height,this.rectangle.copy(e.rectangle),this}getSize(e,i=new S.Vector2){return i.set(this.width<<e,this.height<<e)}getTile(e,i,o=new $e){const s=this.getSize(i,Kr),{rectangle:c}=this,l=c.width/s.x,y=c.height/s.y,{west:v,south:I,east:N}=c;let C=e.longitude;N<v&&(C+=Math.PI*2);let q=Math.floor((C-v)/l);q>=s.x&&(q=s.x-1);let se=Math.floor((e.latitude-I)/y);return se>=s.y&&(se=s.y-1),o.x=q,o.y=se,o.z=i,o}getRectangle(e,i=new pt){const o=this.getSize(e.z,Kr),{rectangle:s}=this,c=s.width/o.x,l=s.height/o.y,{west:y,north:v}=s;return i.west=e.x*c+y,i.east=(e.x+1)*c+y,i.north=v-(o.y-e.y-1)*l,i.south=v-(o.y-e.y)*l,i}}const Es=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*(?:i\s*\+\+|\+\+\s*i)\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Is(r,e,i,o){let s="";for(let c=parseInt(e);c<parseInt(i);++c)s+=o.replace(/\[\s*i\s*\]/g,"["+c+"]").replace(/UNROLLED_LOOP_INDEX/g,`${c}`);return s}function _s(r){return r.replace(Es,Is)}exports.Ellipsoid=Ie.Ellipsoid;exports.EllipsoidGeometry=Ie.EllipsoidGeometry;exports.Geodetic=Ie.Geodetic;exports.ArrayBufferLoader=tn;exports.DEFAULT_STBN_URL=Ei;exports.DataLoader=mn;exports.EXR3DLoader=ss;exports.Float16Array=P;exports.PointOfView=Nr;exports.Rectangle=pt;exports.STBNLoader=Ss;exports.STBN_TEXTURE_DEPTH=on;exports.STBN_TEXTURE_HEIGHT=nn;exports.STBN_TEXTURE_WIDTH=rn;exports.TileCoordinate=$e;exports.TilingScheme=Ur;exports.TypedArrayLoader=On;exports.assertType=Ai;exports.ceilPowerOfTwo=Ro;exports.clamp=He;exports.closeTo=Bo;exports.createData3DTextureLoader=Io;exports.createData3DTextureLoaderClass=br;exports.createDataTextureLoader=_o;exports.createDataTextureLoaderClass=Rn;exports.createTypedArrayLoader=go;exports.createTypedArrayLoaderClass=_r;exports.define=zo;exports.defineExpression=Zo;exports.defineFloat=ko;exports.defineInt=Ho;exports.definePropertyShorthand=Go;exports.defineUniformShorthand=Wo;exports.degrees=mo;exports.euclideanModulo=bo;exports.floorPowerOfTwo=Lo;exports.fromBufferGeometryLike=gi;exports.inverseLerp=No;exports.isPowerOfTwo=Co;exports.isTypedArray=To;exports.lerp=Uo;exports.normalize=Fo;exports.parseFloat16Array=As;exports.parseFloat32Array=Ts;exports.parseFloat64Array=gs;exports.parseInt16Array=ps;exports.parseInt32Array=ds;exports.parseInt8Array=ys;exports.parseUint16Array=vs;exports.parseUint32Array=ws;exports.parseUint8Array=zn;exports.radians=Oo;exports.remap=xo;exports.remapClamped=Mo;exports.resolveIncludes=Bn;exports.saturate=Do;exports.smoothstep=Po;exports.toBufferGeometryLike=Ti;exports.unrollLoops=_s;
|
2
2
|
//# sourceMappingURL=index.cjs.map
|