@takram/three-geospatial 0.3.0 → 0.5.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 +28 -1
- package/build/index.cjs +1 -1
- package/build/index.cjs.map +1 -1
- package/build/index.js +1109 -2108
- package/build/index.js.map +1 -1
- package/build/r3f.cjs +1 -1
- package/build/r3f.cjs.map +1 -1
- package/build/r3f.js +1 -1
- package/build/r3f.js.map +1 -1
- package/build/shaders.cjs +4 -4
- package/build/shaders.js +7 -7
- package/build/shared.cjs +1 -1
- package/build/shared.cjs.map +1 -1
- package/build/shared.js +8 -206
- package/build/shared.js.map +1 -1
- package/build/shared2.cjs +2 -0
- package/build/shared2.cjs.map +1 -0
- package/build/shared2.js +224 -0
- package/build/shared2.js.map +1 -0
- package/build/shared3.cjs +2 -0
- package/build/shared3.cjs.map +1 -0
- package/build/shared3.js +13 -0
- package/build/shared3.js.map +1 -0
- package/build/webgpu.cjs +2 -0
- package/build/webgpu.cjs.map +1 -0
- package/build/webgpu.js +1336 -0
- package/build/webgpu.js.map +1 -0
- package/package.json +14 -9
- package/src/Ellipsoid.ts +25 -0
- package/src/EllipsoidGeometry.ts +2 -2
- package/src/QuadGeometry.ts +14 -0
- package/src/bufferGeometry.ts +1 -1
- package/src/capabilities.ts +12 -3
- package/src/decorators.ts +11 -6
- package/src/index.ts +2 -2
- package/src/shaders/depth.glsl +3 -3
- package/src/types.ts +2 -0
- package/src/unrollLoops.ts +1 -1
- package/src/webgpu/DownsampleThresholdNode.ts +40 -0
- package/src/webgpu/DualMipmapFilterNode.ts +130 -0
- package/src/webgpu/FilterNode.ts +93 -0
- package/src/webgpu/FnLayout.ts +86 -0
- package/src/webgpu/FnVar.ts +26 -0
- package/src/webgpu/GaussianBlurNode.ts +129 -0
- package/src/webgpu/HighpVelocityNode.ts +115 -0
- package/src/webgpu/KawaseBlurNode.ts +76 -0
- package/src/webgpu/LensFlareNode.ts +128 -0
- package/src/webgpu/LensGhostNode.ts +62 -0
- package/src/webgpu/LensGlareNode.ts +318 -0
- package/src/webgpu/LensHaloNode.ts +99 -0
- package/src/webgpu/MipmapBlurNode.ts +113 -0
- package/src/webgpu/MipmapSurfaceBlurNode.ts +140 -0
- package/src/webgpu/OutputTexture3DNode.ts +34 -0
- package/src/webgpu/OutputTextureNode.ts +33 -0
- package/src/webgpu/RTTextureNode.ts +132 -0
- package/src/webgpu/SeparableFilterNode.ts +98 -0
- package/src/webgpu/SingleFilterNode.ts +80 -0
- package/src/webgpu/TemporalAntialiasNode.ts +571 -0
- package/src/webgpu/accessors.ts +67 -0
- package/src/webgpu/debug.ts +86 -0
- package/src/webgpu/generators.ts +40 -0
- package/src/webgpu/index.ts +21 -0
- package/src/webgpu/internals.ts +37 -0
- package/src/webgpu/math.ts +81 -0
- package/src/webgpu/node.ts +100 -0
- package/src/webgpu/sampling.ts +103 -0
- package/src/webgpu/transformations.ts +106 -0
- package/src/webgpu/utils.ts +13 -0
- package/types/Ellipsoid.d.ts +4 -0
- package/types/QuadGeometry.d.ts +4 -0
- package/types/bufferGeometry.d.ts +2 -2
- package/types/capabilities.d.ts +2 -1
- package/types/decorators.d.ts +8 -5
- package/types/index.d.ts +2 -2
- package/types/types.d.ts +1 -0
- package/types/webgpu/DownsampleThresholdNode.d.ts +11 -0
- package/types/webgpu/DualMipmapFilterNode.d.ts +21 -0
- package/types/webgpu/FilterNode.d.ts +17 -0
- package/types/webgpu/FnLayout.d.ts +21 -0
- package/types/webgpu/FnVar.d.ts +6 -0
- package/types/webgpu/GaussianBlurNode.d.ts +10 -0
- package/types/webgpu/HighpVelocityNode.d.ts +18 -0
- package/types/webgpu/KawaseBlurNode.d.ts +10 -0
- package/types/webgpu/LensFlareNode.d.ts +25 -0
- package/types/webgpu/LensGhostNode.d.ts +8 -0
- package/types/webgpu/LensGlareNode.d.ts +32 -0
- package/types/webgpu/LensHaloNode.d.ts +11 -0
- package/types/webgpu/MipmapBlurNode.d.ts +12 -0
- package/types/webgpu/MipmapSurfaceBlurNode.d.ts +11 -0
- package/types/webgpu/OutputTexture3DNode.d.ts +11 -0
- package/types/webgpu/OutputTextureNode.d.ts +11 -0
- package/types/webgpu/RTTextureNode.d.ts +23 -0
- package/types/webgpu/SeparableFilterNode.d.ts +20 -0
- package/types/webgpu/SingleFilterNode.d.ts +17 -0
- package/types/webgpu/TemporalAntialiasNode.d.ts +56 -0
- package/types/webgpu/accessors.d.ts +10 -0
- package/types/webgpu/debug.d.ts +7 -0
- package/types/webgpu/generators.d.ts +4 -0
- package/types/webgpu/index.d.ts +21 -0
- package/types/webgpu/internals.d.ts +3 -0
- package/types/webgpu/math.d.ts +4 -0
- package/types/webgpu/node.d.ts +33 -0
- package/types/webgpu/sampling.d.ts +2 -0
- package/types/webgpu/transformations.d.ts +12 -0
- package/types/webgpu/utils.d.ts +3 -0
- package/src/assertions.ts +0 -1
- package/types/assertions.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## [0.5.0] - 2025-11-01
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Added initial support for WebGPU / TSL. See [WEBGPU.md](https://github.com/takram-design-engineering/three-geospatial/blob/main/packages/core/WEBGPU.md) for details.
|
|
8
|
+
- Added `getMoonFixedToECIRotationMatrix`.
|
|
9
|
+
- `Ellipsoid`: Added `flattening`, `eccentricity`.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Removed module augmentation from type definitions.
|
|
14
|
+
- Updated dependencies.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Addressed usage of `requestIdleCallback` in SSR environment.
|
|
19
|
+
|
|
20
|
+
## [0.4.0] - 2025-08-19
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- `Ellipsoid`: Added `getNorthUpEastFrame`.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- Updated dependencies.
|
|
29
|
+
|
|
30
|
+
## [0.3.0] - 2025-07-05
|
|
4
31
|
|
|
5
32
|
### Changed
|
|
6
33
|
|
package/build/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("three"),ne=require("./shared.cjs"),x=require("./shared2.cjs"),se=require("three-stdlib"),ve=require("./shared3.cjs");class oe extends h.Loader{load(t,r,n,s){const o=new h.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(this.withCredentials),o.load(t,i=>{ne.invariant(i instanceof ArrayBuffer);try{r(i)}catch(a){s!=null?s(a):console.error(a),this.manager.itemError(t)}},n,s)}}function De(e){const{attributes:t,index:r,boundingBox:n,boundingSphere:s}=e;return[{attributes:t,index:r,boundingBox:n,boundingSphere:s},[...Object.values(e.attributes).map(o=>o.array.buffer),e.index?.array.buffer].filter(o=>o!=null)]}function Ge(e,t=new h.BufferGeometry){for(const[r,n]of Object.entries(e.attributes))t.setAttribute(r,new h.BufferAttribute(n.array,n.itemSize,n.normalized));if(t.index=e.index!=null?new h.BufferAttribute(e.index.array,e.index.itemSize,e.index.normalized):null,e.boundingBox!=null){const{min:r,max:n}=e.boundingBox;t.boundingBox=new h.Box3(new h.Vector3(r.x,r.y,r.z),new h.Vector3(n.x,n.y,n.z))}if(e.boundingSphere!=null){const{center:r,radius:n}=e.boundingSphere;t.boundingSphere=new h.Sphere(new h.Vector3(r.x,r.y,r.z),n)}return t}function je(e){return e instanceof h.WebGLRenderer?e.getContext().getExtension("OES_texture_float_linear")!=null:e.backend.hasFeature?.("float32-filterable")??!1}const ie=128,ae=128,ce=64,He="9627216cc50057994c98a2118f3c4a23765d43b9",Ve=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${He}/packages/core/assets/stbn.bin`,ze="This is not an object",We="This is not a Float16Array object",jt="This constructor is not a subclass of Float16Array",he="The constructor property value is not an object",Xe="Species constructor didn't return TypedArray object",Ye="Derived constructor created TypedArray object which was too small length",Q="Attempting to access detached ArrayBuffer",mt="Cannot convert undefined or null to object",_t="Cannot mix BigInt and other types, use explicit conversions",Ht="@@iterator property is not callable",Vt="Reduce of empty array with no initial value",qe="The comparison function must be either a function or undefined",gt="Offset is out of bounds";function T(e){return(t,...r)=>E(e,t,r)}function W(e,t){return T(G(e,t).get)}const{apply:E,construct:k,defineProperty:zt,get:Tt,getOwnPropertyDescriptor:G,getPrototypeOf:Z,has:It,ownKeys:le,set:Wt,setPrototypeOf:fe}=Reflect,ke=Proxy,{EPSILON:Je,MAX_SAFE_INTEGER:Xt,isFinite:ue,isNaN:j}=Number,{iterator:N,species:Qe,toStringTag:Lt,for:$e}=Symbol,H=Object,{create:ut,defineProperty:K,freeze:Ze,is:Yt}=H,Pt=H.prototype,Ke=Pt.__lookupGetter__?T(Pt.__lookupGetter__):(e,t)=>{if(e==null)throw w(mt);let r=H(e);do{const n=G(r,t);if(n!==void 0)return U(n,"get")?n.get:void 0}while((r=Z(r))!==null)},U=H.hasOwn||T(Pt.hasOwnProperty),de=Array,ye=de.isArray,dt=de.prototype,tr=T(dt.join),er=T(dt.push),rr=T(dt.toLocaleString),Rt=dt[N],nr=T(Rt),{abs:sr,trunc:pe}=Math,yt=ArrayBuffer,or=yt.isView,Ae=yt.prototype,ir=T(Ae.slice),ar=W(Ae,"byteLength"),Ot=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null,cr=Ot&&W(Ot.prototype,"byteLength"),Ut=Z(Uint8Array),hr=Ut.from,S=Ut.prototype,lr=S[N],fr=T(S.keys),ur=T(S.values),dr=T(S.entries),yr=T(S.set),qt=T(S.reverse),pr=T(S.fill),Ar=T(S.copyWithin),kt=T(S.sort),Y=T(S.slice),gr=T(S.subarray),b=W(S,"buffer"),M=W(S,"byteOffset"),y=W(S,"length"),ge=W(S,Lt),Tr=Uint8Array,m=Uint16Array,Jt=(...e)=>E(hr,m,e),Mt=Uint32Array,wr=Float32Array,F=Z([][N]()),pt=T(F.next),br=T((function*(){})().next),Sr=Z(F),Er=DataView.prototype,mr=T(Er.getUint16),w=TypeError,wt=RangeError,Te=WeakSet,we=Te.prototype,_r=T(we.add),Ir=T(we.has),At=WeakMap,Ft=At.prototype,it=T(Ft.get),Pr=T(Ft.has),Bt=T(Ft.set),be=new At,Or=ut(null,{next:{value:function(){const t=it(be,this);return pt(t)}},[N]:{value:function(){return this}}});function J(e){if(e[N]===Rt&&F.next===pt)return e;const t=ut(Or);return Bt(be,t,nr(e)),t}const Se=new At,Ee=ut(Sr,{next:{value:function(){const t=it(Se,this);return br(t)},writable:!0,configurable:!0}});for(const e of le(F))e!=="next"&&K(Ee,e,G(F,e));function Qt(e){const t=ut(Ee);return Bt(Se,t,e),t}function at(e){return e!==null&&typeof e=="object"||typeof e=="function"}function $t(e){return e!==null&&typeof e=="object"}function ct(e){return ge(e)!==void 0}function xt(e){const t=ge(e);return t==="BigInt64Array"||t==="BigUint64Array"}function xr(e){try{return ye(e)?!1:(ar(e),!0)}catch{return!1}}function me(e){if(Ot===null)return!1;try{return cr(e),!0}catch{return!1}}function Nr(e){return xr(e)||me(e)}function Zt(e){return ye(e)?e[N]===Rt&&F.next===pt:!1}function Lr(e){return ct(e)?e[N]===lr&&F.next===pt:!1}function tt(e){if(typeof e!="string")return!1;const t=+e;return e!==t+""||!ue(t)?!1:t===pe(t)}const ht=$e("__Float16Array__");function Rr(e){if(!$t(e))return!1;const t=Z(e);if(!$t(t))return!1;const r=t.constructor;if(r===void 0)return!1;if(!at(r))throw w(he);return It(r,ht)}const Nt=1/Je;function Ur(e){return e+Nt-Nt}const _e=6103515625e-14,Mr=65504,Ie=.0009765625,Kt=Ie*_e,Fr=Ie*Nt;function Br(e){const t=+e;if(!ue(t)||t===0)return t;const r=t>0?1:-1,n=sr(t);if(n<_e)return r*Ur(n/Kt)*Kt;const s=(1+Fr)*n,o=s-(s-n);return o>Mr||j(o)?r*(1/0):r*o}const Pe=new yt(4),Oe=new wr(Pe),xe=new Mt(Pe),_=new m(512),I=new Tr(512);for(let e=0;e<256;++e){const t=e-127;t<-24?(_[e]=0,_[e|256]=32768,I[e]=24,I[e|256]=24):t<-14?(_[e]=1024>>-t-14,_[e|256]=1024>>-t-14|32768,I[e]=-t-1,I[e|256]=-t-1):t<=15?(_[e]=t+15<<10,_[e|256]=t+15<<10|32768,I[e]=13,I[e|256]=13):t<128?(_[e]=31744,_[e|256]=64512,I[e]=24,I[e|256]=24):(_[e]=31744,_[e|256]=64512,I[e]=13,I[e|256]=13)}function O(e){Oe[0]=Br(e);const t=xe[0],r=t>>23&511;return _[r]+((t&8388607)>>I[r])}const Ct=new Mt(2048);for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;(t&8388608)===0;)t<<=1,r-=8388608;t&=-8388609,r+=947912704,Ct[e]=t|r}for(let e=1024;e<2048;++e)Ct[e]=939524096+(e-1024<<13);const X=new Mt(64);for(let e=1;e<31;++e)X[e]=e<<23;X[31]=1199570944;X[32]=2147483648;for(let e=33;e<63;++e)X[e]=2147483648+(e-32<<23);X[63]=3347054592;const Ne=new m(64);for(let e=1;e<64;++e)e!==32&&(Ne[e]=1024);function p(e){const t=e>>10;return xe[0]=Ct[Ne[t]+(e&1023)]+X[t],Oe[0]}function R(e){const t=+e;return j(t)||t===0?0:pe(t)}function bt(e){const t=R(e);return t<0?0:t<Xt?t:Xt}function et(e,t){if(!at(e))throw w(ze);const r=e.constructor;if(r===void 0)return t;if(!at(r))throw w(he);const n=r[Qe];return n??t}function $(e){if(me(e))return!1;try{return ir(e,0,0),!1}catch{}return!0}function te(e,t){const r=j(e),n=j(t);if(r&&n)return 0;if(r)return 1;if(n||e<t)return-1;if(e>t)return 1;if(e===0&&t===0){const s=Yt(e,0),o=Yt(t,0);if(!s&&o)return-1;if(s&&!o)return 1}return 0}const vt=2,lt=new At;function D(e){return Pr(lt,e)||!or(e)&&Rr(e)}function d(e){if(!D(e))throw w(We)}function rt(e,t){const r=D(e),n=ct(e);if(!r&&!n)throw w(Xe);if(typeof t=="number"){let s;if(r){const o=u(e);s=y(o)}else s=y(e);if(s<t)throw w(Ye)}if(xt(e))throw w(_t)}function u(e){const t=it(lt,e);if(t!==void 0){const s=b(t);if($(s))throw w(Q);return t}const r=e.buffer;if($(r))throw w(Q);const n=k(A,[r,e.byteOffset,e.length],e.constructor);return it(lt,n)}function ee(e){const t=y(e),r=[];for(let n=0;n<t;++n)r[n]=p(e[n]);return r}const Le=new Te;for(const e of le(S)){if(e===Lt)continue;const t=G(S,e);U(t,"get")&&typeof t.get=="function"&&_r(Le,t.get)}const Cr=Ze({get(e,t,r){return tt(t)&&U(e,t)?p(Tt(e,t)):Ir(Le,Ke(e,t))?Tt(e,t):Tt(e,t,r)},set(e,t,r,n){return tt(t)&&U(e,t)?Wt(e,t,O(r)):Wt(e,t,r,n)},getOwnPropertyDescriptor(e,t){if(tt(t)&&U(e,t)){const r=G(e,t);return r.value=p(r.value),r}return G(e,t)},defineProperty(e,t,r){return tt(t)&&U(e,t)&&U(r,"value")&&(r.value=O(r.value)),zt(e,t,r)}});class A{constructor(t,r,n){let s;if(D(t))s=k(m,[u(t)],new.target);else if(at(t)&&!Nr(t)){let i,a;if(ct(t)){i=t,a=y(t);const c=b(t);if($(c))throw w(Q);if(xt(t))throw w(_t);const l=new yt(a*vt);s=k(m,[l],new.target)}else{const c=t[N];if(c!=null&&typeof c!="function")throw w(Ht);c!=null?Zt(t)?(i=t,a=t.length):(i=[...t],a=i.length):(i=t,a=bt(i.length)),s=k(m,[a],new.target)}for(let c=0;c<a;++c)s[c]=O(i[c])}else s=k(m,arguments,new.target);const o=new ke(s,Cr);return Bt(lt,o,s),o}static from(t,...r){const n=this;if(!It(n,ht))throw w(jt);if(n===A){if(D(t)&&r.length===0){const f=u(t),g=new m(b(f),M(f),y(f));return new A(b(Y(g)))}if(r.length===0)return new A(b(Jt(t,O)));const c=r[0],l=r[1];return new A(b(Jt(t,function(f,...g){return O(E(c,this,[f,...J(g)]))},l)))}let s,o;const i=t[N];if(i!=null&&typeof i!="function")throw w(Ht);if(i!=null)Zt(t)?(s=t,o=t.length):Lr(t)?(s=t,o=y(t)):(s=[...t],o=s.length);else{if(t==null)throw w(mt);s=H(t),o=bt(s.length)}const a=new n(o);if(r.length===0)for(let c=0;c<o;++c)a[c]=s[c];else{const c=r[0],l=r[1];for(let f=0;f<o;++f)a[f]=E(c,l,[s[f],f])}return a}static of(...t){const r=this;if(!It(r,ht))throw w(jt);const n=t.length;if(r===A){const o=new A(n),i=u(o);for(let a=0;a<n;++a)i[a]=O(t[a]);return o}const s=new r(n);for(let o=0;o<n;++o)s[o]=t[o];return s}keys(){d(this);const t=u(this);return fr(t)}values(){d(this);const t=u(this);return Qt((function*(){for(const r of ur(t))yield p(r)})())}entries(){d(this);const t=u(this);return Qt((function*(){for(const[r,n]of dr(t))yield[r,p(n)]})())}at(t){d(this);const r=u(this),n=y(r),s=R(t),o=s>=0?s:n+s;if(!(o<0||o>=n))return p(r[o])}with(t,r){d(this);const n=u(this),s=y(n),o=R(t),i=o>=0?o:s+o,a=+r;if(i<0||i>=s)throw wt(gt);const c=new m(b(n),M(n),y(n)),l=new A(b(Y(c))),f=u(l);return f[i]=O(a),l}map(t,...r){d(this);const n=u(this),s=y(n),o=r[0],i=et(n,A);if(i===A){const c=new A(s),l=u(c);for(let f=0;f<s;++f){const g=p(n[f]);l[f]=O(E(t,o,[g,f,this]))}return c}const a=new i(s);rt(a,s);for(let c=0;c<s;++c){const l=p(n[c]);a[c]=E(t,o,[l,c,this])}return a}filter(t,...r){d(this);const n=u(this),s=y(n),o=r[0],i=[];for(let l=0;l<s;++l){const f=p(n[l]);E(t,o,[f,l,this])&&er(i,f)}const a=et(n,A),c=new a(i);return rt(c),c}reduce(t,...r){d(this);const n=u(this),s=y(n);if(s===0&&r.length===0)throw w(Vt);let o,i;r.length===0?(o=p(n[0]),i=1):(o=r[0],i=0);for(let a=i;a<s;++a)o=t(o,p(n[a]),a,this);return o}reduceRight(t,...r){d(this);const n=u(this),s=y(n);if(s===0&&r.length===0)throw w(Vt);let o,i;r.length===0?(o=p(n[s-1]),i=s-2):(o=r[0],i=s-1);for(let a=i;a>=0;--a)o=t(o,p(n[a]),a,this);return o}forEach(t,...r){d(this);const n=u(this),s=y(n),o=r[0];for(let i=0;i<s;++i)E(t,o,[p(n[i]),i,this])}find(t,...r){d(this);const n=u(this),s=y(n),o=r[0];for(let i=0;i<s;++i){const a=p(n[i]);if(E(t,o,[a,i,this]))return a}}findIndex(t,...r){d(this);const n=u(this),s=y(n),o=r[0];for(let i=0;i<s;++i){const a=p(n[i]);if(E(t,o,[a,i,this]))return i}return-1}findLast(t,...r){d(this);const n=u(this),s=y(n),o=r[0];for(let i=s-1;i>=0;--i){const a=p(n[i]);if(E(t,o,[a,i,this]))return a}}findLastIndex(t,...r){d(this);const n=u(this),s=y(n),o=r[0];for(let i=s-1;i>=0;--i){const a=p(n[i]);if(E(t,o,[a,i,this]))return i}return-1}every(t,...r){d(this);const n=u(this),s=y(n),o=r[0];for(let i=0;i<s;++i)if(!E(t,o,[p(n[i]),i,this]))return!1;return!0}some(t,...r){d(this);const n=u(this),s=y(n),o=r[0];for(let i=0;i<s;++i)if(E(t,o,[p(n[i]),i,this]))return!0;return!1}set(t,...r){d(this);const n=u(this),s=R(r[0]);if(s<0)throw wt(gt);if(t==null)throw w(mt);if(xt(t))throw w(_t);if(D(t))return yr(u(this),u(t),s);if(ct(t)){const c=b(t);if($(c))throw w(Q)}const o=y(n),i=H(t),a=bt(i.length);if(s===1/0||a+s>o)throw wt(gt);for(let c=0;c<a;++c)n[c+s]=O(i[c])}reverse(){d(this);const t=u(this);return qt(t),this}toReversed(){d(this);const t=u(this),r=new m(b(t),M(t),y(t)),n=new A(b(Y(r))),s=u(n);return qt(s),n}fill(t,...r){d(this);const n=u(this);return pr(n,O(t),...J(r)),this}copyWithin(t,r,...n){d(this);const s=u(this);return Ar(s,t,r,...J(n)),this}sort(t){d(this);const r=u(this),n=t!==void 0?t:te;return kt(r,(s,o)=>n(p(s),p(o))),this}toSorted(t){d(this);const r=u(this);if(t!==void 0&&typeof t!="function")throw new w(qe);const n=t!==void 0?t:te,s=new m(b(r),M(r),y(r)),o=new A(b(Y(s))),i=u(o);return kt(i,(a,c)=>n(p(a),p(c))),o}slice(t,r){d(this);const n=u(this),s=et(n,A);if(s===A){const Ce=new m(b(n),M(n),y(n));return new A(b(Y(Ce,t,r)))}const o=y(n),i=R(t),a=r===void 0?o:R(r);let c;i===-1/0?c=0:i<0?c=o+i>0?o+i:0:c=o<i?o:i;let l;a===-1/0?l=0:a<0?l=o+a>0?o+a:0:l=o<a?o:a;const f=l-c>0?l-c:0,g=new s(f);if(rt(g,f),f===0)return g;const P=b(n);if($(P))throw w(Q);let v=0;for(;c<l;)g[v]=p(n[c]),++c,++v;return g}subarray(t,r){d(this);const n=u(this),s=et(n,A),o=new m(b(n),M(n),y(n)),i=gr(o,t,r),a=new s(b(i),M(i),y(i));return rt(a),a}indexOf(t,...r){d(this);const n=u(this),s=y(n);let o=R(r[0]);if(o===1/0)return-1;o<0&&(o+=s,o<0&&(o=0));for(let i=o;i<s;++i)if(U(n,i)&&p(n[i])===t)return i;return-1}lastIndexOf(t,...r){d(this);const n=u(this),s=y(n);let o=r.length>=1?R(r[0]):s-1;if(o===-1/0)return-1;o>=0?o=o<s-1?o:s-1:o+=s;for(let i=o;i>=0;--i)if(U(n,i)&&p(n[i])===t)return i;return-1}includes(t,...r){d(this);const n=u(this),s=y(n);let o=R(r[0]);if(o===1/0)return!1;o<0&&(o+=s,o<0&&(o=0));const i=j(t);for(let a=o;a<s;++a){const c=p(n[a]);if(i&&j(c)||c===t)return!0}return!1}join(t){d(this);const r=u(this),n=ee(r);return tr(n,t)}toLocaleString(...t){d(this);const r=u(this),n=ee(r);return rr(n,...J(t))}get[Lt](){if(D(this))return"Float16Array"}}K(A,"BYTES_PER_ELEMENT",{value:vt});K(A,ht,{});fe(A,Ut);const ft=A.prototype;K(ft,"BYTES_PER_ELEMENT",{value:vt});K(ft,N,{value:ft.values,writable:!0,configurable:!0});fe(ft,S);function vr(e,t,...r){return p(mr(e,t,...J(r)))}function Dr(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof A||e instanceof Float32Array||e instanceof Float64Array}class Re extends h.Loader{parser;constructor(t,r){super(r),this.parser=t}load(t,r,n,s){const o=new oe(this.manager);o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(this.withCredentials),o.load(t,i=>{try{r(this.parser(i))}catch(a){s!=null?s(a):console.error(a),this.manager.itemError(t)}},n,s)}}function Gr(e){const t=e instanceof Int8Array?h.ByteType:e instanceof Uint8Array||e instanceof Uint8ClampedArray?h.UnsignedByteType:e instanceof Int16Array?h.ShortType:e instanceof Uint16Array?h.UnsignedShortType:e instanceof Int32Array?h.IntType:e instanceof Uint32Array?h.UnsignedIntType:e instanceof A?h.HalfFloatType:e instanceof Float32Array||e instanceof Float64Array?h.FloatType:null;return ne.invariant(t!=null),t}class Ue extends h.Loader{textureClass;parser;options;constructor(t,r,n={},s){super(s),this.textureClass=t,this.parser=r,this.options={format:h.RGBAFormat,minFilter:h.LinearFilter,magFilter:h.LinearFilter,...n}}load(t,r,n,s){const o=new this.textureClass,i=new Re(this.parser,this.manager);return i.setRequestHeader(this.requestHeader),i.setPath(this.path),i.setWithCredentials(this.withCredentials),i.load(t,a=>{o.image.data=a instanceof A?new Uint16Array(a.buffer):a;const{width:c,height:l,depth:f,...g}=this.options;c!=null&&(o.image.width=c),l!=null&&(o.image.height=l),"depth"in o.image&&f!=null&&(o.image.depth=f),o.type=Gr(a),Object.assign(o,g),o.needsUpdate=!0,r?.(o)},n,s),o}}const B=h.MathUtils.clamp,jr=h.MathUtils.euclideanModulo,Hr=h.MathUtils.inverseLerp,Vr=h.MathUtils.lerp,zr=h.MathUtils.degToRad,Wr=h.MathUtils.radToDeg,Xr=h.MathUtils.isPowerOfTwo,Yr=h.MathUtils.ceilPowerOfTwo,qr=h.MathUtils.floorPowerOfTwo,kr=h.MathUtils.normalize;function Jr(e,t,r,n=0,s=1){return h.MathUtils.mapLinear(e,t,r,n,s)}function Qr(e,t,r,n=0,s=1){return B(h.MathUtils.mapLinear(e,t,r,n,s),n,s)}function $r(e,t,r){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function Zr(e){return Math.min(Math.max(e,0),1)}function Kr(e,t,r,n=r){const s=Math.abs(e-t);return s<=n||s<=r*Math.max(Math.abs(e),Math.abs(t))}function tn(e){return(t,r)=>{t instanceof h.Material?Object.defineProperty(t,r,{enumerable:!0,get(){return this.defines?.[e]!=null},set(n){n!==this[r]&&(n?(this.defines??={},this.defines[e]="1"):delete this.defines?.[e],this.needsUpdate=!0)}}):Object.defineProperty(t,r,{enumerable:!0,get(){return this.defines.has(e)},set(n){n!==this[r]&&(n?this.defines.set(e,"1"):this.defines.delete(e),this.setChanged())}})}}function en(e,{min:t=Number.MIN_SAFE_INTEGER,max:r=Number.MAX_SAFE_INTEGER}={}){return(n,s)=>{n instanceof h.Material?Object.defineProperty(n,s,{enumerable:!0,get(){const o=this.defines?.[e];return o!=null?parseInt(o,10):0},set(o){const i=this[s];o!==i&&(this.defines??={},this.defines[e]=B(o,t,r).toFixed(0),this.needsUpdate=!0)}}):Object.defineProperty(n,s,{enumerable:!0,get(){const o=this.defines.get(e);return o!=null?parseInt(o,10):0},set(o){const i=this[s];o!==i&&(this.defines.set(e,B(o,t,r).toFixed(0)),this.setChanged())}})}}function rn(e,{min:t=-1/0,max:r=1/0,precision:n=7}={}){return(s,o)=>{s instanceof h.Material?Object.defineProperty(s,o,{enumerable:!0,get(){const i=this.defines?.[e];return i!=null?parseFloat(i):0},set(i){const a=this[o];i!==a&&(this.defines??={},this.defines[e]=B(i,t,r).toFixed(n),this.needsUpdate=!0)}}):Object.defineProperty(s,o,{enumerable:!0,get(){const i=this.defines.get(e);return i!=null?parseFloat(i):0},set(i){const a=this[o];i!==a&&(this.defines.set(e,B(i,t,r).toFixed(n)),this.setChanged())}})}}function nn(e,{validate:t}={}){return(r,n)=>{r instanceof h.Material?Object.defineProperty(r,n,{enumerable:!0,get(){return this.defines?.[e]??""},set(s){if(s!==this[n]){if(t?.(s)===!1){console.error(`Expression validation failed: ${s}`);return}this.defines??={},this.defines[e]=s,this.needsUpdate=!0}}}):Object.defineProperty(r,n,{enumerable:!0,get(){return this.defines.get(e)??""},set(s){if(s!==this[n]){if(t?.(s)===!1){console.error(`Expression validation failed: ${s}`);return}this.defines.set(e,s),this.setChanged()}}})}}function sn(e,...t){const r={};for(let n=0;n<t.length;n+=2){const s=t[n],o=t[n+1];for(const i of o)r[i]={enumerable:!0,get:()=>s[i],set:a=>{s[i]=a}}}return Object.defineProperties(e,r),e}function on(e,t,r){const n={};for(const s of r)n[s]={enumerable:!0,get:()=>t.uniforms[s].value,set:o=>{t.uniforms[s].value=o}};return Object.defineProperties(e,n),e}class an extends h.Loader{options;constructor(t={},r){super(r),this.options=t}load(t,r,n,s){const{width:o,height:i,depth:a}=this.options,c=new h.Data3DTexture(null,o,i,a),l=new se.EXRLoader(this.manager);return l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(this.withCredentials),l.load(t,f=>{const{image:g}=f;c.image={data:g.data,width:o??g.width,height:i??g.height,depth:a??Math.sqrt(g.height)},c.type=f.type,c.format=f.format,c.colorSpace=f.colorSpace,c.needsUpdate=!0;try{r?.(c)}catch(P){s!=null?s(P):console.error(P),this.manager.itemError(t)}},n,s),c}}class cn extends h.Loader{options;constructor(t={},r){super(r),this.options=t}load(t,r,n,s){const{width:o,height:i}=this.options,a=new h.DataTexture(null,o,i),c=new se.EXRLoader(this.manager);return c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(t,l=>{const{image:f}=l;a.image={data:f.data,width:o??f.width,height:i??f.height},a.type=l.type,a.format=l.format,a.colorSpace=l.colorSpace,a.needsUpdate=!0;try{r?.(a)}catch(g){s!=null?s(g):console.error(g),this.manager.itemError(t)}},n,s),a}}const St=1e-6,nt=new h.Vector3,st=new h.Vector3,L=new h.Vector3,q=new h.Vector3,Et=new h.Vector3,hn=new h.Vector3,ln=new h.Matrix4,fn=new h.Quaternion,un=new h.Ray;class Dt{_distance;heading;_pitch;roll;constructor(t=0,r=0,n=0,s=0){this.distance=t,this.heading=r,this.pitch=n,this.roll=s}get distance(){return this._distance}set distance(t){this._distance=Math.max(t,St)}get pitch(){return this._pitch}set pitch(t){this._pitch=B(t,-Math.PI/2+St,Math.PI/2-St)}set(t,r,n,s){return this.distance=t,this.heading=r,this.pitch=n,s!=null&&(this.roll=s),this}clone(){return new Dt(this.distance,this.heading,this.pitch,this.roll)}copy(t){return this.distance=t.distance,this.heading=t.heading,this.pitch=t.pitch,this.roll=t.roll,this}equals(t){return t.distance===this.distance&&t.heading===this.heading&&t.pitch===this.pitch&&t.roll===this.roll}decompose(t,r,n,s,o=x.Ellipsoid.WGS84){o.getEastNorthUpVectors(t,nt,st,L),s?.copy(L);const i=q.copy(nt).multiplyScalar(Math.cos(this.heading)).add(Et.copy(st).multiplyScalar(Math.sin(this.heading))).multiplyScalar(Math.cos(this.pitch)).add(Et.copy(L).multiplyScalar(Math.sin(this.pitch))).normalize().multiplyScalar(this.distance);if(r.copy(t).sub(i),this.roll!==0){const a=q.copy(t).sub(r).normalize();L.applyQuaternion(fn.setFromAxisAngle(a,this.roll))}n.setFromRotationMatrix(ln.lookAt(r,t,L))}setFromCamera(t,r=x.Ellipsoid.WGS84){const n=q.setFromMatrixPosition(t.matrixWorld),s=Et.set(0,0,.5).unproject(t).sub(n).normalize(),o=r.getIntersection(un.set(n,s));if(o==null)return;this.distance=n.distanceTo(o),r.getEastNorthUpVectors(o,nt,st,L),this.heading=Math.atan2(st.dot(s),nt.dot(s)),this.pitch=Math.asin(L.dot(s));const i=q.copy(t.up).applyQuaternion(t.quaternion),a=hn.copy(s).multiplyScalar(-i.dot(s)).add(i).normalize(),c=q.copy(s).multiplyScalar(-L.dot(s)).add(L).normalize(),l=c.dot(a),f=s.dot(c.cross(a));return this.roll=Math.atan2(f,l),this}}class V{constructor(t=0,r=0,n=0,s=0){this.west=t,this.south=r,this.east=n,this.north=s}static MAX=new V(x.Geodetic.MIN_LONGITUDE,x.Geodetic.MIN_LATITUDE,x.Geodetic.MAX_LONGITUDE,x.Geodetic.MAX_LATITUDE);get width(){let t=this.east;return t<this.west&&(t+=Math.PI*2),t-this.west}get height(){return this.north-this.south}set(t,r,n,s){return this.west=t,this.south=r,this.east=n,this.north=s,this}clone(){return new V(this.west,this.south,this.east,this.north)}copy(t){return this.west=t.west,this.south=t.south,this.east=t.east,this.north=t.north,this}equals(t){return t.west===this.west&&t.south===this.south&&t.east===this.east&&t.north===this.north}at(t,r,n=new x.Geodetic){return n.set(this.west+(this.east-this.west)*t,this.north+(this.south-this.north)*r)}fromArray(t,r=0){return this.west=t[r],this.south=t[r+1],this.east=t[r+2],this.north=t[r+3],this}toArray(t=[],r=0){return t[r]=this.west,t[r+1]=this.south,t[r+2]=this.east,t[r+3]=this.north,t}*[Symbol.iterator](){yield this.west,yield this.south,yield this.east,yield this.north}}const dn=/^[ \t]*#include +"([\w\d./]+)"/gm;function Me(e,t){return e.replace(dn,(r,n)=>{const o=n.split("/").reduce((i,a)=>typeof i!="string"&&i!=null?i[a]:void 0,t);if(typeof o!="string")throw new Error(`Could not find include for ${n}.`);return Me(o,t)})}let ot;function yn(){if(ot!=null)return ot;const e=new Uint32Array([268435456]);return ot=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)[0]===0,ot}function C(e,t,r,n=!0){if(n===yn())return new t(e);const s=Object.assign(new DataView(e),{getFloat16(i,a){return vr(this,i,a)}}),o=new t(s.byteLength/t.BYTES_PER_ELEMENT);for(let i=0,a=0;i<o.length;++i,a+=t.BYTES_PER_ELEMENT)o[i]=s[r](a,n);return o}const Fe=e=>new Uint8Array(e),pn=e=>new Int8Array(e),An=(e,t)=>C(e,Uint16Array,"getUint16",t),gn=(e,t)=>C(e,Int16Array,"getInt16",t),Tn=(e,t)=>C(e,Int32Array,"getInt32",t),wn=(e,t)=>C(e,Uint32Array,"getUint32",t),bn=(e,t)=>C(e,A,"getFloat16",t),Sn=(e,t)=>C(e,Float32Array,"getFloat32",t),En=(e,t)=>C(e,Float64Array,"getFloat64",t);class mn extends Ue{constructor(t){super(h.Data3DTexture,Fe,{format:h.RedFormat,minFilter:h.NearestFilter,magFilter:h.NearestFilter,wrapS:h.RepeatWrapping,wrapT:h.RepeatWrapping,wrapR:h.RepeatWrapping,width:ie,height:ae,depth:ce},t)}}function*Be(e,t,r,n,s){if(r>=n)return;const o=2**r,i=r+1,a=2**i,c=Math.floor(e/o*a),l=Math.floor(t/o*a),f=[[c,l,i],[c+1,l,i],[c,l+1,i],[c+1,l+1,i]];if(i<n)for(const g of f)for(const P of Be(...g,n,s))yield P;else for(const g of f)yield(s??new z).set(...g)}class z{constructor(t=0,r=0,n=0){this.x=t,this.y=r,this.z=n}set(t,r,n){return this.x=t,this.y=r,n!=null&&(this.z=n),this}clone(){return new z(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}getParent(t=new z){const r=2**this.z,n=this.x/r,s=this.y/r,o=this.z-1,i=2**o;return t.set(Math.floor(n*i),Math.floor(s*i),o)}*traverseChildren(t,r){const{x:n,y:s,z:o}=this;for(const i of Be(n,s,o,o+t,r))yield i}fromArray(t,r=0){return this.x=t[r],this.y=t[r+1],this.z=t[r+2],this}toArray(t=[],r=0){return t[r]=this.x,t[r+1]=this.y,t[r+2]=this.z,t}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const re=new h.Vector2;class Gt{constructor(t=2,r=1,n=V.MAX){this.width=t,this.height=r,this.rectangle=n}clone(){return new Gt(this.width,this.height,this.rectangle.clone())}copy(t){return this.width=t.width,this.height=t.height,this.rectangle.copy(t.rectangle),this}getSize(t,r=new h.Vector2){return r.set(this.width<<t,this.height<<t)}getTile(t,r,n=new z){const s=this.getSize(r,re),{rectangle:o}=this,i=o.width/s.x,a=o.height/s.y,{west:c,south:l,east:f}=o;let g=t.longitude;f<c&&(g+=Math.PI*2);let P=Math.floor((g-c)/i);P>=s.x&&(P=s.x-1);let v=Math.floor((t.latitude-l)/a);return v>=s.y&&(v=s.y-1),n.x=P,n.y=v,n.z=r,n}getRectangle(t,r=new V){const n=this.getSize(t.z,re),{rectangle:s}=this,o=s.width/n.x,i=s.height/n.y,{west:a,north:c}=s;return r.west=t.x*o+a,r.east=(t.x+1)*o+a,r.north=c-(n.y-t.y-1)*i,r.south=c-(n.y-t.y)*i,r}}function _n(e){}const In=/#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 Pn(e,t,r,n){let s="";for(let o=parseInt(t,10);o<parseInt(r,10);++o)s+=n.replace(/\[\s*i\s*\]/g,"["+o+"]").replace(/UNROLLED_LOOP_INDEX/g,`${o}`);return s}function On(e){return e.replace(In,Pn)}exports.Ellipsoid=x.Ellipsoid;exports.EllipsoidGeometry=x.EllipsoidGeometry;exports.Geodetic=x.Geodetic;exports.QuadGeometry=ve.QuadGeometry;exports.ArrayBufferLoader=oe;exports.DEFAULT_STBN_URL=Ve;exports.DataTextureLoader=Ue;exports.EXR3DTextureLoader=an;exports.EXRTextureLoader=cn;exports.Float16Array=A;exports.PointOfView=Dt;exports.Rectangle=V;exports.STBNLoader=mn;exports.STBN_TEXTURE_DEPTH=ce;exports.STBN_TEXTURE_HEIGHT=ae;exports.STBN_TEXTURE_WIDTH=ie;exports.TileCoordinate=z;exports.TilingScheme=Gt;exports.TypedArrayLoader=Re;exports.ceilPowerOfTwo=Yr;exports.clamp=B;exports.closeTo=Kr;exports.define=tn;exports.defineExpression=nn;exports.defineFloat=rn;exports.defineInt=en;exports.definePropertyShorthand=sn;exports.defineUniformShorthand=on;exports.degrees=Wr;exports.euclideanModulo=jr;exports.floorPowerOfTwo=qr;exports.fromBufferGeometryLike=Ge;exports.inverseLerp=Hr;exports.isFloatLinearSupported=je;exports.isPowerOfTwo=Xr;exports.isTypedArray=Dr;exports.lerp=Vr;exports.normalize=kr;exports.parseFloat16Array=bn;exports.parseFloat32Array=Sn;exports.parseFloat64Array=En;exports.parseInt16Array=gn;exports.parseInt32Array=Tn;exports.parseInt8Array=pn;exports.parseUint16Array=An;exports.parseUint32Array=wn;exports.parseUint8Array=Fe;exports.radians=zr;exports.reinterpretType=_n;exports.remap=Jr;exports.remapClamped=Qr;exports.resolveIncludes=Me;exports.saturate=Zr;exports.smoothstep=$r;exports.toBufferGeometryLike=De;exports.unrollLoops=On;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|