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