@splinetool/runtime 0.9.34 → 0.9.35
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/build/runtime.js +1 -1
- package/package.json +1 -1
package/build/runtime.js
CHANGED
|
@@ -4226,4 +4226,4 @@ float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offse
|
|
|
4226
4226
|
vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord));
|
|
4227
4227
|
#endif
|
|
4228
4228
|
outputColor=vec4(color,inputColor.a);}`,Vp={DEFAULT:0,ESKIL:1},mA=class extends Vi{constructor({blendFunction:i=yt.NORMAL,technique:e=Vp.DEFAULT,eskil:t=!1,offset:r=.5,darkness:n=.5}={}){super("VignetteEffect",DU,{blendFunction:i,defines:new Map([["VIGNETTE_TECHNIQUE",e.toFixed(0)]]),uniforms:new Map([["offset",new Te(r)],["darkness",new Te(n)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(i){this.technique!==i&&(this.defines.set("VIGNETTE_TECHNIQUE",i.toFixed(0)),this.setChanged())}get eskil(){return this.technique===Vp.ESKIL}set eskil(i){this.technique=i?Vp.ESKIL:Vp.DEFAULT}getTechnique(){return this.technique}setTechnique(i){this.technique=i}get offset(){return this.uniforms.get("offset").value}set offset(i){this.uniforms.get("offset").value=i}getOffset(){return this.offset}setOffset(i){this.offset=i}get darkness(){return this.uniforms.get("darkness").value}set darkness(i){this.uniforms.get("darkness").value=i}getDarkness(){return this.darkness}setDarkness(i){this.darkness=i}},Hie=[new Float32Array(3),new Float32Array(3)],Wie=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],jie=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var qie=[new Float32Array(2),new Float32Array(2)];var Xie=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Yie=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],Jie=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Qie=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Kie=new Map([[en(0,0,0,0),new Float32Array([0,0,0,0])],[en(0,0,0,1),new Float32Array([0,0,0,1])],[en(0,0,1,0),new Float32Array([0,0,1,0])],[en(0,0,1,1),new Float32Array([0,0,1,1])],[en(0,1,0,0),new Float32Array([0,1,0,0])],[en(0,1,0,1),new Float32Array([0,1,0,1])],[en(0,1,1,0),new Float32Array([0,1,1,0])],[en(0,1,1,1),new Float32Array([0,1,1,1])],[en(1,0,0,0),new Float32Array([1,0,0,0])],[en(1,0,0,1),new Float32Array([1,0,0,1])],[en(1,0,1,0),new Float32Array([1,0,1,0])],[en(1,0,1,1),new Float32Array([1,0,1,1])],[en(1,1,0,0),new Float32Array([1,1,0,0])],[en(1,1,0,1),new Float32Array([1,1,0,1])],[en(1,1,1,0),new Float32Array([1,1,1,0])],[en(1,1,1,1),new Float32Array([1,1,1,1])]]);function Tv(i,e,t){return i+(e-i)*t}function en(i,e,t,r){let n=Tv(i,e,.75),s=Tv(t,r,1-.25);return Tv(n,s,1-.125)}var pr=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(r){this.effect.blendMode.opacity.value=r},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(r){this.effect.blendMode.setBlendFunction(Number(r))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=yt.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=se({},this),r=Object.getPrototypeOf(this),n=Object.getOwnPropertyNames(r);for(let s of n){let o=Object.getOwnPropertyDescriptor(r,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var Ql=class extends pr{constructor(){super(oA),this.blendFunction=yt.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var Kl=class extends pr{constructor(){super(aA)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var Zl=class extends pr{constructor(){super(cA),this.effect.offset=new B(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var $l=class extends pr{constructor(){super(lA)}};var ec=class extends pr{constructor(){super(hA);this._hue=0}set hue(t){this._hue=t,this.effect.setHue(t)}get hue(){return this._hue}set saturation(t){this.effect.uniforms.get("saturation").value=t}get saturation(){return this.effect.uniforms.get("saturation").value}};var tc=class extends pr{constructor(){super(fA),this.blendFunction=yt.OVERLAY}};var rc=class extends pr{constructor(){super(mA)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var nc=class extends pr{constructor(e){super(uA,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var ic=class extends pr{constructor(){super(dA)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function gA(i,e){return e&&e.enabled&&i.push(e.effect),i}var dh=class extends jt{constructor(){super();this._scene=new on;this._camera=new Bn;this.effects=new Map;this.loadingManager=new Ro;this.renderPass=new Pv;this._renderToScreen=!0;this._hasSmaa=!1;this.clock=new Wf,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new Ql),this.effects.set("chromaticAberration",new Zl),this.effects.set("vignette",new rc),this.effects.set("noise",new tc),this.effects.set("colorAverage",new $l),this.effects.set("hueSaturation",new ec),this.effects.set("brightnessContrast",new Kl),this.effects.set("depthOfField",new nc),this.effects.set("pixelation",new ic)}get scene(){return this._scene}set scene(t){this._scene=t}get camera(){return this._camera}set camera(t){this._camera=t}_initSmaa(){if(!this.effectComposer)return;let t=this.effectComposer.passes.length,r=new pA({preset:Qo.ULTRA,edgeDetectionMode:Hp.COLOR}),n=()=>{r.removeEventListener("load",n),this.dispatchEvent({type:"smaaloaded"})};r.addEventListener("load",n),r.edgeDetectionMaterial.setPredicationMode(Cv.DEPTH),r.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),r.edgeDetectionMaterial.setPredicationThreshold(.002),r.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Wp(this.camera,r),t),this._hasSmaa=!0}_initPasses(){if(!this.effectComposer||!this.renderer)return;let t;if(this.effectComposer.removeAllPasses(),this._hasSmaa=!1,this.renderPass=new Pv(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let r=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(gA,[]),n=[this.effects.get("pixelation")].reduce(gA,[]);n.length>0&&this.effectComposer.addPass(new Wp(this.camera,...n)),this.effectComposer.addPass(new Wp(this.camera,...r))}else this.effectComposer.addPass(this.renderPass);if(t)return t}reinit(){if(!this.renderer)return Promise.all([]);this.effectComposer=new sA(this.renderer),this._initPasses()}init({renderer:t,camera:r,scene:n}){this.renderer=t,this.scene=n,this.camera=r,this._initCopyPass(),this.reinit()}_initCopyPass(){if(this._savePass)return;let t=new B;this.renderer.getDrawingBufferSize(t),this._rt=new mt(t.x,t.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:La,wrapT:La}),this._rt.samples=this.renderer.capabilities.isWebGL2?4:0,this._savePass=new Lv(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(t){var n,s;let r=this.effectComposer;!r||(t===!0?((n=this.renderer)!=null&&n.capabilities.isWebGL2&&(r.multisampling=0),r.removePass(this._savePass),r.passes[r.passes.length-1].renderToScreen=!0,r.autoRenderToScreen=!0):(((s=this.renderer)==null?void 0:s.capabilities.isWebGL2)&&!this._hasSmaa&&(r.multisampling=4),r.autoRenderToScreen=!1,r.passes[r.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,this.enabled||(this._savePass.needsDepthTexture=!0),r.addPass(this._savePass)),this._renderToScreen=t)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(t){t&&(Object.keys(t).forEach(r=>{let n=t[r],s=this.effects.get(r);Object.keys(n).forEach(o=>{s[o]=n[o]})}),this.enabled=t.enabled)}toJSON(){let t={};return this.effects.forEach((r,n)=>{t[n]=r.toJSON()},t),se({enabled:this.enabled},t)}render(){var t;(t=this.effectComposer)==null||t.render(this.clock.getDelta())}setScissor(t,r,n,s){if(!this.effectComposer||!this.renderer)return;t instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(t.x,t.y,t.z,t.w),this.effectComposer.outputBuffer.scissor.set(t.x,t.y,t.z,t.w)):(this.effectComposer.inputBuffer.scissor.set(t,r,n,s),this.effectComposer.outputBuffer.scissor.set(t,r,n,s));let o=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(o),this.effectComposer.outputBuffer.scissor.multiplyScalar(o),this.renderer.setScissor(t,r,n,s)}setScissorTest(t){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=t,this.effectComposer.outputBuffer.scissorTest=t,this.renderer.setScissorTest(t))}setViewport(t,r,n,s){!this.effectComposer||(t instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(t),this.effectComposer.outputBuffer.viewport.copy(t)):(this.effectComposer.inputBuffer.viewport.set(t,r,n,s),this.effectComposer.outputBuffer.viewport.set(t,r,n,s)))}resize(t,r){var n,s;if((n=this.effectComposer)==null||n.setSize(t,r),this._rt){let o=((s=this.renderer)==null?void 0:s.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(t*o,r*o)}}dispose(){var t;this._listeners=void 0,(t=this.effectComposer)==null||t.dispose()}};var jp=class extends hh{constructor(t,r){super(t,r);this.postprocessing=new dh;this.initPostprocessing(t.postprocessing)}resetAfterClear(t,r){super.resetAfterClear(t,r),this.initPostprocessing(t.postprocessing)}initPostprocessing(t){let s=t,{enabled:r}=s,n=dx(s,["enabled"]);for(let o of Object.entries(n)){let a=o[1],l=this.postprocessing.effects.get(o[0]);if(l){l.enabled=a.enabled;for(let[c,u]of Object.entries(a))l[c]=u}}this.postprocessing.enabled=r,this.postprocessing.reinit()}dispose(){super.dispose(),this.postprocessing.dispose()}switchActiveCamera(t){super.switchActiveCamera(t),this.postprocessing&&(this.postprocessing.camera=t)}};var Rv=new WeakMap,qp=class extends cn{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,n){let s=new is(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(n)},r,n)}decodeDracoFile(e,t,r,n){let s={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let r=JSON.stringify(t);if(Rv.has(e)){let l=Rv.get(e);if(l.key===r)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(n=l,new Promise((c,u)=>{n._callbacks[s]={resolve:c,reject:u},n.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{n&&s&&this._releaseTask(n,s)}),Rv.set(e,{key:r,promise:a}),a}_createGeometry(e){let t=new Ie;e.index&&t.setIndex(new Ue(e.index.array,1));for(let r=0;r<e.attributes.length;r++){let n=e.attributes[r],s=n.name,o=n.array,a=n.itemSize;t.setAttribute(s,new Ue(o,a))}return t}_loadLibrary(e,t){let r=new is(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((n,s)=>{r.load(e,n,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(r=>{let n=r[0];e||(this.decoderConfig.wasmBinary=r[1]);let s=IU.toString(),o=["/* draco decoder */",n,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
|
|
4229
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(s){let o=s.data;switch(o.type){case"decode":n._callbacks[o.id].resolve(o);break;case"error":n._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,s){return n._taskLoad>s._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}};function IU(){let i,e;onmessage=function(o){let a=o.data;switch(a.type){case"init":i=a.decoderConfig,e=new Promise(function(u){i.onModuleLoaded=function(h){u({draco:h})},DracoDecoderModule(i)});break;case"decode":let l=a.buffer,c=a.taskConfig;e.then(u=>{let h=u.draco,f=new h.Decoder,d=new h.DecoderBuffer;d.Init(new Int8Array(l),l.byteLength);try{let m=t(h,f,d,c),p=m.attributes.map(g=>g.array.buffer);m.index&&p.push(m.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:m},p)}catch(m){console.error(m),self.postMessage({type:"error",id:a.id,error:m.message})}finally{h.destroy(d),h.destroy(f)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,f,d,m=a.GetEncodedGeometryType(l);if(m===o.TRIANGULAR_MESH)f=new o.Mesh,d=a.DecodeBufferToMesh(l,f);else if(m===o.POINT_CLOUD)f=new o.PointCloud,d=a.DecodeBufferToPointCloud(l,f);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||f.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());let p={index:null,attributes:[]};for(let g in u){let y=self[h[g]],v,x;if(c.useUniqueIDs)x=u[g],v=a.GetAttributeByUniqueId(f,x);else{if(x=a.GetAttributeId(f,o[u[g]]),x===-1)continue;v=a.GetAttribute(f,x)}p.attributes.push(n(o,a,f,g,y,v))}return m===o.TRIANGULAR_MESH&&(p.index=r(o,a,f)),o.destroy(f),p}function r(o,a,l){let u=l.num_faces()*3,h=u*4,f=o._malloc(h);a.GetTrianglesUInt32Array(l,h,f);let d=new Uint32Array(o.HEAPF32.buffer,f,u).slice();return o._free(f),{array:d,itemSize:1}}function n(o,a,l,c,u,h){let f=h.num_components(),m=l.num_points()*f,p=m*u.BYTES_PER_ELEMENT,g=s(o,u),y=o._malloc(p);a.GetAttributeDataArrayForAllPoints(l,h,g,p,y);let v=new u(o.HEAPF32.buffer,y,m).slice();return o._free(y),{name:c,array:v,itemSize:f}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}var fo;function RU(){return fo||(fo=new qp,fo.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.5.2/").preload()),fo.decoderPending}async function BU(i){if(fo){let e={attributeIDs:fo.defaultAttributeIDs,attributeTypes:fo.defaultAttributeTypes,useUniqueIDs:!1},t;try{t=await fo.decodeGeometry(new Int8Array(i).buffer,e)}catch(r){console.error(r)}if(t)return{index:t.index?{array:t.index.array}:void 0,attributes:Object.entries(t.attributes).map(([r,n])=>({name:r,itemSize:n.itemSize,array:n.array}))}}return null}async function yA(i){let[e,t]=hy(Kd.deserialize(new Uint8Array(i))),r=[];e.scene.objects.traverse((n,s)=>{s.type==="Mesh"&&s.geometry.type==="NonParametricGeometry"&&s.geometry.data.draco!==void 0&&r.push(s)}),r.length&&await RU();for(let n of r){let s=await BU(dy(n.geometry.data.draco));if(s){s.index&&(n.geometry.data.index={array:s.index.array,itemSize:1,normalized:!1,type:"Uint32Array"});let o={};s.attributes.forEach(({name:a,array:l,itemSize:c})=>{o[a]={array:l,itemSize:c,type:"Float32Array",normalized:!1}}),n.geometry.data.attributes=o,n.geometry.data.draco=void 0}}return t.result().data}var MA={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Fv={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},NU=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Yp={CSS:{},springs:{}};function Hi(i,e,t){return Math.min(Math.max(i,e),t)}function ph(i,e){return i.indexOf(e)>-1}function Bv(i,e){return i.apply(null,e)}var Je={arr:function(i){return Array.isArray(i)},obj:function(i){return ph(Object.prototype.toString.call(i),"Object")},pth:function(i){return Je.obj(i)&&i.hasOwnProperty("totalLength")},svg:function(i){return i instanceof SVGElement},inp:function(i){return i instanceof HTMLInputElement},dom:function(i){return!("isNode"in i)&&(i.nodeType||Je.svg(i))},str:function(i){return typeof i=="string"},fnc:function(i){return typeof i=="function"},und:function(i){return typeof i>"u"},hex:function(i){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)},rgb:function(i){return/^rgb/.test(i)},hsl:function(i){return/^hsl/.test(i)},col:function(i){return Je.hex(i)||Je.rgb(i)||Je.hsl(i)},key:function(i){return!MA.hasOwnProperty(i)&&!Fv.hasOwnProperty(i)&&i!=="targets"&&i!=="keyframes"}};function AA(i){var e=/\(([^)]+)\)/.exec(i);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function TA(i,e){var t=AA(i),r=Hi(Je.und(t[0])?1:t[0],.1,100),n=Hi(Je.und(t[1])?100:t[1],.1,100),s=Hi(Je.und(t[2])?10:t[2],.1,100),o=Hi(Je.und(t[3])?0:t[3],.1,100),a=Math.sqrt(n/r),l=s/(2*Math.sqrt(n*r)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function f(m){var p=e?e*m/1e3:m;return l<1?p=Math.exp(-p*l*a)*(u*Math.cos(c*p)+h*Math.sin(c*p)):p=(u+h*p)*Math.exp(-p*a),m===0||m===1?m:1-p}function d(){var m=Yp.springs[i];if(m)return m;for(var p=1/6,g=0,y=0;;)if(g+=p,f(g)===1){if(y++,y>=16)break}else y=0;var v=g*p*1e3;return Yp.springs[i]=v,v}return e?f:d}function OU(i){return i===void 0&&(i=10),function(e){return Math.ceil(Hi(e,1e-6,1)*i)*(1/i)}}var FU=function(){var i=11,e=1/(i-1);function t(u,h){return 1-3*h+3*u}function r(u,h){return 3*h-6*u}function n(u){return 3*u}function s(u,h,f){return((t(h,f)*u+r(h,f))*u+n(h))*u}function o(u,h,f){return 3*t(h,f)*u*u+2*r(h,f)*u+n(h)}function a(u,h,f,d,m){var p,g,y=0;do g=h+(f-h)/2,p=s(g,d,m)-u,p>0?f=g:h=g;while(Math.abs(p)>1e-7&&++y<10);return g}function l(u,h,f,d){for(var m=0;m<4;++m){var p=o(h,f,d);if(p===0)return h;var g=s(h,f,d)-u;h-=g/p}return h}function c(u,h,f,d){if(!(0<=u&&u<=1&&0<=f&&f<=1))return;var m=new Float32Array(i);if(u!==h||f!==d)for(var p=0;p<i;++p)m[p]=s(p*e,u,f);function g(y){for(var v=0,x=1,w=i-1;x!==w&&m[x]<=y;++x)v+=e;--x;var b=(y-m[x])/(m[x+1]-m[x]),E=v+b*e,T=o(E,u,f);return T>=.001?l(y,E,u,f):T===0?E:a(y,v,v+e,u,f)}return function(y){return u===h&&f===d||y===0||y===1?y:s(g(y),h,d)}}return c}(),EA=function(){var i={linear:function(){return function(r){return r}}},e={Sine:function(){return function(r){return 1-Math.cos(r*Math.PI/2)}},Circ:function(){return function(r){return 1-Math.sqrt(1-r*r)}},Back:function(){return function(r){return r*r*(3*r-2)}},Bounce:function(){return function(r){for(var n,s=4;r<((n=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((n*3-2)/22-r,2)}},Elastic:function(r,n){r===void 0&&(r=1),n===void 0&&(n=.5);var s=Hi(r,1,10),o=Hi(n,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(r,n){e[r]=function(){return function(s){return Math.pow(s,n+2)}}}),Object.keys(e).forEach(function(r){var n=e[r];i["easeIn"+r]=n,i["easeOut"+r]=function(s,o){return function(a){return 1-n(s,o)(1-a)}},i["easeInOut"+r]=function(s,o){return function(a){return a<.5?n(s,o)(a*2)/2:1-n(s,o)(a*-2+2)/2}}}),i}();function Uv(i,e){if(Je.fnc(i))return i;var t=i.split("(")[0],r=EA[t],n=AA(i);switch(t){case"spring":return TA(i,e);case"cubicBezier":return Bv(FU,n);case"steps":return Bv(OU,n);default:return Bv(r,n)}}function _A(i){try{var e=document.querySelectorAll(i);return e}catch{return}}function Jp(i,e){for(var t=i.length,r=arguments.length>=2?arguments[1]:void 0,n=[],s=0;s<t;s++)if(s in i){var o=i[s];e.call(r,o,s,i)&&n.push(o)}return n}function Qp(i){return i.reduce(function(e,t){return e.concat(Je.arr(t)?Qp(t):t)},[])}function vA(i){return Je.arr(i)?i:(Je.str(i)&&(i=_A(i)||i),i instanceof NodeList||i instanceof HTMLCollection?[].slice.call(i):[i])}function zv(i,e){return i.some(function(t){return t===e})}function Gv(i){var e={};for(var t in i)e[t]=i[t];return e}function Nv(i,e){var t=Gv(i);for(var r in i)t[r]=e.hasOwnProperty(r)?e[r]:i[r];return t}function Kp(i,e){var t=Gv(i);for(var r in e)t[r]=Je.und(i[r])?e[r]:i[r];return t}function UU(i){var e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(i);return e?"rgba("+e[1]+",1)":i}function zU(i){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,t=i.replace(e,function(a,l,c,u){return l+l+c+c+u+u}),r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),n=parseInt(r[1],16),s=parseInt(r[2],16),o=parseInt(r[3],16);return"rgba("+n+","+s+","+o+",1)"}function GU(i){var e=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(i)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(i),t=parseInt(e[1],10)/360,r=parseInt(e[2],10)/100,n=parseInt(e[3],10)/100,s=e[4]||1;function o(f,d,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?f+(d-f)*6*m:m<1/2?d:m<2/3?f+(d-f)*(2/3-m)*6:f}var a,l,c;if(r==0)a=l=c=n;else{var u=n<.5?n*(1+r):n+r-n*r,h=2*n-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function kU(i){if(Je.rgb(i))return UU(i);if(Je.hex(i))return zU(i);if(Je.hsl(i))return GU(i)}function ds(i){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(i);if(e)return e[1]}function VU(i){if(ph(i,"translate")||i==="perspective")return"px";if(ph(i,"rotate")||ph(i,"skew"))return"deg"}function Ov(i,e){return Je.fnc(i)?i(e.target,e.id,e.total):i}function Wi(i,e){return i.getAttribute(e)}function kv(i,e,t){var r=ds(e);if(zv([t,"deg","rad","turn"],r))return e;var n=Yp.CSS[e+t];if(!Je.und(n))return n;var s=100,o=document.createElement(i.tagName),a=i.parentNode&&i.parentNode!==document?i.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Yp.CSS[e+t]=c,c}function CA(i,e,t){if(e in i.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n=i.style[e]||getComputedStyle(i).getPropertyValue(r)||"0";return t?kv(i,n,t):n}}function Vv(i,e){if(Je.dom(i)&&!Je.inp(i)&&(Wi(i,e)||Je.svg(i)&&i[e]))return"attribute";if(Je.dom(i)&&zv(NU,e))return"transform";if(Je.dom(i)&&e!=="transform"&&CA(i,e))return"css";if(i[e]!=null)return"object"}function LA(i){if(!!Je.dom(i)){for(var e=i.style.transform||"",t=/(\w+)\(([^)]*)\)/g,r=new Map,n;n=t.exec(e);)r.set(n[1],n[2]);return r}}function HU(i,e,t,r){var n=ph(e,"scale")?1:0+VU(e),s=LA(i).get(e)||n;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),r?kv(i,s,r):s}function Hv(i,e,t,r){switch(Vv(i,e)){case"transform":return HU(i,e,r,t);case"css":return CA(i,e,t);case"attribute":return Wi(i,e);default:return i[e]||0}}function Wv(i,e){var t=/^(\*=|\+=|-=)/.exec(i);if(!t)return i;var r=ds(i)||0,n=parseFloat(e),s=parseFloat(i.replace(t[0],""));switch(t[0][0]){case"+":return n+s+r;case"-":return n-s+r;case"*":return n*s+r}}function DA(i,e){if(Je.col(i))return kU(i);if(/\s/g.test(i))return i;var t=ds(i),r=t?i.substr(0,i.length-t.length):i;return e?r+e:r}function jv(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function WU(i){return Math.PI*2*Wi(i,"r")}function jU(i){return Wi(i,"width")*2+Wi(i,"height")*2}function qU(i){return jv({x:Wi(i,"x1"),y:Wi(i,"y1")},{x:Wi(i,"x2"),y:Wi(i,"y2")})}function PA(i){for(var e=i.points,t=0,r,n=0;n<e.numberOfItems;n++){var s=e.getItem(n);n>0&&(t+=jv(r,s)),r=s}return t}function XU(i){var e=i.points;return PA(i)+jv(e.getItem(e.numberOfItems-1),e.getItem(0))}function IA(i){if(i.getTotalLength)return i.getTotalLength();switch(i.tagName.toLowerCase()){case"circle":return WU(i);case"rect":return jU(i);case"line":return qU(i);case"polyline":return PA(i);case"polygon":return XU(i)}}function YU(i){var e=IA(i);return i.setAttribute("stroke-dasharray",e),e}function JU(i){for(var e=i.parentNode;Je.svg(e)&&Je.svg(e.parentNode);)e=e.parentNode;return e}function RA(i,e){var t=e||{},r=t.el||JU(i),n=r.getBoundingClientRect(),s=Wi(r,"viewBox"),o=n.width,a=n.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function QU(i,e){var t=Je.str(i)?_A(i)[0]:i,r=e||100;return function(n){return{property:n,el:t,svg:RA(t),totalLength:IA(t)*(r/100)}}}function KU(i,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return i.el.getPointAtLength(l)}var r=RA(i.el,i.svg),n=t(),s=t(-1),o=t(1);switch(i.property){case"x":return(n.x-r.x)*r.w;case"y":return(n.y-r.y)*r.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function xA(i,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=DA(Je.pth(i)?i.totalLength:i,e)+"";return{original:r,numbers:r.match(t)?r.match(t).map(Number):[0],strings:Je.str(i)||e?r.split(t):[]}}function BA(i){var e=i?Qp(Je.arr(i)?i.map(vA):vA(i)):[];return Jp(e,function(t,r,n){return n.indexOf(t)===r})}function NA(i){var e=BA(i);return e.map(function(t,r){return{target:t,id:r,total:e.length,transforms:{list:LA(t)}}})}function ZU(i,e){var t=Gv(e);if(/^spring/.test(t.easing)&&(t.duration=TA(t.easing)),Je.arr(i)){var r=i.length,n=r===2&&!Je.obj(i[0]);n?i={value:i}:Je.fnc(e.duration)||(t.duration=e.duration/r)}var s=Je.arr(i)?i:[i];return s.map(function(o,a){var l=Je.obj(o)&&!Je.pth(o)?o:{value:o};return Je.und(l.delay)&&(l.delay=a?0:e.delay),Je.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return Kp(o,t)})}function $U(i){for(var e=Jp(Qp(i.map(function(s){return Object.keys(s)})),function(s){return Je.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},r=function(s){var o=e[s];t[o]=i.map(function(a){var l={};for(var c in a)Je.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},n=0;n<e.length;n++)r(n);return t}function ez(i,e){var t=[],r=e.keyframes;r&&(e=Kp($U(r),e));for(var n in e)Je.key(n)&&t.push({name:n,tweens:ZU(e[n],i)});return t}function tz(i,e){var t={};for(var r in i){var n=Ov(i[r],e);Je.arr(n)&&(n=n.map(function(s){return Ov(s,e)}),n.length===1&&(n=n[0])),t[r]=n}return t.duration=parseFloat(t.duration),t.delay=parseFloat(t.delay),t}function rz(i,e){var t;return i.tweens.map(function(r){var n=tz(r,e),s=n.value,o=Je.arr(s)?s[1]:s,a=ds(o),l=Hv(e.target,i.name,a,e),c=t?t.to.original:l,u=Je.arr(s)?s[0]:c,h=ds(u)||ds(l),f=a||h;return Je.und(o)&&(o=c),n.from=xA(u,f),n.to=xA(Wv(o,u),f),n.start=t?t.end:0,n.end=n.start+n.delay+n.duration+n.endDelay,n.easing=Uv(n.easing,n.duration),n.isPath=Je.pth(s),n.isColor=Je.col(n.from.original),n.isColor&&(n.round=1),t=n,n})}var OA={css:function(i,e,t){return i.style[e]=t},attribute:function(i,e,t){return i.setAttribute(e,t)},object:function(i,e,t){return i[e]=t},transform:function(i,e,t,r,n){if(r.list.set(e,t),e===r.last||n){var s="";r.list.forEach(function(o,a){s+=a+"("+o+") "}),i.style.transform=s}}};function FA(i,e){var t=NA(i);t.forEach(function(r){for(var n in e){var s=Ov(e[n],r),o=r.target,a=ds(s),l=Hv(o,n,a,r),c=a||ds(l),u=Wv(DA(s,c),l),h=Vv(o,n);OA[h](o,n,u,r.transforms,!0)}})}function nz(i,e){var t=Vv(i.target,e.name);if(t){var r=rz(e,i),n=r[r.length-1];return{type:t,property:e.name,animatable:i,tweens:r,duration:n.end,delay:r[0].delay,endDelay:n.endDelay}}}function iz(i,e){return Jp(Qp(i.map(function(t){return e.map(function(r){return nz(t,r)})})),function(t){return!Je.und(t)})}function UA(i,e){var t=i.length,r=function(s){return s.timelineOffset?s.timelineOffset:0},n={};return n.duration=t?Math.max.apply(Math,i.map(function(s){return r(s)+s.duration})):e.duration,n.delay=t?Math.min.apply(Math,i.map(function(s){return r(s)+s.delay})):e.delay,n.endDelay=t?n.duration-Math.max.apply(Math,i.map(function(s){return r(s)+s.duration-s.endDelay})):e.endDelay,n}var bA=0;function sz(i){var e=Nv(MA,i),t=Nv(Fv,i),r=ez(t,i),n=NA(i.targets),s=iz(n,r),o=UA(s,t),a=bA;return bA++,Kp(e,{id:a,children:[],animatables:n,animations:s,duration:o.duration,delay:o.delay,endDelay:o.endDelay})}var Mn=[],wA=[],Xp,oz=function(){function i(){Xp=requestAnimationFrame(e)}function e(t){var r=Mn.length;if(r){for(var n=0;n<r;){var s=Mn[n];if(!s.paused)s.tick(t);else{var o=Mn.indexOf(s);o>-1&&(Mn.splice(o,1),r=Mn.length)}n++}i()}else Xp=cancelAnimationFrame(Xp)}return i}();function az(){document.hidden?(Mn.forEach(function(i){return i.pause()}),wA=Mn.slice(0),br.running=Mn=[]):wA.forEach(function(i){return i.play()})}typeof document<"u"&&document.addEventListener("visibilitychange",az);function br(i){i===void 0&&(i={});var e=0,t=0,r=0,n,s=0,o=null;function a(x){var w=window.Promise&&new Promise(function(b){return o=b});return x.finished=w,w}var l=sz(i),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,n.forEach(function(w){return w.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function f(){e=0,t=h(l.currentTime)*(1/br.speed)}function d(x,w){w&&w.seek(x-w.timelineOffset)}function m(x){if(l.reversePlayback)for(var b=s;b--;)d(x,n[b]);else for(var w=0;w<s;w++)d(x,n[w])}function p(x){var w=0,b=l.animations,E=b.length;for(l.reversePlayback===!0&&l.rewind===!1&&(x=l.duration-x);w<E;){var T=b[w],S=T.animatable,I=T.tweens,C=I.length-1,M=I[C];C&&(M=Jp(I,function(ae){return x<ae.end})[0]||M);for(var _=Hi(x-M.start-M.delay,0,M.duration)/M.duration,R=isNaN(_)?1:M.easing(_),N=M.to.strings,O=M.round,z=[],q=M.to.numbers.length,F=void 0,ee=0;ee<q;ee++){var k=void 0;if(l.reversePlayback===!0&&l.rewind===!1)var V=M.to.numbers[ee],U=M.from.numbers[ee]||0;else var U=M.to.numbers[ee],V=M.from.numbers[ee]||0;M.isPath?k=KU(M.value,R*U):k=V+R*(U-V),O&&(M.isColor&&ee>2||(k=Math.round(k*O)/O)),z.push(k)}var J=N.length;if(!J)F=z[0];else{F=N[0];for(var K=0;K<J;K++){var $=N[K],j=N[K+1],ge=z[K];isNaN(ge)||(j?F+=ge+j:F+=ge+" ")}}OA[T.type](S.target,T.property,F,S.transforms),T.currentValue=F,w++}}function g(x){l[x]&&!l.passThrough&&l[x](l)}function y(){l.remaining&&l.remaining!==!0&&l.remaining--}function v(x){var w=l.duration,b=l.delay,E=w-l.endDelay,T=h(x);l.progress=Hi(T/w*100,0,100),l.reversePlayback=T<l.currentTime,n&&m(T),!l.began&&l.currentTime>=0&&(l.began=!0,g("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,g("loopBegin")),T<=b&&l.currentTime!==0&&p(0),(T>=E&&l.currentTime!==w||!w)&&p(w),T>b&&T<E?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,g("changeBegin")),g("change"),p(T)):l.changeBegan?(l.changeCompleted=!0,l.changeBegan=!1,g("change"),g("changeComplete")):l.began&&T>E&&(g("change"),g("changeComplete")),l.currentTime=Hi(T,0,w),l.began&&g("update"),x>=w&&(t=0,y(),l.remaining?(e=r,g("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,g("loopComplete"),g("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,n=l.children,s=n.length;for(var w=s;w--;)l.children[w].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,p(l.reversed?l.duration:0)},l.set=function(x,w){return FA(x,w),l},l.tick=function(x){r=x,e||(e=r),v((r+(t-e))*br.speed)},l.seek=function(x){v(h(x))},l.pause=function(){l.paused=!0,f()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,Mn.push(l),f(),Xp||oz())},l.reverse=function(){u(),l.completed=!l.reversed,f()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function SA(i,e){for(var t=e.length;t--;)zv(i,e[t].animatable.target)&&e.splice(t,1)}function lz(i){for(var e=BA(i),t=Mn.length;t--;){var r=Mn[t],n=r.animations,s=r.children;SA(e,n);for(var o=s.length;o--;){var a=s[o],l=a.animations;SA(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!n.length&&!s.length&&r.pause()}}function cz(i,e){e===void 0&&(e={});var t=e.direction||"normal",r=e.easing?Uv(e.easing):null,n=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=Je.arr(i),h=parseFloat(u?i[0]:i),f=u?parseFloat(i[1]):0,d=ds(u?i[1]:i)||0,m=e.start||0+(u?h:0),p=[],g=0;return function(y,v,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!p.length){for(var w=0;w<x;w++){if(!n)p.push(Math.abs(o-w));else{var b=l?(n[0]-1)/2:o%n[0],E=l?(n[1]-1)/2:Math.floor(o/n[0]),T=w%n[0],S=Math.floor(w/n[0]),I=b-T,C=E-S,M=Math.sqrt(I*I+C*C);s==="x"&&(M=-I),s==="y"&&(M=-C),p.push(M)}g=Math.max.apply(Math,p)}r&&(p=p.map(function(R){return r(R/g)*g})),t==="reverse"&&(p=p.map(function(R){return s?R<0?R*-1:-R:Math.abs(g-R)}))}var _=u?(f-h)/g:h;return m+_*(Math.round(p[v]*100)/100)+d}}function uz(i){i===void 0&&(i={});var e=br(i);return e.duration=0,e.add=function(t,r){var n=Mn.indexOf(e),s=e.children;n>-1&&Mn.splice(n,1);function o(f){f.passThrough=!0}for(var a=0;a<s.length;a++)o(s[a]);var l=Kp(t,Nv(Fv,i));l.targets=l.targets||i.targets;var c=e.duration;l.autoplay=!1,l.direction=e.direction,l.timelineOffset=Je.und(r)?c:Wv(r,c),o(e),l.rewind=e.rewind,e.seek(l.timelineOffset);var u=br(l);o(u),s.push(u);var h=UA(s,i);return e.delay=h.delay,e.endDelay=h.endDelay,e.duration=h.duration,e.seek(0),e.reset(),e.autoplay&&e.play(),e},e}br.version="3.2.0";br.speed=1;br.running=Mn;br.remove=lz;br.get=Hv;br.set=FA;br.convertPx=kv;br.path=QU;br.setDashoffset=YU;br.stagger=cz;br.timeline=uz;br.easing=Uv;br.penner=EA;br.random=function(i,e){return Math.floor(Math.random()*(e-i+1))+i};var mh=br;function gh(i,e,t){switch(i){case 0:return"cubicBezier( 0, 0, 1, 1 )";case 1:return"cubicBezier( .25, .1, .25, 1 )";case 2:return"cubicBezier( .42, 0, 1, 1 )";case 3:return"cubicBezier( 0, 0, .58, 1 )";case 4:return"cubicBezier( .42, 0, .58, 1 )";case 5:let{control1:r,control2:n}=e;return`cubicBezier( ${r[0]}, ${r[1]}, ${n[0]}, ${n[1]} )`;case 6:let{mass:s,stiffness:o,damping:a,velocity:l}=t;return`spring( ${s}, ${o}, ${a}, ${l} )`}}function zA(i,e,t){var n,s;let r=i.cameraType==="OrthographicCamera"?(n=e.orthographic)==null?void 0:n.zoom:(s=e.perspective)==null?void 0:s.zoom;if(r!==void 0){let o=i.zoom;o!==r&&t.push({change:a=>{i.zoom=et.lerp(o,r,a),i.updateProjectionMatrix()}})}if(e.targetOffset!==void 0){let o=i.targetOffset,a=e.targetOffset;o!==a&&t.push({change:l=>{i.targetOffset=et.lerp(o,a,l)}})}}function GA(i,e,t){if(e.width!==void 0&&e.height!==void 0&&e.depth!==void 0){let{width:r,height:n,depth:s}=i.geometry.userData.parameters,o=[r,n,s],a=[e.width,e.height,e.depth];vr.isEqual(o,a)||t.push({change:l=>{let[c,u,h]=vr.lerp(o,a,l);i.updateGeometry({parameters:{width:c,height:u,depth:h}})}})}}function kA(i,e,t,r){if(e.intensity!==void 0){let n=i.intensity,s=e.intensity;n!==s&&t.push({change:o=>{i.intensity=et.lerp(n,s,o)}})}if(e.color!==void 0){let n=i.color.clone(),s=typeof e.color=="string"?r.getColor(e.color):e.color;if(!Sr.equals(n,s)){let o=n.clone();i.color=o,t.push({change:a=>{let{r:l,g:c,b:u}=Sr.lerp(n,s,a);o.setRGB(l,c,u)}})}}}function VA(i,e,t,r){var s,o;let n=i.layersList.head;for(;n;){let a=e.layers.data(n.uuid);if(a&&((s=n.visible)!=null?s:!0)&&((o=a.visible)!=null?o:!0)){let l=n.getNames().filter(c=>!uM.some(u=>c.includes(u)));for(let c of l)try{let u=n.getValue(c);if(c==="steps")gz(n,a,c,t);else if(c==="colors")yz(n,a,c,t);else if(typeof u=="number")hz(n,a,c,t);else{if(typeof u=="boolean")continue;"isVector2"in u?fz(n,a,c,t):"isVector3"in u?dz(n,a,c,t):"isColorA"in u?mz(n,a,c,t,r):"isColor"in u?pz(n,a,c,t,r):"isTexture"in u&&vz(n,a,c,t)}}catch(u){console.error(`animateMaterial: unexpected material layer for ${c}`,u)}}n=n.next}}function hz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=e[t];n!==s&&r.push({change:o=>{i.setValue(t,et.lerp(n,s,o))}})}function fz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=n.toArray(),o=e[t];ls.isEqual(s,o)||r.push({change:a=>{n.fromArray(ls.lerp(s,o,a))}})}function dz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=n.toArray(),o=e[t];vr.isEqual(s,o)||r.push({change:a=>{n.fromArray(vr.lerp(s,o,a))}})}function pz(i,e,t,r,n){if(!i.hasValue(t)||!(t in e))return;let s=i.getValue(t).clone(),o=e[t],a=typeof o=="string"?n.getColor(o):o;if(Sr.equals(s,a))return;let l=s.clone();i.setValue(t,l),r.push({change:c=>{let{r:u,g:h,b:f}=Sr.lerp(s,a,c);l.setRGB(u,h,f)}})}function mz(i,e,t,r,n){if(!i.hasValue(t)||!(t in e))return;let s=i.getValue(t).clone(),o=e[t],a=typeof o=="string"?n.getColor(o):o;if(Ln.equals(s,a))return;let l=s.clone();i.setValue(t,l),r.push({change:c=>{let{r:u,g:h,b:f,a:d}=Ln.lerp(s,a,c);l.setRGBA(u,h,f,d)}})}function gz(i,e,t="steps",r){if(!i.hasValue(t)||!(t in e))return;let n=[...i.getValue(t)],s=e[t];for(let o=0;o<n.length;++o){let a=n[o],l=s[o];a!==l&&r.push({change:c=>{n[o]=et.lerp(a,l,c),i.setValue("steps",n)}})}}function yz(i,e,t="colors",r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=e[t];for(let o=0;o<n.length;++o){let a=n[o].toArray(),l=s[o];Mu.isEqual(a,l)||r.push({change:c=>{n[o].fromArray(Mu.lerp(a,l,c))}})}}function vz(i,e,t="texture",r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue("texture"),s=e[t],o=n.repeat.toArray(),a=n.offset.toArray(),l=s.repeat,c=s.offset;(!ls.isEqual(o,l)||!ls.isEqual(a,c))&&r.push({change:u=>{n.repeat.fromArray(ls.lerp(o,l,u)),n.offset.fromArray(ls.lerp(a,c,u)),n.updateMatrix(),n.needsUpdate=!0}})}function HA(i,e,t,r){if(r===0)return t.copy(i);if(r===1)return t.copy(e);let n=i.w*e.w+i.x*e.x+i.y*e.y+i.z*e.z;if(n>=1)return t.copy(i);let s=1-n*n;if(s<=Number.EPSILON){let u=1-r;return t.w=u*i.w+r*e.w,t.x=u*i.x+r*e.x,t.y=u*i.y+r*e.y,t.z=u*i.z+r*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,n),l=Math.sin((1-r)*a)/o,c=Math.sin(r*a)/o;return t.w=i.w*l+e.w*c,t.x=i.x*l+e.x*c,t.y=i.y*l+e.y*c,t.z=i.z*l+e.z*c,t}function WA(i,e,t=0){let r=Array.isArray(i.material)?i.material[t]:i.material,n;return"materials"in e?n=e.materials[t]:"material"in e&&(n=e.material),[r,n]}var qv=new A,Xv=new A,jA=new Ut,xz=new pn,bz=new Ee;function qA(i,e,t,r){if(t.position!==void 0){let n=i.position.toArray(),s=t.position;vr.isEqual(n,s)||r.push({change:o=>{i.position.fromArray(vr.lerp(n,s,o)),i.updateMatrix()}})}if(t.scale!==void 0){let n=i.scale.toArray(),s=t.scale;vr.isEqual(n,s)||r.push({change:o=>{i.scale.fromArray(vr.lerp(n,s,o)),i.updateMatrix()}})}wz(i,e,t,r),Sz(i,t,r)}function wz(i,e,t,r){if(t.rotation===void 0)return;let n=qv.setFromEuler(i.rotation).toArray(),s=t.rotation;if(vr.isEqual(n,s))return;if(vr.sub(t.rotation,e?e.rotation:i.rotation).every(a=>Math.abs(a)<2*Math.PI)){let a=i.quaternion.clone(),l=new Ut().setFromEuler(xz.set(t.rotation[0],t.rotation[1],t.rotation[2]));r.push({change:c=>{HA(a,l,i.quaternion,c),i.updateMatrix()}})}else r.push({change:a=>{i.rotation.setFromVector3(Xv.fromArray(vr.lerp(n,s,a))),i.updateMatrix()}})}function Sz(i,e,t){if(e.hiddenMatrix!==void 0&&!_i.isEqual(i.hiddenMatrix.toArray(),e.hiddenMatrix)){let r=new A,n=new Ut,s=new A;i.hiddenMatrix.decompose(r,n,s);let o=new A,a=new Ut,l=new A;bz.fromArray(e.hiddenMatrix).decompose(o,a,l),t.push({change:c=>{jA.slerpQuaternions(n,a,c),qv.lerpVectors(r,o,c),Xv.lerpVectors(s,l,c),i.hiddenMatrix.compose(qv,jA,Xv)}})}}function XA(i,e,t,r){let n=[];if(qA(i,e==null?void 0:e.objectState,t.objectState,n),El(i)){if("geometry"in t.objectState&&GA(i,t.objectState.geometry,n),"material"in t.objectState||"materials"in t.objectState){let[s,o]=WA(i,t.objectState,i.selectedMaterial);s&&o&&typeof o!="string"&&VA(s,o,n,r)}}else m1(i)?kA(i,t.objectState,n,r):p1(i)&&zA(i,t.objectState,n);return{change:s=>{n.forEach(o=>{o.change&&o.change(s)})}}}var Zp=class{constructor(e,t){this.object=e;this.sharedAssets=t;this.uuid=et.generateUUID();this.states=[];this.events={};this._scrollCounter=null}get animation(){return this._animation}start(){this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._scrollCounter=null),this.states.length>1&&(this.states[0].execute(this.object,this.sharedAssets),this._currentState=this.states[0],this._prevState=void 0)}end(){this._animation!==void 0&&(this._animation.pause(),this._animation=void 0),this.states.length>1&&this.states[0].execute(this.object,this.sharedAssets),this._currentState=void 0,this._prevState=void 0}play(e,t){this.object.visible&&e.state!==void 0&&this.animate(e.state,e,!0,t)}reverse(e,t){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e,!0,t)}seek(e,t,r,n){var s;this._scrollCounter===null&&(this.object.visible&&e.state!==void 0&&this.animate(e.state,e,!1,n),this._scrollCounter=0),this._scrollCounter+=t,this._scrollCounter=Math.min(Math.max(this._scrollCounter,0),r),(s=this._animation)==null||s.seek(this._scrollCounter/r*e.duration)}animate(e,t,r=!0,n){var s,o,a,l,c,u;if(this._currentState===e){if((s=this._animation)!=null&&s.reversed){let h=(a=(o=this._animation)==null?void 0:o.currentTime)!=null?a:0;(l=this._animation)==null||l.reset(),(c=this._animation)==null||c.seek(h),(u=this._animation)==null||u.play()}}else{this._prevState=this._currentState,this._currentState=e,this._animation!==void 0&&this._animation.pause(),t.cycle===!0&&t.repeat===!0?this._animation=mh.timeline({duration:t.duration,delay:t.delay/2,endDelay:t.delay/2,direction:"alternate",loop:!0,rewind:t.rewind,easing:gh(t.easing,t.cubicControls,t.springParameters),autoplay:r}):t.cycle===!0&&t.repeat===!1?this._animation=mh.timeline({duration:t.duration,delay:t.delay,endDelay:t.delay/2,direction:"alternate",rewind:t.rewind,easing:gh(t.easing,t.cubicControls,t.springParameters),autoplay:r}):t.cycle===!1&&t.repeat===!0?this._animation=mh.timeline({duration:t.duration,delay:t.delay,direction:"normal",loop:!0,easing:gh(t.easing,t.cubicControls,t.springParameters),autoplay:r}):this._animation=mh.timeline({duration:t.duration,delay:t.delay,direction:"normal",easing:gh(t.easing,t.cubicControls,t.springParameters),autoplay:r}),r&&this._animation.finished.then(()=>{this._animation=void 0});let h=XA(this.object,this._prevState,this._currentState,this.sharedAssets),f={t:0};this._animation.add({targets:f,t:1,change:()=>{var d;h.change&&(h.change(f.t),(d=n==null?void 0:n.change)==null||d.call(this,f.t))}},0)}}emitEvent(e){if(e==="keyDown"||e==="keyUp"||e==="mouseDown"||e==="mouseUp"||e==="mouseHover"||e==="scroll"||e==="start"){let t=this.events[e];if(t)for(let r of t)r.targets.forEach(n=>this.play(n))}}emitEventReverse(e){if(e==="keyDown"||e==="keyUp"||e==="mouseDown"||e==="mouseUp"||e==="mouseHover"||e==="scroll"||e==="start"){let t=this.events[e];if(t)for(let r of t)r.targets.forEach(n=>this.reverse(n))}}};var sc=class{constructor(e){this.targetState=e}static create(e,t){var n;let r=new sc(e);if(e.object){let s=t.find(e.object);if(r.object=s,s!=null&&s.interaction){let o=s.interaction.states;r.state=e.state&&(n=o.find(a=>a.uuid===e.state))!=null?n:o[0]}}return r}get cubicControls(){let e=this.targetState;return e.easing===5?{control1:e.control1,control2:e.control2}:se({},Rd.defaultData)}get springParameters(){let e=this.targetState;return e.easing===6?e:se({},Id.defaultData)}get easing(){return this.targetState.easing}get duration(){return this.targetState.duration}get delay(){return this.targetState.delay}get repeat(){return this.targetState.repeat}get cycle(){return this.targetState.cycle}get rewind(){return this.targetState.rewind}};var YA=new qr,Ko=class extends Vr{},$p=class{constructor(e){this.materials={};this.images={};this.colors={};this.transmissionRenderTarget=new mt(2048,2048,{generateMipmaps:!0,minFilter:Gs,magFilter:ct,wrapS:_r,wrapT:_r}),this.transmissionRenderTarget.depthTexture=new si(2048,2048),this.reset(e)}reset(e){for(let[t,r]of Object.entries(e.images))this.addImage(t,r.data);for(let[t,r]of Object.entries(e.colors))this.addColor(t,r);for(let[t,r]of Object.entries(e.materials))this.addMaterial(t,mv(r,this))}get transmissionSamplerMap(){return this.transmissionRenderTarget.texture}get transmissionDepthMap(){return this.transmissionRenderTarget.depthTexture}addMaterial(e,t){t.uuid=e,this.materials[e]=t}deleteMaterial(e){this.materials[e]&&(this.materials[e].dispose(),delete this.materials[e])}isSharedMaterial(e){return e.uuid in this.materials||e===YA}getMaterial(e){let t=this.materials[e];return t}getMaterialOrDeletedPlaceholder(e){var t;return(t=this.materials[e])!=null?t:YA}getMaterials(){return this.materials}addImage(e,t){if(this.images[e])return this.images[e].onload=()=>{this.onImageLoad&&this.onImageLoad(e)},this.images[e].src=t,!0;{let r=new Image;return r.src=t,r.onload=()=>{this.onImageLoad&&this.onImageLoad(e)},this.images[e]=r,!1}}deleteImage(e){this.images[e]&&delete this.images[e]}getDefaultImage(){return this.images.image_0}getImage(e){return this.images[e]}getImages(){return this.images}addColor(e,t){return this.colors[e]?("a"in t?this.colors[e].setRGBA(t.r,t.g,t.b,t.a):this.colors[e].setRGBA(t.r,t.g,t.b,1),!0):("a"in t?this.colors[e]=new Ko(t.r,t.g,t.b,t.a):this.colors[e]=new Ko(t.r,t.g,t.b,1),!1)}updateColor(e,t){var r,n,s,o;if(this.colors[e]){let a=this.colors[e];return this.colors[e].r=(r=t.r)!=null?r:a.r,this.colors[e].g=(n=t.g)!=null?n:a.g,this.colors[e].b=(s=t.b)!=null?s:a.b,this.colors[e].a=(o=t.a)!=null?o:a.a,!0}return!1}deleteColor(e){this.colors[e]&&delete this.colors[e]}getColor(e){return this.colors[e]}dispose(){Object.keys(this.materials).forEach(t=>this.deleteMaterial(t)),this.transmissionRenderTarget.depthTexture.dispose(),this.transmissionRenderTarget.dispose(),this.onImageLoad=void 0}};function Mz(i,e){switch(i.type){case"noise":return e==="noiseType";case"texture":return e==="projection"||e==="axis";case"displace":return e==="noiseType";case"depth":return e==="num"||e==="smooth"||e==="isWorldSpace"||e==="gradientType";default:return!1}}function Yv(i,e,t,r,n){var o;let s=!1;for(let[a,l]of Object.entries(i)){if(!a||l===void 0||Bp(a,t,n))continue;t.visible=n.visible;let c=t.uniforms[`f${t.id}_${a}`];if(!!c)switch(c.constructor){case Rt:if(typeof l=="string"){let u=e.getColor(l);u&&(c.value=u);break}else{let u=l;c.value instanceof Ko?c.value=new Vr(u.r,u.g,u.b,u.a):c.setRGBA(u);break}case ci:if(typeof l=="string"){let u=e.getColor(l);u&&(c.value=u);break}else{let u=l;c.value instanceof Ko?c.value=new Vr(u.r,u.g,u.b,u.a):c.value.setRGBA(u.r,u.g,u.b,u.a);break}case Pr:{let u=l;c.value.setX(u[0]),c.value.setY(u[1]);break}case Ir:{let u=l;c.value.setX(u[0]),c.value.setY(u[1]),c.value.setZ(u[2]);break}case Wr:{let u=l;"image"in u&&(c.value.image=e.getImage(u.image)),"wrapping"in u&&(c.value.wrapS=c.value.wrapT=u.wrapping),"repeat"in u&&c.value.repeat.fromArray(u.repeat),"offset"in u&&c.value.offset.fromArray(u.offset),c.value.needsUpdate=!0;break}case hs:{l.forEach((u,h)=>{c.value[h].setX(u[0]),c.value[h].setY(u[1]),c.value[h].setZ(u[2]),c.value[h].setW(u[3])});break}default:{s=s||Mz(t,a),c.value=l;break}}}if(s&&n){let a=Rp({id:"0",fi:0,data:n},e);(o=r.userData.layers)==null||o.changeLayer(t.id,se({},a)),r.dispose(),r.needsUpdate=!0}}var Jv=new A,JA=new Fr,QA=new Ee,ac={type:"follow",normal:new A,raycaster:new $s},oc;(t=>{function i(r){if(r.type===10)return{type:"follow"}}t.create=i;function e({target:r,normal:n,raycaster:s,begin:o,change:a}){!r||!r.interaction||!n||!s||(o&&o("follow",r.uuid),JA.setFromNormalAndCoplanarPoint(n,r.getWorldPosition(Jv)),s.ray.intersectPlane(JA,Jv),r.position.copy(Jv),r.parent!==null&&r.position.applyMatrix4(QA.copy(r.parent.matrixWorld).invert()),r.position.applyMatrix4(QA.copy(r.hiddenMatrix).invert()),r.updateMatrix(),a&&a())}t.listener=e})(oc||(oc={}));var em={type:"keyDown"},tm={type:"keyUp"},lc;(t=>{function i(r){if(r.type===5&&r.key)return{type:"keyDown",targets:[],key:r.key}}t.create=i;function e({target:r,begin:n,change:s,domEvent:o}){if(!r||!r.interaction||!o)return;let a=r.interaction.events.keyDown;if(!(a!=null&&a.length))return;let l=!1;for(let c of a)c.key===o.key&&(c.targets.forEach(u=>{var h,f;return(f=(h=u.object)==null?void 0:h.interaction)==null?void 0:f.play(u,{change:s})}),l=!0);l&&n&&n("keyDown",r.uuid)}t.listener=e})(lc||(lc={}));var cc;(t=>{function i(r){if(!(r.type!==6||!r.key))return{type:"keyUp",targets:[],key:r.key}}t.create=i;function e({target:r,begin:n,change:s,domEvent:o}){if(!r||!r.interaction||!o)return;let a=r.interaction.events.keyUp;if(!(a!=null&&a.length))return;let l=!1;for(let c of a)c.key===o.key&&(c.targets.forEach(u=>{var h,f;return(f=(h=u.object)==null?void 0:h.interaction)==null?void 0:f.play(u,{change:s})}),l=!0);l&&n&&n("keyUp",r.uuid)}t.listener=e})(cc||(cc={}));var Qv=new A,KA=new Fr,hc={type:"lookAt",normal:new A,raycaster:new $s},uc;(t=>{function i(r){if(r.type===9&&r.distance)return{type:"lookAt",distance:r.distance}}t.create=i;function e({target:r,normal:n,raycaster:s,begin:o,change:a}){var u;if(!r||!r.interaction||!n||!s)return;let l=r.interaction.events.lookAt;if(!(l!=null&&l.length))return;o&&o("lookAt",r.uuid);let c=l[0].distance;KA.set(n,-c),s.ray.intersectPlane(KA,Qv),r.lookAt(Qv),r.updateMatrix(),(u=r.interaction.animation)==null||u.finished.then(()=>{r.lookAt(Qv),r.updateMatrix()}),a&&a()}t.listener=e})(uc||(uc={}));var rm={type:"mouseDown"},nm={type:"mouseUp"},fc;(t=>{function i(r){if(r.type===0)return{type:"mouseDown",targets:[]}}t.create=i;function e({target:r,begin:n,change:s}){if(!r||!r.interaction)return;let o=r.interaction.events.mouseDown;!(o!=null&&o.length)||(n&&n("mouseDown",r.uuid),o.forEach(a=>{a.targets.forEach(l=>{var c,u;return(u=(c=l.object)==null?void 0:c.interaction)==null?void 0:u.play(l,{change:s})})}))}t.listener=e})(fc||(fc={}));var dc;(t=>{function i(r){if(r.type===1)return{type:"mouseUp",targets:[]}}t.create=i;function e({target:r,begin:n,change:s}){if(!r||!r.interaction)return;let o=r.interaction.events.mouseUp;!(o!=null&&o.length)||(n&&n("mouseUp",r.uuid),o.forEach(a=>{a.targets.forEach(l=>{var c,u;return(u=(c=l.object)==null?void 0:c.interaction)==null?void 0:u.play(l,{change:s})})}))}t.listener=e})(dc||(dc={}));var Kv={type:"start"},pc;(t=>{function i(r){if(r.type===7)return{type:"start",targets:[]}}t.create=i;function e({target:r,begin:n,change:s}){if(!r||!r.interaction)return;let o=r.interaction.events.start;!(o!=null&&o.length)||(n&&n("start",r.uuid),o.forEach(a=>{a.targets.forEach(l=>{var c,u;return(u=(c=l.object)==null?void 0:c.interaction)==null?void 0:u.play(l,{change:s})})}))}t.listener=e})(pc||(pc={}));function ZA(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var An={type:"link"},mc;(t=>{function i(r){let n;if(r.type===0)n={type:"mousedown"};else if(r.type===1)n={type:"mouseup"};else if(r.type===5){if(!r.key)return;n={type:"keydown",key:r.key}}else if(r.type===6){if(!r.key)return;n={type:"keyup",key:r.key}}else return;if(r.url)return{type:"link",subEvent:n,url:r.url}}t.create=i;function e({target:r,begin:n,domEvent:s,subType:o}){var c;if(!r||!r.interaction||!o||!s)return;let a=r.interaction.events.link;if(!a)return;let l;if(o==="keydown"||o==="keyup"){let u=s.key;l=(c=a[o])==null?void 0:c.filter(h=>h.subEvent.type===o&&h.subEvent.key===u)}else l=a[o];if(!!(l!=null&&l.length)){n&&n("link",r.uuid);for(let u of l)ZA()?window.location.assign(u.url):window.open(u.url,"_blank")}}t.listener=e})(mc||(mc={}));var im={type:"scroll"},gc;(t=>{function i(r){if(!(r.type!==11||r.steps===void 0))return{type:"scroll",targets:[],steps:r.steps}}t.create=i;function e({target:r,begin:n,change:s,domEvent:o}){if(!r||!r.interaction||!o)return;let a=r.interaction.events.scroll;if(!(a!=null&&a.length))return;n&&n("scroll",r.uuid);let l=o.deltaY>0?1:-1;a.forEach(c=>{c.targets.forEach(u=>{var h,f;return(f=(h=u.object)==null?void 0:h.interaction)==null?void 0:f.seek(u,l,c.steps,{change:s})})})}t.listener=e})(gc||(gc={}));var po={type:"mouseHover"},yc;(t=>{function i(r){if(r.type===2)return{type:"mouseHover",targets:[]}}t.create=i;function e({target:r,begin:n,change:s,enter:o}){if(!r||!r.interaction||o===void 0)return;let a=r.interaction.events.mouseHover;!(a!=null&&a.length)||(n&&n("mouseHover",r.uuid),o?a.forEach(l=>{l.targets.forEach(c=>{var u,h;return(h=(u=c.object)==null?void 0:u.interaction)==null?void 0:h.play(c,{change:s})})}):a.forEach(l=>{l.targets.forEach(c=>{var u,h;return(h=(u=c.object)==null?void 0:u.interaction)==null?void 0:h.reverse(c,{change:s})})}))}t.listener=e})(yc||(yc={}));function Az(i){let e,{type:t}=i;return t===10?e=oc.create(i):t===5?e=lc.create(i):t===6?e=cc.create(i):t===9?e=uc.create(i):t===0?e=fc.create(i):t===1?e=dc.create(i):t===2?e=yc.create(i):t===11?e=gc.create(i):t===7&&(e=pc.create(i)),e}function $A(i,e,t){let r=[];i.objects.traverse((n,s)=>{var u;if(s.states===void 0)return;let o=e.find(n),a=new Zp(o,t),l=a.states;l.push(Zo.create(n,s));for(let h of s.states){let f=Du.patch(s,h.data);l.push(Zo.create(h.id,f))}let c=a.events;if(s.events)for(let{data:h}of s.events){let f=Az(h);if(!f)continue;let d=f.type;c[d]?(u=c[d])==null||u.push(f):c[d]=[f],"targets"in h&&r.push([h,f]);let m=mc.create(h);if(m){c.link||(c.link={});let p=m.subEvent.type;c.link[p]?c.link[p].push(m):c.link[p]=[m]}}l.length>0||Object.keys(c).length>0?(o.interaction=a,Zv(o,s,null,t)):delete o.interaction});for(let[n,s]of r)if("targets"in n&&"targets"in s)for(let{data:o}of n.targets){let a=sc.create(o,e);s.targets.push(a)}}function Zv(i,e,t,r,n=!1){if(!n&&e.states.length===0)return;let s=t===null?e:Du.patch(e,e.states.data(t));if(nv(i,s),i instanceof Xt&&s.type==="Mesh"){if(i instanceof lo?i.buildFromStore(s.geometry):i.updateGeometry({parameters:s.geometry}),"material"in s){if(i.material instanceof Array)return;if(typeof s.material!="string"){let a=s.material.layers;for(let l of a){let c=i.material.userData.layers.getLayerByUuid(l.id);Yv(l.data,r,c,i.material,l.data)}}}else if("materials"in s){if(!(i.material instanceof Array))return;var o=0;for(let a of s.materials){if(typeof a!="string"){let l=a.layers;for(let c of l){let u=i.material[o].userData.layers.getLayerByUuid(c.id);Yv(c.data,r,u,i.material[o],c.data)}}o++}}}else if(s.type==="DirectionalLight")i.fromDirectionalLightState(s,r);else if(s.type==="PointLight")i.fromPointLightState(s,r);else if(s.type==="SpotLight")i.fromSpotLightState(s,r);else if(i instanceof Bn&&Ys.is(s.type)){let a=s;i.setZoom("PerspectiveCamera",a.perspective.zoom),i.setZoom("OrthographicCamera",a.orthographic.zoom)}}var Zo=class{constructor(e){this.objectState=e;this.uuid=et.generateUUID()}static create(e,t){let r=new Zo(t);return r.uuid=e,r}execute(e,t){Zv(e,this.objectState,null,t,!0)}};var ps;(e=>{function i(t,r,n=!0){r.dispatchEvent(t),n&&(r==null||r.traverseAncestors(s=>{s instanceof pi&&s.dispatchEvent(t)}))}e.dispatchEvent=i})(ps||(ps={}));var Qn=new $s,mo=new A,Tz=new Qe,$v={follow:oc.listener,keyDown:lc.listener,keyUp:cc.listener,link:mc.listener,lookAt:uc.listener,mouseDown:fc.listener,mouseUp:dc.listener,mouseHover:yc.listener,scroll:gc.listener,start:pc.listener},eT={follow:ac,keyDown:em,keyUp:tm,link:An,lookAt:hc,mouseDown:rm,mouseUp:nm,mouseHover:po,scroll:im,start:Kv};function Ez(i){if(i.style.transform!==""){let e=getComputedStyle(i).getPropertyValue("transform");if(e!=="none"){let t=e.replace("matrix(","").split(",");return{x:parseFloat(t[0]),y:parseFloat(t[3])}}}return{x:1,y:1}}function tT(i,e,t,r=!1){if(e in i||(i[e]=[]),i[e].some(n=>n===t)||i[e].push(t),r&&t.objectType==="EmptyObject")for(let n of t.children)bn(n)&&n.traverseEntity(s=>{i[e].some(o=>o===s)||i[e].push(s)})}function yh(i,e){let t=[];return!e.raycastLock&&e.visible&&x1(e)&&i.intersectObject(e,!1,t),t.length?t[0]:void 0}var sm=class{constructor(e,t,r,n){this.isEnable=!1;this.splineEvents={};this._map={};this._prevObjects=[];this._onMouseDown=e=>{Qn.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent(e)};this._onMouseUp=e=>{Qn.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent(e)};this._onMouseMove=e=>{Qn.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(mo),mo.negate(),this._handleMouseHoverEvent(void 0,e),this._handleLookAtEvent(e),this._handleFollowEvent(e)};this._onWheel=e=>{this._handleWheelEvent(e)};this._onTouchStart=e=>{e.touches.length===1&&(Qn.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(mo),mo.negate(),this._handleMouseDownEvent(e),this._handleMouseHoverEvent(void 0,e),this._handleLookAtEvent(e),this._handleFollowEvent(e))};this._onTouchEnd=e=>{this._handleMouseUpEvent(e),this._handleMouseHoverEvent(!0,e)};this._onTouchMove=e=>{e.touches.length===1&&(Qn.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(mo),mo.negate(),this._handleMouseHoverEvent(void 0,e),this._handleLookAtEvent(e),this._handleFollowEvent(e))};this._onKeyDown=e=>{this._handleKeyDownEvent(e)};this._onKeyUp=e=>{this._handleKeyUpEvent(e)};this._renderer=e,this._domElement=e.domElement,this._camera=r,this._scene=t,this._app=n}activate(){var e,t,r,n,s,o,a,l,c,u,h,f,d,m,p,g,y;this.isEnable=!0,this._map={},this._scene.traverseEntity(v=>{v.interaction!==void 0&&(v.interaction.start(),Object.keys(v.interaction.events).forEach(x=>{let w=x;this._addDOMCustomEvent(w,v),this._addSPEEvent(w,$v[w],v)}))}),(((e=this._map.mouseDown)==null?void 0:e.length)||((r=(t=this._map.link)==null?void 0:t.mousedown)==null?void 0:r.length))&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),(((n=this._map.mouseUp)==null?void 0:n.length)||((o=(s=this._map.link)==null?void 0:s.mouseup)==null?void 0:o.length))&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(a=this._map.scroll)!=null&&a.length&&this._domElement.addEventListener("wheel",this._onWheel,!1),(((l=this._map.mouseHover)==null?void 0:l.length)||((c=this._map.lookAt)==null?void 0:c.length)||((u=this._map.follow)==null?void 0:u.length))&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),(((h=this._map.keyDown)==null?void 0:h.length)||((d=(f=this._map.link)==null?void 0:f.keydown)==null?void 0:d.length))&&document.addEventListener("keydown",this._onKeyDown,!1),(((m=this._map.keyUp)==null?void 0:m.length)||((g=(p=this._map.link)==null?void 0:p.keyup)==null?void 0:g.length))&&document.addEventListener("keyup",this._onKeyUp,!1),(y=this._map.start)!=null&&y.length&&this._handleStartEvent()}deactivate(){this._scene.traverseEntity(e=>{if(!e.interaction)return;e.interaction.end();let t=e;Object.keys($v).forEach(r=>{let n=r;t.removeEventListener(n,$v[n])})}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),this._domElement.removeEventListener("wheel",this._onWheel),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{var t;(t=e.interaction)==null||t.start()}),this._handleStartEvent()}_getPointer(e,t){let r=this._domElement.getBoundingClientRect(),n=this._renderer.getViewport(Tz),s=Ez(this._domElement),o=n.x*s.x,a=n.y*s.y,l=n.z*s.x,c=n.w*s.y,u=r.height-c,h=(e-o-r.left)*(r.width/l),f=(t-u+a-r.top)*(r.height/c);return{x:h/r.width*2-1,y:-(f/r.height)*2+1}}_handleStartEvent(){var e;(e=this._map.start)==null||e.forEach(t=>t.dispatchEvent(Kv))}_handleWheelEvent(e){var t;(t=this._map.scroll)!=null&&t.length&&(im.domEvent=e,this._map.scroll.forEach(r=>r.dispatchEvent(im)))}_handleMouseDownEvent(e){var t,r,n;(t=this._map.mouseDown)==null||t.forEach(s=>{yh(Qn,s)&&(rm.domEvent=e,ps.dispatchEvent(rm,s))}),(n=(r=this._map.link)==null?void 0:r.mousedown)==null||n.forEach(s=>{yh(Qn,s)&&(An.domEvent=e,An.subType="mousedown",ps.dispatchEvent(An,s))})}_handleMouseUpEvent(e){var t,r,n;(t=this._map.mouseUp)==null||t.forEach(s=>{yh(Qn,s)&&(nm.domEvent=e,ps.dispatchEvent(nm,s))}),(n=(r=this._map.link)==null?void 0:r.mouseup)==null||n.forEach(s=>{yh(Qn,s)&&(An.domEvent=e,An.subType="mouseup",ps.dispatchEvent(An,s))})}_handleMouseHoverEvent(e=!1,t){var n;let r=[];e||(n=this._map.mouseHover)==null||n.forEach(s=>{let o=yh(Qn,s);o&&r.push(o.object)}),this._prevObjects.length&&(po.domEvent=t,po.enter=!1,this._prevObjects.forEach(s=>{r.includes(s)||ps.dispatchEvent(po,s)})),r.length&&(po.domEvent=t,po.enter=!0,r.forEach(s=>ps.dispatchEvent(po,s,!0))),this._prevObjects=r}_handleLookAtEvent(e){var t;(t=this._map.lookAt)!=null&&t.length&&(hc.domEvent=e,hc.normal=mo,hc.raycaster=Qn,this._map.lookAt.forEach(r=>r.dispatchEvent(hc)))}_handleFollowEvent(e){this._map.follow&&(ac.domEvent=e,ac.normal=mo,ac.raycaster=Qn,this._map.follow.forEach(t=>t.dispatchEvent(ac)))}_handleKeyDownEvent(e){var t,r,n;(t=this._map.keyDown)!=null&&t.length&&(em.domEvent=e,this._map.keyDown.forEach(s=>s.dispatchEvent(em))),(n=(r=this._map.link)==null?void 0:r.keydown)!=null&&n.length&&(An.domEvent=e,An.subType="keydown",this._map.link.keydown.forEach(s=>s.dispatchEvent(An)))}_handleKeyUpEvent(e){var t,r,n;(t=this._map.keyUp)!=null&&t.length&&(tm.domEvent=e,this._map.keyUp.forEach(s=>s.dispatchEvent(tm))),(n=(r=this._map.link)==null?void 0:r.keyup)!=null&&n.length&&(An.domEvent=e,An.subType="keyup",this._map.link.keyup.forEach(s=>s.dispatchEvent(An)))}_addSPEEvent(e,t,r){var n;if(!!r.interaction){if(eT[e].begin=this._dispatchDOMCustomEvent.bind(this),eT[e].change=this._app.requestRender.bind(this),e==="link"){let s=r.interaction.events[e];if(s){let o=!1;Object.keys(s).forEach(a=>{this._map[e]||(this._map[e]={});let l=a==="mousedown"||a==="mouseup";tT(this._map[e],a,r,l),o=!0}),o&&r.addEventListener(e,t)}}else if((n=r.interaction.events[e])!=null&&n.length){r.addEventListener(e,t);let o=e==="mouseDown"||e==="mouseUp"||e==="mouseHover";tT(this._map,e,r,o)}}}_addDOMCustomEvent(e,t){if(e){let r=new CustomEvent(e,{bubbles:!0});Object.defineProperty(r,"target",{writable:!1,value:{id:t.uuid,name:t.name}}),this.splineEvents[e]?this.splineEvents[e][t.uuid]=r:this.splineEvents[e]={[t.uuid]:r}}}_dispatchDOMCustomEvent(e,t){var n;let r=(n=this.splineEvents[e])==null?void 0:n[t];r&&this._domElement.dispatchEvent(r)}};var om=class{constructor(e,t,r,n,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new B().copy(r),this._editorSize=new B().copy(n),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewportForImageExport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,r=this._editorSize.x,n=this._editorSize.y;this._aspect=e/t,this._camera.zoom*=Math.min(r/e,n/t),this._renderer.setViewport(0,0,e,t)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,r=this._editorSize.x,n=this._editorSize.y,s=0,o=0,a=e,l=t;e<r&&(s=(r-e)*.5,s=-s,a=r),t<n&&(o=(n-t)*.5,o=-o,l=n),this._aspect=a/l,this._renderer.setViewport(s,o,a,l)}updateCamera(){if(!!this._camera)if(this._camera.cameraType==="PerspectiveCamera"){let e=this._frameSize.y,t=this._editorSize.y,r=this._fov;if(e>t){let n=_z(e,1080,2160,1,15)/100;r*=e/t,r*=1-n}this._camera.aspect=this._aspect,this._camera.fov=r,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function _z(i,e,t,r,n){return(i-e)/(t-e)*(n-r)+r}var am=class{constructor(e){this.sharedAssets=new $p(e.shared),this.scene=new jp(e.scene,this.sharedAssets),this.scene.switchActiveCamera(this.scene.activeCamera)}reset(e,t){this.scene.clearScene(this.sharedAssets),this.sharedAssets.reset(e.shared),this.scene.resetAfterClear(e.scene,this.sharedAssets)}dispose(){this.scene.dispose()}};var lm=class{constructor({x:e=10,y:t=10}){this._startTime=0;let r=document.getElementById("spe-perfs");r?this.element=r:(this.element=document.createElement("div"),document.body.appendChild(this.element),this.element.style.position="absolute",this.element.style.zIndex="10000",this.element.style.fontFamily="monospace",this.element.style.background="black",this.element.style.color="white",this.element.style.padding="10px",this.element.style.opacity="0.5",this.element.style.fontSize="11px",this.element.setAttribute("id","spe-perfs")),this.element.style.left=`${e}px`,this.element.style.top=`${t}px`}dispose(){var e;(e=this.element.parentElement)==null||e.removeChild(this.element)}start(){this._startTime=performance.now()}end(){let t=performance.now()-this._startTime;this.element.innerHTML=t.toFixed(3)+" ms"}};function Cz(i){let e;if(!!i.index)for(let t=0;t<i.index.array.length;t+=3)e=i.index.array[t],i.index.array[t]=i.index.array[t+2],i.index.array[t+2]=e}function ex(i){return i==="SubdivObject"||i==="NonParametric"?i:"Mesh"}function Lz(i,e){let t={};return i.traverseEntity(r=>{var c;if(r.type!=="Mesh"||!("material"in r)||!r.visible||!(r instanceof Xt)||Array.isArray(r.material)||r&&r.interaction&&r.interaction.states.length>0)return;let n=r.parent;for(;n;){if(n instanceof Xt&&n.interaction&&n.interaction.states.length>1)return;n=n.parent}let s=r.material.uuid,o=e.shared.materials[s];if(o){if(!Ri.isMergable(o))return}else{let u=(c=e.scene.objects.get(r.uuid))==null?void 0:c.data;if(u&&"material"in u&&typeof u.material!="string"){if(!Ri.isMergable(u.material))return;s=Ri.getHash(u.material)}}t[s]||(t[s]={});let l=t[s][ex(r.objectType)];if(l){if(l.push(r),r.cloner)for(let u of r.cloner.children)l.push(u)}else if(t[s][ex(r.objectType)]=[r],r.cloner)for(let u of r.cloner.children)t[s][ex(r.objectType)].push(u)}),t}function Dz(i){let e=0;return Object.values(i).forEach(t=>{Object.values(t).forEach(r=>{let n=r.length;n>e&&(e=n)})}),e}function rT(i,e){let t=Lz(e,i),r=Dz(t),n=new Array(r),s=0,o=new Array(r),a=0,l=new Array(r),c=0,u=new Array(r),h=0;for(let f of Object.values(t))for(let d of Object.values(f)){if(a=0,c=0,d.forEach(p=>{p instanceof Xt&&(o[a++]=p.geometry.clone(),l[c++]=p)}),c<2)continue;for(let p=0;p<c;p++)l[p].updateWorldMatrix(!0,!1),o[p].applyMatrix4(l[p].matrixWorld),l[p].matrixWorld.determinant()<0&&Cz(o[p]);let m=gM(o.slice(0,a),!1);if(m){let p;switch(d[0].objectType){case"SubdivObject":{console.warn("Turning subdiv object into mesh"),p=new Gt(m,l[0].material);break}default:{p=new Gt(m,l[0].material);break}}p.castShadow=l[0].castShadow,p.receiveShadow=l[0].receiveShadow,e.add(p);let g=y=>{h=0;for(let v of y)v.children&&g(v.children),v instanceof Xt&&(Array.isArray(v.material)||t[v.material.uuid]&&t[v.material.uuid][v.objectType]&&t[v.material.uuid][v.objectType].length>1||(u[h++]=v));for(let v=0;v<h;v++)e.attach(u[v])};for(let y=0;y<c;y++){let v=l[y];g(v.children),n[s++]=v}}}for(let f=0;f<s;f++)n[f].removeFromParent()}var vc=".",vh=Symbol("target"),tx=Symbol("unsubscribe");function xh(i){return i instanceof Date||i instanceof Set||i instanceof Map||i instanceof WeakSet||i instanceof WeakMap||ArrayBuffer.isView(i)}function nT(i){return(typeof i=="object"?i===null:typeof i!="function")||i instanceof RegExp}var Nn=Array.isArray;function $o(i){return typeof i=="symbol"}var Pz={after:(i,e)=>Nn(i)?i.slice(e.length):e===""?i:i.slice(e.length+1),concat:(i,e)=>Nn(i)?(i=[...i],e&&i.push(e),i):e&&e.toString!==void 0?(i!==""&&(i+=vc),$o(e)?i+e.toString():i+e):i,initial:i=>{if(Nn(i))return i.slice(0,-1);if(i==="")return i;let e=i.lastIndexOf(vc);return e===-1?"":i.slice(0,e)},last:i=>{if(Nn(i))return i[i.length-1]||"";if(i==="")return i;let e=i.lastIndexOf(vc);return e===-1?i:i.slice(e+1)},walk:(i,e)=>{if(Nn(i))for(let t of i)e(t);else if(i!==""){let t=0,r=i.indexOf(vc);if(r===-1)e(i);else for(;t<i.length;)r===-1&&(r=i.length),e(i.slice(t,r)),t=r+1,r=i.indexOf(vc,t)}},get(i,e){return this.walk(e,t=>{i&&(i=i[t])}),i}},dn=Pz;function rx(i){return typeof i=="object"&&typeof i.next=="function"}function nx(i,e,t,r,n){let s=i.next;if(e.name==="entries")i.next=function(){let o=s.call(this);return o.done===!1&&(o.value[0]=n(o.value[0],e,o.value[0],r),o.value[1]=n(o.value[1],e,o.value[0],r)),o};else if(e.name==="values"){let o=t[vh].keys();i.next=function(){let a=s.call(this);return a.done===!1&&(a.value=n(a.value,e,o.next().value,r)),a}}else i.next=function(){let o=s.call(this);return o.done===!1&&(o.value=n(o.value,e,o.value,r)),o};return i}function cm(i,e,t){return i.isUnsubscribed||e.ignoreSymbols&&$o(t)||e.ignoreUnderscores&&t.charAt(0)==="_"||"ignoreKeys"in e&&e.ignoreKeys.includes(t)}var bh=class{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return this._descriptorCache===void 0&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){let t=this._getDescriptorCache(),r=t.get(e);return r===void 0&&(r={},t.set(e,r)),r}_getOwnPropertyDescriptor(e,t){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,t);let r=this._getProperties(e),n=r[t];return n===void 0&&(n=Reflect.getOwnPropertyDescriptor(e,t),r[t]=n),n}getProxy(e,t,r,n){if(this.isUnsubscribed)return e;let s=e[n],o=s||e;this._pathCache.set(o,t);let a=this._proxyCache.get(o);return a===void 0&&(a=s===void 0?new Proxy(e,r):e,this._proxyCache.set(o,a)),a}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,t){return!Object.is(e,dn.get(t,this.getPath(e)))}defineProperty(e,t,r){return Reflect.defineProperty(e,t,r)?(this.isUnsubscribed||(this._getProperties(e)[t]=r),!0):!1}setProperty(e,t,r,n,s){if(!this._equals(s,r)||!(t in e)){let o=this._getOwnPropertyDescriptor(e,t);return o!==void 0&&"set"in o?Reflect.set(e,t,r,n):Reflect.set(e,t,r)}return!0}deleteProperty(e,t,r){if(Reflect.deleteProperty(e,t)){if(!this.isUnsubscribed){let n=this._getDescriptorCache().get(e);n&&(delete n[t],this._pathCache.delete(r))}return!0}return!1}isSameDescriptor(e,t,r){let n=this._getOwnPropertyDescriptor(t,r);return e!==void 0&&n!==void 0&&Object.is(e.value,n.value)&&(e.writable||!1)===(n.writable||!1)&&(e.enumerable||!1)===(n.enumerable||!1)&&(e.configurable||!1)===(n.configurable||!1)&&e.get===n.get&&e.set===n.set}isGetInvariant(e,t){let r=this._getOwnPropertyDescriptor(e,t);return r!==void 0&&r.configurable!==!0&&r.writable!==!0}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}};function xc(i){return toString.call(i)==="[object Object]"}function bc(){return!0}function go(i,e){return i.length!==e.length||i.some((t,r)=>e[r]!==t)}var um=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]);var Iz=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),ix={push:bc,pop:bc,shift:bc,unshift:bc,copyWithin:go,reverse:go,sort:go,splice:go,flat:go,fill:go},iT=new Set([...um,...Iz,...Object.keys(ix)]);function wc(i,e){if(i.size!==e.size)return!0;for(let t of i)if(!e.has(t))return!0;return!1}var sx=["keys","values","entries"],ox=new Set(["has","toString"]),ax={add:wc,clear:wc,delete:wc,forEach:wc},sT=new Set([...ox,...Object.keys(ax),...sx]);function Sc(i,e){if(i.size!==e.size)return!0;let t;for(let[r,n]of i)if(t=e.get(r),t!==n||t===void 0&&!e.has(r))return!0;return!1}var Rz=new Set([...ox,"get"]),lx={set:Sc,clear:Sc,delete:Sc,forEach:Sc},oT=new Set([...Rz,...Object.keys(lx),...sx]);var Br=class{constructor(e,t,r,n){this._path=t,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=n,this._changes=n?[]:null,this.clone=t===void 0?e:this._shallowClone(e)}static isHandledMethod(e){return um.has(e)}_shallowClone(e){let t=e;if(xc(e))t=se({},e);else if(Nn(e))t=[...e];else if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set([...e].map(r=>this._shallowClone(r)));else if(e instanceof Map){t=new Map;for(let[r,n]of e.entries())t.set(r,this._shallowClone(n))}return this._clonedCache.add(t),t}preferredThisArg(e,t,r,n){return e?(Nn(n)?this._onIsChanged=ix[t]:n instanceof Set?this._onIsChanged=ax[t]:n instanceof Map&&(this._onIsChanged=lx[t]),n):r}update(e,t,r){let n=dn.after(e,this._path);if(t!=="length"){let s=this.clone;dn.walk(n,o=>{s&&s[o]&&(this._clonedCache.has(s[o])||(s[o]=this._shallowClone(s[o])),s=s[o])}),this._hasOnValidate&&this._changes.push({path:n,property:t,previous:r}),s&&s[t]&&(s[t]=r)}this._isChanged=!0}undo(e){let t;for(let r=this._changes.length-1;r!==-1;r--)t=this._changes[r],dn.get(e,t.path)[t.property]=t.previous}isChanged(e){return this._onIsChanged===void 0?this._isChanged:this._onIsChanged(this.clone,e)}};var Mc=class extends Br{static isHandledMethod(e){return iT.has(e)}};var wh=class extends Br{undo(e){e.setTime(this.clone.getTime())}isChanged(e,t){return!t(this.clone.valueOf(),e.valueOf())}};var Ac=class extends Br{static isHandledMethod(e){return sT.has(e)}undo(e){for(let t of this.clone)e.add(t);for(let t of e)this.clone.has(t)||e.delete(t)}};var Tc=class extends Br{static isHandledMethod(e){return oT.has(e)}undo(e){for(let[t,r]of this.clone.entries())e.set(t,r);for(let t of e.keys())this.clone.has(t)||e.delete(t)}};var Sh=class extends Br{constructor(e,t,r,n){super(void 0,t,r,n),this._arg1=r[0],this._weakValue=e.has(this._arg1)}isChanged(e){return this._weakValue!==e.has(this._arg1)}undo(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}};var Mh=class extends Br{constructor(e,t,r,n){super(void 0,t,r,n),this._weakKey=r[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){let t=e.has(this._weakKey);this._weakHas&&!t?e.set(this._weakKey,this._weakValue):!this._weakHas&&t?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}};var vi=class{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return xc(e)||Nn(e)||xh(e)}static isHandledMethod(e,t){return xc(e)?Br.isHandledMethod(t):Nn(e)?Mc.isHandledMethod(t):e instanceof Set?Ac.isHandledMethod(t):e instanceof Map?Tc.isHandledMethod(t):xh(e)}get isCloning(){return this._stack.length>0}start(e,t,r){let n=Br;Nn(e)?n=Mc:e instanceof Date?n=wh:e instanceof Set?n=Ac:e instanceof Map?n=Tc:e instanceof WeakSet?n=Sh:e instanceof WeakMap&&(n=Mh),this._stack.push(new n(e,t,r,this._hasOnValidate))}update(e,t,r){this._stack[this._stack.length-1].update(e,t,r)}preferredThisArg(e,t,r){let{name:n}=e,s=vi.isHandledMethod(r,n);return this._stack[this._stack.length-1].preferredThisArg(s,n,t,r)}isChanged(e,t,r){return this._stack[this._stack.length-1].isChanged(e,t,r)}undo(e){this._previousClone!==void 0&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}};var Bz={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},cx=(i,e,t={})=>{t=se(se({},Bz),t);let r=Symbol("ProxyTarget"),{equals:n,isShallow:s,ignoreDetached:o,details:a}=t,l=new bh(n),c=typeof t.onValidate=="function",u=new vi(c),h=(v,x,w,b,E)=>!c||u.isCloning||t.onValidate(dn.concat(l.getPath(v),x),w,b,E)===!0,f=(v,x,w,b)=>{!cm(l,t,x)&&!(o&&l.isDetached(v,i))&&d(l.getPath(v),x,w,b)},d=(v,x,w,b,E)=>{u.isCloning?u.update(v,x,b):e(dn.concat(v,x),w,b,E)},m=v=>v&&(v[r]||v),p=(v,x,w,b)=>nT(v)||w==="constructor"||s&&!vi.isHandledMethod(x,w)||cm(l,t,w)||l.isGetInvariant(x,w)||o&&l.isDetached(x,i)?v:(b===void 0&&(b=l.getPath(x)),l.getProxy(v,dn.concat(b,w),g,r)),g={get(v,x,w){if($o(x)){if(x===r||x===vh)return v;if(x===tx&&!l.isUnsubscribed&&l.getPath(v).length===0)return l.unsubscribe(),v}let b=xh(v)?Reflect.get(v,x):Reflect.get(v,x,w);return p(b,v,x)},set(v,x,w,b){w=m(w);let E=v[r]||v,T=E[x];if(n(T,w)&&x in v)return!0;let S=h(v,x,w,T);return S&&l.setProperty(E,x,w,b,T)?(f(v,x,v[x],T),!0):!S},defineProperty(v,x,w){if(!l.isSameDescriptor(w,v,x)){let b=v[x];h(v,x,w.value,b)&&l.defineProperty(v,x,w,b)&&f(v,x,w.value,b)}return!0},deleteProperty(v,x){if(!Reflect.has(v,x))return!0;let w=Reflect.get(v,x),b=h(v,x,void 0,w);return b&&l.deleteProperty(v,x,w)?(f(v,x,void 0,w),!0):!b},apply(v,x,w){let b=x[r]||x;if(l.isUnsubscribed)return Reflect.apply(v,b,w);if((a===!1||a!==!0&&!a.includes(v.name))&&vi.isHandledType(b)){let E=dn.initial(l.getPath(v)),T=vi.isHandledMethod(b,v.name);u.start(b,E,w);let S=Reflect.apply(v,u.preferredThisArg(v,x,b),T?w.map(M=>m(M)):w),I=u.isChanged(b,n),C=u.stop();if(vi.isHandledType(S)&&T&&(x instanceof Map&&v.name==="get"&&(E=dn.concat(E,w[0])),S=l.getProxy(S,E,g)),I){let M={name:v.name,args:w,result:S},_=u.isCloning?dn.initial(E):E,R=u.isCloning?dn.last(E):"";h(dn.get(i,_),R,b,C,M)?d(_,R,b,C,M):u.undo(b)}return(x instanceof Map||x instanceof Set)&&rx(S)?nx(S,v,x,E,p):S}return Reflect.apply(v,x,w)}},y=l.getProxy(i,t.pathAsArray?[]:"",g);return e=e.bind(y),c&&(t.onValidate=t.onValidate.bind(y)),y};cx.target=i=>i&&i[vh]||i;cx.unsubscribe=i=>i[tx]||i;var ux=cx;var aT=class{constructor(e,{autoRender:t=!1}={}){this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this._proxyObjectCache=new Map;this._skipRender=!0;this.autoRender=!1;this.disposed=!1;this.requestRender=()=>{this._skipRender=!1};this.render=()=>{var e,t,r;!this._renderer||(this._rafId=requestAnimationFrame(this.render),(e=this._perfs)==null||e.start(),!(!this.autoRender&&this._skipRender)&&(this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this._skipRender=!this._controls.update():this._skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._transmissionRenderTarget&&(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3)),(t=this._scene.postprocessing)!=null&&t.enabled?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera))),(r=this._perfs)==null||r.end()))};this.resize=()=>{var e,t,r,n;!this._renderer||(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new B(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),(t=this._scene)!=null&&t.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((r=this._frameView)==null||r.updateViewport()),this._camera&&((n=this._frameView)==null||n.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()),this.requestRender())};this.canvas=e,this.autoRender=t,window.addEventListener("resize",bu(this.resize,200)),window.location.search.includes("perfs")&&(this._perfs=new lm({x:10,y:10}))}async load(e){let r=await(await fetch(e)).arrayBuffer();await this.start(r)}async start(e){var o;if(this.disposed)return;let t=await yA(e);this._publishData=t.scene.publish;let r=new am(t);if(window.location.search.includes("merge-geometries")){let a=performance.now();rT(t,r.scene);let l=performance.now();console.log("Merged geometries in ",l-a," ms")}this._scene=r.scene,this._sharedAssetsManager=r.sharedAssets,this._sharedAssetsManager.onImageLoad=()=>{this.requestRender()},$A(t.scene,this._scene,this._sharedAssetsManager),this._camera=this._scene.activeCamera;let n=Object.values(t.frames)[0];n&&(n.preset==="fullscreen"?(this._viewportMode=1,this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight):(this._viewportMode=2,this._viewportWidth=n.size[0],this._viewportHeight=n.size[1])),(o=this._scene.postprocessing)!=null&&o.enabled?(this._renderer=new Ct({canvas:this.canvas,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene}),this._scene.postprocessing.addEventListener("smaaloaded",this.requestRender)):this._renderer=new Ct({canvas:this.canvas,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._scene.needsTransmission(void 0)&&(this._transmissionRenderTarget=new mt(2048,2048,{generateMipmaps:!0,minFilter:Gs,magFilter:ct,wrapS:_r,wrapT:_r}),this._transmissionRenderTarget.depthTexture=new si(2048,2048),this._scene.needsTransmission(this._transmissionRenderTarget)),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=Jg,this._renderer.setClearColor(this._scene.bgColor,this._scene.alpha),this._frameView=new om(this._renderer,this._camera,new B(this._viewportWidth,this._viewportHeight),new B(window.innerWidth,window.innerHeight)),!0&&(this._controls=new sp(this._camera,this._renderer.domElement),this._publishData&&(this._controls.fromJSON(this._publishData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",this.requestRender),this._controls.addEventListener("start",this.requestRender)),this._playmode=new sm(this._renderer,this._scene,this._camera,this),this.resize(),this.render()}findObjectById(e){var r;let t=(r=this._scene)==null?void 0:r.getObjectByProperty("uuid",e);return this._createProxyObject(t)}findObjectByName(e){var r;let t=(r=this._scene)==null?void 0:r.getObjectByName(e);return this._createProxyObject(t)}getSplineEvents(){var e;return(e=this._playmode)==null?void 0:e.splineEvents}emitEvent(e,t){let r=this.findObjectById(t);r==null||r.emitEvent(e)}emitEventReverse(e,t){let r=this.findObjectById(t);r==null||r.emitEventReverse(e)}addEventListener(e,t){var r;(r=this._renderer)==null||r.domElement.addEventListener(e,t)}removeEventListener(e,t){var r;(r=this._renderer)==null||r.domElement.removeEventListener(e,t)}setZoom(e){var t;(t=this._controls)==null||t.zoomOut(e)}dispose(){var e,t,r,n,s,o,a;this.disposed=!0,(e=this._playmode)==null||e.deactivate(),(t=this._scene)==null||t.dispose(),this._rafId&&cancelAnimationFrame(this._rafId),this._proxyObjectCache.forEach(l=>{ux.unsubscribe(l)}),(r=this._renderer)==null||r.dispose(),(n=this._transmissionRenderTarget)==null||n.dispose(),(o=(s=this._transmissionRenderTarget)==null?void 0:s.depthTexture)==null||o.dispose(),(a=this._sharedAssetsManager)==null||a.dispose()}_createProxyObject(e){if(e==null)return;if(this._proxyObjectCache.has(e.uuid))return this._proxyObjectCache.get(e.uuid);let t={name:e.name,uuid:e.uuid,visible:e.visible,intensity:e.intensity,position:e.position,rotation:e.rotation,scale:e.scale,emitEvent(n){var s;(s=e.interaction)==null||s.emitEvent(n)},emitEventReverse(n){var s;(s=e.interaction)==null||s.emitEventReverse(n)}},r=ux(t,(n,s)=>{var a;typeof e[n]!="object"&&((a=Object.getOwnPropertyDescriptor(e,n))==null?void 0:a.writable)&&(e[n]=s),this.requestRender(),e.updateMatrix()});return this._proxyObjectCache.set(e.uuid,r),r}};Gr.FONTS_PATH="_assets/_fonts/";export{aT as Application};
|
|
4229
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(s){let o=s.data;switch(o.type){case"decode":n._callbacks[o.id].resolve(o);break;case"error":n._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,s){return n._taskLoad>s._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}};function IU(){let i,e;onmessage=function(o){let a=o.data;switch(a.type){case"init":i=a.decoderConfig,e=new Promise(function(u){i.onModuleLoaded=function(h){u({draco:h})},DracoDecoderModule(i)});break;case"decode":let l=a.buffer,c=a.taskConfig;e.then(u=>{let h=u.draco,f=new h.Decoder,d=new h.DecoderBuffer;d.Init(new Int8Array(l),l.byteLength);try{let m=t(h,f,d,c),p=m.attributes.map(g=>g.array.buffer);m.index&&p.push(m.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:m},p)}catch(m){console.error(m),self.postMessage({type:"error",id:a.id,error:m.message})}finally{h.destroy(d),h.destroy(f)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,f,d,m=a.GetEncodedGeometryType(l);if(m===o.TRIANGULAR_MESH)f=new o.Mesh,d=a.DecodeBufferToMesh(l,f);else if(m===o.POINT_CLOUD)f=new o.PointCloud,d=a.DecodeBufferToPointCloud(l,f);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||f.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());let p={index:null,attributes:[]};for(let g in u){let y=self[h[g]],v,x;if(c.useUniqueIDs)x=u[g],v=a.GetAttributeByUniqueId(f,x);else{if(x=a.GetAttributeId(f,o[u[g]]),x===-1)continue;v=a.GetAttribute(f,x)}p.attributes.push(n(o,a,f,g,y,v))}return m===o.TRIANGULAR_MESH&&(p.index=r(o,a,f)),o.destroy(f),p}function r(o,a,l){let u=l.num_faces()*3,h=u*4,f=o._malloc(h);a.GetTrianglesUInt32Array(l,h,f);let d=new Uint32Array(o.HEAPF32.buffer,f,u).slice();return o._free(f),{array:d,itemSize:1}}function n(o,a,l,c,u,h){let f=h.num_components(),m=l.num_points()*f,p=m*u.BYTES_PER_ELEMENT,g=s(o,u),y=o._malloc(p);a.GetAttributeDataArrayForAllPoints(l,h,g,p,y);let v=new u(o.HEAPF32.buffer,y,m).slice();return o._free(y),{name:c,array:v,itemSize:f}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}var fo;function RU(){return fo||(fo=new qp,fo.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.5.2/").preload()),fo.decoderPending}async function BU(i){if(fo){let e={attributeIDs:fo.defaultAttributeIDs,attributeTypes:fo.defaultAttributeTypes,useUniqueIDs:!1},t;try{t=await fo.decodeGeometry(new Int8Array(i).buffer,e)}catch(r){console.error(r)}if(t)return{index:t.index?{array:t.index.array}:void 0,attributes:Object.entries(t.attributes).map(([r,n])=>({name:r,itemSize:n.itemSize,array:n.array}))}}return null}async function yA(i){let[e,t]=hy(Kd.deserialize(new Uint8Array(i))),r=[];e.scene.objects.traverse((n,s)=>{s.type==="Mesh"&&s.geometry.type==="NonParametricGeometry"&&s.geometry.data.draco!==void 0&&r.push(s)}),r.length&&await RU();for(let n of r){let s=await BU(dy(n.geometry.data.draco));if(s){s.index&&(n.geometry.data.index={array:s.index.array,itemSize:1,normalized:!1,type:"Uint32Array"});let o={};s.attributes.forEach(({name:a,array:l,itemSize:c})=>{o[a]={array:l,itemSize:c,type:"Float32Array",normalized:!1}}),n.geometry.data.attributes=o,n.geometry.data.draco=void 0}}return t.result().data}var MA={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Fv={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},NU=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Yp={CSS:{},springs:{}};function Hi(i,e,t){return Math.min(Math.max(i,e),t)}function ph(i,e){return i.indexOf(e)>-1}function Bv(i,e){return i.apply(null,e)}var Je={arr:function(i){return Array.isArray(i)},obj:function(i){return ph(Object.prototype.toString.call(i),"Object")},pth:function(i){return Je.obj(i)&&i.hasOwnProperty("totalLength")},svg:function(i){return i instanceof SVGElement},inp:function(i){return i instanceof HTMLInputElement},dom:function(i){return!("isNode"in i)&&(i.nodeType||Je.svg(i))},str:function(i){return typeof i=="string"},fnc:function(i){return typeof i=="function"},und:function(i){return typeof i>"u"},hex:function(i){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)},rgb:function(i){return/^rgb/.test(i)},hsl:function(i){return/^hsl/.test(i)},col:function(i){return Je.hex(i)||Je.rgb(i)||Je.hsl(i)},key:function(i){return!MA.hasOwnProperty(i)&&!Fv.hasOwnProperty(i)&&i!=="targets"&&i!=="keyframes"}};function AA(i){var e=/\(([^)]+)\)/.exec(i);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function TA(i,e){var t=AA(i),r=Hi(Je.und(t[0])?1:t[0],.1,100),n=Hi(Je.und(t[1])?100:t[1],.1,100),s=Hi(Je.und(t[2])?10:t[2],.1,100),o=Hi(Je.und(t[3])?0:t[3],.1,100),a=Math.sqrt(n/r),l=s/(2*Math.sqrt(n*r)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function f(m){var p=e?e*m/1e3:m;return l<1?p=Math.exp(-p*l*a)*(u*Math.cos(c*p)+h*Math.sin(c*p)):p=(u+h*p)*Math.exp(-p*a),m===0||m===1?m:1-p}function d(){var m=Yp.springs[i];if(m)return m;for(var p=1/6,g=0,y=0;;)if(g+=p,f(g)===1){if(y++,y>=16)break}else y=0;var v=g*p*1e3;return Yp.springs[i]=v,v}return e?f:d}function OU(i){return i===void 0&&(i=10),function(e){return Math.ceil(Hi(e,1e-6,1)*i)*(1/i)}}var FU=function(){var i=11,e=1/(i-1);function t(u,h){return 1-3*h+3*u}function r(u,h){return 3*h-6*u}function n(u){return 3*u}function s(u,h,f){return((t(h,f)*u+r(h,f))*u+n(h))*u}function o(u,h,f){return 3*t(h,f)*u*u+2*r(h,f)*u+n(h)}function a(u,h,f,d,m){var p,g,y=0;do g=h+(f-h)/2,p=s(g,d,m)-u,p>0?f=g:h=g;while(Math.abs(p)>1e-7&&++y<10);return g}function l(u,h,f,d){for(var m=0;m<4;++m){var p=o(h,f,d);if(p===0)return h;var g=s(h,f,d)-u;h-=g/p}return h}function c(u,h,f,d){if(!(0<=u&&u<=1&&0<=f&&f<=1))return;var m=new Float32Array(i);if(u!==h||f!==d)for(var p=0;p<i;++p)m[p]=s(p*e,u,f);function g(y){for(var v=0,x=1,w=i-1;x!==w&&m[x]<=y;++x)v+=e;--x;var b=(y-m[x])/(m[x+1]-m[x]),E=v+b*e,T=o(E,u,f);return T>=.001?l(y,E,u,f):T===0?E:a(y,v,v+e,u,f)}return function(y){return u===h&&f===d||y===0||y===1?y:s(g(y),h,d)}}return c}(),EA=function(){var i={linear:function(){return function(r){return r}}},e={Sine:function(){return function(r){return 1-Math.cos(r*Math.PI/2)}},Circ:function(){return function(r){return 1-Math.sqrt(1-r*r)}},Back:function(){return function(r){return r*r*(3*r-2)}},Bounce:function(){return function(r){for(var n,s=4;r<((n=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((n*3-2)/22-r,2)}},Elastic:function(r,n){r===void 0&&(r=1),n===void 0&&(n=.5);var s=Hi(r,1,10),o=Hi(n,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(r,n){e[r]=function(){return function(s){return Math.pow(s,n+2)}}}),Object.keys(e).forEach(function(r){var n=e[r];i["easeIn"+r]=n,i["easeOut"+r]=function(s,o){return function(a){return 1-n(s,o)(1-a)}},i["easeInOut"+r]=function(s,o){return function(a){return a<.5?n(s,o)(a*2)/2:1-n(s,o)(a*-2+2)/2}}}),i}();function Uv(i,e){if(Je.fnc(i))return i;var t=i.split("(")[0],r=EA[t],n=AA(i);switch(t){case"spring":return TA(i,e);case"cubicBezier":return Bv(FU,n);case"steps":return Bv(OU,n);default:return Bv(r,n)}}function _A(i){try{var e=document.querySelectorAll(i);return e}catch{return}}function Jp(i,e){for(var t=i.length,r=arguments.length>=2?arguments[1]:void 0,n=[],s=0;s<t;s++)if(s in i){var o=i[s];e.call(r,o,s,i)&&n.push(o)}return n}function Qp(i){return i.reduce(function(e,t){return e.concat(Je.arr(t)?Qp(t):t)},[])}function vA(i){return Je.arr(i)?i:(Je.str(i)&&(i=_A(i)||i),i instanceof NodeList||i instanceof HTMLCollection?[].slice.call(i):[i])}function zv(i,e){return i.some(function(t){return t===e})}function Gv(i){var e={};for(var t in i)e[t]=i[t];return e}function Nv(i,e){var t=Gv(i);for(var r in i)t[r]=e.hasOwnProperty(r)?e[r]:i[r];return t}function Kp(i,e){var t=Gv(i);for(var r in e)t[r]=Je.und(i[r])?e[r]:i[r];return t}function UU(i){var e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(i);return e?"rgba("+e[1]+",1)":i}function zU(i){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,t=i.replace(e,function(a,l,c,u){return l+l+c+c+u+u}),r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),n=parseInt(r[1],16),s=parseInt(r[2],16),o=parseInt(r[3],16);return"rgba("+n+","+s+","+o+",1)"}function GU(i){var e=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(i)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(i),t=parseInt(e[1],10)/360,r=parseInt(e[2],10)/100,n=parseInt(e[3],10)/100,s=e[4]||1;function o(f,d,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?f+(d-f)*6*m:m<1/2?d:m<2/3?f+(d-f)*(2/3-m)*6:f}var a,l,c;if(r==0)a=l=c=n;else{var u=n<.5?n*(1+r):n+r-n*r,h=2*n-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function kU(i){if(Je.rgb(i))return UU(i);if(Je.hex(i))return zU(i);if(Je.hsl(i))return GU(i)}function ds(i){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(i);if(e)return e[1]}function VU(i){if(ph(i,"translate")||i==="perspective")return"px";if(ph(i,"rotate")||ph(i,"skew"))return"deg"}function Ov(i,e){return Je.fnc(i)?i(e.target,e.id,e.total):i}function Wi(i,e){return i.getAttribute(e)}function kv(i,e,t){var r=ds(e);if(zv([t,"deg","rad","turn"],r))return e;var n=Yp.CSS[e+t];if(!Je.und(n))return n;var s=100,o=document.createElement(i.tagName),a=i.parentNode&&i.parentNode!==document?i.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Yp.CSS[e+t]=c,c}function CA(i,e,t){if(e in i.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n=i.style[e]||getComputedStyle(i).getPropertyValue(r)||"0";return t?kv(i,n,t):n}}function Vv(i,e){if(Je.dom(i)&&!Je.inp(i)&&(Wi(i,e)||Je.svg(i)&&i[e]))return"attribute";if(Je.dom(i)&&zv(NU,e))return"transform";if(Je.dom(i)&&e!=="transform"&&CA(i,e))return"css";if(i[e]!=null)return"object"}function LA(i){if(!!Je.dom(i)){for(var e=i.style.transform||"",t=/(\w+)\(([^)]*)\)/g,r=new Map,n;n=t.exec(e);)r.set(n[1],n[2]);return r}}function HU(i,e,t,r){var n=ph(e,"scale")?1:0+VU(e),s=LA(i).get(e)||n;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),r?kv(i,s,r):s}function Hv(i,e,t,r){switch(Vv(i,e)){case"transform":return HU(i,e,r,t);case"css":return CA(i,e,t);case"attribute":return Wi(i,e);default:return i[e]||0}}function Wv(i,e){var t=/^(\*=|\+=|-=)/.exec(i);if(!t)return i;var r=ds(i)||0,n=parseFloat(e),s=parseFloat(i.replace(t[0],""));switch(t[0][0]){case"+":return n+s+r;case"-":return n-s+r;case"*":return n*s+r}}function DA(i,e){if(Je.col(i))return kU(i);if(/\s/g.test(i))return i;var t=ds(i),r=t?i.substr(0,i.length-t.length):i;return e?r+e:r}function jv(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function WU(i){return Math.PI*2*Wi(i,"r")}function jU(i){return Wi(i,"width")*2+Wi(i,"height")*2}function qU(i){return jv({x:Wi(i,"x1"),y:Wi(i,"y1")},{x:Wi(i,"x2"),y:Wi(i,"y2")})}function PA(i){for(var e=i.points,t=0,r,n=0;n<e.numberOfItems;n++){var s=e.getItem(n);n>0&&(t+=jv(r,s)),r=s}return t}function XU(i){var e=i.points;return PA(i)+jv(e.getItem(e.numberOfItems-1),e.getItem(0))}function IA(i){if(i.getTotalLength)return i.getTotalLength();switch(i.tagName.toLowerCase()){case"circle":return WU(i);case"rect":return jU(i);case"line":return qU(i);case"polyline":return PA(i);case"polygon":return XU(i)}}function YU(i){var e=IA(i);return i.setAttribute("stroke-dasharray",e),e}function JU(i){for(var e=i.parentNode;Je.svg(e)&&Je.svg(e.parentNode);)e=e.parentNode;return e}function RA(i,e){var t=e||{},r=t.el||JU(i),n=r.getBoundingClientRect(),s=Wi(r,"viewBox"),o=n.width,a=n.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function QU(i,e){var t=Je.str(i)?_A(i)[0]:i,r=e||100;return function(n){return{property:n,el:t,svg:RA(t),totalLength:IA(t)*(r/100)}}}function KU(i,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return i.el.getPointAtLength(l)}var r=RA(i.el,i.svg),n=t(),s=t(-1),o=t(1);switch(i.property){case"x":return(n.x-r.x)*r.w;case"y":return(n.y-r.y)*r.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function xA(i,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=DA(Je.pth(i)?i.totalLength:i,e)+"";return{original:r,numbers:r.match(t)?r.match(t).map(Number):[0],strings:Je.str(i)||e?r.split(t):[]}}function BA(i){var e=i?Qp(Je.arr(i)?i.map(vA):vA(i)):[];return Jp(e,function(t,r,n){return n.indexOf(t)===r})}function NA(i){var e=BA(i);return e.map(function(t,r){return{target:t,id:r,total:e.length,transforms:{list:LA(t)}}})}function ZU(i,e){var t=Gv(e);if(/^spring/.test(t.easing)&&(t.duration=TA(t.easing)),Je.arr(i)){var r=i.length,n=r===2&&!Je.obj(i[0]);n?i={value:i}:Je.fnc(e.duration)||(t.duration=e.duration/r)}var s=Je.arr(i)?i:[i];return s.map(function(o,a){var l=Je.obj(o)&&!Je.pth(o)?o:{value:o};return Je.und(l.delay)&&(l.delay=a?0:e.delay),Je.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return Kp(o,t)})}function $U(i){for(var e=Jp(Qp(i.map(function(s){return Object.keys(s)})),function(s){return Je.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},r=function(s){var o=e[s];t[o]=i.map(function(a){var l={};for(var c in a)Je.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},n=0;n<e.length;n++)r(n);return t}function ez(i,e){var t=[],r=e.keyframes;r&&(e=Kp($U(r),e));for(var n in e)Je.key(n)&&t.push({name:n,tweens:ZU(e[n],i)});return t}function tz(i,e){var t={};for(var r in i){var n=Ov(i[r],e);Je.arr(n)&&(n=n.map(function(s){return Ov(s,e)}),n.length===1&&(n=n[0])),t[r]=n}return t.duration=parseFloat(t.duration),t.delay=parseFloat(t.delay),t}function rz(i,e){var t;return i.tweens.map(function(r){var n=tz(r,e),s=n.value,o=Je.arr(s)?s[1]:s,a=ds(o),l=Hv(e.target,i.name,a,e),c=t?t.to.original:l,u=Je.arr(s)?s[0]:c,h=ds(u)||ds(l),f=a||h;return Je.und(o)&&(o=c),n.from=xA(u,f),n.to=xA(Wv(o,u),f),n.start=t?t.end:0,n.end=n.start+n.delay+n.duration+n.endDelay,n.easing=Uv(n.easing,n.duration),n.isPath=Je.pth(s),n.isColor=Je.col(n.from.original),n.isColor&&(n.round=1),t=n,n})}var OA={css:function(i,e,t){return i.style[e]=t},attribute:function(i,e,t){return i.setAttribute(e,t)},object:function(i,e,t){return i[e]=t},transform:function(i,e,t,r,n){if(r.list.set(e,t),e===r.last||n){var s="";r.list.forEach(function(o,a){s+=a+"("+o+") "}),i.style.transform=s}}};function FA(i,e){var t=NA(i);t.forEach(function(r){for(var n in e){var s=Ov(e[n],r),o=r.target,a=ds(s),l=Hv(o,n,a,r),c=a||ds(l),u=Wv(DA(s,c),l),h=Vv(o,n);OA[h](o,n,u,r.transforms,!0)}})}function nz(i,e){var t=Vv(i.target,e.name);if(t){var r=rz(e,i),n=r[r.length-1];return{type:t,property:e.name,animatable:i,tweens:r,duration:n.end,delay:r[0].delay,endDelay:n.endDelay}}}function iz(i,e){return Jp(Qp(i.map(function(t){return e.map(function(r){return nz(t,r)})})),function(t){return!Je.und(t)})}function UA(i,e){var t=i.length,r=function(s){return s.timelineOffset?s.timelineOffset:0},n={};return n.duration=t?Math.max.apply(Math,i.map(function(s){return r(s)+s.duration})):e.duration,n.delay=t?Math.min.apply(Math,i.map(function(s){return r(s)+s.delay})):e.delay,n.endDelay=t?n.duration-Math.max.apply(Math,i.map(function(s){return r(s)+s.duration-s.endDelay})):e.endDelay,n}var bA=0;function sz(i){var e=Nv(MA,i),t=Nv(Fv,i),r=ez(t,i),n=NA(i.targets),s=iz(n,r),o=UA(s,t),a=bA;return bA++,Kp(e,{id:a,children:[],animatables:n,animations:s,duration:o.duration,delay:o.delay,endDelay:o.endDelay})}var Mn=[],wA=[],Xp,oz=function(){function i(){Xp=requestAnimationFrame(e)}function e(t){var r=Mn.length;if(r){for(var n=0;n<r;){var s=Mn[n];if(!s.paused)s.tick(t);else{var o=Mn.indexOf(s);o>-1&&(Mn.splice(o,1),r=Mn.length)}n++}i()}else Xp=cancelAnimationFrame(Xp)}return i}();function az(){document.hidden?(Mn.forEach(function(i){return i.pause()}),wA=Mn.slice(0),br.running=Mn=[]):wA.forEach(function(i){return i.play()})}typeof document<"u"&&document.addEventListener("visibilitychange",az);function br(i){i===void 0&&(i={});var e=0,t=0,r=0,n,s=0,o=null;function a(x){var w=window.Promise&&new Promise(function(b){return o=b});return x.finished=w,w}var l=sz(i),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,n.forEach(function(w){return w.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function f(){e=0,t=h(l.currentTime)*(1/br.speed)}function d(x,w){w&&w.seek(x-w.timelineOffset)}function m(x){if(l.reversePlayback)for(var b=s;b--;)d(x,n[b]);else for(var w=0;w<s;w++)d(x,n[w])}function p(x){var w=0,b=l.animations,E=b.length;for(l.reversePlayback===!0&&l.rewind===!1&&(x=l.duration-x);w<E;){var T=b[w],S=T.animatable,I=T.tweens,C=I.length-1,M=I[C];C&&(M=Jp(I,function(ae){return x<ae.end})[0]||M);for(var _=Hi(x-M.start-M.delay,0,M.duration)/M.duration,R=isNaN(_)?1:M.easing(_),N=M.to.strings,O=M.round,z=[],q=M.to.numbers.length,F=void 0,ee=0;ee<q;ee++){var k=void 0;if(l.reversePlayback===!0&&l.rewind===!1)var V=M.to.numbers[ee],U=M.from.numbers[ee]||0;else var U=M.to.numbers[ee],V=M.from.numbers[ee]||0;M.isPath?k=KU(M.value,R*U):k=V+R*(U-V),O&&(M.isColor&&ee>2||(k=Math.round(k*O)/O)),z.push(k)}var J=N.length;if(!J)F=z[0];else{F=N[0];for(var K=0;K<J;K++){var $=N[K],j=N[K+1],ge=z[K];isNaN(ge)||(j?F+=ge+j:F+=ge+" ")}}OA[T.type](S.target,T.property,F,S.transforms),T.currentValue=F,w++}}function g(x){l[x]&&!l.passThrough&&l[x](l)}function y(){l.remaining&&l.remaining!==!0&&l.remaining--}function v(x){var w=l.duration,b=l.delay,E=w-l.endDelay,T=h(x);l.progress=Hi(T/w*100,0,100),l.reversePlayback=T<l.currentTime,n&&m(T),!l.began&&l.currentTime>=0&&(l.began=!0,g("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,g("loopBegin")),T<=b&&l.currentTime!==0&&p(0),(T>=E&&l.currentTime!==w||!w)&&p(w),T>b&&T<E?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,g("changeBegin")),g("change"),p(T)):l.changeBegan?(l.changeCompleted=!0,l.changeBegan=!1,g("change"),g("changeComplete")):l.began&&T>E&&(g("change"),g("changeComplete")),l.currentTime=Hi(T,0,w),l.began&&g("update"),x>=w&&(t=0,y(),l.remaining?(e=r,g("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,g("loopComplete"),g("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,n=l.children,s=n.length;for(var w=s;w--;)l.children[w].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,p(l.reversed?l.duration:0)},l.set=function(x,w){return FA(x,w),l},l.tick=function(x){r=x,e||(e=r),v((r+(t-e))*br.speed)},l.seek=function(x){v(h(x))},l.pause=function(){l.paused=!0,f()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,Mn.push(l),f(),Xp||oz())},l.reverse=function(){u(),l.completed=!l.reversed,f()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function SA(i,e){for(var t=e.length;t--;)zv(i,e[t].animatable.target)&&e.splice(t,1)}function lz(i){for(var e=BA(i),t=Mn.length;t--;){var r=Mn[t],n=r.animations,s=r.children;SA(e,n);for(var o=s.length;o--;){var a=s[o],l=a.animations;SA(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!n.length&&!s.length&&r.pause()}}function cz(i,e){e===void 0&&(e={});var t=e.direction||"normal",r=e.easing?Uv(e.easing):null,n=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=Je.arr(i),h=parseFloat(u?i[0]:i),f=u?parseFloat(i[1]):0,d=ds(u?i[1]:i)||0,m=e.start||0+(u?h:0),p=[],g=0;return function(y,v,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!p.length){for(var w=0;w<x;w++){if(!n)p.push(Math.abs(o-w));else{var b=l?(n[0]-1)/2:o%n[0],E=l?(n[1]-1)/2:Math.floor(o/n[0]),T=w%n[0],S=Math.floor(w/n[0]),I=b-T,C=E-S,M=Math.sqrt(I*I+C*C);s==="x"&&(M=-I),s==="y"&&(M=-C),p.push(M)}g=Math.max.apply(Math,p)}r&&(p=p.map(function(R){return r(R/g)*g})),t==="reverse"&&(p=p.map(function(R){return s?R<0?R*-1:-R:Math.abs(g-R)}))}var _=u?(f-h)/g:h;return m+_*(Math.round(p[v]*100)/100)+d}}function uz(i){i===void 0&&(i={});var e=br(i);return e.duration=0,e.add=function(t,r){var n=Mn.indexOf(e),s=e.children;n>-1&&Mn.splice(n,1);function o(f){f.passThrough=!0}for(var a=0;a<s.length;a++)o(s[a]);var l=Kp(t,Nv(Fv,i));l.targets=l.targets||i.targets;var c=e.duration;l.autoplay=!1,l.direction=e.direction,l.timelineOffset=Je.und(r)?c:Wv(r,c),o(e),l.rewind=e.rewind,e.seek(l.timelineOffset);var u=br(l);o(u),s.push(u);var h=UA(s,i);return e.delay=h.delay,e.endDelay=h.endDelay,e.duration=h.duration,e.seek(0),e.reset(),e.autoplay&&e.play(),e},e}br.version="3.2.0";br.speed=1;br.running=Mn;br.remove=lz;br.get=Hv;br.set=FA;br.convertPx=kv;br.path=QU;br.setDashoffset=YU;br.stagger=cz;br.timeline=uz;br.easing=Uv;br.penner=EA;br.random=function(i,e){return Math.floor(Math.random()*(e-i+1))+i};var mh=br;function gh(i,e,t){switch(i){case 0:return"cubicBezier( 0, 0, 1, 1 )";case 1:return"cubicBezier( .25, .1, .25, 1 )";case 2:return"cubicBezier( .42, 0, 1, 1 )";case 3:return"cubicBezier( 0, 0, .58, 1 )";case 4:return"cubicBezier( .42, 0, .58, 1 )";case 5:let{control1:r,control2:n}=e;return`cubicBezier( ${r[0]}, ${r[1]}, ${n[0]}, ${n[1]} )`;case 6:let{mass:s,stiffness:o,damping:a,velocity:l}=t;return`spring( ${s}, ${o}, ${a}, ${l} )`}}function zA(i,e,t){var n,s;let r=i.cameraType==="OrthographicCamera"?(n=e.orthographic)==null?void 0:n.zoom:(s=e.perspective)==null?void 0:s.zoom;if(r!==void 0){let o=i.zoom;o!==r&&t.push({change:a=>{i.zoom=et.lerp(o,r,a),i.updateProjectionMatrix()}})}if(e.targetOffset!==void 0){let o=i.targetOffset,a=e.targetOffset;o!==a&&t.push({change:l=>{i.targetOffset=et.lerp(o,a,l)}})}}function GA(i,e,t){if(e.width!==void 0&&e.height!==void 0&&e.depth!==void 0){let{width:r,height:n,depth:s}=i.geometry.userData.parameters,o=[r,n,s],a=[e.width,e.height,e.depth];vr.isEqual(o,a)||t.push({change:l=>{let[c,u,h]=vr.lerp(o,a,l);i.updateGeometry({parameters:{width:c,height:u,depth:h}})}})}}function kA(i,e,t,r){if(e.intensity!==void 0){let n=i.intensity,s=e.intensity;n!==s&&t.push({change:o=>{i.intensity=et.lerp(n,s,o)}})}if(e.color!==void 0){let n=i.color.clone(),s=typeof e.color=="string"?r.getColor(e.color):e.color;if(!Sr.equals(n,s)){let o=n.clone();i.color=o,t.push({change:a=>{let{r:l,g:c,b:u}=Sr.lerp(n,s,a);o.setRGB(l,c,u)}})}}}function VA(i,e,t,r){var s,o;let n=i.layersList.head;for(;n;){let a=e.layers.data(n.uuid);if(a&&((s=n.visible)!=null?s:!0)&&((o=a.visible)!=null?o:!0)){let l=n.getNames().filter(c=>!uM.some(u=>c.includes(u)));for(let c of l)try{let u=n.getValue(c);if(c==="steps")gz(n,a,c,t);else if(c==="colors")yz(n,a,c,t);else if(typeof u=="number")hz(n,a,c,t);else{if(typeof u=="boolean")continue;"isVector2"in u?fz(n,a,c,t):"isVector3"in u?dz(n,a,c,t):"isColorA"in u?mz(n,a,c,t,r):"isColor"in u?pz(n,a,c,t,r):"isTexture"in u&&vz(n,a,c,t)}}catch(u){console.error(`animateMaterial: unexpected material layer for ${c}`,u)}}n=n.next}}function hz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=e[t];n!==s&&r.push({change:o=>{i.setValue(t,et.lerp(n,s,o))}})}function fz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=n.toArray(),o=e[t];ls.isEqual(s,o)||r.push({change:a=>{n.fromArray(ls.lerp(s,o,a))}})}function dz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=n.toArray(),o=e[t];vr.isEqual(s,o)||r.push({change:a=>{n.fromArray(vr.lerp(s,o,a))}})}function pz(i,e,t,r,n){if(!i.hasValue(t)||!(t in e))return;let s=i.getValue(t).clone(),o=e[t],a=typeof o=="string"?n.getColor(o):o;if(Sr.equals(s,a))return;let l=s.clone();i.setValue(t,l),r.push({change:c=>{let{r:u,g:h,b:f}=Sr.lerp(s,a,c);l.setRGB(u,h,f)}})}function mz(i,e,t,r,n){if(!i.hasValue(t)||!(t in e))return;let s=i.getValue(t).clone(),o=e[t],a=typeof o=="string"?n.getColor(o):o;if(Ln.equals(s,a))return;let l=s.clone();i.setValue(t,l),r.push({change:c=>{let{r:u,g:h,b:f,a:d}=Ln.lerp(s,a,c);l.setRGBA(u,h,f,d)}})}function gz(i,e,t="steps",r){if(!i.hasValue(t)||!(t in e))return;let n=[...i.getValue(t)],s=e[t];for(let o=0;o<n.length;++o){let a=n[o],l=s[o];a!==l&&r.push({change:c=>{n[o]=et.lerp(a,l,c),i.setValue("steps",n)}})}}function yz(i,e,t="colors",r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=e[t];for(let o=0;o<n.length;++o){let a=n[o].toArray(),l=s[o];Mu.isEqual(a,l)||r.push({change:c=>{n[o].fromArray(Mu.lerp(a,l,c))}})}}function vz(i,e,t="texture",r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue("texture"),s=e[t],o=n.repeat.toArray(),a=n.offset.toArray(),l=s.repeat,c=s.offset;(!ls.isEqual(o,l)||!ls.isEqual(a,c))&&r.push({change:u=>{n.repeat.fromArray(ls.lerp(o,l,u)),n.offset.fromArray(ls.lerp(a,c,u)),n.updateMatrix(),n.needsUpdate=!0}})}function HA(i,e,t,r){if(r===0)return t.copy(i);if(r===1)return t.copy(e);let n=i.w*e.w+i.x*e.x+i.y*e.y+i.z*e.z;if(n>=1)return t.copy(i);let s=1-n*n;if(s<=Number.EPSILON){let u=1-r;return t.w=u*i.w+r*e.w,t.x=u*i.x+r*e.x,t.y=u*i.y+r*e.y,t.z=u*i.z+r*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,n),l=Math.sin((1-r)*a)/o,c=Math.sin(r*a)/o;return t.w=i.w*l+e.w*c,t.x=i.x*l+e.x*c,t.y=i.y*l+e.y*c,t.z=i.z*l+e.z*c,t}function WA(i,e,t=0){let r=Array.isArray(i.material)?i.material[t]:i.material,n;return"materials"in e?n=e.materials[t]:"material"in e&&(n=e.material),[r,n]}var qv=new A,Xv=new A,jA=new Ut,xz=new pn,bz=new Ee;function qA(i,e,t,r){if(t.position!==void 0){let n=i.position.toArray(),s=t.position;vr.isEqual(n,s)||r.push({change:o=>{i.position.fromArray(vr.lerp(n,s,o)),i.updateMatrix()}})}if(t.scale!==void 0){let n=i.scale.toArray(),s=t.scale;vr.isEqual(n,s)||r.push({change:o=>{i.scale.fromArray(vr.lerp(n,s,o)),i.updateMatrix()}})}wz(i,e,t,r),Sz(i,t,r)}function wz(i,e,t,r){if(t.rotation===void 0)return;let n=qv.setFromEuler(i.rotation).toArray(),s=t.rotation;if(vr.isEqual(n,s))return;if(vr.sub(t.rotation,e?e.rotation:i.rotation).every(a=>Math.abs(a)<2*Math.PI)){let a=i.quaternion.clone(),l=new Ut().setFromEuler(xz.set(t.rotation[0],t.rotation[1],t.rotation[2]));r.push({change:c=>{HA(a,l,i.quaternion,c),i.updateMatrix()}})}else r.push({change:a=>{i.rotation.setFromVector3(Xv.fromArray(vr.lerp(n,s,a))),i.updateMatrix()}})}function Sz(i,e,t){if(e.hiddenMatrix!==void 0&&!_i.isEqual(i.hiddenMatrix.toArray(),e.hiddenMatrix)){let r=new A,n=new Ut,s=new A;i.hiddenMatrix.decompose(r,n,s);let o=new A,a=new Ut,l=new A;bz.fromArray(e.hiddenMatrix).decompose(o,a,l),t.push({change:c=>{jA.slerpQuaternions(n,a,c),qv.lerpVectors(r,o,c),Xv.lerpVectors(s,l,c),i.hiddenMatrix.compose(qv,jA,Xv)}})}}function XA(i,e,t,r){let n=[];if(qA(i,e==null?void 0:e.objectState,t.objectState,n),El(i)){if("geometry"in t.objectState&&GA(i,t.objectState.geometry,n),"material"in t.objectState||"materials"in t.objectState){let[s,o]=WA(i,t.objectState,i.selectedMaterial);s&&o&&typeof o!="string"&&VA(s,o,n,r)}}else m1(i)?kA(i,t.objectState,n,r):p1(i)&&zA(i,t.objectState,n);return{change:s=>{n.forEach(o=>{o.change&&o.change(s)})}}}var Zp=class{constructor(e,t){this.object=e;this.sharedAssets=t;this.uuid=et.generateUUID();this.states=[];this.events={};this._scrollCounter=null}get animation(){return this._animation}start(){this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._scrollCounter=null),this.states.length>1&&(this.states[0].execute(this.object,this.sharedAssets),this._currentState=this.states[0],this._prevState=void 0)}end(){this._animation!==void 0&&(this._animation.pause(),this._animation=void 0),this.states.length>1&&this.states[0].execute(this.object,this.sharedAssets),this._currentState=void 0,this._prevState=void 0}play(e,t){this.object.visible&&e.state!==void 0&&this.animate(e.state,e,!0,t)}reverse(e,t){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e,!0,t)}seek(e,t,r,n){var s;this._scrollCounter===null&&(this.object.visible&&e.state!==void 0&&this.animate(e.state,e,!1,n),this._scrollCounter=0),this._scrollCounter+=t,this._scrollCounter=Math.min(Math.max(this._scrollCounter,0),r),(s=this._animation)==null||s.seek(this._scrollCounter/r*e.duration)}animate(e,t,r=!0,n){var s,o,a,l,c,u;if(this._currentState===e){if((s=this._animation)!=null&&s.reversed){let h=(a=(o=this._animation)==null?void 0:o.currentTime)!=null?a:0;(l=this._animation)==null||l.reset(),(c=this._animation)==null||c.seek(h),(u=this._animation)==null||u.play()}}else{this._prevState=this._currentState,this._currentState=e,this._animation!==void 0&&this._animation.pause(),t.cycle===!0&&t.repeat===!0?this._animation=mh.timeline({duration:t.duration,delay:t.delay/2,endDelay:t.delay/2,direction:"alternate",loop:!0,rewind:t.rewind,easing:gh(t.easing,t.cubicControls,t.springParameters),autoplay:r}):t.cycle===!0&&t.repeat===!1?this._animation=mh.timeline({duration:t.duration,delay:t.delay,endDelay:t.delay/2,direction:"alternate",rewind:t.rewind,easing:gh(t.easing,t.cubicControls,t.springParameters),autoplay:r}):t.cycle===!1&&t.repeat===!0?this._animation=mh.timeline({duration:t.duration,delay:t.delay,direction:"normal",loop:!0,easing:gh(t.easing,t.cubicControls,t.springParameters),autoplay:r}):this._animation=mh.timeline({duration:t.duration,delay:t.delay,direction:"normal",easing:gh(t.easing,t.cubicControls,t.springParameters),autoplay:r}),r&&this._animation.finished.then(()=>{this._animation=void 0});let h=XA(this.object,this._prevState,this._currentState,this.sharedAssets),f={t:0};this._animation.add({targets:f,t:1,change:()=>{var d;h.change&&(h.change(f.t),(d=n==null?void 0:n.change)==null||d.call(this,f.t))}},0)}}emitEvent(e){if(e==="keyDown"||e==="keyUp"||e==="mouseDown"||e==="mouseUp"||e==="mouseHover"||e==="scroll"||e==="start"){let t=this.events[e];if(t)for(let r of t)r.targets.forEach(n=>this.play(n))}}emitEventReverse(e){if(e==="keyDown"||e==="keyUp"||e==="mouseDown"||e==="mouseUp"||e==="mouseHover"||e==="scroll"||e==="start"){let t=this.events[e];if(t)for(let r of t)r.targets.forEach(n=>this.reverse(n))}}};var sc=class{constructor(e){this.targetState=e}static create(e,t){var n;let r=new sc(e);if(e.object){let s=t.find(e.object);if(r.object=s,s!=null&&s.interaction){let o=s.interaction.states;r.state=e.state&&(n=o.find(a=>a.uuid===e.state))!=null?n:o[0]}}return r}get cubicControls(){let e=this.targetState;return e.easing===5?{control1:e.control1,control2:e.control2}:se({},Rd.defaultData)}get springParameters(){let e=this.targetState;return e.easing===6?e:se({},Id.defaultData)}get easing(){return this.targetState.easing}get duration(){return this.targetState.duration}get delay(){return this.targetState.delay}get repeat(){return this.targetState.repeat}get cycle(){return this.targetState.cycle}get rewind(){return this.targetState.rewind}};var YA=new qr,Ko=class extends Vr{},$p=class{constructor(e){this.materials={};this.images={};this.colors={};this.transmissionRenderTarget=new mt(2048,2048,{generateMipmaps:!0,minFilter:Gs,magFilter:ct,wrapS:_r,wrapT:_r}),this.transmissionRenderTarget.depthTexture=new si(2048,2048),this.reset(e)}reset(e){for(let[t,r]of Object.entries(e.images))this.addImage(t,r.data);for(let[t,r]of Object.entries(e.colors))this.addColor(t,r);for(let[t,r]of Object.entries(e.materials))this.addMaterial(t,mv(r,this))}get transmissionSamplerMap(){return this.transmissionRenderTarget.texture}get transmissionDepthMap(){return this.transmissionRenderTarget.depthTexture}addMaterial(e,t){t.uuid=e,this.materials[e]=t}deleteMaterial(e){this.materials[e]&&(this.materials[e].dispose(),delete this.materials[e])}isSharedMaterial(e){return e.uuid in this.materials||e===YA}getMaterial(e){let t=this.materials[e];return t}getMaterialOrDeletedPlaceholder(e){var t;return(t=this.materials[e])!=null?t:YA}getMaterials(){return this.materials}addImage(e,t){if(this.images[e])return this.images[e].onload=()=>{this.onImageLoad&&this.onImageLoad(e)},this.images[e].src=t,!0;{let r=new Image;return r.src=t,r.onload=()=>{this.onImageLoad&&this.onImageLoad(e)},this.images[e]=r,!1}}deleteImage(e){this.images[e]&&delete this.images[e]}getDefaultImage(){return this.images.image_0}getImage(e){return this.images[e]}getImages(){return this.images}addColor(e,t){return this.colors[e]?("a"in t?this.colors[e].setRGBA(t.r,t.g,t.b,t.a):this.colors[e].setRGBA(t.r,t.g,t.b,1),!0):("a"in t?this.colors[e]=new Ko(t.r,t.g,t.b,t.a):this.colors[e]=new Ko(t.r,t.g,t.b,1),!1)}updateColor(e,t){var r,n,s,o;if(this.colors[e]){let a=this.colors[e];return this.colors[e].r=(r=t.r)!=null?r:a.r,this.colors[e].g=(n=t.g)!=null?n:a.g,this.colors[e].b=(s=t.b)!=null?s:a.b,this.colors[e].a=(o=t.a)!=null?o:a.a,!0}return!1}deleteColor(e){this.colors[e]&&delete this.colors[e]}getColor(e){return this.colors[e]}dispose(){Object.keys(this.materials).forEach(t=>this.deleteMaterial(t)),this.transmissionRenderTarget.depthTexture.dispose(),this.transmissionRenderTarget.dispose(),this.onImageLoad=void 0}};function Mz(i,e){switch(i.type){case"noise":return e==="noiseType";case"texture":return e==="projection"||e==="axis";case"displace":return e==="noiseType";case"depth":return e==="num"||e==="smooth"||e==="isWorldSpace"||e==="gradientType";default:return!1}}function Yv(i,e,t,r,n){var o;let s=!1;for(let[a,l]of Object.entries(i)){if(!a||l===void 0||Bp(a,t,n))continue;t.visible=n.visible;let c=t.uniforms[`f${t.id}_${a}`];if(!!c)switch(c.constructor){case Rt:if(typeof l=="string"){let u=e.getColor(l);u&&(c.value=u);break}else{let u=l;c.value instanceof Ko?c.value=new Vr(u.r,u.g,u.b,u.a):c.setRGBA(u);break}case ci:if(typeof l=="string"){let u=e.getColor(l);u&&(c.value=u);break}else{let u=l;c.value instanceof Ko?c.value=new Vr(u.r,u.g,u.b,u.a):c.value.setRGBA(u.r,u.g,u.b,u.a);break}case Pr:{let u=l;c.value.setX(u[0]),c.value.setY(u[1]);break}case Ir:{let u=l;c.value.setX(u[0]),c.value.setY(u[1]),c.value.setZ(u[2]);break}case Wr:{let u=l;if("image"in u){let h=e.getImage(u.image);if(h)c.value.image=h;else{let f=new Image;f.src=u.image.data,c.value.image=f}}"wrapping"in u&&(c.value.wrapS=c.value.wrapT=u.wrapping),"repeat"in u&&c.value.repeat.fromArray(u.repeat),"offset"in u&&c.value.offset.fromArray(u.offset),c.value.needsUpdate=!0;break}case hs:{l.forEach((u,h)=>{c.value[h].setX(u[0]),c.value[h].setY(u[1]),c.value[h].setZ(u[2]),c.value[h].setW(u[3])});break}default:{s=s||Mz(t,a),c.value=l;break}}}if(s&&n){let a=Rp({id:"0",fi:0,data:n},e);(o=r.userData.layers)==null||o.changeLayer(t.id,se({},a)),r.dispose(),r.needsUpdate=!0}}var Jv=new A,JA=new Fr,QA=new Ee,ac={type:"follow",normal:new A,raycaster:new $s},oc;(t=>{function i(r){if(r.type===10)return{type:"follow"}}t.create=i;function e({target:r,normal:n,raycaster:s,begin:o,change:a}){!r||!r.interaction||!n||!s||(o&&o("follow",r.uuid),JA.setFromNormalAndCoplanarPoint(n,r.getWorldPosition(Jv)),s.ray.intersectPlane(JA,Jv),r.position.copy(Jv),r.parent!==null&&r.position.applyMatrix4(QA.copy(r.parent.matrixWorld).invert()),r.position.applyMatrix4(QA.copy(r.hiddenMatrix).invert()),r.updateMatrix(),a&&a())}t.listener=e})(oc||(oc={}));var em={type:"keyDown"},tm={type:"keyUp"},lc;(t=>{function i(r){if(r.type===5&&r.key)return{type:"keyDown",targets:[],key:r.key}}t.create=i;function e({target:r,begin:n,change:s,domEvent:o}){if(!r||!r.interaction||!o)return;let a=r.interaction.events.keyDown;if(!(a!=null&&a.length))return;let l=!1;for(let c of a)c.key===o.key&&(c.targets.forEach(u=>{var h,f;return(f=(h=u.object)==null?void 0:h.interaction)==null?void 0:f.play(u,{change:s})}),l=!0);l&&n&&n("keyDown",r.uuid)}t.listener=e})(lc||(lc={}));var cc;(t=>{function i(r){if(!(r.type!==6||!r.key))return{type:"keyUp",targets:[],key:r.key}}t.create=i;function e({target:r,begin:n,change:s,domEvent:o}){if(!r||!r.interaction||!o)return;let a=r.interaction.events.keyUp;if(!(a!=null&&a.length))return;let l=!1;for(let c of a)c.key===o.key&&(c.targets.forEach(u=>{var h,f;return(f=(h=u.object)==null?void 0:h.interaction)==null?void 0:f.play(u,{change:s})}),l=!0);l&&n&&n("keyUp",r.uuid)}t.listener=e})(cc||(cc={}));var Qv=new A,KA=new Fr,hc={type:"lookAt",normal:new A,raycaster:new $s},uc;(t=>{function i(r){if(r.type===9&&r.distance)return{type:"lookAt",distance:r.distance}}t.create=i;function e({target:r,normal:n,raycaster:s,begin:o,change:a}){var u;if(!r||!r.interaction||!n||!s)return;let l=r.interaction.events.lookAt;if(!(l!=null&&l.length))return;o&&o("lookAt",r.uuid);let c=l[0].distance;KA.set(n,-c),s.ray.intersectPlane(KA,Qv),r.lookAt(Qv),r.updateMatrix(),(u=r.interaction.animation)==null||u.finished.then(()=>{r.lookAt(Qv),r.updateMatrix()}),a&&a()}t.listener=e})(uc||(uc={}));var rm={type:"mouseDown"},nm={type:"mouseUp"},fc;(t=>{function i(r){if(r.type===0)return{type:"mouseDown",targets:[]}}t.create=i;function e({target:r,begin:n,change:s}){if(!r||!r.interaction)return;let o=r.interaction.events.mouseDown;!(o!=null&&o.length)||(n&&n("mouseDown",r.uuid),o.forEach(a=>{a.targets.forEach(l=>{var c,u;return(u=(c=l.object)==null?void 0:c.interaction)==null?void 0:u.play(l,{change:s})})}))}t.listener=e})(fc||(fc={}));var dc;(t=>{function i(r){if(r.type===1)return{type:"mouseUp",targets:[]}}t.create=i;function e({target:r,begin:n,change:s}){if(!r||!r.interaction)return;let o=r.interaction.events.mouseUp;!(o!=null&&o.length)||(n&&n("mouseUp",r.uuid),o.forEach(a=>{a.targets.forEach(l=>{var c,u;return(u=(c=l.object)==null?void 0:c.interaction)==null?void 0:u.play(l,{change:s})})}))}t.listener=e})(dc||(dc={}));var Kv={type:"start"},pc;(t=>{function i(r){if(r.type===7)return{type:"start",targets:[]}}t.create=i;function e({target:r,begin:n,change:s}){if(!r||!r.interaction)return;let o=r.interaction.events.start;!(o!=null&&o.length)||(n&&n("start",r.uuid),o.forEach(a=>{a.targets.forEach(l=>{var c,u;return(u=(c=l.object)==null?void 0:c.interaction)==null?void 0:u.play(l,{change:s})})}))}t.listener=e})(pc||(pc={}));function ZA(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var An={type:"link"},mc;(t=>{function i(r){let n;if(r.type===0)n={type:"mousedown"};else if(r.type===1)n={type:"mouseup"};else if(r.type===5){if(!r.key)return;n={type:"keydown",key:r.key}}else if(r.type===6){if(!r.key)return;n={type:"keyup",key:r.key}}else return;if(r.url)return{type:"link",subEvent:n,url:r.url}}t.create=i;function e({target:r,begin:n,domEvent:s,subType:o}){var c;if(!r||!r.interaction||!o||!s)return;let a=r.interaction.events.link;if(!a)return;let l;if(o==="keydown"||o==="keyup"){let u=s.key;l=(c=a[o])==null?void 0:c.filter(h=>h.subEvent.type===o&&h.subEvent.key===u)}else l=a[o];if(!!(l!=null&&l.length)){n&&n("link",r.uuid);for(let u of l)ZA()?window.location.assign(u.url):window.open(u.url,"_blank")}}t.listener=e})(mc||(mc={}));var im={type:"scroll"},gc;(t=>{function i(r){if(!(r.type!==11||r.steps===void 0))return{type:"scroll",targets:[],steps:r.steps}}t.create=i;function e({target:r,begin:n,change:s,domEvent:o}){if(!r||!r.interaction||!o)return;let a=r.interaction.events.scroll;if(!(a!=null&&a.length))return;n&&n("scroll",r.uuid);let l=o.deltaY>0?1:-1;a.forEach(c=>{c.targets.forEach(u=>{var h,f;return(f=(h=u.object)==null?void 0:h.interaction)==null?void 0:f.seek(u,l,c.steps,{change:s})})})}t.listener=e})(gc||(gc={}));var po={type:"mouseHover"},yc;(t=>{function i(r){if(r.type===2)return{type:"mouseHover",targets:[]}}t.create=i;function e({target:r,begin:n,change:s,enter:o}){if(!r||!r.interaction||o===void 0)return;let a=r.interaction.events.mouseHover;!(a!=null&&a.length)||(n&&n("mouseHover",r.uuid),o?a.forEach(l=>{l.targets.forEach(c=>{var u,h;return(h=(u=c.object)==null?void 0:u.interaction)==null?void 0:h.play(c,{change:s})})}):a.forEach(l=>{l.targets.forEach(c=>{var u,h;return(h=(u=c.object)==null?void 0:u.interaction)==null?void 0:h.reverse(c,{change:s})})}))}t.listener=e})(yc||(yc={}));function Az(i){let e,{type:t}=i;return t===10?e=oc.create(i):t===5?e=lc.create(i):t===6?e=cc.create(i):t===9?e=uc.create(i):t===0?e=fc.create(i):t===1?e=dc.create(i):t===2?e=yc.create(i):t===11?e=gc.create(i):t===7&&(e=pc.create(i)),e}function $A(i,e,t){let r=[];i.objects.traverse((n,s)=>{var u;if(s.states===void 0)return;let o=e.find(n),a=new Zp(o,t),l=a.states;l.push(Zo.create(n,s));for(let h of s.states){let f=Du.patch(s,h.data);l.push(Zo.create(h.id,f))}let c=a.events;if(s.events)for(let{data:h}of s.events){let f=Az(h);if(!f)continue;let d=f.type;c[d]?(u=c[d])==null||u.push(f):c[d]=[f],"targets"in h&&r.push([h,f]);let m=mc.create(h);if(m){c.link||(c.link={});let p=m.subEvent.type;c.link[p]?c.link[p].push(m):c.link[p]=[m]}}l.length>0||Object.keys(c).length>0?(o.interaction=a,Zv(o,s,null,t)):delete o.interaction});for(let[n,s]of r)if("targets"in n&&"targets"in s)for(let{data:o}of n.targets){let a=sc.create(o,e);s.targets.push(a)}}function Zv(i,e,t,r,n=!1){if(!n&&e.states.length===0)return;let s=t===null?e:Du.patch(e,e.states.data(t));if(nv(i,s),i instanceof Xt&&s.type==="Mesh"){if(i instanceof lo?i.buildFromStore(s.geometry):i.updateGeometry({parameters:s.geometry}),"material"in s){if(i.material instanceof Array)return;if(typeof s.material!="string"){let a=s.material.layers;for(let l of a){let c=i.material.userData.layers.getLayerByUuid(l.id);Yv(l.data,r,c,i.material,l.data)}}}else if("materials"in s){if(!(i.material instanceof Array))return;var o=0;for(let a of s.materials){if(typeof a!="string"){let l=a.layers;for(let c of l){let u=i.material[o].userData.layers.getLayerByUuid(c.id);Yv(c.data,r,u,i.material[o],c.data)}}o++}}}else if(s.type==="DirectionalLight")i.fromDirectionalLightState(s,r);else if(s.type==="PointLight")i.fromPointLightState(s,r);else if(s.type==="SpotLight")i.fromSpotLightState(s,r);else if(i instanceof Bn&&Ys.is(s.type)){let a=s;i.setZoom("PerspectiveCamera",a.perspective.zoom),i.setZoom("OrthographicCamera",a.orthographic.zoom)}}var Zo=class{constructor(e){this.objectState=e;this.uuid=et.generateUUID()}static create(e,t){let r=new Zo(t);return r.uuid=e,r}execute(e,t){Zv(e,this.objectState,null,t,!0)}};var ps;(e=>{function i(t,r,n=!0){r.dispatchEvent(t),n&&(r==null||r.traverseAncestors(s=>{s instanceof pi&&s.dispatchEvent(t)}))}e.dispatchEvent=i})(ps||(ps={}));var Qn=new $s,mo=new A,Tz=new Qe,$v={follow:oc.listener,keyDown:lc.listener,keyUp:cc.listener,link:mc.listener,lookAt:uc.listener,mouseDown:fc.listener,mouseUp:dc.listener,mouseHover:yc.listener,scroll:gc.listener,start:pc.listener},eT={follow:ac,keyDown:em,keyUp:tm,link:An,lookAt:hc,mouseDown:rm,mouseUp:nm,mouseHover:po,scroll:im,start:Kv};function Ez(i){if(i.style.transform!==""){let e=getComputedStyle(i).getPropertyValue("transform");if(e!=="none"){let t=e.replace("matrix(","").split(",");return{x:parseFloat(t[0]),y:parseFloat(t[3])}}}return{x:1,y:1}}function tT(i,e,t,r=!1){if(e in i||(i[e]=[]),i[e].some(n=>n===t)||i[e].push(t),r&&t.objectType==="EmptyObject")for(let n of t.children)bn(n)&&n.traverseEntity(s=>{i[e].some(o=>o===s)||i[e].push(s)})}function yh(i,e){let t=[];return!e.raycastLock&&e.visible&&x1(e)&&i.intersectObject(e,!1,t),t.length?t[0]:void 0}var sm=class{constructor(e,t,r,n){this.isEnable=!1;this.splineEvents={};this._map={};this._prevObjects=[];this._onMouseDown=e=>{Qn.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent(e)};this._onMouseUp=e=>{Qn.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent(e)};this._onMouseMove=e=>{Qn.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(mo),mo.negate(),this._handleMouseHoverEvent(void 0,e),this._handleLookAtEvent(e),this._handleFollowEvent(e)};this._onWheel=e=>{this._handleWheelEvent(e)};this._onTouchStart=e=>{e.touches.length===1&&(Qn.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(mo),mo.negate(),this._handleMouseDownEvent(e),this._handleMouseHoverEvent(void 0,e),this._handleLookAtEvent(e),this._handleFollowEvent(e))};this._onTouchEnd=e=>{this._handleMouseUpEvent(e),this._handleMouseHoverEvent(!0,e)};this._onTouchMove=e=>{e.touches.length===1&&(Qn.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(mo),mo.negate(),this._handleMouseHoverEvent(void 0,e),this._handleLookAtEvent(e),this._handleFollowEvent(e))};this._onKeyDown=e=>{this._handleKeyDownEvent(e)};this._onKeyUp=e=>{this._handleKeyUpEvent(e)};this._renderer=e,this._domElement=e.domElement,this._camera=r,this._scene=t,this._app=n}activate(){var e,t,r,n,s,o,a,l,c,u,h,f,d,m,p,g,y;this.isEnable=!0,this._map={},this._scene.traverseEntity(v=>{v.interaction!==void 0&&(v.interaction.start(),Object.keys(v.interaction.events).forEach(x=>{let w=x;this._addDOMCustomEvent(w,v),this._addSPEEvent(w,$v[w],v)}))}),(((e=this._map.mouseDown)==null?void 0:e.length)||((r=(t=this._map.link)==null?void 0:t.mousedown)==null?void 0:r.length))&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),(((n=this._map.mouseUp)==null?void 0:n.length)||((o=(s=this._map.link)==null?void 0:s.mouseup)==null?void 0:o.length))&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(a=this._map.scroll)!=null&&a.length&&this._domElement.addEventListener("wheel",this._onWheel,!1),(((l=this._map.mouseHover)==null?void 0:l.length)||((c=this._map.lookAt)==null?void 0:c.length)||((u=this._map.follow)==null?void 0:u.length))&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),(((h=this._map.keyDown)==null?void 0:h.length)||((d=(f=this._map.link)==null?void 0:f.keydown)==null?void 0:d.length))&&document.addEventListener("keydown",this._onKeyDown,!1),(((m=this._map.keyUp)==null?void 0:m.length)||((g=(p=this._map.link)==null?void 0:p.keyup)==null?void 0:g.length))&&document.addEventListener("keyup",this._onKeyUp,!1),(y=this._map.start)!=null&&y.length&&this._handleStartEvent()}deactivate(){this._scene.traverseEntity(e=>{if(!e.interaction)return;e.interaction.end();let t=e;Object.keys($v).forEach(r=>{let n=r;t.removeEventListener(n,$v[n])})}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),this._domElement.removeEventListener("wheel",this._onWheel),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{var t;(t=e.interaction)==null||t.start()}),this._handleStartEvent()}_getPointer(e,t){let r=this._domElement.getBoundingClientRect(),n=this._renderer.getViewport(Tz),s=Ez(this._domElement),o=n.x*s.x,a=n.y*s.y,l=n.z*s.x,c=n.w*s.y,u=r.height-c,h=(e-o-r.left)*(r.width/l),f=(t-u+a-r.top)*(r.height/c);return{x:h/r.width*2-1,y:-(f/r.height)*2+1}}_handleStartEvent(){var e;(e=this._map.start)==null||e.forEach(t=>t.dispatchEvent(Kv))}_handleWheelEvent(e){var t;(t=this._map.scroll)!=null&&t.length&&(im.domEvent=e,this._map.scroll.forEach(r=>r.dispatchEvent(im)))}_handleMouseDownEvent(e){var t,r,n;(t=this._map.mouseDown)==null||t.forEach(s=>{yh(Qn,s)&&(rm.domEvent=e,ps.dispatchEvent(rm,s))}),(n=(r=this._map.link)==null?void 0:r.mousedown)==null||n.forEach(s=>{yh(Qn,s)&&(An.domEvent=e,An.subType="mousedown",ps.dispatchEvent(An,s))})}_handleMouseUpEvent(e){var t,r,n;(t=this._map.mouseUp)==null||t.forEach(s=>{yh(Qn,s)&&(nm.domEvent=e,ps.dispatchEvent(nm,s))}),(n=(r=this._map.link)==null?void 0:r.mouseup)==null||n.forEach(s=>{yh(Qn,s)&&(An.domEvent=e,An.subType="mouseup",ps.dispatchEvent(An,s))})}_handleMouseHoverEvent(e=!1,t){var n;let r=[];e||(n=this._map.mouseHover)==null||n.forEach(s=>{let o=yh(Qn,s);o&&r.push(o.object)}),this._prevObjects.length&&(po.domEvent=t,po.enter=!1,this._prevObjects.forEach(s=>{r.includes(s)||ps.dispatchEvent(po,s)})),r.length&&(po.domEvent=t,po.enter=!0,r.forEach(s=>ps.dispatchEvent(po,s,!0))),this._prevObjects=r}_handleLookAtEvent(e){var t;(t=this._map.lookAt)!=null&&t.length&&(hc.domEvent=e,hc.normal=mo,hc.raycaster=Qn,this._map.lookAt.forEach(r=>r.dispatchEvent(hc)))}_handleFollowEvent(e){this._map.follow&&(ac.domEvent=e,ac.normal=mo,ac.raycaster=Qn,this._map.follow.forEach(t=>t.dispatchEvent(ac)))}_handleKeyDownEvent(e){var t,r,n;(t=this._map.keyDown)!=null&&t.length&&(em.domEvent=e,this._map.keyDown.forEach(s=>s.dispatchEvent(em))),(n=(r=this._map.link)==null?void 0:r.keydown)!=null&&n.length&&(An.domEvent=e,An.subType="keydown",this._map.link.keydown.forEach(s=>s.dispatchEvent(An)))}_handleKeyUpEvent(e){var t,r,n;(t=this._map.keyUp)!=null&&t.length&&(tm.domEvent=e,this._map.keyUp.forEach(s=>s.dispatchEvent(tm))),(n=(r=this._map.link)==null?void 0:r.keyup)!=null&&n.length&&(An.domEvent=e,An.subType="keyup",this._map.link.keyup.forEach(s=>s.dispatchEvent(An)))}_addSPEEvent(e,t,r){var n;if(!!r.interaction){if(eT[e].begin=this._dispatchDOMCustomEvent.bind(this),eT[e].change=this._app.requestRender.bind(this),e==="link"){let s=r.interaction.events[e];if(s){let o=!1;Object.keys(s).forEach(a=>{this._map[e]||(this._map[e]={});let l=a==="mousedown"||a==="mouseup";tT(this._map[e],a,r,l),o=!0}),o&&r.addEventListener(e,t)}}else if((n=r.interaction.events[e])!=null&&n.length){r.addEventListener(e,t);let o=e==="mouseDown"||e==="mouseUp"||e==="mouseHover";tT(this._map,e,r,o)}}}_addDOMCustomEvent(e,t){if(e){let r=new CustomEvent(e,{bubbles:!0});Object.defineProperty(r,"target",{writable:!1,value:{id:t.uuid,name:t.name}}),this.splineEvents[e]?this.splineEvents[e][t.uuid]=r:this.splineEvents[e]={[t.uuid]:r}}}_dispatchDOMCustomEvent(e,t){var n;let r=(n=this.splineEvents[e])==null?void 0:n[t];r&&this._domElement.dispatchEvent(r)}};var om=class{constructor(e,t,r,n,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new B().copy(r),this._editorSize=new B().copy(n),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewportForImageExport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,r=this._editorSize.x,n=this._editorSize.y;this._aspect=e/t,this._camera.zoom*=Math.min(r/e,n/t),this._renderer.setViewport(0,0,e,t)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,r=this._editorSize.x,n=this._editorSize.y,s=0,o=0,a=e,l=t;e<r&&(s=(r-e)*.5,s=-s,a=r),t<n&&(o=(n-t)*.5,o=-o,l=n),this._aspect=a/l,this._renderer.setViewport(s,o,a,l)}updateCamera(){if(!!this._camera)if(this._camera.cameraType==="PerspectiveCamera"){let e=this._frameSize.y,t=this._editorSize.y,r=this._fov;if(e>t){let n=_z(e,1080,2160,1,15)/100;r*=e/t,r*=1-n}this._camera.aspect=this._aspect,this._camera.fov=r,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function _z(i,e,t,r,n){return(i-e)/(t-e)*(n-r)+r}var am=class{constructor(e){this.sharedAssets=new $p(e.shared),this.scene=new jp(e.scene,this.sharedAssets),this.scene.switchActiveCamera(this.scene.activeCamera)}reset(e,t){this.scene.clearScene(this.sharedAssets),this.sharedAssets.reset(e.shared),this.scene.resetAfterClear(e.scene,this.sharedAssets)}dispose(){this.scene.dispose()}};var lm=class{constructor({x:e=10,y:t=10}){this._startTime=0;let r=document.getElementById("spe-perfs");r?this.element=r:(this.element=document.createElement("div"),document.body.appendChild(this.element),this.element.style.position="absolute",this.element.style.zIndex="10000",this.element.style.fontFamily="monospace",this.element.style.background="black",this.element.style.color="white",this.element.style.padding="10px",this.element.style.opacity="0.5",this.element.style.fontSize="11px",this.element.setAttribute("id","spe-perfs")),this.element.style.left=`${e}px`,this.element.style.top=`${t}px`}dispose(){var e;(e=this.element.parentElement)==null||e.removeChild(this.element)}start(){this._startTime=performance.now()}end(){let t=performance.now()-this._startTime;this.element.innerHTML=t.toFixed(3)+" ms"}};function Cz(i){let e;if(!!i.index)for(let t=0;t<i.index.array.length;t+=3)e=i.index.array[t],i.index.array[t]=i.index.array[t+2],i.index.array[t+2]=e}function ex(i){return i==="SubdivObject"||i==="NonParametric"?i:"Mesh"}function Lz(i,e){let t={};return i.traverseEntity(r=>{var c;if(r.type!=="Mesh"||!("material"in r)||!r.visible||!(r instanceof Xt)||Array.isArray(r.material)||r&&r.interaction&&r.interaction.states.length>0)return;let n=r.parent;for(;n;){if(n instanceof Xt&&n.interaction&&n.interaction.states.length>1)return;n=n.parent}let s=r.material.uuid,o=e.shared.materials[s];if(o){if(!Ri.isMergable(o))return}else{let u=(c=e.scene.objects.get(r.uuid))==null?void 0:c.data;if(u&&"material"in u&&typeof u.material!="string"){if(!Ri.isMergable(u.material))return;s=Ri.getHash(u.material)}}t[s]||(t[s]={});let l=t[s][ex(r.objectType)];if(l){if(l.push(r),r.cloner)for(let u of r.cloner.children)l.push(u)}else if(t[s][ex(r.objectType)]=[r],r.cloner)for(let u of r.cloner.children)t[s][ex(r.objectType)].push(u)}),t}function Dz(i){let e=0;return Object.values(i).forEach(t=>{Object.values(t).forEach(r=>{let n=r.length;n>e&&(e=n)})}),e}function rT(i,e){let t=Lz(e,i),r=Dz(t),n=new Array(r),s=0,o=new Array(r),a=0,l=new Array(r),c=0,u=new Array(r),h=0;for(let f of Object.values(t))for(let d of Object.values(f)){if(a=0,c=0,d.forEach(p=>{p instanceof Xt&&(o[a++]=p.geometry.clone(),l[c++]=p)}),c<2)continue;for(let p=0;p<c;p++)l[p].updateWorldMatrix(!0,!1),o[p].applyMatrix4(l[p].matrixWorld),l[p].matrixWorld.determinant()<0&&Cz(o[p]);let m=gM(o.slice(0,a),!1);if(m){let p;switch(d[0].objectType){case"SubdivObject":{console.warn("Turning subdiv object into mesh"),p=new Gt(m,l[0].material);break}default:{p=new Gt(m,l[0].material);break}}p.castShadow=l[0].castShadow,p.receiveShadow=l[0].receiveShadow,e.add(p);let g=y=>{h=0;for(let v of y)v.children&&g(v.children),v instanceof Xt&&(Array.isArray(v.material)||t[v.material.uuid]&&t[v.material.uuid][v.objectType]&&t[v.material.uuid][v.objectType].length>1||(u[h++]=v));for(let v=0;v<h;v++)e.attach(u[v])};for(let y=0;y<c;y++){let v=l[y];g(v.children),n[s++]=v}}}for(let f=0;f<s;f++)n[f].removeFromParent()}var vc=".",vh=Symbol("target"),tx=Symbol("unsubscribe");function xh(i){return i instanceof Date||i instanceof Set||i instanceof Map||i instanceof WeakSet||i instanceof WeakMap||ArrayBuffer.isView(i)}function nT(i){return(typeof i=="object"?i===null:typeof i!="function")||i instanceof RegExp}var Nn=Array.isArray;function $o(i){return typeof i=="symbol"}var Pz={after:(i,e)=>Nn(i)?i.slice(e.length):e===""?i:i.slice(e.length+1),concat:(i,e)=>Nn(i)?(i=[...i],e&&i.push(e),i):e&&e.toString!==void 0?(i!==""&&(i+=vc),$o(e)?i+e.toString():i+e):i,initial:i=>{if(Nn(i))return i.slice(0,-1);if(i==="")return i;let e=i.lastIndexOf(vc);return e===-1?"":i.slice(0,e)},last:i=>{if(Nn(i))return i[i.length-1]||"";if(i==="")return i;let e=i.lastIndexOf(vc);return e===-1?i:i.slice(e+1)},walk:(i,e)=>{if(Nn(i))for(let t of i)e(t);else if(i!==""){let t=0,r=i.indexOf(vc);if(r===-1)e(i);else for(;t<i.length;)r===-1&&(r=i.length),e(i.slice(t,r)),t=r+1,r=i.indexOf(vc,t)}},get(i,e){return this.walk(e,t=>{i&&(i=i[t])}),i}},dn=Pz;function rx(i){return typeof i=="object"&&typeof i.next=="function"}function nx(i,e,t,r,n){let s=i.next;if(e.name==="entries")i.next=function(){let o=s.call(this);return o.done===!1&&(o.value[0]=n(o.value[0],e,o.value[0],r),o.value[1]=n(o.value[1],e,o.value[0],r)),o};else if(e.name==="values"){let o=t[vh].keys();i.next=function(){let a=s.call(this);return a.done===!1&&(a.value=n(a.value,e,o.next().value,r)),a}}else i.next=function(){let o=s.call(this);return o.done===!1&&(o.value=n(o.value,e,o.value,r)),o};return i}function cm(i,e,t){return i.isUnsubscribed||e.ignoreSymbols&&$o(t)||e.ignoreUnderscores&&t.charAt(0)==="_"||"ignoreKeys"in e&&e.ignoreKeys.includes(t)}var bh=class{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return this._descriptorCache===void 0&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){let t=this._getDescriptorCache(),r=t.get(e);return r===void 0&&(r={},t.set(e,r)),r}_getOwnPropertyDescriptor(e,t){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,t);let r=this._getProperties(e),n=r[t];return n===void 0&&(n=Reflect.getOwnPropertyDescriptor(e,t),r[t]=n),n}getProxy(e,t,r,n){if(this.isUnsubscribed)return e;let s=e[n],o=s||e;this._pathCache.set(o,t);let a=this._proxyCache.get(o);return a===void 0&&(a=s===void 0?new Proxy(e,r):e,this._proxyCache.set(o,a)),a}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,t){return!Object.is(e,dn.get(t,this.getPath(e)))}defineProperty(e,t,r){return Reflect.defineProperty(e,t,r)?(this.isUnsubscribed||(this._getProperties(e)[t]=r),!0):!1}setProperty(e,t,r,n,s){if(!this._equals(s,r)||!(t in e)){let o=this._getOwnPropertyDescriptor(e,t);return o!==void 0&&"set"in o?Reflect.set(e,t,r,n):Reflect.set(e,t,r)}return!0}deleteProperty(e,t,r){if(Reflect.deleteProperty(e,t)){if(!this.isUnsubscribed){let n=this._getDescriptorCache().get(e);n&&(delete n[t],this._pathCache.delete(r))}return!0}return!1}isSameDescriptor(e,t,r){let n=this._getOwnPropertyDescriptor(t,r);return e!==void 0&&n!==void 0&&Object.is(e.value,n.value)&&(e.writable||!1)===(n.writable||!1)&&(e.enumerable||!1)===(n.enumerable||!1)&&(e.configurable||!1)===(n.configurable||!1)&&e.get===n.get&&e.set===n.set}isGetInvariant(e,t){let r=this._getOwnPropertyDescriptor(e,t);return r!==void 0&&r.configurable!==!0&&r.writable!==!0}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}};function xc(i){return toString.call(i)==="[object Object]"}function bc(){return!0}function go(i,e){return i.length!==e.length||i.some((t,r)=>e[r]!==t)}var um=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]);var Iz=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),ix={push:bc,pop:bc,shift:bc,unshift:bc,copyWithin:go,reverse:go,sort:go,splice:go,flat:go,fill:go},iT=new Set([...um,...Iz,...Object.keys(ix)]);function wc(i,e){if(i.size!==e.size)return!0;for(let t of i)if(!e.has(t))return!0;return!1}var sx=["keys","values","entries"],ox=new Set(["has","toString"]),ax={add:wc,clear:wc,delete:wc,forEach:wc},sT=new Set([...ox,...Object.keys(ax),...sx]);function Sc(i,e){if(i.size!==e.size)return!0;let t;for(let[r,n]of i)if(t=e.get(r),t!==n||t===void 0&&!e.has(r))return!0;return!1}var Rz=new Set([...ox,"get"]),lx={set:Sc,clear:Sc,delete:Sc,forEach:Sc},oT=new Set([...Rz,...Object.keys(lx),...sx]);var Br=class{constructor(e,t,r,n){this._path=t,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=n,this._changes=n?[]:null,this.clone=t===void 0?e:this._shallowClone(e)}static isHandledMethod(e){return um.has(e)}_shallowClone(e){let t=e;if(xc(e))t=se({},e);else if(Nn(e))t=[...e];else if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set([...e].map(r=>this._shallowClone(r)));else if(e instanceof Map){t=new Map;for(let[r,n]of e.entries())t.set(r,this._shallowClone(n))}return this._clonedCache.add(t),t}preferredThisArg(e,t,r,n){return e?(Nn(n)?this._onIsChanged=ix[t]:n instanceof Set?this._onIsChanged=ax[t]:n instanceof Map&&(this._onIsChanged=lx[t]),n):r}update(e,t,r){let n=dn.after(e,this._path);if(t!=="length"){let s=this.clone;dn.walk(n,o=>{s&&s[o]&&(this._clonedCache.has(s[o])||(s[o]=this._shallowClone(s[o])),s=s[o])}),this._hasOnValidate&&this._changes.push({path:n,property:t,previous:r}),s&&s[t]&&(s[t]=r)}this._isChanged=!0}undo(e){let t;for(let r=this._changes.length-1;r!==-1;r--)t=this._changes[r],dn.get(e,t.path)[t.property]=t.previous}isChanged(e){return this._onIsChanged===void 0?this._isChanged:this._onIsChanged(this.clone,e)}};var Mc=class extends Br{static isHandledMethod(e){return iT.has(e)}};var wh=class extends Br{undo(e){e.setTime(this.clone.getTime())}isChanged(e,t){return!t(this.clone.valueOf(),e.valueOf())}};var Ac=class extends Br{static isHandledMethod(e){return sT.has(e)}undo(e){for(let t of this.clone)e.add(t);for(let t of e)this.clone.has(t)||e.delete(t)}};var Tc=class extends Br{static isHandledMethod(e){return oT.has(e)}undo(e){for(let[t,r]of this.clone.entries())e.set(t,r);for(let t of e.keys())this.clone.has(t)||e.delete(t)}};var Sh=class extends Br{constructor(e,t,r,n){super(void 0,t,r,n),this._arg1=r[0],this._weakValue=e.has(this._arg1)}isChanged(e){return this._weakValue!==e.has(this._arg1)}undo(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}};var Mh=class extends Br{constructor(e,t,r,n){super(void 0,t,r,n),this._weakKey=r[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){let t=e.has(this._weakKey);this._weakHas&&!t?e.set(this._weakKey,this._weakValue):!this._weakHas&&t?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}};var vi=class{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return xc(e)||Nn(e)||xh(e)}static isHandledMethod(e,t){return xc(e)?Br.isHandledMethod(t):Nn(e)?Mc.isHandledMethod(t):e instanceof Set?Ac.isHandledMethod(t):e instanceof Map?Tc.isHandledMethod(t):xh(e)}get isCloning(){return this._stack.length>0}start(e,t,r){let n=Br;Nn(e)?n=Mc:e instanceof Date?n=wh:e instanceof Set?n=Ac:e instanceof Map?n=Tc:e instanceof WeakSet?n=Sh:e instanceof WeakMap&&(n=Mh),this._stack.push(new n(e,t,r,this._hasOnValidate))}update(e,t,r){this._stack[this._stack.length-1].update(e,t,r)}preferredThisArg(e,t,r){let{name:n}=e,s=vi.isHandledMethod(r,n);return this._stack[this._stack.length-1].preferredThisArg(s,n,t,r)}isChanged(e,t,r){return this._stack[this._stack.length-1].isChanged(e,t,r)}undo(e){this._previousClone!==void 0&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}};var Bz={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},cx=(i,e,t={})=>{t=se(se({},Bz),t);let r=Symbol("ProxyTarget"),{equals:n,isShallow:s,ignoreDetached:o,details:a}=t,l=new bh(n),c=typeof t.onValidate=="function",u=new vi(c),h=(v,x,w,b,E)=>!c||u.isCloning||t.onValidate(dn.concat(l.getPath(v),x),w,b,E)===!0,f=(v,x,w,b)=>{!cm(l,t,x)&&!(o&&l.isDetached(v,i))&&d(l.getPath(v),x,w,b)},d=(v,x,w,b,E)=>{u.isCloning?u.update(v,x,b):e(dn.concat(v,x),w,b,E)},m=v=>v&&(v[r]||v),p=(v,x,w,b)=>nT(v)||w==="constructor"||s&&!vi.isHandledMethod(x,w)||cm(l,t,w)||l.isGetInvariant(x,w)||o&&l.isDetached(x,i)?v:(b===void 0&&(b=l.getPath(x)),l.getProxy(v,dn.concat(b,w),g,r)),g={get(v,x,w){if($o(x)){if(x===r||x===vh)return v;if(x===tx&&!l.isUnsubscribed&&l.getPath(v).length===0)return l.unsubscribe(),v}let b=xh(v)?Reflect.get(v,x):Reflect.get(v,x,w);return p(b,v,x)},set(v,x,w,b){w=m(w);let E=v[r]||v,T=E[x];if(n(T,w)&&x in v)return!0;let S=h(v,x,w,T);return S&&l.setProperty(E,x,w,b,T)?(f(v,x,v[x],T),!0):!S},defineProperty(v,x,w){if(!l.isSameDescriptor(w,v,x)){let b=v[x];h(v,x,w.value,b)&&l.defineProperty(v,x,w,b)&&f(v,x,w.value,b)}return!0},deleteProperty(v,x){if(!Reflect.has(v,x))return!0;let w=Reflect.get(v,x),b=h(v,x,void 0,w);return b&&l.deleteProperty(v,x,w)?(f(v,x,void 0,w),!0):!b},apply(v,x,w){let b=x[r]||x;if(l.isUnsubscribed)return Reflect.apply(v,b,w);if((a===!1||a!==!0&&!a.includes(v.name))&&vi.isHandledType(b)){let E=dn.initial(l.getPath(v)),T=vi.isHandledMethod(b,v.name);u.start(b,E,w);let S=Reflect.apply(v,u.preferredThisArg(v,x,b),T?w.map(M=>m(M)):w),I=u.isChanged(b,n),C=u.stop();if(vi.isHandledType(S)&&T&&(x instanceof Map&&v.name==="get"&&(E=dn.concat(E,w[0])),S=l.getProxy(S,E,g)),I){let M={name:v.name,args:w,result:S},_=u.isCloning?dn.initial(E):E,R=u.isCloning?dn.last(E):"";h(dn.get(i,_),R,b,C,M)?d(_,R,b,C,M):u.undo(b)}return(x instanceof Map||x instanceof Set)&&rx(S)?nx(S,v,x,E,p):S}return Reflect.apply(v,x,w)}},y=l.getProxy(i,t.pathAsArray?[]:"",g);return e=e.bind(y),c&&(t.onValidate=t.onValidate.bind(y)),y};cx.target=i=>i&&i[vh]||i;cx.unsubscribe=i=>i[tx]||i;var ux=cx;var aT=class{constructor(e,{autoRender:t=!1}={}){this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this._proxyObjectCache=new Map;this._skipRender=!0;this.autoRender=!1;this.disposed=!1;this.requestRender=()=>{this._skipRender=!1};this.render=()=>{var e,t,r;!this._renderer||(this._rafId=requestAnimationFrame(this.render),(e=this._perfs)==null||e.start(),!(!this.autoRender&&this._skipRender)&&(this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this._skipRender=!this._controls.update():this._skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._transmissionRenderTarget&&(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3)),(t=this._scene.postprocessing)!=null&&t.enabled?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera))),(r=this._perfs)==null||r.end()))};this.resize=()=>{var e,t,r,n;!this._renderer||(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new B(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),(t=this._scene)!=null&&t.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((r=this._frameView)==null||r.updateViewport()),this._camera&&((n=this._frameView)==null||n.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()),this.requestRender())};this.canvas=e,this.autoRender=t,window.addEventListener("resize",bu(this.resize,200)),window.location.search.includes("perfs")&&(this._perfs=new lm({x:10,y:10}))}async load(e){let r=await(await fetch(e)).arrayBuffer();await this.start(r)}async start(e){var o;if(this.disposed)return;let t=await yA(e);this._publishData=t.scene.publish;let r=new am(t);if(window.location.search.includes("merge-geometries")){let a=performance.now();rT(t,r.scene);let l=performance.now();console.log("Merged geometries in ",l-a," ms")}this._scene=r.scene,this._sharedAssetsManager=r.sharedAssets,this._sharedAssetsManager.onImageLoad=()=>{this.requestRender()},$A(t.scene,this._scene,this._sharedAssetsManager),this._camera=this._scene.activeCamera;let n=Object.values(t.frames)[0];n&&(n.preset==="fullscreen"?(this._viewportMode=1,this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight):(this._viewportMode=2,this._viewportWidth=n.size[0],this._viewportHeight=n.size[1])),(o=this._scene.postprocessing)!=null&&o.enabled?(this._renderer=new Ct({canvas:this.canvas,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene}),this._scene.postprocessing.addEventListener("smaaloaded",this.requestRender)):this._renderer=new Ct({canvas:this.canvas,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._scene.needsTransmission(void 0)&&(this._transmissionRenderTarget=new mt(2048,2048,{generateMipmaps:!0,minFilter:Gs,magFilter:ct,wrapS:_r,wrapT:_r}),this._transmissionRenderTarget.depthTexture=new si(2048,2048),this._scene.needsTransmission(this._transmissionRenderTarget)),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=Jg,this._renderer.setClearColor(this._scene.bgColor,this._scene.alpha),this._frameView=new om(this._renderer,this._camera,new B(this._viewportWidth,this._viewportHeight),new B(window.innerWidth,window.innerHeight)),!0&&(this._controls=new sp(this._camera,this._renderer.domElement),this._publishData&&(this._controls.fromJSON(this._publishData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",this.requestRender),this._controls.addEventListener("start",this.requestRender)),this._playmode=new sm(this._renderer,this._scene,this._camera,this),this.resize(),this.render()}findObjectById(e){var r;let t=(r=this._scene)==null?void 0:r.getObjectByProperty("uuid",e);return this._createProxyObject(t)}findObjectByName(e){var r;let t=(r=this._scene)==null?void 0:r.getObjectByName(e);return this._createProxyObject(t)}getSplineEvents(){var e;return(e=this._playmode)==null?void 0:e.splineEvents}emitEvent(e,t){let r=this.findObjectById(t);r==null||r.emitEvent(e)}emitEventReverse(e,t){let r=this.findObjectById(t);r==null||r.emitEventReverse(e)}addEventListener(e,t){var r;(r=this._renderer)==null||r.domElement.addEventListener(e,t)}removeEventListener(e,t){var r;(r=this._renderer)==null||r.domElement.removeEventListener(e,t)}setZoom(e){var t;(t=this._controls)==null||t.zoomOut(e)}dispose(){var e,t,r,n,s,o,a;this.disposed=!0,(e=this._playmode)==null||e.deactivate(),(t=this._scene)==null||t.dispose(),this._rafId&&cancelAnimationFrame(this._rafId),this._proxyObjectCache.forEach(l=>{ux.unsubscribe(l)}),(r=this._renderer)==null||r.dispose(),(n=this._transmissionRenderTarget)==null||n.dispose(),(o=(s=this._transmissionRenderTarget)==null?void 0:s.depthTexture)==null||o.dispose(),(a=this._sharedAssetsManager)==null||a.dispose()}_createProxyObject(e){if(e==null)return;if(this._proxyObjectCache.has(e.uuid))return this._proxyObjectCache.get(e.uuid);let t={name:e.name,uuid:e.uuid,visible:e.visible,intensity:e.intensity,position:e.position,rotation:e.rotation,scale:e.scale,emitEvent(n){var s;(s=e.interaction)==null||s.emitEvent(n)},emitEventReverse(n){var s;(s=e.interaction)==null||s.emitEventReverse(n)}},r=ux(t,(n,s)=>{var a;typeof e[n]!="object"&&((a=Object.getOwnPropertyDescriptor(e,n))==null?void 0:a.writable)&&(e[n]=s),this.requestRender(),e.updateMatrix()});return this._proxyObjectCache.set(e.uuid,r),r}};Gr.FONTS_PATH="_assets/_fonts/";export{aT as Application};
|