@needle-tools/engine 3.2.10-alpha → 3.2.11-alpha
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 +3 -0
- package/dist/needle-engine.js +4 -4
- package/dist/needle-engine.min.js +2 -2
- package/dist/needle-engine.umd.cjs +2 -2
- package/lib/engine/engine_mainloop_utils.js +8 -6
- package/lib/engine/engine_mainloop_utils.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_lighting_settings.js +2 -2
- package/lib/engine/extensions/NEEDLE_lighting_settings.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/engine/engine_mainloop_utils.ts +9 -6
- package/src/engine/extensions/NEEDLE_lighting_settings.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,9 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [3.2.11-alpha] - 2023-04-25
|
|
8
|
+
- Fix: lighting settings being implictly switched (enabled/disabled) when using SyncCamera / any loaded prefab at runtime
|
|
9
|
+
|
|
7
10
|
## [3.2.10-alpha] - 2023-04-25
|
|
8
11
|
- Fix: Remove log in `Animator.SetTrigger`
|
|
9
12
|
- Fix: GroundEnv radius property setting wrong value internally
|
package/dist/needle-engine.js
CHANGED
|
@@ -21898,7 +21898,7 @@ function yK(i, A) {
|
|
|
21898
21898
|
const e = i.new_script_start[g];
|
|
21899
21899
|
if (A !== void 0 && e.gameObject !== A || e.destroyed || e.activeAndEnabled === !1)
|
|
21900
21900
|
continue;
|
|
21901
|
-
Ka(e.__internalAwake.bind(e)), Ka(e.__internalEnable.bind(e)), Ka(e.__internalStart.bind(e)), i.new_script_start.splice(g, 1), g
|
|
21901
|
+
Ka(e.__internalAwake.bind(e)), e.enabled && (Ka(e.__internalEnable.bind(e)), Ka(e.__internalStart.bind(e)), i.new_script_start.splice(g, 1), g--);
|
|
21902
21902
|
} catch (e) {
|
|
21903
21903
|
console.error(e), ko(i.new_script_start[g], i), i.new_script_start.splice(g, 1), g--;
|
|
21904
21904
|
}
|
|
@@ -21931,7 +21931,7 @@ function SK(i, A, g, e = 0) {
|
|
|
21931
21931
|
}
|
|
21932
21932
|
const C = i[Ys] !== A;
|
|
21933
21933
|
i[Ys] = A, C && (i1 && console.warn("ACTIVE CHANGE", i.name, I, i.visible, A, "changed?" + C, i), g && C1(i, (s) => {
|
|
21934
|
-
A ? s.enabled && (Ka(s.__internalAwake.bind(s)), s.enabled && (s.__didEnable = !0, s.onEnable())) : s.__didAwake && (s.__didEnable = !1, s.onDisable());
|
|
21934
|
+
A ? s.enabled && (Ka(s.__internalAwake.bind(s)), s.enabled && (s.__didEnable = !0, s.onEnable())) : s.__didAwake && s.enabled && (s.__didEnable = !1, s.onDisable());
|
|
21935
21935
|
}));
|
|
21936
21936
|
let o = !0;
|
|
21937
21937
|
if (i.children) {
|
|
@@ -50110,7 +50110,7 @@ class rZ {
|
|
|
50110
50110
|
}
|
|
50111
50111
|
RI.registerCallback(BC.ContextCreated, (i) => {
|
|
50112
50112
|
const A = i.context, g = eA.findObjectOfType(eS, A);
|
|
50113
|
-
g != null && g.sourceId &&
|
|
50113
|
+
g != null && g.sourceId && (g.enabled = !0);
|
|
50114
50114
|
});
|
|
50115
50115
|
class eS extends xA {
|
|
50116
50116
|
constructor() {
|
|
@@ -50148,7 +50148,7 @@ class eS extends xA {
|
|
|
50148
50148
|
return 2.2 * Ag.lerp(0, 1.33, e);
|
|
50149
50149
|
}
|
|
50150
50150
|
onEnable() {
|
|
50151
|
-
if (Kn && console.warn("💡🟡 >>> Enable lighting", this.sourceId, this), this.ambientMode == nE.Flat) {
|
|
50151
|
+
if (Kn && console.warn("💡🟡 >>> Enable lighting", this.sourceId, this.enabled, this), this.ambientMode == nE.Flat) {
|
|
50152
50152
|
if (this.ambientLight && !this._ambientLightObj) {
|
|
50153
50153
|
const g = this.calculateIntensityFactor(this.ambientLight);
|
|
50154
50154
|
this._ambientLightObj = new d0(this.ambientLight, this.ambientIntensity * g), Kn && console.log("Created ambient light", this.sourceId, this._ambientLightObj, this.ambientIntensity, g);
|
|
@@ -3253,7 +3253,7 @@ in script ${t}.ts
|
|
|
3253
3253
|
uv.y = 1.0 - uv.y;
|
|
3254
3254
|
gl_FragColor = texture2D( map, uv);
|
|
3255
3255
|
// gl_FragColor = vec4(uv.xy, 0, 1);
|
|
3256
|
-
}`),Q(ji,"blipMaterial",new Hg({uniforms:{map:new kA(null)},vertexShader:Vr.vertex,fragmentShader:Vr.fragment})),Q(ji,"mesh",new SA(Vr.planeGeometry,Vr.blipMaterial));function nF(I){return ji.copyTexture(I)}function t3(I,A=!1){return ji.textureToCanvas(I,A)}function i3(I){return typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&I instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&I instanceof ImageBitmap}const C3=Symbol("object"),rF=new uB(()=>new S,20);class EF{constructor(A,g,e,t,i){Q(this,"_point"),Q(this,"_normal"),Q(this,"distance"),Q(this,"impulse"),Q(this,"friction"),this._point=A,this.distance=g,this._normal=e,this.impulse=t,this.friction=i}get point(){return rF.get().set(this._point.x,this._point.y,this._point.z)}get normal(){return rF.get().set(this._normal.x,this._normal.y,this._normal.z)}}class hF{constructor(A,g,e){Q(this,"contacts"),Q(this,"me"),Q(this,"_collider"),Q(this,"_gameObject"),this.me=A,this._collider=g,this._gameObject=g.gameObject,this.contacts=e}get collider(){return this._collider}get gameObject(){return this._gameObject}get rigidBody(){var A;return(A=this.collider)==null?void 0:A.attachedRigidbody}}function mQ(I,A){try{A?I(A):I()}catch(g){return console.error(g),!1}return!0}const wo="needle_isActiveInHierarchy",$B="builtin_components",Xr="needle_editor_guid",o3=nA("debugnewscripts"),s3=nA("debughierarchy"),UI=[];function $r(I){if(!(I.new_scripts.length<=0)){if(o3&&console.log("Register new components",I.new_scripts.length,[...I.new_scripts],I.alias?"element: "+I.alias:I.hash,I),I.new_scripts_pre_setup_callbacks.length>0){for(const A of I.new_scripts_pre_setup_callbacks)A&&A();I.new_scripts_pre_setup_callbacks.length=0}UI.length=0,I.new_scripts.length>0&&UI.push(...I.new_scripts),I.new_scripts.length=0;for(let A=0;A<UI.length;A++)try{const g=UI[A];if(g.destroyed)continue;if(!g.gameObject){console.error("MISSING GAMEOBJECT - will ignore",g),UI.splice(A,1),A--;continue}g.context=I,AE(g.gameObject),NS(g,I)}catch(g){console.error(g),yo(UI[A],I),UI.splice(A,1),A--}for(let A=0;A<UI.length;A++)try{const g=UI[A];if(g.destroyed){yo(UI[A],I),UI.splice(A,1),A--;continue}if(g.registering)try{g.registering()}catch(e){console.error(e)}g.__internalAwake!==void 0&&(g.gameObject||console.error("MISSING GAMEOBJECT",g,g.gameObject),AE(g.gameObject),g.activeAndEnabled&&mQ(g.__internalAwake.bind(g)))}catch(g){console.error(g),yo(UI[A],I),UI.splice(A,1),A--}for(let A=0;A<UI.length;A++)try{const g=UI[A];if(g.destroyed||g.enabled===!1||(AE(g.gameObject),g.activeAndEnabled===!1))continue;g.__internalEnable!==void 0&&(g.enabled=!0,mQ(g.__internalEnable.bind(g)))}catch(g){console.error(g),yo(UI[A],I),UI.splice(A,1),A--}for(let A=0;A<UI.length;A++)try{const g=UI[A];if(g.destroyed||!g.gameObject)continue;I.new_script_start.push(g)}catch(g){console.error(g),yo(UI[A],I),UI.splice(A,1),A--}UI.length=0;for(const A of I.new_scripts_post_setup_callbacks)A&&A();I.new_scripts_post_setup_callbacks.length=0}}function B3(I){I&&(I.__internalDisable(),yo(I,I.context))}function cF(I,A){for(let g=0;g<I.new_script_start.length;g++)try{const e=I.new_script_start[g];if(A!==void 0&&e.gameObject!==A||e.destroyed||e.activeAndEnabled===!1)continue;mQ(e.__internalAwake.bind(e)),mQ(e.__internalEnable.bind(e)),mQ(e.__internalStart.bind(e)),I.new_script_start.splice(g,1),g--}catch(e){console.error(e),yo(I.new_script_start[g],I),I.new_script_start.splice(g,1),g--}}function NS(I,A){A.scripts.indexOf(I)===-1&&(A.scripts.push(I),I.earlyUpdate&&A.scripts_earlyUpdate.push(I),I.update&&A.scripts_update.push(I),I.lateUpdate&&A.scripts_lateUpdate.push(I),I.onBeforeRender&&A.scripts_onBeforeRender.push(I),I.onAfterRender&&A.scripts_onAfterRender.push(I),I.onPausedChanged&&A.scripts_pausedChanged.push(I))}function yo(I,A){So(I,A.new_scripts),So(I,A.new_script_start),So(I,A.scripts),So(I,A.scripts_earlyUpdate),So(I,A.scripts_update),So(I,A.scripts_lateUpdate),So(I,A.scripts_onBeforeRender),So(I,A.scripts_onAfterRender),So(I,A.scripts_pausedChanged),A.stopAllCoroutinesFrom(I)}function So(I,A){const g=A.indexOf(I);g>=0&&A.splice(g,1)}function Sd(I){if(I||(I=oe.Current.scene),!I){console.trace("Invalid call - no current context.");return}const A=FQ(I);lF(I,A,!0)||(console.error('Failed to update active state in hierarchy of "'+I.name+'"',I),console.warn(" \u2191 this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."))}function lF(I,A,g,e=0){if(e>1e3)return console.warn("Hierarchy is too deep (> 1000 level) - will abort updating active state"),!1;const t=FQ(I);if(A&&(A=t,A&&I.parent)){const o=I.parent;A=o[wo],A===void 0&&(o instanceof li||(A=!0))}const i=I[wo]!==A;I[wo]=A,i&&(s3&&console.warn("ACTIVE CHANGE",I.name,t,I.visible,A,"changed?"+i,I),g&&a3(I,o=>{A?o.enabled&&(mQ(o.__internalAwake.bind(o)),o.enabled&&(o.__didEnable=!0,o.onEnable())):o.__didAwake&&(o.__didEnable=!1,o.onDisable())}));let C=!0;if(I.children){const o=e+1;for(const s of I.children)lF(s,A,g,o)===!1&&(C=!1)}return C}function AE(I){let A=!0,g=I,e=!1;for(;g&&g;){if(g.type==="Scene"&&(e=!0),!FQ(g)){A=!1;break}g=g.parent}if(!I){console.error("GO is null");return}I[wo]=A&&e}function a3(I,A){var g;if((g=I.userData)!=null&&g.components)for(const e of I.userData.components)A(e)}const Gd=new Map,dF=Symbol("prewarmFlag"),KS=Symbol("waitingForPrewarm"),JS=nA("debugprewarm");function DF(I,A){!I||I[dF]===!0||I[KS]===!0||(Gd.has(A)||Gd.set(A,[]),I[KS]=!0,Gd.get(A).push(I),JS&&console.debug("register prewarm",I.name))}let qS=null,LS=null;function Q3(I){if(!I)return;const A=Gd.get(I);if(!(A!=null&&A.length))return;const g=I.mainCamera;if(g){JS&&console.log("prewarm",A.length,"objects",[...A]);const e=I.renderer;if(e.compile){const t=I.scene;e.compile(t,g),qS??(qS=new kl(64)),LS??(LS=new py(.001,9999999,qS)),LS.update(e,t);for(const i of A)i[dF]=!0,i[KS]=!1;A.length=0,JS&&console.log("prewarm done")}}}const n3=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function r3(I){return typeof I=="string"&&n3.test(I)}const me=[];for(let I=0;I<256;++I)me.push((I+256).toString(16).slice(1));function E3(I,A=0){return(me[I[A+0]]+me[I[A+1]]+me[I[A+2]]+me[I[A+3]]+"-"+me[I[A+4]]+me[I[A+5]]+"-"+me[I[A+6]]+me[I[A+7]]+"-"+me[I[A+8]]+me[I[A+9]]+"-"+me[I[A+10]]+me[I[A+11]]+me[I[A+12]]+me[I[A+13]]+me[I[A+14]]+me[I[A+15]]).toLowerCase()}function h3(I){if(!r3(I))throw TypeError("Invalid UUID");let A;const g=new Uint8Array(16);return g[0]=(A=parseInt(I.slice(0,8),16))>>>24,g[1]=A>>>16&255,g[2]=A>>>8&255,g[3]=A&255,g[4]=(A=parseInt(I.slice(9,13),16))>>>8,g[5]=A&255,g[6]=(A=parseInt(I.slice(14,18),16))>>>8,g[7]=A&255,g[8]=(A=parseInt(I.slice(19,23),16))>>>8,g[9]=A&255,g[10]=(A=parseInt(I.slice(24,36),16))/1099511627776&255,g[11]=A/4294967296&255,g[12]=A>>>24&255,g[13]=A>>>16&255,g[14]=A>>>8&255,g[15]=A&255,g}function c3(I){I=unescape(encodeURIComponent(I));const A=[];for(let g=0;g<I.length;++g)A.push(I.charCodeAt(g));return A}const l3="6ba7b810-9dad-11d1-80b4-00c04fd430c8",d3="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function D3(I,A,g){function e(t,i,C,o){var s;if(typeof t=="string"&&(t=c3(t)),typeof i=="string"&&(i=h3(i)),((s=i)===null||s===void 0?void 0:s.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let B=new Uint8Array(16+t.length);if(B.set(i),B.set(t,i.length),B=g(B),B[6]=B[6]&15|A,B[8]=B[8]&63|128,C){o=o||0;for(let a=0;a<16;++a)C[o+a]=B[a];return C}return E3(B)}try{e.name=I}catch{}return e.DNS=l3,e.URL=d3,e}function p3(I,A,g,e){switch(I){case 0:return A&g^~A&e;case 1:return A^g^e;case 2:return A&g^A&e^g&e;case 3:return A^g^e}}function bS(I,A){return I<<A|I>>>32-A}function u3(I){const A=[1518500249,1859775393,2400959708,3395469782],g=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof I=="string"){const C=unescape(encodeURIComponent(I));I=[];for(let o=0;o<C.length;++o)I.push(C.charCodeAt(o))}else Array.isArray(I)||(I=Array.prototype.slice.call(I));I.push(128);const e=I.length/4+2,t=Math.ceil(e/16),i=new Array(t);for(let C=0;C<t;++C){const o=new Uint32Array(16);for(let s=0;s<16;++s)o[s]=I[C*64+s*4]<<24|I[C*64+s*4+1]<<16|I[C*64+s*4+2]<<8|I[C*64+s*4+3];i[C]=o}i[t-1][14]=(I.length-1)*8/Math.pow(2,32),i[t-1][14]=Math.floor(i[t-1][14]),i[t-1][15]=(I.length-1)*8&4294967295;for(let C=0;C<t;++C){const o=new Uint32Array(80);for(let E=0;E<16;++E)o[E]=i[C][E];for(let E=16;E<80;++E)o[E]=bS(o[E-3]^o[E-8]^o[E-14]^o[E-16],1);let s=g[0],B=g[1],a=g[2],n=g[3],r=g[4];for(let E=0;E<80;++E){const h=Math.floor(E/20),c=bS(s,5)+p3(h,B,a,n)+r+A[h]+o[E]>>>0;r=n,n=a,a=bS(B,30)>>>0,B=s,s=c}g[0]=g[0]+s>>>0,g[1]=g[1]+B>>>0,g[2]=g[2]+a>>>0,g[3]=g[3]+n>>>0,g[4]=g[4]+r>>>0}return[g[0]>>24&255,g[0]>>16&255,g[0]>>8&255,g[0]&255,g[1]>>24&255,g[1]>>16&255,g[1]>>8&255,g[1]&255,g[2]>>24&255,g[2]>>16&255,g[2]>>8&255,g[2]&255,g[3]>>24&255,g[3]>>16&255,g[3]>>8&255,g[3]&255,g[4]>>24&255,g[4]>>16&255,g[4]>>8&255,g[4]&255]}const w3=D3("v5",80,u3),pF=w3;var ft=(I=>(I[I.OnConnection=0]="OnConnection",I[I.OnRoomJoin=1]="OnRoomJoin",I[I.Queued=2]="Queued",I[I.Immediate=3]="Immediate",I))(ft||{});oe.registerCallback(ai.ContextCreated,I=>{const A=I.context;kF(A),GF(A)});const kd=nA("debugcomponents"),uF="eff8ba80-635d-11ec-90d6-0242ac120003";class yt{constructor(A){Q(this,"_originalSeed"),Q(this,"_seed"),typeof A=="string"&&(A=yt.hash(A)),this._originalSeed=A,this._seed=A}get seed(){return this._seed}set seed(A){this._seed=A}reset(){this._seed=this._originalSeed}generateUUID(A){if(typeof A=="string")return pF(A,uF);const g=this._seed;return this._seed-=1,pF(g.toString(),uF)}initialize(A){typeof A=="string"?this._seed=yt.hash(A):this._seed=A}static createFromString(A){return new yt(this.hash(A))}static hash(A){let g=0;for(let e=0;e<A.length;e++)g=A.charCodeAt(e)+((g<<5)-g);return g}}var wF=(I=>(I.NewInstanceCreated="new-instance-created",I.InstanceDestroyed="instance-destroyed",I))(wF||{});class yF{constructor(A){Q(this,"guid"),this.guid=A}}function fd(I,A,g=!0){if(!I)return;const e=I;if(Ms(I,g),!A){console.warn("Can not send destroy: No networking connection provided",I.guid);return}if(!A.isConnected){console.warn("Can not send destroy: not connected",I.guid);return}let t=I.guid;if(!t&&e.uuid&&(t=e.uuid),!t){console.warn("Can not send destroy: failed to find guid",I);return}const i=new yF(t);A.send("instance-destroyed",i,ft.Queued)}function SF(I,A){const g=new yF(I);A.send("instance-destroyed",g,ft.Queued)}function GF(I){I.connection.beginListen("instance-destroyed",A=>{kd&&console.log("[Remote] Destroyed",I.scene,A);const g=aE(A.guid,I.scene);g&&Ms(g)})}class y3{constructor(A,g,e){Q(this,"filename"),Q(this,"hash"),Q(this,"size"),this.filename=A,this.hash=g,this.size=e}}class S3{constructor(A,g){Q(this,"guid"),Q(this,"originalGuid"),Q(this,"seed"),Q(this,"visible"),Q(this,"hostData"),Q(this,"dontSave"),Q(this,"parent"),Q(this,"position"),Q(this,"rotation"),Q(this,"scale"),this.originalGuid=A,this.guid=g}}function vS(I,A,g,e){var t;const i=I;if(!i.guid)return console.warn("Can not instantiate: No guid",i),null;if(A.context||(A.context=Dg.Current),!A.context)return console.error("Missing network instantiate options / reference to network connection in sync instantiate"),null;const C=A?{...A}:null,{instance:o,seed:s}=G3(i,A);if(o){const B=o;if(B.guid){kd&&console.log("[Local] new instance","gameobject:",o?.guid);const a=new S3(i.guid,B.guid);a.seed=s,C&&(C.position&&(a.position={x:C.position.x,y:C.position.y,z:C.position.z}),C.rotation&&(a.rotation={x:C.rotation.x,y:C.rotation.y,z:C.rotation.z,w:C.rotation.w}),C.scale&&(a.scale={x:C.scale.x,y:C.scale.y,z:C.scale.z})),a.position||(a.position={x:B.position.x,y:B.position.y,z:B.position.z}),a.rotation||(a.rotation={x:B.quaternion.x,y:B.quaternion.y,z:B.quaternion.z,w:B.quaternion.w}),a.scale||(a.scale={x:B.scale.x,y:B.scale.y,z:B.scale.z}),a.visible=i.visible,C!=null&&C.parent&&(typeof C.parent=="string"?a.parent=C.parent:a.parent=C.parent.guid),a.hostData=g,e===!1&&(a.dontSave=!0),(t=A?.context)==null||t.connection.send("new-instance-created",a)}else console.warn("Missing guid, can not send new instance event",B)}return o}function Md(){return Math.random()*9999999}function kF(I){I.connection.beginListen("new-instance-created",async A=>{const g=await k3(A.originalGuid,I.scene);if(!g){console.warn("could not find object that was instantiated: "+A.guid);return}const e=new lC;A.position&&(e.position=new S(A.position.x,A.position.y,A.position.z)),A.rotation&&(e.rotation=new MA(A.rotation.x,A.rotation.y,A.rotation.z,A.rotation.w)),A.scale&&(e.scale=new S(A.scale.x,A.scale.y,A.scale.z)),e.parent=A.parent,A.seed&&(e.idProvider=new yt(A.seed)),e.visible=A.visible,e.context=I,kd&&I.alias&&console.log("[Remote] instantiate in: "+I.alias);const t=QE(g,e);t&&(A.parent==="scene"&&I.scene.add(t),kd&&console.log("[Remote] new instance","gameobject:",t?.guid,g))})}function G3(I,A){const g=Md(),e=A??new lC;e.idProvider=new yt(g);const t=QE(I,e);return{seed:g,instance:t}}const fF={};function MF(I,A){fF[I]=A}async function k3(I,A){const g=fF[I];if(g!=null){const e=await g(I);if(e)return e}return mF(I,A)}function mF(I,A){if(A===null||!I)return null;if(A.guid===I)return A;if(A.children)for(const g of A.children){const e=mF(I,g);if(e)return e}return null}const UF=new Map;function f3(I,A){if(!I)return;if(!A){console.warn("No prototype found",I,I.prototype,I.constructor);return}let g=UF.get(A);g&&g.apply(I)}function M3(I){const A=m3(I.prototype);UF.set(I,A)}function m3(I){return new U3(I)}class U3{constructor(A){Q(this,"$symbol"),Q(this,"extensions"),Q(this,"descriptors"),this.$symbol=Symbol("prototype-extension"),this.extensions=Object.keys(A),this.descriptors=new Array;for(let g=0;g<this.extensions.length;g++){const e=this.extensions[g],t=Object.getOwnPropertyDescriptor(A,e);t&&this.descriptors.push(t)}}apply(A){if(!A[this.$symbol]){A[this.$symbol]=!0;for(let g=0;g<this.extensions.length;g++){const e=this.extensions[g],t=this.descriptors[g];t&&Object.defineProperty(A,e,t)}}}}var gE=(I=>(I.Added="component-added",I.Removing="removing-component",I))(gE||{});const RF=nA("debugcomponentevents");class IE{static addComponentLifecylceEventListener(A,g){this.eventListeners.has(A)&&this.eventListeners.set(A,[]);let e=this.eventListeners.get(A);e||(e=[]),e.push(g),this.eventListeners.set(A,e),RF&&console.log("Added event listener for "+A,this.eventListeners)}static removeComponentLifecylceEventListener(A,g){const e=this.eventListeners.get(A);if(!e)return;const t=e.indexOf(g);t<0||e.splice(t,1)}static dispatchComponentLifecycleEvent(A,g){const e=this.eventListeners.get(A);if(RF&&console.log("Dispatching event "+A,e),!!e)for(const t of e)t(g)}}Q(IE,"eventListeners",new Map);const xS=nA("debuggetcomponent");function R3(I){return I==null||I.isObject3D?I:I.object&&I.object.isObject3D?I.object:I}function YS(I,A){if(!I||!I.userData.components)return;const g=I.userData.components.indexOf(A);g<0||(IE.dispatchComponentLifecycleEvent(gE.Removing,A),A.gameObject=null,I.userData.components.splice(g,1))}function HS(I,A){const g=UQ(I,A);if(g)return g;const e=new A;return fs(I,e)}const F3=new yt("addComponentIdProvider");function fs(I,A,g=!0){I.userData||(I.userData={}),I.userData.components||(I.userData.components=[]),I.userData.components.push(A),A.gameObject=I,(A.guid===void 0||A.guid==="invalid")&&(A.guid=F3.generateUUID()),Ud(I),V0(A);try{g&&A.__internalAwake&&(AE(I),A.__internalAwake()),IE.dispatchComponentLifecycleEvent(gE.Added,A)}catch(e){console.error(e)}return A}function FF(I,A){if(A.gameObject!==I){if(A.gameObject&&A.gameObject.userData.components){const g=A.gameObject.userData.components.indexOf(A);A.gameObject.userData.components.splice(g,1)}if(!I.userData.components)I.userData.components=[];else if(I.userData.components.includes(A))return;I.userData.components.push(A),A.gameObject=I}}function NF(I){if(I.gameObject&&I.gameObject.userData.components){const A=I.gameObject.userData.components.indexOf(I);I.gameObject.userData.components.splice(A,1)}I.__internalDisable&&I.__internalDisable(),I.onDestroy&&I.onDestroy(),yo(I,I.context??Dg.Current),I.__internalDestroy(),I.gameObject=null}let KF=!1;function JF(I,A,g){var e;if(I!=null){if(!I.isObject3D){console.error("Object is not object3D");return}if(!((e=I?.userData)!=null&&e.components))return null;if(typeof A=="string"&&(KF||(KF=!0,console.warn(`Accessing components by name is not supported.
|
|
3256
|
+
}`),Q(ji,"blipMaterial",new Hg({uniforms:{map:new kA(null)},vertexShader:Vr.vertex,fragmentShader:Vr.fragment})),Q(ji,"mesh",new SA(Vr.planeGeometry,Vr.blipMaterial));function nF(I){return ji.copyTexture(I)}function t3(I,A=!1){return ji.textureToCanvas(I,A)}function i3(I){return typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&I instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&I instanceof ImageBitmap}const C3=Symbol("object"),rF=new uB(()=>new S,20);class EF{constructor(A,g,e,t,i){Q(this,"_point"),Q(this,"_normal"),Q(this,"distance"),Q(this,"impulse"),Q(this,"friction"),this._point=A,this.distance=g,this._normal=e,this.impulse=t,this.friction=i}get point(){return rF.get().set(this._point.x,this._point.y,this._point.z)}get normal(){return rF.get().set(this._normal.x,this._normal.y,this._normal.z)}}class hF{constructor(A,g,e){Q(this,"contacts"),Q(this,"me"),Q(this,"_collider"),Q(this,"_gameObject"),this.me=A,this._collider=g,this._gameObject=g.gameObject,this.contacts=e}get collider(){return this._collider}get gameObject(){return this._gameObject}get rigidBody(){var A;return(A=this.collider)==null?void 0:A.attachedRigidbody}}function mQ(I,A){try{A?I(A):I()}catch(g){return console.error(g),!1}return!0}const wo="needle_isActiveInHierarchy",$B="builtin_components",Xr="needle_editor_guid",o3=nA("debugnewscripts"),s3=nA("debughierarchy"),UI=[];function $r(I){if(!(I.new_scripts.length<=0)){if(o3&&console.log("Register new components",I.new_scripts.length,[...I.new_scripts],I.alias?"element: "+I.alias:I.hash,I),I.new_scripts_pre_setup_callbacks.length>0){for(const A of I.new_scripts_pre_setup_callbacks)A&&A();I.new_scripts_pre_setup_callbacks.length=0}UI.length=0,I.new_scripts.length>0&&UI.push(...I.new_scripts),I.new_scripts.length=0;for(let A=0;A<UI.length;A++)try{const g=UI[A];if(g.destroyed)continue;if(!g.gameObject){console.error("MISSING GAMEOBJECT - will ignore",g),UI.splice(A,1),A--;continue}g.context=I,AE(g.gameObject),NS(g,I)}catch(g){console.error(g),yo(UI[A],I),UI.splice(A,1),A--}for(let A=0;A<UI.length;A++)try{const g=UI[A];if(g.destroyed){yo(UI[A],I),UI.splice(A,1),A--;continue}if(g.registering)try{g.registering()}catch(e){console.error(e)}g.__internalAwake!==void 0&&(g.gameObject||console.error("MISSING GAMEOBJECT",g,g.gameObject),AE(g.gameObject),g.activeAndEnabled&&mQ(g.__internalAwake.bind(g)))}catch(g){console.error(g),yo(UI[A],I),UI.splice(A,1),A--}for(let A=0;A<UI.length;A++)try{const g=UI[A];if(g.destroyed||g.enabled===!1||(AE(g.gameObject),g.activeAndEnabled===!1))continue;g.__internalEnable!==void 0&&(g.enabled=!0,mQ(g.__internalEnable.bind(g)))}catch(g){console.error(g),yo(UI[A],I),UI.splice(A,1),A--}for(let A=0;A<UI.length;A++)try{const g=UI[A];if(g.destroyed||!g.gameObject)continue;I.new_script_start.push(g)}catch(g){console.error(g),yo(UI[A],I),UI.splice(A,1),A--}UI.length=0;for(const A of I.new_scripts_post_setup_callbacks)A&&A();I.new_scripts_post_setup_callbacks.length=0}}function B3(I){I&&(I.__internalDisable(),yo(I,I.context))}function cF(I,A){for(let g=0;g<I.new_script_start.length;g++)try{const e=I.new_script_start[g];if(A!==void 0&&e.gameObject!==A||e.destroyed||e.activeAndEnabled===!1)continue;mQ(e.__internalAwake.bind(e)),e.enabled&&(mQ(e.__internalEnable.bind(e)),mQ(e.__internalStart.bind(e)),I.new_script_start.splice(g,1),g--)}catch(e){console.error(e),yo(I.new_script_start[g],I),I.new_script_start.splice(g,1),g--}}function NS(I,A){A.scripts.indexOf(I)===-1&&(A.scripts.push(I),I.earlyUpdate&&A.scripts_earlyUpdate.push(I),I.update&&A.scripts_update.push(I),I.lateUpdate&&A.scripts_lateUpdate.push(I),I.onBeforeRender&&A.scripts_onBeforeRender.push(I),I.onAfterRender&&A.scripts_onAfterRender.push(I),I.onPausedChanged&&A.scripts_pausedChanged.push(I))}function yo(I,A){So(I,A.new_scripts),So(I,A.new_script_start),So(I,A.scripts),So(I,A.scripts_earlyUpdate),So(I,A.scripts_update),So(I,A.scripts_lateUpdate),So(I,A.scripts_onBeforeRender),So(I,A.scripts_onAfterRender),So(I,A.scripts_pausedChanged),A.stopAllCoroutinesFrom(I)}function So(I,A){const g=A.indexOf(I);g>=0&&A.splice(g,1)}function Sd(I){if(I||(I=oe.Current.scene),!I){console.trace("Invalid call - no current context.");return}const A=FQ(I);lF(I,A,!0)||(console.error('Failed to update active state in hierarchy of "'+I.name+'"',I),console.warn(" \u2191 this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."))}function lF(I,A,g,e=0){if(e>1e3)return console.warn("Hierarchy is too deep (> 1000 level) - will abort updating active state"),!1;const t=FQ(I);if(A&&(A=t,A&&I.parent)){const o=I.parent;A=o[wo],A===void 0&&(o instanceof li||(A=!0))}const i=I[wo]!==A;I[wo]=A,i&&(s3&&console.warn("ACTIVE CHANGE",I.name,t,I.visible,A,"changed?"+i,I),g&&a3(I,o=>{A?o.enabled&&(mQ(o.__internalAwake.bind(o)),o.enabled&&(o.__didEnable=!0,o.onEnable())):o.__didAwake&&o.enabled&&(o.__didEnable=!1,o.onDisable())}));let C=!0;if(I.children){const o=e+1;for(const s of I.children)lF(s,A,g,o)===!1&&(C=!1)}return C}function AE(I){let A=!0,g=I,e=!1;for(;g&&g;){if(g.type==="Scene"&&(e=!0),!FQ(g)){A=!1;break}g=g.parent}if(!I){console.error("GO is null");return}I[wo]=A&&e}function a3(I,A){var g;if((g=I.userData)!=null&&g.components)for(const e of I.userData.components)A(e)}const Gd=new Map,dF=Symbol("prewarmFlag"),KS=Symbol("waitingForPrewarm"),JS=nA("debugprewarm");function DF(I,A){!I||I[dF]===!0||I[KS]===!0||(Gd.has(A)||Gd.set(A,[]),I[KS]=!0,Gd.get(A).push(I),JS&&console.debug("register prewarm",I.name))}let qS=null,LS=null;function Q3(I){if(!I)return;const A=Gd.get(I);if(!(A!=null&&A.length))return;const g=I.mainCamera;if(g){JS&&console.log("prewarm",A.length,"objects",[...A]);const e=I.renderer;if(e.compile){const t=I.scene;e.compile(t,g),qS??(qS=new kl(64)),LS??(LS=new py(.001,9999999,qS)),LS.update(e,t);for(const i of A)i[dF]=!0,i[KS]=!1;A.length=0,JS&&console.log("prewarm done")}}}const n3=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function r3(I){return typeof I=="string"&&n3.test(I)}const me=[];for(let I=0;I<256;++I)me.push((I+256).toString(16).slice(1));function E3(I,A=0){return(me[I[A+0]]+me[I[A+1]]+me[I[A+2]]+me[I[A+3]]+"-"+me[I[A+4]]+me[I[A+5]]+"-"+me[I[A+6]]+me[I[A+7]]+"-"+me[I[A+8]]+me[I[A+9]]+"-"+me[I[A+10]]+me[I[A+11]]+me[I[A+12]]+me[I[A+13]]+me[I[A+14]]+me[I[A+15]]).toLowerCase()}function h3(I){if(!r3(I))throw TypeError("Invalid UUID");let A;const g=new Uint8Array(16);return g[0]=(A=parseInt(I.slice(0,8),16))>>>24,g[1]=A>>>16&255,g[2]=A>>>8&255,g[3]=A&255,g[4]=(A=parseInt(I.slice(9,13),16))>>>8,g[5]=A&255,g[6]=(A=parseInt(I.slice(14,18),16))>>>8,g[7]=A&255,g[8]=(A=parseInt(I.slice(19,23),16))>>>8,g[9]=A&255,g[10]=(A=parseInt(I.slice(24,36),16))/1099511627776&255,g[11]=A/4294967296&255,g[12]=A>>>24&255,g[13]=A>>>16&255,g[14]=A>>>8&255,g[15]=A&255,g}function c3(I){I=unescape(encodeURIComponent(I));const A=[];for(let g=0;g<I.length;++g)A.push(I.charCodeAt(g));return A}const l3="6ba7b810-9dad-11d1-80b4-00c04fd430c8",d3="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function D3(I,A,g){function e(t,i,C,o){var s;if(typeof t=="string"&&(t=c3(t)),typeof i=="string"&&(i=h3(i)),((s=i)===null||s===void 0?void 0:s.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let B=new Uint8Array(16+t.length);if(B.set(i),B.set(t,i.length),B=g(B),B[6]=B[6]&15|A,B[8]=B[8]&63|128,C){o=o||0;for(let a=0;a<16;++a)C[o+a]=B[a];return C}return E3(B)}try{e.name=I}catch{}return e.DNS=l3,e.URL=d3,e}function p3(I,A,g,e){switch(I){case 0:return A&g^~A&e;case 1:return A^g^e;case 2:return A&g^A&e^g&e;case 3:return A^g^e}}function bS(I,A){return I<<A|I>>>32-A}function u3(I){const A=[1518500249,1859775393,2400959708,3395469782],g=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof I=="string"){const C=unescape(encodeURIComponent(I));I=[];for(let o=0;o<C.length;++o)I.push(C.charCodeAt(o))}else Array.isArray(I)||(I=Array.prototype.slice.call(I));I.push(128);const e=I.length/4+2,t=Math.ceil(e/16),i=new Array(t);for(let C=0;C<t;++C){const o=new Uint32Array(16);for(let s=0;s<16;++s)o[s]=I[C*64+s*4]<<24|I[C*64+s*4+1]<<16|I[C*64+s*4+2]<<8|I[C*64+s*4+3];i[C]=o}i[t-1][14]=(I.length-1)*8/Math.pow(2,32),i[t-1][14]=Math.floor(i[t-1][14]),i[t-1][15]=(I.length-1)*8&4294967295;for(let C=0;C<t;++C){const o=new Uint32Array(80);for(let E=0;E<16;++E)o[E]=i[C][E];for(let E=16;E<80;++E)o[E]=bS(o[E-3]^o[E-8]^o[E-14]^o[E-16],1);let s=g[0],B=g[1],a=g[2],n=g[3],r=g[4];for(let E=0;E<80;++E){const h=Math.floor(E/20),c=bS(s,5)+p3(h,B,a,n)+r+A[h]+o[E]>>>0;r=n,n=a,a=bS(B,30)>>>0,B=s,s=c}g[0]=g[0]+s>>>0,g[1]=g[1]+B>>>0,g[2]=g[2]+a>>>0,g[3]=g[3]+n>>>0,g[4]=g[4]+r>>>0}return[g[0]>>24&255,g[0]>>16&255,g[0]>>8&255,g[0]&255,g[1]>>24&255,g[1]>>16&255,g[1]>>8&255,g[1]&255,g[2]>>24&255,g[2]>>16&255,g[2]>>8&255,g[2]&255,g[3]>>24&255,g[3]>>16&255,g[3]>>8&255,g[3]&255,g[4]>>24&255,g[4]>>16&255,g[4]>>8&255,g[4]&255]}const w3=D3("v5",80,u3),pF=w3;var ft=(I=>(I[I.OnConnection=0]="OnConnection",I[I.OnRoomJoin=1]="OnRoomJoin",I[I.Queued=2]="Queued",I[I.Immediate=3]="Immediate",I))(ft||{});oe.registerCallback(ai.ContextCreated,I=>{const A=I.context;kF(A),GF(A)});const kd=nA("debugcomponents"),uF="eff8ba80-635d-11ec-90d6-0242ac120003";class yt{constructor(A){Q(this,"_originalSeed"),Q(this,"_seed"),typeof A=="string"&&(A=yt.hash(A)),this._originalSeed=A,this._seed=A}get seed(){return this._seed}set seed(A){this._seed=A}reset(){this._seed=this._originalSeed}generateUUID(A){if(typeof A=="string")return pF(A,uF);const g=this._seed;return this._seed-=1,pF(g.toString(),uF)}initialize(A){typeof A=="string"?this._seed=yt.hash(A):this._seed=A}static createFromString(A){return new yt(this.hash(A))}static hash(A){let g=0;for(let e=0;e<A.length;e++)g=A.charCodeAt(e)+((g<<5)-g);return g}}var wF=(I=>(I.NewInstanceCreated="new-instance-created",I.InstanceDestroyed="instance-destroyed",I))(wF||{});class yF{constructor(A){Q(this,"guid"),this.guid=A}}function fd(I,A,g=!0){if(!I)return;const e=I;if(Ms(I,g),!A){console.warn("Can not send destroy: No networking connection provided",I.guid);return}if(!A.isConnected){console.warn("Can not send destroy: not connected",I.guid);return}let t=I.guid;if(!t&&e.uuid&&(t=e.uuid),!t){console.warn("Can not send destroy: failed to find guid",I);return}const i=new yF(t);A.send("instance-destroyed",i,ft.Queued)}function SF(I,A){const g=new yF(I);A.send("instance-destroyed",g,ft.Queued)}function GF(I){I.connection.beginListen("instance-destroyed",A=>{kd&&console.log("[Remote] Destroyed",I.scene,A);const g=aE(A.guid,I.scene);g&&Ms(g)})}class y3{constructor(A,g,e){Q(this,"filename"),Q(this,"hash"),Q(this,"size"),this.filename=A,this.hash=g,this.size=e}}class S3{constructor(A,g){Q(this,"guid"),Q(this,"originalGuid"),Q(this,"seed"),Q(this,"visible"),Q(this,"hostData"),Q(this,"dontSave"),Q(this,"parent"),Q(this,"position"),Q(this,"rotation"),Q(this,"scale"),this.originalGuid=A,this.guid=g}}function vS(I,A,g,e){var t;const i=I;if(!i.guid)return console.warn("Can not instantiate: No guid",i),null;if(A.context||(A.context=Dg.Current),!A.context)return console.error("Missing network instantiate options / reference to network connection in sync instantiate"),null;const C=A?{...A}:null,{instance:o,seed:s}=G3(i,A);if(o){const B=o;if(B.guid){kd&&console.log("[Local] new instance","gameobject:",o?.guid);const a=new S3(i.guid,B.guid);a.seed=s,C&&(C.position&&(a.position={x:C.position.x,y:C.position.y,z:C.position.z}),C.rotation&&(a.rotation={x:C.rotation.x,y:C.rotation.y,z:C.rotation.z,w:C.rotation.w}),C.scale&&(a.scale={x:C.scale.x,y:C.scale.y,z:C.scale.z})),a.position||(a.position={x:B.position.x,y:B.position.y,z:B.position.z}),a.rotation||(a.rotation={x:B.quaternion.x,y:B.quaternion.y,z:B.quaternion.z,w:B.quaternion.w}),a.scale||(a.scale={x:B.scale.x,y:B.scale.y,z:B.scale.z}),a.visible=i.visible,C!=null&&C.parent&&(typeof C.parent=="string"?a.parent=C.parent:a.parent=C.parent.guid),a.hostData=g,e===!1&&(a.dontSave=!0),(t=A?.context)==null||t.connection.send("new-instance-created",a)}else console.warn("Missing guid, can not send new instance event",B)}return o}function Md(){return Math.random()*9999999}function kF(I){I.connection.beginListen("new-instance-created",async A=>{const g=await k3(A.originalGuid,I.scene);if(!g){console.warn("could not find object that was instantiated: "+A.guid);return}const e=new lC;A.position&&(e.position=new S(A.position.x,A.position.y,A.position.z)),A.rotation&&(e.rotation=new MA(A.rotation.x,A.rotation.y,A.rotation.z,A.rotation.w)),A.scale&&(e.scale=new S(A.scale.x,A.scale.y,A.scale.z)),e.parent=A.parent,A.seed&&(e.idProvider=new yt(A.seed)),e.visible=A.visible,e.context=I,kd&&I.alias&&console.log("[Remote] instantiate in: "+I.alias);const t=QE(g,e);t&&(A.parent==="scene"&&I.scene.add(t),kd&&console.log("[Remote] new instance","gameobject:",t?.guid,g))})}function G3(I,A){const g=Md(),e=A??new lC;e.idProvider=new yt(g);const t=QE(I,e);return{seed:g,instance:t}}const fF={};function MF(I,A){fF[I]=A}async function k3(I,A){const g=fF[I];if(g!=null){const e=await g(I);if(e)return e}return mF(I,A)}function mF(I,A){if(A===null||!I)return null;if(A.guid===I)return A;if(A.children)for(const g of A.children){const e=mF(I,g);if(e)return e}return null}const UF=new Map;function f3(I,A){if(!I)return;if(!A){console.warn("No prototype found",I,I.prototype,I.constructor);return}let g=UF.get(A);g&&g.apply(I)}function M3(I){const A=m3(I.prototype);UF.set(I,A)}function m3(I){return new U3(I)}class U3{constructor(A){Q(this,"$symbol"),Q(this,"extensions"),Q(this,"descriptors"),this.$symbol=Symbol("prototype-extension"),this.extensions=Object.keys(A),this.descriptors=new Array;for(let g=0;g<this.extensions.length;g++){const e=this.extensions[g],t=Object.getOwnPropertyDescriptor(A,e);t&&this.descriptors.push(t)}}apply(A){if(!A[this.$symbol]){A[this.$symbol]=!0;for(let g=0;g<this.extensions.length;g++){const e=this.extensions[g],t=this.descriptors[g];t&&Object.defineProperty(A,e,t)}}}}var gE=(I=>(I.Added="component-added",I.Removing="removing-component",I))(gE||{});const RF=nA("debugcomponentevents");class IE{static addComponentLifecylceEventListener(A,g){this.eventListeners.has(A)&&this.eventListeners.set(A,[]);let e=this.eventListeners.get(A);e||(e=[]),e.push(g),this.eventListeners.set(A,e),RF&&console.log("Added event listener for "+A,this.eventListeners)}static removeComponentLifecylceEventListener(A,g){const e=this.eventListeners.get(A);if(!e)return;const t=e.indexOf(g);t<0||e.splice(t,1)}static dispatchComponentLifecycleEvent(A,g){const e=this.eventListeners.get(A);if(RF&&console.log("Dispatching event "+A,e),!!e)for(const t of e)t(g)}}Q(IE,"eventListeners",new Map);const xS=nA("debuggetcomponent");function R3(I){return I==null||I.isObject3D?I:I.object&&I.object.isObject3D?I.object:I}function YS(I,A){if(!I||!I.userData.components)return;const g=I.userData.components.indexOf(A);g<0||(IE.dispatchComponentLifecycleEvent(gE.Removing,A),A.gameObject=null,I.userData.components.splice(g,1))}function HS(I,A){const g=UQ(I,A);if(g)return g;const e=new A;return fs(I,e)}const F3=new yt("addComponentIdProvider");function fs(I,A,g=!0){I.userData||(I.userData={}),I.userData.components||(I.userData.components=[]),I.userData.components.push(A),A.gameObject=I,(A.guid===void 0||A.guid==="invalid")&&(A.guid=F3.generateUUID()),Ud(I),V0(A);try{g&&A.__internalAwake&&(AE(I),A.__internalAwake()),IE.dispatchComponentLifecycleEvent(gE.Added,A)}catch(e){console.error(e)}return A}function FF(I,A){if(A.gameObject!==I){if(A.gameObject&&A.gameObject.userData.components){const g=A.gameObject.userData.components.indexOf(A);A.gameObject.userData.components.splice(g,1)}if(!I.userData.components)I.userData.components=[];else if(I.userData.components.includes(A))return;I.userData.components.push(A),A.gameObject=I}}function NF(I){if(I.gameObject&&I.gameObject.userData.components){const A=I.gameObject.userData.components.indexOf(I);I.gameObject.userData.components.splice(A,1)}I.__internalDisable&&I.__internalDisable(),I.onDestroy&&I.onDestroy(),yo(I,I.context??Dg.Current),I.__internalDestroy(),I.gameObject=null}let KF=!1;function JF(I,A,g){var e;if(I!=null){if(!I.isObject3D){console.error("Object is not object3D");return}if(!((e=I?.userData)!=null&&e.components))return null;if(typeof A=="string"&&(KF||(KF=!0,console.warn(`Accessing components by name is not supported.
|
|
3257
3257
|
Please use the component type instead. This may keep working in local development but it will fail when bundling your application.
|
|
3258
3258
|
|
|
3259
3259
|
You can import other modules your main module to get access to types
|
|
@@ -3976,7 +3976,7 @@ fflate - fast JavaScript compression/decompression
|
|
|
3976
3976
|
<https://101arrowz.github.io/fflate>
|
|
3977
3977
|
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
|
|
3978
3978
|
version 0.6.9
|
|
3979
|
-
*/var Uq={},GG=function(I){return URL.createObjectURL(new Blob([I],{type:"text/javascript"}))},Rq=function(I){return new Worker(I)};try{URL.revokeObjectURL(GG(""))}catch{GG=function(I){return"data:application/javascript;charset=UTF-8,"+encodeURI(I)},Rq=function(I){return new Worker(I,{type:"module"})}}var UZ=function(I,A,g,e,t){var i=Rq(Uq[A]||(Uq[A]=GG(I)));return i.onerror=function(C){return t(C.error,null)},i.onmessage=function(C){return t(null,C.data)},i.postMessage(g,e),i},Og=Uint8Array,ye=Uint16Array,No=Uint32Array,zQ=new Og([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]),VQ=new Og([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]),LE=new Og([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fq=function(I,A){for(var g=new ye(31),e=0;e<31;++e)g[e]=A+=1<<I[e-1];for(var t=new No(g[30]),e=1;e<30;++e)for(var i=g[e];i<g[e+1];++i)t[i]=i-g[e]<<5|e;return[g,t]},Nq=Fq(zQ,2),kG=Nq[0],JD=Nq[1];kG[28]=258,JD[258]=28;for(var Kq=Fq(VQ,0),Jq=Kq[0],fG=Kq[1],bE=new ye(32768),pI=0;pI<32768;++pI){var Hs=(pI&43690)>>>1|(pI&21845)<<1;Hs=(Hs&52428)>>>2|(Hs&13107)<<2,Hs=(Hs&61680)>>>4|(Hs&3855)<<4,bE[pI]=((Hs&65280)>>>8|(Hs&255)<<8)>>>1}for(var Si=function(I,A,g){for(var e=I.length,t=0,i=new ye(A);t<e;++t)++i[I[t]-1];var C=new ye(A);for(t=0;t<A;++t)C[t]=C[t-1]+i[t-1]<<1;var o;if(g){o=new ye(1<<A);var s=15-A;for(t=0;t<e;++t)if(I[t])for(var B=t<<4|I[t],a=A-I[t],n=C[I[t]-1]++<<a,r=n|(1<<a)-1;n<=r;++n)o[bE[n]>>>s]=B}else for(o=new ye(e),t=0;t<e;++t)I[t]&&(o[t]=bE[C[I[t]-1]++]>>>15-I[t]);return o},Ko=new Og(288),pI=0;pI<144;++pI)Ko[pI]=8;for(var pI=144;pI<256;++pI)Ko[pI]=9;for(var pI=256;pI<280;++pI)Ko[pI]=7;for(var pI=280;pI<288;++pI)Ko[pI]=8;for(var XQ=new Og(32),pI=0;pI<32;++pI)XQ[pI]=5;var qq=Si(Ko,9,0),Lq=Si(Ko,9,1),bq=Si(XQ,5,0),vq=Si(XQ,5,1),qD=function(I){for(var A=I[0],g=1;g<I.length;++g)I[g]>A&&(A=I[g]);return A},Gi=function(I,A,g){var e=A/8|0;return(I[e]|I[e+1]<<8)>>(A&7)&g},LD=function(I,A){var g=A/8|0;return(I[g]|I[g+1]<<8|I[g+2]<<16)>>(A&7)},vE=function(I){return(I/8|0)+(I&7&&1)},ki=function(I,A,g){(A==null||A<0)&&(A=0),(g==null||g>I.length)&&(g=I.length);var e=new(I instanceof ye?ye:I instanceof No?No:Og)(g-A);return e.set(I.subarray(A,g)),e},xE=function(I,A,g){var e=I.length;if(!e||g&&!g.l&&e<5)return A||new Og(0);var t=!A||g,i=!g||g.i;g||(g={}),A||(A=new Og(e*3));var C=function(V){var HA=A.length;if(V>HA){var xA=new Og(Math.max(HA*2,V));xA.set(A),A=xA}},o=g.f||0,s=g.p||0,B=g.b||0,a=g.l,n=g.d,r=g.m,E=g.n,h=e*8;do{if(!a){g.f=o=Gi(I,s,1);var c=Gi(I,s+1,3);if(s+=3,c)if(c==1)a=Lq,n=vq,r=9,E=5;else if(c==2){var l=Gi(I,s,31)+257,d=Gi(I,s+10,15)+4,p=l+Gi(I,s+5,31)+1;s+=14;for(var D=new Og(p),u=new Og(19),w=0;w<d;++w)u[LE[w]]=Gi(I,s+w*3,7);s+=d*3;for(var k=qD(u),m=(1<<k)-1,y=Si(u,k,1),w=0;w<p;){var R=y[Gi(I,s,m)];s+=R&15;var F=R>>>4;if(F<16)D[w++]=F;else{var Y=0,T=0;for(F==16?(T=3+Gi(I,s,3),s+=2,Y=D[w-1]):F==17?(T=3+Gi(I,s,7),s+=3):F==18&&(T=11+Gi(I,s,127),s+=7);T--;)D[w++]=Y}}var v=D.subarray(0,l),L=D.subarray(l);r=qD(v),E=qD(L),a=Si(v,r,1),n=Si(L,E,1)}else throw"invalid block type";else{var F=vE(s)+4,z=I[F-4]|I[F-3]<<8,IA=F+z;if(IA>e){if(i)throw"unexpected EOF";break}t&&C(B+z),A.set(I.subarray(F,IA),B),g.b=B+=z,g.p=s=IA*8;continue}if(s>h){if(i)throw"unexpected EOF";break}}t&&C(B+131072);for(var CA=(1<<r)-1,X=(1<<E)-1,lA=s;;lA=s){var Y=a[LD(I,s)&CA],BA=Y>>>4;if(s+=Y&15,s>h){if(i)throw"unexpected EOF";break}if(!Y)throw"invalid length/literal";if(BA<256)A[B++]=BA;else if(BA==256){lA=s,a=null;break}else{var LA=BA-254;if(BA>264){var w=BA-257,fA=zQ[w];LA=Gi(I,s,(1<<fA)-1)+kG[w],s+=fA}var gA=n[LD(I,s)&X],QA=gA>>>4;if(!gA)throw"invalid distance";s+=gA&15;var L=Jq[QA];if(QA>3){var fA=VQ[QA];L+=LD(I,s)&(1<<fA)-1,s+=fA}if(s>h){if(i)throw"unexpected EOF";break}t&&C(B+131072);for(var UA=B+LA;B<UA;B+=4)A[B]=A[B-L],A[B+1]=A[B+1-L],A[B+2]=A[B+2-L],A[B+3]=A[B+3-L];B=UA}}g.l=a,g.p=lA,g.b=B,a&&(o=1,g.m=r,g.d=n,g.n=E)}while(!o);return B==A.length?A:ki(A,0,B)},fC=function(I,A,g){g<<=A&7;var e=A/8|0;I[e]|=g,I[e+1]|=g>>>8},$Q=function(I,A,g){g<<=A&7;var e=A/8|0;I[e]|=g,I[e+1]|=g>>>8,I[e+2]|=g>>>16},bD=function(I,A){for(var g=[],e=0;e<I.length;++e)I[e]&&g.push({s:e,f:I[e]});var t=g.length,i=g.slice();if(!t)return[Jo,0];if(t==1){var C=new Og(g[0].s+1);return C[g[0].s]=1,[C,1]}g.sort(function(w,k){return w.f-k.f}),g.push({s:-1,f:25001});var o=g[0],s=g[1],B=0,a=1,n=2;for(g[0]={s:-1,f:o.f+s.f,l:o,r:s};a!=t-1;)o=g[g[B].f<g[n].f?B++:n++],s=g[B!=a&&g[B].f<g[n].f?B++:n++],g[a++]={s:-1,f:o.f+s.f,l:o,r:s};for(var r=i[0].s,e=1;e<t;++e)i[e].s>r&&(r=i[e].s);var E=new ye(r+1),h=vD(g[a-1],E,0);if(h>A){var e=0,c=0,l=h-A,d=1<<l;for(i.sort(function(k,m){return E[m.s]-E[k.s]||k.f-m.f});e<t;++e){var p=i[e].s;if(E[p]>A)c+=d-(1<<h-E[p]),E[p]=A;else break}for(c>>>=l;c>0;){var D=i[e].s;E[D]<A?c-=1<<A-E[D]++-1:++e}for(;e>=0&&c;--e){var u=i[e].s;E[u]==A&&(--E[u],++c)}h=A}return[new Og(E),h]},vD=function(I,A,g){return I.s==-1?Math.max(vD(I.l,A,g+1),vD(I.r,A,g+1)):A[I.s]=g},MG=function(I){for(var A=I.length;A&&!I[--A];);for(var g=new ye(++A),e=0,t=I[0],i=1,C=function(s){g[e++]=s},o=1;o<=A;++o)if(I[o]==t&&o!=A)++i;else{if(!t&&i>2){for(;i>138;i-=138)C(32754);i>2&&(C(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(C(t),--i;i>6;i-=6)C(8304);i>2&&(C(i-3<<5|8208),i=0)}for(;i--;)C(t);i=1,t=I[o]}return[g.subarray(0,e),A]},An=function(I,A){for(var g=0,e=0;e<A.length;++e)g+=I[e]*A[e];return g},YE=function(I,A,g){var e=g.length,t=vE(A+2);I[t]=e&255,I[t+1]=e>>>8,I[t+2]=I[t]^255,I[t+3]=I[t+1]^255;for(var i=0;i<e;++i)I[t+i+4]=g[i];return(t+4+e)*8},mG=function(I,A,g,e,t,i,C,o,s,B,a){fC(A,a++,g),++t[256];for(var n=bD(t,15),r=n[0],E=n[1],h=bD(i,15),c=h[0],l=h[1],d=MG(r),p=d[0],D=d[1],u=MG(c),w=u[0],k=u[1],m=new ye(19),y=0;y<p.length;++y)m[p[y]&31]++;for(var y=0;y<w.length;++y)m[w[y]&31]++;for(var R=bD(m,7),F=R[0],Y=R[1],T=19;T>4&&!F[LE[T-1]];--T);var v=B+5<<3,L=An(t,Ko)+An(i,XQ)+C,z=An(t,r)+An(i,c)+C+14+3*T+An(m,F)+(2*m[16]+3*m[17]+7*m[18]);if(v<=L&&v<=z)return YE(A,a,I.subarray(s,s+B));var IA,CA,X,lA;if(fC(A,a,1+(z<L)),a+=2,z<L){IA=Si(r,E,0),CA=r,X=Si(c,l,0),lA=c;var BA=Si(F,Y,0);fC(A,a,D-257),fC(A,a+5,k-1),fC(A,a+10,T-4),a+=14;for(var y=0;y<T;++y)fC(A,a+3*y,F[LE[y]]);a+=3*T;for(var LA=[p,w],fA=0;fA<2;++fA)for(var gA=LA[fA],y=0;y<gA.length;++y){var QA=gA[y]&31;fC(A,a,BA[QA]),a+=F[QA],QA>15&&(fC(A,a,gA[y]>>>5&127),a+=gA[y]>>>12)}}else IA=qq,CA=Ko,X=bq,lA=XQ;for(var y=0;y<o;++y)if(e[y]>255){var QA=e[y]>>>18&31;$Q(A,a,IA[QA+257]),a+=CA[QA+257],QA>7&&(fC(A,a,e[y]>>>23&31),a+=zQ[QA]);var UA=e[y]&31;$Q(A,a,X[UA]),a+=lA[UA],UA>3&&($Q(A,a,e[y]>>>5&8191),a+=VQ[UA])}else $Q(A,a,IA[e[y]]),a+=CA[e[y]];return $Q(A,a,IA[256]),a+CA[256]},xq=new No([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jo=new Og(0),Yq=function(I,A,g,e,t,i){var C=I.length,o=new Og(e+C+5*(1+Math.ceil(C/7e3))+t),s=o.subarray(e,o.length-t),B=0;if(!A||C<8)for(var a=0;a<=C;a+=65535){var n=a+65535;n<C?B=YE(s,B,I.subarray(a,n)):(s[a]=i,B=YE(s,B,I.subarray(a,C)))}else{for(var r=xq[A-1],E=r>>>13,h=r&8191,c=(1<<g)-1,l=new ye(32768),d=new ye(c+1),p=Math.ceil(g/3),D=2*p,u=function(vA){return(I[vA]^I[vA+1]<<p^I[vA+2]<<D)&c},w=new No(25e3),k=new ye(288),m=new ye(32),y=0,R=0,a=0,F=0,Y=0,T=0;a<C;++a){var v=u(a),L=a&32767,z=d[v];if(l[L]=z,d[v]=L,Y<=a){var IA=C-a;if((y>7e3||F>24576)&&IA>423){B=mG(I,s,0,w,k,m,R,F,T,a-T,B),F=y=R=0,T=a;for(var CA=0;CA<286;++CA)k[CA]=0;for(var CA=0;CA<30;++CA)m[CA]=0}var X=2,lA=0,BA=h,LA=L-z&32767;if(IA>2&&v==u(a-LA))for(var fA=Math.min(E,IA)-1,gA=Math.min(32767,a),QA=Math.min(258,IA);LA<=gA&&--BA&&L!=z;){if(I[a+X]==I[a+X-LA]){for(var UA=0;UA<QA&&I[a+UA]==I[a+UA-LA];++UA);if(UA>X){if(X=UA,lA=LA,UA>fA)break;for(var V=Math.min(LA,UA-2),HA=0,CA=0;CA<V;++CA){var xA=a-LA+CA+32768&32767,KA=l[xA],pA=xA-KA+32768&32767;pA>HA&&(HA=pA,z=xA)}}}L=z,z=l[L],LA+=L-z+32768&32767}if(lA){w[F++]=268435456|JD[X]<<18|fG[lA];var hA=JD[X]&31,uA=fG[lA]&31;R+=zQ[hA]+VQ[uA],++k[257+hA],++m[uA],Y=a+X,++y}else w[F++]=I[a],++k[I[a]]}}B=mG(I,s,i,w,k,m,R,F,T,a-T,B),!i&&B&7&&(B=YE(s,B+1,Jo))}return ki(o,0,e+vE(B)+t)},Hq=function(){for(var I=new No(256),A=0;A<256;++A){for(var g=A,e=9;--e;)g=(g&1&&3988292384)^g>>>1;I[A]=g}return I}(),gn=function(){var I=-1;return{p:function(A){for(var g=I,e=0;e<A.length;++e)g=Hq[g&255^A[e]]^g>>>8;I=g},d:function(){return~I}}},UG=function(){var I=1,A=0;return{p:function(g){for(var e=I,t=A,i=g.length,C=0;C!=i;){for(var o=Math.min(C+2655,i);C<o;++C)t+=e+=g[C];e=(e&65535)+15*(e>>16),t=(t&65535)+15*(t>>16)}I=e,A=t},d:function(){return I%=65521,A%=65521,(I&255)<<24|I>>>8<<16|(A&255)<<8|A>>>8}}},Ba=function(I,A,g,e,t){return Yq(I,A.level==null?6:A.level,A.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(I.length)))*1.5):12+A.mem,g,e,!t)},HE=function(I,A){var g={};for(var e in I)g[e]=I[e];for(var e in A)g[e]=A[e];return g},Tq=function(I,A,g){for(var e=I(),t=I.toString(),i=t.slice(t.indexOf("[")+1,t.lastIndexOf("]")).replace(/ /g,"").split(","),C=0;C<e.length;++C){var o=e[C],s=i[C];if(typeof o=="function"){A+=";"+s+"=";var B=o.toString();if(o.prototype)if(B.indexOf("[native code]")!=-1){var a=B.indexOf(" ",8)+1;A+=B.slice(a,B.indexOf("(",a))}else{A+=B;for(var n in o.prototype)A+=";"+s+".prototype."+n+"="+o.prototype[n].toString()}else A+=B}else g[s]=o}return[A,g]},xD=[],RZ=function(I){var A=[];for(var g in I)(I[g]instanceof Og||I[g]instanceof ye||I[g]instanceof No)&&A.push((I[g]=new I[g].constructor(I[g])).buffer);return A},Oq=function(I,A,g,e){var t;if(!xD[g]){for(var i="",C={},o=I.length-1,s=0;s<o;++s)t=Tq(I[s],i,C),i=t[0],C=t[1];xD[g]=Tq(I[o],i,C)}var B=HE({},xD[g][1]);return UZ(xD[g][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+A.toString()+"}",g,B,RZ(B),e)},In=function(){return[Og,ye,No,zQ,VQ,LE,kG,Jq,Lq,vq,bE,Si,qD,Gi,LD,vE,ki,xE,on,Ts,RG]},en=function(){return[Og,ye,No,zQ,VQ,LE,JD,fG,qq,Ko,bq,XQ,bE,xq,Jo,Si,fC,$Q,bD,vD,MG,An,YE,mG,vE,ki,Yq,Ba,TE,Ts]},Pq=function(){return[NG,JG,iI,gn,Hq]},_q=function(){return[KG,Zq]},jq=function(){return[qG,iI,UG]},Wq=function(){return[zq]},Ts=function(I){return postMessage(I,[I.buffer])},RG=function(I){return I&&I.size&&new Og(I.size)},tn=function(I,A,g,e,t,i){var C=Oq(g,e,t,function(o,s){C.terminate(),i(o,s)});return C.postMessage([I,A],A.consume?[I.buffer]:[]),function(){C.terminate()}},fi=function(I){return I.ondata=function(A,g){return postMessage([A,g],[A.buffer])},function(A){return I.push(A.data[0],A.data[1])}},Cn=function(I,A,g,e,t){var i,C=Oq(I,e,t,function(o,s){o?(C.terminate(),A.ondata.call(A,o)):(s[1]&&C.terminate(),A.ondata.call(A,o,s[0],s[1]))});C.postMessage(g),A.push=function(o,s){if(i)throw"stream finished";if(!A.ondata)throw"no stream handler";C.postMessage([o,i=s],[o.buffer])},A.terminate=function(){C.terminate()}},ct=function(I,A){return I[A]|I[A+1]<<8},HI=function(I,A){return(I[A]|I[A+1]<<8|I[A+2]<<16|I[A+3]<<24)>>>0},FG=function(I,A){return HI(I,A)+HI(I,A+4)*4294967296},iI=function(I,A,g){for(;g;++A)I[A]=g,g>>>=8},NG=function(I,A){var g=A.filename;if(I[0]=31,I[1]=139,I[2]=8,I[8]=A.level<2?4:A.level==9?2:0,I[9]=3,A.mtime!=0&&iI(I,4,Math.floor(new Date(A.mtime||Date.now())/1e3)),g){I[3]=8;for(var e=0;e<=g.length;++e)I[e+10]=g.charCodeAt(e)}},KG=function(I){if(I[0]!=31||I[1]!=139||I[2]!=8)throw"invalid gzip data";var A=I[3],g=10;A&4&&(g+=I[10]|(I[11]<<8)+2);for(var e=(A>>3&1)+(A>>4&1);e>0;e-=!I[g++]);return g+(A&2)},Zq=function(I){var A=I.length;return(I[A-4]|I[A-3]<<8|I[A-2]<<16|I[A-1]<<24)>>>0},JG=function(I){return 10+(I.filename&&I.filename.length+1||0)},qG=function(I,A){var g=A.level,e=g==0?0:g<6?1:g==9?3:2;I[0]=120,I[1]=e<<6|(e?32-2*e:1)},zq=function(I){if((I[0]&15)!=8||I[0]>>>4>7||(I[0]<<8|I[1])%31)throw"invalid zlib data";if(I[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function LG(I,A){return!A&&typeof I=="function"&&(A=I,I={}),this.ondata=A,I}var MC=function(){function I(A,g){!g&&typeof A=="function"&&(g=A,A={}),this.ondata=g,this.o=A||{}}return I.prototype.p=function(A,g){this.ondata(Ba(A,this.o,0,0,!g),g)},I.prototype.push=function(A,g){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=g,this.p(A,g||!1)},I}(),Vq=function(){function I(A,g){Cn([en,function(){return[fi,MC]}],this,LG.call(this,A,g),function(e){var t=new MC(e.data);onmessage=fi(t)},6)}return I}();function Xq(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[en],function(e){return Ts(TE(e.data[0],e.data[1]))},0,g)}function TE(I,A){return Ba(I,A||{},0,0)}var Ft=function(){function I(A){this.s={},this.p=new Og(0),this.ondata=A}return I.prototype.e=function(A){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var g=this.p.length,e=new Og(g+A.length);e.set(this.p),e.set(A,g),this.p=e},I.prototype.c=function(A){this.d=this.s.i=A||!1;var g=this.s.b,e=xE(this.p,this.o,this.s);this.ondata(ki(e,g,this.s.b),this.d),this.o=ki(e,this.s.b-32768),this.s.b=this.o.length,this.p=ki(this.p,this.s.p/8|0),this.s.p&=7},I.prototype.push=function(A,g){this.e(A),this.c(g)},I}(),bG=function(){function I(A){this.ondata=A,Cn([In,function(){return[fi,Ft]}],this,0,function(){var g=new Ft;onmessage=fi(g)},7)}return I}();function vG(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[In],function(e){return Ts(on(e.data[0],RG(e.data[1])))},1,g)}function on(I,A){return xE(I,A)}var YD=function(){function I(A,g){this.c=gn(),this.l=0,this.v=1,MC.call(this,A,g)}return I.prototype.push=function(A,g){MC.prototype.push.call(this,A,g)},I.prototype.p=function(A,g){this.c.p(A),this.l+=A.length;var e=Ba(A,this.o,this.v&&JG(this.o),g&&8,!g);this.v&&(NG(e,this.o),this.v=0),g&&(iI(e,e.length-8,this.c.d()),iI(e,e.length-4,this.l)),this.ondata(e,g)},I}(),$q=function(){function I(A,g){Cn([en,Pq,function(){return[fi,MC,YD]}],this,LG.call(this,A,g),function(e){var t=new YD(e.data);onmessage=fi(t)},8)}return I}();function AL(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[en,Pq,function(){return[HD]}],function(e){return Ts(HD(e.data[0],e.data[1]))},2,g)}function HD(I,A){A||(A={});var g=gn(),e=I.length;g.p(I);var t=Ba(I,A,JG(A),8),i=t.length;return NG(t,A),iI(t,i-8,g.d()),iI(t,i-4,e),t}var TD=function(){function I(A){this.v=1,Ft.call(this,A)}return I.prototype.push=function(A,g){if(Ft.prototype.e.call(this,A),this.v){var e=this.p.length>3?KG(this.p):4;if(e>=this.p.length&&!g)return;this.p=this.p.subarray(e),this.v=0}if(g){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Ft.prototype.c.call(this,g)},I}(),gL=function(){function I(A){this.ondata=A,Cn([In,_q,function(){return[fi,Ft,TD]}],this,0,function(){var g=new TD;onmessage=fi(g)},9)}return I}();function IL(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[In,_q,function(){return[OD]}],function(e){return Ts(OD(e.data[0]))},3,g)}function OD(I,A){return xE(I.subarray(KG(I),-8),A||new Og(Zq(I)))}var xG=function(){function I(A,g){this.c=UG(),this.v=1,MC.call(this,A,g)}return I.prototype.push=function(A,g){MC.prototype.push.call(this,A,g)},I.prototype.p=function(A,g){this.c.p(A);var e=Ba(A,this.o,this.v&&2,g&&4,!g);this.v&&(qG(e,this.o),this.v=0),g&&iI(e,e.length-4,this.c.d()),this.ondata(e,g)},I}(),FZ=function(){function I(A,g){Cn([en,jq,function(){return[fi,MC,xG]}],this,LG.call(this,A,g),function(e){var t=new xG(e.data);onmessage=fi(t)},10)}return I}();function NZ(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[en,jq,function(){return[YG]}],function(e){return Ts(YG(e.data[0],e.data[1]))},4,g)}function YG(I,A){A||(A={});var g=UG();g.p(I);var e=Ba(I,A,2,4);return qG(e,A),iI(e,e.length-4,g.d()),e}var PD=function(){function I(A){this.v=1,Ft.call(this,A)}return I.prototype.push=function(A,g){if(Ft.prototype.e.call(this,A),this.v){if(this.p.length<2&&!g)return;this.p=this.p.subarray(2),this.v=0}if(g){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Ft.prototype.c.call(this,g)},I}(),eL=function(){function I(A){this.ondata=A,Cn([In,Wq,function(){return[fi,Ft,PD]}],this,0,function(){var g=new PD;onmessage=fi(g)},11)}return I}();function tL(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[In,Wq,function(){return[Os]}],function(e){return Ts(Os(e.data[0],RG(e.data[1])))},5,g)}function Os(I,A){return xE((zq(I),I.subarray(2,-4)),A)}var iL=function(){function I(A){this.G=TD,this.I=Ft,this.Z=PD,this.ondata=A}return I.prototype.push=function(A,g){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(A,g);else{if(this.p&&this.p.length){var e=new Og(this.p.length+A.length);e.set(this.p),e.set(A,this.p.length)}else this.p=A;if(this.p.length>2){var t=this,i=function(){t.ondata.apply(t,arguments)};this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(i):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,g),this.p=null}}},I}(),KZ=function(){function I(A){this.G=gL,this.I=bG,this.Z=eL,this.ondata=A}return I.prototype.push=function(A,g){iL.prototype.push.call(this,A,g)},I}();function JZ(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return I[0]==31&&I[1]==139&&I[2]==8?IL(I,A,g):(I[0]&15)!=8||I[0]>>4>7||(I[0]<<8|I[1])%31?vG(I,A,g):tL(I,A,g)}function qZ(I,A){return I[0]==31&&I[1]==139&&I[2]==8?OD(I,A):(I[0]&15)!=8||I[0]>>4>7||(I[0]<<8|I[1])%31?on(I,A):Os(I,A)}var HG=function(I,A,g,e){for(var t in I){var i=I[t],C=A+t;i instanceof Og?g[C]=[i,e]:Array.isArray(i)?g[C]=[i[0],HE(e,i[1])]:HG(i,C+"/",g,e)}},CL=typeof TextEncoder<"u"&&new TextEncoder,TG=typeof TextDecoder<"u"&&new TextDecoder,oL=0;try{TG.decode(Jo,{stream:!0}),oL=1}catch{}var sL=function(I){for(var A="",g=0;;){var e=I[g++],t=(e>127)+(e>223)+(e>239);if(g+t>I.length)return[A,ki(I,g-1)];t?t==3?(e=((e&15)<<18|(I[g++]&63)<<12|(I[g++]&63)<<6|I[g++]&63)-65536,A+=String.fromCharCode(55296|e>>10,56320|e&1023)):t&1?A+=String.fromCharCode((e&31)<<6|I[g++]&63):A+=String.fromCharCode((e&15)<<12|(I[g++]&63)<<6|I[g++]&63):A+=String.fromCharCode(e)}},LZ=function(){function I(A){this.ondata=A,oL?this.t=new TextDecoder:this.p=Jo}return I.prototype.push=function(A,g){if(!this.ondata)throw"no callback";if(g=!!g,this.t){if(this.ondata(this.t.decode(A,{stream:!0}),g),g){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}return}if(!this.p)throw"stream finished";var e=new Og(this.p.length+A.length);e.set(this.p),e.set(A,this.p.length);var t=sL(e),i=t[0],C=t[1];if(g){if(C.length)throw"invalid utf-8 data";this.p=null}else this.p=C;this.ondata(i,g)},I}(),bZ=function(){function I(A){this.ondata=A}return I.prototype.push=function(A,g){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(mC(A),this.d=g||!1)},I}();function mC(I,A){if(A){for(var g=new Og(I.length),e=0;e<I.length;++e)g[e]=I.charCodeAt(e);return g}if(CL)return CL.encode(I);for(var t=I.length,i=new Og(I.length+(I.length>>1)),C=0,o=function(n){i[C++]=n},e=0;e<t;++e){if(C+5>i.length){var s=new Og(C+8+(t-e<<1));s.set(i),i=s}var B=I.charCodeAt(e);B<128||A?o(B):B<2048?(o(192|B>>6),o(128|B&63)):B>55295&&B<57344?(B=65536+(B&1023<<10)|I.charCodeAt(++e)&1023,o(240|B>>18),o(128|B>>12&63),o(128|B>>6&63),o(128|B&63)):(o(224|B>>12),o(128|B>>6&63),o(128|B&63))}return ki(i,0,C)}function OG(I,A){if(A){for(var g="",e=0;e<I.length;e+=16384)g+=String.fromCharCode.apply(null,I.subarray(e,e+16384));return g}else{if(TG)return TG.decode(I);var t=sL(I),i=t[0],C=t[1];if(C.length)throw"invalid utf-8 data";return i}}var BL=function(I){return I==1?3:I<6?2:I==9?1:0},aL=function(I,A){return A+30+ct(I,A+26)+ct(I,A+28)},QL=function(I,A,g){var e=ct(I,A+28),t=OG(I.subarray(A+46,A+46+e),!(ct(I,A+8)&2048)),i=A+46+e,C=HI(I,A+20),o=g&&C==4294967295?nL(I,i):[C,HI(I,A+24),HI(I,A+42)],s=o[0],B=o[1],a=o[2];return[ct(I,A+10),s,B,t,i+ct(I,A+30)+ct(I,A+32),a]},nL=function(I,A){for(;ct(I,A)!=1;A+=4+ct(I,A+2));return[FG(I,A+12),FG(I,A+4),FG(I,A+20)]},Ps=function(I){var A=0;if(I)for(var g in I){var e=I[g].length;if(e>65535)throw"extra field too long";A+=e+4}return A},sn=function(I,A,g,e,t,i,C,o){var s=e.length,B=g.extra,a=o&&o.length,n=Ps(B);iI(I,A,C!=null?33639248:67324752),A+=4,C!=null&&(I[A++]=20,I[A++]=g.os),I[A]=20,A+=2,I[A++]=g.flag<<1|(i==null&&8),I[A++]=t&&8,I[A++]=g.compression&255,I[A++]=g.compression>>8;var r=new Date(g.mtime==null?Date.now():g.mtime),E=r.getFullYear()-1980;if(E<0||E>119)throw"date not in range 1980-2099";if(iI(I,A,E<<25|r.getMonth()+1<<21|r.getDate()<<16|r.getHours()<<11|r.getMinutes()<<5|r.getSeconds()>>>1),A+=4,i!=null&&(iI(I,A,g.crc),iI(I,A+4,i),iI(I,A+8,g.size)),iI(I,A+12,s),iI(I,A+14,n),A+=16,C!=null&&(iI(I,A,a),iI(I,A+6,g.attrs),iI(I,A+10,C),A+=14),I.set(e,A),A+=s,n)for(var h in B){var c=B[h],l=c.length;iI(I,A,+h),iI(I,A+2,l),I.set(c,A+4),A+=4+l}return a&&(I.set(o,A),A+=a),A},PG=function(I,A,g,e,t){iI(I,A,101010256),iI(I,A+8,g),iI(I,A+10,g),iI(I,A+12,e),iI(I,A+16,t)},OE=function(){function I(A){this.filename=A,this.c=gn(),this.size=0,this.compression=0}return I.prototype.process=function(A,g){this.ondata(null,A,g)},I.prototype.push=function(A,g){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(A),this.size+=A.length,g&&(this.crc=this.c.d()),this.process(A,g||!1)},I}(),vZ=function(){function I(A,g){var e=this;g||(g={}),OE.call(this,A),this.d=new MC(g,function(t,i){e.ondata(null,t,i)}),this.compression=8,this.flag=BL(g.level)}return I.prototype.process=function(A,g){try{this.d.push(A,g)}catch(e){this.ondata(e,null,g)}},I.prototype.push=function(A,g){OE.prototype.push.call(this,A,g)},I}(),xZ=function(){function I(A,g){var e=this;g||(g={}),OE.call(this,A),this.d=new Vq(g,function(t,i,C){e.ondata(t,i,C)}),this.compression=8,this.flag=BL(g.level),this.terminate=this.d.terminate}return I.prototype.process=function(A,g){this.d.push(A,g)},I.prototype.push=function(A,g){OE.prototype.push.call(this,A,g)},I}(),YZ=function(){function I(A){this.ondata=A,this.u=[],this.d=1}return I.prototype.add=function(A){var g=this;if(this.d&2)throw"stream finished";var e=mC(A.filename),t=e.length,i=A.comment,C=i&&mC(i),o=t!=A.filename.length||C&&i.length!=C.length,s=t+Ps(A.extra)+30;if(t>65535)throw"filename too long";var B=new Og(s);sn(B,0,A,e,o);var a=[B],n=function(){for(var l=0,d=a;l<d.length;l++){var p=d[l];g.ondata(null,p,!1)}a=[]},r=this.d;this.d=0;var E=this.u.length,h=HE(A,{f:e,u:o,o:C,t:function(){A.terminate&&A.terminate()},r:function(){if(n(),r){var l=g.u[E+1];l?l.r():g.d=1}r=1}}),c=0;A.ondata=function(l,d,p){if(l)g.ondata(l,d,p),g.terminate();else if(c+=d.length,a.push(d),p){var D=new Og(16);iI(D,0,134695760),iI(D,4,A.crc),iI(D,8,c),iI(D,12,A.size),a.push(D),h.c=c,h.b=s+c+16,h.crc=A.crc,h.size=A.size,r&&h.r(),r=1}else r&&n()},this.u.push(h)},I.prototype.end=function(){var A=this;if(this.d&2)throw this.d&1?"stream finishing":"stream finished";this.d?this.e():this.u.push({r:function(){A.d&1&&(A.u.splice(-1,1),A.e())},t:function(){}}),this.d=3},I.prototype.e=function(){for(var A=0,g=0,e=0,t=0,i=this.u;t<i.length;t++){var C=i[t];e+=46+C.f.length+Ps(C.extra)+(C.o?C.o.length:0)}for(var o=new Og(e+22),s=0,B=this.u;s<B.length;s++){var C=B[s];sn(o,A,C,C.f,C.u,C.c,g,C.o),A+=46+C.f.length+Ps(C.extra)+(C.o?C.o.length:0),g+=C.b}PG(o,A,this.u.length,e,g),this.ondata(null,o,!0),this.d=2},I.prototype.terminate=function(){for(var A=0,g=this.u;A<g.length;A++){var e=g[A];e.t()}this.d=2},I}();function HZ(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";var e={};HG(I,"",e,A);var t=Object.keys(e),i=t.length,C=0,o=0,s=i,B=new Array(i),a=[],n=function(){for(var c=0;c<a.length;++c)a[c]()},r=function(){var c=new Og(o+22),l=C,d=o-C;o=0;for(var p=0;p<s;++p){var D=B[p];try{var u=D.c.length;sn(c,o,D,D.f,D.u,u);var w=30+D.f.length+Ps(D.extra),k=o+w;c.set(D.c,k),sn(c,C,D,D.f,D.u,u,o,D.m),C+=16+w+(D.m?D.m.length:0),o=k+u}catch(m){return g(m,null)}}PG(c,C,B.length,d,l),g(null,c)};i||r();for(var E=function(c){var l=t[c],d=e[l],p=d[0],D=d[1],u=gn(),w=p.length;u.p(p);var k=mC(l),m=k.length,y=D.comment,R=y&&mC(y),F=R&&R.length,Y=Ps(D.extra),T=D.level==0?0:8,v=function(L,z){if(L)n(),g(L,null);else{var IA=z.length;B[c]=HE(D,{size:w,crc:u.d(),c:z,f:k,m:R,u:m!=l.length||R&&y.length!=F,compression:T}),C+=30+m+Y+IA,o+=76+2*(m+Y)+(F||0)+IA,--i||r()}};if(m>65535&&v("filename too long",null),!T)v(null,p);else if(w<16e4)try{v(null,TE(p,D))}catch(L){v(L,null)}else a.push(Xq(p,D,v))},h=0;h<s;++h)E(h);return n}function rL(I,A){A||(A={});var g={},e=[];HG(I,"",g,A);var t=0,i=0;for(var C in g){var o=g[C],s=o[0],B=o[1],a=B.level==0?0:8,n=mC(C),r=n.length,E=B.comment,h=E&&mC(E),c=h&&h.length,l=Ps(B.extra);if(r>65535)throw"filename too long";var d=a?TE(s,B):s,p=d.length,D=gn();D.p(s),e.push(HE(B,{size:s.length,crc:D.d(),c:d,f:n,m:h,u:r!=C.length||h&&E.length!=c,o:t,compression:a})),t+=30+r+l+p,i+=76+2*(r+l)+(c||0)+p}for(var u=new Og(i+22),w=t,k=i-t,m=0;m<e.length;++m){var n=e[m];sn(u,n.o,n,n.f,n.u,n.c.length);var y=30+n.f.length+Ps(n.extra);u.set(n.c,n.o+y),sn(u,t,n,n.f,n.u,n.c.length,n.o,n.m),t+=16+y+(n.m?n.m.length:0)}return PG(u,t,e.length,k,w),u}var EL=function(){function I(){}return I.prototype.push=function(A,g){this.ondata(null,A,g)},I.compression=0,I}(),TZ=function(){function I(){var A=this;this.i=new Ft(function(g,e){A.ondata(null,g,e)})}return I.prototype.push=function(A,g){try{this.i.push(A,g)}catch(e){this.ondata(e,A,g)}},I.compression=8,I}(),OZ=function(){function I(A,g){var e=this;g<32e4?this.i=new Ft(function(t,i){e.ondata(null,t,i)}):(this.i=new bG(function(t,i,C){e.ondata(t,i,C)}),this.terminate=this.i.terminate)}return I.prototype.push=function(A,g){this.i.terminate&&(A=ki(A,0)),this.i.push(A,g)},I.compression=8,I}(),PZ=function(){function I(A){this.onfile=A,this.k=[],this.o={0:EL},this.p=Jo}return I.prototype.push=function(A,g){var e=this;if(!this.onfile)throw"no callback";if(!this.p)throw"stream finished";if(this.c>0){var t=Math.min(this.c,A.length),i=A.subarray(0,t);if(this.c-=t,this.d?this.d.push(i,!this.c):this.k[0].push(i),A=A.subarray(t),A.length)return this.push(A,g)}else{var C=0,o=0,s=void 0,B=void 0;this.p.length?A.length?(B=new Og(this.p.length+A.length),B.set(this.p),B.set(A,this.p.length)):B=this.p:B=A;for(var a=B.length,n=this.c,r=n&&this.d,E=function(){var d,p=HI(B,o);if(p==67324752){C=1,s=o,h.d=null,h.c=0;var D=ct(B,o+6),u=ct(B,o+8),w=D&2048,k=D&8,m=ct(B,o+26),y=ct(B,o+28);if(a>o+30+m+y){var R=[];h.k.unshift(R),C=2;var F=HI(B,o+18),Y=HI(B,o+22),T=OG(B.subarray(o+30,o+=30+m),!w);F==4294967295?(d=k?[-2]:nL(B,o),F=d[0],Y=d[1]):k&&(F=-1),o+=y,h.c=F;var v,L={name:T,compression:u,start:function(){if(!L.ondata)throw"no callback";if(!F)L.ondata(null,Jo,!0);else{var z=e.o[u];if(!z)throw"unknown compression type "+u;v=F<0?new z(T):new z(T,F,Y),v.ondata=function(lA,BA,LA){L.ondata(lA,BA,LA)};for(var IA=0,CA=R;IA<CA.length;IA++){var X=CA[IA];v.push(X,!1)}e.k[0]==R&&e.c?e.d=v:v.push(Jo,!0)}},terminate:function(){v&&v.terminate&&v.terminate()}};F>=0&&(L.size=F,L.originalSize=Y),h.onfile(L)}return"break"}else if(n){if(p==134695760)return s=o+=12+(n==-2&&8),C=3,h.c=0,"break";if(p==33639248)return s=o-=4,C=3,h.c=0,"break"}},h=this;o<a-4;++o){var c=E();if(c==="break")break}if(this.p=Jo,n<0){var l=C?B.subarray(0,s-12-(n==-2&&8)-(HI(B,s-16)==134695760&&4)):B.subarray(0,o);r?r.push(l,!!C):this.k[+(C==2)].push(l)}if(C&2)return this.push(B.subarray(o),g);this.p=B.subarray(o)}if(g){if(this.c)throw"invalid zip file";this.p=null}},I.prototype.register=function(A){this.o[A.compression]=A},I}();function _Z(I,A){if(typeof A!="function")throw"no callback";for(var g=[],e=function(){for(var r=0;r<g.length;++r)g[r]()},t={},i=I.length-22;HI(I,i)!=101010256;--i)if(!i||I.length-i>65558){A("invalid zip file",null);return}var C=ct(I,i+8);C||A(null,{});var o=C,s=HI(I,i+16),B=s==4294967295;if(B){if(i=HI(I,i-12),HI(I,i)!=101075792){A("invalid zip file",null);return}o=C=HI(I,i+32),s=HI(I,i+48)}for(var a=function(r){var E=QL(I,s,B),h=E[0],c=E[1],l=E[2],d=E[3],p=E[4],D=E[5],u=aL(I,D);s=p;var w=function(m,y){m?(e(),A(m,null)):(t[d]=y,--C||A(null,t))};if(!h)w(null,ki(I,u,u+c));else if(h==8){var k=I.subarray(u,u+c);if(c<32e4)try{w(null,on(k,new Og(l)))}catch(m){w(m,null)}else g.push(vG(k,{size:l},w))}else w("unknown compression type "+h,null)},n=0;n<o;++n)a();return e}function jZ(I){for(var A={},g=I.length-22;HI(I,g)!=101010256;--g)if(!g||I.length-g>65558)throw"invalid zip file";var e=ct(I,g+8);if(!e)return{};var t=HI(I,g+16),i=t==4294967295;if(i){if(g=HI(I,g-12),HI(I,g)!=101075792)throw"invalid zip file";e=HI(I,g+32),t=HI(I,g+48)}for(var C=0;C<e;++C){var o=QL(I,t,i),s=o[0],B=o[1],a=o[2],n=o[3],r=o[4],E=o[5],h=aL(I,E);if(t=r,!s)A[n]=ki(I,h,h+B);else if(s==8)A[n]=on(I.subarray(h,h+B),new Og(a));else throw"unknown compression type "+s}return A}const hL=Object.freeze(Object.defineProperty({__proto__:null,AsyncCompress:$q,AsyncDecompress:KZ,AsyncDeflate:Vq,AsyncGunzip:gL,AsyncGzip:$q,AsyncInflate:bG,AsyncUnzipInflate:OZ,AsyncUnzlib:eL,AsyncZipDeflate:xZ,AsyncZlib:FZ,Compress:YD,DecodeUTF8:LZ,Decompress:iL,Deflate:MC,EncodeUTF8:bZ,Gunzip:TD,Gzip:YD,Inflate:Ft,Unzip:PZ,UnzipInflate:TZ,UnzipPassThrough:EL,Unzlib:PD,Zip:YZ,ZipDeflate:vZ,ZipPassThrough:OE,Zlib:xG,compress:AL,compressSync:HD,decompress:JZ,decompressSync:qZ,deflate:Xq,deflateSync:TE,gunzip:IL,gunzipSync:OD,gzip:AL,gzipSync:HD,inflate:vG,inflateSync:on,strFromU8:OG,strToU8:mC,unzip:_Z,unzipSync:jZ,unzlib:tL,unzlibSync:Os,zip:HZ,zipSync:rL,zlib:NZ,zlibSync:YG},Symbol.toStringTag,{value:"Module"}));class _G extends iS{constructor(A){super(A),this.type=se}parse(A){const g=Math.pow(2.7182818,2.2);function e(f,N){let U=0;for(let H=0;H<65536;++H)(H==0||f[H>>3]&1<<(H&7))&&(N[U++]=H);const q=U-1;for(;U<65536;)N[U++]=0;return q}function t(f){for(let N=0;N<16384;N++)f[N]={},f[N].len=0,f[N].lit=0,f[N].p=null}const i={l:0,c:0,lc:0};function C(f,N,U,q,H){for(;U<f;)N=N<<8|uA(q,H),U+=8;U-=f,i.l=N>>U&(1<<f)-1,i.c=N,i.lc=U}const o=new Array(59);function s(f){for(let U=0;U<=58;++U)o[U]=0;for(let U=0;U<65537;++U)o[f[U]]+=1;let N=0;for(let U=58;U>0;--U){const q=N+o[U]>>1;o[U]=N,N=q}for(let U=0;U<65537;++U){const q=f[U];q>0&&(f[U]=q|o[q]++<<6)}}function B(f,N,U,q,H,O){const rA=N;let yA=0,qA=0;for(;q<=H;q++){if(rA.value-N.value>U)return!1;C(6,yA,qA,f,rA);const GA=i.l;if(yA=i.c,qA=i.lc,O[q]=GA,GA==63){if(rA.value-N.value>U)throw new Error("Something wrong with hufUnpackEncTable");C(8,yA,qA,f,rA);let bA=i.l+6;if(yA=i.c,qA=i.lc,q+bA>H+1)throw new Error("Something wrong with hufUnpackEncTable");for(;bA--;)O[q++]=0;q--}else if(GA>=59){let bA=GA-59+2;if(q+bA>H+1)throw new Error("Something wrong with hufUnpackEncTable");for(;bA--;)O[q++]=0;q--}}s(O)}function a(f){return f&63}function n(f){return f>>6}function r(f,N,U,q){for(;N<=U;N++){const H=n(f[N]),O=a(f[N]);if(H>>O)throw new Error("Invalid table entry");if(O>14){const rA=q[H>>O-14];if(rA.len)throw new Error("Invalid table entry");if(rA.lit++,rA.p){const yA=rA.p;rA.p=new Array(rA.lit);for(let qA=0;qA<rA.lit-1;++qA)rA.p[qA]=yA[qA]}else rA.p=new Array(1);rA.p[rA.lit-1]=N}else if(O){let rA=0;for(let yA=1<<14-O;yA>0;yA--){const qA=q[(H<<14-O)+rA];if(qA.len||qA.p)throw new Error("Invalid table entry");qA.len=O,qA.lit=N,rA++}}}return!0}const E={c:0,lc:0};function h(f,N,U,q){f=f<<8|uA(U,q),N+=8,E.c=f,E.lc=N}const c={c:0,lc:0};function l(f,N,U,q,H,O,rA,yA,qA){if(f==N){q<8&&(h(U,q,H,O),U=E.c,q=E.lc),q-=8;let GA=U>>q;if(GA=new Uint8Array([GA])[0],yA.value+GA>qA)return!1;const bA=rA[yA.value-1];for(;GA-- >0;)rA[yA.value++]=bA}else if(yA.value<qA)rA[yA.value++]=f;else return!1;c.c=U,c.lc=q}function d(f){return f&65535}function p(f){const N=d(f);return N>32767?N-65536:N}const D={a:0,b:0};function u(f,N){const U=p(f),q=p(N),H=U+(q&1)+(q>>1),O=H,rA=H-q;D.a=O,D.b=rA}function w(f,N){const U=d(f),q=d(N),H=U-(q>>1)&65535,O=q+H-32768&65535;D.a=O,D.b=H}function k(f,N,U,q,H,O,rA){const yA=rA<16384,qA=U>H?H:U;let GA=1,bA,OA;for(;GA<=qA;)GA<<=1;for(GA>>=1,bA=GA,GA>>=1;GA>=1;){OA=0;const VA=OA+O*(H-bA),Cg=O*GA,fg=O*bA,sg=q*GA,rg=q*bA;let qg,J,AA,EA;for(;OA<=VA;OA+=fg){let W=OA;const iA=OA+q*(U-bA);for(;W<=iA;W+=rg){const jA=W+sg,Eg=W+Cg,ng=Eg+sg;yA?(u(f[W+N],f[Eg+N]),qg=D.a,AA=D.b,u(f[jA+N],f[ng+N]),J=D.a,EA=D.b,u(qg,J),f[W+N]=D.a,f[jA+N]=D.b,u(AA,EA),f[Eg+N]=D.a,f[ng+N]=D.b):(w(f[W+N],f[Eg+N]),qg=D.a,AA=D.b,w(f[jA+N],f[ng+N]),J=D.a,EA=D.b,w(qg,J),f[W+N]=D.a,f[jA+N]=D.b,w(AA,EA),f[Eg+N]=D.a,f[ng+N]=D.b)}if(U&GA){const jA=W+Cg;yA?u(f[W+N],f[jA+N]):w(f[W+N],f[jA+N]),qg=D.a,f[jA+N]=D.b,f[W+N]=qg}}if(H&GA){let W=OA;const iA=OA+q*(U-bA);for(;W<=iA;W+=rg){const jA=W+sg;yA?u(f[W+N],f[jA+N]):w(f[W+N],f[jA+N]),qg=D.a,f[jA+N]=D.b,f[W+N]=qg}}bA=GA,GA>>=1}return OA}function m(f,N,U,q,H,O,rA,yA,qA){let GA=0,bA=0;const OA=rA,VA=Math.trunc(q.value+(H+7)/8);for(;q.value<VA;)for(h(GA,bA,U,q),GA=E.c,bA=E.lc;bA>=14;){const fg=GA>>bA-14&16383,sg=N[fg];if(sg.len)bA-=sg.len,l(sg.lit,O,GA,bA,U,q,yA,qA,OA),GA=c.c,bA=c.lc;else{if(!sg.p)throw new Error("hufDecode issues");let rg;for(rg=0;rg<sg.lit;rg++){const qg=a(f[sg.p[rg]]);for(;bA<qg&&q.value<VA;)h(GA,bA,U,q),GA=E.c,bA=E.lc;if(bA>=qg&&n(f[sg.p[rg]])==(GA>>bA-qg&(1<<qg)-1)){bA-=qg,l(sg.p[rg],O,GA,bA,U,q,yA,qA,OA),GA=c.c,bA=c.lc;break}}if(rg==sg.lit)throw new Error("hufDecode issues")}}const Cg=8-H&7;for(GA>>=Cg,bA-=Cg;bA>0;){const fg=N[GA<<14-bA&16383];if(fg.len)bA-=fg.len,l(fg.lit,O,GA,bA,U,q,yA,qA,OA),GA=c.c,bA=c.lc;else throw new Error("hufDecode issues")}return!0}function y(f,N,U,q,H,O){const rA={value:0},yA=U.value,qA=hA(N,U),GA=hA(N,U);U.value+=4;const bA=hA(N,U);if(U.value+=4,qA<0||qA>=65537||GA<0||GA>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const OA=new Array(65537),VA=new Array(16384);t(VA);const Cg=q-(U.value-yA);if(B(f,U,Cg,qA,GA,OA),bA>8*(q-(U.value-yA)))throw new Error("Something wrong with hufUncompress");r(OA,qA,GA,VA),m(OA,VA,f,U,bA,GA,O,H,rA)}function R(f,N,U){for(let q=0;q<U;++q)N[q]=f[N[q]]}function F(f){for(let N=1;N<f.length;N++){const U=f[N-1]+f[N]-128;f[N]=U}}function Y(f,N){let U=0,q=Math.floor((f.length+1)/2),H=0;const O=f.length-1;for(;!(H>O||(N[H++]=f[U++],H>O));)N[H++]=f[q++]}function T(f){let N=f.byteLength;const U=new Array;let q=0;const H=new DataView(f);for(;N>0;){const O=H.getInt8(q++);if(O<0){const rA=-O;N-=rA+1;for(let yA=0;yA<rA;yA++)U.push(H.getUint8(q++))}else{const rA=O;N-=2;const yA=H.getUint8(q++);for(let qA=0;qA<rA+1;qA++)U.push(yA)}}return U}function v(f,N,U,q,H,O){let rA=new DataView(O.buffer);const yA=U[f.idx[0]].width,qA=U[f.idx[0]].height,GA=3,bA=Math.floor(yA/8),OA=Math.ceil(yA/8),VA=Math.ceil(qA/8),Cg=yA-(OA-1)*8,fg=qA-(VA-1)*8,sg={value:0},rg=new Array(GA),qg=new Array(GA),J=new Array(GA),AA=new Array(GA),EA=new Array(GA);for(let iA=0;iA<GA;++iA)EA[iA]=N[f.idx[iA]],rg[iA]=iA<1?0:rg[iA-1]+OA*VA,qg[iA]=new Float32Array(64),J[iA]=new Uint16Array(64),AA[iA]=new Uint16Array(OA*64);for(let iA=0;iA<VA;++iA){let jA=8;iA==VA-1&&(jA=fg);let Eg=8;for(let $A=0;$A<OA;++$A){$A==OA-1&&(Eg=Cg);for(let cg=0;cg<GA;++cg)J[cg].fill(0),J[cg][0]=H[rg[cg]++],L(sg,q,J[cg]),z(J[cg],qg[cg]),IA(qg[cg]);CA(qg);for(let cg=0;cg<GA;++cg)X(qg[cg],AA[cg],$A*64)}let ng=0;for(let $A=0;$A<GA;++$A){const cg=U[f.idx[$A]].type;for(let mg=8*iA;mg<8*iA+jA;++mg){ng=EA[$A][mg];for(let Ng=0;Ng<bA;++Ng){const BI=Ng*64+(mg&7)*8;rA.setUint16(ng+0*2*cg,AA[$A][BI+0],!0),rA.setUint16(ng+1*2*cg,AA[$A][BI+1],!0),rA.setUint16(ng+2*2*cg,AA[$A][BI+2],!0),rA.setUint16(ng+3*2*cg,AA[$A][BI+3],!0),rA.setUint16(ng+4*2*cg,AA[$A][BI+4],!0),rA.setUint16(ng+5*2*cg,AA[$A][BI+5],!0),rA.setUint16(ng+6*2*cg,AA[$A][BI+6],!0),rA.setUint16(ng+7*2*cg,AA[$A][BI+7],!0),ng+=8*2*cg}}if(bA!=OA)for(let mg=8*iA;mg<8*iA+jA;++mg){const Ng=EA[$A][mg]+8*bA*2*cg,BI=bA*64+(mg&7)*8;for(let ce=0;ce<Eg;++ce)rA.setUint16(Ng+ce*2*cg,AA[$A][BI+ce],!0)}}}const W=new Uint16Array(yA);rA=new DataView(O.buffer);for(let iA=0;iA<GA;++iA){U[f.idx[iA]].decoded=!0;const jA=U[f.idx[iA]].type;if(U[iA].type==2)for(let Eg=0;Eg<qA;++Eg){const ng=EA[iA][Eg];for(let $A=0;$A<yA;++$A)W[$A]=rA.getUint16(ng+$A*2*jA,!0);for(let $A=0;$A<yA;++$A)rA.setFloat32(ng+$A*2*jA,DA(W[$A]),!0)}}}function L(f,N,U){let q,H=1;for(;H<64;)q=N[f.value],q==65280?H=64:q>>8==255?H+=q&255:(U[H]=q,H++),f.value++}function z(f,N){N[0]=DA(f[0]),N[1]=DA(f[1]),N[2]=DA(f[5]),N[3]=DA(f[6]),N[4]=DA(f[14]),N[5]=DA(f[15]),N[6]=DA(f[27]),N[7]=DA(f[28]),N[8]=DA(f[2]),N[9]=DA(f[4]),N[10]=DA(f[7]),N[11]=DA(f[13]),N[12]=DA(f[16]),N[13]=DA(f[26]),N[14]=DA(f[29]),N[15]=DA(f[42]),N[16]=DA(f[3]),N[17]=DA(f[8]),N[18]=DA(f[12]),N[19]=DA(f[17]),N[20]=DA(f[25]),N[21]=DA(f[30]),N[22]=DA(f[41]),N[23]=DA(f[43]),N[24]=DA(f[9]),N[25]=DA(f[11]),N[26]=DA(f[18]),N[27]=DA(f[24]),N[28]=DA(f[31]),N[29]=DA(f[40]),N[30]=DA(f[44]),N[31]=DA(f[53]),N[32]=DA(f[10]),N[33]=DA(f[19]),N[34]=DA(f[23]),N[35]=DA(f[32]),N[36]=DA(f[39]),N[37]=DA(f[45]),N[38]=DA(f[52]),N[39]=DA(f[54]),N[40]=DA(f[20]),N[41]=DA(f[22]),N[42]=DA(f[33]),N[43]=DA(f[38]),N[44]=DA(f[46]),N[45]=DA(f[51]),N[46]=DA(f[55]),N[47]=DA(f[60]),N[48]=DA(f[21]),N[49]=DA(f[34]),N[50]=DA(f[37]),N[51]=DA(f[47]),N[52]=DA(f[50]),N[53]=DA(f[56]),N[54]=DA(f[59]),N[55]=DA(f[61]),N[56]=DA(f[35]),N[57]=DA(f[36]),N[58]=DA(f[48]),N[59]=DA(f[49]),N[60]=DA(f[57]),N[61]=DA(f[58]),N[62]=DA(f[62]),N[63]=DA(f[63])}function IA(f){const N=.5*Math.cos(.7853975),U=.5*Math.cos(3.14159/16),q=.5*Math.cos(3.14159/8),H=.5*Math.cos(3*3.14159/16),O=.5*Math.cos(5*3.14159/16),rA=.5*Math.cos(3*3.14159/8),yA=.5*Math.cos(7*3.14159/16),qA=new Array(4),GA=new Array(4),bA=new Array(4),OA=new Array(4);for(let VA=0;VA<8;++VA){const Cg=VA*8;qA[0]=q*f[Cg+2],qA[1]=rA*f[Cg+2],qA[2]=q*f[Cg+6],qA[3]=rA*f[Cg+6],GA[0]=U*f[Cg+1]+H*f[Cg+3]+O*f[Cg+5]+yA*f[Cg+7],GA[1]=H*f[Cg+1]-yA*f[Cg+3]-U*f[Cg+5]-O*f[Cg+7],GA[2]=O*f[Cg+1]-U*f[Cg+3]+yA*f[Cg+5]+H*f[Cg+7],GA[3]=yA*f[Cg+1]-O*f[Cg+3]+H*f[Cg+5]-U*f[Cg+7],bA[0]=N*(f[Cg+0]+f[Cg+4]),bA[3]=N*(f[Cg+0]-f[Cg+4]),bA[1]=qA[0]+qA[3],bA[2]=qA[1]-qA[2],OA[0]=bA[0]+bA[1],OA[1]=bA[3]+bA[2],OA[2]=bA[3]-bA[2],OA[3]=bA[0]-bA[1],f[Cg+0]=OA[0]+GA[0],f[Cg+1]=OA[1]+GA[1],f[Cg+2]=OA[2]+GA[2],f[Cg+3]=OA[3]+GA[3],f[Cg+4]=OA[3]-GA[3],f[Cg+5]=OA[2]-GA[2],f[Cg+6]=OA[1]-GA[1],f[Cg+7]=OA[0]-GA[0]}for(let VA=0;VA<8;++VA)qA[0]=q*f[16+VA],qA[1]=rA*f[16+VA],qA[2]=q*f[48+VA],qA[3]=rA*f[48+VA],GA[0]=U*f[8+VA]+H*f[24+VA]+O*f[40+VA]+yA*f[56+VA],GA[1]=H*f[8+VA]-yA*f[24+VA]-U*f[40+VA]-O*f[56+VA],GA[2]=O*f[8+VA]-U*f[24+VA]+yA*f[40+VA]+H*f[56+VA],GA[3]=yA*f[8+VA]-O*f[24+VA]+H*f[40+VA]-U*f[56+VA],bA[0]=N*(f[VA]+f[32+VA]),bA[3]=N*(f[VA]-f[32+VA]),bA[1]=qA[0]+qA[3],bA[2]=qA[1]-qA[2],OA[0]=bA[0]+bA[1],OA[1]=bA[3]+bA[2],OA[2]=bA[3]-bA[2],OA[3]=bA[0]-bA[1],f[0+VA]=OA[0]+GA[0],f[8+VA]=OA[1]+GA[1],f[16+VA]=OA[2]+GA[2],f[24+VA]=OA[3]+GA[3],f[32+VA]=OA[3]-GA[3],f[40+VA]=OA[2]-GA[2],f[48+VA]=OA[1]-GA[1],f[56+VA]=OA[0]-GA[0]}function CA(f){for(let N=0;N<64;++N){const U=f[0][N],q=f[1][N],H=f[2][N];f[0][N]=U+1.5747*H,f[1][N]=U-.1873*q-.4682*H,f[2][N]=U+1.8556*q}}function X(f,N,U){for(let q=0;q<64;++q)N[U+q]=ZB.toHalfFloat(lA(f[q]))}function lA(f){return f<=1?Math.sign(f)*Math.pow(Math.abs(f),2.2):Math.sign(f)*Math.pow(g,Math.abs(f)-1)}function BA(f){return new DataView(f.array.buffer,f.offset.value,f.size)}function LA(f){const N=f.viewer.buffer.slice(f.offset.value,f.offset.value+f.size),U=new Uint8Array(T(N)),q=new Uint8Array(U.length);return F(U),Y(U,q),new DataView(q.buffer)}function fA(f){const N=f.array.slice(f.offset.value,f.offset.value+f.size);typeof hL>"u"&&console.error("THREE.EXRLoader: External library fflate.min.js required.");const U=Os(N),q=new Uint8Array(U.length);return F(U),Y(U,q),new DataView(q.buffer)}function gA(f){const N=f.viewer,U={value:f.offset.value},q=new Uint16Array(f.width*f.scanlineBlockSize*(f.channels*f.type)),H=new Uint8Array(8192);let O=0;const rA=new Array(f.channels);for(let fg=0;fg<f.channels;fg++)rA[fg]={},rA[fg].start=O,rA[fg].end=rA[fg].start,rA[fg].nx=f.width,rA[fg].ny=f.lines,rA[fg].size=f.type,O+=rA[fg].nx*rA[fg].ny*rA[fg].size;const yA=ag(N,U),qA=ag(N,U);if(qA>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(yA<=qA)for(let fg=0;fg<qA-yA+1;fg++)H[fg+yA]=cA(N,U);const GA=new Uint16Array(65536),bA=e(H,GA),OA=hA(N,U);y(f.array,N,U,OA,q,O);for(let fg=0;fg<f.channels;++fg){const sg=rA[fg];for(let rg=0;rg<rA[fg].size;++rg)k(q,sg.start+rg,sg.nx,sg.size,sg.ny,sg.nx*sg.size,bA)}R(GA,q,O);let VA=0;const Cg=new Uint8Array(q.buffer.byteLength);for(let fg=0;fg<f.lines;fg++)for(let sg=0;sg<f.channels;sg++){const rg=rA[sg],qg=rg.nx*rg.size,J=new Uint8Array(q.buffer,rg.end*2,qg*2);Cg.set(J,VA),VA+=qg*2,rg.end+=qg}return new DataView(Cg.buffer)}function QA(f){const N=f.array.slice(f.offset.value,f.offset.value+f.size);typeof hL>"u"&&console.error("THREE.EXRLoader: External library fflate.min.js required.");const U=Os(N),q=f.lines*f.channels*f.width,H=f.type==1?new Uint16Array(q):new Uint32Array(q);let O=0,rA=0;const yA=new Array(4);for(let qA=0;qA<f.lines;qA++)for(let GA=0;GA<f.channels;GA++){let bA=0;switch(f.type){case 1:yA[0]=O,yA[1]=yA[0]+f.width,O=yA[1]+f.width;for(let OA=0;OA<f.width;++OA){const VA=U[yA[0]++]<<8|U[yA[1]++];bA+=VA,H[rA]=bA,rA++}break;case 2:yA[0]=O,yA[1]=yA[0]+f.width,yA[2]=yA[1]+f.width,O=yA[2]+f.width;for(let OA=0;OA<f.width;++OA){const VA=U[yA[0]++]<<24|U[yA[1]++]<<16|U[yA[2]++]<<8;bA+=VA,H[rA]=bA,rA++}break}}return new DataView(H.buffer)}function UA(f){const N=f.viewer,U={value:f.offset.value},q=new Uint8Array(f.width*f.lines*(f.channels*f.type*2)),H={version:vA(N,U),unknownUncompressedSize:vA(N,U),unknownCompressedSize:vA(N,U),acCompressedSize:vA(N,U),dcCompressedSize:vA(N,U),rleCompressedSize:vA(N,U),rleUncompressedSize:vA(N,U),rleRawSize:vA(N,U),totalAcUncompressedCount:vA(N,U),totalDcUncompressedCount:vA(N,U),acCompression:vA(N,U)};if(H.version<2)throw new Error("EXRLoader.parse: "+YA.compression+" version "+H.version+" is unsupported");const O=new Array;let rA=ag(N,U)-2;for(;rA>0;){const sg=V(N.buffer,U),rg=cA(N,U),qg=rg>>2&3,J=(rg>>4)-1,AA=new Int8Array([J])[0],EA=cA(N,U);O.push({name:sg,index:AA,type:EA,compression:qg}),rA-=sg.length+3}const yA=YA.channels,qA=new Array(f.channels);for(let sg=0;sg<f.channels;++sg){const rg=qA[sg]={},qg=yA[sg];rg.name=qg.name,rg.compression=0,rg.decoded=!1,rg.type=qg.pixelType,rg.pLinear=qg.pLinear,rg.width=f.width,rg.height=f.lines}const GA={idx:new Array(3)};for(let sg=0;sg<f.channels;++sg){const rg=qA[sg];for(let qg=0;qg<O.length;++qg){const J=O[qg];rg.name==J.name&&(rg.compression=J.compression,J.index>=0&&(GA.idx[J.index]=sg),rg.offset=sg)}}let bA,OA,VA;if(H.acCompressedSize>0)switch(H.acCompression){case 0:bA=new Uint16Array(H.totalAcUncompressedCount),y(f.array,N,U,H.acCompressedSize,bA,H.totalAcUncompressedCount);break;case 1:const sg=f.array.slice(U.value,U.value+H.totalAcUncompressedCount),rg=Os(sg);bA=new Uint16Array(rg.buffer),U.value+=H.totalAcUncompressedCount;break}if(H.dcCompressedSize>0){const sg={array:f.array,offset:U,size:H.dcCompressedSize};OA=new Uint16Array(fA(sg).buffer),U.value+=H.dcCompressedSize}if(H.rleRawSize>0){const sg=f.array.slice(U.value,U.value+H.rleCompressedSize),rg=Os(sg);VA=T(rg.buffer),U.value+=H.rleCompressedSize}let Cg=0;const fg=new Array(qA.length);for(let sg=0;sg<fg.length;++sg)fg[sg]=new Array;for(let sg=0;sg<f.lines;++sg)for(let rg=0;rg<qA.length;++rg)fg[rg].push(Cg),Cg+=qA[rg].width*f.type*2;v(GA,fg,qA,bA,OA,q);for(let sg=0;sg<qA.length;++sg){const rg=qA[sg];if(!rg.decoded)switch(rg.compression){case 2:let qg=0,J=0;for(let AA=0;AA<f.lines;++AA){let EA=fg[sg][qg];for(let W=0;W<rg.width;++W){for(let iA=0;iA<2*rg.type;++iA)q[EA++]=VA[J+iA*rg.width*rg.height];J++}qg++}break;case 1:default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(q.buffer)}function V(f,N){const U=new Uint8Array(f);let q=0;for(;U[N.value+q]!=0;)q+=1;const H=new TextDecoder().decode(U.slice(N.value,N.value+q));return N.value=N.value+q+1,H}function HA(f,N,U){const q=new TextDecoder().decode(new Uint8Array(f).slice(N.value,N.value+U));return N.value=N.value+U,q}function xA(f,N){const U=pA(f,N),q=hA(f,N);return[U,q]}function KA(f,N){const U=hA(f,N),q=hA(f,N);return[U,q]}function pA(f,N){const U=f.getInt32(N.value,!0);return N.value=N.value+4,U}function hA(f,N){const U=f.getUint32(N.value,!0);return N.value=N.value+4,U}function uA(f,N){const U=f[N.value];return N.value=N.value+1,U}function cA(f,N){const U=f.getUint8(N.value);return N.value=N.value+1,U}const vA=function(f,N){const U=Number(f.getBigInt64(N.value,!0));return N.value+=8,U};function RA(f,N){const U=f.getFloat32(N.value,!0);return N.value+=4,U}function Bg(f,N){return ZB.toHalfFloat(RA(f,N))}function DA(f){const N=(f&31744)>>10,U=f&1023;return(f>>15?-1:1)*(N?N===31?U?NaN:1/0:Math.pow(2,N-15)*(1+U/1024):6103515625e-14*(U/1024))}function ag(f,N){const U=f.getUint16(N.value,!0);return N.value+=2,U}function Qg(f,N){return DA(ag(f,N))}function Mg(f,N,U,q){const H=U.value,O=[];for(;U.value<H+q-1;){const rA=V(N,U),yA=pA(f,U),qA=cA(f,U);U.value+=3;const GA=pA(f,U),bA=pA(f,U);O.push({name:rA,pixelType:yA,pLinear:qA,xSampling:GA,ySampling:bA})}return U.value+=1,O}function Xg(f,N){const U=RA(f,N),q=RA(f,N),H=RA(f,N),O=RA(f,N),rA=RA(f,N),yA=RA(f,N),qA=RA(f,N),GA=RA(f,N);return{redX:U,redY:q,greenX:H,greenY:O,blueX:rA,blueY:yA,whiteX:qA,whiteY:GA}}function b(f,N){const U=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],q=cA(f,N);return U[q]}function K(f,N){const U=hA(f,N),q=hA(f,N),H=hA(f,N),O=hA(f,N);return{xMin:U,yMin:q,xMax:H,yMax:O}}function aA(f,N){const U=["INCREASING_Y"],q=cA(f,N);return U[q]}function mA(f,N){const U=RA(f,N),q=RA(f,N);return[U,q]}function JA(f,N){const U=RA(f,N),q=RA(f,N),H=RA(f,N);return[U,q,H]}function TA(f,N,U,q,H){if(q==="string"||q==="stringvector"||q==="iccProfile")return HA(N,U,H);if(q==="chlist")return Mg(f,N,U,H);if(q==="chromaticities")return Xg(f,U);if(q==="compression")return b(f,U);if(q==="box2i")return K(f,U);if(q==="lineOrder")return aA(f,U);if(q==="float")return RA(f,U);if(q==="v2f")return mA(f,U);if(q==="v3f")return JA(f,U);if(q==="int")return pA(f,U);if(q==="rational")return xA(f,U);if(q==="timecode")return KA(f,U);if(q==="preview")return U.value+=H,"skipped";U.value+=H}function tg(f,N,U){const q={};if(f.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.");q.version=f.getUint8(4);const H=f.getUint8(5);q.spec={singleTile:!!(H&2),longName:!!(H&4),deepFormat:!!(H&8),multiPart:!!(H&16)},U.value=8;let O=!0;for(;O;){const rA=V(N,U);if(rA==0)O=!1;else{const yA=V(N,U),qA=hA(f,U),GA=TA(f,N,U,yA,qA);GA===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${yA}'.`):q[rA]=GA}}if(H&-5)throw console.error("EXRHeader:",q),new Error("THREE.EXRLoader: provided file is currently unsupported.");return q}function x(f,N,U,q,H){const O={size:0,viewer:N,array:U,offset:q,width:f.dataWindow.xMax-f.dataWindow.xMin+1,height:f.dataWindow.yMax-f.dataWindow.yMin+1,channels:f.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:f.channels[0].pixelType,uncompress:null,getter:null,format:null,encoding:null};switch(f.compression){case"NO_COMPRESSION":O.lines=1,O.uncompress=BA;break;case"RLE_COMPRESSION":O.lines=1,O.uncompress=LA;break;case"ZIPS_COMPRESSION":O.lines=1,O.uncompress=fA;break;case"ZIP_COMPRESSION":O.lines=16,O.uncompress=fA;break;case"PIZ_COMPRESSION":O.lines=32,O.uncompress=gA;break;case"PXR24_COMPRESSION":O.lines=16,O.uncompress=QA;break;case"DWAA_COMPRESSION":O.lines=32,O.uncompress=UA;break;case"DWAB_COMPRESSION":O.lines=256,O.uncompress=UA;break;default:throw new Error("EXRLoader.parse: "+f.compression+" is unsupported")}if(O.scanlineBlockSize=O.lines,O.type==1)switch(H){case jI:O.getter=Qg,O.inputSize=2;break;case se:O.getter=ag,O.inputSize=2;break}else if(O.type==2)switch(H){case jI:O.getter=RA,O.inputSize=4;break;case se:O.getter=Bg,O.inputSize=4}else throw new Error("EXRLoader.parse: unsupported pixelType "+O.type+" for "+f.compression+".");O.blockCount=(f.dataWindow.yMax+1)/O.scanlineBlockSize;for(let yA=0;yA<O.blockCount;yA++)vA(N,q);O.outputChannels=O.channels==3?4:O.channels;const rA=O.width*O.height*O.outputChannels;switch(H){case jI:O.byteArray=new Float32Array(rA),O.channels<O.outputChannels&&O.byteArray.fill(1,0,rA);break;case se:O.byteArray=new Uint16Array(rA),O.channels<O.outputChannels&&O.byteArray.fill(15360,0,rA);break;default:console.error("THREE.EXRLoader: unsupported type: ",H);break}return O.bytesPerLine=O.width*O.inputSize*O.channels,O.outputChannels==4?(O.format=cI,O.encoding=JI):(O.format=as,O.encoding=JI),O}const Z=new DataView(A),PA=new Uint8Array(A),WA={value:0},YA=tg(Z,A,WA),dA=x(YA,Z,PA,WA,this.type),og={value:0},kg={R:0,G:1,B:2,A:3,Y:0};for(let f=0;f<dA.height/dA.scanlineBlockSize;f++){const N=hA(Z,WA);dA.size=hA(Z,WA),dA.lines=N+dA.scanlineBlockSize>dA.height?dA.height-N:dA.scanlineBlockSize;const U=dA.size<dA.lines*dA.bytesPerLine?dA.uncompress(dA):BA(dA);WA.value+=dA.size;for(let q=0;q<dA.scanlineBlockSize;q++){const H=q+f*dA.scanlineBlockSize;if(H>=dA.height)break;for(let O=0;O<dA.channels;O++){const rA=kg[YA.channels[O].name];for(let yA=0;yA<dA.width;yA++){og.value=(q*(dA.channels*dA.width)+O*dA.width+yA)*dA.inputSize;const qA=(dA.height-1-H)*(dA.width*dA.outputChannels)+yA*dA.outputChannels+rA;dA.byteArray[qA]=dA.getter(U,og)}}}}return{header:YA,width:dA.width,height:dA.height,data:dA.byteArray,format:dA.format,encoding:dA.encoding,type:this.type}}setDataType(A){return this.type=A,this}load(A,g,e,t){function i(C,o){C.encoding=o.encoding,C.minFilter=Lg,C.magFilter=Lg,C.generateMipmaps=!1,C.flipY=!1,g&&g(C,o)}return super.load(A,i,e,t)}}const jG=nA("debugexr");class WZ{constructor(A){Q(this,"parser"),Q(this,"name"),this.parser=A,this.name="EXT_texture_exr",jG&&console.log(A)}loadTexture(A){const g=this.name,e=this.parser,t=e.json.textures[A];if(jG&&console.log("EXT_texture_exr.loadTexture",A,t),!t.extensions||!t.extensions[g])return null;const i=t.extensions[g],C=new _G(e.options.manager);return jG&&console.log("EXT_texture_exr.loadTexture",i,C),e.loadTextureImage(A,i.source,C)}}window.addEventListener("unhandledrejection",I=>{});const cL="NEEDLE_gameobject_data";class ZZ{constructor(A){Q(this,"parser"),this.parser=A}get name(){return cL}afterRoot(A){const g=[];for(let e=0;e<this.parser.json.nodes.length;e++){const t=this.parser.json.nodes[e];if(t&&t.extensions){const i=t.extensions[cL];if(i){const C=this.findAndApplyExtensionData(e,i);g.push(C)}}}return Promise.all(g).then(()=>{})}async findAndApplyExtensionData(A,g){const e=await this.parser.getDependency("node",A);e&&this.applyExtensionData(e,g)}applyExtensionData(A,g){g.layers===void 0&&(g.layers=0),A.userData.layer=g.layers,A.layers.disableAll(),A.layers.set(g.layers),A.userData.tag=g.tag??"none",A.userData.hideFlags=g.hideFlags??0,A.userData.static=g.static??!1,A.visible=g.activeSelf??!0,A.guid=g.guid}}const lL="NEEDLE_lighting_settings",aa=nA("debugenvlight");class zZ{constructor(A,g,e){Q(this,"parser"),Q(this,"sourceId"),Q(this,"context"),this.parser=A,this.sourceId=g,this.context=e}get name(){return lL}afterRoot(A){const g=this.parser.json.extensions;if(g){const e=g[lL];if(e){aa&&console.log('Loaded "'+this.name+'", src: "'+this.sourceId+'"',e);let t;if(A.scene.children.length===1)t=eA.addNewComponent(A.scene.children[0],_D,!1);else{const i=new FA;i.name="LightSettings "+this.sourceId,A.scene.add(i),t=eA.addNewComponent(i,_D,!1)}t.sourceId=this.sourceId,t.ambientIntensity=e.ambientIntensity,t.ambientLight=new wA().fromArray(e.ambientLight),Array.isArray(e.ambientTrilight)&&(t.ambientTrilight=e.ambientTrilight.map(i=>new wA().fromArray(i))),t.ambientMode=e.ambientMode,t.environmentReflectionSource=e.environmentReflectionSource}}return null}}oe.registerCallback(ai.ContextCreated,I=>{const A=I.context,g=eA.findObjectOfType(_D,A);g!=null&&g.sourceId&&A.sceneLighting.enable(g.sourceId)});class _D extends NA{constructor(){super(...arguments),Q(this,"ambientMode",TQ.Skybox),Q(this,"ambientLight"),Q(this,"ambientTrilight"),Q(this,"ambientIntensity",1),Q(this,"environmentReflectionSource",mD.Skybox),Q(this,"_hasReflection",!1),Q(this,"_ambientLightObj"),Q(this,"_hemisphereLightObj"),Q(this,"_lightProbeObj")}awake(){if(this.sourceId){const A=this.environmentReflectionSource===mD.Skybox?Ks.Skybox:Ks.Reflection,g=this.context.lightmaps.tryGet(this.sourceId,A,0);this._hasReflection=g!=null,g&&this.context.sceneLighting.internalRegisterReflection(this.sourceId,g)}this.enabled=!1,this.context.sceneLighting.internalRegisterSceneLightSettings(this),aa&&window.addEventListener("keydown",A=>{if(!this.destroyed)switch(A.key){case"l":this.enabled=!this.enabled;break}})}onDestroy(){this.context.sceneLighting.internalUnregisterSceneLightSettings(this)}calculateIntensityFactor(A){const g=Math.max(A.r,A.g,A.b);return 2.2*XA.lerp(0,1.33,g)}onEnable(){if(aa&&console.warn("\u{1F4A1}\u{1F7E1} >>> Enable lighting",this.sourceId,this),this.ambientMode==TQ.Flat){if(this.ambientLight&&!this._ambientLightObj){const A=this.calculateIntensityFactor(this.ambientLight);this._ambientLightObj=new aS(this.ambientLight,this.ambientIntensity*A),aa&&console.log("Created ambient light",this.sourceId,this._ambientLightObj,this.ambientIntensity,A)}this._ambientLightObj&&this.gameObject.add(this._ambientLightObj),this._lightProbeObj&&this._lightProbeObj.removeFromParent()}else if(this.ambientMode===TQ.Trilight){if(this.ambientTrilight){const A=this.ambientTrilight[0],g=this.ambientTrilight[this.ambientTrilight.length-1],e=this.calculateIntensityFactor(g);this._hemisphereLightObj=new CS(g,A,this.ambientIntensity*e),this.gameObject.add(this._hemisphereLightObj),aa&&console.log("Created hemisphere ambient light",this.sourceId,this._hemisphereLightObj,this.ambientIntensity,e)}}else this._ambientLightObj&&this._ambientLightObj.removeFromParent(),this._hemisphereLightObj&&this._hemisphereLightObj.removeFromParent(),this._lightProbeObj?this.enabled&&this.destroyed&&this._lightProbeObj&&this.gameObject.add(this._lightProbeObj):this.sourceId&&this.context.sceneLighting.internalGetSceneLightingData(this.sourceId).then(A=>{A&&(this._lightProbeObj=A.lightProbe,this.enabled&&!this.destroyed&&this._lightProbeObj&&(aa&&console.log("Add",this.sourceId,A),this.gameObject.add(this._lightProbeObj)))});this.sourceId&&this.context.sceneLighting.internalEnableReflection(this.sourceId)}onDisable(){aa&&console.warn("\u{1F4A1}\u26AB <<< Disable lighting:",this.sourceId,this),this._lightProbeObj&&this._lightProbeObj.removeFromParent(),this._ambientLightObj&&this._ambientLightObj.removeFromParent(),this._hemisphereLightObj&&this._hemisphereLightObj.removeFromParent(),this.sourceId&&this.context.sceneLighting.internalDisableReflection(this.sourceId)}}const WG=nA("debugstencil");function VZ(I,A){return(I&1<<A.layer)!=0}const XZ=Symbol("stencils"),Bn=class{constructor(I,A){Q(this,"parser"),Q(this,"source"),this.parser=I,this.source=A}static applyStencil(I){if(!I)return;const A=I.sourceId;if(WG&&console.log(A,Bn.stencils),!A)return;const g=Bn.stencils[A];if(g)for(let e=g.length-1;e>=0;e--){const t=g[e];if(VZ(t.layer,I)){WG&&console.log(t),setTimeout(()=>{it()&&Jd(I.gameObject)&&(Oi("Stencil not supported on instanced objects"),console.warn("Stencil not supported on instanced objects",I))},500);for(let i=0;i<I.sharedMaterials.length;i++){let C=I.sharedMaterials[i];C&&(C=C.clone(),C[XZ]=!0,C.stencilWrite=!0,C.stencilWriteMask=255,C.stencilFuncMask=255,C.stencilRef=t.value,C.stencilFunc=t.compareFunc,C.stencilZPass=t.passOp,C.stencilFail=t.failOp,C.stencilZFail=t.zFailOp,I.sharedMaterials[i]=C)}I.gameObject.renderOrder=t.event*1e3+t.index*50;break}}}afterRoot(I){const A=this.parser.json.extensions;if(A){const g=A[Az];if(g){WG&&console.log(g);const e=g.stencil;if(e&&Array.isArray(e))for(const t of e){const i={...t};i.compareFunc=$Z(i.compareFunc),i.passOp=zG(i.passOp),i.failOp=zG(i.failOp),i.zFailOp=zG(i.zFailOp),Bn.stencils[this.source]||(Bn.stencils[this.source]=[]),Bn.stencils[this.source].push(i)}}}return null}};let ZG=Bn;Q(ZG,"stencils",{});function zG(I){switch(I){case 0:return pr;case 1:return lm;case 2:return dm;case 3:return Dm;case 4:return pm;case 6:return um;case 7:return wm;case 5:return ym}return 0}function $Z(I){switch(I){case 1:return Sm;case 2:return Gm;case 3:return km;case 4:return fm;case 5:return Mm;case 6:return mm;case 7:return Um;case 8:return Pw}return 0}const Az="NEEDLE_render_objects",jD="NEEDLE_progressive",Se=nA("debugprogressive"),VG=Symbol("needle-progressive-texture"),XG=new Map;let $G=!1;Se&&window.addEventListener("keyup",I=>{I.key==="p"&&(XG.forEach((A,g)=>{Object.entries(A).forEach(([e,t])=>{$G?g[e]=t.lod0:g[e]=t.original,g.needsUpdate=!0})}),$G=!$G)});const WD=class{constructor(I,A,g){Q(this,"parser"),Q(this,"sourceId"),Q(this,"context"),this.parser=I,this.sourceId=A,this.context=g}static assignTextureLOD(I,A,g,e=0){if(g)for(let t of Object.keys(g)){const i=g[t];i?.isTexture===!0&&(Se&&console.log(`-----------
|
|
3979
|
+
*/var Uq={},GG=function(I){return URL.createObjectURL(new Blob([I],{type:"text/javascript"}))},Rq=function(I){return new Worker(I)};try{URL.revokeObjectURL(GG(""))}catch{GG=function(I){return"data:application/javascript;charset=UTF-8,"+encodeURI(I)},Rq=function(I){return new Worker(I,{type:"module"})}}var UZ=function(I,A,g,e,t){var i=Rq(Uq[A]||(Uq[A]=GG(I)));return i.onerror=function(C){return t(C.error,null)},i.onmessage=function(C){return t(null,C.data)},i.postMessage(g,e),i},Og=Uint8Array,ye=Uint16Array,No=Uint32Array,zQ=new Og([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]),VQ=new Og([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]),LE=new Og([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fq=function(I,A){for(var g=new ye(31),e=0;e<31;++e)g[e]=A+=1<<I[e-1];for(var t=new No(g[30]),e=1;e<30;++e)for(var i=g[e];i<g[e+1];++i)t[i]=i-g[e]<<5|e;return[g,t]},Nq=Fq(zQ,2),kG=Nq[0],JD=Nq[1];kG[28]=258,JD[258]=28;for(var Kq=Fq(VQ,0),Jq=Kq[0],fG=Kq[1],bE=new ye(32768),pI=0;pI<32768;++pI){var Hs=(pI&43690)>>>1|(pI&21845)<<1;Hs=(Hs&52428)>>>2|(Hs&13107)<<2,Hs=(Hs&61680)>>>4|(Hs&3855)<<4,bE[pI]=((Hs&65280)>>>8|(Hs&255)<<8)>>>1}for(var Si=function(I,A,g){for(var e=I.length,t=0,i=new ye(A);t<e;++t)++i[I[t]-1];var C=new ye(A);for(t=0;t<A;++t)C[t]=C[t-1]+i[t-1]<<1;var o;if(g){o=new ye(1<<A);var s=15-A;for(t=0;t<e;++t)if(I[t])for(var B=t<<4|I[t],a=A-I[t],n=C[I[t]-1]++<<a,r=n|(1<<a)-1;n<=r;++n)o[bE[n]>>>s]=B}else for(o=new ye(e),t=0;t<e;++t)I[t]&&(o[t]=bE[C[I[t]-1]++]>>>15-I[t]);return o},Ko=new Og(288),pI=0;pI<144;++pI)Ko[pI]=8;for(var pI=144;pI<256;++pI)Ko[pI]=9;for(var pI=256;pI<280;++pI)Ko[pI]=7;for(var pI=280;pI<288;++pI)Ko[pI]=8;for(var XQ=new Og(32),pI=0;pI<32;++pI)XQ[pI]=5;var qq=Si(Ko,9,0),Lq=Si(Ko,9,1),bq=Si(XQ,5,0),vq=Si(XQ,5,1),qD=function(I){for(var A=I[0],g=1;g<I.length;++g)I[g]>A&&(A=I[g]);return A},Gi=function(I,A,g){var e=A/8|0;return(I[e]|I[e+1]<<8)>>(A&7)&g},LD=function(I,A){var g=A/8|0;return(I[g]|I[g+1]<<8|I[g+2]<<16)>>(A&7)},vE=function(I){return(I/8|0)+(I&7&&1)},ki=function(I,A,g){(A==null||A<0)&&(A=0),(g==null||g>I.length)&&(g=I.length);var e=new(I instanceof ye?ye:I instanceof No?No:Og)(g-A);return e.set(I.subarray(A,g)),e},xE=function(I,A,g){var e=I.length;if(!e||g&&!g.l&&e<5)return A||new Og(0);var t=!A||g,i=!g||g.i;g||(g={}),A||(A=new Og(e*3));var C=function(V){var HA=A.length;if(V>HA){var xA=new Og(Math.max(HA*2,V));xA.set(A),A=xA}},o=g.f||0,s=g.p||0,B=g.b||0,a=g.l,n=g.d,r=g.m,E=g.n,h=e*8;do{if(!a){g.f=o=Gi(I,s,1);var c=Gi(I,s+1,3);if(s+=3,c)if(c==1)a=Lq,n=vq,r=9,E=5;else if(c==2){var l=Gi(I,s,31)+257,d=Gi(I,s+10,15)+4,p=l+Gi(I,s+5,31)+1;s+=14;for(var D=new Og(p),u=new Og(19),w=0;w<d;++w)u[LE[w]]=Gi(I,s+w*3,7);s+=d*3;for(var k=qD(u),m=(1<<k)-1,y=Si(u,k,1),w=0;w<p;){var R=y[Gi(I,s,m)];s+=R&15;var F=R>>>4;if(F<16)D[w++]=F;else{var Y=0,T=0;for(F==16?(T=3+Gi(I,s,3),s+=2,Y=D[w-1]):F==17?(T=3+Gi(I,s,7),s+=3):F==18&&(T=11+Gi(I,s,127),s+=7);T--;)D[w++]=Y}}var v=D.subarray(0,l),L=D.subarray(l);r=qD(v),E=qD(L),a=Si(v,r,1),n=Si(L,E,1)}else throw"invalid block type";else{var F=vE(s)+4,z=I[F-4]|I[F-3]<<8,IA=F+z;if(IA>e){if(i)throw"unexpected EOF";break}t&&C(B+z),A.set(I.subarray(F,IA),B),g.b=B+=z,g.p=s=IA*8;continue}if(s>h){if(i)throw"unexpected EOF";break}}t&&C(B+131072);for(var CA=(1<<r)-1,X=(1<<E)-1,lA=s;;lA=s){var Y=a[LD(I,s)&CA],BA=Y>>>4;if(s+=Y&15,s>h){if(i)throw"unexpected EOF";break}if(!Y)throw"invalid length/literal";if(BA<256)A[B++]=BA;else if(BA==256){lA=s,a=null;break}else{var LA=BA-254;if(BA>264){var w=BA-257,fA=zQ[w];LA=Gi(I,s,(1<<fA)-1)+kG[w],s+=fA}var gA=n[LD(I,s)&X],QA=gA>>>4;if(!gA)throw"invalid distance";s+=gA&15;var L=Jq[QA];if(QA>3){var fA=VQ[QA];L+=LD(I,s)&(1<<fA)-1,s+=fA}if(s>h){if(i)throw"unexpected EOF";break}t&&C(B+131072);for(var UA=B+LA;B<UA;B+=4)A[B]=A[B-L],A[B+1]=A[B+1-L],A[B+2]=A[B+2-L],A[B+3]=A[B+3-L];B=UA}}g.l=a,g.p=lA,g.b=B,a&&(o=1,g.m=r,g.d=n,g.n=E)}while(!o);return B==A.length?A:ki(A,0,B)},fC=function(I,A,g){g<<=A&7;var e=A/8|0;I[e]|=g,I[e+1]|=g>>>8},$Q=function(I,A,g){g<<=A&7;var e=A/8|0;I[e]|=g,I[e+1]|=g>>>8,I[e+2]|=g>>>16},bD=function(I,A){for(var g=[],e=0;e<I.length;++e)I[e]&&g.push({s:e,f:I[e]});var t=g.length,i=g.slice();if(!t)return[Jo,0];if(t==1){var C=new Og(g[0].s+1);return C[g[0].s]=1,[C,1]}g.sort(function(w,k){return w.f-k.f}),g.push({s:-1,f:25001});var o=g[0],s=g[1],B=0,a=1,n=2;for(g[0]={s:-1,f:o.f+s.f,l:o,r:s};a!=t-1;)o=g[g[B].f<g[n].f?B++:n++],s=g[B!=a&&g[B].f<g[n].f?B++:n++],g[a++]={s:-1,f:o.f+s.f,l:o,r:s};for(var r=i[0].s,e=1;e<t;++e)i[e].s>r&&(r=i[e].s);var E=new ye(r+1),h=vD(g[a-1],E,0);if(h>A){var e=0,c=0,l=h-A,d=1<<l;for(i.sort(function(k,m){return E[m.s]-E[k.s]||k.f-m.f});e<t;++e){var p=i[e].s;if(E[p]>A)c+=d-(1<<h-E[p]),E[p]=A;else break}for(c>>>=l;c>0;){var D=i[e].s;E[D]<A?c-=1<<A-E[D]++-1:++e}for(;e>=0&&c;--e){var u=i[e].s;E[u]==A&&(--E[u],++c)}h=A}return[new Og(E),h]},vD=function(I,A,g){return I.s==-1?Math.max(vD(I.l,A,g+1),vD(I.r,A,g+1)):A[I.s]=g},MG=function(I){for(var A=I.length;A&&!I[--A];);for(var g=new ye(++A),e=0,t=I[0],i=1,C=function(s){g[e++]=s},o=1;o<=A;++o)if(I[o]==t&&o!=A)++i;else{if(!t&&i>2){for(;i>138;i-=138)C(32754);i>2&&(C(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(C(t),--i;i>6;i-=6)C(8304);i>2&&(C(i-3<<5|8208),i=0)}for(;i--;)C(t);i=1,t=I[o]}return[g.subarray(0,e),A]},An=function(I,A){for(var g=0,e=0;e<A.length;++e)g+=I[e]*A[e];return g},YE=function(I,A,g){var e=g.length,t=vE(A+2);I[t]=e&255,I[t+1]=e>>>8,I[t+2]=I[t]^255,I[t+3]=I[t+1]^255;for(var i=0;i<e;++i)I[t+i+4]=g[i];return(t+4+e)*8},mG=function(I,A,g,e,t,i,C,o,s,B,a){fC(A,a++,g),++t[256];for(var n=bD(t,15),r=n[0],E=n[1],h=bD(i,15),c=h[0],l=h[1],d=MG(r),p=d[0],D=d[1],u=MG(c),w=u[0],k=u[1],m=new ye(19),y=0;y<p.length;++y)m[p[y]&31]++;for(var y=0;y<w.length;++y)m[w[y]&31]++;for(var R=bD(m,7),F=R[0],Y=R[1],T=19;T>4&&!F[LE[T-1]];--T);var v=B+5<<3,L=An(t,Ko)+An(i,XQ)+C,z=An(t,r)+An(i,c)+C+14+3*T+An(m,F)+(2*m[16]+3*m[17]+7*m[18]);if(v<=L&&v<=z)return YE(A,a,I.subarray(s,s+B));var IA,CA,X,lA;if(fC(A,a,1+(z<L)),a+=2,z<L){IA=Si(r,E,0),CA=r,X=Si(c,l,0),lA=c;var BA=Si(F,Y,0);fC(A,a,D-257),fC(A,a+5,k-1),fC(A,a+10,T-4),a+=14;for(var y=0;y<T;++y)fC(A,a+3*y,F[LE[y]]);a+=3*T;for(var LA=[p,w],fA=0;fA<2;++fA)for(var gA=LA[fA],y=0;y<gA.length;++y){var QA=gA[y]&31;fC(A,a,BA[QA]),a+=F[QA],QA>15&&(fC(A,a,gA[y]>>>5&127),a+=gA[y]>>>12)}}else IA=qq,CA=Ko,X=bq,lA=XQ;for(var y=0;y<o;++y)if(e[y]>255){var QA=e[y]>>>18&31;$Q(A,a,IA[QA+257]),a+=CA[QA+257],QA>7&&(fC(A,a,e[y]>>>23&31),a+=zQ[QA]);var UA=e[y]&31;$Q(A,a,X[UA]),a+=lA[UA],UA>3&&($Q(A,a,e[y]>>>5&8191),a+=VQ[UA])}else $Q(A,a,IA[e[y]]),a+=CA[e[y]];return $Q(A,a,IA[256]),a+CA[256]},xq=new No([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jo=new Og(0),Yq=function(I,A,g,e,t,i){var C=I.length,o=new Og(e+C+5*(1+Math.ceil(C/7e3))+t),s=o.subarray(e,o.length-t),B=0;if(!A||C<8)for(var a=0;a<=C;a+=65535){var n=a+65535;n<C?B=YE(s,B,I.subarray(a,n)):(s[a]=i,B=YE(s,B,I.subarray(a,C)))}else{for(var r=xq[A-1],E=r>>>13,h=r&8191,c=(1<<g)-1,l=new ye(32768),d=new ye(c+1),p=Math.ceil(g/3),D=2*p,u=function(vA){return(I[vA]^I[vA+1]<<p^I[vA+2]<<D)&c},w=new No(25e3),k=new ye(288),m=new ye(32),y=0,R=0,a=0,F=0,Y=0,T=0;a<C;++a){var v=u(a),L=a&32767,z=d[v];if(l[L]=z,d[v]=L,Y<=a){var IA=C-a;if((y>7e3||F>24576)&&IA>423){B=mG(I,s,0,w,k,m,R,F,T,a-T,B),F=y=R=0,T=a;for(var CA=0;CA<286;++CA)k[CA]=0;for(var CA=0;CA<30;++CA)m[CA]=0}var X=2,lA=0,BA=h,LA=L-z&32767;if(IA>2&&v==u(a-LA))for(var fA=Math.min(E,IA)-1,gA=Math.min(32767,a),QA=Math.min(258,IA);LA<=gA&&--BA&&L!=z;){if(I[a+X]==I[a+X-LA]){for(var UA=0;UA<QA&&I[a+UA]==I[a+UA-LA];++UA);if(UA>X){if(X=UA,lA=LA,UA>fA)break;for(var V=Math.min(LA,UA-2),HA=0,CA=0;CA<V;++CA){var xA=a-LA+CA+32768&32767,KA=l[xA],pA=xA-KA+32768&32767;pA>HA&&(HA=pA,z=xA)}}}L=z,z=l[L],LA+=L-z+32768&32767}if(lA){w[F++]=268435456|JD[X]<<18|fG[lA];var hA=JD[X]&31,uA=fG[lA]&31;R+=zQ[hA]+VQ[uA],++k[257+hA],++m[uA],Y=a+X,++y}else w[F++]=I[a],++k[I[a]]}}B=mG(I,s,i,w,k,m,R,F,T,a-T,B),!i&&B&7&&(B=YE(s,B+1,Jo))}return ki(o,0,e+vE(B)+t)},Hq=function(){for(var I=new No(256),A=0;A<256;++A){for(var g=A,e=9;--e;)g=(g&1&&3988292384)^g>>>1;I[A]=g}return I}(),gn=function(){var I=-1;return{p:function(A){for(var g=I,e=0;e<A.length;++e)g=Hq[g&255^A[e]]^g>>>8;I=g},d:function(){return~I}}},UG=function(){var I=1,A=0;return{p:function(g){for(var e=I,t=A,i=g.length,C=0;C!=i;){for(var o=Math.min(C+2655,i);C<o;++C)t+=e+=g[C];e=(e&65535)+15*(e>>16),t=(t&65535)+15*(t>>16)}I=e,A=t},d:function(){return I%=65521,A%=65521,(I&255)<<24|I>>>8<<16|(A&255)<<8|A>>>8}}},Ba=function(I,A,g,e,t){return Yq(I,A.level==null?6:A.level,A.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(I.length)))*1.5):12+A.mem,g,e,!t)},HE=function(I,A){var g={};for(var e in I)g[e]=I[e];for(var e in A)g[e]=A[e];return g},Tq=function(I,A,g){for(var e=I(),t=I.toString(),i=t.slice(t.indexOf("[")+1,t.lastIndexOf("]")).replace(/ /g,"").split(","),C=0;C<e.length;++C){var o=e[C],s=i[C];if(typeof o=="function"){A+=";"+s+"=";var B=o.toString();if(o.prototype)if(B.indexOf("[native code]")!=-1){var a=B.indexOf(" ",8)+1;A+=B.slice(a,B.indexOf("(",a))}else{A+=B;for(var n in o.prototype)A+=";"+s+".prototype."+n+"="+o.prototype[n].toString()}else A+=B}else g[s]=o}return[A,g]},xD=[],RZ=function(I){var A=[];for(var g in I)(I[g]instanceof Og||I[g]instanceof ye||I[g]instanceof No)&&A.push((I[g]=new I[g].constructor(I[g])).buffer);return A},Oq=function(I,A,g,e){var t;if(!xD[g]){for(var i="",C={},o=I.length-1,s=0;s<o;++s)t=Tq(I[s],i,C),i=t[0],C=t[1];xD[g]=Tq(I[o],i,C)}var B=HE({},xD[g][1]);return UZ(xD[g][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+A.toString()+"}",g,B,RZ(B),e)},In=function(){return[Og,ye,No,zQ,VQ,LE,kG,Jq,Lq,vq,bE,Si,qD,Gi,LD,vE,ki,xE,on,Ts,RG]},en=function(){return[Og,ye,No,zQ,VQ,LE,JD,fG,qq,Ko,bq,XQ,bE,xq,Jo,Si,fC,$Q,bD,vD,MG,An,YE,mG,vE,ki,Yq,Ba,TE,Ts]},Pq=function(){return[NG,JG,iI,gn,Hq]},_q=function(){return[KG,Zq]},jq=function(){return[qG,iI,UG]},Wq=function(){return[zq]},Ts=function(I){return postMessage(I,[I.buffer])},RG=function(I){return I&&I.size&&new Og(I.size)},tn=function(I,A,g,e,t,i){var C=Oq(g,e,t,function(o,s){C.terminate(),i(o,s)});return C.postMessage([I,A],A.consume?[I.buffer]:[]),function(){C.terminate()}},fi=function(I){return I.ondata=function(A,g){return postMessage([A,g],[A.buffer])},function(A){return I.push(A.data[0],A.data[1])}},Cn=function(I,A,g,e,t){var i,C=Oq(I,e,t,function(o,s){o?(C.terminate(),A.ondata.call(A,o)):(s[1]&&C.terminate(),A.ondata.call(A,o,s[0],s[1]))});C.postMessage(g),A.push=function(o,s){if(i)throw"stream finished";if(!A.ondata)throw"no stream handler";C.postMessage([o,i=s],[o.buffer])},A.terminate=function(){C.terminate()}},ct=function(I,A){return I[A]|I[A+1]<<8},HI=function(I,A){return(I[A]|I[A+1]<<8|I[A+2]<<16|I[A+3]<<24)>>>0},FG=function(I,A){return HI(I,A)+HI(I,A+4)*4294967296},iI=function(I,A,g){for(;g;++A)I[A]=g,g>>>=8},NG=function(I,A){var g=A.filename;if(I[0]=31,I[1]=139,I[2]=8,I[8]=A.level<2?4:A.level==9?2:0,I[9]=3,A.mtime!=0&&iI(I,4,Math.floor(new Date(A.mtime||Date.now())/1e3)),g){I[3]=8;for(var e=0;e<=g.length;++e)I[e+10]=g.charCodeAt(e)}},KG=function(I){if(I[0]!=31||I[1]!=139||I[2]!=8)throw"invalid gzip data";var A=I[3],g=10;A&4&&(g+=I[10]|(I[11]<<8)+2);for(var e=(A>>3&1)+(A>>4&1);e>0;e-=!I[g++]);return g+(A&2)},Zq=function(I){var A=I.length;return(I[A-4]|I[A-3]<<8|I[A-2]<<16|I[A-1]<<24)>>>0},JG=function(I){return 10+(I.filename&&I.filename.length+1||0)},qG=function(I,A){var g=A.level,e=g==0?0:g<6?1:g==9?3:2;I[0]=120,I[1]=e<<6|(e?32-2*e:1)},zq=function(I){if((I[0]&15)!=8||I[0]>>>4>7||(I[0]<<8|I[1])%31)throw"invalid zlib data";if(I[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function LG(I,A){return!A&&typeof I=="function"&&(A=I,I={}),this.ondata=A,I}var MC=function(){function I(A,g){!g&&typeof A=="function"&&(g=A,A={}),this.ondata=g,this.o=A||{}}return I.prototype.p=function(A,g){this.ondata(Ba(A,this.o,0,0,!g),g)},I.prototype.push=function(A,g){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=g,this.p(A,g||!1)},I}(),Vq=function(){function I(A,g){Cn([en,function(){return[fi,MC]}],this,LG.call(this,A,g),function(e){var t=new MC(e.data);onmessage=fi(t)},6)}return I}();function Xq(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[en],function(e){return Ts(TE(e.data[0],e.data[1]))},0,g)}function TE(I,A){return Ba(I,A||{},0,0)}var Ft=function(){function I(A){this.s={},this.p=new Og(0),this.ondata=A}return I.prototype.e=function(A){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var g=this.p.length,e=new Og(g+A.length);e.set(this.p),e.set(A,g),this.p=e},I.prototype.c=function(A){this.d=this.s.i=A||!1;var g=this.s.b,e=xE(this.p,this.o,this.s);this.ondata(ki(e,g,this.s.b),this.d),this.o=ki(e,this.s.b-32768),this.s.b=this.o.length,this.p=ki(this.p,this.s.p/8|0),this.s.p&=7},I.prototype.push=function(A,g){this.e(A),this.c(g)},I}(),bG=function(){function I(A){this.ondata=A,Cn([In,function(){return[fi,Ft]}],this,0,function(){var g=new Ft;onmessage=fi(g)},7)}return I}();function vG(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[In],function(e){return Ts(on(e.data[0],RG(e.data[1])))},1,g)}function on(I,A){return xE(I,A)}var YD=function(){function I(A,g){this.c=gn(),this.l=0,this.v=1,MC.call(this,A,g)}return I.prototype.push=function(A,g){MC.prototype.push.call(this,A,g)},I.prototype.p=function(A,g){this.c.p(A),this.l+=A.length;var e=Ba(A,this.o,this.v&&JG(this.o),g&&8,!g);this.v&&(NG(e,this.o),this.v=0),g&&(iI(e,e.length-8,this.c.d()),iI(e,e.length-4,this.l)),this.ondata(e,g)},I}(),$q=function(){function I(A,g){Cn([en,Pq,function(){return[fi,MC,YD]}],this,LG.call(this,A,g),function(e){var t=new YD(e.data);onmessage=fi(t)},8)}return I}();function AL(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[en,Pq,function(){return[HD]}],function(e){return Ts(HD(e.data[0],e.data[1]))},2,g)}function HD(I,A){A||(A={});var g=gn(),e=I.length;g.p(I);var t=Ba(I,A,JG(A),8),i=t.length;return NG(t,A),iI(t,i-8,g.d()),iI(t,i-4,e),t}var TD=function(){function I(A){this.v=1,Ft.call(this,A)}return I.prototype.push=function(A,g){if(Ft.prototype.e.call(this,A),this.v){var e=this.p.length>3?KG(this.p):4;if(e>=this.p.length&&!g)return;this.p=this.p.subarray(e),this.v=0}if(g){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Ft.prototype.c.call(this,g)},I}(),gL=function(){function I(A){this.ondata=A,Cn([In,_q,function(){return[fi,Ft,TD]}],this,0,function(){var g=new TD;onmessage=fi(g)},9)}return I}();function IL(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[In,_q,function(){return[OD]}],function(e){return Ts(OD(e.data[0]))},3,g)}function OD(I,A){return xE(I.subarray(KG(I),-8),A||new Og(Zq(I)))}var xG=function(){function I(A,g){this.c=UG(),this.v=1,MC.call(this,A,g)}return I.prototype.push=function(A,g){MC.prototype.push.call(this,A,g)},I.prototype.p=function(A,g){this.c.p(A);var e=Ba(A,this.o,this.v&&2,g&&4,!g);this.v&&(qG(e,this.o),this.v=0),g&&iI(e,e.length-4,this.c.d()),this.ondata(e,g)},I}(),FZ=function(){function I(A,g){Cn([en,jq,function(){return[fi,MC,xG]}],this,LG.call(this,A,g),function(e){var t=new xG(e.data);onmessage=fi(t)},10)}return I}();function NZ(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[en,jq,function(){return[YG]}],function(e){return Ts(YG(e.data[0],e.data[1]))},4,g)}function YG(I,A){A||(A={});var g=UG();g.p(I);var e=Ba(I,A,2,4);return qG(e,A),iI(e,e.length-4,g.d()),e}var PD=function(){function I(A){this.v=1,Ft.call(this,A)}return I.prototype.push=function(A,g){if(Ft.prototype.e.call(this,A),this.v){if(this.p.length<2&&!g)return;this.p=this.p.subarray(2),this.v=0}if(g){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Ft.prototype.c.call(this,g)},I}(),eL=function(){function I(A){this.ondata=A,Cn([In,Wq,function(){return[fi,Ft,PD]}],this,0,function(){var g=new PD;onmessage=fi(g)},11)}return I}();function tL(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return tn(I,A,[In,Wq,function(){return[Os]}],function(e){return Ts(Os(e.data[0],RG(e.data[1])))},5,g)}function Os(I,A){return xE((zq(I),I.subarray(2,-4)),A)}var iL=function(){function I(A){this.G=TD,this.I=Ft,this.Z=PD,this.ondata=A}return I.prototype.push=function(A,g){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(A,g);else{if(this.p&&this.p.length){var e=new Og(this.p.length+A.length);e.set(this.p),e.set(A,this.p.length)}else this.p=A;if(this.p.length>2){var t=this,i=function(){t.ondata.apply(t,arguments)};this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(i):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,g),this.p=null}}},I}(),KZ=function(){function I(A){this.G=gL,this.I=bG,this.Z=eL,this.ondata=A}return I.prototype.push=function(A,g){iL.prototype.push.call(this,A,g)},I}();function JZ(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";return I[0]==31&&I[1]==139&&I[2]==8?IL(I,A,g):(I[0]&15)!=8||I[0]>>4>7||(I[0]<<8|I[1])%31?vG(I,A,g):tL(I,A,g)}function qZ(I,A){return I[0]==31&&I[1]==139&&I[2]==8?OD(I,A):(I[0]&15)!=8||I[0]>>4>7||(I[0]<<8|I[1])%31?on(I,A):Os(I,A)}var HG=function(I,A,g,e){for(var t in I){var i=I[t],C=A+t;i instanceof Og?g[C]=[i,e]:Array.isArray(i)?g[C]=[i[0],HE(e,i[1])]:HG(i,C+"/",g,e)}},CL=typeof TextEncoder<"u"&&new TextEncoder,TG=typeof TextDecoder<"u"&&new TextDecoder,oL=0;try{TG.decode(Jo,{stream:!0}),oL=1}catch{}var sL=function(I){for(var A="",g=0;;){var e=I[g++],t=(e>127)+(e>223)+(e>239);if(g+t>I.length)return[A,ki(I,g-1)];t?t==3?(e=((e&15)<<18|(I[g++]&63)<<12|(I[g++]&63)<<6|I[g++]&63)-65536,A+=String.fromCharCode(55296|e>>10,56320|e&1023)):t&1?A+=String.fromCharCode((e&31)<<6|I[g++]&63):A+=String.fromCharCode((e&15)<<12|(I[g++]&63)<<6|I[g++]&63):A+=String.fromCharCode(e)}},LZ=function(){function I(A){this.ondata=A,oL?this.t=new TextDecoder:this.p=Jo}return I.prototype.push=function(A,g){if(!this.ondata)throw"no callback";if(g=!!g,this.t){if(this.ondata(this.t.decode(A,{stream:!0}),g),g){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}return}if(!this.p)throw"stream finished";var e=new Og(this.p.length+A.length);e.set(this.p),e.set(A,this.p.length);var t=sL(e),i=t[0],C=t[1];if(g){if(C.length)throw"invalid utf-8 data";this.p=null}else this.p=C;this.ondata(i,g)},I}(),bZ=function(){function I(A){this.ondata=A}return I.prototype.push=function(A,g){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(mC(A),this.d=g||!1)},I}();function mC(I,A){if(A){for(var g=new Og(I.length),e=0;e<I.length;++e)g[e]=I.charCodeAt(e);return g}if(CL)return CL.encode(I);for(var t=I.length,i=new Og(I.length+(I.length>>1)),C=0,o=function(n){i[C++]=n},e=0;e<t;++e){if(C+5>i.length){var s=new Og(C+8+(t-e<<1));s.set(i),i=s}var B=I.charCodeAt(e);B<128||A?o(B):B<2048?(o(192|B>>6),o(128|B&63)):B>55295&&B<57344?(B=65536+(B&1023<<10)|I.charCodeAt(++e)&1023,o(240|B>>18),o(128|B>>12&63),o(128|B>>6&63),o(128|B&63)):(o(224|B>>12),o(128|B>>6&63),o(128|B&63))}return ki(i,0,C)}function OG(I,A){if(A){for(var g="",e=0;e<I.length;e+=16384)g+=String.fromCharCode.apply(null,I.subarray(e,e+16384));return g}else{if(TG)return TG.decode(I);var t=sL(I),i=t[0],C=t[1];if(C.length)throw"invalid utf-8 data";return i}}var BL=function(I){return I==1?3:I<6?2:I==9?1:0},aL=function(I,A){return A+30+ct(I,A+26)+ct(I,A+28)},QL=function(I,A,g){var e=ct(I,A+28),t=OG(I.subarray(A+46,A+46+e),!(ct(I,A+8)&2048)),i=A+46+e,C=HI(I,A+20),o=g&&C==4294967295?nL(I,i):[C,HI(I,A+24),HI(I,A+42)],s=o[0],B=o[1],a=o[2];return[ct(I,A+10),s,B,t,i+ct(I,A+30)+ct(I,A+32),a]},nL=function(I,A){for(;ct(I,A)!=1;A+=4+ct(I,A+2));return[FG(I,A+12),FG(I,A+4),FG(I,A+20)]},Ps=function(I){var A=0;if(I)for(var g in I){var e=I[g].length;if(e>65535)throw"extra field too long";A+=e+4}return A},sn=function(I,A,g,e,t,i,C,o){var s=e.length,B=g.extra,a=o&&o.length,n=Ps(B);iI(I,A,C!=null?33639248:67324752),A+=4,C!=null&&(I[A++]=20,I[A++]=g.os),I[A]=20,A+=2,I[A++]=g.flag<<1|(i==null&&8),I[A++]=t&&8,I[A++]=g.compression&255,I[A++]=g.compression>>8;var r=new Date(g.mtime==null?Date.now():g.mtime),E=r.getFullYear()-1980;if(E<0||E>119)throw"date not in range 1980-2099";if(iI(I,A,E<<25|r.getMonth()+1<<21|r.getDate()<<16|r.getHours()<<11|r.getMinutes()<<5|r.getSeconds()>>>1),A+=4,i!=null&&(iI(I,A,g.crc),iI(I,A+4,i),iI(I,A+8,g.size)),iI(I,A+12,s),iI(I,A+14,n),A+=16,C!=null&&(iI(I,A,a),iI(I,A+6,g.attrs),iI(I,A+10,C),A+=14),I.set(e,A),A+=s,n)for(var h in B){var c=B[h],l=c.length;iI(I,A,+h),iI(I,A+2,l),I.set(c,A+4),A+=4+l}return a&&(I.set(o,A),A+=a),A},PG=function(I,A,g,e,t){iI(I,A,101010256),iI(I,A+8,g),iI(I,A+10,g),iI(I,A+12,e),iI(I,A+16,t)},OE=function(){function I(A){this.filename=A,this.c=gn(),this.size=0,this.compression=0}return I.prototype.process=function(A,g){this.ondata(null,A,g)},I.prototype.push=function(A,g){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(A),this.size+=A.length,g&&(this.crc=this.c.d()),this.process(A,g||!1)},I}(),vZ=function(){function I(A,g){var e=this;g||(g={}),OE.call(this,A),this.d=new MC(g,function(t,i){e.ondata(null,t,i)}),this.compression=8,this.flag=BL(g.level)}return I.prototype.process=function(A,g){try{this.d.push(A,g)}catch(e){this.ondata(e,null,g)}},I.prototype.push=function(A,g){OE.prototype.push.call(this,A,g)},I}(),xZ=function(){function I(A,g){var e=this;g||(g={}),OE.call(this,A),this.d=new Vq(g,function(t,i,C){e.ondata(t,i,C)}),this.compression=8,this.flag=BL(g.level),this.terminate=this.d.terminate}return I.prototype.process=function(A,g){this.d.push(A,g)},I.prototype.push=function(A,g){OE.prototype.push.call(this,A,g)},I}(),YZ=function(){function I(A){this.ondata=A,this.u=[],this.d=1}return I.prototype.add=function(A){var g=this;if(this.d&2)throw"stream finished";var e=mC(A.filename),t=e.length,i=A.comment,C=i&&mC(i),o=t!=A.filename.length||C&&i.length!=C.length,s=t+Ps(A.extra)+30;if(t>65535)throw"filename too long";var B=new Og(s);sn(B,0,A,e,o);var a=[B],n=function(){for(var l=0,d=a;l<d.length;l++){var p=d[l];g.ondata(null,p,!1)}a=[]},r=this.d;this.d=0;var E=this.u.length,h=HE(A,{f:e,u:o,o:C,t:function(){A.terminate&&A.terminate()},r:function(){if(n(),r){var l=g.u[E+1];l?l.r():g.d=1}r=1}}),c=0;A.ondata=function(l,d,p){if(l)g.ondata(l,d,p),g.terminate();else if(c+=d.length,a.push(d),p){var D=new Og(16);iI(D,0,134695760),iI(D,4,A.crc),iI(D,8,c),iI(D,12,A.size),a.push(D),h.c=c,h.b=s+c+16,h.crc=A.crc,h.size=A.size,r&&h.r(),r=1}else r&&n()},this.u.push(h)},I.prototype.end=function(){var A=this;if(this.d&2)throw this.d&1?"stream finishing":"stream finished";this.d?this.e():this.u.push({r:function(){A.d&1&&(A.u.splice(-1,1),A.e())},t:function(){}}),this.d=3},I.prototype.e=function(){for(var A=0,g=0,e=0,t=0,i=this.u;t<i.length;t++){var C=i[t];e+=46+C.f.length+Ps(C.extra)+(C.o?C.o.length:0)}for(var o=new Og(e+22),s=0,B=this.u;s<B.length;s++){var C=B[s];sn(o,A,C,C.f,C.u,C.c,g,C.o),A+=46+C.f.length+Ps(C.extra)+(C.o?C.o.length:0),g+=C.b}PG(o,A,this.u.length,e,g),this.ondata(null,o,!0),this.d=2},I.prototype.terminate=function(){for(var A=0,g=this.u;A<g.length;A++){var e=g[A];e.t()}this.d=2},I}();function HZ(I,A,g){if(g||(g=A,A={}),typeof g!="function")throw"no callback";var e={};HG(I,"",e,A);var t=Object.keys(e),i=t.length,C=0,o=0,s=i,B=new Array(i),a=[],n=function(){for(var c=0;c<a.length;++c)a[c]()},r=function(){var c=new Og(o+22),l=C,d=o-C;o=0;for(var p=0;p<s;++p){var D=B[p];try{var u=D.c.length;sn(c,o,D,D.f,D.u,u);var w=30+D.f.length+Ps(D.extra),k=o+w;c.set(D.c,k),sn(c,C,D,D.f,D.u,u,o,D.m),C+=16+w+(D.m?D.m.length:0),o=k+u}catch(m){return g(m,null)}}PG(c,C,B.length,d,l),g(null,c)};i||r();for(var E=function(c){var l=t[c],d=e[l],p=d[0],D=d[1],u=gn(),w=p.length;u.p(p);var k=mC(l),m=k.length,y=D.comment,R=y&&mC(y),F=R&&R.length,Y=Ps(D.extra),T=D.level==0?0:8,v=function(L,z){if(L)n(),g(L,null);else{var IA=z.length;B[c]=HE(D,{size:w,crc:u.d(),c:z,f:k,m:R,u:m!=l.length||R&&y.length!=F,compression:T}),C+=30+m+Y+IA,o+=76+2*(m+Y)+(F||0)+IA,--i||r()}};if(m>65535&&v("filename too long",null),!T)v(null,p);else if(w<16e4)try{v(null,TE(p,D))}catch(L){v(L,null)}else a.push(Xq(p,D,v))},h=0;h<s;++h)E(h);return n}function rL(I,A){A||(A={});var g={},e=[];HG(I,"",g,A);var t=0,i=0;for(var C in g){var o=g[C],s=o[0],B=o[1],a=B.level==0?0:8,n=mC(C),r=n.length,E=B.comment,h=E&&mC(E),c=h&&h.length,l=Ps(B.extra);if(r>65535)throw"filename too long";var d=a?TE(s,B):s,p=d.length,D=gn();D.p(s),e.push(HE(B,{size:s.length,crc:D.d(),c:d,f:n,m:h,u:r!=C.length||h&&E.length!=c,o:t,compression:a})),t+=30+r+l+p,i+=76+2*(r+l)+(c||0)+p}for(var u=new Og(i+22),w=t,k=i-t,m=0;m<e.length;++m){var n=e[m];sn(u,n.o,n,n.f,n.u,n.c.length);var y=30+n.f.length+Ps(n.extra);u.set(n.c,n.o+y),sn(u,t,n,n.f,n.u,n.c.length,n.o,n.m),t+=16+y+(n.m?n.m.length:0)}return PG(u,t,e.length,k,w),u}var EL=function(){function I(){}return I.prototype.push=function(A,g){this.ondata(null,A,g)},I.compression=0,I}(),TZ=function(){function I(){var A=this;this.i=new Ft(function(g,e){A.ondata(null,g,e)})}return I.prototype.push=function(A,g){try{this.i.push(A,g)}catch(e){this.ondata(e,A,g)}},I.compression=8,I}(),OZ=function(){function I(A,g){var e=this;g<32e4?this.i=new Ft(function(t,i){e.ondata(null,t,i)}):(this.i=new bG(function(t,i,C){e.ondata(t,i,C)}),this.terminate=this.i.terminate)}return I.prototype.push=function(A,g){this.i.terminate&&(A=ki(A,0)),this.i.push(A,g)},I.compression=8,I}(),PZ=function(){function I(A){this.onfile=A,this.k=[],this.o={0:EL},this.p=Jo}return I.prototype.push=function(A,g){var e=this;if(!this.onfile)throw"no callback";if(!this.p)throw"stream finished";if(this.c>0){var t=Math.min(this.c,A.length),i=A.subarray(0,t);if(this.c-=t,this.d?this.d.push(i,!this.c):this.k[0].push(i),A=A.subarray(t),A.length)return this.push(A,g)}else{var C=0,o=0,s=void 0,B=void 0;this.p.length?A.length?(B=new Og(this.p.length+A.length),B.set(this.p),B.set(A,this.p.length)):B=this.p:B=A;for(var a=B.length,n=this.c,r=n&&this.d,E=function(){var d,p=HI(B,o);if(p==67324752){C=1,s=o,h.d=null,h.c=0;var D=ct(B,o+6),u=ct(B,o+8),w=D&2048,k=D&8,m=ct(B,o+26),y=ct(B,o+28);if(a>o+30+m+y){var R=[];h.k.unshift(R),C=2;var F=HI(B,o+18),Y=HI(B,o+22),T=OG(B.subarray(o+30,o+=30+m),!w);F==4294967295?(d=k?[-2]:nL(B,o),F=d[0],Y=d[1]):k&&(F=-1),o+=y,h.c=F;var v,L={name:T,compression:u,start:function(){if(!L.ondata)throw"no callback";if(!F)L.ondata(null,Jo,!0);else{var z=e.o[u];if(!z)throw"unknown compression type "+u;v=F<0?new z(T):new z(T,F,Y),v.ondata=function(lA,BA,LA){L.ondata(lA,BA,LA)};for(var IA=0,CA=R;IA<CA.length;IA++){var X=CA[IA];v.push(X,!1)}e.k[0]==R&&e.c?e.d=v:v.push(Jo,!0)}},terminate:function(){v&&v.terminate&&v.terminate()}};F>=0&&(L.size=F,L.originalSize=Y),h.onfile(L)}return"break"}else if(n){if(p==134695760)return s=o+=12+(n==-2&&8),C=3,h.c=0,"break";if(p==33639248)return s=o-=4,C=3,h.c=0,"break"}},h=this;o<a-4;++o){var c=E();if(c==="break")break}if(this.p=Jo,n<0){var l=C?B.subarray(0,s-12-(n==-2&&8)-(HI(B,s-16)==134695760&&4)):B.subarray(0,o);r?r.push(l,!!C):this.k[+(C==2)].push(l)}if(C&2)return this.push(B.subarray(o),g);this.p=B.subarray(o)}if(g){if(this.c)throw"invalid zip file";this.p=null}},I.prototype.register=function(A){this.o[A.compression]=A},I}();function _Z(I,A){if(typeof A!="function")throw"no callback";for(var g=[],e=function(){for(var r=0;r<g.length;++r)g[r]()},t={},i=I.length-22;HI(I,i)!=101010256;--i)if(!i||I.length-i>65558){A("invalid zip file",null);return}var C=ct(I,i+8);C||A(null,{});var o=C,s=HI(I,i+16),B=s==4294967295;if(B){if(i=HI(I,i-12),HI(I,i)!=101075792){A("invalid zip file",null);return}o=C=HI(I,i+32),s=HI(I,i+48)}for(var a=function(r){var E=QL(I,s,B),h=E[0],c=E[1],l=E[2],d=E[3],p=E[4],D=E[5],u=aL(I,D);s=p;var w=function(m,y){m?(e(),A(m,null)):(t[d]=y,--C||A(null,t))};if(!h)w(null,ki(I,u,u+c));else if(h==8){var k=I.subarray(u,u+c);if(c<32e4)try{w(null,on(k,new Og(l)))}catch(m){w(m,null)}else g.push(vG(k,{size:l},w))}else w("unknown compression type "+h,null)},n=0;n<o;++n)a();return e}function jZ(I){for(var A={},g=I.length-22;HI(I,g)!=101010256;--g)if(!g||I.length-g>65558)throw"invalid zip file";var e=ct(I,g+8);if(!e)return{};var t=HI(I,g+16),i=t==4294967295;if(i){if(g=HI(I,g-12),HI(I,g)!=101075792)throw"invalid zip file";e=HI(I,g+32),t=HI(I,g+48)}for(var C=0;C<e;++C){var o=QL(I,t,i),s=o[0],B=o[1],a=o[2],n=o[3],r=o[4],E=o[5],h=aL(I,E);if(t=r,!s)A[n]=ki(I,h,h+B);else if(s==8)A[n]=on(I.subarray(h,h+B),new Og(a));else throw"unknown compression type "+s}return A}const hL=Object.freeze(Object.defineProperty({__proto__:null,AsyncCompress:$q,AsyncDecompress:KZ,AsyncDeflate:Vq,AsyncGunzip:gL,AsyncGzip:$q,AsyncInflate:bG,AsyncUnzipInflate:OZ,AsyncUnzlib:eL,AsyncZipDeflate:xZ,AsyncZlib:FZ,Compress:YD,DecodeUTF8:LZ,Decompress:iL,Deflate:MC,EncodeUTF8:bZ,Gunzip:TD,Gzip:YD,Inflate:Ft,Unzip:PZ,UnzipInflate:TZ,UnzipPassThrough:EL,Unzlib:PD,Zip:YZ,ZipDeflate:vZ,ZipPassThrough:OE,Zlib:xG,compress:AL,compressSync:HD,decompress:JZ,decompressSync:qZ,deflate:Xq,deflateSync:TE,gunzip:IL,gunzipSync:OD,gzip:AL,gzipSync:HD,inflate:vG,inflateSync:on,strFromU8:OG,strToU8:mC,unzip:_Z,unzipSync:jZ,unzlib:tL,unzlibSync:Os,zip:HZ,zipSync:rL,zlib:NZ,zlibSync:YG},Symbol.toStringTag,{value:"Module"}));class _G extends iS{constructor(A){super(A),this.type=se}parse(A){const g=Math.pow(2.7182818,2.2);function e(f,N){let U=0;for(let H=0;H<65536;++H)(H==0||f[H>>3]&1<<(H&7))&&(N[U++]=H);const q=U-1;for(;U<65536;)N[U++]=0;return q}function t(f){for(let N=0;N<16384;N++)f[N]={},f[N].len=0,f[N].lit=0,f[N].p=null}const i={l:0,c:0,lc:0};function C(f,N,U,q,H){for(;U<f;)N=N<<8|uA(q,H),U+=8;U-=f,i.l=N>>U&(1<<f)-1,i.c=N,i.lc=U}const o=new Array(59);function s(f){for(let U=0;U<=58;++U)o[U]=0;for(let U=0;U<65537;++U)o[f[U]]+=1;let N=0;for(let U=58;U>0;--U){const q=N+o[U]>>1;o[U]=N,N=q}for(let U=0;U<65537;++U){const q=f[U];q>0&&(f[U]=q|o[q]++<<6)}}function B(f,N,U,q,H,O){const rA=N;let yA=0,qA=0;for(;q<=H;q++){if(rA.value-N.value>U)return!1;C(6,yA,qA,f,rA);const GA=i.l;if(yA=i.c,qA=i.lc,O[q]=GA,GA==63){if(rA.value-N.value>U)throw new Error("Something wrong with hufUnpackEncTable");C(8,yA,qA,f,rA);let bA=i.l+6;if(yA=i.c,qA=i.lc,q+bA>H+1)throw new Error("Something wrong with hufUnpackEncTable");for(;bA--;)O[q++]=0;q--}else if(GA>=59){let bA=GA-59+2;if(q+bA>H+1)throw new Error("Something wrong with hufUnpackEncTable");for(;bA--;)O[q++]=0;q--}}s(O)}function a(f){return f&63}function n(f){return f>>6}function r(f,N,U,q){for(;N<=U;N++){const H=n(f[N]),O=a(f[N]);if(H>>O)throw new Error("Invalid table entry");if(O>14){const rA=q[H>>O-14];if(rA.len)throw new Error("Invalid table entry");if(rA.lit++,rA.p){const yA=rA.p;rA.p=new Array(rA.lit);for(let qA=0;qA<rA.lit-1;++qA)rA.p[qA]=yA[qA]}else rA.p=new Array(1);rA.p[rA.lit-1]=N}else if(O){let rA=0;for(let yA=1<<14-O;yA>0;yA--){const qA=q[(H<<14-O)+rA];if(qA.len||qA.p)throw new Error("Invalid table entry");qA.len=O,qA.lit=N,rA++}}}return!0}const E={c:0,lc:0};function h(f,N,U,q){f=f<<8|uA(U,q),N+=8,E.c=f,E.lc=N}const c={c:0,lc:0};function l(f,N,U,q,H,O,rA,yA,qA){if(f==N){q<8&&(h(U,q,H,O),U=E.c,q=E.lc),q-=8;let GA=U>>q;if(GA=new Uint8Array([GA])[0],yA.value+GA>qA)return!1;const bA=rA[yA.value-1];for(;GA-- >0;)rA[yA.value++]=bA}else if(yA.value<qA)rA[yA.value++]=f;else return!1;c.c=U,c.lc=q}function d(f){return f&65535}function p(f){const N=d(f);return N>32767?N-65536:N}const D={a:0,b:0};function u(f,N){const U=p(f),q=p(N),H=U+(q&1)+(q>>1),O=H,rA=H-q;D.a=O,D.b=rA}function w(f,N){const U=d(f),q=d(N),H=U-(q>>1)&65535,O=q+H-32768&65535;D.a=O,D.b=H}function k(f,N,U,q,H,O,rA){const yA=rA<16384,qA=U>H?H:U;let GA=1,bA,OA;for(;GA<=qA;)GA<<=1;for(GA>>=1,bA=GA,GA>>=1;GA>=1;){OA=0;const VA=OA+O*(H-bA),Cg=O*GA,fg=O*bA,sg=q*GA,rg=q*bA;let qg,J,AA,EA;for(;OA<=VA;OA+=fg){let W=OA;const iA=OA+q*(U-bA);for(;W<=iA;W+=rg){const jA=W+sg,Eg=W+Cg,ng=Eg+sg;yA?(u(f[W+N],f[Eg+N]),qg=D.a,AA=D.b,u(f[jA+N],f[ng+N]),J=D.a,EA=D.b,u(qg,J),f[W+N]=D.a,f[jA+N]=D.b,u(AA,EA),f[Eg+N]=D.a,f[ng+N]=D.b):(w(f[W+N],f[Eg+N]),qg=D.a,AA=D.b,w(f[jA+N],f[ng+N]),J=D.a,EA=D.b,w(qg,J),f[W+N]=D.a,f[jA+N]=D.b,w(AA,EA),f[Eg+N]=D.a,f[ng+N]=D.b)}if(U&GA){const jA=W+Cg;yA?u(f[W+N],f[jA+N]):w(f[W+N],f[jA+N]),qg=D.a,f[jA+N]=D.b,f[W+N]=qg}}if(H&GA){let W=OA;const iA=OA+q*(U-bA);for(;W<=iA;W+=rg){const jA=W+sg;yA?u(f[W+N],f[jA+N]):w(f[W+N],f[jA+N]),qg=D.a,f[jA+N]=D.b,f[W+N]=qg}}bA=GA,GA>>=1}return OA}function m(f,N,U,q,H,O,rA,yA,qA){let GA=0,bA=0;const OA=rA,VA=Math.trunc(q.value+(H+7)/8);for(;q.value<VA;)for(h(GA,bA,U,q),GA=E.c,bA=E.lc;bA>=14;){const fg=GA>>bA-14&16383,sg=N[fg];if(sg.len)bA-=sg.len,l(sg.lit,O,GA,bA,U,q,yA,qA,OA),GA=c.c,bA=c.lc;else{if(!sg.p)throw new Error("hufDecode issues");let rg;for(rg=0;rg<sg.lit;rg++){const qg=a(f[sg.p[rg]]);for(;bA<qg&&q.value<VA;)h(GA,bA,U,q),GA=E.c,bA=E.lc;if(bA>=qg&&n(f[sg.p[rg]])==(GA>>bA-qg&(1<<qg)-1)){bA-=qg,l(sg.p[rg],O,GA,bA,U,q,yA,qA,OA),GA=c.c,bA=c.lc;break}}if(rg==sg.lit)throw new Error("hufDecode issues")}}const Cg=8-H&7;for(GA>>=Cg,bA-=Cg;bA>0;){const fg=N[GA<<14-bA&16383];if(fg.len)bA-=fg.len,l(fg.lit,O,GA,bA,U,q,yA,qA,OA),GA=c.c,bA=c.lc;else throw new Error("hufDecode issues")}return!0}function y(f,N,U,q,H,O){const rA={value:0},yA=U.value,qA=hA(N,U),GA=hA(N,U);U.value+=4;const bA=hA(N,U);if(U.value+=4,qA<0||qA>=65537||GA<0||GA>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const OA=new Array(65537),VA=new Array(16384);t(VA);const Cg=q-(U.value-yA);if(B(f,U,Cg,qA,GA,OA),bA>8*(q-(U.value-yA)))throw new Error("Something wrong with hufUncompress");r(OA,qA,GA,VA),m(OA,VA,f,U,bA,GA,O,H,rA)}function R(f,N,U){for(let q=0;q<U;++q)N[q]=f[N[q]]}function F(f){for(let N=1;N<f.length;N++){const U=f[N-1]+f[N]-128;f[N]=U}}function Y(f,N){let U=0,q=Math.floor((f.length+1)/2),H=0;const O=f.length-1;for(;!(H>O||(N[H++]=f[U++],H>O));)N[H++]=f[q++]}function T(f){let N=f.byteLength;const U=new Array;let q=0;const H=new DataView(f);for(;N>0;){const O=H.getInt8(q++);if(O<0){const rA=-O;N-=rA+1;for(let yA=0;yA<rA;yA++)U.push(H.getUint8(q++))}else{const rA=O;N-=2;const yA=H.getUint8(q++);for(let qA=0;qA<rA+1;qA++)U.push(yA)}}return U}function v(f,N,U,q,H,O){let rA=new DataView(O.buffer);const yA=U[f.idx[0]].width,qA=U[f.idx[0]].height,GA=3,bA=Math.floor(yA/8),OA=Math.ceil(yA/8),VA=Math.ceil(qA/8),Cg=yA-(OA-1)*8,fg=qA-(VA-1)*8,sg={value:0},rg=new Array(GA),qg=new Array(GA),J=new Array(GA),AA=new Array(GA),EA=new Array(GA);for(let iA=0;iA<GA;++iA)EA[iA]=N[f.idx[iA]],rg[iA]=iA<1?0:rg[iA-1]+OA*VA,qg[iA]=new Float32Array(64),J[iA]=new Uint16Array(64),AA[iA]=new Uint16Array(OA*64);for(let iA=0;iA<VA;++iA){let jA=8;iA==VA-1&&(jA=fg);let Eg=8;for(let $A=0;$A<OA;++$A){$A==OA-1&&(Eg=Cg);for(let cg=0;cg<GA;++cg)J[cg].fill(0),J[cg][0]=H[rg[cg]++],L(sg,q,J[cg]),z(J[cg],qg[cg]),IA(qg[cg]);CA(qg);for(let cg=0;cg<GA;++cg)X(qg[cg],AA[cg],$A*64)}let ng=0;for(let $A=0;$A<GA;++$A){const cg=U[f.idx[$A]].type;for(let mg=8*iA;mg<8*iA+jA;++mg){ng=EA[$A][mg];for(let Ng=0;Ng<bA;++Ng){const BI=Ng*64+(mg&7)*8;rA.setUint16(ng+0*2*cg,AA[$A][BI+0],!0),rA.setUint16(ng+1*2*cg,AA[$A][BI+1],!0),rA.setUint16(ng+2*2*cg,AA[$A][BI+2],!0),rA.setUint16(ng+3*2*cg,AA[$A][BI+3],!0),rA.setUint16(ng+4*2*cg,AA[$A][BI+4],!0),rA.setUint16(ng+5*2*cg,AA[$A][BI+5],!0),rA.setUint16(ng+6*2*cg,AA[$A][BI+6],!0),rA.setUint16(ng+7*2*cg,AA[$A][BI+7],!0),ng+=8*2*cg}}if(bA!=OA)for(let mg=8*iA;mg<8*iA+jA;++mg){const Ng=EA[$A][mg]+8*bA*2*cg,BI=bA*64+(mg&7)*8;for(let ce=0;ce<Eg;++ce)rA.setUint16(Ng+ce*2*cg,AA[$A][BI+ce],!0)}}}const W=new Uint16Array(yA);rA=new DataView(O.buffer);for(let iA=0;iA<GA;++iA){U[f.idx[iA]].decoded=!0;const jA=U[f.idx[iA]].type;if(U[iA].type==2)for(let Eg=0;Eg<qA;++Eg){const ng=EA[iA][Eg];for(let $A=0;$A<yA;++$A)W[$A]=rA.getUint16(ng+$A*2*jA,!0);for(let $A=0;$A<yA;++$A)rA.setFloat32(ng+$A*2*jA,DA(W[$A]),!0)}}}function L(f,N,U){let q,H=1;for(;H<64;)q=N[f.value],q==65280?H=64:q>>8==255?H+=q&255:(U[H]=q,H++),f.value++}function z(f,N){N[0]=DA(f[0]),N[1]=DA(f[1]),N[2]=DA(f[5]),N[3]=DA(f[6]),N[4]=DA(f[14]),N[5]=DA(f[15]),N[6]=DA(f[27]),N[7]=DA(f[28]),N[8]=DA(f[2]),N[9]=DA(f[4]),N[10]=DA(f[7]),N[11]=DA(f[13]),N[12]=DA(f[16]),N[13]=DA(f[26]),N[14]=DA(f[29]),N[15]=DA(f[42]),N[16]=DA(f[3]),N[17]=DA(f[8]),N[18]=DA(f[12]),N[19]=DA(f[17]),N[20]=DA(f[25]),N[21]=DA(f[30]),N[22]=DA(f[41]),N[23]=DA(f[43]),N[24]=DA(f[9]),N[25]=DA(f[11]),N[26]=DA(f[18]),N[27]=DA(f[24]),N[28]=DA(f[31]),N[29]=DA(f[40]),N[30]=DA(f[44]),N[31]=DA(f[53]),N[32]=DA(f[10]),N[33]=DA(f[19]),N[34]=DA(f[23]),N[35]=DA(f[32]),N[36]=DA(f[39]),N[37]=DA(f[45]),N[38]=DA(f[52]),N[39]=DA(f[54]),N[40]=DA(f[20]),N[41]=DA(f[22]),N[42]=DA(f[33]),N[43]=DA(f[38]),N[44]=DA(f[46]),N[45]=DA(f[51]),N[46]=DA(f[55]),N[47]=DA(f[60]),N[48]=DA(f[21]),N[49]=DA(f[34]),N[50]=DA(f[37]),N[51]=DA(f[47]),N[52]=DA(f[50]),N[53]=DA(f[56]),N[54]=DA(f[59]),N[55]=DA(f[61]),N[56]=DA(f[35]),N[57]=DA(f[36]),N[58]=DA(f[48]),N[59]=DA(f[49]),N[60]=DA(f[57]),N[61]=DA(f[58]),N[62]=DA(f[62]),N[63]=DA(f[63])}function IA(f){const N=.5*Math.cos(.7853975),U=.5*Math.cos(3.14159/16),q=.5*Math.cos(3.14159/8),H=.5*Math.cos(3*3.14159/16),O=.5*Math.cos(5*3.14159/16),rA=.5*Math.cos(3*3.14159/8),yA=.5*Math.cos(7*3.14159/16),qA=new Array(4),GA=new Array(4),bA=new Array(4),OA=new Array(4);for(let VA=0;VA<8;++VA){const Cg=VA*8;qA[0]=q*f[Cg+2],qA[1]=rA*f[Cg+2],qA[2]=q*f[Cg+6],qA[3]=rA*f[Cg+6],GA[0]=U*f[Cg+1]+H*f[Cg+3]+O*f[Cg+5]+yA*f[Cg+7],GA[1]=H*f[Cg+1]-yA*f[Cg+3]-U*f[Cg+5]-O*f[Cg+7],GA[2]=O*f[Cg+1]-U*f[Cg+3]+yA*f[Cg+5]+H*f[Cg+7],GA[3]=yA*f[Cg+1]-O*f[Cg+3]+H*f[Cg+5]-U*f[Cg+7],bA[0]=N*(f[Cg+0]+f[Cg+4]),bA[3]=N*(f[Cg+0]-f[Cg+4]),bA[1]=qA[0]+qA[3],bA[2]=qA[1]-qA[2],OA[0]=bA[0]+bA[1],OA[1]=bA[3]+bA[2],OA[2]=bA[3]-bA[2],OA[3]=bA[0]-bA[1],f[Cg+0]=OA[0]+GA[0],f[Cg+1]=OA[1]+GA[1],f[Cg+2]=OA[2]+GA[2],f[Cg+3]=OA[3]+GA[3],f[Cg+4]=OA[3]-GA[3],f[Cg+5]=OA[2]-GA[2],f[Cg+6]=OA[1]-GA[1],f[Cg+7]=OA[0]-GA[0]}for(let VA=0;VA<8;++VA)qA[0]=q*f[16+VA],qA[1]=rA*f[16+VA],qA[2]=q*f[48+VA],qA[3]=rA*f[48+VA],GA[0]=U*f[8+VA]+H*f[24+VA]+O*f[40+VA]+yA*f[56+VA],GA[1]=H*f[8+VA]-yA*f[24+VA]-U*f[40+VA]-O*f[56+VA],GA[2]=O*f[8+VA]-U*f[24+VA]+yA*f[40+VA]+H*f[56+VA],GA[3]=yA*f[8+VA]-O*f[24+VA]+H*f[40+VA]-U*f[56+VA],bA[0]=N*(f[VA]+f[32+VA]),bA[3]=N*(f[VA]-f[32+VA]),bA[1]=qA[0]+qA[3],bA[2]=qA[1]-qA[2],OA[0]=bA[0]+bA[1],OA[1]=bA[3]+bA[2],OA[2]=bA[3]-bA[2],OA[3]=bA[0]-bA[1],f[0+VA]=OA[0]+GA[0],f[8+VA]=OA[1]+GA[1],f[16+VA]=OA[2]+GA[2],f[24+VA]=OA[3]+GA[3],f[32+VA]=OA[3]-GA[3],f[40+VA]=OA[2]-GA[2],f[48+VA]=OA[1]-GA[1],f[56+VA]=OA[0]-GA[0]}function CA(f){for(let N=0;N<64;++N){const U=f[0][N],q=f[1][N],H=f[2][N];f[0][N]=U+1.5747*H,f[1][N]=U-.1873*q-.4682*H,f[2][N]=U+1.8556*q}}function X(f,N,U){for(let q=0;q<64;++q)N[U+q]=ZB.toHalfFloat(lA(f[q]))}function lA(f){return f<=1?Math.sign(f)*Math.pow(Math.abs(f),2.2):Math.sign(f)*Math.pow(g,Math.abs(f)-1)}function BA(f){return new DataView(f.array.buffer,f.offset.value,f.size)}function LA(f){const N=f.viewer.buffer.slice(f.offset.value,f.offset.value+f.size),U=new Uint8Array(T(N)),q=new Uint8Array(U.length);return F(U),Y(U,q),new DataView(q.buffer)}function fA(f){const N=f.array.slice(f.offset.value,f.offset.value+f.size);typeof hL>"u"&&console.error("THREE.EXRLoader: External library fflate.min.js required.");const U=Os(N),q=new Uint8Array(U.length);return F(U),Y(U,q),new DataView(q.buffer)}function gA(f){const N=f.viewer,U={value:f.offset.value},q=new Uint16Array(f.width*f.scanlineBlockSize*(f.channels*f.type)),H=new Uint8Array(8192);let O=0;const rA=new Array(f.channels);for(let fg=0;fg<f.channels;fg++)rA[fg]={},rA[fg].start=O,rA[fg].end=rA[fg].start,rA[fg].nx=f.width,rA[fg].ny=f.lines,rA[fg].size=f.type,O+=rA[fg].nx*rA[fg].ny*rA[fg].size;const yA=ag(N,U),qA=ag(N,U);if(qA>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(yA<=qA)for(let fg=0;fg<qA-yA+1;fg++)H[fg+yA]=cA(N,U);const GA=new Uint16Array(65536),bA=e(H,GA),OA=hA(N,U);y(f.array,N,U,OA,q,O);for(let fg=0;fg<f.channels;++fg){const sg=rA[fg];for(let rg=0;rg<rA[fg].size;++rg)k(q,sg.start+rg,sg.nx,sg.size,sg.ny,sg.nx*sg.size,bA)}R(GA,q,O);let VA=0;const Cg=new Uint8Array(q.buffer.byteLength);for(let fg=0;fg<f.lines;fg++)for(let sg=0;sg<f.channels;sg++){const rg=rA[sg],qg=rg.nx*rg.size,J=new Uint8Array(q.buffer,rg.end*2,qg*2);Cg.set(J,VA),VA+=qg*2,rg.end+=qg}return new DataView(Cg.buffer)}function QA(f){const N=f.array.slice(f.offset.value,f.offset.value+f.size);typeof hL>"u"&&console.error("THREE.EXRLoader: External library fflate.min.js required.");const U=Os(N),q=f.lines*f.channels*f.width,H=f.type==1?new Uint16Array(q):new Uint32Array(q);let O=0,rA=0;const yA=new Array(4);for(let qA=0;qA<f.lines;qA++)for(let GA=0;GA<f.channels;GA++){let bA=0;switch(f.type){case 1:yA[0]=O,yA[1]=yA[0]+f.width,O=yA[1]+f.width;for(let OA=0;OA<f.width;++OA){const VA=U[yA[0]++]<<8|U[yA[1]++];bA+=VA,H[rA]=bA,rA++}break;case 2:yA[0]=O,yA[1]=yA[0]+f.width,yA[2]=yA[1]+f.width,O=yA[2]+f.width;for(let OA=0;OA<f.width;++OA){const VA=U[yA[0]++]<<24|U[yA[1]++]<<16|U[yA[2]++]<<8;bA+=VA,H[rA]=bA,rA++}break}}return new DataView(H.buffer)}function UA(f){const N=f.viewer,U={value:f.offset.value},q=new Uint8Array(f.width*f.lines*(f.channels*f.type*2)),H={version:vA(N,U),unknownUncompressedSize:vA(N,U),unknownCompressedSize:vA(N,U),acCompressedSize:vA(N,U),dcCompressedSize:vA(N,U),rleCompressedSize:vA(N,U),rleUncompressedSize:vA(N,U),rleRawSize:vA(N,U),totalAcUncompressedCount:vA(N,U),totalDcUncompressedCount:vA(N,U),acCompression:vA(N,U)};if(H.version<2)throw new Error("EXRLoader.parse: "+YA.compression+" version "+H.version+" is unsupported");const O=new Array;let rA=ag(N,U)-2;for(;rA>0;){const sg=V(N.buffer,U),rg=cA(N,U),qg=rg>>2&3,J=(rg>>4)-1,AA=new Int8Array([J])[0],EA=cA(N,U);O.push({name:sg,index:AA,type:EA,compression:qg}),rA-=sg.length+3}const yA=YA.channels,qA=new Array(f.channels);for(let sg=0;sg<f.channels;++sg){const rg=qA[sg]={},qg=yA[sg];rg.name=qg.name,rg.compression=0,rg.decoded=!1,rg.type=qg.pixelType,rg.pLinear=qg.pLinear,rg.width=f.width,rg.height=f.lines}const GA={idx:new Array(3)};for(let sg=0;sg<f.channels;++sg){const rg=qA[sg];for(let qg=0;qg<O.length;++qg){const J=O[qg];rg.name==J.name&&(rg.compression=J.compression,J.index>=0&&(GA.idx[J.index]=sg),rg.offset=sg)}}let bA,OA,VA;if(H.acCompressedSize>0)switch(H.acCompression){case 0:bA=new Uint16Array(H.totalAcUncompressedCount),y(f.array,N,U,H.acCompressedSize,bA,H.totalAcUncompressedCount);break;case 1:const sg=f.array.slice(U.value,U.value+H.totalAcUncompressedCount),rg=Os(sg);bA=new Uint16Array(rg.buffer),U.value+=H.totalAcUncompressedCount;break}if(H.dcCompressedSize>0){const sg={array:f.array,offset:U,size:H.dcCompressedSize};OA=new Uint16Array(fA(sg).buffer),U.value+=H.dcCompressedSize}if(H.rleRawSize>0){const sg=f.array.slice(U.value,U.value+H.rleCompressedSize),rg=Os(sg);VA=T(rg.buffer),U.value+=H.rleCompressedSize}let Cg=0;const fg=new Array(qA.length);for(let sg=0;sg<fg.length;++sg)fg[sg]=new Array;for(let sg=0;sg<f.lines;++sg)for(let rg=0;rg<qA.length;++rg)fg[rg].push(Cg),Cg+=qA[rg].width*f.type*2;v(GA,fg,qA,bA,OA,q);for(let sg=0;sg<qA.length;++sg){const rg=qA[sg];if(!rg.decoded)switch(rg.compression){case 2:let qg=0,J=0;for(let AA=0;AA<f.lines;++AA){let EA=fg[sg][qg];for(let W=0;W<rg.width;++W){for(let iA=0;iA<2*rg.type;++iA)q[EA++]=VA[J+iA*rg.width*rg.height];J++}qg++}break;case 1:default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(q.buffer)}function V(f,N){const U=new Uint8Array(f);let q=0;for(;U[N.value+q]!=0;)q+=1;const H=new TextDecoder().decode(U.slice(N.value,N.value+q));return N.value=N.value+q+1,H}function HA(f,N,U){const q=new TextDecoder().decode(new Uint8Array(f).slice(N.value,N.value+U));return N.value=N.value+U,q}function xA(f,N){const U=pA(f,N),q=hA(f,N);return[U,q]}function KA(f,N){const U=hA(f,N),q=hA(f,N);return[U,q]}function pA(f,N){const U=f.getInt32(N.value,!0);return N.value=N.value+4,U}function hA(f,N){const U=f.getUint32(N.value,!0);return N.value=N.value+4,U}function uA(f,N){const U=f[N.value];return N.value=N.value+1,U}function cA(f,N){const U=f.getUint8(N.value);return N.value=N.value+1,U}const vA=function(f,N){const U=Number(f.getBigInt64(N.value,!0));return N.value+=8,U};function RA(f,N){const U=f.getFloat32(N.value,!0);return N.value+=4,U}function Bg(f,N){return ZB.toHalfFloat(RA(f,N))}function DA(f){const N=(f&31744)>>10,U=f&1023;return(f>>15?-1:1)*(N?N===31?U?NaN:1/0:Math.pow(2,N-15)*(1+U/1024):6103515625e-14*(U/1024))}function ag(f,N){const U=f.getUint16(N.value,!0);return N.value+=2,U}function Qg(f,N){return DA(ag(f,N))}function Mg(f,N,U,q){const H=U.value,O=[];for(;U.value<H+q-1;){const rA=V(N,U),yA=pA(f,U),qA=cA(f,U);U.value+=3;const GA=pA(f,U),bA=pA(f,U);O.push({name:rA,pixelType:yA,pLinear:qA,xSampling:GA,ySampling:bA})}return U.value+=1,O}function Xg(f,N){const U=RA(f,N),q=RA(f,N),H=RA(f,N),O=RA(f,N),rA=RA(f,N),yA=RA(f,N),qA=RA(f,N),GA=RA(f,N);return{redX:U,redY:q,greenX:H,greenY:O,blueX:rA,blueY:yA,whiteX:qA,whiteY:GA}}function b(f,N){const U=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],q=cA(f,N);return U[q]}function K(f,N){const U=hA(f,N),q=hA(f,N),H=hA(f,N),O=hA(f,N);return{xMin:U,yMin:q,xMax:H,yMax:O}}function aA(f,N){const U=["INCREASING_Y"],q=cA(f,N);return U[q]}function mA(f,N){const U=RA(f,N),q=RA(f,N);return[U,q]}function JA(f,N){const U=RA(f,N),q=RA(f,N),H=RA(f,N);return[U,q,H]}function TA(f,N,U,q,H){if(q==="string"||q==="stringvector"||q==="iccProfile")return HA(N,U,H);if(q==="chlist")return Mg(f,N,U,H);if(q==="chromaticities")return Xg(f,U);if(q==="compression")return b(f,U);if(q==="box2i")return K(f,U);if(q==="lineOrder")return aA(f,U);if(q==="float")return RA(f,U);if(q==="v2f")return mA(f,U);if(q==="v3f")return JA(f,U);if(q==="int")return pA(f,U);if(q==="rational")return xA(f,U);if(q==="timecode")return KA(f,U);if(q==="preview")return U.value+=H,"skipped";U.value+=H}function tg(f,N,U){const q={};if(f.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.");q.version=f.getUint8(4);const H=f.getUint8(5);q.spec={singleTile:!!(H&2),longName:!!(H&4),deepFormat:!!(H&8),multiPart:!!(H&16)},U.value=8;let O=!0;for(;O;){const rA=V(N,U);if(rA==0)O=!1;else{const yA=V(N,U),qA=hA(f,U),GA=TA(f,N,U,yA,qA);GA===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${yA}'.`):q[rA]=GA}}if(H&-5)throw console.error("EXRHeader:",q),new Error("THREE.EXRLoader: provided file is currently unsupported.");return q}function x(f,N,U,q,H){const O={size:0,viewer:N,array:U,offset:q,width:f.dataWindow.xMax-f.dataWindow.xMin+1,height:f.dataWindow.yMax-f.dataWindow.yMin+1,channels:f.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:f.channels[0].pixelType,uncompress:null,getter:null,format:null,encoding:null};switch(f.compression){case"NO_COMPRESSION":O.lines=1,O.uncompress=BA;break;case"RLE_COMPRESSION":O.lines=1,O.uncompress=LA;break;case"ZIPS_COMPRESSION":O.lines=1,O.uncompress=fA;break;case"ZIP_COMPRESSION":O.lines=16,O.uncompress=fA;break;case"PIZ_COMPRESSION":O.lines=32,O.uncompress=gA;break;case"PXR24_COMPRESSION":O.lines=16,O.uncompress=QA;break;case"DWAA_COMPRESSION":O.lines=32,O.uncompress=UA;break;case"DWAB_COMPRESSION":O.lines=256,O.uncompress=UA;break;default:throw new Error("EXRLoader.parse: "+f.compression+" is unsupported")}if(O.scanlineBlockSize=O.lines,O.type==1)switch(H){case jI:O.getter=Qg,O.inputSize=2;break;case se:O.getter=ag,O.inputSize=2;break}else if(O.type==2)switch(H){case jI:O.getter=RA,O.inputSize=4;break;case se:O.getter=Bg,O.inputSize=4}else throw new Error("EXRLoader.parse: unsupported pixelType "+O.type+" for "+f.compression+".");O.blockCount=(f.dataWindow.yMax+1)/O.scanlineBlockSize;for(let yA=0;yA<O.blockCount;yA++)vA(N,q);O.outputChannels=O.channels==3?4:O.channels;const rA=O.width*O.height*O.outputChannels;switch(H){case jI:O.byteArray=new Float32Array(rA),O.channels<O.outputChannels&&O.byteArray.fill(1,0,rA);break;case se:O.byteArray=new Uint16Array(rA),O.channels<O.outputChannels&&O.byteArray.fill(15360,0,rA);break;default:console.error("THREE.EXRLoader: unsupported type: ",H);break}return O.bytesPerLine=O.width*O.inputSize*O.channels,O.outputChannels==4?(O.format=cI,O.encoding=JI):(O.format=as,O.encoding=JI),O}const Z=new DataView(A),PA=new Uint8Array(A),WA={value:0},YA=tg(Z,A,WA),dA=x(YA,Z,PA,WA,this.type),og={value:0},kg={R:0,G:1,B:2,A:3,Y:0};for(let f=0;f<dA.height/dA.scanlineBlockSize;f++){const N=hA(Z,WA);dA.size=hA(Z,WA),dA.lines=N+dA.scanlineBlockSize>dA.height?dA.height-N:dA.scanlineBlockSize;const U=dA.size<dA.lines*dA.bytesPerLine?dA.uncompress(dA):BA(dA);WA.value+=dA.size;for(let q=0;q<dA.scanlineBlockSize;q++){const H=q+f*dA.scanlineBlockSize;if(H>=dA.height)break;for(let O=0;O<dA.channels;O++){const rA=kg[YA.channels[O].name];for(let yA=0;yA<dA.width;yA++){og.value=(q*(dA.channels*dA.width)+O*dA.width+yA)*dA.inputSize;const qA=(dA.height-1-H)*(dA.width*dA.outputChannels)+yA*dA.outputChannels+rA;dA.byteArray[qA]=dA.getter(U,og)}}}}return{header:YA,width:dA.width,height:dA.height,data:dA.byteArray,format:dA.format,encoding:dA.encoding,type:this.type}}setDataType(A){return this.type=A,this}load(A,g,e,t){function i(C,o){C.encoding=o.encoding,C.minFilter=Lg,C.magFilter=Lg,C.generateMipmaps=!1,C.flipY=!1,g&&g(C,o)}return super.load(A,i,e,t)}}const jG=nA("debugexr");class WZ{constructor(A){Q(this,"parser"),Q(this,"name"),this.parser=A,this.name="EXT_texture_exr",jG&&console.log(A)}loadTexture(A){const g=this.name,e=this.parser,t=e.json.textures[A];if(jG&&console.log("EXT_texture_exr.loadTexture",A,t),!t.extensions||!t.extensions[g])return null;const i=t.extensions[g],C=new _G(e.options.manager);return jG&&console.log("EXT_texture_exr.loadTexture",i,C),e.loadTextureImage(A,i.source,C)}}window.addEventListener("unhandledrejection",I=>{});const cL="NEEDLE_gameobject_data";class ZZ{constructor(A){Q(this,"parser"),this.parser=A}get name(){return cL}afterRoot(A){const g=[];for(let e=0;e<this.parser.json.nodes.length;e++){const t=this.parser.json.nodes[e];if(t&&t.extensions){const i=t.extensions[cL];if(i){const C=this.findAndApplyExtensionData(e,i);g.push(C)}}}return Promise.all(g).then(()=>{})}async findAndApplyExtensionData(A,g){const e=await this.parser.getDependency("node",A);e&&this.applyExtensionData(e,g)}applyExtensionData(A,g){g.layers===void 0&&(g.layers=0),A.userData.layer=g.layers,A.layers.disableAll(),A.layers.set(g.layers),A.userData.tag=g.tag??"none",A.userData.hideFlags=g.hideFlags??0,A.userData.static=g.static??!1,A.visible=g.activeSelf??!0,A.guid=g.guid}}const lL="NEEDLE_lighting_settings",aa=nA("debugenvlight");class zZ{constructor(A,g,e){Q(this,"parser"),Q(this,"sourceId"),Q(this,"context"),this.parser=A,this.sourceId=g,this.context=e}get name(){return lL}afterRoot(A){const g=this.parser.json.extensions;if(g){const e=g[lL];if(e){aa&&console.log('Loaded "'+this.name+'", src: "'+this.sourceId+'"',e);let t;if(A.scene.children.length===1)t=eA.addNewComponent(A.scene.children[0],_D,!1);else{const i=new FA;i.name="LightSettings "+this.sourceId,A.scene.add(i),t=eA.addNewComponent(i,_D,!1)}t.sourceId=this.sourceId,t.ambientIntensity=e.ambientIntensity,t.ambientLight=new wA().fromArray(e.ambientLight),Array.isArray(e.ambientTrilight)&&(t.ambientTrilight=e.ambientTrilight.map(i=>new wA().fromArray(i))),t.ambientMode=e.ambientMode,t.environmentReflectionSource=e.environmentReflectionSource}}return null}}oe.registerCallback(ai.ContextCreated,I=>{const A=I.context,g=eA.findObjectOfType(_D,A);g!=null&&g.sourceId&&(g.enabled=!0)});class _D extends NA{constructor(){super(...arguments),Q(this,"ambientMode",TQ.Skybox),Q(this,"ambientLight"),Q(this,"ambientTrilight"),Q(this,"ambientIntensity",1),Q(this,"environmentReflectionSource",mD.Skybox),Q(this,"_hasReflection",!1),Q(this,"_ambientLightObj"),Q(this,"_hemisphereLightObj"),Q(this,"_lightProbeObj")}awake(){if(this.sourceId){const A=this.environmentReflectionSource===mD.Skybox?Ks.Skybox:Ks.Reflection,g=this.context.lightmaps.tryGet(this.sourceId,A,0);this._hasReflection=g!=null,g&&this.context.sceneLighting.internalRegisterReflection(this.sourceId,g)}this.enabled=!1,this.context.sceneLighting.internalRegisterSceneLightSettings(this),aa&&window.addEventListener("keydown",A=>{if(!this.destroyed)switch(A.key){case"l":this.enabled=!this.enabled;break}})}onDestroy(){this.context.sceneLighting.internalUnregisterSceneLightSettings(this)}calculateIntensityFactor(A){const g=Math.max(A.r,A.g,A.b);return 2.2*XA.lerp(0,1.33,g)}onEnable(){if(aa&&console.warn("\u{1F4A1}\u{1F7E1} >>> Enable lighting",this.sourceId,this.enabled,this),this.ambientMode==TQ.Flat){if(this.ambientLight&&!this._ambientLightObj){const A=this.calculateIntensityFactor(this.ambientLight);this._ambientLightObj=new aS(this.ambientLight,this.ambientIntensity*A),aa&&console.log("Created ambient light",this.sourceId,this._ambientLightObj,this.ambientIntensity,A)}this._ambientLightObj&&this.gameObject.add(this._ambientLightObj),this._lightProbeObj&&this._lightProbeObj.removeFromParent()}else if(this.ambientMode===TQ.Trilight){if(this.ambientTrilight){const A=this.ambientTrilight[0],g=this.ambientTrilight[this.ambientTrilight.length-1],e=this.calculateIntensityFactor(g);this._hemisphereLightObj=new CS(g,A,this.ambientIntensity*e),this.gameObject.add(this._hemisphereLightObj),aa&&console.log("Created hemisphere ambient light",this.sourceId,this._hemisphereLightObj,this.ambientIntensity,e)}}else this._ambientLightObj&&this._ambientLightObj.removeFromParent(),this._hemisphereLightObj&&this._hemisphereLightObj.removeFromParent(),this._lightProbeObj?this.enabled&&this.destroyed&&this._lightProbeObj&&this.gameObject.add(this._lightProbeObj):this.sourceId&&this.context.sceneLighting.internalGetSceneLightingData(this.sourceId).then(A=>{A&&(this._lightProbeObj=A.lightProbe,this.enabled&&!this.destroyed&&this._lightProbeObj&&(aa&&console.log("Add",this.sourceId,A),this.gameObject.add(this._lightProbeObj)))});this.sourceId&&this.context.sceneLighting.internalEnableReflection(this.sourceId)}onDisable(){aa&&console.warn("\u{1F4A1}\u26AB <<< Disable lighting:",this.sourceId,this),this._lightProbeObj&&this._lightProbeObj.removeFromParent(),this._ambientLightObj&&this._ambientLightObj.removeFromParent(),this._hemisphereLightObj&&this._hemisphereLightObj.removeFromParent(),this.sourceId&&this.context.sceneLighting.internalDisableReflection(this.sourceId)}}const WG=nA("debugstencil");function VZ(I,A){return(I&1<<A.layer)!=0}const XZ=Symbol("stencils"),Bn=class{constructor(I,A){Q(this,"parser"),Q(this,"source"),this.parser=I,this.source=A}static applyStencil(I){if(!I)return;const A=I.sourceId;if(WG&&console.log(A,Bn.stencils),!A)return;const g=Bn.stencils[A];if(g)for(let e=g.length-1;e>=0;e--){const t=g[e];if(VZ(t.layer,I)){WG&&console.log(t),setTimeout(()=>{it()&&Jd(I.gameObject)&&(Oi("Stencil not supported on instanced objects"),console.warn("Stencil not supported on instanced objects",I))},500);for(let i=0;i<I.sharedMaterials.length;i++){let C=I.sharedMaterials[i];C&&(C=C.clone(),C[XZ]=!0,C.stencilWrite=!0,C.stencilWriteMask=255,C.stencilFuncMask=255,C.stencilRef=t.value,C.stencilFunc=t.compareFunc,C.stencilZPass=t.passOp,C.stencilFail=t.failOp,C.stencilZFail=t.zFailOp,I.sharedMaterials[i]=C)}I.gameObject.renderOrder=t.event*1e3+t.index*50;break}}}afterRoot(I){const A=this.parser.json.extensions;if(A){const g=A[Az];if(g){WG&&console.log(g);const e=g.stencil;if(e&&Array.isArray(e))for(const t of e){const i={...t};i.compareFunc=$Z(i.compareFunc),i.passOp=zG(i.passOp),i.failOp=zG(i.failOp),i.zFailOp=zG(i.zFailOp),Bn.stencils[this.source]||(Bn.stencils[this.source]=[]),Bn.stencils[this.source].push(i)}}}return null}};let ZG=Bn;Q(ZG,"stencils",{});function zG(I){switch(I){case 0:return pr;case 1:return lm;case 2:return dm;case 3:return Dm;case 4:return pm;case 6:return um;case 7:return wm;case 5:return ym}return 0}function $Z(I){switch(I){case 1:return Sm;case 2:return Gm;case 3:return km;case 4:return fm;case 5:return Mm;case 6:return mm;case 7:return Um;case 8:return Pw}return 0}const Az="NEEDLE_render_objects",jD="NEEDLE_progressive",Se=nA("debugprogressive"),VG=Symbol("needle-progressive-texture"),XG=new Map;let $G=!1;Se&&window.addEventListener("keyup",I=>{I.key==="p"&&(XG.forEach((A,g)=>{Object.entries(A).forEach(([e,t])=>{$G?g[e]=t.lod0:g[e]=t.original,g.needsUpdate=!0})}),$G=!$G)});const WD=class{constructor(I,A,g){Q(this,"parser"),Q(this,"sourceId"),Q(this,"context"),this.parser=I,this.sourceId=A,this.context=g}static assignTextureLOD(I,A,g,e=0){if(g)for(let t of Object.keys(g)){const i=g[t];i?.isTexture===!0&&(Se&&console.log(`-----------
|
|
3980
3980
|
`,"FIND",g.name,t,i?.name,i?.userData,i,g),WD.getOrLoadTexture(I,A,g,t,i,e).then(C=>{if(C?.isTexture===!0&&(Se&&console.log("Assign LOD",g.name,t,C.name,C.guid,g,"Prev:",i,"Now:",C,`
|
|
3981
3981
|
--------------`),g[t]=C,C.needsUpdate=!0,g.needsUpdate=!0,Se)){let o=XG.get(g);o||(o={},XG.set(g,o));let s=o[t];s||(s=o[t]={original:i,lod0:C}),s.lod0=C}}))}}get name(){return jD}afterRoot(I){var A;return Se&&console.log("AFTER",this.sourceId,I),(A=this.parser.json.textures)==null||A.forEach((g,e)=>{if(g!=null&&g.extensions){const t=g?.extensions[jD];t&&this.parser.getDependency("texture",e).then(i=>{Se&&console.log("> Progressive: register",i.name,i.uuid,t),i.source&&(i.source[VG]=t),WD.cache.set(i.uuid,t)})}}),null}static async getOrLoadTexture(I,A,g,e,t,i){const C=t.uuid;let o;if(t.source&&t.source[VG]&&(o=t.source[VG]),o||(o=WD.cache.get(C)),o){Se&&console.log(C,o.uri,o.guid);const s=St(A,o.uri);if(s.endsWith(".glb")||s.endsWith(".gltf")){if(!o.guid)return console.warn("missing pointer for glb/gltf texture",o),null;const B=s+"_"+o.guid;if(this.resolved[B]){let n=this.resolved[B];if(n.image&&n.image.data)return Se&&console.log("Texture has already been loaded: "+B,g.name,e,t.name,n),n=this.copySettings(t,n),n;n&&Se&&console.log("Texture has been disposed, will load again: "+B,g.name,e,t.name,n)}const a=this.onProgressiveLoadStart(I,A,s,g,e);try{if(this.currentlyLoading[B]!==void 0){Se&&console.log("Already loading:",g.name+"."+e,B);let E=await this.currentlyLoading[B];return E&&(E=this.copySettings(t,E)),E}const n=o,r=new Promise(async(E,h)=>{const c=new jQ;NE(c,I),Se&&console.log("Load "+s,g.name,e,n.guid),Se&&await xc(Math.random()*1e3);const l=await c.loadAsync(s),d=l.parser;Se&&console.log("Loading finished "+s,g.name,e,n.guid);let p=-1,D=!1;for(const w of l.parser.json.textures)if(p++,w!=null&&w.extensions){const k=w?.extensions[jD];if(k!=null&&k.guid&&k.guid===n.guid){D=!0;break}}if(!D)return E(null);let u=await d.getDependency("texture",p);u=this.copySettings(t,u),u&&(u.guid=n.guid),this.resolved[B]=u,Se&&console.log(g.name,e,'change "'+t.name+'" \u2192 "'+u.name+'"',s,p,u,g,B),E(u)});return this.currentlyLoading[B]=r,await r}finally{delete this.currentlyLoading[B],this.onProgressiveLoadEnd(a)}}else{const B=this.onProgressiveLoadStart(I,A,s,g,e);try{Se&&console.log("Load texture from uri: "+s);const a=await new ws().loadAsync(s);return a?(a.guid=o.guid,a.flipY=!1,a.needsUpdate=!0,a.encoding=t.encoding,Se&&console.log(o,a)):Se&&console.warn("failed loading",s),a}finally{this.onProgressiveLoadEnd(B)}}}else Se&&console.warn("unknown texture",t.name,t.uuid,t);return null}static copySettings(I,A){const g=I.clone(),e=A.source,t=A.mipmaps;return g.copy(I),g.source=e,g.mipmaps=t,g}static beginListenStart(I,A){this._progressiveEventListeners.has(I)||this._progressiveEventListeners.set(I,new DL),this._progressiveEventListeners.get(I).start.push(A)}static stopListenStart(I,A){if(!this._progressiveEventListeners.has(I))return;const g=this._progressiveEventListeners.get(I).start,e=g.indexOf(A);e>=0&&g.splice(e,1)}static beginListenEnd(I,A){this._progressiveEventListeners.has(I)||this._progressiveEventListeners.set(I,new DL),this._progressiveEventListeners.get(I).end.push(A)}static stopListenEnd(I,A){if(!this._progressiveEventListeners.has(I))return;const g=this._progressiveEventListeners.get(I).end,e=g.indexOf(A);e>=0&&g.splice(e,1)}static onProgressiveLoadStart(I,A,g,e,t){this._currentProgressiveLoadingInfo.has(I)||this._currentProgressiveLoadingInfo.set(I,[]);const i=new dL(I,A,g,e,t),C=this._currentProgressiveLoadingInfo.get(I),o=this._progressiveEventListeners.get(I);return o&&o.onStart(i),C.push(i),i}static onProgressiveLoadEnd(I){if(!I)return;const A=I.context;if(!this._currentProgressiveLoadingInfo.has(A))return;const g=this._currentProgressiveLoadingInfo.get(A),e=g.indexOf(I);if(e<0)return;g.splice(e,1);const t=this._progressiveEventListeners.get(A);t&&t.onEnd(I)}};let qo=WD;Q(qo,"cache",new Map),Q(qo,"resolved",{}),Q(qo,"currentlyLoading",{}),Q(qo,"_progressiveEventListeners",new Map),Q(qo,"_currentProgressiveLoadingInfo",new Map);class dL{constructor(A,g,e,t,i){Q(this,"context"),Q(this,"source"),Q(this,"uri"),Q(this,"material"),Q(this,"slot"),this.context=A,this.source=g,this.uri=e,this.material=t,this.slot=i}}class DL{constructor(){Q(this,"start",[]),Q(this,"end",[])}onStart(A){for(const g of this.start)g(A)}onEnd(A){for(const g of this.end)g(A)}}const PE=new Array;function gz(I){PE.includes(I)||PE.push(I)}function Iz(I){const A=PE.indexOf(I);A>=0&&PE.splice(A,1)}function Ak(I){const A=new mq;return I.register(g=>(A.parser=g,A)),A}class ez{resolvePath(A){return A.includes("/extensions/builtin_components/")?A.replace("/extensions/builtin_components/","/userData/components/"):A.includes("extensions/builtin_components/")?A.replace("extensions/builtin_components/","/userData/components/"):A}}function pL(I,A,g){const e=g.lastIndexOf("?");e>=0&&(g=g.substring(0,e)),I.register(i=>new ZZ(i)),I.register(i=>new Y_(i)),I.register(i=>new B8(i,A.lightmaps,g)),I.register(i=>new zZ(i,g,A)),I.register(i=>new kZ(i,g)),I.register(i=>new ZG(i,g)),I.register(i=>new qo(i,g,A)),I.register(i=>new WZ(i)),TF()&&I.register(i=>new xF(i));for(const i of PE)I.register(C=>new i(C));const t=I.setAnimationPointerResolver;typeof t=="function"&&t.bind(I)(new ez)}var tz=Object.defineProperty,iz=Object.getOwnPropertyDescriptor,uL=(I,A,g,e)=>{for(var t=e>1?void 0:e?iz(A,g):A,i=I.length-1,C;i>=0;i--)(C=I[i])&&(t=(e?C(A,g,t):C(t))||t);return e&&t&&tz(A,g,t),t};class _E extends NA{constructor(){super(...arguments),Q(this,"from"),Q(this,"to"),Q(this,"width",0),Q(this,"centered",!0),Q(this,"_centerPos")}awake(){this._centerPos=new S}update(){if(!this.from||!this.to)return;const A=wg(this.from).clone(),g=wg(this.to).clone(),e=A.distanceTo(g);this._centerPos.copy(A),this._centerPos.add(g),this._centerPos.multiplyScalar(.5),ue(this.gameObject,this.centered?this._centerPos:A),this.gameObject.lookAt(wg(this.to).clone()),this.gameObject.scale.set(this.width,this.width,e)}}uL([G(eA)],_E.prototype,"from",2),uL([G(eA)],_E.prototype,"to",2);var Cz=Object.defineProperty,oz=Object.getOwnPropertyDescriptor,_s=(I,A,g,e)=>{for(var t=e>1?void 0:e?oz(A,g):A,i=I.length-1,C;i>=0;i--)(C=I[i])&&(t=(e?C(A,g,t):C(t))||t);return e&&t&&Cz(A,g,t),t};class js{constructor(){Q(this,"time"),Q(this,"value"),Q(this,"inTangent"),Q(this,"inWeight"),Q(this,"outTangent"),Q(this,"outWeight"),Q(this,"weightedMode")}}_s([G()],js.prototype,"time",2),_s([G()],js.prototype,"value",2),_s([G()],js.prototype,"inTangent",2),_s([G()],js.prototype,"inWeight",2),_s([G()],js.prototype,"outTangent",2),_s([G()],js.prototype,"outWeight",2),_s([G()],js.prototype,"weightedMode",2);class Qa{constructor(){Q(this,"keys")}get duration(){return!this.keys||this.keys.length==0?0:this.keys[this.keys.length-1].time}evaluate(A){if(!this.keys||this.keys.length==0)return 0;if(this.keys[0].time>=A)return this.keys[0].value;for(let g=0;g<this.keys.length;g++){const e=this.keys[g];if(e.time<=A)if(g+1<this.keys.length){const t=this.keys[g+1];if(t.time<A)continue;const i=XA.remap(A,e.time,t.time,0,1);return XA.lerp(e.value,t.value,i)}else return e.value}return this.keys[this.keys.length-1].value}}_s([G(js)],Qa.prototype,"keys",2);function wL(I){return I.replace(/[^a-zA-Z0-9_]/g,"")}class sz{get isDocumentRoot(){return!0}get isDynamic(){return!1}constructor(){this.name="StageRoot",this.children=[],this.stageLength=100}add(A){A.parent=this,this.children.push(A)}remove(A){const g=this.children.indexOf(A);g>=0&&(A.parent===this&&(A.parent=null),this.children.splice(g,1))}traverse(A,g=null){if(g!==null?A(g):g=this,g.children)for(const e of g.children)this.traverse(A,e)}findById(A){let g=!1;function e(t){if(!g){if(t.uuid===A)return g=!0,t;if(t.children)for(const i of t.children){const C=e(i);if(C)return C}}}return e(this)}buildHeader(){return`#usda 1.0
|
|
3982
3982
|
(
|