pageflipopen 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/pageflipopen.iife.js +2 -2
- package/dist/pageflipopen.js +2 -3
- package/dist/pageflipopen.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,11 @@ A JavaScript library that renders a PDF as an interactive 3D flipbook in the bro
|
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
```bash
|
|
18
|
+
npm install pageflipopen
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or download the latest release and copy the `dist/` folder into your project.
|
|
18
22
|
|
|
19
23
|
## Quick Start
|
|
20
24
|
|
|
@@ -46982,8 +46982,8 @@ void main() {
|
|
|
46982
46982
|
this._layout = layout;
|
|
46983
46983
|
this._currentLeftPage = currentLeftPage;
|
|
46984
46984
|
this._totalPages = totalPages;
|
|
46985
|
-
const containerW = this._container.clientWidth;
|
|
46986
|
-
const containerH = this._container.clientHeight - TOOLBAR_HEIGHT;
|
|
46985
|
+
const containerW = Math.max(1, this._container.clientWidth);
|
|
46986
|
+
const containerH = Math.max(1, this._container.clientHeight - TOOLBAR_HEIGHT);
|
|
46987
46987
|
this._renderer.setSize(containerW, containerH);
|
|
46988
46988
|
const cameraZ = containerH;
|
|
46989
46989
|
const fovY = 2 * Math.atan(containerH / 2 / cameraZ) * (180 / Math.PI);
|
package/dist/pageflipopen.js
CHANGED
|
@@ -46967,8 +46967,8 @@ var Animator = class {
|
|
|
46967
46967
|
this._layout = layout;
|
|
46968
46968
|
this._currentLeftPage = currentLeftPage;
|
|
46969
46969
|
this._totalPages = totalPages;
|
|
46970
|
-
const containerW = this._container.clientWidth;
|
|
46971
|
-
const containerH = this._container.clientHeight - TOOLBAR_HEIGHT;
|
|
46970
|
+
const containerW = Math.max(1, this._container.clientWidth);
|
|
46971
|
+
const containerH = Math.max(1, this._container.clientHeight - TOOLBAR_HEIGHT);
|
|
46972
46972
|
this._renderer.setSize(containerW, containerH);
|
|
46973
46973
|
const cameraZ = containerH;
|
|
46974
46974
|
const fovY = 2 * Math.atan(containerH / 2 / cameraZ) * (180 / Math.PI);
|
|
@@ -48764,4 +48764,3 @@ gsap/CSSPlugin.js:
|
|
|
48764
48764
|
* @author: Jack Doyle, jack@greensock.com
|
|
48765
48765
|
*)
|
|
48766
48766
|
*/
|
|
48767
|
-
//# sourceMappingURL=pageflipopen.js.map
|
package/dist/pageflipopen.min.js
CHANGED
|
@@ -3847,7 +3847,7 @@ void main() {
|
|
|
3847
3847
|
|
|
3848
3848
|
}
|
|
3849
3849
|
|
|
3850
|
-
}`,Td=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){let n=new Li,s=t.properties.get(n);s.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(t){if(this.texture!==null&&this.mesh===null){let e=t.cameras[0].viewport,i=new un({vertexShader:nw,fragmentShader:sw,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new ke(new Gi(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},Cd=class extends Qn{constructor(t,e){super();let i=this,n=null,s=1,a=null,o="local-floor",l=1,h=null,c=null,u=null,d=null,f=null,p=null,m=new Td,_=e.getContextAttributes(),g=null,y=null,v=[],x=[],E=new ue,w=null,A=new di;A.layers.enable(1),A.viewport=new qe;let P=new di;P.layers.enable(2),P.viewport=new qe;let b=[A,P],S=new Ed;S.layers.enable(1),S.layers.enable(2);let I=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(G){let K=v[G];return K===void 0&&(K=new La,v[G]=K),K.getTargetRaySpace()},this.getControllerGrip=function(G){let K=v[G];return K===void 0&&(K=new La,v[G]=K),K.getGripSpace()},this.getHand=function(G){let K=v[G];return K===void 0&&(K=new La,v[G]=K),K.getHandSpace()};function F(G){let K=x.indexOf(G.inputSource);if(K===-1)return;let rt=v[K];rt!==void 0&&(rt.update(G.inputSource,G.frame,h||a),rt.dispatchEvent({type:G.type,data:G.inputSource}))}function H(){n.removeEventListener("select",F),n.removeEventListener("selectstart",F),n.removeEventListener("selectend",F),n.removeEventListener("squeeze",F),n.removeEventListener("squeezestart",F),n.removeEventListener("squeezeend",F),n.removeEventListener("end",H),n.removeEventListener("inputsourceschange",J);for(let G=0;G<v.length;G++){let K=x[G];K!==null&&(x[G]=null,v[G].disconnect(K))}I=null,B=null,m.reset(),t.setRenderTarget(g),f=null,d=null,u=null,n=null,y=null,nt.stop(),i.isPresenting=!1,t.setPixelRatio(w),t.setSize(E.width,E.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(G){s=G,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(G){o=G,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||a},this.setReferenceSpace=function(G){h=G},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u},this.getFrame=function(){return p},this.getSession=function(){return n},this.setSession=async function(G){if(n=G,n!==null){if(g=t.getRenderTarget(),n.addEventListener("select",F),n.addEventListener("selectstart",F),n.addEventListener("selectend",F),n.addEventListener("squeeze",F),n.addEventListener("squeezestart",F),n.addEventListener("squeezeend",F),n.addEventListener("end",H),n.addEventListener("inputsourceschange",J),_.xrCompatible!==!0&&await e.makeXRCompatible(),w=t.getPixelRatio(),t.getSize(E),n.renderState.layers===void 0){let K={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(n,e,K),n.updateRenderState({baseLayer:f}),t.setPixelRatio(1),t.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new Ln(f.framebufferWidth,f.framebufferHeight,{format:tn,type:In,colorSpace:t.outputColorSpace,stencilBuffer:_.stencil})}else{let K=null,rt=null,st=null;_.depth&&(st=_.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,K=_.stencil?Ir:Mr,rt=_.stencil?Pr:Ns);let mt={colorFormat:e.RGBA8,depthFormat:st,scaleFactor:s};u=new XRWebGLBinding(n,e),d=u.createProjectionLayer(mt),n.updateRenderState({layers:[d]}),t.setPixelRatio(1),t.setSize(d.textureWidth,d.textureHeight,!1),y=new Ln(d.textureWidth,d.textureHeight,{format:tn,type:In,depthTexture:new Xl(d.textureWidth,d.textureHeight,rt,void 0,void 0,void 0,void 0,void 0,void 0,K),stencilBuffer:_.stencil,colorSpace:t.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1})}y.isXRRenderTarget=!0,this.setFoveation(l),h=null,a=await n.requestReferenceSpace(o),nt.setContext(n),nt.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(n!==null)return n.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};function J(G){for(let K=0;K<G.removed.length;K++){let rt=G.removed[K],st=x.indexOf(rt);st>=0&&(x[st]=null,v[st].disconnect(rt))}for(let K=0;K<G.added.length;K++){let rt=G.added[K],st=x.indexOf(rt);if(st===-1){for(let Et=0;Et<v.length;Et++)if(Et>=x.length){x.push(rt),st=Et;break}else if(x[Et]===null){x[Et]=rt,st=Et;break}if(st===-1)break}let mt=v[st];mt&&mt.connect(rt)}}let O=new j,V=new j;function q(G,K,rt){O.setFromMatrixPosition(K.matrixWorld),V.setFromMatrixPosition(rt.matrixWorld);let st=O.distanceTo(V),mt=K.projectionMatrix.elements,Et=rt.projectionMatrix.elements,Nt=mt[14]/(mt[10]-1),Zt=mt[14]/(mt[10]+1),N=(mt[9]+1)/mt[5],le=(mt[9]-1)/mt[5],$t=(mt[8]-1)/mt[0],Ht=(Et[8]+1)/Et[0],Tt=Nt*$t,we=Nt*Ht,kt=st/(-$t+Ht),Ut=kt*-$t;K.matrixWorld.decompose(G.position,G.quaternion,G.scale),G.translateX(Ut),G.translateZ(kt),G.matrixWorld.compose(G.position,G.quaternion,G.scale),G.matrixWorldInverse.copy(G.matrixWorld).invert();let L=Nt+kt,T=Zt+kt,Z=Tt-Ut,lt=we+(st-Ut),ct=N*Zt/T*L,at=le*Zt/T*L;G.projectionMatrix.makePerspective(Z,lt,ct,at,L,T),G.projectionMatrixInverse.copy(G.projectionMatrix).invert()}function W(G,K){K===null?G.matrixWorld.copy(G.matrix):G.matrixWorld.multiplyMatrices(K.matrixWorld,G.matrix),G.matrixWorldInverse.copy(G.matrixWorld).invert()}this.updateCamera=function(G){if(n===null)return;m.texture!==null&&(G.near=m.depthNear,G.far=m.depthFar),S.near=P.near=A.near=G.near,S.far=P.far=A.far=G.far,(I!==S.near||B!==S.far)&&(n.updateRenderState({depthNear:S.near,depthFar:S.far}),I=S.near,B=S.far,A.near=I,A.far=B,P.near=I,P.far=B,A.updateProjectionMatrix(),P.updateProjectionMatrix(),G.updateProjectionMatrix());let K=G.parent,rt=S.cameras;W(S,K);for(let st=0;st<rt.length;st++)W(rt[st],K);rt.length===2?q(S,A,P):S.projectionMatrix.copy(A.projectionMatrix),Q(G,S,K)};function Q(G,K,rt){rt===null?G.matrix.copy(K.matrixWorld):(G.matrix.copy(rt.matrixWorld),G.matrix.invert(),G.matrix.multiply(K.matrixWorld)),G.matrix.decompose(G.position,G.quaternion,G.scale),G.updateMatrixWorld(!0),G.projectionMatrix.copy(K.projectionMatrix),G.projectionMatrixInverse.copy(K.projectionMatrixInverse),G.isPerspectiveCamera&&(G.fov=cd*2*Math.atan(1/G.projectionMatrix.elements[5]),G.zoom=1)}this.getCamera=function(){return S},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(G){l=G,d!==null&&(d.fixedFoveation=G),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=G)},this.hasDepthSensing=function(){return m.texture!==null},this.getDepthSensingMesh=function(){return m.getMesh(S)};let tt=null;function ht(G,K){if(c=K.getViewerPose(h||a),p=K,c!==null){let rt=c.views;f!==null&&(t.setRenderTargetFramebuffer(y,f.framebuffer),t.setRenderTarget(y));let st=!1;rt.length!==S.cameras.length&&(S.cameras.length=0,st=!0);for(let Et=0;Et<rt.length;Et++){let Nt=rt[Et],Zt=null;if(f!==null)Zt=f.getViewport(Nt);else{let le=u.getViewSubImage(d,Nt);Zt=le.viewport,Et===0&&(t.setRenderTargetTextures(y,le.colorTexture,d.ignoreDepthValues?void 0:le.depthStencilTexture),t.setRenderTarget(y))}let N=b[Et];N===void 0&&(N=new di,N.layers.enable(Et),N.viewport=new qe,b[Et]=N),N.matrix.fromArray(Nt.transform.matrix),N.matrix.decompose(N.position,N.quaternion,N.scale),N.projectionMatrix.fromArray(Nt.projectionMatrix),N.projectionMatrixInverse.copy(N.projectionMatrix).invert(),N.viewport.set(Zt.x,Zt.y,Zt.width,Zt.height),Et===0&&(S.matrix.copy(N.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),st===!0&&S.cameras.push(N)}let mt=n.enabledFeatures;if(mt&&mt.includes("depth-sensing")){let Et=u.getDepthInformation(rt[0]);Et&&Et.isValid&&Et.texture&&m.init(t,Et,n.renderState)}}for(let rt=0;rt<v.length;rt++){let st=x[rt],mt=v[rt];st!==null&&mt!==void 0&&mt.update(st,K,h||a)}tt&&tt(G,K),K.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:K}),p=null}let nt=new Wm;nt.setAnimationLoop(ht),this.setAnimationLoop=function(G){tt=G},this.dispose=function(){}}},Cs=new Dn,rw=new Ye;function aw(r,t){function e(_,g){_.matrixAutoUpdate===!0&&_.updateMatrix(),g.value.copy(_.matrix)}function i(_,g){g.color.getRGB(_.fogColor.value,Gm(r)),g.isFog?(_.fogNear.value=g.near,_.fogFar.value=g.far):g.isFogExp2&&(_.fogDensity.value=g.density)}function n(_,g,y,v,x){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(_,g):g.isMeshToonMaterial?(s(_,g),u(_,g)):g.isMeshPhongMaterial?(s(_,g),c(_,g)):g.isMeshStandardMaterial?(s(_,g),d(_,g),g.isMeshPhysicalMaterial&&f(_,g,x)):g.isMeshMatcapMaterial?(s(_,g),p(_,g)):g.isMeshDepthMaterial?s(_,g):g.isMeshDistanceMaterial?(s(_,g),m(_,g)):g.isMeshNormalMaterial?s(_,g):g.isLineBasicMaterial?(a(_,g),g.isLineDashedMaterial&&o(_,g)):g.isPointsMaterial?l(_,g,y,v):g.isSpriteMaterial?h(_,g):g.isShadowMaterial?(_.color.value.copy(g.color),_.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(_,g){_.opacity.value=g.opacity,g.color&&_.diffuse.value.copy(g.color),g.emissive&&_.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(_.map.value=g.map,e(g.map,_.mapTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,e(g.alphaMap,_.alphaMapTransform)),g.bumpMap&&(_.bumpMap.value=g.bumpMap,e(g.bumpMap,_.bumpMapTransform),_.bumpScale.value=g.bumpScale,g.side===bi&&(_.bumpScale.value*=-1)),g.normalMap&&(_.normalMap.value=g.normalMap,e(g.normalMap,_.normalMapTransform),_.normalScale.value.copy(g.normalScale),g.side===bi&&_.normalScale.value.negate()),g.displacementMap&&(_.displacementMap.value=g.displacementMap,e(g.displacementMap,_.displacementMapTransform),_.displacementScale.value=g.displacementScale,_.displacementBias.value=g.displacementBias),g.emissiveMap&&(_.emissiveMap.value=g.emissiveMap,e(g.emissiveMap,_.emissiveMapTransform)),g.specularMap&&(_.specularMap.value=g.specularMap,e(g.specularMap,_.specularMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest);let y=t.get(g),v=y.envMap,x=y.envMapRotation;v&&(_.envMap.value=v,Cs.copy(x),Cs.x*=-1,Cs.y*=-1,Cs.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(Cs.y*=-1,Cs.z*=-1),_.envMapRotation.value.setFromMatrix4(rw.makeRotationFromEuler(Cs)),_.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=g.reflectivity,_.ior.value=g.ior,_.refractionRatio.value=g.refractionRatio),g.lightMap&&(_.lightMap.value=g.lightMap,_.lightMapIntensity.value=g.lightMapIntensity,e(g.lightMap,_.lightMapTransform)),g.aoMap&&(_.aoMap.value=g.aoMap,_.aoMapIntensity.value=g.aoMapIntensity,e(g.aoMap,_.aoMapTransform))}function a(_,g){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,g.map&&(_.map.value=g.map,e(g.map,_.mapTransform))}function o(_,g){_.dashSize.value=g.dashSize,_.totalSize.value=g.dashSize+g.gapSize,_.scale.value=g.scale}function l(_,g,y,v){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,_.size.value=g.size*y,_.scale.value=v*.5,g.map&&(_.map.value=g.map,e(g.map,_.uvTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,e(g.alphaMap,_.alphaMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest)}function h(_,g){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,_.rotation.value=g.rotation,g.map&&(_.map.value=g.map,e(g.map,_.mapTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,e(g.alphaMap,_.alphaMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest)}function c(_,g){_.specular.value.copy(g.specular),_.shininess.value=Math.max(g.shininess,1e-4)}function u(_,g){g.gradientMap&&(_.gradientMap.value=g.gradientMap)}function d(_,g){_.metalness.value=g.metalness,g.metalnessMap&&(_.metalnessMap.value=g.metalnessMap,e(g.metalnessMap,_.metalnessMapTransform)),_.roughness.value=g.roughness,g.roughnessMap&&(_.roughnessMap.value=g.roughnessMap,e(g.roughnessMap,_.roughnessMapTransform)),g.envMap&&(_.envMapIntensity.value=g.envMapIntensity)}function f(_,g,y){_.ior.value=g.ior,g.sheen>0&&(_.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),_.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(_.sheenColorMap.value=g.sheenColorMap,e(g.sheenColorMap,_.sheenColorMapTransform)),g.sheenRoughnessMap&&(_.sheenRoughnessMap.value=g.sheenRoughnessMap,e(g.sheenRoughnessMap,_.sheenRoughnessMapTransform))),g.clearcoat>0&&(_.clearcoat.value=g.clearcoat,_.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(_.clearcoatMap.value=g.clearcoatMap,e(g.clearcoatMap,_.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,e(g.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(_.clearcoatNormalMap.value=g.clearcoatNormalMap,e(g.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===bi&&_.clearcoatNormalScale.value.negate())),g.dispersion>0&&(_.dispersion.value=g.dispersion),g.iridescence>0&&(_.iridescence.value=g.iridescence,_.iridescenceIOR.value=g.iridescenceIOR,_.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(_.iridescenceMap.value=g.iridescenceMap,e(g.iridescenceMap,_.iridescenceMapTransform)),g.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=g.iridescenceThicknessMap,e(g.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),g.transmission>0&&(_.transmission.value=g.transmission,_.transmissionSamplerMap.value=y.texture,_.transmissionSamplerSize.value.set(y.width,y.height),g.transmissionMap&&(_.transmissionMap.value=g.transmissionMap,e(g.transmissionMap,_.transmissionMapTransform)),_.thickness.value=g.thickness,g.thicknessMap&&(_.thicknessMap.value=g.thicknessMap,e(g.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=g.attenuationDistance,_.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(_.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(_.anisotropyMap.value=g.anisotropyMap,e(g.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=g.specularIntensity,_.specularColor.value.copy(g.specularColor),g.specularColorMap&&(_.specularColorMap.value=g.specularColorMap,e(g.specularColorMap,_.specularColorMapTransform)),g.specularIntensityMap&&(_.specularIntensityMap.value=g.specularIntensityMap,e(g.specularIntensityMap,_.specularIntensityMapTransform))}function p(_,g){g.matcap&&(_.matcap.value=g.matcap)}function m(_,g){let y=t.get(g).light;_.referencePosition.value.setFromMatrixPosition(y.matrixWorld),_.nearDistance.value=y.shadow.camera.near,_.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:n}}function ow(r,t,e,i){let n={},s={},a=[],o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,v){let x=v.program;i.uniformBlockBinding(y,x)}function h(y,v){let x=n[y.id];x===void 0&&(p(y),x=c(y),n[y.id]=x,y.addEventListener("dispose",_));let E=v.program;i.updateUBOMapping(y,E);let w=t.render.frame;s[y.id]!==w&&(d(y),s[y.id]=w)}function c(y){let v=u();y.__bindingPointIndex=v;let x=r.createBuffer(),E=y.__size,w=y.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,E,w),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,x),x}function u(){for(let y=0;y<o;y++)if(a.indexOf(y)===-1)return a.push(y),y;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(y){let v=n[y.id],x=y.uniforms,E=y.__cache;r.bindBuffer(r.UNIFORM_BUFFER,v);for(let w=0,A=x.length;w<A;w++){let P=Array.isArray(x[w])?x[w]:[x[w]];for(let b=0,S=P.length;b<S;b++){let I=P[b];if(f(I,w,b,E)===!0){let B=I.__offset,F=Array.isArray(I.value)?I.value:[I.value],H=0;for(let J=0;J<F.length;J++){let O=F[J],V=m(O);typeof O=="number"||typeof O=="boolean"?(I.__data[0]=O,r.bufferSubData(r.UNIFORM_BUFFER,B+H,I.__data)):O.isMatrix3?(I.__data[0]=O.elements[0],I.__data[1]=O.elements[1],I.__data[2]=O.elements[2],I.__data[3]=0,I.__data[4]=O.elements[3],I.__data[5]=O.elements[4],I.__data[6]=O.elements[5],I.__data[7]=0,I.__data[8]=O.elements[6],I.__data[9]=O.elements[7],I.__data[10]=O.elements[8],I.__data[11]=0):(O.toArray(I.__data,H),H+=V.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,B,I.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function f(y,v,x,E){let w=y.value,A=v+"_"+x;if(E[A]===void 0)return typeof w=="number"||typeof w=="boolean"?E[A]=w:E[A]=w.clone(),!0;{let P=E[A];if(typeof w=="number"||typeof w=="boolean"){if(P!==w)return E[A]=w,!0}else if(P.equals(w)===!1)return P.copy(w),!0}return!1}function p(y){let v=y.uniforms,x=0,E=16;for(let A=0,P=v.length;A<P;A++){let b=Array.isArray(v[A])?v[A]:[v[A]];for(let S=0,I=b.length;S<I;S++){let B=b[S],F=Array.isArray(B.value)?B.value:[B.value];for(let H=0,J=F.length;H<J;H++){let O=F[H],V=m(O),q=x%E,W=q%V.boundary,Q=q+W;x+=W,Q!==0&&E-Q<V.storage&&(x+=E-Q),B.__data=new Float32Array(V.storage/Float32Array.BYTES_PER_ELEMENT),B.__offset=x,x+=V.storage}}}let w=x%E;return w>0&&(x+=E-w),y.__size=x,y.__cache={},this}function m(y){let v={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(v.boundary=4,v.storage=4):y.isVector2?(v.boundary=8,v.storage=8):y.isVector3||y.isColor?(v.boundary=16,v.storage=12):y.isVector4?(v.boundary=16,v.storage=16):y.isMatrix3?(v.boundary=48,v.storage=48):y.isMatrix4?(v.boundary=64,v.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),v}function _(y){let v=y.target;v.removeEventListener("dispose",_);let x=a.indexOf(v.__bindingPointIndex);a.splice(x,1),r.deleteBuffer(n[v.id]),delete n[v.id],delete s[v.id]}function g(){for(let y in n)r.deleteBuffer(n[y]);a=[],n={},s={}}return{bind:l,update:h,dispose:g}}var ql=class{constructor(t={}){let{canvas:e=fv(),context:i=null,depth:n=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:h=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=t;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=a;let f=new Uint32Array(4),p=new Int32Array(4),m=null,_=null,g=[],y=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Hi,this.toneMapping=Jn,this.toneMappingExposure=1;let v=this,x=!1,E=0,w=0,A=null,P=-1,b=null,S=new qe,I=new qe,B=null,F=new ce(0),H=0,J=e.width,O=e.height,V=1,q=null,W=null,Q=new qe(0,0,J,O),tt=new qe(0,0,J,O),ht=!1,nt=new Gl,G=!1,K=!1,rt=new Ye,st=new j,mt=new qe,Et={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},Nt=!1;function Zt(){return A===null?V:1}let N=i;function le(C,U){return e.getContext(C,U)}try{let C={alpha:!0,depth:n,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:h,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Bd}`),e.addEventListener("webglcontextlost",et,!1),e.addEventListener("webglcontextrestored",it,!1),e.addEventListener("webglcontextcreationerror",pt,!1),N===null){let U="webgl2";if(N=le(U,C),N===null)throw le(U)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(C){throw console.error("THREE.WebGLRenderer: "+C.message),C}let $t,Ht,Tt,we,kt,Ut,L,T,Z,lt,ct,at,Dt,gt,St,Vt,ut,xt,Jt,Ft,Mt,zt,Xt,fe;function k(){$t=new Ab(N),$t.init(),zt=new ew(N,$t),Ht=new vb(N,$t,t,zt),Tt=new JS(N),we=new Tb(N),kt=new zS,Ut=new tw(N,$t,Tt,kt,Ht,zt,we),L=new xb(v),T=new wb(v),Z=new Nv(N),Xt=new gb(N,Z),lt=new Mb(N,Z,we,Xt),ct=new Rb(N,lt,Z,we),Jt=new Cb(N,Ht,Ut),Vt=new yb(kt),at=new BS(v,L,T,$t,Ht,Xt,Vt),Dt=new aw(v,kt),gt=new VS,St=new $S($t),xt=new mb(v,L,T,Tt,ct,d,l),ut=new ZS(v,ct,Ht),fe=new ow(N,we,Ht,Tt),Ft=new _b(N,$t,we),Mt=new Eb(N,$t,we),we.programs=at.programs,v.capabilities=Ht,v.extensions=$t,v.properties=kt,v.renderLists=gt,v.shadowMap=ut,v.state=Tt,v.info=we}k();let dt=new Cd(v,N);this.xr=dt,this.getContext=function(){return N},this.getContextAttributes=function(){return N.getContextAttributes()},this.forceContextLoss=function(){let C=$t.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){let C=$t.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return V},this.setPixelRatio=function(C){C!==void 0&&(V=C,this.setSize(J,O,!1))},this.getSize=function(C){return C.set(J,O)},this.setSize=function(C,U,X=!0){if(dt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}J=C,O=U,e.width=Math.floor(C*V),e.height=Math.floor(U*V),X===!0&&(e.style.width=C+"px",e.style.height=U+"px"),this.setViewport(0,0,C,U)},this.getDrawingBufferSize=function(C){return C.set(J*V,O*V).floor()},this.setDrawingBufferSize=function(C,U,X){J=C,O=U,V=X,e.width=Math.floor(C*X),e.height=Math.floor(U*X),this.setViewport(0,0,C,U)},this.getCurrentViewport=function(C){return C.copy(S)},this.getViewport=function(C){return C.copy(Q)},this.setViewport=function(C,U,X,$){C.isVector4?Q.set(C.x,C.y,C.z,C.w):Q.set(C,U,X,$),Tt.viewport(S.copy(Q).multiplyScalar(V).round())},this.getScissor=function(C){return C.copy(tt)},this.setScissor=function(C,U,X,$){C.isVector4?tt.set(C.x,C.y,C.z,C.w):tt.set(C,U,X,$),Tt.scissor(I.copy(tt).multiplyScalar(V).round())},this.getScissorTest=function(){return ht},this.setScissorTest=function(C){Tt.setScissorTest(ht=C)},this.setOpaqueSort=function(C){q=C},this.setTransparentSort=function(C){W=C},this.getClearColor=function(C){return C.copy(xt.getClearColor())},this.setClearColor=function(){xt.setClearColor.apply(xt,arguments)},this.getClearAlpha=function(){return xt.getClearAlpha()},this.setClearAlpha=function(){xt.setClearAlpha.apply(xt,arguments)},this.clear=function(C=!0,U=!0,X=!0){let $=0;if(C){let z=!1;if(A!==null){let ft=A.texture.format;z=ft===Xd||ft===Wd||ft===Gd}if(z){let ft=A.texture.type,yt=ft===In||ft===Ns||ft===Da||ft===Pr||ft===Hd||ft===Vd,At=xt.getClearColor(),vt=xt.getClearAlpha(),Lt=At.r,It=At.g,Ct=At.b;yt?(f[0]=Lt,f[1]=It,f[2]=Ct,f[3]=vt,N.clearBufferuiv(N.COLOR,0,f)):(p[0]=Lt,p[1]=It,p[2]=Ct,p[3]=vt,N.clearBufferiv(N.COLOR,0,p))}else $|=N.COLOR_BUFFER_BIT}U&&($|=N.DEPTH_BUFFER_BIT),X&&($|=N.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),N.clear($)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",et,!1),e.removeEventListener("webglcontextrestored",it,!1),e.removeEventListener("webglcontextcreationerror",pt,!1),gt.dispose(),St.dispose(),kt.dispose(),L.dispose(),T.dispose(),ct.dispose(),Xt.dispose(),fe.dispose(),at.dispose(),dt.dispose(),dt.removeEventListener("sessionstart",Ui),dt.removeEventListener("sessionend",us),_n.stop()};function et(C){C.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function it(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;let C=we.autoReset,U=ut.enabled,X=ut.autoUpdate,$=ut.needsUpdate,z=ut.type;k(),we.autoReset=C,ut.enabled=U,ut.autoUpdate=X,ut.needsUpdate=$,ut.type=z}function pt(C){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function Ot(C){let U=C.target;U.removeEventListener("dispose",Ot),te(U)}function te(C){Ce(C),kt.remove(C)}function Ce(C){let U=kt.get(C).programs;U!==void 0&&(U.forEach(function(X){at.releaseProgram(X)}),C.isShaderMaterial&&at.releaseShaderCache(C))}this.renderBufferDirect=function(C,U,X,$,z,ft){U===null&&(U=Et);let yt=z.isMesh&&z.matrixWorld.determinant()<0,At=Qa(C,U,X,$,z);Tt.setMaterial($,yt);let vt=X.index,Lt=1;if($.wireframe===!0){if(vt=lt.getWireframeAttribute(X),vt===void 0)return;Lt=2}let It=X.drawRange,Ct=X.attributes.position,Qt=It.start*Lt,se=(It.start+It.count)*Lt;ft!==null&&(Qt=Math.max(Qt,ft.start*Lt),se=Math.min(se,(ft.start+ft.count)*Lt)),vt!==null?(Qt=Math.max(Qt,0),se=Math.min(se,vt.count)):Ct!=null&&(Qt=Math.max(Qt,0),se=Math.min(se,Ct.count));let oe=se-Qt;if(oe<0||oe===1/0)return;Xt.setup(z,$,At,X,vt);let ti,re=Ft;if(vt!==null&&(ti=Z.get(vt),re=Mt,re.setIndex(ti)),z.isMesh)$.wireframe===!0?(Tt.setLineWidth($.wireframeLinewidth*Zt()),re.setMode(N.LINES)):re.setMode(N.TRIANGLES);else if(z.isLine){let Rt=$.linewidth;Rt===void 0&&(Rt=1),Tt.setLineWidth(Rt*Zt()),z.isLineSegments?re.setMode(N.LINES):z.isLineLoop?re.setMode(N.LINE_LOOP):re.setMode(N.LINE_STRIP)}else z.isPoints?re.setMode(N.POINTS):z.isSprite&&re.setMode(N.TRIANGLES);if(z.isBatchedMesh)if(z._multiDrawInstances!==null)re.renderMultiDrawInstances(z._multiDrawStarts,z._multiDrawCounts,z._multiDrawCount,z._multiDrawInstances);else if($t.get("WEBGL_multi_draw"))re.renderMultiDraw(z._multiDrawStarts,z._multiDrawCounts,z._multiDrawCount);else{let Rt=z._multiDrawStarts,de=z._multiDrawCounts,ee=z._multiDrawCount,li=vt?Z.get(vt).bytesPerElement:1,rn=kt.get($).currentProgram.getUniforms();for(let $e=0;$e<ee;$e++)rn.setValue(N,"_gl_DrawID",$e),re.render(Rt[$e]/li,de[$e])}else if(z.isInstancedMesh)re.renderInstances(Qt,oe,z.count);else if(X.isInstancedBufferGeometry){let Rt=X._maxInstanceCount!==void 0?X._maxInstanceCount:1/0,de=Math.min(X.instanceCount,Rt);re.renderInstances(Qt,oe,de)}else re.render(Qt,oe)};function De(C,U,X){C.transparent===!0&&C.side===Tn&&C.forceSinglePass===!1?(C.side=bi,C.needsUpdate=!0,Zs(C,U,X),C.side=en,C.needsUpdate=!0,Zs(C,U,X),C.side=Tn):Zs(C,U,X)}this.compile=function(C,U,X=null){X===null&&(X=C),_=St.get(X),_.init(U),y.push(_),X.traverseVisible(function(z){z.isLight&&z.layers.test(U.layers)&&(_.pushLight(z),z.castShadow&&_.pushShadow(z))}),C!==X&&C.traverseVisible(function(z){z.isLight&&z.layers.test(U.layers)&&(_.pushLight(z),z.castShadow&&_.pushShadow(z))}),_.setupLights();let $=new Set;return C.traverse(function(z){let ft=z.material;if(ft)if(Array.isArray(ft))for(let yt=0;yt<ft.length;yt++){let At=ft[yt];De(At,X,z),$.add(At)}else De(ft,X,z),$.add(ft)}),y.pop(),_=null,$},this.compileAsync=function(C,U,X=null){let $=this.compile(C,U,X);return new Promise(z=>{function ft(){if($.forEach(function(yt){kt.get(yt).currentProgram.isReady()&&$.delete(yt)}),$.size===0){z(C);return}setTimeout(ft,10)}$t.get("KHR_parallel_shader_compile")!==null?ft():setTimeout(ft,10)})};let ae=null;function Yi(C){ae&&ae(C)}function Ui(){_n.stop()}function us(){_n.start()}let _n=new Wm;_n.setAnimationLoop(Yi),typeof self<"u"&&_n.setContext(self),this.setAnimationLoop=function(C){ae=C,dt.setAnimationLoop(C),C===null?_n.stop():_n.start()},dt.addEventListener("sessionstart",Ui),dt.addEventListener("sessionend",us),this.render=function(C,U){if(U!==void 0&&U.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),U.parent===null&&U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),dt.enabled===!0&&dt.isPresenting===!0&&(dt.cameraAutoUpdate===!0&&dt.updateCamera(U),U=dt.getCamera()),C.isScene===!0&&C.onBeforeRender(v,C,U,A),_=St.get(C,y.length),_.init(U),y.push(_),rt.multiplyMatrices(U.projectionMatrix,U.matrixWorldInverse),nt.setFromProjectionMatrix(rt),K=this.localClippingEnabled,G=Vt.init(this.clippingPlanes,K),m=gt.get(C,g.length),m.init(),g.push(m),dt.enabled===!0&&dt.isPresenting===!0){let ft=v.xr.getDepthSensingMesh();ft!==null&&Kr(ft,U,-1/0,v.sortObjects)}Kr(C,U,0,v.sortObjects),m.finish(),v.sortObjects===!0&&m.sort(q,W),Nt=dt.enabled===!1||dt.isPresenting===!1||dt.hasDepthSensing()===!1,Nt&&xt.addToRenderList(m,C),this.info.render.frame++,G===!0&&Vt.beginShadows();let X=_.state.shadowsArray;ut.render(X,C,U),G===!0&&Vt.endShadows(),this.info.autoReset===!0&&this.info.reset();let $=m.opaque,z=m.transmissive;if(_.setupLights(),U.isArrayCamera){let ft=U.cameras;if(z.length>0)for(let yt=0,At=ft.length;yt<At;yt++){let vt=ft[yt];Ks($,z,C,vt)}Nt&&xt.render(C);for(let yt=0,At=ft.length;yt<At;yt++){let vt=ft[yt];jr(m,C,vt,vt.viewport)}}else z.length>0&&Ks($,z,C,U),Nt&&xt.render(C),jr(m,C,U);A!==null&&(Ut.updateMultisampleRenderTarget(A),Ut.updateRenderTargetMipmap(A)),C.isScene===!0&&C.onAfterRender(v,C,U),Xt.resetDefaultState(),P=-1,b=null,y.pop(),y.length>0?(_=y[y.length-1],G===!0&&Vt.setGlobalState(v.clippingPlanes,_.state.camera)):_=null,g.pop(),g.length>0?m=g[g.length-1]:m=null};function Kr(C,U,X,$){if(C.visible===!1)return;if(C.layers.test(U.layers)){if(C.isGroup)X=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(U);else if(C.isLight)_.pushLight(C),C.castShadow&&_.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||nt.intersectsSprite(C)){$&&mt.setFromMatrixPosition(C.matrixWorld).applyMatrix4(rt);let yt=ct.update(C),At=C.material;At.visible&&m.push(C,yt,At,X,mt.z,null)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||nt.intersectsObject(C))){let yt=ct.update(C),At=C.material;if($&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),mt.copy(C.boundingSphere.center)):(yt.boundingSphere===null&&yt.computeBoundingSphere(),mt.copy(yt.boundingSphere.center)),mt.applyMatrix4(C.matrixWorld).applyMatrix4(rt)),Array.isArray(At)){let vt=yt.groups;for(let Lt=0,It=vt.length;Lt<It;Lt++){let Ct=vt[Lt],Qt=At[Ct.materialIndex];Qt&&Qt.visible&&m.push(C,yt,Qt,X,mt.z,Ct)}}else At.visible&&m.push(C,yt,At,X,mt.z,null)}}let ft=C.children;for(let yt=0,At=ft.length;yt<At;yt++)Kr(ft[yt],U,X,$)}function jr(C,U,X,$){let z=C.opaque,ft=C.transmissive,yt=C.transparent;_.setupLightsView(X),G===!0&&Vt.setGlobalState(v.clippingPlanes,X),$&&Tt.viewport(S.copy($)),z.length>0&&js(z,U,X),ft.length>0&&js(ft,U,X),yt.length>0&&js(yt,U,X),Tt.buffers.depth.setTest(!0),Tt.buffers.depth.setMask(!0),Tt.buffers.color.setMask(!0),Tt.setPolygonOffset(!1)}function Ks(C,U,X,$){if((X.isScene===!0?X.overrideMaterial:null)!==null)return;_.state.transmissionRenderTarget[$.id]===void 0&&(_.state.transmissionRenderTarget[$.id]=new Ln(1,1,{generateMipmaps:!0,type:$t.has("EXT_color_buffer_half_float")||$t.has("EXT_color_buffer_float")?Fa:In,minFilter:Ds,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:he.workingColorSpace}));let ft=_.state.transmissionRenderTarget[$.id],yt=$.viewport||S;ft.setSize(yt.z,yt.w);let At=v.getRenderTarget();v.setRenderTarget(ft),v.getClearColor(F),H=v.getClearAlpha(),H<1&&v.setClearColor(16777215,.5),v.clear(),Nt&&xt.render(X);let vt=v.toneMapping;v.toneMapping=Jn;let Lt=$.viewport;if($.viewport!==void 0&&($.viewport=void 0),_.setupLightsView($),G===!0&&Vt.setGlobalState(v.clippingPlanes,$),js(C,X,$),Ut.updateMultisampleRenderTarget(ft),Ut.updateRenderTargetMipmap(ft),$t.has("WEBGL_multisampled_render_to_texture")===!1){let It=!1;for(let Ct=0,Qt=U.length;Ct<Qt;Ct++){let se=U[Ct],oe=se.object,ti=se.geometry,re=se.material,Rt=se.group;if(re.side===Tn&&oe.layers.test($.layers)){let de=re.side;re.side=bi,re.needsUpdate=!0,Zr(oe,X,$,ti,re,Rt),re.side=de,re.needsUpdate=!0,It=!0}}It===!0&&(Ut.updateMultisampleRenderTarget(ft),Ut.updateRenderTargetMipmap(ft))}v.setRenderTarget(At),v.setClearColor(F,H),Lt!==void 0&&($.viewport=Lt),v.toneMapping=vt}function js(C,U,X){let $=U.isScene===!0?U.overrideMaterial:null;for(let z=0,ft=C.length;z<ft;z++){let yt=C[z],At=yt.object,vt=yt.geometry,Lt=$===null?yt.material:$,It=yt.group;At.layers.test(X.layers)&&Zr(At,U,X,vt,Lt,It)}}function Zr(C,U,X,$,z,ft){C.onBeforeRender(v,U,X,$,z,ft),C.modelViewMatrix.multiplyMatrices(X.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),z.transparent===!0&&z.side===Tn&&z.forceSinglePass===!1?(z.side=bi,z.needsUpdate=!0,v.renderBufferDirect(X,U,$,z,C,ft),z.side=en,z.needsUpdate=!0,v.renderBufferDirect(X,U,$,z,C,ft),z.side=Tn):v.renderBufferDirect(X,U,$,z,C,ft),C.onAfterRender(v,U,X,$,z,ft)}function Zs(C,U,X){U.isScene!==!0&&(U=Et);let $=kt.get(C),z=_.state.lights,ft=_.state.shadowsArray,yt=z.state.version,At=at.getParameters(C,z.state,ft,U,X),vt=at.getProgramCacheKey(At),Lt=$.programs;$.environment=C.isMeshStandardMaterial?U.environment:null,$.fog=U.fog,$.envMap=(C.isMeshStandardMaterial?T:L).get(C.envMap||$.environment),$.envMapRotation=$.environment!==null&&C.envMap===null?U.environmentRotation:C.envMapRotation,Lt===void 0&&(C.addEventListener("dispose",Ot),Lt=new Map,$.programs=Lt);let It=Lt.get(vt);if(It!==void 0){if($.currentProgram===It&&$.lightsStateVersion===yt)return Qr(C,At),It}else At.uniforms=at.getUniforms(C),C.onBeforeCompile(At,v),It=at.acquireProgram(At,vt),Lt.set(vt,It),$.uniforms=At.uniforms;let Ct=$.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&(Ct.clippingPlanes=Vt.uniform),Qr(C,At),$.needsLights=ta(C),$.lightsStateVersion=yt,$.needsLights&&(Ct.ambientLightColor.value=z.state.ambient,Ct.lightProbe.value=z.state.probe,Ct.directionalLights.value=z.state.directional,Ct.directionalLightShadows.value=z.state.directionalShadow,Ct.spotLights.value=z.state.spot,Ct.spotLightShadows.value=z.state.spotShadow,Ct.rectAreaLights.value=z.state.rectArea,Ct.ltc_1.value=z.state.rectAreaLTC1,Ct.ltc_2.value=z.state.rectAreaLTC2,Ct.pointLights.value=z.state.point,Ct.pointLightShadows.value=z.state.pointShadow,Ct.hemisphereLights.value=z.state.hemi,Ct.directionalShadowMap.value=z.state.directionalShadowMap,Ct.directionalShadowMatrix.value=z.state.directionalShadowMatrix,Ct.spotShadowMap.value=z.state.spotShadowMap,Ct.spotLightMatrix.value=z.state.spotLightMatrix,Ct.spotLightMap.value=z.state.spotLightMap,Ct.pointShadowMap.value=z.state.pointShadowMap,Ct.pointShadowMatrix.value=z.state.pointShadowMatrix),$.currentProgram=It,$.uniformsList=null,It}function Jr(C){if(C.uniformsList===null){let U=C.currentProgram.getUniforms();C.uniformsList=Tr.seqWithValue(U.seq,C.uniforms)}return C.uniformsList}function Qr(C,U){let X=kt.get(C);X.outputColorSpace=U.outputColorSpace,X.batching=U.batching,X.batchingColor=U.batchingColor,X.instancing=U.instancing,X.instancingColor=U.instancingColor,X.instancingMorph=U.instancingMorph,X.skinning=U.skinning,X.morphTargets=U.morphTargets,X.morphNormals=U.morphNormals,X.morphColors=U.morphColors,X.morphTargetsCount=U.morphTargetsCount,X.numClippingPlanes=U.numClippingPlanes,X.numIntersection=U.numClipIntersection,X.vertexAlphas=U.vertexAlphas,X.vertexTangents=U.vertexTangents,X.toneMapping=U.toneMapping}function Qa(C,U,X,$,z){U.isScene!==!0&&(U=Et),Ut.resetTextureUnits();let ft=U.fog,yt=$.isMeshStandardMaterial?U.environment:null,At=A===null?v.outputColorSpace:A.isXRRenderTarget===!0?A.texture.colorSpace:es,vt=($.isMeshStandardMaterial?T:L).get($.envMap||yt),Lt=$.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,It=!!X.attributes.tangent&&(!!$.normalMap||$.anisotropy>0),Ct=!!X.morphAttributes.position,Qt=!!X.morphAttributes.normal,se=!!X.morphAttributes.color,oe=Jn;$.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(oe=v.toneMapping);let ti=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,re=ti!==void 0?ti.length:0,Rt=kt.get($),de=_.state.lights;if(G===!0&&(K===!0||C!==b)){let hi=C===b&&$.id===P;Vt.setState($,C,hi)}let ee=!1;$.version===Rt.__version?(Rt.needsLights&&Rt.lightsStateVersion!==de.state.version||Rt.outputColorSpace!==At||z.isBatchedMesh&&Rt.batching===!1||!z.isBatchedMesh&&Rt.batching===!0||z.isBatchedMesh&&Rt.batchingColor===!0&&z.colorTexture===null||z.isBatchedMesh&&Rt.batchingColor===!1&&z.colorTexture!==null||z.isInstancedMesh&&Rt.instancing===!1||!z.isInstancedMesh&&Rt.instancing===!0||z.isSkinnedMesh&&Rt.skinning===!1||!z.isSkinnedMesh&&Rt.skinning===!0||z.isInstancedMesh&&Rt.instancingColor===!0&&z.instanceColor===null||z.isInstancedMesh&&Rt.instancingColor===!1&&z.instanceColor!==null||z.isInstancedMesh&&Rt.instancingMorph===!0&&z.morphTexture===null||z.isInstancedMesh&&Rt.instancingMorph===!1&&z.morphTexture!==null||Rt.envMap!==vt||$.fog===!0&&Rt.fog!==ft||Rt.numClippingPlanes!==void 0&&(Rt.numClippingPlanes!==Vt.numPlanes||Rt.numIntersection!==Vt.numIntersection)||Rt.vertexAlphas!==Lt||Rt.vertexTangents!==It||Rt.morphTargets!==Ct||Rt.morphNormals!==Qt||Rt.morphColors!==se||Rt.toneMapping!==oe||Rt.morphTargetsCount!==re)&&(ee=!0):(ee=!0,Rt.__version=$.version);let li=Rt.currentProgram;ee===!0&&(li=Zs($,U,z));let rn=!1,$e=!1,ds=!1,_e=li.getUniforms(),Ge=Rt.uniforms;if(Tt.useProgram(li.program)&&(rn=!0,$e=!0,ds=!0),$.id!==P&&(P=$.id,$e=!0),rn||b!==C){_e.setValue(N,"projectionMatrix",C.projectionMatrix),_e.setValue(N,"viewMatrix",C.matrixWorldInverse);let hi=_e.map.cameraPosition;hi!==void 0&&hi.setValue(N,st.setFromMatrixPosition(C.matrixWorld)),Ht.logarithmicDepthBuffer&&_e.setValue(N,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),($.isMeshPhongMaterial||$.isMeshToonMaterial||$.isMeshLambertMaterial||$.isMeshBasicMaterial||$.isMeshStandardMaterial||$.isShaderMaterial)&&_e.setValue(N,"isOrthographic",C.isOrthographicCamera===!0),b!==C&&(b=C,$e=!0,ds=!0)}if(z.isSkinnedMesh){_e.setOptional(N,z,"bindMatrix"),_e.setOptional(N,z,"bindMatrixInverse");let hi=z.skeleton;hi&&(hi.boneTexture===null&&hi.computeBoneTexture(),_e.setValue(N,"boneTexture",hi.boneTexture,Ut))}z.isBatchedMesh&&(_e.setOptional(N,z,"batchingTexture"),_e.setValue(N,"batchingTexture",z._matricesTexture,Ut),_e.setOptional(N,z,"batchingIdTexture"),_e.setValue(N,"batchingIdTexture",z._indirectTexture,Ut),_e.setOptional(N,z,"batchingColorTexture"),z._colorsTexture!==null&&_e.setValue(N,"batchingColorTexture",z._colorsTexture,Ut));let ea=X.morphAttributes;if((ea.position!==void 0||ea.normal!==void 0||ea.color!==void 0)&&Jt.update(z,X,li),($e||Rt.receiveShadow!==z.receiveShadow)&&(Rt.receiveShadow=z.receiveShadow,_e.setValue(N,"receiveShadow",z.receiveShadow)),$.isMeshGouraudMaterial&&$.envMap!==null&&(Ge.envMap.value=vt,Ge.flipEnvMap.value=vt.isCubeTexture&&vt.isRenderTargetTexture===!1?-1:1),$.isMeshStandardMaterial&&$.envMap===null&&U.environment!==null&&(Ge.envMapIntensity.value=U.environmentIntensity),$e&&(_e.setValue(N,"toneMappingExposure",v.toneMappingExposure),Rt.needsLights&&to(Ge,ds),ft&&$.fog===!0&&Dt.refreshFogUniforms(Ge,ft),Dt.refreshMaterialUniforms(Ge,$,V,O,_.state.transmissionRenderTarget[C.id]),Tr.upload(N,Jr(Rt),Ge,Ut)),$.isShaderMaterial&&$.uniformsNeedUpdate===!0&&(Tr.upload(N,Jr(Rt),Ge,Ut),$.uniformsNeedUpdate=!1),$.isSpriteMaterial&&_e.setValue(N,"center",z.center),_e.setValue(N,"modelViewMatrix",z.modelViewMatrix),_e.setValue(N,"normalMatrix",z.normalMatrix),_e.setValue(N,"modelMatrix",z.matrixWorld),$.isShaderMaterial||$.isRawShaderMaterial){let hi=$.uniformsGroups;for(let fs=0,eo=hi.length;fs<eo;fs++){let io=hi[fs];fe.update(io,li),fe.bind(io,li)}}return li}function to(C,U){C.ambientLightColor.needsUpdate=U,C.lightProbe.needsUpdate=U,C.directionalLights.needsUpdate=U,C.directionalLightShadows.needsUpdate=U,C.pointLights.needsUpdate=U,C.pointLightShadows.needsUpdate=U,C.spotLights.needsUpdate=U,C.spotLightShadows.needsUpdate=U,C.rectAreaLights.needsUpdate=U,C.hemisphereLights.needsUpdate=U}function ta(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return w},this.getRenderTarget=function(){return A},this.setRenderTargetTextures=function(C,U,X){kt.get(C.texture).__webglTexture=U,kt.get(C.depthTexture).__webglTexture=X;let $=kt.get(C);$.__hasExternalTextures=!0,$.__autoAllocateDepthBuffer=X===void 0,$.__autoAllocateDepthBuffer||$t.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),$.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(C,U){let X=kt.get(C);X.__webglFramebuffer=U,X.__useDefaultFramebuffer=U===void 0},this.setRenderTarget=function(C,U=0,X=0){A=C,E=U,w=X;let $=!0,z=null,ft=!1,yt=!1;if(C){let vt=kt.get(C);vt.__useDefaultFramebuffer!==void 0?(Tt.bindFramebuffer(N.FRAMEBUFFER,null),$=!1):vt.__webglFramebuffer===void 0?Ut.setupRenderTarget(C):vt.__hasExternalTextures&&Ut.rebindTextures(C,kt.get(C.texture).__webglTexture,kt.get(C.depthTexture).__webglTexture);let Lt=C.texture;(Lt.isData3DTexture||Lt.isDataArrayTexture||Lt.isCompressedArrayTexture)&&(yt=!0);let It=kt.get(C).__webglFramebuffer;C.isWebGLCubeRenderTarget?(Array.isArray(It[U])?z=It[U][X]:z=It[U],ft=!0):C.samples>0&&Ut.useMultisampledRTT(C)===!1?z=kt.get(C).__webglMultisampledFramebuffer:Array.isArray(It)?z=It[X]:z=It,S.copy(C.viewport),I.copy(C.scissor),B=C.scissorTest}else S.copy(Q).multiplyScalar(V).floor(),I.copy(tt).multiplyScalar(V).floor(),B=ht;if(Tt.bindFramebuffer(N.FRAMEBUFFER,z)&&$&&Tt.drawBuffers(C,z),Tt.viewport(S),Tt.scissor(I),Tt.setScissorTest(B),ft){let vt=kt.get(C.texture);N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_CUBE_MAP_POSITIVE_X+U,vt.__webglTexture,X)}else if(yt){let vt=kt.get(C.texture),Lt=U||0;N.framebufferTextureLayer(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,vt.__webglTexture,X||0,Lt)}P=-1},this.readRenderTargetPixels=function(C,U,X,$,z,ft,yt){if(!(C&&C.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let At=kt.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&yt!==void 0&&(At=At[yt]),At){Tt.bindFramebuffer(N.FRAMEBUFFER,At);try{let vt=C.texture,Lt=vt.format,It=vt.type;if(!Ht.textureFormatReadable(Lt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ht.textureTypeReadable(It)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}U>=0&&U<=C.width-$&&X>=0&&X<=C.height-z&&N.readPixels(U,X,$,z,zt.convert(Lt),zt.convert(It),ft)}finally{let vt=A!==null?kt.get(A).__webglFramebuffer:null;Tt.bindFramebuffer(N.FRAMEBUFFER,vt)}}},this.readRenderTargetPixelsAsync=async function(C,U,X,$,z,ft,yt){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let At=kt.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&yt!==void 0&&(At=At[yt]),At){Tt.bindFramebuffer(N.FRAMEBUFFER,At);try{let vt=C.texture,Lt=vt.format,It=vt.type;if(!Ht.textureFormatReadable(Lt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ht.textureTypeReadable(It))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(U>=0&&U<=C.width-$&&X>=0&&X<=C.height-z){let Ct=N.createBuffer();N.bindBuffer(N.PIXEL_PACK_BUFFER,Ct),N.bufferData(N.PIXEL_PACK_BUFFER,ft.byteLength,N.STREAM_READ),N.readPixels(U,X,$,z,zt.convert(Lt),zt.convert(It),0),N.flush();let Qt=N.fenceSync(N.SYNC_GPU_COMMANDS_COMPLETE,0);await pv(N,Qt,4);try{N.bindBuffer(N.PIXEL_PACK_BUFFER,Ct),N.getBufferSubData(N.PIXEL_PACK_BUFFER,0,ft)}finally{N.deleteBuffer(Ct),N.deleteSync(Qt)}return ft}}finally{let vt=A!==null?kt.get(A).__webglFramebuffer:null;Tt.bindFramebuffer(N.FRAMEBUFFER,vt)}}},this.copyFramebufferToTexture=function(C,U=null,X=0){C.isTexture!==!0&&(Ia("WebGLRenderer: copyFramebufferToTexture function signature has changed."),U=arguments[0]||null,C=arguments[1]);let $=Math.pow(2,-X),z=Math.floor(C.image.width*$),ft=Math.floor(C.image.height*$),yt=U!==null?U.x:0,At=U!==null?U.y:0;Ut.setTexture2D(C,0),N.copyTexSubImage2D(N.TEXTURE_2D,X,0,0,yt,At,z,ft),Tt.unbindTexture()},this.copyTextureToTexture=function(C,U,X=null,$=null,z=0){C.isTexture!==!0&&(Ia("WebGLRenderer: copyTextureToTexture function signature has changed."),$=arguments[0]||null,C=arguments[1],U=arguments[2],z=arguments[3]||0,X=null);let ft,yt,At,vt,Lt,It;X!==null?(ft=X.max.x-X.min.x,yt=X.max.y-X.min.y,At=X.min.x,vt=X.min.y):(ft=C.image.width,yt=C.image.height,At=0,vt=0),$!==null?(Lt=$.x,It=$.y):(Lt=0,It=0);let Ct=zt.convert(U.format),Qt=zt.convert(U.type);Ut.setTexture2D(U,0),N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,U.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,U.unpackAlignment);let se=N.getParameter(N.UNPACK_ROW_LENGTH),oe=N.getParameter(N.UNPACK_IMAGE_HEIGHT),ti=N.getParameter(N.UNPACK_SKIP_PIXELS),re=N.getParameter(N.UNPACK_SKIP_ROWS),Rt=N.getParameter(N.UNPACK_SKIP_IMAGES),de=C.isCompressedTexture?C.mipmaps[z]:C.image;N.pixelStorei(N.UNPACK_ROW_LENGTH,de.width),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,de.height),N.pixelStorei(N.UNPACK_SKIP_PIXELS,At),N.pixelStorei(N.UNPACK_SKIP_ROWS,vt),C.isDataTexture?N.texSubImage2D(N.TEXTURE_2D,z,Lt,It,ft,yt,Ct,Qt,de.data):C.isCompressedTexture?N.compressedTexSubImage2D(N.TEXTURE_2D,z,Lt,It,de.width,de.height,Ct,de.data):N.texSubImage2D(N.TEXTURE_2D,z,Lt,It,ft,yt,Ct,Qt,de),N.pixelStorei(N.UNPACK_ROW_LENGTH,se),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,oe),N.pixelStorei(N.UNPACK_SKIP_PIXELS,ti),N.pixelStorei(N.UNPACK_SKIP_ROWS,re),N.pixelStorei(N.UNPACK_SKIP_IMAGES,Rt),z===0&&U.generateMipmaps&&N.generateMipmap(N.TEXTURE_2D),Tt.unbindTexture()},this.copyTextureToTexture3D=function(C,U,X=null,$=null,z=0){C.isTexture!==!0&&(Ia("WebGLRenderer: copyTextureToTexture3D function signature has changed."),X=arguments[0]||null,$=arguments[1]||null,C=arguments[2],U=arguments[3],z=arguments[4]||0);let ft,yt,At,vt,Lt,It,Ct,Qt,se,oe=C.isCompressedTexture?C.mipmaps[z]:C.image;X!==null?(ft=X.max.x-X.min.x,yt=X.max.y-X.min.y,At=X.max.z-X.min.z,vt=X.min.x,Lt=X.min.y,It=X.min.z):(ft=oe.width,yt=oe.height,At=oe.depth,vt=0,Lt=0,It=0),$!==null?(Ct=$.x,Qt=$.y,se=$.z):(Ct=0,Qt=0,se=0);let ti=zt.convert(U.format),re=zt.convert(U.type),Rt;if(U.isData3DTexture)Ut.setTexture3D(U,0),Rt=N.TEXTURE_3D;else if(U.isDataArrayTexture||U.isCompressedArrayTexture)Ut.setTexture2DArray(U,0),Rt=N.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,U.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,U.unpackAlignment);let de=N.getParameter(N.UNPACK_ROW_LENGTH),ee=N.getParameter(N.UNPACK_IMAGE_HEIGHT),li=N.getParameter(N.UNPACK_SKIP_PIXELS),rn=N.getParameter(N.UNPACK_SKIP_ROWS),$e=N.getParameter(N.UNPACK_SKIP_IMAGES);N.pixelStorei(N.UNPACK_ROW_LENGTH,oe.width),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,oe.height),N.pixelStorei(N.UNPACK_SKIP_PIXELS,vt),N.pixelStorei(N.UNPACK_SKIP_ROWS,Lt),N.pixelStorei(N.UNPACK_SKIP_IMAGES,It),C.isDataTexture||C.isData3DTexture?N.texSubImage3D(Rt,z,Ct,Qt,se,ft,yt,At,ti,re,oe.data):U.isCompressedArrayTexture?N.compressedTexSubImage3D(Rt,z,Ct,Qt,se,ft,yt,At,ti,oe.data):N.texSubImage3D(Rt,z,Ct,Qt,se,ft,yt,At,ti,re,oe),N.pixelStorei(N.UNPACK_ROW_LENGTH,de),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,ee),N.pixelStorei(N.UNPACK_SKIP_PIXELS,li),N.pixelStorei(N.UNPACK_SKIP_ROWS,rn),N.pixelStorei(N.UNPACK_SKIP_IMAGES,$e),z===0&&U.generateMipmaps&&N.generateMipmap(Rt),Tt.unbindTexture()},this.initRenderTarget=function(C){kt.get(C).__webglFramebuffer===void 0&&Ut.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?Ut.setTextureCube(C,0):C.isData3DTexture?Ut.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?Ut.setTexture2DArray(C,0):Ut.setTexture2D(C,0),Tt.unbindTexture()},this.resetState=function(){E=0,w=0,A=null,Tt.reset(),Xt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Rn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===qd?"display-p3":"srgb",e.unpackColorSpace=he.workingColorSpace===jl?"display-p3":"srgb"}};var Yl=class extends nn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Dn,this.environmentIntensity=1,this.environmentRotation=new Dn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var Nr=class extends Li{constructor(t,e,i,n,s,a,o,l,h){super(t,e,i,n,s,a,o,l,h),this.isCanvasTexture=!0,this.needsUpdate=!0}};function wl(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function lw(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var Or=class{constructor(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=n!==void 0?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,n=e[i],s=e[i-1];i:{t:{let a;e:{n:if(!(t<n)){for(let o=i+2;;){if(n===void 0){if(t<s)break n;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===o)break;if(s=n,n=e[++i],t<n)break t}a=e.length;break e}if(!(t>=s)){let o=e[1];t<o&&(i=2,s=o);for(let l=i-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(n=s,s=e[--i-1],t>=s)break t}a=i,i=0;break e}break i}for(;i<a;){let o=i+a>>>1;t<e[o]?a=o:i=o+1}if(n=e[i],s=e[i-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===void 0)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,n)}return this.interpolate_(i,s,t,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=t*n;for(let a=0;a!==n;++a)e[a]=i[s+a];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Rd=class extends Or{constructor(t,e,i,n){super(t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Dp,endingEnd:Dp}}intervalChanged_(t,e,i){let n=this.parameterPositions,s=t-2,a=t+1,o=n[s],l=n[a];if(o===void 0)switch(this.getSettings_().endingStart){case Np:s=t,o=2*e-i;break;case Op:s=n.length-2,o=e+n[s]-n[s+1];break;default:s=t,o=i}if(l===void 0)switch(this.getSettings_().endingEnd){case Np:a=t,l=2*i-e;break;case Op:a=1,l=i+n[1]-n[0];break;default:a=t-1,l=e}let h=(i-e)*.5,c=this.valueSize;this._weightPrev=h/(e-o),this._weightNext=h/(l-i),this._offsetPrev=s*c,this._offsetNext=a*c}interpolate_(t,e,i,n){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=t*o,h=l-o,c=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(i-e)/(n-e),m=p*p,_=m*p,g=-d*_+2*d*m-d*p,y=(1+d)*_+(-1.5-2*d)*m+(-.5+d)*p+1,v=(-1-f)*_+(1.5+f)*m+.5*p,x=f*_-f*m;for(let E=0;E!==o;++E)s[E]=g*a[c+E]+y*a[h+E]+v*a[l+E]+x*a[u+E];return s}},Pd=class extends Or{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=t*o,h=l-o,c=(i-e)/(n-e),u=1-c;for(let d=0;d!==o;++d)s[d]=a[h+d]*u+a[l+d]*c;return s}},Id=class extends Or{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t){return this.copySampleValue_(t-1)}},sn=class{constructor(t,e,i,n){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=wl(e,this.TimeBufferType),this.values=wl(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:wl(t.times,Array),values:wl(t.values,Array)};let n=t.getInterpolation();n!==t.DefaultInterpolation&&(i.interpolation=n)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new Id(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Pd(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Rd(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Pl:e=this.InterpolantFactoryMethodDiscrete;break;case hd:e=this.InterpolantFactoryMethodLinear;break;case su:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Pl;case this.InterpolantFactoryMethodLinear:return hd;case this.InterpolantFactoryMethodSmooth:return su}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this}trim(t,e){let i=this.times,n=i.length,s=0,a=n-1;for(;s!==n&&i[s]<t;)++s;for(;a!==-1&&i[a]>e;)--a;if(++a,s!==0||a!==n){s>=a&&(a=Math.max(a,1),s=a-1);let o=this.getValueSize();this.times=i.slice(s,a),this.values=this.values.slice(s*o,a*o)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,n=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==s;o++){let l=i[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),t=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),t=!1;break}a=l}if(n!==void 0&&lw(n))for(let o=0,l=n.length;o!==l;++o){let h=n[o];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,h),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),n=this.getInterpolation()===su,s=t.length-1,a=1;for(let o=1;o<s;++o){let l=!1,h=t[o],c=t[o+1];if(h!==c&&(o!==1||h!==t[0]))if(n)l=!0;else{let u=o*i,d=u-i,f=u+i;for(let p=0;p!==i;++p){let m=e[u+p];if(m!==e[d+p]||m!==e[f+p]){l=!0;break}}}if(l){if(o!==a){t[a]=t[o];let u=o*i,d=a*i;for(let f=0;f!==i;++f)e[d+f]=e[u+f]}++a}}if(s>0){t[a]=t[s];for(let o=s*i,l=a*i,h=0;h!==i;++h)e[l+h]=e[o+h];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=this.constructor,n=new i(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}};sn.prototype.TimeBufferType=Float32Array;sn.prototype.ValueBufferType=Float32Array;sn.prototype.DefaultInterpolation=hd;var ks=class extends sn{constructor(t,e,i){super(t,e,i)}};ks.prototype.ValueTypeName="bool";ks.prototype.ValueBufferType=Array;ks.prototype.DefaultInterpolation=Pl;ks.prototype.InterpolantFactoryMethodLinear=void 0;ks.prototype.InterpolantFactoryMethodSmooth=void 0;var Ld=class extends sn{};Ld.prototype.ValueTypeName="color";var Dd=class extends sn{};Dd.prototype.ValueTypeName="number";var Nd=class extends Or{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(i-e)/(n-e),h=t*o;for(let c=h+o;h!==c;h+=4)ts.slerpFlat(s,0,a,h-o,a,h,l);return s}},$l=class extends sn{InterpolantFactoryMethodLinear(t){return new Nd(this.times,this.values,this.getValueSize(),t)}};$l.prototype.ValueTypeName="quaternion";$l.prototype.InterpolantFactoryMethodSmooth=void 0;var Us=class extends sn{constructor(t,e,i){super(t,e,i)}};Us.prototype.ValueTypeName="string";Us.prototype.ValueBufferType=Array;Us.prototype.DefaultInterpolation=Pl;Us.prototype.InterpolantFactoryMethodLinear=void 0;Us.prototype.InterpolantFactoryMethodSmooth=void 0;var Od=class extends sn{};Od.prototype.ValueTypeName="vector";var Fd=class{constructor(t,e,i){let n=this,s=!1,a=0,o=0,l,h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(c){o++,s===!1&&n.onStart!==void 0&&n.onStart(c,a,o),s=!0},this.itemEnd=function(c){a++,n.onProgress!==void 0&&n.onProgress(c,a,o),a===o&&(s=!1,n.onLoad!==void 0&&n.onLoad())},this.itemError=function(c){n.onError!==void 0&&n.onError(c)},this.resolveURL=function(c){return l?l(c):c},this.setURLModifier=function(c){return l=c,this},this.addHandler=function(c,u){return h.push(c,u),this},this.removeHandler=function(c){let u=h.indexOf(c);return u!==-1&&h.splice(u,2),this},this.getHandler=function(c){for(let u=0,d=h.length;u<d;u+=2){let f=h[u],p=h[u+1];if(f.global&&(f.lastIndex=0),f.test(c))return p}return null}}},hw=new Fd,kd=class{constructor(t){this.manager=t!==void 0?t:hw,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let i=this;return new Promise(function(n,s){i.load(t,n,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};kd.DEFAULT_MATERIAL_NAME="__DEFAULT";var $d="\\[\\]\\.:\\/",cw=new RegExp("["+$d+"]","g"),Kd="[^"+$d+"]",uw="[^"+$d.replace("\\.","")+"]",dw=/((?:WC+[\/:])*)/.source.replace("WC",Kd),fw=/(WCOD+)?/.source.replace("WCOD",uw),pw=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Kd),mw=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Kd),gw=new RegExp("^"+dw+fw+pw+mw+"$"),_w=["material","materials","bones","map"],Ud=class{constructor(t,e,i){let n=i||be.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,n=this._bindings[i];n!==void 0&&n.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=i.length;n!==s;++n)i[n].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},be=class r{constructor(t,e,i){this.path=e,this.parsedPath=i||r.parseTrackName(e),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new r.Composite(t,e,i):new r(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(cw,"")}static parseTrackName(t){let e=gw.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(n!==void 0&&n!==-1){let s=i.nodeName.substring(n+1);_w.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);if(i!==void 0)return i}if(t.children){let i=function(s){for(let a=0;a<s.length;a++){let o=s[a];if(o.name===e||o.uuid===e)return o;let l=i(o.children);if(l)return l}return null},n=i(t.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)t[e++]=i[n]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,i=e.objectName,n=e.propertyName,s=e.propertyIndex;if(t||(t=r.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let h=e.objectIndex;switch(i){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let c=0;c<t.length;c++)if(t[c].name===h){h=c;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[i]}if(h!==void 0){if(t[h]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[h]}}let a=t[n];if(a===void 0){let h=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+n+" but it wasn't found.",t);return}let o=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?o=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(n==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=s}else a.fromArray!==void 0&&a.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(l=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=n;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};be.Composite=Ud;be.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};be.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};be.prototype.GetterByBindingType=[be.prototype._getValue_direct,be.prototype._getValue_array,be.prototype._getValue_arrayElement,be.prototype._getValue_toArray];be.prototype.SetterByBindingTypeAndVersioning=[[be.prototype._setValue_direct,be.prototype._setValue_direct_setNeedsUpdate,be.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[be.prototype._setValue_array,be.prototype._setValue_array_setNeedsUpdate,be.prototype._setValue_array_setMatrixWorldNeedsUpdate],[be.prototype._setValue_arrayElement,be.prototype._setValue_arrayElement_setNeedsUpdate,be.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[be.prototype._setValue_fromArray,be.prototype._setValue_fromArray_setNeedsUpdate,be.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var vE=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Bd}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Bd);var Sw={},jm=!1;function Zm(r){tl.workerSrc=r,jm=!0}function yw(){if(!(jm||tl.workerSrc))try{tl.workerSrc=new URL("./pdf.worker.mjs",Sw.url).toString()}catch{console.warn("PageFlipOpen: Could not auto-resolve PDF.js worker URL. Call PageFlipOpen.setPdfWorkerSrc(url) before instantiation.")}}var xw=20,Km=1.5,bw=1.5,Jl=class{constructor(){this._pdf=null,this._cache=new Map,this._lruOrder=[],this._pending=new Map,this._pageDimensions=null,this._renderScale=Km,this._pageMap=[]}setRenderScale(t){let e=Math.max(t,Km);if(Math.abs(e-this._renderScale)>.25){for(let i of this._cache.values())i.dispose();this._cache.clear(),this._lruOrder=[]}this._renderScale=e}async load(t){yw();let e=Cp({url:t});this._pdf=await e.promise;let n=(await this._pdf.getPage(1)).getViewport({scale:1});this._pageDimensions={width:n.width,height:n.height};let s=n.width/n.height;this._pageMap=[];for(let a=1;a<=this._pdf.numPages;a++){let l=(await this._pdf.getPage(a)).getViewport({scale:1});l.width/l.height>=s*bw?(this._pageMap.push({pdfPage:a,side:"left"}),this._pageMap.push({pdfPage:a,side:"right"})):this._pageMap.push({pdfPage:a,side:"full"})}return{totalPages:this._pageMap.length,pageDimensions:this._pageDimensions}}async getTexture(t){if(this._cache.has(t))return this._touchLRU(t),this._cache.get(t);if(this._pending.has(t))return this._pending.get(t);let e=this._renderVirtualPage(t);this._pending.set(t,e);try{let i=await e;return this._pending.delete(t),this._storeInCache(t,i),i}catch(i){throw this._pending.delete(t),i}}async _renderVirtualPage(t){let e=this._pageMap[t-1];if(!e)throw new Error(`Virtual page ${t} out of range`);return e.side==="full"?this._renderPage(e.pdfPage):this._renderSpreadHalf(e.pdfPage,e.side)}async _renderPage(t){if(!this._pdf)throw new Error("PDF not loaded");let e=await this._pdf.getPage(t),i=e.getViewport({scale:this._renderScale}),n=this._pageDimensions.width/this._pageDimensions.height,s=i.width/i.height,a=Math.round(i.width),o=Math.round(i.height),l=0,h=0;Math.abs(s-n)>.01&&(s>n?(o=Math.round(i.width/n),h=(o-i.height)/2):(a=Math.round(i.height*n),l=(a-i.width)/2));let c=document.createElement("canvas");c.width=a,c.height=o;let u=c.getContext("2d");return u.fillStyle="#ffffff",u.fillRect(0,0,a,o),await e.render({canvasContext:u,viewport:i,transform:[1,0,0,1,l,h]}).promise,this._makeTexture(c)}async _renderSpreadHalf(t,e){if(!this._pdf)throw new Error("PDF not loaded");let i=await this._pdf.getPage(t),n=i.getViewport({scale:this._renderScale}),s=Math.round(n.width),a=Math.round(n.height),o=document.createElement("canvas");o.width=s,o.height=a;let l=o.getContext("2d");l.fillStyle="#ffffff",l.fillRect(0,0,s,a),await i.render({canvasContext:l,viewport:n}).promise;let h=s/2,c=e==="left"?0:h,u=this._pageDimensions.width/this._pageDimensions.height,d=h/a,f=Math.round(h),p=a,m=0,_=0;Math.abs(d-u)>.01&&(d>u?(p=Math.round(h/u),_=Math.round((p-a)/2)):(f=Math.round(a*u),m=Math.round((f-h)/2)));let g=document.createElement("canvas");g.width=f,g.height=p;let y=g.getContext("2d");return y.fillStyle="#ffffff",y.fillRect(0,0,f,p),y.drawImage(o,c,0,h,a,m,_,h,a),this._makeTexture(g)}_makeTexture(t){let e=new Nr(t);return e.generateMipmaps=!1,e.minFilter=xi,e.magFilter=xi,e.colorSpace=Hi,e.needsUpdate=!0,e}_storeInCache(t,e){this._cache.size>=xw&&this._evictLRU(),this._cache.set(t,e),this._lruOrder.push(t)}_touchLRU(t){let e=this._lruOrder.indexOf(t);e!==-1&&this._lruOrder.splice(e,1),this._lruOrder.push(t)}_evictLRU(){let t=this._lruOrder.shift();t!==void 0&&this._cache.has(t)&&(this._cache.get(t).dispose(),this._cache.delete(t))}prefetch(t,e){let i=[];for(let n=-2;n<=2;n++){let s=t+n;s>=1&&s<=e&&i.push(s)}for(let n of i)!this._cache.has(n)&&!this._pending.has(n)&&this.getTexture(n).catch(()=>{})}destroy(){for(let t of this._cache.values())t.dispose();this._cache.clear(),this._lruOrder=[],this._pending.clear(),this._pdf&&(this._pdf.destroy(),this._pdf=null),this._pageMap=[]}};var ww=100,Jm=.88,Ql=class{constructor(t){this._container=t,this._pageDimensions={width:0,height:0},this._totalPages=0,this._currentLayout="double",this._forceSingle=!1,this._changeCallbacks=[],this._resizeTimer=null,this._observer=new ResizeObserver(()=>{clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>this._onResize(),ww)}),this._observer.observe(this._container)}init(t,e,i=!1){this._pageDimensions=t,this._totalPages=e,this._forceSingle=i,this._currentLayout=this._detectLayout()}_detectLayout(){if(this._forceSingle)return"single";let{width:t,height:e}=this._pageDimensions;return t>e?"single":"double"}_onResize(){this._currentLayout=this._detectLayout();for(let t of this._changeCallbacks)t(this._currentLayout)}onLayoutChange(t){this._changeCallbacks.push(t)}getCurrentLayout(){return this._currentLayout}getPageDimensions(){let t=this._container.clientWidth,e=this._container.clientHeight,{width:i,height:n}=this._pageDimensions,s=e-44,a=this._currentLayout==="double"?2:1,o=t*Jm,l=s*Jm,h=i*a,c=n,u=o/h,d=l/c,f=Math.min(u,d);return{pageWidth:i*f,pageHeight:n*f,spreadWidth:i*a*f,spreadHeight:n*f,scale:f,pdfPageWidth:i,pdfPageHeight:n}}getSpreadForPage(t){if(this._currentLayout==="single")return[t];if(t===1)return[1];if(this._totalPages%2===0&&t===this._totalPages)return[this._totalPages];if(t%2===0){let e=t+1;return e<=this._totalPages?[t,e]:[t]}else{let e=t-1;return e>=2?[e,t]:[t]}}getSpreadLeftPage(t){return this.getSpreadForPage(t)[0]}getNextSpreadPage(t){return this._currentLayout==="single"?Math.min(t+1,this._totalPages):t===1?2:Math.min(t+2,this._totalPages)}getPrevSpreadPage(t){return this._currentLayout==="single"?Math.max(t-1,1):t===2||t===3?1:Math.max(t-2,1)}destroy(){clearTimeout(this._resizeTimer),this._observer.disconnect(),this._changeCallbacks=[]}};function Nn(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function og(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var Ei={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Ur={duration:.5,overwrite:!1,delay:0},mf,Je,Se,Xi=1e8,ge=1/Xi,rf=Math.PI*2,Aw=rf/4,Mw=0,lg=Math.sqrt,Ew=Math.cos,Tw=Math.sin,He=function(t){return typeof t=="string"},Re=function(t){return typeof t=="function"},Fn=function(t){return typeof t=="number"},hh=function(t){return typeof t>"u"},pn=function(t){return typeof t=="object"},Mi=function(t){return t!==!1},gf=function(){return typeof window<"u"},th=function(t){return Re(t)||He(t)},hg=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ai=Array.isArray,Cw=/random\([^)]+\)/g,Rw=/,\s*/g,Qm=/(?:-?\.?\d|\.)+/gi,_f=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Vs=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Zd=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,vf=/[+-]=-?[.\d]+/,Pw=/[^,'"\[\]\s]+/gi,Iw=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ee,dn,af,yf,Oi={},sh={},cg,ug=function(t){return(sh=Br(t,Oi))&&oi},ch=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},Ga=function(t,e){return!e&&console.warn(t)},dg=function(t,e){return t&&(Oi[t]=e)&&sh&&(sh[t]=e)||Oi},Wa=function(){return 0},Lw={suppressEvents:!0,isStart:!0,kill:!1},eh={suppressEvents:!0,kill:!1},Dw={suppressEvents:!0},xf={},ns=[],of={},fg,wi={},Jd={},tg=30,ih=[],bf="",Sf=function(t){var e=t[0],i,n;if(pn(e)||Re(e)||(t=[t]),!(i=(e._gsap||{}).harness)){for(n=ih.length;n--&&!ih[n].targetTest(e););i=ih[n]}for(n=t.length;n--;)t[n]&&(t[n]._gsap||(t[n]._gsap=new Ef(t[n],i)))||t.splice(n,1);return t},ss=function(t){return t._gsap||Sf(qi(t))[0]._gsap},wf=function(t,e,i){return(i=t[e])&&Re(i)?t[e]():hh(i)&&t.getAttribute&&t.getAttribute(e)||i},fi=function(t,e){return(t=t.split(",")).forEach(e)||t},Pe=function(t){return Math.round(t*1e5)/1e5||0},Me=function(t){return Math.round(t*1e7)/1e7||0},Gs=function(t,e){var i=e.charAt(0),n=parseFloat(e.substr(2));return t=parseFloat(t),i==="+"?t+n:i==="-"?t-n:i==="*"?t*n:t/n},Nw=function(t,e){for(var i=e.length,n=0;t.indexOf(e[n])<0&&++n<i;);return n<i},rh=function(){var t=ns.length,e=ns.slice(0),i,n;for(of={},ns.length=0,i=0;i<t;i++)n=e[i],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},Af=function(t){return!!(t._initted||t._startAt||t.add)},pg=function(t,e,i,n){ns.length&&!Je&&rh(),t.render(e,i,n||!!(Je&&e<0&&Af(t))),ns.length&&!Je&&rh()},mg=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Pw).length<2?e:He(t)?t.trim():t},gg=function(t){return t},Fi=function(t,e){for(var i in e)i in t||(t[i]=e[i]);return t},Ow=function(t){return function(e,i){for(var n in i)n in e||n==="duration"&&t||n==="ease"||(e[n]=i[n])}},Br=function(t,e){for(var i in e)t[i]=e[i];return t},eg=function r(t,e){for(var i in e)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(t[i]=pn(e[i])?r(t[i]||(t[i]={}),e[i]):e[i]);return t},ah=function(t,e){var i={},n;for(n in t)n in e||(i[n]=t[n]);return i},za=function(t){var e=t.parent||Ee,i=t.keyframes?Ow(ai(t.keyframes)):Fi;if(Mi(t.inherit))for(;e;)i(t,e.vars.defaults),e=e.parent||e._dp;return t},Fw=function(t,e){for(var i=t.length,n=i===e.length;n&&i--&&t[i]===e[i];);return i<0},_g=function(t,e,i,n,s){i===void 0&&(i="_first"),n===void 0&&(n="_last");var a=t[n],o;if(s)for(o=e[s];a&&a[s]>o;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[n]=e,e._prev=a,e.parent=e._dp=t,e},uh=function(t,e,i,n){i===void 0&&(i="_first"),n===void 0&&(n="_last");var s=e._prev,a=e._next;s?s._next=a:t[i]===e&&(t[i]=a),a?a._prev=s:t[n]===e&&(t[n]=s),e._next=e._prev=e.parent=null},rs=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Bs=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t},kw=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},lf=function(t,e,i,n){return t._startAt&&(Je?t._startAt.revert(eh):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,n))},Uw=function r(t){return!t||t._ts&&r(t.parent)},ig=function(t){return t._repeat?zr(t._tTime,t=t.duration()+t._rDelay)*t:0},zr=function(t,e){var i=Math.floor(t=Me(t/e));return t&&i===t?i-1:i},oh=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},dh=function(t){return t._end=Me(t._start+(t._tDur/Math.abs(t._ts||t._rts||ge)||0))},fh=function(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=Me(i._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),dh(t),i._dirty||Bs(i,t)),t},vg=function(t,e){var i;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(i=oh(t.rawTime(),e),(!e._dur||Ya(0,e.totalDuration(),i)-e._tTime>ge)&&e.render(i,!0)),Bs(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(i=t;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;t._zTime=-ge}},fn=function(t,e,i,n){return e.parent&&rs(e),e._start=Me((Fn(i)?i:i||t!==Ee?Wi(t,i,e):t._time)+e._delay),e._end=Me(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),_g(t,e,"_first","_last",t._sort?"_start":0),hf(e)||(t._recent=e),n||vg(t,e),t._ts<0&&fh(t,t._tTime),t},yg=function(t,e){return(Oi.ScrollTrigger||ch("scrollTrigger",e))&&Oi.ScrollTrigger.create(e,t)},xg=function(t,e,i,n,s){if(Rf(t,e,s),!t._initted)return 1;if(!i&&t._pt&&!Je&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&fg!==Ai.frame)return ns.push(t),t._lazy=[s,n],1},Bw=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},hf=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},zw=function(t,e,i,n){var s=t.ratio,a=e<0||!e&&(!t._start&&Bw(t)&&!(!t._initted&&hf(t))||(t._ts<0||t._dp._ts<0)&&!hf(t))?0:1,o=t._rDelay,l=0,h,c,u;if(o&&t._repeat&&(l=Ya(0,t._tDur,e),c=zr(l,o),t._yoyo&&c&1&&(a=1-a),c!==zr(t._tTime,o)&&(s=1-a,t.vars.repeatRefresh&&t._initted&&t.invalidate())),a!==s||Je||n||t._zTime===ge||!e&&t._zTime){if(!t._initted&&xg(t,e,n,i,l))return;for(u=t._zTime,t._zTime=e||(i?ge:0),i||(i=e&&!u),t.ratio=a,t._from&&(a=1-a),t._time=0,t._tTime=l,h=t._pt;h;)h.r(a,h.d),h=h._next;e<0&&lf(t,e,i,!0),t._onUpdate&&!i&&Ni(t,"onUpdate"),l&&t._repeat&&!i&&t.parent&&Ni(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===a&&(a&&rs(t,1),!i&&!Je&&(Ni(t,a?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},Hw=function(t,e,i){var n;if(i>e)for(n=t._first;n&&n._start<=i;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=i;){if(n.data==="isPause"&&n._start<e)return n;n=n._prev}},Hr=function(t,e,i,n){var s=t._repeat,a=Me(e)||0,o=t._tTime/t._tDur;return o&&!n&&(t._time*=a/t._dur),t._dur=a,t._tDur=s?s<0?1e10:Me(a*(s+1)+t._rDelay*s):a,o>0&&!n&&fh(t,t._tTime=t._tDur*o),t.parent&&dh(t),i||Bs(t.parent,t),t},ng=function(t){return t instanceof Ze?Bs(t):Hr(t,t._dur)},Vw={_start:0,endTime:Wa,totalDuration:Wa},Wi=function r(t,e,i){var n=t.labels,s=t._recent||Vw,a=t.duration()>=Xi?s.endTime(!1):t._dur,o,l,h;return He(e)&&(isNaN(e)||e in n)?(l=e.charAt(0),h=e.substr(-1)==="%",o=e.indexOf("="),l==="<"||l===">"?(o>=0&&(e=e.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(e.substr(1))||0)*(h?(o<0?s:i).totalDuration()/100:1)):o<0?(e in n||(n[e]=a),n[e]):(l=parseFloat(e.charAt(o-1)+e.substr(o+1)),h&&i&&(l=l/100*(ai(i)?i[0]:i).totalDuration()),o>1?r(t,e.substr(0,o-1),i)+l:a+l)):e==null?a:+e},Ha=function(t,e,i){var n=Fn(e[1]),s=(n?2:1)+(t<2?0:1),a=e[s],o,l;if(n&&(a.duration=e[1]),a.parent=i,t){for(o=a,l=i;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Mi(l.vars.inherit)&&l.parent;a.immediateRender=Mi(o.immediateRender),t<2?a.runBackwards=1:a.startAt=e[s-1]}return new Le(e[0],a,e[s+1])},as=function(t,e){return t||t===0?e(t):e},Ya=function(t,e,i){return i<t?t:i>e?e:i},Qe=function(t,e){return!He(t)||!(e=Iw.exec(t))?"":e[1]},Gw=function(t,e,i){return as(i,function(n){return Ya(t,e,n)})},cf=[].slice,bg=function(t,e){return t&&pn(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&pn(t[0]))&&!t.nodeType&&t!==dn},Ww=function(t,e,i){return i===void 0&&(i=[]),t.forEach(function(n){var s;return He(n)&&!e||bg(n,1)?(s=i).push.apply(s,qi(n)):i.push(n)})||i},qi=function(t,e,i){return Se&&!e&&Se.selector?Se.selector(t):He(t)&&!i&&(af||!Vr())?cf.call((e||yf).querySelectorAll(t),0):ai(t)?Ww(t,i):bg(t)?cf.call(t,0):t?[t]:[]},uf=function(t){return t=qi(t)[0]||Ga("Invalid scope")||{},function(e){var i=t.current||t.nativeElement||t;return qi(e,i.querySelectorAll?i:i===t?Ga("Invalid scope")||yf.createElement("div"):t)}},Sg=function(t){return t.sort(function(){return .5-Math.random()})},wg=function(t){if(Re(t))return t;var e=pn(t)?t:{each:t},i=zs(e.ease),n=e.from||0,s=parseFloat(e.base)||0,a={},o=n>0&&n<1,l=isNaN(n)||o,h=e.axis,c=n,u=n;return He(n)?c=u={center:.5,edges:.5,end:1}[n]||0:!o&&l&&(c=n[0],u=n[1]),function(d,f,p){var m=(p||e).length,_=a[m],g,y,v,x,E,w,A,P,b;if(!_){if(b=e.grid==="auto"?0:(e.grid||[1,Xi])[1],!b){for(A=-Xi;A<(A=p[b++].getBoundingClientRect().left)&&b<m;);b<m&&b--}for(_=a[m]=[],g=l?Math.min(b,m)*c-.5:n%b,y=b===Xi?0:l?m*u/b-.5:n/b|0,A=0,P=Xi,w=0;w<m;w++)v=w%b-g,x=y-(w/b|0),_[w]=E=h?Math.abs(h==="y"?x:v):lg(v*v+x*x),E>A&&(A=E),E<P&&(P=E);n==="random"&&Sg(_),_.max=A-P,_.min=P,_.v=m=(parseFloat(e.amount)||parseFloat(e.each)*(b>m?m-1:h?h==="y"?m/b:b:Math.max(b,m/b))||0)*(n==="edges"?-1:1),_.b=m<0?s-m:s,_.u=Qe(e.amount||e.each)||0,i=i&&m<0?Lg(i):i}return m=(_[d]-_.min)/_.max||0,Me(_.b+(i?i(m):m)*_.v)+_.u}},df=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(i){var n=Me(Math.round(parseFloat(i)/t)*t*e);return(n-n%1)/e+(Fn(i)?0:Qe(i))}},Ag=function(t,e){var i=ai(t),n,s;return!i&&pn(t)&&(n=i=t.radius||Xi,t.values?(t=qi(t.values),(s=!Fn(t[0]))&&(n*=n)):t=df(t.increment)),as(e,i?Re(t)?function(a){return s=t(a),Math.abs(s-a)<=n?s:a}:function(a){for(var o=parseFloat(s?a.x:a),l=parseFloat(s?a.y:0),h=Xi,c=0,u=t.length,d,f;u--;)s?(d=t[u].x-o,f=t[u].y-l,d=d*d+f*f):d=Math.abs(t[u]-o),d<h&&(h=d,c=u);return c=!n||h<=n?t[c]:a,s||c===a||Fn(a)?c:c+Qe(a)}:df(t))},Mg=function(t,e,i,n){return as(ai(t)?!e:i===!0?!!(i=0):!n,function(){return ai(t)?t[~~(Math.random()*t.length)]:(i=i||1e-5)&&(n=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((t-i/2+Math.random()*(e-t+i*.99))/i)*i*n)/n})},Xw=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(n){return e.reduce(function(s,a){return a(s)},n)}},qw=function(t,e){return function(i){return t(parseFloat(i))+(e||Qe(i))}},Yw=function(t,e,i){return Tg(t,e,0,1,i)},Eg=function(t,e,i){return as(i,function(n){return t[~~e(n)]})},$w=function r(t,e,i){var n=e-t;return ai(t)?Eg(t,r(0,t.length),e):as(i,function(s){return(n+(s-t)%n)%n+t})},Kw=function r(t,e,i){var n=e-t,s=n*2;return ai(t)?Eg(t,r(0,t.length-1),e):as(i,function(a){return a=(s+(a-t)%s)%s||0,t+(a>n?s-a:a)})},Gr=function(t){return t.replace(Cw,function(e){var i=e.indexOf("[")+1,n=e.substring(i||7,i?e.indexOf("]"):e.length-1).split(Rw);return Mg(i?n:+n[0],i?0:+n[1],+n[2]||1e-5)})},Tg=function(t,e,i,n,s){var a=e-t,o=n-i;return as(s,function(l){return i+((l-t)/a*o||0)})},jw=function r(t,e,i,n){var s=isNaN(t+e)?0:function(f){return(1-f)*t+f*e};if(!s){var a=He(t),o={},l,h,c,u,d;if(i===!0&&(n=1)&&(i=null),a)t={p:t},e={p:e};else if(ai(t)&&!ai(e)){for(c=[],u=t.length,d=u-2,h=1;h<u;h++)c.push(r(t[h-1],t[h]));u--,s=function(p){p*=u;var m=Math.min(d,~~p);return c[m](p-m)},i=e}else n||(t=Br(ai(t)?[]:{},t));if(!c){for(l in e)Tf.call(o,t,l,"get",e[l]);s=function(p){return Lf(p,o)||(a?t.p:t)}}}return as(i,s)},sg=function(t,e,i){var n=t.labels,s=Xi,a,o,l;for(a in n)o=n[a]-e,o<0==!!i&&o&&s>(o=Math.abs(o))&&(l=a,s=o);return l},Ni=function(t,e,i){var n=t.vars,s=n[e],a=Se,o=t._ctx,l,h,c;if(s)return l=n[e+"Params"],h=n.callbackScope||t,i&&ns.length&&rh(),o&&(Se=o),c=l?s.apply(h,l):s.call(h),Se=a,c},Ua=function(t){return rs(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Je),t.progress()<1&&Ni(t,"onInterrupt"),t},kr,Cg=[],Rg=function(t){if(t)if(t=!t.name&&t.default||t,gf()||t.headless){var e=t.name,i=Re(t),n=e&&!i&&t.init?function(){this._props=[]}:t,s={init:Wa,render:Lf,add:Tf,kill:dA,modifier:uA,rawVars:0},a={targetTest:0,get:0,getSetter:ph,aliases:{},register:0};if(Vr(),t!==n){if(wi[e])return;Fi(n,Fi(ah(t,s),a)),Br(n.prototype,Br(s,ah(t,a))),wi[n.prop=e]=n,t.targetTest&&(ih.push(n),xf[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}dg(e,n),t.register&&t.register(oi,n,pi)}else Cg.push(t)},me=255,Ba={aqua:[0,me,me],lime:[0,me,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,me],navy:[0,0,128],white:[me,me,me],olive:[128,128,0],yellow:[me,me,0],orange:[me,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[me,0,0],pink:[me,192,203],cyan:[0,me,me],transparent:[me,me,me,0]},Qd=function(t,e,i){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(i-e)*t*6:t<.5?i:t*3<2?e+(i-e)*(2/3-t)*6:e)*me+.5|0},Pg=function(t,e,i){var n=t?Fn(t)?[t>>16,t>>8&me,t&me]:0:Ba.black,s,a,o,l,h,c,u,d,f,p;if(!n){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Ba[t])n=Ba[t];else if(t.charAt(0)==="#"){if(t.length<6&&(s=t.charAt(1),a=t.charAt(2),o=t.charAt(3),t="#"+s+s+a+a+o+o+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return n=parseInt(t.substr(1,6),16),[n>>16,n>>8&me,n&me,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),n=[t>>16,t>>8&me,t&me]}else if(t.substr(0,3)==="hsl"){if(n=p=t.match(Qm),!e)l=+n[0]%360/360,h=+n[1]/100,c=+n[2]/100,a=c<=.5?c*(h+1):c+h-c*h,s=c*2-a,n.length>3&&(n[3]*=1),n[0]=Qd(l+1/3,s,a),n[1]=Qd(l,s,a),n[2]=Qd(l-1/3,s,a);else if(~t.indexOf("="))return n=t.match(_f),i&&n.length<4&&(n[3]=1),n}else n=t.match(Qm)||Ba.transparent;n=n.map(Number)}return e&&!p&&(s=n[0]/me,a=n[1]/me,o=n[2]/me,u=Math.max(s,a,o),d=Math.min(s,a,o),c=(u+d)/2,u===d?l=h=0:(f=u-d,h=c>.5?f/(2-u-d):f/(u+d),l=u===s?(a-o)/f+(a<o?6:0):u===a?(o-s)/f+2:(s-a)/f+4,l*=60),n[0]=~~(l+.5),n[1]=~~(h*100+.5),n[2]=~~(c*100+.5)),i&&n.length<4&&(n[3]=1),n},Ig=function(t){var e=[],i=[],n=-1;return t.split(On).forEach(function(s){var a=s.match(Vs)||[];e.push.apply(e,a),i.push(n+=a.length+1)}),e.c=i,e},rg=function(t,e,i){var n="",s=(t+n).match(On),a=e?"hsla(":"rgba(",o=0,l,h,c,u;if(!s)return t;if(s=s.map(function(d){return(d=Pg(d,e,1))&&a+(e?d[0]+","+d[1]+"%,"+d[2]+"%,"+d[3]:d.join(","))+")"}),i&&(c=Ig(t),l=i.c,l.join(n)!==c.c.join(n)))for(h=t.replace(On,"1").split(Vs),u=h.length-1;o<u;o++)n+=h[o]+(~l.indexOf(o)?s.shift()||a+"0,0,0,0)":(c.length?c:s.length?s:i).shift());if(!h)for(h=t.split(On),u=h.length-1;o<u;o++)n+=h[o]+s[o];return n+h[u]},On=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Ba)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),Zw=/hsl[a]?\(/,Mf=function(t){var e=t.join(" "),i;if(On.lastIndex=0,On.test(e))return i=Zw.test(e),t[1]=rg(t[1],i),t[0]=rg(t[0],i,Ig(t[1])),!0},Xa,Ai=function(){var r=Date.now,t=500,e=33,i=r(),n=i,s=1e3/240,a=s,o=[],l,h,c,u,d,f,p=function m(_){var g=r()-n,y=_===!0,v,x,E,w;if((g>t||g<0)&&(i+=g-e),n+=g,E=n-i,v=E-a,(v>0||y)&&(w=++u.frame,d=E-u.time*1e3,u.time=E=E/1e3,a+=v+(v>=s?4:s-v),x=1),y||(l=h(m)),x)for(f=0;f<o.length;f++)o[f](E,d,w,_)};return u={time:0,frame:0,tick:function(){p(!0)},deltaRatio:function(_){return d/(1e3/(_||60))},wake:function(){cg&&(!af&&gf()&&(dn=af=window,yf=dn.document||{},Oi.gsap=oi,(dn.gsapVersions||(dn.gsapVersions=[])).push(oi.version),ug(sh||dn.GreenSockGlobals||!dn.gsap&&dn||{}),Cg.forEach(Rg)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&u.sleep(),h=c||function(_){return setTimeout(_,a-u.time*1e3+1|0)},Xa=1,p(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(l),Xa=0,h=Wa},lagSmoothing:function(_,g){t=_||1/0,e=Math.min(g||33,t)},fps:function(_){s=1e3/(_||240),a=u.time*1e3+s},add:function(_,g,y){var v=g?function(x,E,w,A){_(x,E,w,A),u.remove(v)}:_;return u.remove(_),o[y?"unshift":"push"](v),Vr(),v},remove:function(_,g){~(g=o.indexOf(_))&&o.splice(g,1)&&f>=g&&f--},_listeners:o},u}(),Vr=function(){return!Xa&&Ai.wake()},ne={},Jw=/^[\d.\-M][\d.\-,\s]/,Qw=/["']/g,tA=function(t){for(var e={},i=t.substr(1,t.length-3).split(":"),n=i[0],s=1,a=i.length,o,l,h;s<a;s++)l=i[s],o=s!==a-1?l.lastIndexOf(","):l.length,h=l.substr(0,o),e[n]=isNaN(h)?h.replace(Qw,"").trim():+h,n=l.substr(o+1).trim();return e},eA=function(t){var e=t.indexOf("(")+1,i=t.indexOf(")"),n=t.indexOf("(",e);return t.substring(e,~n&&n<i?t.indexOf(")",i+1):i)},iA=function(t){var e=(t+"").split("("),i=ne[e[0]];return i&&e.length>1&&i.config?i.config.apply(null,~t.indexOf("{")?[tA(e[1])]:eA(t).split(",").map(mg)):ne._CE&&Jw.test(t)?ne._CE("",t):i},Lg=function(t){return function(e){return 1-t(1-e)}},Dg=function r(t,e){for(var i=t._first,n;i;)i instanceof Ze?r(i,e):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==e&&(i.timeline?r(i.timeline,e):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=e)),i=i._next},zs=function(t,e){return t&&(Re(t)?t:ne[t]||iA(t))||e},Ws=function(t,e,i,n){i===void 0&&(i=function(l){return 1-e(1-l)}),n===void 0&&(n=function(l){return l<.5?e(l*2)/2:1-e((1-l)*2)/2});var s={easeIn:e,easeOut:i,easeInOut:n},a;return fi(t,function(o){ne[o]=Oi[o]=s,ne[a=o.toLowerCase()]=i;for(var l in s)ne[a+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=ne[o+"."+l]=s[l]}),s},Ng=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},tf=function r(t,e,i){var n=e>=1?e:1,s=(i||(t?.3:.45))/(e<1?e:1),a=s/rf*(Math.asin(1/n)||0),o=function(c){return c===1?1:n*Math.pow(2,-10*c)*Tw((c-a)*s)+1},l=t==="out"?o:t==="in"?function(h){return 1-o(1-h)}:Ng(o);return s=rf/s,l.config=function(h,c){return r(t,h,c)},l},ef=function r(t,e){e===void 0&&(e=1.70158);var i=function(a){return a?--a*a*((e+1)*a+e)+1:0},n=t==="out"?i:t==="in"?function(s){return 1-i(1-s)}:Ng(i);return n.config=function(s){return r(t,s)},n};fi("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;Ws(r+",Power"+(e-1),t?function(i){return Math.pow(i,e)}:function(i){return i},function(i){return 1-Math.pow(1-i,e)},function(i){return i<.5?Math.pow(i*2,e)/2:1-Math.pow((1-i)*2,e)/2})});ne.Linear.easeNone=ne.none=ne.Linear.easeIn;Ws("Elastic",tf("in"),tf("out"),tf());(function(r,t){var e=1/t,i=2*e,n=2.5*e,s=function(o){return o<e?r*o*o:o<i?r*Math.pow(o-1.5/t,2)+.75:o<n?r*(o-=2.25/t)*o+.9375:r*Math.pow(o-2.625/t,2)+.984375};Ws("Bounce",function(a){return 1-s(1-a)},s)})(7.5625,2.75);Ws("Expo",function(r){return Math.pow(2,10*(r-1))*r+r*r*r*r*r*r*(1-r)});Ws("Circ",function(r){return-(lg(1-r*r)-1)});Ws("Sine",function(r){return r===1?1:-Ew(r*Aw)+1});Ws("Back",ef("in"),ef("out"),ef());ne.SteppedEase=ne.steps=Oi.SteppedEase={config:function(t,e){t===void 0&&(t=1);var i=1/t,n=t+(e?0:1),s=e?1:0,a=1-ge;return function(o){return((n*Ya(0,a,o)|0)+s)*i}}};Ur.ease=ne["quad.out"];fi("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return bf+=r+","+r+"Params,"});var Ef=function(t,e){this.id=Mw++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:wf,this.set=e?e.getSetter:ph},qa=function(){function r(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,Hr(this,+e.duration,1,1),this.data=e.data,Se&&(this._ctx=Se,Se.data.push(this)),Xa||Ai.wake()}var t=r.prototype;return t.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},t.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},t.totalDuration=function(i){return arguments.length?(this._dirty=0,Hr(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(i,n){if(Vr(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(fh(this,i),!s._dp||s.parent||vg(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&fn(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===ge||!this._initted&&this._dur&&i||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),pg(this,i,n)),this},t.time=function(i,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+ig(this))%(this._dur+this._rDelay)||(i?this._dur:0),n):this._time},t.totalProgress=function(i,n){return arguments.length?this.totalTime(this.totalDuration()*i,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(i,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+ig(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(i,n){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*s,n):this._repeat?zr(this._tTime,s)+1:1},t.timeScale=function(i,n){if(!arguments.length)return this._rts===-ge?0:this._rts;if(this._rts===i)return this;var s=this.parent&&this._ts?oh(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-ge?0:this._rts,this.totalTime(Ya(-Math.abs(this._delay),this.totalDuration(),s),n!==!1),dh(this),kw(this)},t.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Vr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==ge&&(this._tTime-=ge)))),this):this._ps},t.startTime=function(i){if(arguments.length){this._start=Me(i);var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&fn(n,this,this._start-this._delay),this}return this._start},t.endTime=function(i){return this._start+(Mi(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(i){var n=this.parent||this._dp;return n?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?oh(n.rawTime(i),this):this._tTime:this._tTime},t.revert=function(i){i===void 0&&(i=Dw);var n=Je;return Je=i,Af(this)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),Je=n,this},t.globalTime=function(i){for(var n=this,s=arguments.length?i:n.rawTime();n;)s=n._start+s/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(i):s},t.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,ng(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(i){if(arguments.length){var n=this._time;return this._rDelay=i,ng(this),n?this.time(n):this}return this._rDelay},t.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},t.seek=function(i,n){return this.totalTime(Wi(this,i),Mi(n))},t.restart=function(i,n){return this.play().totalTime(i?-this._delay:0,Mi(n)),this._dur||(this._zTime=-ge),this},t.play=function(i,n){return i!=null&&this.seek(i,n),this.reversed(!1).paused(!1)},t.reverse=function(i,n){return i!=null&&this.seek(i||this.totalDuration(),n),this.reversed(!0).paused(!1)},t.pause=function(i,n){return i!=null&&this.seek(i,n),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-ge:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-ge,this},t.isActive=function(){var i=this.parent||this._dp,n=this._start,s;return!!(!i||this._ts&&this._initted&&i.isActive()&&(s=i.rawTime(!0))>=n&&s<this.endTime(!0)-ge)},t.eventCallback=function(i,n,s){var a=this.vars;return arguments.length>1?(n?(a[i]=n,s&&(a[i+"Params"]=s),i==="onUpdate"&&(this._onUpdate=n)):delete a[i],this):a[i]},t.then=function(i){var n=this,s=n._prom;return new Promise(function(a){var o=Re(i)?i:gg,l=function(){var c=n.then;n.then=null,s&&s(),Re(o)&&(o=o(n))&&(o.then||o===n)&&(n.then=c),a(o),n.then=c};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?l():n._prom=l})},t.kill=function(){Ua(this)},r}();Fi(qa.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-ge,_prom:0,_ps:!1,_rts:1});var Ze=function(r){og(t,r);function t(i,n){var s;return i===void 0&&(i={}),s=r.call(this,i)||this,s.labels={},s.smoothChildTiming=!!i.smoothChildTiming,s.autoRemoveChildren=!!i.autoRemoveChildren,s._sort=Mi(i.sortChildren),Ee&&fn(i.parent||Ee,Nn(s),n),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&yg(Nn(s),i.scrollTrigger),s}var e=t.prototype;return e.to=function(n,s,a){return Ha(0,arguments,this),this},e.from=function(n,s,a){return Ha(1,arguments,this),this},e.fromTo=function(n,s,a,o){return Ha(2,arguments,this),this},e.set=function(n,s,a){return s.duration=0,s.parent=this,za(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Le(n,s,Wi(this,a),1),this},e.call=function(n,s,a){return fn(this,Le.delayedCall(0,n,s),a)},e.staggerTo=function(n,s,a,o,l,h,c){return a.duration=s,a.stagger=a.stagger||o,a.onComplete=h,a.onCompleteParams=c,a.parent=this,new Le(n,a,Wi(this,l)),this},e.staggerFrom=function(n,s,a,o,l,h,c){return a.runBackwards=1,za(a).immediateRender=Mi(a.immediateRender),this.staggerTo(n,s,a,o,l,h,c)},e.staggerFromTo=function(n,s,a,o,l,h,c,u){return o.startAt=a,za(o).immediateRender=Mi(o.immediateRender),this.staggerTo(n,s,o,l,h,c,u)},e.render=function(n,s,a){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,h=this._dur,c=n<=0?0:Me(n),u=this._zTime<0!=n<0&&(this._initted||!h),d,f,p,m,_,g,y,v,x,E,w,A;if(this!==Ee&&c>l&&n>=0&&(c=l),c!==this._tTime||a||u){if(o!==this._time&&h&&(c+=this._time-o,n+=this._time-o),d=c,x=this._start,v=this._ts,g=!v,u&&(h||(o=this._zTime),(n||!s)&&(this._zTime=n)),this._repeat){if(w=this._yoyo,_=h+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(_*100+n,s,a);if(d=Me(c%_),c===l?(m=this._repeat,d=h):(E=Me(c/_),m=~~E,m&&m===E&&(d=h,m--),d>h&&(d=h)),E=zr(this._tTime,_),!o&&this._tTime&&E!==m&&this._tTime-E*_-this._dur<=0&&(E=m),w&&m&1&&(d=h-d,A=1),m!==E&&!this._lock){var P=w&&E&1,b=P===(w&&m&1);if(m<E&&(P=!P),o=P?0:c%h?h:c,this._lock=1,this.render(o||(A?0:Me(m*_)),s,!h)._lock=0,this._tTime=c,!s&&this.parent&&Ni(this,"onRepeat"),this.vars.repeatRefresh&&!A&&(this.invalidate()._lock=1,E=m),o&&o!==this._time||g!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(h=this._dur,l=this._tDur,b&&(this._lock=2,o=P?h:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!A&&this.invalidate()),this._lock=0,!this._ts&&!g)return this;Dg(this,A)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=Hw(this,Me(o),Me(d)),y&&(c-=d-(d=y._start))),this._tTime=c,this._time=d,this._act=!v,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&c&&h&&!s&&!E&&(Ni(this,"onStart"),this._tTime!==c))return this;if(d>=o&&n>=0)for(f=this._first;f;){if(p=f._next,(f._act||d>=f._start)&&f._ts&&y!==f){if(f.parent!==this)return this.render(n,s,a);if(f.render(f._ts>0?(d-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(d-f._start)*f._ts,s,a),d!==this._time||!this._ts&&!g){y=0,p&&(c+=this._zTime=-ge);break}}f=p}else{f=this._last;for(var S=n<0?n:d;f;){if(p=f._prev,(f._act||S<=f._end)&&f._ts&&y!==f){if(f.parent!==this)return this.render(n,s,a);if(f.render(f._ts>0?(S-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(S-f._start)*f._ts,s,a||Je&&Af(f)),d!==this._time||!this._ts&&!g){y=0,p&&(c+=this._zTime=S?-ge:ge);break}}f=p}}if(y&&!s&&(this.pause(),y.render(d>=o?0:-ge)._zTime=d>=o?1:-1,this._ts))return this._start=x,dh(this),this.render(n,s,a);this._onUpdate&&!s&&Ni(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&o)&&(x===this._start||Math.abs(v)!==Math.abs(this._ts))&&(this._lock||((n||!h)&&(c===l&&this._ts>0||!c&&this._ts<0)&&rs(this,1),!s&&!(n<0&&!o)&&(c||o||!l)&&(Ni(this,c===l&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(n,s){var a=this;if(Fn(s)||(s=Wi(this,s,n)),!(n instanceof qa)){if(ai(n))return n.forEach(function(o){return a.add(o,s)}),this;if(He(n))return this.addLabel(n,s);if(Re(n))n=Le.delayedCall(0,n);else return this}return this!==n?fn(this,n,s):this},e.getChildren=function(n,s,a,o){n===void 0&&(n=!0),s===void 0&&(s=!0),a===void 0&&(a=!0),o===void 0&&(o=-Xi);for(var l=[],h=this._first;h;)h._start>=o&&(h instanceof Le?s&&l.push(h):(a&&l.push(h),n&&l.push.apply(l,h.getChildren(!0,s,a)))),h=h._next;return l},e.getById=function(n){for(var s=this.getChildren(1,1,1),a=s.length;a--;)if(s[a].vars.id===n)return s[a]},e.remove=function(n){return He(n)?this.removeLabel(n):Re(n)?this.killTweensOf(n):(n.parent===this&&uh(this,n),n===this._recent&&(this._recent=this._last),Bs(this))},e.totalTime=function(n,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Me(Ai.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,s),this._forcing=0,this):this._tTime},e.addLabel=function(n,s){return this.labels[n]=Wi(this,s),this},e.removeLabel=function(n){return delete this.labels[n],this},e.addPause=function(n,s,a){var o=Le.delayedCall(0,s||Wa,a);return o.data="isPause",this._hasPause=1,fn(this,o,Wi(this,n))},e.removePause=function(n){var s=this._first;for(n=Wi(this,n);s;)s._start===n&&s.data==="isPause"&&rs(s),s=s._next},e.killTweensOf=function(n,s,a){for(var o=this.getTweensOf(n,a),l=o.length;l--;)is!==o[l]&&o[l].kill(n,s);return this},e.getTweensOf=function(n,s){for(var a=[],o=qi(n),l=this._first,h=Fn(s),c;l;)l instanceof Le?Nw(l._targets,o)&&(h?(!is||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&a.push(l):(c=l.getTweensOf(o,s)).length&&a.push.apply(a,c),l=l._next;return a},e.tweenTo=function(n,s){s=s||{};var a=this,o=Wi(a,n),l=s,h=l.startAt,c=l.onStart,u=l.onStartParams,d=l.immediateRender,f,p=Le.to(a,Fi({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:s.duration||Math.abs((o-(h&&"time"in h?h.time:a._time))/a.timeScale())||ge,onStart:function(){if(a.pause(),!f){var _=s.duration||Math.abs((o-(h&&"time"in h?h.time:a._time))/a.timeScale());p._dur!==_&&Hr(p,_,0,1).render(p._time,!0,!0),f=1}c&&c.apply(p,u||[])}},s));return d?p.render(0):p},e.tweenFromTo=function(n,s,a){return this.tweenTo(s,Fi({startAt:{time:Wi(this,n)}},a))},e.recent=function(){return this._recent},e.nextLabel=function(n){return n===void 0&&(n=this._time),sg(this,Wi(this,n))},e.previousLabel=function(n){return n===void 0&&(n=this._time),sg(this,Wi(this,n),1)},e.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+ge)},e.shiftChildren=function(n,s,a){a===void 0&&(a=0);var o=this._first,l=this.labels,h;for(n=Me(n);o;)o._start>=a&&(o._start+=n,o._end+=n),o=o._next;if(s)for(h in l)l[h]>=a&&(l[h]+=n);return Bs(this)},e.invalidate=function(n){var s=this._first;for(this._lock=0;s;)s.invalidate(n),s=s._next;return r.prototype.invalidate.call(this,n)},e.clear=function(n){n===void 0&&(n=!0);for(var s=this._first,a;s;)a=s._next,this.remove(s),s=a;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Bs(this)},e.totalDuration=function(n){var s=0,a=this,o=a._last,l=Xi,h,c,u;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-n:n));if(a._dirty){for(u=a.parent;o;)h=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>l&&a._sort&&o._ts&&!a._lock?(a._lock=1,fn(a,o,c-o._delay,1)._lock=0):l=c,c<0&&o._ts&&(s-=c,(!u&&!a._dp||u&&u.smoothChildTiming)&&(a._start+=Me(c/a._ts),a._time-=c,a._tTime-=c),a.shiftChildren(-c,!1,-1/0),l=0),o._end>s&&o._ts&&(s=o._end),o=h;Hr(a,a===Ee&&a._time>s?a._time:s,1,1),a._dirty=0}return a._tDur},t.updateRoot=function(n){if(Ee._ts&&(pg(Ee,oh(n,Ee)),fg=Ai.frame),Ai.frame>=tg){tg+=Ei.autoSleep||120;var s=Ee._first;if((!s||!s._ts)&&Ei.autoSleep&&Ai._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||Ai.sleep()}}},t}(qa);Fi(Ze.prototype,{_lock:0,_hasPause:0,_forcing:0});var nA=function(t,e,i,n,s,a,o){var l=new pi(this._pt,t,e,0,1,If,null,s),h=0,c=0,u,d,f,p,m,_,g,y;for(l.b=i,l.e=n,i+="",n+="",(g=~n.indexOf("random("))&&(n=Gr(n)),a&&(y=[i,n],a(y,t,e),i=y[0],n=y[1]),d=i.match(Zd)||[];u=Zd.exec(n);)p=u[0],m=n.substring(h,u.index),f?f=(f+1)%5:m.substr(-5)==="rgba("&&(f=1),p!==d[c++]&&(_=parseFloat(d[c-1])||0,l._pt={_next:l._pt,p:m||c===1?m:",",s:_,c:p.charAt(1)==="="?Gs(_,p)-_:parseFloat(p)-_,m:f&&f<4?Math.round:0},h=Zd.lastIndex);return l.c=h<n.length?n.substring(h,n.length):"",l.fp=o,(vf.test(n)||g)&&(l.e=0),this._pt=l,l},Tf=function(t,e,i,n,s,a,o,l,h,c){Re(n)&&(n=n(s||0,t,a));var u=t[e],d=i!=="get"?i:Re(u)?h?t[e.indexOf("set")||!Re(t["get"+e.substr(3)])?e:"get"+e.substr(3)](h):t[e]():u,f=Re(u)?h?lA:kg:Pf,p;if(He(n)&&(~n.indexOf("random(")&&(n=Gr(n)),n.charAt(1)==="="&&(p=Gs(d,n)+(Qe(d)||0),(p||p===0)&&(n=p))),!c||d!==n||ff)return!isNaN(d*n)&&n!==""?(p=new pi(this._pt,t,e,+d||0,n-(d||0),typeof u=="boolean"?cA:Ug,0,f),h&&(p.fp=h),o&&p.modifier(o,this,t),this._pt=p):(!u&&!(e in t)&&ch(e,n),nA.call(this,t,e,d,n,f,l||Ei.stringFilter,h))},sA=function(t,e,i,n,s){if(Re(t)&&(t=Va(t,s,e,i,n)),!pn(t)||t.style&&t.nodeType||ai(t)||hg(t))return He(t)?Va(t,s,e,i,n):t;var a={},o;for(o in t)a[o]=Va(t[o],s,e,i,n);return a},Cf=function(t,e,i,n,s,a){var o,l,h,c;if(wi[t]&&(o=new wi[t]).init(s,o.rawVars?e[t]:sA(e[t],n,s,a,i),i,n,a)!==!1&&(i._pt=l=new pi(i._pt,s,t,0,1,o.render,o,0,o.priority),i!==kr))for(h=i._ptLookup[i._targets.indexOf(s)],c=o._props.length;c--;)h[o._props[c]]=l;return o},is,ff,Rf=function r(t,e,i){var n=t.vars,s=n.ease,a=n.startAt,o=n.immediateRender,l=n.lazy,h=n.onUpdate,c=n.runBackwards,u=n.yoyoEase,d=n.keyframes,f=n.autoRevert,p=t._dur,m=t._startAt,_=t._targets,g=t.parent,y=g&&g.data==="nested"?g.vars.targets:_,v=t._overwrite==="auto"&&!mf,x=t.timeline,E,w,A,P,b,S,I,B,F,H,J,O,V;if(x&&(!d||!s)&&(s="none"),t._ease=zs(s,Ur.ease),t._yEase=u?Lg(zs(u===!0?s:u,Ur.ease)):0,u&&t._yoyo&&!t._repeat&&(u=t._yEase,t._yEase=t._ease,t._ease=u),t._from=!x&&!!n.runBackwards,!x||d&&!n.stagger){if(B=_[0]?ss(_[0]).harness:0,O=B&&n[B.prop],E=ah(n,xf),m&&(m._zTime<0&&m.progress(1),e<0&&c&&o&&!f?m.render(-1,!0):m.revert(c&&p?eh:Lw),m._lazy=0),a){if(rs(t._startAt=Le.set(_,Fi({data:"isStart",overwrite:!1,parent:g,immediateRender:!0,lazy:!m&&Mi(l),startAt:null,delay:0,onUpdate:h&&function(){return Ni(t,"onUpdate")},stagger:0},a))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(Je||!o&&!f)&&t._startAt.revert(eh),o&&p&&e<=0&&i<=0){e&&(t._zTime=e);return}}else if(c&&p&&!m){if(e&&(o=!1),A=Fi({overwrite:!1,data:"isFromStart",lazy:o&&!m&&Mi(l),immediateRender:o,stagger:0,parent:g},E),O&&(A[B.prop]=O),rs(t._startAt=Le.set(_,A)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(Je?t._startAt.revert(eh):t._startAt.render(-1,!0)),t._zTime=e,!o)r(t._startAt,ge,ge);else if(!e)return}for(t._pt=t._ptCache=0,l=p&&Mi(l)||l&&!p,w=0;w<_.length;w++){if(b=_[w],I=b._gsap||Sf(_)[w]._gsap,t._ptLookup[w]=H={},of[I.id]&&ns.length&&rh(),J=y===_?w:y.indexOf(b),B&&(F=new B).init(b,O||E,t,J,y)!==!1&&(t._pt=P=new pi(t._pt,b,F.name,0,1,F.render,F,0,F.priority),F._props.forEach(function(q){H[q]=P}),F.priority&&(S=1)),!B||O)for(A in E)wi[A]&&(F=Cf(A,E,t,J,b,y))?F.priority&&(S=1):H[A]=P=Tf.call(t,b,A,"get",E[A],J,y,0,n.stringFilter);t._op&&t._op[w]&&t.kill(b,t._op[w]),v&&t._pt&&(is=t,Ee.killTweensOf(b,H,t.globalTime(e)),V=!t.parent,is=0),t._pt&&l&&(of[I.id]=1)}S&&Df(t),t._onInit&&t._onInit(t)}t._onUpdate=h,t._initted=(!t._op||t._pt)&&!V,d&&e<=0&&x.render(Xi,!0,!0)},rA=function(t,e,i,n,s,a,o,l){var h=(t._pt&&t._ptCache||(t._ptCache={}))[e],c,u,d,f;if(!h)for(h=t._ptCache[e]=[],d=t._ptLookup,f=t._targets.length;f--;){if(c=d[f][e],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==e&&c.fp!==e;)c=c._next;if(!c)return ff=1,t.vars[e]="+=0",Rf(t,o),ff=0,l?Ga(e+" not eligible for reset"):1;h.push(c)}for(f=h.length;f--;)u=h[f],c=u._pt||u,c.s=(n||n===0)&&!s?n:c.s+(n||0)+a*c.c,c.c=i-c.s,u.e&&(u.e=Pe(i)+Qe(u.e)),u.b&&(u.b=c.s+Qe(u.b))},aA=function(t,e){var i=t[0]?ss(t[0]).harness:0,n=i&&i.aliases,s,a,o,l;if(!n)return e;s=Br({},e);for(a in n)if(a in s)for(l=n[a].split(","),o=l.length;o--;)s[l[o]]=s[a];return s},oA=function(t,e,i,n){var s=e.ease||n||"power1.inOut",a,o;if(ai(e))o=i[t]||(i[t]=[]),e.forEach(function(l,h){return o.push({t:h/(e.length-1)*100,v:l,e:s})});else for(a in e)o=i[a]||(i[a]=[]),a==="ease"||o.push({t:parseFloat(t),v:e[a],e:s})},Va=function(t,e,i,n,s){return Re(t)?t.call(e,i,n,s):He(t)&&~t.indexOf("random(")?Gr(t):t},Og=bf+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Fg={};fi(Og+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return Fg[r]=1});var Le=function(r){og(t,r);function t(i,n,s,a){var o;typeof n=="number"&&(s.duration=n,n=s,s=null),o=r.call(this,a?n:za(n))||this;var l=o.vars,h=l.duration,c=l.delay,u=l.immediateRender,d=l.stagger,f=l.overwrite,p=l.keyframes,m=l.defaults,_=l.scrollTrigger,g=l.yoyoEase,y=n.parent||Ee,v=(ai(i)||hg(i)?Fn(i[0]):"length"in n)?[i]:qi(i),x,E,w,A,P,b,S,I;if(o._targets=v.length?Sf(v):Ga("GSAP target "+i+" not found. https://gsap.com",!Ei.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=f,p||d||th(h)||th(c)){if(n=o.vars,x=o.timeline=new Ze({data:"nested",defaults:m||{},targets:y&&y.data==="nested"?y.vars.targets:v}),x.kill(),x.parent=x._dp=Nn(o),x._start=0,d||th(h)||th(c)){if(A=v.length,S=d&&wg(d),pn(d))for(P in d)~Og.indexOf(P)&&(I||(I={}),I[P]=d[P]);for(E=0;E<A;E++)w=ah(n,Fg),w.stagger=0,g&&(w.yoyoEase=g),I&&Br(w,I),b=v[E],w.duration=+Va(h,Nn(o),E,b,v),w.delay=(+Va(c,Nn(o),E,b,v)||0)-o._delay,!d&&A===1&&w.delay&&(o._delay=c=w.delay,o._start+=c,w.delay=0),x.to(b,w,S?S(E,b,v):0),x._ease=ne.none;x.duration()?h=c=0:o.timeline=0}else if(p){za(Fi(x.vars.defaults,{ease:"none"})),x._ease=zs(p.ease||n.ease||"none");var B=0,F,H,J;if(ai(p))p.forEach(function(O){return x.to(v,O,">")}),x.duration();else{w={};for(P in p)P==="ease"||P==="easeEach"||oA(P,p[P],w,p.easeEach);for(P in w)for(F=w[P].sort(function(O,V){return O.t-V.t}),B=0,E=0;E<F.length;E++)H=F[E],J={ease:H.e,duration:(H.t-(E?F[E-1].t:0))/100*h},J[P]=H.v,x.to(v,J,B),B+=J.duration;x.duration()<h&&x.to({},{duration:h-x.duration()})}}h||o.duration(h=x.duration())}else o.timeline=0;return f===!0&&!mf&&(is=Nn(o),Ee.killTweensOf(v),is=0),fn(y,Nn(o),s),n.reversed&&o.reverse(),n.paused&&o.paused(!0),(u||!h&&!p&&o._start===Me(y._time)&&Mi(u)&&Uw(Nn(o))&&y.data!=="nested")&&(o._tTime=-ge,o.render(Math.max(0,-c)||0)),_&&yg(Nn(o),_),o}var e=t.prototype;return e.render=function(n,s,a){var o=this._time,l=this._tDur,h=this._dur,c=n<0,u=n>l-ge&&!c?l:n<ge?0:n,d,f,p,m,_,g,y,v,x;if(!h)zw(this,n,s,a);else if(u!==this._tTime||!n||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(d=u,v=this.timeline,this._repeat){if(m=h+this._rDelay,this._repeat<-1&&c)return this.totalTime(m*100+n,s,a);if(d=Me(u%m),u===l?(p=this._repeat,d=h):(_=Me(u/m),p=~~_,p&&p===_?(d=h,p--):d>h&&(d=h)),g=this._yoyo&&p&1,g&&(x=this._yEase,d=h-d),_=zr(this._tTime,m),d===o&&!a&&this._initted&&p===_)return this._tTime=u,this;p!==_&&(v&&this._yEase&&Dg(v,g),this.vars.repeatRefresh&&!g&&!this._lock&&d!==m&&this._initted&&(this._lock=a=1,this.render(Me(m*p),!0).invalidate()._lock=0))}if(!this._initted){if(xg(this,c?n:d,a,s,u))return this._tTime=0,this;if(o!==this._time&&!(a&&this.vars.repeatRefresh&&p!==_))return this;if(h!==this._dur)return this.render(n,s,a)}if(this._tTime=u,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(x||this._ease)(d/h),this._from&&(this.ratio=y=1-y),!o&&u&&!s&&!_&&(Ni(this,"onStart"),this._tTime!==u))return this;for(f=this._pt;f;)f.r(y,f.d),f=f._next;v&&v.render(n<0?n:v._dur*v._ease(d/this._dur),s,a)||this._startAt&&(this._zTime=n),this._onUpdate&&!s&&(c&&lf(this,n,s,a),Ni(this,"onUpdate")),this._repeat&&p!==_&&this.vars.onRepeat&&!s&&this.parent&&Ni(this,"onRepeat"),(u===this._tDur||!u)&&this._tTime===u&&(c&&!this._onUpdate&&lf(this,n,!0,!0),(n||!h)&&(u===this._tDur&&this._ts>0||!u&&this._ts<0)&&rs(this,1),!s&&!(c&&!o)&&(u||o||g)&&(Ni(this,u===l?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},e.resetTo=function(n,s,a,o,l){Xa||Ai.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||Rf(this,h),c=this._ease(h/this._dur),rA(this,n,s,a,o,c,h,l)?this.resetTo(n,s,a,o,1):(fh(this,0),this.parent||_g(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(n,s){if(s===void 0&&(s="all"),!n&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?Ua(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Je),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(n,s,is&&is.vars.overwrite!==!0)._first||Ua(this),this.parent&&a!==this.timeline.totalDuration()&&Hr(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,l=n?qi(n):o,h=this._ptLookup,c=this._pt,u,d,f,p,m,_,g;if((!s||s==="all")&&Fw(o,l))return s==="all"&&(this._pt=0),Ua(this);for(u=this._op=this._op||[],s!=="all"&&(He(s)&&(m={},fi(s,function(y){return m[y]=1}),s=m),s=aA(o,s)),g=o.length;g--;)if(~l.indexOf(o[g])){d=h[g],s==="all"?(u[g]=s,p=d,f={}):(f=u[g]=u[g]||{},p=s);for(m in p)_=d&&d[m],_&&((!("kill"in _.d)||_.d.kill(m)===!0)&&uh(this,_,"_pt"),delete d[m]),f!=="all"&&(f[m]=1)}return this._initted&&!this._pt&&c&&Ua(this),this},t.to=function(n,s){return new t(n,s,arguments[2])},t.from=function(n,s){return Ha(1,arguments)},t.delayedCall=function(n,s,a,o){return new t(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:s,onReverseComplete:s,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},t.fromTo=function(n,s,a){return Ha(2,arguments)},t.set=function(n,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new t(n,s)},t.killTweensOf=function(n,s,a){return Ee.killTweensOf(n,s,a)},t}(qa);Fi(Le.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});fi("staggerTo,staggerFrom,staggerFromTo",function(r){Le[r]=function(){var t=new Ze,e=cf.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var Pf=function(t,e,i){return t[e]=i},kg=function(t,e,i){return t[e](i)},lA=function(t,e,i,n){return t[e](n.fp,i)},hA=function(t,e,i){return t.setAttribute(e,i)},ph=function(t,e){return Re(t[e])?kg:hh(t[e])&&t.setAttribute?hA:Pf},Ug=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},cA=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},If=function(t,e){var i=e._pt,n="";if(!t&&e.b)n=e.b;else if(t===1&&e.e)n=e.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*t):Math.round((i.s+i.c*t)*1e4)/1e4)+n,i=i._next;n+=e.c}e.set(e.t,e.p,n,e)},Lf=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},uA=function(t,e,i,n){for(var s=this._pt,a;s;)a=s._next,s.p===n&&s.modifier(t,e,i),s=a},dA=function(t){for(var e=this._pt,i,n;e;)n=e._next,e.p===t&&!e.op||e.op===t?uh(this,e,"_pt"):e.dep||(i=1),e=n;return!i},fA=function(t,e,i,n){n.mSet(t,e,n.m.call(n.tween,i,n.mt),n)},Df=function(t){for(var e=t._pt,i,n,s,a;e;){for(i=e._next,n=s;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:a)?e._prev._next=e:s=e,(e._next=n)?n._prev=e:a=e,e=i}t._pt=s},pi=function(){function r(e,i,n,s,a,o,l,h,c){this.t=i,this.s=s,this.c=a,this.p=n,this.r=o||Ug,this.d=l||this,this.set=h||Pf,this.pr=c||0,this._next=e,e&&(e._prev=this)}var t=r.prototype;return t.modifier=function(i,n,s){this.mSet=this.mSet||this.set,this.set=fA,this.m=i,this.mt=s,this.tween=n},r}();fi(bf+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return xf[r]=1});Oi.TweenMax=Oi.TweenLite=Le;Oi.TimelineLite=Oi.TimelineMax=Ze;Ee=new Ze({sortChildren:!1,defaults:Ur,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ei.stringFilter=Mf;var Hs=[],nh={},pA=[],ag=0,mA=0,nf=function(t){return(nh[t]||pA).map(function(e){return e()})},pf=function(){var t=Date.now(),e=[];t-ag>2&&(nf("matchMediaInit"),Hs.forEach(function(i){var n=i.queries,s=i.conditions,a,o,l,h;for(o in n)a=dn.matchMedia(n[o]).matches,a&&(l=1),a!==s[o]&&(s[o]=a,h=1);h&&(i.revert(),l&&e.push(i))}),nf("matchMediaRevert"),e.forEach(function(i){return i.onMatch(i,function(n){return i.add(null,n)})}),ag=t,nf("matchMedia"))},Bg=function(){function r(e,i){this.selector=i&&uf(i),this.data=[],this._r=[],this.isReverted=!1,this.id=mA++,e&&this.add(e)}var t=r.prototype;return t.add=function(i,n,s){Re(i)&&(s=n,n=i,i=Re);var a=this,o=function(){var h=Se,c=a.selector,u;return h&&h!==a&&h.data.push(a),s&&(a.selector=uf(s)),Se=a,u=n.apply(a,arguments),Re(u)&&a._r.push(u),Se=h,a.selector=c,a.isReverted=!1,u};return a.last=o,i===Re?o(a,function(l){return a.add(null,l)}):i?a[i]=o:o},t.ignore=function(i){var n=Se;Se=null,i(this),Se=n},t.getTweens=function(){var i=[];return this.data.forEach(function(n){return n instanceof r?i.push.apply(i,n.getTweens()):n instanceof Le&&!(n.parent&&n.parent.data==="nested")&&i.push(n)}),i},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(i,n){var s=this;if(i?function(){for(var o=s.getTweens(),l=s.data.length,h;l--;)h=s.data[l],h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,u){return u.g-c.g||-1/0}).forEach(function(c){return c.t.revert(i)}),l=s.data.length;l--;)h=s.data[l],h instanceof Ze?h.data!=="nested"&&(h.scrollTrigger&&h.scrollTrigger.revert(),h.kill()):!(h instanceof Le)&&h.revert&&h.revert(i);s._r.forEach(function(c){return c(i,s)}),s.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),n)for(var a=Hs.length;a--;)Hs[a].id===this.id&&Hs.splice(a,1)},t.revert=function(i){this.kill(i||{})},r}(),gA=function(){function r(e){this.contexts=[],this.scope=e,Se&&Se.data.push(this)}var t=r.prototype;return t.add=function(i,n,s){pn(i)||(i={matches:i});var a=new Bg(0,s||this.scope),o=a.conditions={},l,h,c;Se&&!a.selector&&(a.selector=Se.selector),this.contexts.push(a),n=a.add("onMatch",n),a.queries=i;for(h in i)h==="all"?c=1:(l=dn.matchMedia(i[h]),l&&(Hs.indexOf(a)<0&&Hs.push(a),(o[h]=l.matches)&&(c=1),l.addListener?l.addListener(pf):l.addEventListener("change",pf)));return c&&n(a,function(u){return a.add(null,u)}),this},t.revert=function(i){this.kill(i||{})},t.kill=function(i){this.contexts.forEach(function(n){return n.kill(i,!0)})},r}(),lh={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach(function(n){return Rg(n)})},timeline:function(t){return new Ze(t)},getTweensOf:function(t,e){return Ee.getTweensOf(t,e)},getProperty:function(t,e,i,n){He(t)&&(t=qi(t)[0]);var s=ss(t||{}).get,a=i?gg:mg;return i==="native"&&(i=""),t&&(e?a((wi[e]&&wi[e].get||s)(t,e,i,n)):function(o,l,h){return a((wi[o]&&wi[o].get||s)(t,o,l,h))})},quickSetter:function(t,e,i){if(t=qi(t),t.length>1){var n=t.map(function(c){return oi.quickSetter(c,e,i)}),s=n.length;return function(c){for(var u=s;u--;)n[u](c)}}t=t[0]||{};var a=wi[e],o=ss(t),l=o.harness&&(o.harness.aliases||{})[e]||e,h=a?function(c){var u=new a;kr._pt=0,u.init(t,i?c+i:c,kr,0,[t]),u.render(1,u),kr._pt&&Lf(1,kr)}:o.set(t,l);return a?h:function(c){return h(t,l,i?c+i:c,o,1)}},quickTo:function(t,e,i){var n,s=oi.to(t,Fi((n={},n[e]="+=0.1",n.paused=!0,n.stagger=0,n),i||{})),a=function(l,h,c){return s.resetTo(e,l,h,c)};return a.tween=s,a},isTweening:function(t){return Ee.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=zs(t.ease,Ur.ease)),eg(Ur,t||{})},config:function(t){return eg(Ei,t||{})},registerEffect:function(t){var e=t.name,i=t.effect,n=t.plugins,s=t.defaults,a=t.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!wi[o]&&!Oi[o]&&Ga(e+" effect requires "+o+" plugin.")}),Jd[e]=function(o,l,h){return i(qi(o),Fi(l||{},s),h)},a&&(Ze.prototype[e]=function(o,l,h){return this.add(Jd[e](o,pn(l)?l:(h=l)&&{},this),h)})},registerEase:function(t,e){ne[t]=zs(e)},parseEase:function(t,e){return arguments.length?zs(t,e):ne},getById:function(t){return Ee.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var i=new Ze(t),n,s;for(i.smoothChildTiming=Mi(t.smoothChildTiming),Ee.remove(i),i._dp=0,i._time=i._tTime=Ee._time,n=Ee._first;n;)s=n._next,(e||!(!n._dur&&n instanceof Le&&n.vars.onComplete===n._targets[0]))&&fn(i,n,n._start-n._delay),n=s;return fn(Ee,i,0),i},context:function(t,e){return t?new Bg(t,e):Se},matchMedia:function(t){return new gA(t)},matchMediaRefresh:function(){return Hs.forEach(function(t){var e=t.conditions,i,n;for(n in e)e[n]&&(e[n]=!1,i=1);i&&t.revert()})||pf()},addEventListener:function(t,e){var i=nh[t]||(nh[t]=[]);~i.indexOf(e)||i.push(e)},removeEventListener:function(t,e){var i=nh[t],n=i&&i.indexOf(e);n>=0&&i.splice(n,1)},utils:{wrap:$w,wrapYoyo:Kw,distribute:wg,random:Mg,snap:Ag,normalize:Yw,getUnit:Qe,clamp:Gw,splitColor:Pg,toArray:qi,selector:uf,mapRange:Tg,pipe:Xw,unitize:qw,interpolate:jw,shuffle:Sg},install:ug,effects:Jd,ticker:Ai,updateRoot:Ze.updateRoot,plugins:wi,globalTimeline:Ee,core:{PropTween:pi,globals:dg,Tween:Le,Timeline:Ze,Animation:qa,getCache:ss,_removeLinkedListItem:uh,reverting:function(){return Je},context:function(t){return t&&Se&&(Se.data.push(t),t._ctx=Se),Se},suppressOverwrites:function(t){return mf=t}}};fi("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return lh[r]=Le[r]});Ai.add(Ze.updateRoot);kr=lh.to({},{duration:0});var _A=function(t,e){for(var i=t._pt;i&&i.p!==e&&i.op!==e&&i.fp!==e;)i=i._next;return i},vA=function(t,e){var i=t._targets,n,s,a;for(n in e)for(s=i.length;s--;)a=t._ptLookup[s][n],a&&(a=a.d)&&(a._pt&&(a=_A(a,n)),a&&a.modifier&&a.modifier(e[n],t,i[s],n))},sf=function(t,e){return{name:t,headless:1,rawVars:1,init:function(n,s,a){a._onInit=function(o){var l,h;if(He(s)&&(l={},fi(s,function(c){return l[c]=1}),s=l),e){l={};for(h in s)l[h]=e(s[h]);s=l}vA(o,s)}}}},oi=lh.registerPlugin({name:"attr",init:function(t,e,i,n,s){var a,o,l;this.tween=i;for(a in e)l=t.getAttribute(a)||"",o=this.add(t,"setAttribute",(l||0)+"",e[a],n,s,0,0,a),o.op=a,o.b=l,this._props.push(a)},render:function(t,e){for(var i=e._pt;i;)Je?i.set(i.t,i.p,i.b,i):i.r(t,i.d),i=i._next}},{name:"endArray",headless:1,init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i],0,0,0,0,0,1)}},sf("roundProps",df),sf("modifiers"),sf("snap",Ag))||lh;Le.version=Ze.version=oi.version="3.14.2";cg=1;gf()&&Vr();var yA=ne.Power0,xA=ne.Power1,bA=ne.Power2,SA=ne.Power3,wA=ne.Power4,AA=ne.Linear,MA=ne.Quad,EA=ne.Cubic,TA=ne.Quart,CA=ne.Quint,RA=ne.Strong,PA=ne.Elastic,IA=ne.Back,LA=ne.SteppedEase,DA=ne.Bounce,NA=ne.Sine,OA=ne.Expo,FA=ne.Circ;var zg,os,Xr,Bf,$s,kA,Hg,zf,UA=function(){return typeof window<"u"},Un={},Ys=180/Math.PI,qr=Math.PI/180,Wr=Math.atan2,Vg=1e8,Hf=/([A-Z])/g,BA=/(left|right|width|margin|padding|x)/i,zA=/[\s,\(]\S/,mn={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Of=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},HA=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},VA=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},GA=function(t,e){return e.set(e.t,e.p,t===1?e.e:t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},WA=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},jg=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Zg=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},XA=function(t,e,i){return t.style[e]=i},qA=function(t,e,i){return t.style.setProperty(e,i)},YA=function(t,e,i){return t._gsap[e]=i},$A=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},KA=function(t,e,i,n,s){var a=t._gsap;a.scaleX=a.scaleY=i,a.renderTransform(s,a)},jA=function(t,e,i,n,s){var a=t._gsap;a[e]=i,a.renderTransform(s,a)},Te="transform",Ti=Te+"Origin",ZA=function r(t,e){var i=this,n=this.target,s=n.style,a=n._gsap;if(t in Un&&s){if(this.tfm=this.tfm||{},t!=="transform")t=mn[t]||t,~t.indexOf(",")?t.split(",").forEach(function(o){return i.tfm[o]=kn(n,o)}):this.tfm[t]=a.x?a[t]:kn(n,t),t===Ti&&(this.tfm.zOrigin=a.zOrigin);else return mn.transform.split(",").forEach(function(o){return r.call(i,o,e)});if(this.props.indexOf(Te)>=0)return;a.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(Ti,e,"")),t=Te}(s||e)&&this.props.push(t,e,s[t])},Jg=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},JA=function(){var t=this.props,e=this.target,i=e.style,n=e._gsap,s,a;for(s=0;s<t.length;s+=3)t[s+1]?t[s+1]===2?e[t[s]](t[s+2]):e[t[s]]=t[s+2]:t[s+2]?i[t[s]]=t[s+2]:i.removeProperty(t[s].substr(0,2)==="--"?t[s]:t[s].replace(Hf,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)n[a]=this.tfm[a];n.svg&&(n.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),s=zf(),(!s||!s.isStart)&&!i[Te]&&(Jg(i),n.zOrigin&&i[Ti]&&(i[Ti]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},Qg=function(t,e){var i={target:t,props:[],revert:JA,save:ZA};return t._gsap||oi.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach(function(n){return i.save(n)}),i},t_,Ff=function(t,e){var i=os.createElementNS?os.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):os.createElement(t);return i&&i.style?i:os.createElement(t)},ki=function r(t,e,i){var n=getComputedStyle(t);return n[e]||n.getPropertyValue(e.replace(Hf,"-$1").toLowerCase())||n.getPropertyValue(e)||!i&&r(t,Yr(e)||e,1)||""},Gg="O,Moz,ms,Ms,Webkit".split(","),Yr=function(t,e,i){var n=e||$s,s=n.style,a=5;if(t in s&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);a--&&!(Gg[a]+t in s););return a<0?null:(a===3?"ms":a>=0?Gg[a]:"")+t},kf=function(){UA()&&window.document&&(zg=window,os=zg.document,Xr=os.documentElement,$s=Ff("div")||{style:{}},kA=Ff("div"),Te=Yr(Te),Ti=Te+"Origin",$s.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",t_=!!Yr("perspective"),zf=oi.core.reverting,Bf=1)},Wg=function(t){var e=t.ownerSVGElement,i=Ff("svg",e&&e.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=t.cloneNode(!0),s;n.style.display="block",i.appendChild(n),Xr.appendChild(i);try{s=n.getBBox()}catch{}return i.removeChild(n),Xr.removeChild(i),s},Xg=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},e_=function(t){var e,i;try{e=t.getBBox()}catch{e=Wg(t),i=1}return e&&(e.width||e.height)||i||(e=Wg(t)),e&&!e.width&&!e.x&&!e.y?{x:+Xg(t,["x","cx","x1"])||0,y:+Xg(t,["y","cy","y1"])||0,width:0,height:0}:e},i_=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&e_(t))},hs=function(t,e){if(e){var i=t.style,n;e in Un&&e!==Ti&&(e=Te),i.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),i.removeProperty(n==="--"?e:e.replace(Hf,"-$1").toLowerCase())):i.removeAttribute(e)}},ls=function(t,e,i,n,s,a){var o=new pi(t._pt,e,i,0,1,a?Zg:jg);return t._pt=o,o.b=n,o.e=s,t._props.push(i),o},qg={deg:1,rad:1,turn:1},QA={grid:1,flex:1},cs=function r(t,e,i,n){var s=parseFloat(i)||0,a=(i+"").trim().substr((s+"").length)||"px",o=$s.style,l=BA.test(e),h=t.tagName.toLowerCase()==="svg",c=(h?"client":"offset")+(l?"Width":"Height"),u=100,d=n==="px",f=n==="%",p,m,_,g;if(n===a||!s||qg[n]||qg[a])return s;if(a!=="px"&&!d&&(s=r(t,e,i,"px")),g=t.getCTM&&i_(t),(f||a==="%")&&(Un[e]||~e.indexOf("adius")))return p=g?t.getBBox()[l?"width":"height"]:t[c],Pe(f?s/p*u:s/100*p);if(o[l?"width":"height"]=u+(d?a:n),m=n!=="rem"&&~e.indexOf("adius")||n==="em"&&t.appendChild&&!h?t:t.parentNode,g&&(m=(t.ownerSVGElement||{}).parentNode),(!m||m===os||!m.appendChild)&&(m=os.body),_=m._gsap,_&&f&&_.width&&l&&_.time===Ai.time&&!_.uncache)return Pe(s/_.width*u);if(f&&(e==="height"||e==="width")){var y=t.style[e];t.style[e]=u+n,p=t[c],y?t.style[e]=y:hs(t,e)}else(f||a==="%")&&!QA[ki(m,"display")]&&(o.position=ki(t,"position")),m===t&&(o.position="static"),m.appendChild($s),p=$s[c],m.removeChild($s),o.position="absolute";return l&&f&&(_=ss(m),_.time=Ai.time,_.width=m[c]),Pe(d?p*s/u:p&&s?u/p*s:0)},kn=function(t,e,i,n){var s;return Bf||kf(),e in mn&&e!=="transform"&&(e=mn[e],~e.indexOf(",")&&(e=e.split(",")[0])),Un[e]&&e!=="transform"?(s=ja(t,n),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:gh(ki(t,Ti))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||n||~(s+"").indexOf("calc("))&&(s=mh[e]&&mh[e](t,e,i)||ki(t,e)||wf(t,e)||(e==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?cs(t,e,s,i)+i:s},tM=function(t,e,i,n){if(!i||i==="none"){var s=Yr(e,t,1),a=s&&ki(t,s,1);a&&a!==i?(e=s,i=a):e==="borderColor"&&(i=ki(t,"borderTopColor"))}var o=new pi(this._pt,t.style,e,0,1,If),l=0,h=0,c,u,d,f,p,m,_,g,y,v,x,E;if(o.b=i,o.e=n,i+="",n+="",n.substring(0,6)==="var(--"&&(n=ki(t,n.substring(4,n.indexOf(")")))),n==="auto"&&(m=t.style[e],t.style[e]=n,n=ki(t,e)||n,m?t.style[e]=m:hs(t,e)),c=[i,n],Mf(c),i=c[0],n=c[1],d=i.match(Vs)||[],E=n.match(Vs)||[],E.length){for(;u=Vs.exec(n);)_=u[0],y=n.substring(l,u.index),p?p=(p+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(p=1),_!==(m=d[h++]||"")&&(f=parseFloat(m)||0,x=m.substr((f+"").length),_.charAt(1)==="="&&(_=Gs(f,_)+x),g=parseFloat(_),v=_.substr((g+"").length),l=Vs.lastIndex-v.length,v||(v=v||Ei.units[e]||x,l===n.length&&(n+=v,o.e+=v)),x!==v&&(f=cs(t,e,m,v)||0),o._pt={_next:o._pt,p:y||h===1?y:",",s:f,c:g-f,m:p&&p<4||e==="zIndex"?Math.round:0});o.c=l<n.length?n.substring(l,n.length):""}else o.r=e==="display"&&n==="none"?Zg:jg;return vf.test(n)&&(o.e=0),this._pt=o,o},Yg={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},eM=function(t){var e=t.split(" "),i=e[0],n=e[1]||"50%";return(i==="top"||i==="bottom"||n==="left"||n==="right")&&(t=i,i=n,n=t),e[0]=Yg[i]||i,e[1]=Yg[n]||n,e.join(" ")},iM=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i=e.t,n=i.style,s=e.u,a=i._gsap,o,l,h;if(s==="all"||s===!0)n.cssText="",l=1;else for(s=s.split(","),h=s.length;--h>-1;)o=s[h],Un[o]&&(l=1,o=o==="transformOrigin"?Ti:Te),hs(i,o);l&&(hs(i,Te),a&&(a.svg&&i.removeAttribute("transform"),n.scale=n.rotate=n.translate="none",ja(i,1),a.uncache=1,Jg(n)))}},mh={clearProps:function(t,e,i,n,s){if(s.data!=="isFromStart"){var a=t._pt=new pi(t._pt,e,i,0,0,iM);return a.u=n,a.pr=-10,a.tween=s,t._props.push(i),1}}},Ka=[1,0,0,1,0,0],n_={},s_=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},$g=function(t){var e=ki(t,Te);return s_(e)?Ka:e.substr(7).match(_f).map(Pe)},Vf=function(t,e){var i=t._gsap||ss(t),n=t.style,s=$g(t),a,o,l,h;return i.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?Ka:s):(s===Ka&&!t.offsetParent&&t!==Xr&&!i.svg&&(l=n.display,n.display="block",a=t.parentNode,(!a||!t.offsetParent&&!t.getBoundingClientRect().width)&&(h=1,o=t.nextElementSibling,Xr.appendChild(t)),s=$g(t),l?n.display=l:hs(t,"display"),h&&(o?a.insertBefore(t,o):a?a.appendChild(t):Xr.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Uf=function(t,e,i,n,s,a){var o=t._gsap,l=s||Vf(t,!0),h=o.xOrigin||0,c=o.yOrigin||0,u=o.xOffset||0,d=o.yOffset||0,f=l[0],p=l[1],m=l[2],_=l[3],g=l[4],y=l[5],v=e.split(" "),x=parseFloat(v[0])||0,E=parseFloat(v[1])||0,w,A,P,b;i?l!==Ka&&(A=f*_-p*m)&&(P=x*(_/A)+E*(-m/A)+(m*y-_*g)/A,b=x*(-p/A)+E*(f/A)-(f*y-p*g)/A,x=P,E=b):(w=e_(t),x=w.x+(~v[0].indexOf("%")?x/100*w.width:x),E=w.y+(~(v[1]||v[0]).indexOf("%")?E/100*w.height:E)),n||n!==!1&&o.smooth?(g=x-h,y=E-c,o.xOffset=u+(g*f+y*m)-g,o.yOffset=d+(g*p+y*_)-y):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=E,o.smooth=!!n,o.origin=e,o.originIsAbsolute=!!i,t.style[Ti]="0px 0px",a&&(ls(a,o,"xOrigin",h,x),ls(a,o,"yOrigin",c,E),ls(a,o,"xOffset",u,o.xOffset),ls(a,o,"yOffset",d,o.yOffset)),t.setAttribute("data-svg-origin",x+" "+E)},ja=function(t,e){var i=t._gsap||new Ef(t);if("x"in i&&!e&&!i.uncache)return i;var n=t.style,s=i.scaleX<0,a="px",o="deg",l=getComputedStyle(t),h=ki(t,Ti)||"0",c,u,d,f,p,m,_,g,y,v,x,E,w,A,P,b,S,I,B,F,H,J,O,V,q,W,Q,tt,ht,nt,G,K;return c=u=d=m=_=g=y=v=x=0,f=p=1,i.svg=!!(t.getCTM&&i_(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(n[Te]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Te]!=="none"?l[Te]:"")),n.scale=n.rotate=n.translate="none"),A=Vf(t,i.svg),i.svg&&(i.uncache?(q=t.getBBox(),h=i.xOrigin-q.x+"px "+(i.yOrigin-q.y)+"px",V=""):V=!e&&t.getAttribute("data-svg-origin"),Uf(t,V||h,!!V||i.originIsAbsolute,i.smooth!==!1,A)),E=i.xOrigin||0,w=i.yOrigin||0,A!==Ka&&(I=A[0],B=A[1],F=A[2],H=A[3],c=J=A[4],u=O=A[5],A.length===6?(f=Math.sqrt(I*I+B*B),p=Math.sqrt(H*H+F*F),m=I||B?Wr(B,I)*Ys:0,y=F||H?Wr(F,H)*Ys+m:0,y&&(p*=Math.abs(Math.cos(y*qr))),i.svg&&(c-=E-(E*I+w*F),u-=w-(E*B+w*H))):(K=A[6],nt=A[7],Q=A[8],tt=A[9],ht=A[10],G=A[11],c=A[12],u=A[13],d=A[14],P=Wr(K,ht),_=P*Ys,P&&(b=Math.cos(-P),S=Math.sin(-P),V=J*b+Q*S,q=O*b+tt*S,W=K*b+ht*S,Q=J*-S+Q*b,tt=O*-S+tt*b,ht=K*-S+ht*b,G=nt*-S+G*b,J=V,O=q,K=W),P=Wr(-F,ht),g=P*Ys,P&&(b=Math.cos(-P),S=Math.sin(-P),V=I*b-Q*S,q=B*b-tt*S,W=F*b-ht*S,G=H*S+G*b,I=V,B=q,F=W),P=Wr(B,I),m=P*Ys,P&&(b=Math.cos(P),S=Math.sin(P),V=I*b+B*S,q=J*b+O*S,B=B*b-I*S,O=O*b-J*S,I=V,J=q),_&&Math.abs(_)+Math.abs(m)>359.9&&(_=m=0,g=180-g),f=Pe(Math.sqrt(I*I+B*B+F*F)),p=Pe(Math.sqrt(O*O+K*K)),P=Wr(J,O),y=Math.abs(P)>2e-4?P*Ys:0,x=G?1/(G<0?-G:G):0),i.svg&&(V=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!s_(ki(t,Te)),V&&t.setAttribute("transform",V))),Math.abs(y)>90&&Math.abs(y)<270&&(s?(f*=-1,y+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,y+=y<=0?180:-180)),e=e||i.uncache,i.x=c-((i.xPercent=c&&(!e&&i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+a,i.y=u-((i.yPercent=u&&(!e&&i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-u)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+a,i.z=d+a,i.scaleX=Pe(f),i.scaleY=Pe(p),i.rotation=Pe(m)+o,i.rotationX=Pe(_)+o,i.rotationY=Pe(g)+o,i.skewX=y+o,i.skewY=v+o,i.transformPerspective=x+a,(i.zOrigin=parseFloat(h.split(" ")[2])||!e&&i.zOrigin||0)&&(n[Ti]=gh(h)),i.xOffset=i.yOffset=0,i.force3D=Ei.force3D,i.renderTransform=i.svg?sM:t_?r_:nM,i.uncache=0,i},gh=function(t){return(t=t.split(" "))[0]+" "+t[1]},Nf=function(t,e,i){var n=Qe(e);return Pe(parseFloat(e)+parseFloat(cs(t,"x",i+"px",n)))+n},nM=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,r_(t,e)},Xs="0deg",$a="0px",qs=") ",r_=function(t,e){var i=e||this,n=i.xPercent,s=i.yPercent,a=i.x,o=i.y,l=i.z,h=i.rotation,c=i.rotationY,u=i.rotationX,d=i.skewX,f=i.skewY,p=i.scaleX,m=i.scaleY,_=i.transformPerspective,g=i.force3D,y=i.target,v=i.zOrigin,x="",E=g==="auto"&&t&&t!==1||g===!0;if(v&&(u!==Xs||c!==Xs)){var w=parseFloat(c)*qr,A=Math.sin(w),P=Math.cos(w),b;w=parseFloat(u)*qr,b=Math.cos(w),a=Nf(y,a,A*b*-v),o=Nf(y,o,-Math.sin(w)*-v),l=Nf(y,l,P*b*-v+v)}_!==$a&&(x+="perspective("+_+qs),(n||s)&&(x+="translate("+n+"%, "+s+"%) "),(E||a!==$a||o!==$a||l!==$a)&&(x+=l!==$a||E?"translate3d("+a+", "+o+", "+l+") ":"translate("+a+", "+o+qs),h!==Xs&&(x+="rotate("+h+qs),c!==Xs&&(x+="rotateY("+c+qs),u!==Xs&&(x+="rotateX("+u+qs),(d!==Xs||f!==Xs)&&(x+="skew("+d+", "+f+qs),(p!==1||m!==1)&&(x+="scale("+p+", "+m+qs),y.style[Te]=x||"translate(0, 0)"},sM=function(t,e){var i=e||this,n=i.xPercent,s=i.yPercent,a=i.x,o=i.y,l=i.rotation,h=i.skewX,c=i.skewY,u=i.scaleX,d=i.scaleY,f=i.target,p=i.xOrigin,m=i.yOrigin,_=i.xOffset,g=i.yOffset,y=i.forceCSS,v=parseFloat(a),x=parseFloat(o),E,w,A,P,b;l=parseFloat(l),h=parseFloat(h),c=parseFloat(c),c&&(c=parseFloat(c),h+=c,l+=c),l||h?(l*=qr,h*=qr,E=Math.cos(l)*u,w=Math.sin(l)*u,A=Math.sin(l-h)*-d,P=Math.cos(l-h)*d,h&&(c*=qr,b=Math.tan(h-c),b=Math.sqrt(1+b*b),A*=b,P*=b,c&&(b=Math.tan(c),b=Math.sqrt(1+b*b),E*=b,w*=b)),E=Pe(E),w=Pe(w),A=Pe(A),P=Pe(P)):(E=u,P=d,w=A=0),(v&&!~(a+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(v=cs(f,"x",a,"px"),x=cs(f,"y",o,"px")),(p||m||_||g)&&(v=Pe(v+p-(p*E+m*A)+_),x=Pe(x+m-(p*w+m*P)+g)),(n||s)&&(b=f.getBBox(),v=Pe(v+n/100*b.width),x=Pe(x+s/100*b.height)),b="matrix("+E+","+w+","+A+","+P+","+v+","+x+")",f.setAttribute("transform",b),y&&(f.style[Te]=b)},rM=function(t,e,i,n,s){var a=360,o=He(s),l=parseFloat(s)*(o&&~s.indexOf("rad")?Ys:1),h=l-n,c=n+h+"deg",u,d;return o&&(u=s.split("_")[1],u==="short"&&(h%=a,h!==h%(a/2)&&(h+=h<0?a:-a)),u==="cw"&&h<0?h=(h+a*Vg)%a-~~(h/a)*a:u==="ccw"&&h>0&&(h=(h-a*Vg)%a-~~(h/a)*a)),t._pt=d=new pi(t._pt,e,i,n,h,HA),d.e=c,d.u="deg",t._props.push(i),d},Kg=function(t,e){for(var i in e)t[i]=e[i];return t},aM=function(t,e,i){var n=Kg({},i._gsap),s="perspective,force3D,transformOrigin,svgOrigin",a=i.style,o,l,h,c,u,d,f,p;n.svg?(h=i.getAttribute("transform"),i.setAttribute("transform",""),a[Te]=e,o=ja(i,1),hs(i,Te),i.setAttribute("transform",h)):(h=getComputedStyle(i)[Te],a[Te]=e,o=ja(i,1),a[Te]=h);for(l in Un)h=n[l],c=o[l],h!==c&&s.indexOf(l)<0&&(f=Qe(h),p=Qe(c),u=f!==p?cs(i,l,h,p):parseFloat(h),d=parseFloat(c),t._pt=new pi(t._pt,o,l,u,d-u,Of),t._pt.u=p||0,t._props.push(l));Kg(o,n)};fi("padding,margin,Width,Radius",function(r,t){var e="Top",i="Right",n="Bottom",s="Left",a=(t<3?[e,i,n,s]:[e+s,e+i,n+i,n+s]).map(function(o){return t<2?r+o:"border"+o+r});mh[t>1?"border"+r:r]=function(o,l,h,c,u){var d,f;if(arguments.length<4)return d=a.map(function(p){return kn(o,p,h)}),f=d.join(" "),f.split(d[0]).length===5?d[0]:f;d=(c+"").split(" "),f={},a.forEach(function(p,m){return f[p]=d[m]=d[m]||d[(m-1)/2|0]}),o.init(l,f,u)}});var Gf={name:"css",register:kf,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,n,s){var a=this._props,o=t.style,l=i.vars.startAt,h,c,u,d,f,p,m,_,g,y,v,x,E,w,A,P,b;Bf||kf(),this.styles=this.styles||Qg(t),P=this.styles.props,this.tween=i;for(m in e)if(m!=="autoRound"&&(c=e[m],!(wi[m]&&Cf(m,e,i,n,t,s)))){if(f=typeof c,p=mh[m],f==="function"&&(c=c.call(i,n,t,s),f=typeof c),f==="string"&&~c.indexOf("random(")&&(c=Gr(c)),p)p(this,t,m,c,i)&&(A=1);else if(m.substr(0,2)==="--")h=(getComputedStyle(t).getPropertyValue(m)+"").trim(),c+="",On.lastIndex=0,On.test(h)||(_=Qe(h),g=Qe(c),g?_!==g&&(h=cs(t,m,h,g)+g):_&&(c+=_)),this.add(o,"setProperty",h,c,n,s,0,0,m),a.push(m),P.push(m,0,o[m]);else if(f!=="undefined"){if(l&&m in l?(h=typeof l[m]=="function"?l[m].call(i,n,t,s):l[m],He(h)&&~h.indexOf("random(")&&(h=Gr(h)),Qe(h+"")||h==="auto"||(h+=Ei.units[m]||Qe(kn(t,m))||""),(h+"").charAt(1)==="="&&(h=kn(t,m))):h=kn(t,m),d=parseFloat(h),y=f==="string"&&c.charAt(1)==="="&&c.substr(0,2),y&&(c=c.substr(2)),u=parseFloat(c),m in mn&&(m==="autoAlpha"&&(d===1&&kn(t,"visibility")==="hidden"&&u&&(d=0),P.push("visibility",0,o.visibility),ls(this,o,"visibility",d?"inherit":"hidden",u?"inherit":"hidden",!u)),m!=="scale"&&m!=="transform"&&(m=mn[m],~m.indexOf(",")&&(m=m.split(",")[0]))),v=m in Un,v){if(this.styles.save(m),b=c,f==="string"&&c.substring(0,6)==="var(--"){if(c=ki(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var S=t.style.perspective;t.style.perspective=c,c=ki(t,"perspective"),S?t.style.perspective=S:hs(t,"perspective")}u=parseFloat(c)}if(x||(E=t._gsap,E.renderTransform&&!e.parseTransform||ja(t,e.parseTransform),w=e.smoothOrigin!==!1&&E.smooth,x=this._pt=new pi(this._pt,o,Te,0,1,E.renderTransform,E,0,-1),x.dep=1),m==="scale")this._pt=new pi(this._pt,E,"scaleY",E.scaleY,(y?Gs(E.scaleY,y+u):u)-E.scaleY||0,Of),this._pt.u=0,a.push("scaleY",m),m+="X";else if(m==="transformOrigin"){P.push(Ti,0,o[Ti]),c=eM(c),E.svg?Uf(t,c,0,w,0,this):(g=parseFloat(c.split(" ")[2])||0,g!==E.zOrigin&&ls(this,E,"zOrigin",E.zOrigin,g),ls(this,o,m,gh(h),gh(c)));continue}else if(m==="svgOrigin"){Uf(t,c,1,w,0,this);continue}else if(m in n_){rM(this,E,m,d,y?Gs(d,y+c):c);continue}else if(m==="smoothOrigin"){ls(this,E,"smooth",E.smooth,c);continue}else if(m==="force3D"){E[m]=c;continue}else if(m==="transform"){aM(this,c,t);continue}}else m in o||(m=Yr(m)||m);if(v||(u||u===0)&&(d||d===0)&&!zA.test(c)&&m in o)_=(h+"").substr((d+"").length),u||(u=0),g=Qe(c)||(m in Ei.units?Ei.units[m]:_),_!==g&&(d=cs(t,m,h,g)),this._pt=new pi(this._pt,v?E:o,m,d,(y?Gs(d,y+u):u)-d,!v&&(g==="px"||m==="zIndex")&&e.autoRound!==!1?WA:Of),this._pt.u=g||0,v&&b!==c?(this._pt.b=h,this._pt.e=b,this._pt.r=GA):_!==g&&g!=="%"&&(this._pt.b=h,this._pt.r=VA);else if(m in o)tM.call(this,t,m,h,y?y+c:c);else if(m in t)this.add(t,m,h||t[m],y?y+c:c,n,s);else if(m!=="parseTransform"){ch(m,c);continue}v||(m in o?P.push(m,0,o[m]):typeof t[m]=="function"?P.push(m,2,t[m]()):P.push(m,1,h||t[m])),a.push(m)}}A&&Df(this)},render:function(t,e){if(e.tween._time||!zf())for(var i=e._pt;i;)i.r(t,i.d),i=i._next;else e.styles.revert()},get:kn,aliases:mn,getSetter:function(t,e,i){var n=mn[e];return n&&n.indexOf(",")<0&&(e=n),e in Un&&e!==Ti&&(t._gsap.x||kn(t,"x"))?i&&Hg===i?e==="scale"?$A:YA:(Hg=i||{})&&(e==="scale"?KA:jA):t.style&&!hh(t.style[e])?XA:~e.indexOf("-")?qA:ph(t,e)},core:{_removeProperty:hs,_getMatrix:Vf}};oi.utils.checkPrefix=Yr;oi.core.getStyleSaver=Qg;(function(r,t,e,i){var n=fi(r+","+t+","+e,function(s){Un[s]=1});fi(t,function(s){Ei.units[s]="deg",n_[s]=1}),mn[n[13]]=r+","+t,fi(i,function(s){var a=s.split(":");mn[a[1]]=n[a[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");fi("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Ei.units[r]="px"});oi.registerPlugin(Gf);var Wf=oi.registerPlugin(Gf)||oi,IE=Wf.core.Tween;var oM=.45,Xf=new j(.3,.5,1).normalize(),_h=class{constructor(t,e={}){this._container=t,this._options=e,this._pageDims={pageWidth:400,pageHeight:600,spreadWidth:800,spreadHeight:600},this._layout="double",this._currentLeftPage=1,this._totalPages=1,this._scene=null,this._camera=null,this._renderer=null,this._leftMesh=null,this._rightMesh=null,this._leftOverlay=null,this._rightOverlay=null,this._spineMesh=null,this._shadowMesh=null,this._shadowFwdTex=null,this._shadowBwdTex=null,this._flipRightMesh=null,this._flipLeftMesh=null,this._flipQueue=[],this._currentTimeline=null,this._isAnimating=!1,this._onPageChangeCb=null,this._onAnimationEndCb=null,this._loader=null,this._bookGroup=null,this._init()}_init(){this._scene=new Yl,this._bookGroup=new jn,this._scene.add(this._bookGroup),this._renderer=new ql({antialias:!0,alpha:!0}),this._renderer.setPixelRatio(window.devicePixelRatio||1);let t=this._renderer.domElement;t.classList.add("pfo-canvas"),t.style.display="block",this._container.appendChild(t),this._renderer.setAnimationLoop(()=>this._renderFrame())}setLoader(t){this._loader=t}onPageChange(t){this._onPageChangeCb=t}onAnimationEnd(t){this._onAnimationEndCb=t}buildScene(t,e,i,n){this._pageDims=t,this._layout=e,this._currentLeftPage=i,this._totalPages=n;let s=this._container.clientWidth,a=this._container.clientHeight-44;this._renderer.setSize(s,a);let o=a,l=2*Math.atan(a/2/o)*(180/Math.PI);this._camera=new di(l,s/a,.1,o*4),this._camera.position.set(0,0,o),this._camera.lookAt(0,0,0),this._clearMeshes(),this._bookGroup.position.x=this._getGroupOffsetX(i),this._buildPageMeshes(t.pageWidth,t.pageHeight,e),this._updateTextures()}_clearMeshes(){this._shadowFwdTex&&(this._shadowFwdTex.dispose(),this._shadowFwdTex=null),this._shadowBwdTex&&(this._shadowBwdTex.dispose(),this._shadowBwdTex=null),this._shadowMesh&&(this._shadowMesh.material.map=null);let t=[this._leftMesh,this._rightMesh,this._leftOverlay,this._rightOverlay,this._spineMesh,this._shadowMesh,this._flipRightMesh,this._flipLeftMesh];for(let e of t)e&&(this._bookGroup.remove(e),e.geometry.dispose(),Array.isArray(e.material)?e.material.forEach(i=>{i.map&&i.map.dispose(),i.dispose()}):(e.material.map&&e.material.map.dispose(),e.material.dispose()));this._leftMesh=null,this._rightMesh=null,this._leftOverlay=null,this._rightOverlay=null,this._spineMesh=null,this._shadowMesh=null,this._flipRightMesh=null,this._flipLeftMesh=null}_buildPageMeshes(t,e,i){let n=i==="double",s=t/2;if(this._leftMesh=new ke(new Gi(t,e),new Di({color:16777215})),this._leftMesh.position.set(n?-s:0,0,0),this._bookGroup.add(this._leftMesh),n){this._rightMesh=new ke(new Gi(t,e),new Di({color:16777215})),this._rightMesh.position.set(s,0,0),this._bookGroup.add(this._rightMesh);let o=this._makeGradientTex([[0,"rgba(0,0,0,0)"],[.4,"rgba(0,0,0,0)"],[.75,"rgba(0,0,0,0.05)"],[.9,"rgba(0,0,0,0.10)"],[1,"rgba(0,0,0,0.15)"]]);this._leftOverlay=new ke(new Gi(t,e),new Di({map:o,transparent:!0,depthWrite:!1})),this._leftOverlay.position.set(-s,0,.2),this._bookGroup.add(this._leftOverlay);let l=this._makeGradientTex([[0,"rgba(0,0,0,0.15)"],[.1,"rgba(0,0,0,0.10)"],[.25,"rgba(0,0,0,0.05)"],[.6,"rgba(0,0,0,0)"],[1,"rgba(0,0,0,0)"]]);this._rightOverlay=new ke(new Gi(t,e),new Di({map:l,transparent:!0,depthWrite:!1})),this._rightOverlay.position.set(s,0,.2),this._bookGroup.add(this._rightOverlay);let h=this._makeGradientTex([[0,"rgba(0,0,0,0.00)"],[.5,"rgba(0,0,0,0.08)"],[.51,"rgba(0,0,0,0.0)"],[1,"rgba(0,0,0,0)"]]);this._spineMesh=new ke(new Gi(t*.04,e),new Di({map:h,transparent:!0,depthWrite:!1})),this._spineMesh.position.set(0,0,.5),this._bookGroup.add(this._spineMesh)}let a=o=>{let l=new Gi(t,e,60,10);l.translate(o,0,0),l.userData.originalPositions=l.attributes.position.array.slice();let h=l.attributes.position.count;return l.setAttribute("color",new Si(new Float32Array(h*3).fill(1),3)),l};this._flipRightMesh=new ke(a(t/2),new Di({color:16777215,vertexColors:!0,side:en})),this._flipRightMesh.position.set(0,0,2),this._flipRightMesh.visible=!1,this._bookGroup.add(this._flipRightMesh),this._flipLeftMesh=new ke(a(-t/2),new Di({color:16777215,vertexColors:!0,side:en})),this._flipLeftMesh.position.set(0,0,2),this._flipLeftMesh.visible=!1,this._bookGroup.add(this._flipLeftMesh),this._shadowFwdTex=this._makeGradientTex([[0,"rgba(0,0,0,0)"],[.7,"rgba(0,0,0,0)"],[.88,"rgba(0,0,0,0.22)"],[1,"rgba(0,0,0,0.65)"]]),this._shadowBwdTex=this._makeGradientTex([[0,"rgba(0,0,0,0.65)"],[.12,"rgba(0,0,0,0.22)"],[.3,"rgba(0,0,0,0)"],[1,"rgba(0,0,0,0)"]]),this._shadowMesh=new ke(new Gi(t,e),new Di({map:this._shadowFwdTex,transparent:!0,opacity:0,depthWrite:!1})),this._shadowMesh.position.set(0,0,1),this._bookGroup.add(this._shadowMesh)}_makeGradientTex(t){let e=document.createElement("canvas");e.width=256,e.height=4;let i=e.getContext("2d"),n=i.createLinearGradient(0,0,256,0);for(let[a,o]of t)n.addColorStop(a,o);i.fillStyle=n,i.fillRect(0,0,256,4);let s=new Nr(e);return s.needsUpdate=!0,s}_isCoverSpread(t){return this._layout==="double"&&t===1&&this._totalPages>1}_isBackCoverSpread(t){return this._layout==="double"&&this._totalPages>1&&t===this._totalPages&&this._totalPages%2===0}_getGroupOffsetX(t){let e=this._pageDims.pageWidth/2;return this._isCoverSpread(t)?-e:this._isBackCoverSpread(t)?e:0}_deformPage(t,e,i){let n=t.geometry,s=n.userData.originalPositions,a=n.attributes.position;for(let h=0;h<a.count;h++){let c=h*3,u=s[c],d=s[c+1],f=Math.abs(u)/i,p=Math.PI/2*e*f;a.setXYZ(h,Math.cos(p)*u,d,Math.sin(p)*Math.abs(u)*oM)}a.needsUpdate=!0,n.computeVertexNormals();let o=n.attributes.normal,l=n.attributes.color;for(let h=0;h<a.count;h++){let c=h*3,u=Math.abs(s[c])/i,d=this._shade(o.getX(h),o.getY(h),o.getZ(h)),f=Math.max(0,.15*(1-u/.2)),p=Math.max(0,d-f);l.setXYZ(h,p,p,p)}l.needsUpdate=!0}_shade(t,e,i){let n=t*Xf.x+e*Xf.y+i*Xf.z;return .68+.32*Math.max(0,n)}async _updateTextures(){if(!this._loader)return;let t=this._currentLeftPage,e=this._isCoverSpread(t),i=this._isBackCoverSpread(t),n=this._layout==="double";if(e)this._leftMesh&&(this._leftMesh.visible=!1),this._leftOverlay&&(this._leftOverlay.visible=!1),this._rightMesh&&(this._rightMesh.visible=!0,this._applyTexture(this._rightMesh,1)),this._rightOverlay&&(this._rightOverlay.visible=!1),this._spineMesh&&(this._spineMesh.visible=!1);else if(i)this._leftMesh&&(this._leftMesh.visible=!0,this._applyTexture(this._leftMesh,t)),this._leftOverlay&&(this._leftOverlay.visible=!0),this._rightMesh&&(this._rightMesh.visible=!1),this._rightOverlay&&(this._rightOverlay.visible=!1),this._spineMesh&&(this._spineMesh.visible=!1);else if(this._leftMesh&&(this._leftMesh.visible=!0,this._applyTexture(this._leftMesh,t)),this._leftOverlay&&(this._leftOverlay.visible=n),this._rightOverlay&&(this._rightOverlay.visible=n),this._spineMesh&&(this._spineMesh.visible=n),n&&this._rightMesh){this._rightMesh.visible=!0;let s=t+1;s<=this._totalPages?this._applyTexture(this._rightMesh,s):(this._rightMesh.material.map=null,this._rightMesh.material.color.set(16448250),this._rightMesh.material.needsUpdate=!0)}}async _applyTexture(t,e){if(!(!this._loader||e<1||e>this._totalPages))try{let i=await this._loader.getTexture(e);t.material.map=i,t.material.color.set(16777215),t.material.needsUpdate=!0}catch(i){console.warn(`Failed to load texture for page ${e}:`,i)}}flipTo(t,e){if(t===this._currentLeftPage)return;let n=this._flipQueue.length>0?this._options.flipDuration*.4:this._options.flipDuration;this._flipQueue.push({targetLeftPage:t,direction:e,duration:n}),this._isAnimating||this._processQueue()}_processQueue(){if(this._flipQueue.length===0){this._isAnimating=!1,this._onAnimationEndCb&&this._onAnimationEndCb();return}this._isAnimating=!0,this._executeFlip(this._flipQueue.shift())}_executeFlip({targetLeftPage:t,direction:e,duration:i}){let n=this._layout==="double",s=e==="forward",a=this._pageDims.pageWidth,o=s?this._flipRightMesh:this._flipLeftMesh,l=s?this._flipLeftMesh:this._flipRightMesh,h=this._isCoverSpread(this._currentLeftPage),c=this._isCoverSpread(t),u=this._isBackCoverSpread(t),d=s?n?h?this._currentLeftPage:this._currentLeftPage+1:this._currentLeftPage:this._currentLeftPage;this._applyTexture(o,d);let f=s||c?t:Math.min(t+1,this._totalPages);if(l.material.map=null,l.material.color.set(16777215),this._applyTexture(l,f),s){if(n&&this._rightMesh)if(u)this._rightMesh.visible=!1,this._rightOverlay&&(this._rightOverlay.visible=!1);else{this._rightMesh.visible=!0,this._rightOverlay&&(this._rightOverlay.visible=!0);let _=t+1;_<=this._totalPages?this._applyTexture(this._rightMesh,_):(this._rightMesh.material.map=null,this._rightMesh.material.color.set(16448250),this._rightMesh.material.needsUpdate=!0)}}else c?(this._leftMesh&&(this._leftMesh.visible=!1),this._leftOverlay&&(this._leftOverlay.visible=!1)):(this._leftMesh&&(this._leftMesh.visible=!0),this._applyTexture(this._leftMesh,t));this._shadowMesh&&(this._shadowMesh.position.x=s?-(a/2):a/2,this._shadowMesh.material.map=s?this._shadowFwdTex:this._shadowBwdTex,this._shadowMesh.material.opacity=0,this._shadowMesh.material.needsUpdate=!0),this._deformPage(o,0,a),this._deformPage(l,0,a),o.scale.x=1,o.position.z=2,o.visible=!0,l.scale.x=1,l.position.z=2,l.visible=!1;let p={t:0},m=this._getGroupOffsetX(t);this._currentTimeline=Wf.timeline({onComplete:()=>{this._currentLeftPage=t,this._shadowMesh&&(this._shadowMesh.material.opacity=0),s&&this._leftMesh?(this._leftMesh.material.map=l.material.map,this._leftMesh.material.color.set(16777215),this._leftMesh.material.needsUpdate=!0):!s&&n&&this._rightMesh&&(this._rightMesh.material.map=l.material.map,this._rightMesh.material.color.set(16777215),this._rightMesh.material.needsUpdate=!0),o.visible=!1,l.visible=!1;let _=this._isCoverSpread(t),g=this._isBackCoverSpread(t);this._leftMesh&&(this._leftMesh.visible=!_),this._rightMesh&&(this._rightMesh.visible=!g),this._leftOverlay&&(this._leftOverlay.visible=!_&&n),this._rightOverlay&&(this._rightOverlay.visible=!g&&n),this._spineMesh&&(this._spineMesh.visible=!_&&!g&&n),this._onPageChangeCb&&this._onPageChangeCb(t),this._loader&&this._loader.prefetch(t,this._totalPages),this._processQueue()}}),this._bookGroup.position.x!==m&&this._currentTimeline.to(this._bookGroup.position,{x:m,duration:i/1e3,ease:"power2.inOut"},0),this._currentTimeline.to(p,{t:1,duration:i/1e3,ease:"power2.inOut",onUpdate:()=>{let _=p.t;_<=.5?(this._deformPage(o,_/.5,a),o.visible=!0,l.visible=!1):(this._deformPage(l,1-(_-.5)/.5,a),o.visible=!1,l.visible=!0),this._shadowMesh&&(this._shadowMesh.material.opacity=Math.sin(_*Math.PI)*.55)}},0)}cancelQueue(){this._flipQueue=[],this._currentTimeline&&(this._currentTimeline.kill(),this._currentTimeline=null),this._flipRightMesh&&(this._flipRightMesh.visible=!1),this._flipLeftMesh&&(this._flipLeftMesh.visible=!1),this._shadowMesh&&(this._shadowMesh.material.opacity=0),this._isAnimating=!1,this._onAnimationEndCb&&this._onAnimationEndCb()}_renderFrame(){this._renderer&&this._scene&&this._camera&&this._renderer.render(this._scene,this._camera)}getCanvas(){return this._renderer?this._renderer.domElement:null}get isAnimating(){return this._isAnimating}destroy(){this.cancelQueue(),this._renderer.setAnimationLoop(null),this._clearMeshes(),this._scene.clear(),this._renderer.dispose(),this._renderer.domElement.parentNode&&this._renderer.domElement.parentNode.removeChild(this._renderer.domElement)}};var qf=y_(a_(),1),lM=.3,hM=.7,yh=class{constructor(t,e,i={}){this._canvas=t,this._container=e,this._options=i,this._onNext=null,this._onPrev=null,this._onFirst=null,this._onLast=null,this._onZoomIn=null,this._onZoomOut=null,this._onToggleFullscreen=null,this._onEscape=null,this._onPinch=null,this._onDoubleTap=null,this._hammer=null,this._boundKeyDown=this._onKeyDown.bind(this),this._boundClick=this._onClick.bind(this),this._init()}_init(){this._options.enableKeyboard!==!1&&document.addEventListener("keydown",this._boundKeyDown),this._canvas.addEventListener("click",this._boundClick),this._options.enableTouch!==!1&&this._initHammer()}_initHammer(){this._hammer=new qf.default(this._canvas,{touchAction:"none"}),this._hammer.get("swipe").set({direction:qf.default.DIRECTION_HORIZONTAL,threshold:20,velocity:.3}),this._hammer.on("swipeleft",()=>{this._onNext&&this._onNext()}),this._hammer.on("swiperight",()=>{this._onPrev&&this._onPrev()}),this._hammer.get("pinch").set({enable:!0});let t=1;this._hammer.on("pinchstart",()=>{t=1}),this._hammer.on("pinchmove",e=>{let i=e.scale/t;t=e.scale,this._onPinch&&this._onPinch(i,e.center)}),this._hammer.get("doubletap").set({enable:!0}),this._hammer.on("doubletap",e=>{this._onDoubleTap&&this._onDoubleTap(e.center)})}_onClick(t){let e=this._canvas.getBoundingClientRect(),i=(t.clientX-e.left)/e.width;i<lM?this._onPrev&&this._onPrev():i>hM&&this._onNext&&this._onNext()}_onKeyDown(t){if(!(document.activeElement&&document.activeElement.tagName==="INPUT"))switch(t.key){case"ArrowRight":case"ArrowDown":t.preventDefault(),this._onNext&&this._onNext();break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this._onPrev&&this._onPrev();break;case"Home":t.preventDefault(),this._onFirst&&this._onFirst();break;case"End":t.preventDefault(),this._onLast&&this._onLast();break;case"+":case"=":t.preventDefault(),this._onZoomIn&&this._onZoomIn();break;case"-":t.preventDefault(),this._onZoomOut&&this._onZoomOut();break;case"f":case"F":t.preventDefault(),this._onToggleFullscreen&&this._onToggleFullscreen();break;case"Escape":this._onEscape&&this._onEscape();break}}onNext(t){this._onNext=t}onPrev(t){this._onPrev=t}onFirst(t){this._onFirst=t}onLast(t){this._onLast=t}onZoomIn(t){this._onZoomIn=t}onZoomOut(t){this._onZoomOut=t}onToggleFullscreen(t){this._onToggleFullscreen=t}onEscape(t){this._onEscape=t}onPinch(t){this._onPinch=t}onDoubleTap(t){this._onDoubleTap=t}destroy(){document.removeEventListener("keydown",this._boundKeyDown),this._canvas.removeEventListener("click",this._boundClick),this._hammer&&(this._hammer.destroy(),this._hammer=null)}};var Ve=function(){return Ve=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Ve.apply(this,arguments)};typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}));var cM=typeof document<"u"&&!!document.documentMode,Yf;function uM(){return Yf||(Yf=document.createElement("div").style)}var o_=["webkit","moz","ms"],xh={};function Qf(r){if(xh[r])return xh[r];var t=uM();if(r in t)return xh[r]=r;for(var e=r[0].toUpperCase()+r.slice(1),i=o_.length;i--;){var n="".concat(o_[i]).concat(e);if(n in t)return xh[r]=n}}function bh(r,t){return parseFloat(t[Qf(r)])||0}function Sh(r,t,e){e===void 0&&(e=window.getComputedStyle(r));var i=t==="border"?"Width":"";return{left:bh("".concat(t,"Left").concat(i),e),right:bh("".concat(t,"Right").concat(i),e),top:bh("".concat(t,"Top").concat(i),e),bottom:bh("".concat(t,"Bottom").concat(i),e)}}function $r(r,t,e){r.style[Qf(t)]=e}function dM(r,t){var e=Qf("transform");$r(r,"transition","".concat(e," ").concat(t.duration,"ms ").concat(t.easing))}function fM(r,t,e){var i=t.x,n=t.y,s=t.scale,a=t.isSVG;if($r(r,"transform","scale(".concat(s,") translate(").concat(i,"px, ").concat(n,"px)")),a&&cM){var o=window.getComputedStyle(r).getPropertyValue("transform");r.setAttribute("transform",o)}}function $f(r){var t=r.parentNode,e=window.getComputedStyle(r),i=window.getComputedStyle(t),n=r.getBoundingClientRect(),s=t.getBoundingClientRect();return{elem:{style:e,width:n.width,height:n.height,top:n.top,bottom:n.bottom,left:n.left,right:n.right,margin:Sh(r,"margin",e),border:Sh(r,"border",e)},parent:{style:i,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:Sh(t,"padding",i),border:Sh(t,"border",i)}}}var Za={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Za={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Za={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Kf(r,t,e,i){Za[r].split(" ").forEach(function(n){t.addEventListener(n,e,i)})}function jf(r,t,e){Za[r].split(" ").forEach(function(i){t.removeEventListener(i,e)})}function h_(r,t){for(var e=r.length;e--;)if(r[e].pointerId===t.pointerId)return e;return-1}function Jf(r,t){var e;if(t.touches){e=0;for(var i=0,n=t.touches;i<n.length;i++){var s=n[i];s.pointerId=e++,Jf(r,s)}return}e=h_(r,t),e>-1&&r.splice(e,1),r.push(t)}function pM(r,t){if(t.touches){for(;r.length;)r.pop();return}var e=h_(r,t);e>-1&&r.splice(e,1)}function l_(r){r=r.slice(0);for(var t=r.pop(),e;e=r.pop();)t={clientX:(e.clientX-t.clientX)/2+t.clientX,clientY:(e.clientY-t.clientY)/2+t.clientY};return t}function Zf(r){if(r.length<2)return 0;var t=r[0],e=r[1];return Math.sqrt(Math.pow(Math.abs(e.clientX-t.clientX),2)+Math.pow(Math.abs(e.clientY-t.clientY),2))}function mM(r){for(var t=r;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1}function gM(r){return(r.getAttribute("class")||"").trim()}function _M(r,t){return r.nodeType===1&&" ".concat(gM(r)," ").indexOf(" ".concat(t," "))>-1}function vM(r,t){for(var e=r;e!=null;e=e.parentNode)if(_M(e,t.excludeClass)||t.exclude.indexOf(e)>-1)return!0;return!1}var yM=/^http:[\w\.\/]+svg$/;function xM(r){return yM.test(r.namespaceURI)&&r.nodeName.toLowerCase()!=="svg"}function bM(r){var t={};for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return t}var c_={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:function(r){r.preventDefault(),r.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:fM,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function tp(r,t){if(!r)throw new Error("Panzoom requires an element as an argument");if(r.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!mM(r))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t=Ve(Ve({},c_),t);var e=xM(r),i=r.parentNode;i.style.overflow=t.overflow,i.style.userSelect="none",i.style.touchAction=t.touchAction,(t.canvas?i:r).style.cursor=t.cursor,r.style.userSelect="none",r.style.touchAction=t.touchAction,$r(r,"transformOrigin",typeof t.origin=="string"?t.origin:e?"0 0":"50% 50%");function n(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",r.style.cursor="",r.style.userSelect="",r.style.touchAction="",$r(r,"transformOrigin","")}function s(W){W===void 0&&(W={});for(var Q in W)W.hasOwnProperty(Q)&&(t[Q]=W[Q]);(W.hasOwnProperty("cursor")||W.hasOwnProperty("canvas"))&&(i.style.cursor=r.style.cursor="",(t.canvas?i:r).style.cursor=t.cursor),W.hasOwnProperty("overflow")&&(i.style.overflow=W.overflow),W.hasOwnProperty("touchAction")&&(i.style.touchAction=W.touchAction,r.style.touchAction=W.touchAction)}var a=0,o=0,l=1,h=!1;m(t.startScale,{animate:!1,force:!0}),setTimeout(function(){p(t.startX,t.startY,{animate:!1,force:!0})});function c(W,Q,tt){if(!tt.silent){var ht=new CustomEvent(W,{detail:Q});r.dispatchEvent(ht)}}function u(W,Q,tt){var ht={x:a,y:o,scale:l,isSVG:e,originalEvent:tt};return requestAnimationFrame(function(){typeof Q.animate=="boolean"&&(Q.animate?dM(r,Q):$r(r,"transition","none")),Q.setTransform(r,ht,Q),c(W,ht,Q),c("panzoomchange",ht,Q)}),ht}function d(W,Q,tt,ht){var nt=Ve(Ve({},t),ht),G={x:a,y:o,opts:nt};if(!(ht!=null&&ht.force)&&(nt.disablePan||nt.panOnlyWhenZoomed&&l===nt.startScale))return G;if(W=parseFloat(W),Q=parseFloat(Q),nt.disableXAxis||(G.x=(nt.relative?a:0)+W),nt.disableYAxis||(G.y=(nt.relative?o:0)+Q),nt.contain){var K=$f(r),rt=K.elem.width/l,st=K.elem.height/l,mt=rt*tt,Et=st*tt,Nt=(mt-rt)/2,Zt=(Et-st)/2;if(nt.contain==="inside"){var N=(-K.elem.margin.left-K.parent.padding.left+Nt)/tt,le=(K.parent.width-mt-K.parent.padding.left-K.elem.margin.left-K.parent.border.left-K.parent.border.right+Nt)/tt;G.x=Math.max(Math.min(G.x,le),N);var $t=(-K.elem.margin.top-K.parent.padding.top+Zt)/tt,Ht=(K.parent.height-Et-K.parent.padding.top-K.elem.margin.top-K.parent.border.top-K.parent.border.bottom+Zt)/tt;G.y=Math.max(Math.min(G.y,Ht),$t)}else if(nt.contain==="outside"){var N=(-(mt-K.parent.width)-K.parent.padding.left-K.parent.border.left-K.parent.border.right+Nt)/tt,le=(Nt-K.parent.padding.left)/tt;G.x=Math.max(Math.min(G.x,le),N);var $t=(-(Et-K.parent.height)-K.parent.padding.top-K.parent.border.top-K.parent.border.bottom+Zt)/tt,Ht=(Zt-K.parent.padding.top)/tt;G.y=Math.max(Math.min(G.y,Ht),$t)}}return nt.roundPixels&&(G.x=Math.round(G.x),G.y=Math.round(G.y)),G}function f(W,Q){var tt=Ve(Ve({},t),Q),ht={scale:l,opts:tt};if(!(Q!=null&&Q.force)&&tt.disableZoom)return ht;var nt=t.minScale,G=t.maxScale;if(tt.contain){var K=$f(r),rt=K.elem.width/l,st=K.elem.height/l;if(rt>1&&st>1){var mt=K.parent.width-K.parent.border.left-K.parent.border.right,Et=K.parent.height-K.parent.border.top-K.parent.border.bottom,Nt=mt/rt,Zt=Et/st;t.contain==="inside"?G=Math.min(G,Nt,Zt):t.contain==="outside"&&(nt=Math.max(nt,Nt,Zt))}}return ht.scale=Math.min(Math.max(W,nt),G),ht}function p(W,Q,tt,ht){var nt=d(W,Q,l,tt);return a!==nt.x||o!==nt.y?(a=nt.x,o=nt.y,u("panzoompan",nt.opts,ht)):{x:a,y:o,scale:l,isSVG:e,originalEvent:ht}}function m(W,Q,tt){var ht=f(W,Q),nt=ht.opts;if(!(!(Q!=null&&Q.force)&&nt.disableZoom)){W=ht.scale;var G=a,K=o;if(nt.focal){var rt=nt.focal;G=(rt.x/W-rt.x/l+a*W)/W,K=(rt.y/W-rt.y/l+o*W)/W}var st=d(G,K,W,{relative:!1,force:!0});return a=st.x,o=st.y,l=W,u("panzoomzoom",nt,tt)}}function _(W,Q){var tt=Ve(Ve(Ve({},t),{animate:!0}),Q);return m(l*Math.exp((W?1:-1)*tt.step),tt)}function g(W){return _(!0,W)}function y(W){return _(!1,W)}function v(W,Q,tt,ht){var nt=$f(r),G={width:nt.parent.width-nt.parent.padding.left-nt.parent.padding.right-nt.parent.border.left-nt.parent.border.right,height:nt.parent.height-nt.parent.padding.top-nt.parent.padding.bottom-nt.parent.border.top-nt.parent.border.bottom},K=Q.clientX-nt.parent.left-nt.parent.padding.left-nt.parent.border.left-nt.elem.margin.left,rt=Q.clientY-nt.parent.top-nt.parent.padding.top-nt.parent.border.top-nt.elem.margin.top;e||(K-=nt.elem.width/l/2,rt-=nt.elem.height/l/2);var st={x:K/G.width*(G.width*W),y:rt/G.height*(G.height*W)};return m(W,Ve(Ve({},tt),{animate:!1,focal:st}),ht)}function x(W,Q){W.preventDefault();var tt=Ve(Ve(Ve({},t),Q),{animate:!1}),ht=W.deltaY===0&&W.deltaX?W.deltaX:W.deltaY,nt=ht<0?1:-1,G=f(l*Math.exp(nt*tt.step/3),tt).scale;return v(G,W,tt,W)}function E(W){var Q=Ve(Ve(Ve({},t),{animate:!0,force:!0}),W);l=f(Q.startScale,Q).scale;var tt=d(Q.startX,Q.startY,l,Q);return a=tt.x,o=tt.y,u("panzoomreset",Q)}var w,A,P,b,S,I,B=[];function F(W){if(!vM(W.target,t)){Jf(B,W),h=!0,t.handleStartEvent(W),w=a,A=o,c("panzoomstart",{x:a,y:o,scale:l,isSVG:e,originalEvent:W},t);var Q=l_(B);P=Q.clientX,b=Q.clientY,S=l,I=Zf(B)}}function H(W){if(!(!h||w===void 0||A===void 0||P===void 0||b===void 0)){Jf(B,W);var Q=l_(B),tt=B.length>1,ht=l;if(tt){I===0&&(I=Zf(B));var nt=Zf(B)-I;ht=f(nt*t.step/80+S).scale,v(ht,Q,{animate:!1},W)}(!tt||t.pinchAndPan)&&p(w+(Q.clientX-P)/ht,A+(Q.clientY-b)/ht,{animate:!1},W)}}function J(W){B.length===1&&c("panzoomend",{x:a,y:o,scale:l,isSVG:e,originalEvent:W},t),pM(B,W),h&&(h=!1,w=A=P=b=void 0)}var O=!1;function V(){O||(O=!0,Kf("down",t.canvas?i:r,F),Kf("move",document,H,{passive:!0}),Kf("up",document,J,{passive:!0}))}function q(){O=!1,jf("down",t.canvas?i:r,F),jf("move",document,H),jf("up",document,J)}return t.noBind||V(),{bind:V,destroy:q,eventNames:Za,getPan:function(){return{x:a,y:o}},getScale:function(){return l},getOptions:function(){return bM(t)},handleDown:F,handleMove:H,handleUp:J,pan:p,reset:E,resetStyle:n,setOptions:s,setStyle:function(W,Q){return $r(r,W,Q)},zoom:m,zoomIn:g,zoomOut:y,zoomToPoint:v,zoomWithWheel:x}}tp.defaultOptions=c_;var wh=class{constructor(t,e,i={}){this._canvas=t,this._container=e,this._options=i,this._panzoom=null,this._onZoomChangeCb=null,this._isFullscreen=!1,this._boundFullscreenChange=this._onFullscreenChange.bind(this),this._boundPointerUp=()=>{(this._panzoom?this._panzoom.getScale():1)>1.01&&(this._canvas.style.cursor="grab")},this._boundWheelHandler=null,this._init()}_init(){let t=document.createElement("div");t.classList.add("pfo-panzoom-wrapper"),this._canvas.parentNode.insertBefore(t,this._canvas),t.appendChild(this._canvas),this._wrapper=t,this._panzoom=tp(this._canvas,{maxScale:this._options.zoomMax||3,minScale:this._options.zoomMin||1,step:.25,contain:"outside",cursor:"default",touchAction:"none",startScale:this._options.zoom||1}),this._boundWheelHandler=i=>{(i.ctrlKey||i.metaKey)&&(i.preventDefault(),this._panzoom.zoomWithWheel(i))},t.addEventListener("wheel",this._boundWheelHandler,{passive:!1}),this._canvas.addEventListener("panzoomchange",i=>{let n=i.detail.scale;n<=1.01?(this._panzoom.pan(0,0,{animate:!1}),this._canvas.style.cursor="default"):this._canvas.style.cursor="grab",this._onZoomChangeCb&&this._onZoomChangeCb(Math.round(n*100))}),this._canvas.addEventListener("pointerdown",()=>{this._panzoom.getScale()>1.01&&(this._canvas.style.cursor="grabbing")}),document.addEventListener("pointerup",this._boundPointerUp),this._options.enableFullscreen!==!1&&document.addEventListener("fullscreenchange",this._boundFullscreenChange)}onZoomChange(t){this._onZoomChangeCb=t}onFullscreenChange(t){this._onFullscreenChangeCb=t}zoomIn(){this._panzoom.zoomIn()}zoomOut(){this._panzoom.zoomOut()}zoomReset(){this._panzoom.reset({animate:!0})}adjustZoom(t,e){let n=this._panzoom.getScale()*t;e?this._panzoom.zoom(n,{animate:!1,focal:e}):this._panzoom.zoom(n,{animate:!1})}getScale(){return this._panzoom?this._panzoom.getScale():1}toggleFullscreen(){document.fullscreenElement?document.exitFullscreen():this._container.requestFullscreen().catch(t=>{console.warn("Fullscreen failed:",t)})}_onFullscreenChange(){this._isFullscreen=!!document.fullscreenElement,this._onFullscreenChangeCb&&this._onFullscreenChangeCb(this._isFullscreen)}get isFullscreen(){return this._isFullscreen}destroy(){if(this._panzoom&&(this._panzoom.destroy(),this._panzoom=null),this._wrapper&&this._canvas.parentNode===this._wrapper){let t=this._wrapper.parentNode;t&&(t.insertBefore(this._canvas,this._wrapper),t.removeChild(this._wrapper))}this._boundWheelHandler&&this._wrapper&&this._wrapper.removeEventListener("wheel",this._boundWheelHandler),document.removeEventListener("pointerup",this._boundPointerUp),document.removeEventListener("fullscreenchange",this._boundFullscreenChange)}};var gn={first:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="11 17 6 12 11 7"/><polyline points="18 17 13 12 18 7"/></svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>',last:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="13 17 18 12 13 7"/><polyline points="6 17 11 12 6 7"/></svg>',zoomIn:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',zoomOut:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',exitFullscreen:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="10" y1="14" x2="3" y2="21"/><line x1="21" y1="3" x2="14" y2="10"/></svg>'},SM=2e3,Ah=class{constructor(t,e={}){this._container=t,this._options=e,this._el=null,this._pageInput=null,this._totalPagesEl=null,this._zoomEl=null,this._btnFirst=null,this._btnPrev=null,this._btnNext=null,this._btnLast=null,this._btnZoomIn=null,this._btnZoomOut=null,this._btnFullscreen=null,this._btnDownload=null,this._currentPage=1,this._totalPages=1,this._fadeTimer=null,this._visible=!0,this._callbacks={},this._boundInteractionHandler=this._resetFadeTimer.bind(this),e.toolbar!==!1&&this._build()}_build(){let t=document.createElement("div");t.className="pfo-toolbar",t.innerHTML=`
|
|
3850
|
+
}`,Td=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){let n=new Li,s=t.properties.get(n);s.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(t){if(this.texture!==null&&this.mesh===null){let e=t.cameras[0].viewport,i=new un({vertexShader:nw,fragmentShader:sw,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new ke(new Gi(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},Cd=class extends Qn{constructor(t,e){super();let i=this,n=null,s=1,a=null,o="local-floor",l=1,h=null,c=null,u=null,d=null,f=null,p=null,m=new Td,_=e.getContextAttributes(),g=null,y=null,v=[],x=[],E=new ue,w=null,A=new di;A.layers.enable(1),A.viewport=new qe;let P=new di;P.layers.enable(2),P.viewport=new qe;let b=[A,P],S=new Ed;S.layers.enable(1),S.layers.enable(2);let I=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(G){let K=v[G];return K===void 0&&(K=new La,v[G]=K),K.getTargetRaySpace()},this.getControllerGrip=function(G){let K=v[G];return K===void 0&&(K=new La,v[G]=K),K.getGripSpace()},this.getHand=function(G){let K=v[G];return K===void 0&&(K=new La,v[G]=K),K.getHandSpace()};function F(G){let K=x.indexOf(G.inputSource);if(K===-1)return;let rt=v[K];rt!==void 0&&(rt.update(G.inputSource,G.frame,h||a),rt.dispatchEvent({type:G.type,data:G.inputSource}))}function H(){n.removeEventListener("select",F),n.removeEventListener("selectstart",F),n.removeEventListener("selectend",F),n.removeEventListener("squeeze",F),n.removeEventListener("squeezestart",F),n.removeEventListener("squeezeend",F),n.removeEventListener("end",H),n.removeEventListener("inputsourceschange",J);for(let G=0;G<v.length;G++){let K=x[G];K!==null&&(x[G]=null,v[G].disconnect(K))}I=null,B=null,m.reset(),t.setRenderTarget(g),f=null,d=null,u=null,n=null,y=null,nt.stop(),i.isPresenting=!1,t.setPixelRatio(w),t.setSize(E.width,E.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(G){s=G,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(G){o=G,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||a},this.setReferenceSpace=function(G){h=G},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u},this.getFrame=function(){return p},this.getSession=function(){return n},this.setSession=async function(G){if(n=G,n!==null){if(g=t.getRenderTarget(),n.addEventListener("select",F),n.addEventListener("selectstart",F),n.addEventListener("selectend",F),n.addEventListener("squeeze",F),n.addEventListener("squeezestart",F),n.addEventListener("squeezeend",F),n.addEventListener("end",H),n.addEventListener("inputsourceschange",J),_.xrCompatible!==!0&&await e.makeXRCompatible(),w=t.getPixelRatio(),t.getSize(E),n.renderState.layers===void 0){let K={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(n,e,K),n.updateRenderState({baseLayer:f}),t.setPixelRatio(1),t.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new Ln(f.framebufferWidth,f.framebufferHeight,{format:tn,type:In,colorSpace:t.outputColorSpace,stencilBuffer:_.stencil})}else{let K=null,rt=null,st=null;_.depth&&(st=_.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,K=_.stencil?Ir:Mr,rt=_.stencil?Pr:Ns);let mt={colorFormat:e.RGBA8,depthFormat:st,scaleFactor:s};u=new XRWebGLBinding(n,e),d=u.createProjectionLayer(mt),n.updateRenderState({layers:[d]}),t.setPixelRatio(1),t.setSize(d.textureWidth,d.textureHeight,!1),y=new Ln(d.textureWidth,d.textureHeight,{format:tn,type:In,depthTexture:new Xl(d.textureWidth,d.textureHeight,rt,void 0,void 0,void 0,void 0,void 0,void 0,K),stencilBuffer:_.stencil,colorSpace:t.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1})}y.isXRRenderTarget=!0,this.setFoveation(l),h=null,a=await n.requestReferenceSpace(o),nt.setContext(n),nt.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(n!==null)return n.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};function J(G){for(let K=0;K<G.removed.length;K++){let rt=G.removed[K],st=x.indexOf(rt);st>=0&&(x[st]=null,v[st].disconnect(rt))}for(let K=0;K<G.added.length;K++){let rt=G.added[K],st=x.indexOf(rt);if(st===-1){for(let Et=0;Et<v.length;Et++)if(Et>=x.length){x.push(rt),st=Et;break}else if(x[Et]===null){x[Et]=rt,st=Et;break}if(st===-1)break}let mt=v[st];mt&&mt.connect(rt)}}let O=new j,V=new j;function q(G,K,rt){O.setFromMatrixPosition(K.matrixWorld),V.setFromMatrixPosition(rt.matrixWorld);let st=O.distanceTo(V),mt=K.projectionMatrix.elements,Et=rt.projectionMatrix.elements,Nt=mt[14]/(mt[10]-1),Zt=mt[14]/(mt[10]+1),N=(mt[9]+1)/mt[5],le=(mt[9]-1)/mt[5],$t=(mt[8]-1)/mt[0],Ht=(Et[8]+1)/Et[0],Tt=Nt*$t,we=Nt*Ht,kt=st/(-$t+Ht),Ut=kt*-$t;K.matrixWorld.decompose(G.position,G.quaternion,G.scale),G.translateX(Ut),G.translateZ(kt),G.matrixWorld.compose(G.position,G.quaternion,G.scale),G.matrixWorldInverse.copy(G.matrixWorld).invert();let L=Nt+kt,T=Zt+kt,Z=Tt-Ut,lt=we+(st-Ut),ct=N*Zt/T*L,at=le*Zt/T*L;G.projectionMatrix.makePerspective(Z,lt,ct,at,L,T),G.projectionMatrixInverse.copy(G.projectionMatrix).invert()}function W(G,K){K===null?G.matrixWorld.copy(G.matrix):G.matrixWorld.multiplyMatrices(K.matrixWorld,G.matrix),G.matrixWorldInverse.copy(G.matrixWorld).invert()}this.updateCamera=function(G){if(n===null)return;m.texture!==null&&(G.near=m.depthNear,G.far=m.depthFar),S.near=P.near=A.near=G.near,S.far=P.far=A.far=G.far,(I!==S.near||B!==S.far)&&(n.updateRenderState({depthNear:S.near,depthFar:S.far}),I=S.near,B=S.far,A.near=I,A.far=B,P.near=I,P.far=B,A.updateProjectionMatrix(),P.updateProjectionMatrix(),G.updateProjectionMatrix());let K=G.parent,rt=S.cameras;W(S,K);for(let st=0;st<rt.length;st++)W(rt[st],K);rt.length===2?q(S,A,P):S.projectionMatrix.copy(A.projectionMatrix),Q(G,S,K)};function Q(G,K,rt){rt===null?G.matrix.copy(K.matrixWorld):(G.matrix.copy(rt.matrixWorld),G.matrix.invert(),G.matrix.multiply(K.matrixWorld)),G.matrix.decompose(G.position,G.quaternion,G.scale),G.updateMatrixWorld(!0),G.projectionMatrix.copy(K.projectionMatrix),G.projectionMatrixInverse.copy(K.projectionMatrixInverse),G.isPerspectiveCamera&&(G.fov=cd*2*Math.atan(1/G.projectionMatrix.elements[5]),G.zoom=1)}this.getCamera=function(){return S},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(G){l=G,d!==null&&(d.fixedFoveation=G),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=G)},this.hasDepthSensing=function(){return m.texture!==null},this.getDepthSensingMesh=function(){return m.getMesh(S)};let tt=null;function ht(G,K){if(c=K.getViewerPose(h||a),p=K,c!==null){let rt=c.views;f!==null&&(t.setRenderTargetFramebuffer(y,f.framebuffer),t.setRenderTarget(y));let st=!1;rt.length!==S.cameras.length&&(S.cameras.length=0,st=!0);for(let Et=0;Et<rt.length;Et++){let Nt=rt[Et],Zt=null;if(f!==null)Zt=f.getViewport(Nt);else{let le=u.getViewSubImage(d,Nt);Zt=le.viewport,Et===0&&(t.setRenderTargetTextures(y,le.colorTexture,d.ignoreDepthValues?void 0:le.depthStencilTexture),t.setRenderTarget(y))}let N=b[Et];N===void 0&&(N=new di,N.layers.enable(Et),N.viewport=new qe,b[Et]=N),N.matrix.fromArray(Nt.transform.matrix),N.matrix.decompose(N.position,N.quaternion,N.scale),N.projectionMatrix.fromArray(Nt.projectionMatrix),N.projectionMatrixInverse.copy(N.projectionMatrix).invert(),N.viewport.set(Zt.x,Zt.y,Zt.width,Zt.height),Et===0&&(S.matrix.copy(N.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),st===!0&&S.cameras.push(N)}let mt=n.enabledFeatures;if(mt&&mt.includes("depth-sensing")){let Et=u.getDepthInformation(rt[0]);Et&&Et.isValid&&Et.texture&&m.init(t,Et,n.renderState)}}for(let rt=0;rt<v.length;rt++){let st=x[rt],mt=v[rt];st!==null&&mt!==void 0&&mt.update(st,K,h||a)}tt&&tt(G,K),K.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:K}),p=null}let nt=new Wm;nt.setAnimationLoop(ht),this.setAnimationLoop=function(G){tt=G},this.dispose=function(){}}},Cs=new Dn,rw=new Ye;function aw(r,t){function e(_,g){_.matrixAutoUpdate===!0&&_.updateMatrix(),g.value.copy(_.matrix)}function i(_,g){g.color.getRGB(_.fogColor.value,Gm(r)),g.isFog?(_.fogNear.value=g.near,_.fogFar.value=g.far):g.isFogExp2&&(_.fogDensity.value=g.density)}function n(_,g,y,v,x){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(_,g):g.isMeshToonMaterial?(s(_,g),u(_,g)):g.isMeshPhongMaterial?(s(_,g),c(_,g)):g.isMeshStandardMaterial?(s(_,g),d(_,g),g.isMeshPhysicalMaterial&&f(_,g,x)):g.isMeshMatcapMaterial?(s(_,g),p(_,g)):g.isMeshDepthMaterial?s(_,g):g.isMeshDistanceMaterial?(s(_,g),m(_,g)):g.isMeshNormalMaterial?s(_,g):g.isLineBasicMaterial?(a(_,g),g.isLineDashedMaterial&&o(_,g)):g.isPointsMaterial?l(_,g,y,v):g.isSpriteMaterial?h(_,g):g.isShadowMaterial?(_.color.value.copy(g.color),_.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(_,g){_.opacity.value=g.opacity,g.color&&_.diffuse.value.copy(g.color),g.emissive&&_.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(_.map.value=g.map,e(g.map,_.mapTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,e(g.alphaMap,_.alphaMapTransform)),g.bumpMap&&(_.bumpMap.value=g.bumpMap,e(g.bumpMap,_.bumpMapTransform),_.bumpScale.value=g.bumpScale,g.side===bi&&(_.bumpScale.value*=-1)),g.normalMap&&(_.normalMap.value=g.normalMap,e(g.normalMap,_.normalMapTransform),_.normalScale.value.copy(g.normalScale),g.side===bi&&_.normalScale.value.negate()),g.displacementMap&&(_.displacementMap.value=g.displacementMap,e(g.displacementMap,_.displacementMapTransform),_.displacementScale.value=g.displacementScale,_.displacementBias.value=g.displacementBias),g.emissiveMap&&(_.emissiveMap.value=g.emissiveMap,e(g.emissiveMap,_.emissiveMapTransform)),g.specularMap&&(_.specularMap.value=g.specularMap,e(g.specularMap,_.specularMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest);let y=t.get(g),v=y.envMap,x=y.envMapRotation;v&&(_.envMap.value=v,Cs.copy(x),Cs.x*=-1,Cs.y*=-1,Cs.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(Cs.y*=-1,Cs.z*=-1),_.envMapRotation.value.setFromMatrix4(rw.makeRotationFromEuler(Cs)),_.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=g.reflectivity,_.ior.value=g.ior,_.refractionRatio.value=g.refractionRatio),g.lightMap&&(_.lightMap.value=g.lightMap,_.lightMapIntensity.value=g.lightMapIntensity,e(g.lightMap,_.lightMapTransform)),g.aoMap&&(_.aoMap.value=g.aoMap,_.aoMapIntensity.value=g.aoMapIntensity,e(g.aoMap,_.aoMapTransform))}function a(_,g){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,g.map&&(_.map.value=g.map,e(g.map,_.mapTransform))}function o(_,g){_.dashSize.value=g.dashSize,_.totalSize.value=g.dashSize+g.gapSize,_.scale.value=g.scale}function l(_,g,y,v){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,_.size.value=g.size*y,_.scale.value=v*.5,g.map&&(_.map.value=g.map,e(g.map,_.uvTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,e(g.alphaMap,_.alphaMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest)}function h(_,g){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,_.rotation.value=g.rotation,g.map&&(_.map.value=g.map,e(g.map,_.mapTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,e(g.alphaMap,_.alphaMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest)}function c(_,g){_.specular.value.copy(g.specular),_.shininess.value=Math.max(g.shininess,1e-4)}function u(_,g){g.gradientMap&&(_.gradientMap.value=g.gradientMap)}function d(_,g){_.metalness.value=g.metalness,g.metalnessMap&&(_.metalnessMap.value=g.metalnessMap,e(g.metalnessMap,_.metalnessMapTransform)),_.roughness.value=g.roughness,g.roughnessMap&&(_.roughnessMap.value=g.roughnessMap,e(g.roughnessMap,_.roughnessMapTransform)),g.envMap&&(_.envMapIntensity.value=g.envMapIntensity)}function f(_,g,y){_.ior.value=g.ior,g.sheen>0&&(_.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),_.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(_.sheenColorMap.value=g.sheenColorMap,e(g.sheenColorMap,_.sheenColorMapTransform)),g.sheenRoughnessMap&&(_.sheenRoughnessMap.value=g.sheenRoughnessMap,e(g.sheenRoughnessMap,_.sheenRoughnessMapTransform))),g.clearcoat>0&&(_.clearcoat.value=g.clearcoat,_.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(_.clearcoatMap.value=g.clearcoatMap,e(g.clearcoatMap,_.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,e(g.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(_.clearcoatNormalMap.value=g.clearcoatNormalMap,e(g.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===bi&&_.clearcoatNormalScale.value.negate())),g.dispersion>0&&(_.dispersion.value=g.dispersion),g.iridescence>0&&(_.iridescence.value=g.iridescence,_.iridescenceIOR.value=g.iridescenceIOR,_.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(_.iridescenceMap.value=g.iridescenceMap,e(g.iridescenceMap,_.iridescenceMapTransform)),g.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=g.iridescenceThicknessMap,e(g.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),g.transmission>0&&(_.transmission.value=g.transmission,_.transmissionSamplerMap.value=y.texture,_.transmissionSamplerSize.value.set(y.width,y.height),g.transmissionMap&&(_.transmissionMap.value=g.transmissionMap,e(g.transmissionMap,_.transmissionMapTransform)),_.thickness.value=g.thickness,g.thicknessMap&&(_.thicknessMap.value=g.thicknessMap,e(g.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=g.attenuationDistance,_.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(_.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(_.anisotropyMap.value=g.anisotropyMap,e(g.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=g.specularIntensity,_.specularColor.value.copy(g.specularColor),g.specularColorMap&&(_.specularColorMap.value=g.specularColorMap,e(g.specularColorMap,_.specularColorMapTransform)),g.specularIntensityMap&&(_.specularIntensityMap.value=g.specularIntensityMap,e(g.specularIntensityMap,_.specularIntensityMapTransform))}function p(_,g){g.matcap&&(_.matcap.value=g.matcap)}function m(_,g){let y=t.get(g).light;_.referencePosition.value.setFromMatrixPosition(y.matrixWorld),_.nearDistance.value=y.shadow.camera.near,_.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:n}}function ow(r,t,e,i){let n={},s={},a=[],o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,v){let x=v.program;i.uniformBlockBinding(y,x)}function h(y,v){let x=n[y.id];x===void 0&&(p(y),x=c(y),n[y.id]=x,y.addEventListener("dispose",_));let E=v.program;i.updateUBOMapping(y,E);let w=t.render.frame;s[y.id]!==w&&(d(y),s[y.id]=w)}function c(y){let v=u();y.__bindingPointIndex=v;let x=r.createBuffer(),E=y.__size,w=y.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,E,w),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,x),x}function u(){for(let y=0;y<o;y++)if(a.indexOf(y)===-1)return a.push(y),y;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(y){let v=n[y.id],x=y.uniforms,E=y.__cache;r.bindBuffer(r.UNIFORM_BUFFER,v);for(let w=0,A=x.length;w<A;w++){let P=Array.isArray(x[w])?x[w]:[x[w]];for(let b=0,S=P.length;b<S;b++){let I=P[b];if(f(I,w,b,E)===!0){let B=I.__offset,F=Array.isArray(I.value)?I.value:[I.value],H=0;for(let J=0;J<F.length;J++){let O=F[J],V=m(O);typeof O=="number"||typeof O=="boolean"?(I.__data[0]=O,r.bufferSubData(r.UNIFORM_BUFFER,B+H,I.__data)):O.isMatrix3?(I.__data[0]=O.elements[0],I.__data[1]=O.elements[1],I.__data[2]=O.elements[2],I.__data[3]=0,I.__data[4]=O.elements[3],I.__data[5]=O.elements[4],I.__data[6]=O.elements[5],I.__data[7]=0,I.__data[8]=O.elements[6],I.__data[9]=O.elements[7],I.__data[10]=O.elements[8],I.__data[11]=0):(O.toArray(I.__data,H),H+=V.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,B,I.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function f(y,v,x,E){let w=y.value,A=v+"_"+x;if(E[A]===void 0)return typeof w=="number"||typeof w=="boolean"?E[A]=w:E[A]=w.clone(),!0;{let P=E[A];if(typeof w=="number"||typeof w=="boolean"){if(P!==w)return E[A]=w,!0}else if(P.equals(w)===!1)return P.copy(w),!0}return!1}function p(y){let v=y.uniforms,x=0,E=16;for(let A=0,P=v.length;A<P;A++){let b=Array.isArray(v[A])?v[A]:[v[A]];for(let S=0,I=b.length;S<I;S++){let B=b[S],F=Array.isArray(B.value)?B.value:[B.value];for(let H=0,J=F.length;H<J;H++){let O=F[H],V=m(O),q=x%E,W=q%V.boundary,Q=q+W;x+=W,Q!==0&&E-Q<V.storage&&(x+=E-Q),B.__data=new Float32Array(V.storage/Float32Array.BYTES_PER_ELEMENT),B.__offset=x,x+=V.storage}}}let w=x%E;return w>0&&(x+=E-w),y.__size=x,y.__cache={},this}function m(y){let v={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(v.boundary=4,v.storage=4):y.isVector2?(v.boundary=8,v.storage=8):y.isVector3||y.isColor?(v.boundary=16,v.storage=12):y.isVector4?(v.boundary=16,v.storage=16):y.isMatrix3?(v.boundary=48,v.storage=48):y.isMatrix4?(v.boundary=64,v.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),v}function _(y){let v=y.target;v.removeEventListener("dispose",_);let x=a.indexOf(v.__bindingPointIndex);a.splice(x,1),r.deleteBuffer(n[v.id]),delete n[v.id],delete s[v.id]}function g(){for(let y in n)r.deleteBuffer(n[y]);a=[],n={},s={}}return{bind:l,update:h,dispose:g}}var ql=class{constructor(t={}){let{canvas:e=fv(),context:i=null,depth:n=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:h=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=t;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=a;let f=new Uint32Array(4),p=new Int32Array(4),m=null,_=null,g=[],y=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Hi,this.toneMapping=Jn,this.toneMappingExposure=1;let v=this,x=!1,E=0,w=0,A=null,P=-1,b=null,S=new qe,I=new qe,B=null,F=new ce(0),H=0,J=e.width,O=e.height,V=1,q=null,W=null,Q=new qe(0,0,J,O),tt=new qe(0,0,J,O),ht=!1,nt=new Gl,G=!1,K=!1,rt=new Ye,st=new j,mt=new qe,Et={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},Nt=!1;function Zt(){return A===null?V:1}let N=i;function le(C,U){return e.getContext(C,U)}try{let C={alpha:!0,depth:n,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:h,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Bd}`),e.addEventListener("webglcontextlost",et,!1),e.addEventListener("webglcontextrestored",it,!1),e.addEventListener("webglcontextcreationerror",pt,!1),N===null){let U="webgl2";if(N=le(U,C),N===null)throw le(U)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(C){throw console.error("THREE.WebGLRenderer: "+C.message),C}let $t,Ht,Tt,we,kt,Ut,L,T,Z,lt,ct,at,Dt,gt,St,Vt,ut,xt,Jt,Ft,Mt,zt,Xt,fe;function k(){$t=new Ab(N),$t.init(),zt=new ew(N,$t),Ht=new vb(N,$t,t,zt),Tt=new JS(N),we=new Tb(N),kt=new zS,Ut=new tw(N,$t,Tt,kt,Ht,zt,we),L=new xb(v),T=new wb(v),Z=new Nv(N),Xt=new gb(N,Z),lt=new Mb(N,Z,we,Xt),ct=new Rb(N,lt,Z,we),Jt=new Cb(N,Ht,Ut),Vt=new yb(kt),at=new BS(v,L,T,$t,Ht,Xt,Vt),Dt=new aw(v,kt),gt=new VS,St=new $S($t),xt=new mb(v,L,T,Tt,ct,d,l),ut=new ZS(v,ct,Ht),fe=new ow(N,we,Ht,Tt),Ft=new _b(N,$t,we),Mt=new Eb(N,$t,we),we.programs=at.programs,v.capabilities=Ht,v.extensions=$t,v.properties=kt,v.renderLists=gt,v.shadowMap=ut,v.state=Tt,v.info=we}k();let dt=new Cd(v,N);this.xr=dt,this.getContext=function(){return N},this.getContextAttributes=function(){return N.getContextAttributes()},this.forceContextLoss=function(){let C=$t.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){let C=$t.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return V},this.setPixelRatio=function(C){C!==void 0&&(V=C,this.setSize(J,O,!1))},this.getSize=function(C){return C.set(J,O)},this.setSize=function(C,U,X=!0){if(dt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}J=C,O=U,e.width=Math.floor(C*V),e.height=Math.floor(U*V),X===!0&&(e.style.width=C+"px",e.style.height=U+"px"),this.setViewport(0,0,C,U)},this.getDrawingBufferSize=function(C){return C.set(J*V,O*V).floor()},this.setDrawingBufferSize=function(C,U,X){J=C,O=U,V=X,e.width=Math.floor(C*X),e.height=Math.floor(U*X),this.setViewport(0,0,C,U)},this.getCurrentViewport=function(C){return C.copy(S)},this.getViewport=function(C){return C.copy(Q)},this.setViewport=function(C,U,X,$){C.isVector4?Q.set(C.x,C.y,C.z,C.w):Q.set(C,U,X,$),Tt.viewport(S.copy(Q).multiplyScalar(V).round())},this.getScissor=function(C){return C.copy(tt)},this.setScissor=function(C,U,X,$){C.isVector4?tt.set(C.x,C.y,C.z,C.w):tt.set(C,U,X,$),Tt.scissor(I.copy(tt).multiplyScalar(V).round())},this.getScissorTest=function(){return ht},this.setScissorTest=function(C){Tt.setScissorTest(ht=C)},this.setOpaqueSort=function(C){q=C},this.setTransparentSort=function(C){W=C},this.getClearColor=function(C){return C.copy(xt.getClearColor())},this.setClearColor=function(){xt.setClearColor.apply(xt,arguments)},this.getClearAlpha=function(){return xt.getClearAlpha()},this.setClearAlpha=function(){xt.setClearAlpha.apply(xt,arguments)},this.clear=function(C=!0,U=!0,X=!0){let $=0;if(C){let z=!1;if(A!==null){let ft=A.texture.format;z=ft===Xd||ft===Wd||ft===Gd}if(z){let ft=A.texture.type,yt=ft===In||ft===Ns||ft===Da||ft===Pr||ft===Hd||ft===Vd,At=xt.getClearColor(),vt=xt.getClearAlpha(),Lt=At.r,It=At.g,Ct=At.b;yt?(f[0]=Lt,f[1]=It,f[2]=Ct,f[3]=vt,N.clearBufferuiv(N.COLOR,0,f)):(p[0]=Lt,p[1]=It,p[2]=Ct,p[3]=vt,N.clearBufferiv(N.COLOR,0,p))}else $|=N.COLOR_BUFFER_BIT}U&&($|=N.DEPTH_BUFFER_BIT),X&&($|=N.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),N.clear($)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",et,!1),e.removeEventListener("webglcontextrestored",it,!1),e.removeEventListener("webglcontextcreationerror",pt,!1),gt.dispose(),St.dispose(),kt.dispose(),L.dispose(),T.dispose(),ct.dispose(),Xt.dispose(),fe.dispose(),at.dispose(),dt.dispose(),dt.removeEventListener("sessionstart",Ui),dt.removeEventListener("sessionend",us),_n.stop()};function et(C){C.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function it(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;let C=we.autoReset,U=ut.enabled,X=ut.autoUpdate,$=ut.needsUpdate,z=ut.type;k(),we.autoReset=C,ut.enabled=U,ut.autoUpdate=X,ut.needsUpdate=$,ut.type=z}function pt(C){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function Ot(C){let U=C.target;U.removeEventListener("dispose",Ot),te(U)}function te(C){Ce(C),kt.remove(C)}function Ce(C){let U=kt.get(C).programs;U!==void 0&&(U.forEach(function(X){at.releaseProgram(X)}),C.isShaderMaterial&&at.releaseShaderCache(C))}this.renderBufferDirect=function(C,U,X,$,z,ft){U===null&&(U=Et);let yt=z.isMesh&&z.matrixWorld.determinant()<0,At=Qa(C,U,X,$,z);Tt.setMaterial($,yt);let vt=X.index,Lt=1;if($.wireframe===!0){if(vt=lt.getWireframeAttribute(X),vt===void 0)return;Lt=2}let It=X.drawRange,Ct=X.attributes.position,Qt=It.start*Lt,se=(It.start+It.count)*Lt;ft!==null&&(Qt=Math.max(Qt,ft.start*Lt),se=Math.min(se,(ft.start+ft.count)*Lt)),vt!==null?(Qt=Math.max(Qt,0),se=Math.min(se,vt.count)):Ct!=null&&(Qt=Math.max(Qt,0),se=Math.min(se,Ct.count));let oe=se-Qt;if(oe<0||oe===1/0)return;Xt.setup(z,$,At,X,vt);let ti,re=Ft;if(vt!==null&&(ti=Z.get(vt),re=Mt,re.setIndex(ti)),z.isMesh)$.wireframe===!0?(Tt.setLineWidth($.wireframeLinewidth*Zt()),re.setMode(N.LINES)):re.setMode(N.TRIANGLES);else if(z.isLine){let Rt=$.linewidth;Rt===void 0&&(Rt=1),Tt.setLineWidth(Rt*Zt()),z.isLineSegments?re.setMode(N.LINES):z.isLineLoop?re.setMode(N.LINE_LOOP):re.setMode(N.LINE_STRIP)}else z.isPoints?re.setMode(N.POINTS):z.isSprite&&re.setMode(N.TRIANGLES);if(z.isBatchedMesh)if(z._multiDrawInstances!==null)re.renderMultiDrawInstances(z._multiDrawStarts,z._multiDrawCounts,z._multiDrawCount,z._multiDrawInstances);else if($t.get("WEBGL_multi_draw"))re.renderMultiDraw(z._multiDrawStarts,z._multiDrawCounts,z._multiDrawCount);else{let Rt=z._multiDrawStarts,de=z._multiDrawCounts,ee=z._multiDrawCount,li=vt?Z.get(vt).bytesPerElement:1,rn=kt.get($).currentProgram.getUniforms();for(let $e=0;$e<ee;$e++)rn.setValue(N,"_gl_DrawID",$e),re.render(Rt[$e]/li,de[$e])}else if(z.isInstancedMesh)re.renderInstances(Qt,oe,z.count);else if(X.isInstancedBufferGeometry){let Rt=X._maxInstanceCount!==void 0?X._maxInstanceCount:1/0,de=Math.min(X.instanceCount,Rt);re.renderInstances(Qt,oe,de)}else re.render(Qt,oe)};function De(C,U,X){C.transparent===!0&&C.side===Tn&&C.forceSinglePass===!1?(C.side=bi,C.needsUpdate=!0,Zs(C,U,X),C.side=en,C.needsUpdate=!0,Zs(C,U,X),C.side=Tn):Zs(C,U,X)}this.compile=function(C,U,X=null){X===null&&(X=C),_=St.get(X),_.init(U),y.push(_),X.traverseVisible(function(z){z.isLight&&z.layers.test(U.layers)&&(_.pushLight(z),z.castShadow&&_.pushShadow(z))}),C!==X&&C.traverseVisible(function(z){z.isLight&&z.layers.test(U.layers)&&(_.pushLight(z),z.castShadow&&_.pushShadow(z))}),_.setupLights();let $=new Set;return C.traverse(function(z){let ft=z.material;if(ft)if(Array.isArray(ft))for(let yt=0;yt<ft.length;yt++){let At=ft[yt];De(At,X,z),$.add(At)}else De(ft,X,z),$.add(ft)}),y.pop(),_=null,$},this.compileAsync=function(C,U,X=null){let $=this.compile(C,U,X);return new Promise(z=>{function ft(){if($.forEach(function(yt){kt.get(yt).currentProgram.isReady()&&$.delete(yt)}),$.size===0){z(C);return}setTimeout(ft,10)}$t.get("KHR_parallel_shader_compile")!==null?ft():setTimeout(ft,10)})};let ae=null;function Yi(C){ae&&ae(C)}function Ui(){_n.stop()}function us(){_n.start()}let _n=new Wm;_n.setAnimationLoop(Yi),typeof self<"u"&&_n.setContext(self),this.setAnimationLoop=function(C){ae=C,dt.setAnimationLoop(C),C===null?_n.stop():_n.start()},dt.addEventListener("sessionstart",Ui),dt.addEventListener("sessionend",us),this.render=function(C,U){if(U!==void 0&&U.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),U.parent===null&&U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),dt.enabled===!0&&dt.isPresenting===!0&&(dt.cameraAutoUpdate===!0&&dt.updateCamera(U),U=dt.getCamera()),C.isScene===!0&&C.onBeforeRender(v,C,U,A),_=St.get(C,y.length),_.init(U),y.push(_),rt.multiplyMatrices(U.projectionMatrix,U.matrixWorldInverse),nt.setFromProjectionMatrix(rt),K=this.localClippingEnabled,G=Vt.init(this.clippingPlanes,K),m=gt.get(C,g.length),m.init(),g.push(m),dt.enabled===!0&&dt.isPresenting===!0){let ft=v.xr.getDepthSensingMesh();ft!==null&&Kr(ft,U,-1/0,v.sortObjects)}Kr(C,U,0,v.sortObjects),m.finish(),v.sortObjects===!0&&m.sort(q,W),Nt=dt.enabled===!1||dt.isPresenting===!1||dt.hasDepthSensing()===!1,Nt&&xt.addToRenderList(m,C),this.info.render.frame++,G===!0&&Vt.beginShadows();let X=_.state.shadowsArray;ut.render(X,C,U),G===!0&&Vt.endShadows(),this.info.autoReset===!0&&this.info.reset();let $=m.opaque,z=m.transmissive;if(_.setupLights(),U.isArrayCamera){let ft=U.cameras;if(z.length>0)for(let yt=0,At=ft.length;yt<At;yt++){let vt=ft[yt];Ks($,z,C,vt)}Nt&&xt.render(C);for(let yt=0,At=ft.length;yt<At;yt++){let vt=ft[yt];jr(m,C,vt,vt.viewport)}}else z.length>0&&Ks($,z,C,U),Nt&&xt.render(C),jr(m,C,U);A!==null&&(Ut.updateMultisampleRenderTarget(A),Ut.updateRenderTargetMipmap(A)),C.isScene===!0&&C.onAfterRender(v,C,U),Xt.resetDefaultState(),P=-1,b=null,y.pop(),y.length>0?(_=y[y.length-1],G===!0&&Vt.setGlobalState(v.clippingPlanes,_.state.camera)):_=null,g.pop(),g.length>0?m=g[g.length-1]:m=null};function Kr(C,U,X,$){if(C.visible===!1)return;if(C.layers.test(U.layers)){if(C.isGroup)X=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(U);else if(C.isLight)_.pushLight(C),C.castShadow&&_.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||nt.intersectsSprite(C)){$&&mt.setFromMatrixPosition(C.matrixWorld).applyMatrix4(rt);let yt=ct.update(C),At=C.material;At.visible&&m.push(C,yt,At,X,mt.z,null)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||nt.intersectsObject(C))){let yt=ct.update(C),At=C.material;if($&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),mt.copy(C.boundingSphere.center)):(yt.boundingSphere===null&&yt.computeBoundingSphere(),mt.copy(yt.boundingSphere.center)),mt.applyMatrix4(C.matrixWorld).applyMatrix4(rt)),Array.isArray(At)){let vt=yt.groups;for(let Lt=0,It=vt.length;Lt<It;Lt++){let Ct=vt[Lt],Qt=At[Ct.materialIndex];Qt&&Qt.visible&&m.push(C,yt,Qt,X,mt.z,Ct)}}else At.visible&&m.push(C,yt,At,X,mt.z,null)}}let ft=C.children;for(let yt=0,At=ft.length;yt<At;yt++)Kr(ft[yt],U,X,$)}function jr(C,U,X,$){let z=C.opaque,ft=C.transmissive,yt=C.transparent;_.setupLightsView(X),G===!0&&Vt.setGlobalState(v.clippingPlanes,X),$&&Tt.viewport(S.copy($)),z.length>0&&js(z,U,X),ft.length>0&&js(ft,U,X),yt.length>0&&js(yt,U,X),Tt.buffers.depth.setTest(!0),Tt.buffers.depth.setMask(!0),Tt.buffers.color.setMask(!0),Tt.setPolygonOffset(!1)}function Ks(C,U,X,$){if((X.isScene===!0?X.overrideMaterial:null)!==null)return;_.state.transmissionRenderTarget[$.id]===void 0&&(_.state.transmissionRenderTarget[$.id]=new Ln(1,1,{generateMipmaps:!0,type:$t.has("EXT_color_buffer_half_float")||$t.has("EXT_color_buffer_float")?Fa:In,minFilter:Ds,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:he.workingColorSpace}));let ft=_.state.transmissionRenderTarget[$.id],yt=$.viewport||S;ft.setSize(yt.z,yt.w);let At=v.getRenderTarget();v.setRenderTarget(ft),v.getClearColor(F),H=v.getClearAlpha(),H<1&&v.setClearColor(16777215,.5),v.clear(),Nt&&xt.render(X);let vt=v.toneMapping;v.toneMapping=Jn;let Lt=$.viewport;if($.viewport!==void 0&&($.viewport=void 0),_.setupLightsView($),G===!0&&Vt.setGlobalState(v.clippingPlanes,$),js(C,X,$),Ut.updateMultisampleRenderTarget(ft),Ut.updateRenderTargetMipmap(ft),$t.has("WEBGL_multisampled_render_to_texture")===!1){let It=!1;for(let Ct=0,Qt=U.length;Ct<Qt;Ct++){let se=U[Ct],oe=se.object,ti=se.geometry,re=se.material,Rt=se.group;if(re.side===Tn&&oe.layers.test($.layers)){let de=re.side;re.side=bi,re.needsUpdate=!0,Zr(oe,X,$,ti,re,Rt),re.side=de,re.needsUpdate=!0,It=!0}}It===!0&&(Ut.updateMultisampleRenderTarget(ft),Ut.updateRenderTargetMipmap(ft))}v.setRenderTarget(At),v.setClearColor(F,H),Lt!==void 0&&($.viewport=Lt),v.toneMapping=vt}function js(C,U,X){let $=U.isScene===!0?U.overrideMaterial:null;for(let z=0,ft=C.length;z<ft;z++){let yt=C[z],At=yt.object,vt=yt.geometry,Lt=$===null?yt.material:$,It=yt.group;At.layers.test(X.layers)&&Zr(At,U,X,vt,Lt,It)}}function Zr(C,U,X,$,z,ft){C.onBeforeRender(v,U,X,$,z,ft),C.modelViewMatrix.multiplyMatrices(X.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),z.transparent===!0&&z.side===Tn&&z.forceSinglePass===!1?(z.side=bi,z.needsUpdate=!0,v.renderBufferDirect(X,U,$,z,C,ft),z.side=en,z.needsUpdate=!0,v.renderBufferDirect(X,U,$,z,C,ft),z.side=Tn):v.renderBufferDirect(X,U,$,z,C,ft),C.onAfterRender(v,U,X,$,z,ft)}function Zs(C,U,X){U.isScene!==!0&&(U=Et);let $=kt.get(C),z=_.state.lights,ft=_.state.shadowsArray,yt=z.state.version,At=at.getParameters(C,z.state,ft,U,X),vt=at.getProgramCacheKey(At),Lt=$.programs;$.environment=C.isMeshStandardMaterial?U.environment:null,$.fog=U.fog,$.envMap=(C.isMeshStandardMaterial?T:L).get(C.envMap||$.environment),$.envMapRotation=$.environment!==null&&C.envMap===null?U.environmentRotation:C.envMapRotation,Lt===void 0&&(C.addEventListener("dispose",Ot),Lt=new Map,$.programs=Lt);let It=Lt.get(vt);if(It!==void 0){if($.currentProgram===It&&$.lightsStateVersion===yt)return Qr(C,At),It}else At.uniforms=at.getUniforms(C),C.onBeforeCompile(At,v),It=at.acquireProgram(At,vt),Lt.set(vt,It),$.uniforms=At.uniforms;let Ct=$.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&(Ct.clippingPlanes=Vt.uniform),Qr(C,At),$.needsLights=ta(C),$.lightsStateVersion=yt,$.needsLights&&(Ct.ambientLightColor.value=z.state.ambient,Ct.lightProbe.value=z.state.probe,Ct.directionalLights.value=z.state.directional,Ct.directionalLightShadows.value=z.state.directionalShadow,Ct.spotLights.value=z.state.spot,Ct.spotLightShadows.value=z.state.spotShadow,Ct.rectAreaLights.value=z.state.rectArea,Ct.ltc_1.value=z.state.rectAreaLTC1,Ct.ltc_2.value=z.state.rectAreaLTC2,Ct.pointLights.value=z.state.point,Ct.pointLightShadows.value=z.state.pointShadow,Ct.hemisphereLights.value=z.state.hemi,Ct.directionalShadowMap.value=z.state.directionalShadowMap,Ct.directionalShadowMatrix.value=z.state.directionalShadowMatrix,Ct.spotShadowMap.value=z.state.spotShadowMap,Ct.spotLightMatrix.value=z.state.spotLightMatrix,Ct.spotLightMap.value=z.state.spotLightMap,Ct.pointShadowMap.value=z.state.pointShadowMap,Ct.pointShadowMatrix.value=z.state.pointShadowMatrix),$.currentProgram=It,$.uniformsList=null,It}function Jr(C){if(C.uniformsList===null){let U=C.currentProgram.getUniforms();C.uniformsList=Tr.seqWithValue(U.seq,C.uniforms)}return C.uniformsList}function Qr(C,U){let X=kt.get(C);X.outputColorSpace=U.outputColorSpace,X.batching=U.batching,X.batchingColor=U.batchingColor,X.instancing=U.instancing,X.instancingColor=U.instancingColor,X.instancingMorph=U.instancingMorph,X.skinning=U.skinning,X.morphTargets=U.morphTargets,X.morphNormals=U.morphNormals,X.morphColors=U.morphColors,X.morphTargetsCount=U.morphTargetsCount,X.numClippingPlanes=U.numClippingPlanes,X.numIntersection=U.numClipIntersection,X.vertexAlphas=U.vertexAlphas,X.vertexTangents=U.vertexTangents,X.toneMapping=U.toneMapping}function Qa(C,U,X,$,z){U.isScene!==!0&&(U=Et),Ut.resetTextureUnits();let ft=U.fog,yt=$.isMeshStandardMaterial?U.environment:null,At=A===null?v.outputColorSpace:A.isXRRenderTarget===!0?A.texture.colorSpace:es,vt=($.isMeshStandardMaterial?T:L).get($.envMap||yt),Lt=$.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,It=!!X.attributes.tangent&&(!!$.normalMap||$.anisotropy>0),Ct=!!X.morphAttributes.position,Qt=!!X.morphAttributes.normal,se=!!X.morphAttributes.color,oe=Jn;$.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(oe=v.toneMapping);let ti=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,re=ti!==void 0?ti.length:0,Rt=kt.get($),de=_.state.lights;if(G===!0&&(K===!0||C!==b)){let hi=C===b&&$.id===P;Vt.setState($,C,hi)}let ee=!1;$.version===Rt.__version?(Rt.needsLights&&Rt.lightsStateVersion!==de.state.version||Rt.outputColorSpace!==At||z.isBatchedMesh&&Rt.batching===!1||!z.isBatchedMesh&&Rt.batching===!0||z.isBatchedMesh&&Rt.batchingColor===!0&&z.colorTexture===null||z.isBatchedMesh&&Rt.batchingColor===!1&&z.colorTexture!==null||z.isInstancedMesh&&Rt.instancing===!1||!z.isInstancedMesh&&Rt.instancing===!0||z.isSkinnedMesh&&Rt.skinning===!1||!z.isSkinnedMesh&&Rt.skinning===!0||z.isInstancedMesh&&Rt.instancingColor===!0&&z.instanceColor===null||z.isInstancedMesh&&Rt.instancingColor===!1&&z.instanceColor!==null||z.isInstancedMesh&&Rt.instancingMorph===!0&&z.morphTexture===null||z.isInstancedMesh&&Rt.instancingMorph===!1&&z.morphTexture!==null||Rt.envMap!==vt||$.fog===!0&&Rt.fog!==ft||Rt.numClippingPlanes!==void 0&&(Rt.numClippingPlanes!==Vt.numPlanes||Rt.numIntersection!==Vt.numIntersection)||Rt.vertexAlphas!==Lt||Rt.vertexTangents!==It||Rt.morphTargets!==Ct||Rt.morphNormals!==Qt||Rt.morphColors!==se||Rt.toneMapping!==oe||Rt.morphTargetsCount!==re)&&(ee=!0):(ee=!0,Rt.__version=$.version);let li=Rt.currentProgram;ee===!0&&(li=Zs($,U,z));let rn=!1,$e=!1,ds=!1,_e=li.getUniforms(),Ge=Rt.uniforms;if(Tt.useProgram(li.program)&&(rn=!0,$e=!0,ds=!0),$.id!==P&&(P=$.id,$e=!0),rn||b!==C){_e.setValue(N,"projectionMatrix",C.projectionMatrix),_e.setValue(N,"viewMatrix",C.matrixWorldInverse);let hi=_e.map.cameraPosition;hi!==void 0&&hi.setValue(N,st.setFromMatrixPosition(C.matrixWorld)),Ht.logarithmicDepthBuffer&&_e.setValue(N,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),($.isMeshPhongMaterial||$.isMeshToonMaterial||$.isMeshLambertMaterial||$.isMeshBasicMaterial||$.isMeshStandardMaterial||$.isShaderMaterial)&&_e.setValue(N,"isOrthographic",C.isOrthographicCamera===!0),b!==C&&(b=C,$e=!0,ds=!0)}if(z.isSkinnedMesh){_e.setOptional(N,z,"bindMatrix"),_e.setOptional(N,z,"bindMatrixInverse");let hi=z.skeleton;hi&&(hi.boneTexture===null&&hi.computeBoneTexture(),_e.setValue(N,"boneTexture",hi.boneTexture,Ut))}z.isBatchedMesh&&(_e.setOptional(N,z,"batchingTexture"),_e.setValue(N,"batchingTexture",z._matricesTexture,Ut),_e.setOptional(N,z,"batchingIdTexture"),_e.setValue(N,"batchingIdTexture",z._indirectTexture,Ut),_e.setOptional(N,z,"batchingColorTexture"),z._colorsTexture!==null&&_e.setValue(N,"batchingColorTexture",z._colorsTexture,Ut));let ea=X.morphAttributes;if((ea.position!==void 0||ea.normal!==void 0||ea.color!==void 0)&&Jt.update(z,X,li),($e||Rt.receiveShadow!==z.receiveShadow)&&(Rt.receiveShadow=z.receiveShadow,_e.setValue(N,"receiveShadow",z.receiveShadow)),$.isMeshGouraudMaterial&&$.envMap!==null&&(Ge.envMap.value=vt,Ge.flipEnvMap.value=vt.isCubeTexture&&vt.isRenderTargetTexture===!1?-1:1),$.isMeshStandardMaterial&&$.envMap===null&&U.environment!==null&&(Ge.envMapIntensity.value=U.environmentIntensity),$e&&(_e.setValue(N,"toneMappingExposure",v.toneMappingExposure),Rt.needsLights&&to(Ge,ds),ft&&$.fog===!0&&Dt.refreshFogUniforms(Ge,ft),Dt.refreshMaterialUniforms(Ge,$,V,O,_.state.transmissionRenderTarget[C.id]),Tr.upload(N,Jr(Rt),Ge,Ut)),$.isShaderMaterial&&$.uniformsNeedUpdate===!0&&(Tr.upload(N,Jr(Rt),Ge,Ut),$.uniformsNeedUpdate=!1),$.isSpriteMaterial&&_e.setValue(N,"center",z.center),_e.setValue(N,"modelViewMatrix",z.modelViewMatrix),_e.setValue(N,"normalMatrix",z.normalMatrix),_e.setValue(N,"modelMatrix",z.matrixWorld),$.isShaderMaterial||$.isRawShaderMaterial){let hi=$.uniformsGroups;for(let fs=0,eo=hi.length;fs<eo;fs++){let io=hi[fs];fe.update(io,li),fe.bind(io,li)}}return li}function to(C,U){C.ambientLightColor.needsUpdate=U,C.lightProbe.needsUpdate=U,C.directionalLights.needsUpdate=U,C.directionalLightShadows.needsUpdate=U,C.pointLights.needsUpdate=U,C.pointLightShadows.needsUpdate=U,C.spotLights.needsUpdate=U,C.spotLightShadows.needsUpdate=U,C.rectAreaLights.needsUpdate=U,C.hemisphereLights.needsUpdate=U}function ta(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return w},this.getRenderTarget=function(){return A},this.setRenderTargetTextures=function(C,U,X){kt.get(C.texture).__webglTexture=U,kt.get(C.depthTexture).__webglTexture=X;let $=kt.get(C);$.__hasExternalTextures=!0,$.__autoAllocateDepthBuffer=X===void 0,$.__autoAllocateDepthBuffer||$t.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),$.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(C,U){let X=kt.get(C);X.__webglFramebuffer=U,X.__useDefaultFramebuffer=U===void 0},this.setRenderTarget=function(C,U=0,X=0){A=C,E=U,w=X;let $=!0,z=null,ft=!1,yt=!1;if(C){let vt=kt.get(C);vt.__useDefaultFramebuffer!==void 0?(Tt.bindFramebuffer(N.FRAMEBUFFER,null),$=!1):vt.__webglFramebuffer===void 0?Ut.setupRenderTarget(C):vt.__hasExternalTextures&&Ut.rebindTextures(C,kt.get(C.texture).__webglTexture,kt.get(C.depthTexture).__webglTexture);let Lt=C.texture;(Lt.isData3DTexture||Lt.isDataArrayTexture||Lt.isCompressedArrayTexture)&&(yt=!0);let It=kt.get(C).__webglFramebuffer;C.isWebGLCubeRenderTarget?(Array.isArray(It[U])?z=It[U][X]:z=It[U],ft=!0):C.samples>0&&Ut.useMultisampledRTT(C)===!1?z=kt.get(C).__webglMultisampledFramebuffer:Array.isArray(It)?z=It[X]:z=It,S.copy(C.viewport),I.copy(C.scissor),B=C.scissorTest}else S.copy(Q).multiplyScalar(V).floor(),I.copy(tt).multiplyScalar(V).floor(),B=ht;if(Tt.bindFramebuffer(N.FRAMEBUFFER,z)&&$&&Tt.drawBuffers(C,z),Tt.viewport(S),Tt.scissor(I),Tt.setScissorTest(B),ft){let vt=kt.get(C.texture);N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_CUBE_MAP_POSITIVE_X+U,vt.__webglTexture,X)}else if(yt){let vt=kt.get(C.texture),Lt=U||0;N.framebufferTextureLayer(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,vt.__webglTexture,X||0,Lt)}P=-1},this.readRenderTargetPixels=function(C,U,X,$,z,ft,yt){if(!(C&&C.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let At=kt.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&yt!==void 0&&(At=At[yt]),At){Tt.bindFramebuffer(N.FRAMEBUFFER,At);try{let vt=C.texture,Lt=vt.format,It=vt.type;if(!Ht.textureFormatReadable(Lt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ht.textureTypeReadable(It)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}U>=0&&U<=C.width-$&&X>=0&&X<=C.height-z&&N.readPixels(U,X,$,z,zt.convert(Lt),zt.convert(It),ft)}finally{let vt=A!==null?kt.get(A).__webglFramebuffer:null;Tt.bindFramebuffer(N.FRAMEBUFFER,vt)}}},this.readRenderTargetPixelsAsync=async function(C,U,X,$,z,ft,yt){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let At=kt.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&yt!==void 0&&(At=At[yt]),At){Tt.bindFramebuffer(N.FRAMEBUFFER,At);try{let vt=C.texture,Lt=vt.format,It=vt.type;if(!Ht.textureFormatReadable(Lt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ht.textureTypeReadable(It))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(U>=0&&U<=C.width-$&&X>=0&&X<=C.height-z){let Ct=N.createBuffer();N.bindBuffer(N.PIXEL_PACK_BUFFER,Ct),N.bufferData(N.PIXEL_PACK_BUFFER,ft.byteLength,N.STREAM_READ),N.readPixels(U,X,$,z,zt.convert(Lt),zt.convert(It),0),N.flush();let Qt=N.fenceSync(N.SYNC_GPU_COMMANDS_COMPLETE,0);await pv(N,Qt,4);try{N.bindBuffer(N.PIXEL_PACK_BUFFER,Ct),N.getBufferSubData(N.PIXEL_PACK_BUFFER,0,ft)}finally{N.deleteBuffer(Ct),N.deleteSync(Qt)}return ft}}finally{let vt=A!==null?kt.get(A).__webglFramebuffer:null;Tt.bindFramebuffer(N.FRAMEBUFFER,vt)}}},this.copyFramebufferToTexture=function(C,U=null,X=0){C.isTexture!==!0&&(Ia("WebGLRenderer: copyFramebufferToTexture function signature has changed."),U=arguments[0]||null,C=arguments[1]);let $=Math.pow(2,-X),z=Math.floor(C.image.width*$),ft=Math.floor(C.image.height*$),yt=U!==null?U.x:0,At=U!==null?U.y:0;Ut.setTexture2D(C,0),N.copyTexSubImage2D(N.TEXTURE_2D,X,0,0,yt,At,z,ft),Tt.unbindTexture()},this.copyTextureToTexture=function(C,U,X=null,$=null,z=0){C.isTexture!==!0&&(Ia("WebGLRenderer: copyTextureToTexture function signature has changed."),$=arguments[0]||null,C=arguments[1],U=arguments[2],z=arguments[3]||0,X=null);let ft,yt,At,vt,Lt,It;X!==null?(ft=X.max.x-X.min.x,yt=X.max.y-X.min.y,At=X.min.x,vt=X.min.y):(ft=C.image.width,yt=C.image.height,At=0,vt=0),$!==null?(Lt=$.x,It=$.y):(Lt=0,It=0);let Ct=zt.convert(U.format),Qt=zt.convert(U.type);Ut.setTexture2D(U,0),N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,U.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,U.unpackAlignment);let se=N.getParameter(N.UNPACK_ROW_LENGTH),oe=N.getParameter(N.UNPACK_IMAGE_HEIGHT),ti=N.getParameter(N.UNPACK_SKIP_PIXELS),re=N.getParameter(N.UNPACK_SKIP_ROWS),Rt=N.getParameter(N.UNPACK_SKIP_IMAGES),de=C.isCompressedTexture?C.mipmaps[z]:C.image;N.pixelStorei(N.UNPACK_ROW_LENGTH,de.width),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,de.height),N.pixelStorei(N.UNPACK_SKIP_PIXELS,At),N.pixelStorei(N.UNPACK_SKIP_ROWS,vt),C.isDataTexture?N.texSubImage2D(N.TEXTURE_2D,z,Lt,It,ft,yt,Ct,Qt,de.data):C.isCompressedTexture?N.compressedTexSubImage2D(N.TEXTURE_2D,z,Lt,It,de.width,de.height,Ct,de.data):N.texSubImage2D(N.TEXTURE_2D,z,Lt,It,ft,yt,Ct,Qt,de),N.pixelStorei(N.UNPACK_ROW_LENGTH,se),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,oe),N.pixelStorei(N.UNPACK_SKIP_PIXELS,ti),N.pixelStorei(N.UNPACK_SKIP_ROWS,re),N.pixelStorei(N.UNPACK_SKIP_IMAGES,Rt),z===0&&U.generateMipmaps&&N.generateMipmap(N.TEXTURE_2D),Tt.unbindTexture()},this.copyTextureToTexture3D=function(C,U,X=null,$=null,z=0){C.isTexture!==!0&&(Ia("WebGLRenderer: copyTextureToTexture3D function signature has changed."),X=arguments[0]||null,$=arguments[1]||null,C=arguments[2],U=arguments[3],z=arguments[4]||0);let ft,yt,At,vt,Lt,It,Ct,Qt,se,oe=C.isCompressedTexture?C.mipmaps[z]:C.image;X!==null?(ft=X.max.x-X.min.x,yt=X.max.y-X.min.y,At=X.max.z-X.min.z,vt=X.min.x,Lt=X.min.y,It=X.min.z):(ft=oe.width,yt=oe.height,At=oe.depth,vt=0,Lt=0,It=0),$!==null?(Ct=$.x,Qt=$.y,se=$.z):(Ct=0,Qt=0,se=0);let ti=zt.convert(U.format),re=zt.convert(U.type),Rt;if(U.isData3DTexture)Ut.setTexture3D(U,0),Rt=N.TEXTURE_3D;else if(U.isDataArrayTexture||U.isCompressedArrayTexture)Ut.setTexture2DArray(U,0),Rt=N.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,U.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,U.unpackAlignment);let de=N.getParameter(N.UNPACK_ROW_LENGTH),ee=N.getParameter(N.UNPACK_IMAGE_HEIGHT),li=N.getParameter(N.UNPACK_SKIP_PIXELS),rn=N.getParameter(N.UNPACK_SKIP_ROWS),$e=N.getParameter(N.UNPACK_SKIP_IMAGES);N.pixelStorei(N.UNPACK_ROW_LENGTH,oe.width),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,oe.height),N.pixelStorei(N.UNPACK_SKIP_PIXELS,vt),N.pixelStorei(N.UNPACK_SKIP_ROWS,Lt),N.pixelStorei(N.UNPACK_SKIP_IMAGES,It),C.isDataTexture||C.isData3DTexture?N.texSubImage3D(Rt,z,Ct,Qt,se,ft,yt,At,ti,re,oe.data):U.isCompressedArrayTexture?N.compressedTexSubImage3D(Rt,z,Ct,Qt,se,ft,yt,At,ti,oe.data):N.texSubImage3D(Rt,z,Ct,Qt,se,ft,yt,At,ti,re,oe),N.pixelStorei(N.UNPACK_ROW_LENGTH,de),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,ee),N.pixelStorei(N.UNPACK_SKIP_PIXELS,li),N.pixelStorei(N.UNPACK_SKIP_ROWS,rn),N.pixelStorei(N.UNPACK_SKIP_IMAGES,$e),z===0&&U.generateMipmaps&&N.generateMipmap(Rt),Tt.unbindTexture()},this.initRenderTarget=function(C){kt.get(C).__webglFramebuffer===void 0&&Ut.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?Ut.setTextureCube(C,0):C.isData3DTexture?Ut.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?Ut.setTexture2DArray(C,0):Ut.setTexture2D(C,0),Tt.unbindTexture()},this.resetState=function(){E=0,w=0,A=null,Tt.reset(),Xt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Rn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===qd?"display-p3":"srgb",e.unpackColorSpace=he.workingColorSpace===jl?"display-p3":"srgb"}};var Yl=class extends nn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Dn,this.environmentIntensity=1,this.environmentRotation=new Dn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var Nr=class extends Li{constructor(t,e,i,n,s,a,o,l,h){super(t,e,i,n,s,a,o,l,h),this.isCanvasTexture=!0,this.needsUpdate=!0}};function wl(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function lw(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var Or=class{constructor(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=n!==void 0?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,n=e[i],s=e[i-1];i:{t:{let a;e:{n:if(!(t<n)){for(let o=i+2;;){if(n===void 0){if(t<s)break n;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===o)break;if(s=n,n=e[++i],t<n)break t}a=e.length;break e}if(!(t>=s)){let o=e[1];t<o&&(i=2,s=o);for(let l=i-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(n=s,s=e[--i-1],t>=s)break t}a=i,i=0;break e}break i}for(;i<a;){let o=i+a>>>1;t<e[o]?a=o:i=o+1}if(n=e[i],s=e[i-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===void 0)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,n)}return this.interpolate_(i,s,t,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=t*n;for(let a=0;a!==n;++a)e[a]=i[s+a];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Rd=class extends Or{constructor(t,e,i,n){super(t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Dp,endingEnd:Dp}}intervalChanged_(t,e,i){let n=this.parameterPositions,s=t-2,a=t+1,o=n[s],l=n[a];if(o===void 0)switch(this.getSettings_().endingStart){case Np:s=t,o=2*e-i;break;case Op:s=n.length-2,o=e+n[s]-n[s+1];break;default:s=t,o=i}if(l===void 0)switch(this.getSettings_().endingEnd){case Np:a=t,l=2*i-e;break;case Op:a=1,l=i+n[1]-n[0];break;default:a=t-1,l=e}let h=(i-e)*.5,c=this.valueSize;this._weightPrev=h/(e-o),this._weightNext=h/(l-i),this._offsetPrev=s*c,this._offsetNext=a*c}interpolate_(t,e,i,n){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=t*o,h=l-o,c=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(i-e)/(n-e),m=p*p,_=m*p,g=-d*_+2*d*m-d*p,y=(1+d)*_+(-1.5-2*d)*m+(-.5+d)*p+1,v=(-1-f)*_+(1.5+f)*m+.5*p,x=f*_-f*m;for(let E=0;E!==o;++E)s[E]=g*a[c+E]+y*a[h+E]+v*a[l+E]+x*a[u+E];return s}},Pd=class extends Or{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=t*o,h=l-o,c=(i-e)/(n-e),u=1-c;for(let d=0;d!==o;++d)s[d]=a[h+d]*u+a[l+d]*c;return s}},Id=class extends Or{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t){return this.copySampleValue_(t-1)}},sn=class{constructor(t,e,i,n){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=wl(e,this.TimeBufferType),this.values=wl(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:wl(t.times,Array),values:wl(t.values,Array)};let n=t.getInterpolation();n!==t.DefaultInterpolation&&(i.interpolation=n)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new Id(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Pd(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Rd(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Pl:e=this.InterpolantFactoryMethodDiscrete;break;case hd:e=this.InterpolantFactoryMethodLinear;break;case su:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Pl;case this.InterpolantFactoryMethodLinear:return hd;case this.InterpolantFactoryMethodSmooth:return su}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this}trim(t,e){let i=this.times,n=i.length,s=0,a=n-1;for(;s!==n&&i[s]<t;)++s;for(;a!==-1&&i[a]>e;)--a;if(++a,s!==0||a!==n){s>=a&&(a=Math.max(a,1),s=a-1);let o=this.getValueSize();this.times=i.slice(s,a),this.values=this.values.slice(s*o,a*o)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,n=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==s;o++){let l=i[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),t=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),t=!1;break}a=l}if(n!==void 0&&lw(n))for(let o=0,l=n.length;o!==l;++o){let h=n[o];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,h),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),n=this.getInterpolation()===su,s=t.length-1,a=1;for(let o=1;o<s;++o){let l=!1,h=t[o],c=t[o+1];if(h!==c&&(o!==1||h!==t[0]))if(n)l=!0;else{let u=o*i,d=u-i,f=u+i;for(let p=0;p!==i;++p){let m=e[u+p];if(m!==e[d+p]||m!==e[f+p]){l=!0;break}}}if(l){if(o!==a){t[a]=t[o];let u=o*i,d=a*i;for(let f=0;f!==i;++f)e[d+f]=e[u+f]}++a}}if(s>0){t[a]=t[s];for(let o=s*i,l=a*i,h=0;h!==i;++h)e[l+h]=e[o+h];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=this.constructor,n=new i(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}};sn.prototype.TimeBufferType=Float32Array;sn.prototype.ValueBufferType=Float32Array;sn.prototype.DefaultInterpolation=hd;var ks=class extends sn{constructor(t,e,i){super(t,e,i)}};ks.prototype.ValueTypeName="bool";ks.prototype.ValueBufferType=Array;ks.prototype.DefaultInterpolation=Pl;ks.prototype.InterpolantFactoryMethodLinear=void 0;ks.prototype.InterpolantFactoryMethodSmooth=void 0;var Ld=class extends sn{};Ld.prototype.ValueTypeName="color";var Dd=class extends sn{};Dd.prototype.ValueTypeName="number";var Nd=class extends Or{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(i-e)/(n-e),h=t*o;for(let c=h+o;h!==c;h+=4)ts.slerpFlat(s,0,a,h-o,a,h,l);return s}},$l=class extends sn{InterpolantFactoryMethodLinear(t){return new Nd(this.times,this.values,this.getValueSize(),t)}};$l.prototype.ValueTypeName="quaternion";$l.prototype.InterpolantFactoryMethodSmooth=void 0;var Us=class extends sn{constructor(t,e,i){super(t,e,i)}};Us.prototype.ValueTypeName="string";Us.prototype.ValueBufferType=Array;Us.prototype.DefaultInterpolation=Pl;Us.prototype.InterpolantFactoryMethodLinear=void 0;Us.prototype.InterpolantFactoryMethodSmooth=void 0;var Od=class extends sn{};Od.prototype.ValueTypeName="vector";var Fd=class{constructor(t,e,i){let n=this,s=!1,a=0,o=0,l,h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(c){o++,s===!1&&n.onStart!==void 0&&n.onStart(c,a,o),s=!0},this.itemEnd=function(c){a++,n.onProgress!==void 0&&n.onProgress(c,a,o),a===o&&(s=!1,n.onLoad!==void 0&&n.onLoad())},this.itemError=function(c){n.onError!==void 0&&n.onError(c)},this.resolveURL=function(c){return l?l(c):c},this.setURLModifier=function(c){return l=c,this},this.addHandler=function(c,u){return h.push(c,u),this},this.removeHandler=function(c){let u=h.indexOf(c);return u!==-1&&h.splice(u,2),this},this.getHandler=function(c){for(let u=0,d=h.length;u<d;u+=2){let f=h[u],p=h[u+1];if(f.global&&(f.lastIndex=0),f.test(c))return p}return null}}},hw=new Fd,kd=class{constructor(t){this.manager=t!==void 0?t:hw,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let i=this;return new Promise(function(n,s){i.load(t,n,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};kd.DEFAULT_MATERIAL_NAME="__DEFAULT";var $d="\\[\\]\\.:\\/",cw=new RegExp("["+$d+"]","g"),Kd="[^"+$d+"]",uw="[^"+$d.replace("\\.","")+"]",dw=/((?:WC+[\/:])*)/.source.replace("WC",Kd),fw=/(WCOD+)?/.source.replace("WCOD",uw),pw=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Kd),mw=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Kd),gw=new RegExp("^"+dw+fw+pw+mw+"$"),_w=["material","materials","bones","map"],Ud=class{constructor(t,e,i){let n=i||be.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,n=this._bindings[i];n!==void 0&&n.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=i.length;n!==s;++n)i[n].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},be=class r{constructor(t,e,i){this.path=e,this.parsedPath=i||r.parseTrackName(e),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new r.Composite(t,e,i):new r(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(cw,"")}static parseTrackName(t){let e=gw.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(n!==void 0&&n!==-1){let s=i.nodeName.substring(n+1);_w.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);if(i!==void 0)return i}if(t.children){let i=function(s){for(let a=0;a<s.length;a++){let o=s[a];if(o.name===e||o.uuid===e)return o;let l=i(o.children);if(l)return l}return null},n=i(t.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)t[e++]=i[n]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,i=e.objectName,n=e.propertyName,s=e.propertyIndex;if(t||(t=r.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let h=e.objectIndex;switch(i){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let c=0;c<t.length;c++)if(t[c].name===h){h=c;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[i]}if(h!==void 0){if(t[h]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[h]}}let a=t[n];if(a===void 0){let h=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+n+" but it wasn't found.",t);return}let o=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?o=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(n==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=s}else a.fromArray!==void 0&&a.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(l=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=n;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};be.Composite=Ud;be.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};be.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};be.prototype.GetterByBindingType=[be.prototype._getValue_direct,be.prototype._getValue_array,be.prototype._getValue_arrayElement,be.prototype._getValue_toArray];be.prototype.SetterByBindingTypeAndVersioning=[[be.prototype._setValue_direct,be.prototype._setValue_direct_setNeedsUpdate,be.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[be.prototype._setValue_array,be.prototype._setValue_array_setNeedsUpdate,be.prototype._setValue_array_setMatrixWorldNeedsUpdate],[be.prototype._setValue_arrayElement,be.prototype._setValue_arrayElement_setNeedsUpdate,be.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[be.prototype._setValue_fromArray,be.prototype._setValue_fromArray_setNeedsUpdate,be.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var vE=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Bd}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Bd);var Sw={},jm=!1;function Zm(r){tl.workerSrc=r,jm=!0}function yw(){if(!(jm||tl.workerSrc))try{tl.workerSrc=new URL("./pdf.worker.mjs",Sw.url).toString()}catch{console.warn("PageFlipOpen: Could not auto-resolve PDF.js worker URL. Call PageFlipOpen.setPdfWorkerSrc(url) before instantiation.")}}var xw=20,Km=1.5,bw=1.5,Jl=class{constructor(){this._pdf=null,this._cache=new Map,this._lruOrder=[],this._pending=new Map,this._pageDimensions=null,this._renderScale=Km,this._pageMap=[]}setRenderScale(t){let e=Math.max(t,Km);if(Math.abs(e-this._renderScale)>.25){for(let i of this._cache.values())i.dispose();this._cache.clear(),this._lruOrder=[]}this._renderScale=e}async load(t){yw();let e=Cp({url:t});this._pdf=await e.promise;let n=(await this._pdf.getPage(1)).getViewport({scale:1});this._pageDimensions={width:n.width,height:n.height};let s=n.width/n.height;this._pageMap=[];for(let a=1;a<=this._pdf.numPages;a++){let l=(await this._pdf.getPage(a)).getViewport({scale:1});l.width/l.height>=s*bw?(this._pageMap.push({pdfPage:a,side:"left"}),this._pageMap.push({pdfPage:a,side:"right"})):this._pageMap.push({pdfPage:a,side:"full"})}return{totalPages:this._pageMap.length,pageDimensions:this._pageDimensions}}async getTexture(t){if(this._cache.has(t))return this._touchLRU(t),this._cache.get(t);if(this._pending.has(t))return this._pending.get(t);let e=this._renderVirtualPage(t);this._pending.set(t,e);try{let i=await e;return this._pending.delete(t),this._storeInCache(t,i),i}catch(i){throw this._pending.delete(t),i}}async _renderVirtualPage(t){let e=this._pageMap[t-1];if(!e)throw new Error(`Virtual page ${t} out of range`);return e.side==="full"?this._renderPage(e.pdfPage):this._renderSpreadHalf(e.pdfPage,e.side)}async _renderPage(t){if(!this._pdf)throw new Error("PDF not loaded");let e=await this._pdf.getPage(t),i=e.getViewport({scale:this._renderScale}),n=this._pageDimensions.width/this._pageDimensions.height,s=i.width/i.height,a=Math.round(i.width),o=Math.round(i.height),l=0,h=0;Math.abs(s-n)>.01&&(s>n?(o=Math.round(i.width/n),h=(o-i.height)/2):(a=Math.round(i.height*n),l=(a-i.width)/2));let c=document.createElement("canvas");c.width=a,c.height=o;let u=c.getContext("2d");return u.fillStyle="#ffffff",u.fillRect(0,0,a,o),await e.render({canvasContext:u,viewport:i,transform:[1,0,0,1,l,h]}).promise,this._makeTexture(c)}async _renderSpreadHalf(t,e){if(!this._pdf)throw new Error("PDF not loaded");let i=await this._pdf.getPage(t),n=i.getViewport({scale:this._renderScale}),s=Math.round(n.width),a=Math.round(n.height),o=document.createElement("canvas");o.width=s,o.height=a;let l=o.getContext("2d");l.fillStyle="#ffffff",l.fillRect(0,0,s,a),await i.render({canvasContext:l,viewport:n}).promise;let h=s/2,c=e==="left"?0:h,u=this._pageDimensions.width/this._pageDimensions.height,d=h/a,f=Math.round(h),p=a,m=0,_=0;Math.abs(d-u)>.01&&(d>u?(p=Math.round(h/u),_=Math.round((p-a)/2)):(f=Math.round(a*u),m=Math.round((f-h)/2)));let g=document.createElement("canvas");g.width=f,g.height=p;let y=g.getContext("2d");return y.fillStyle="#ffffff",y.fillRect(0,0,f,p),y.drawImage(o,c,0,h,a,m,_,h,a),this._makeTexture(g)}_makeTexture(t){let e=new Nr(t);return e.generateMipmaps=!1,e.minFilter=xi,e.magFilter=xi,e.colorSpace=Hi,e.needsUpdate=!0,e}_storeInCache(t,e){this._cache.size>=xw&&this._evictLRU(),this._cache.set(t,e),this._lruOrder.push(t)}_touchLRU(t){let e=this._lruOrder.indexOf(t);e!==-1&&this._lruOrder.splice(e,1),this._lruOrder.push(t)}_evictLRU(){let t=this._lruOrder.shift();t!==void 0&&this._cache.has(t)&&(this._cache.get(t).dispose(),this._cache.delete(t))}prefetch(t,e){let i=[];for(let n=-2;n<=2;n++){let s=t+n;s>=1&&s<=e&&i.push(s)}for(let n of i)!this._cache.has(n)&&!this._pending.has(n)&&this.getTexture(n).catch(()=>{})}destroy(){for(let t of this._cache.values())t.dispose();this._cache.clear(),this._lruOrder=[],this._pending.clear(),this._pdf&&(this._pdf.destroy(),this._pdf=null),this._pageMap=[]}};var ww=100,Jm=.88,Ql=class{constructor(t){this._container=t,this._pageDimensions={width:0,height:0},this._totalPages=0,this._currentLayout="double",this._forceSingle=!1,this._changeCallbacks=[],this._resizeTimer=null,this._observer=new ResizeObserver(()=>{clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>this._onResize(),ww)}),this._observer.observe(this._container)}init(t,e,i=!1){this._pageDimensions=t,this._totalPages=e,this._forceSingle=i,this._currentLayout=this._detectLayout()}_detectLayout(){if(this._forceSingle)return"single";let{width:t,height:e}=this._pageDimensions;return t>e?"single":"double"}_onResize(){this._currentLayout=this._detectLayout();for(let t of this._changeCallbacks)t(this._currentLayout)}onLayoutChange(t){this._changeCallbacks.push(t)}getCurrentLayout(){return this._currentLayout}getPageDimensions(){let t=this._container.clientWidth,e=this._container.clientHeight,{width:i,height:n}=this._pageDimensions,s=e-44,a=this._currentLayout==="double"?2:1,o=t*Jm,l=s*Jm,h=i*a,c=n,u=o/h,d=l/c,f=Math.min(u,d);return{pageWidth:i*f,pageHeight:n*f,spreadWidth:i*a*f,spreadHeight:n*f,scale:f,pdfPageWidth:i,pdfPageHeight:n}}getSpreadForPage(t){if(this._currentLayout==="single")return[t];if(t===1)return[1];if(this._totalPages%2===0&&t===this._totalPages)return[this._totalPages];if(t%2===0){let e=t+1;return e<=this._totalPages?[t,e]:[t]}else{let e=t-1;return e>=2?[e,t]:[t]}}getSpreadLeftPage(t){return this.getSpreadForPage(t)[0]}getNextSpreadPage(t){return this._currentLayout==="single"?Math.min(t+1,this._totalPages):t===1?2:Math.min(t+2,this._totalPages)}getPrevSpreadPage(t){return this._currentLayout==="single"?Math.max(t-1,1):t===2||t===3?1:Math.max(t-2,1)}destroy(){clearTimeout(this._resizeTimer),this._observer.disconnect(),this._changeCallbacks=[]}};function Nn(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function og(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var Ei={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Ur={duration:.5,overwrite:!1,delay:0},mf,Je,Se,Xi=1e8,ge=1/Xi,rf=Math.PI*2,Aw=rf/4,Mw=0,lg=Math.sqrt,Ew=Math.cos,Tw=Math.sin,He=function(t){return typeof t=="string"},Re=function(t){return typeof t=="function"},Fn=function(t){return typeof t=="number"},hh=function(t){return typeof t>"u"},pn=function(t){return typeof t=="object"},Mi=function(t){return t!==!1},gf=function(){return typeof window<"u"},th=function(t){return Re(t)||He(t)},hg=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ai=Array.isArray,Cw=/random\([^)]+\)/g,Rw=/,\s*/g,Qm=/(?:-?\.?\d|\.)+/gi,_f=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Vs=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Zd=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,vf=/[+-]=-?[.\d]+/,Pw=/[^,'"\[\]\s]+/gi,Iw=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ee,dn,af,yf,Oi={},sh={},cg,ug=function(t){return(sh=Br(t,Oi))&&oi},ch=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},Ga=function(t,e){return!e&&console.warn(t)},dg=function(t,e){return t&&(Oi[t]=e)&&sh&&(sh[t]=e)||Oi},Wa=function(){return 0},Lw={suppressEvents:!0,isStart:!0,kill:!1},eh={suppressEvents:!0,kill:!1},Dw={suppressEvents:!0},xf={},ns=[],of={},fg,wi={},Jd={},tg=30,ih=[],bf="",Sf=function(t){var e=t[0],i,n;if(pn(e)||Re(e)||(t=[t]),!(i=(e._gsap||{}).harness)){for(n=ih.length;n--&&!ih[n].targetTest(e););i=ih[n]}for(n=t.length;n--;)t[n]&&(t[n]._gsap||(t[n]._gsap=new Ef(t[n],i)))||t.splice(n,1);return t},ss=function(t){return t._gsap||Sf(qi(t))[0]._gsap},wf=function(t,e,i){return(i=t[e])&&Re(i)?t[e]():hh(i)&&t.getAttribute&&t.getAttribute(e)||i},fi=function(t,e){return(t=t.split(",")).forEach(e)||t},Pe=function(t){return Math.round(t*1e5)/1e5||0},Me=function(t){return Math.round(t*1e7)/1e7||0},Gs=function(t,e){var i=e.charAt(0),n=parseFloat(e.substr(2));return t=parseFloat(t),i==="+"?t+n:i==="-"?t-n:i==="*"?t*n:t/n},Nw=function(t,e){for(var i=e.length,n=0;t.indexOf(e[n])<0&&++n<i;);return n<i},rh=function(){var t=ns.length,e=ns.slice(0),i,n;for(of={},ns.length=0,i=0;i<t;i++)n=e[i],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},Af=function(t){return!!(t._initted||t._startAt||t.add)},pg=function(t,e,i,n){ns.length&&!Je&&rh(),t.render(e,i,n||!!(Je&&e<0&&Af(t))),ns.length&&!Je&&rh()},mg=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Pw).length<2?e:He(t)?t.trim():t},gg=function(t){return t},Fi=function(t,e){for(var i in e)i in t||(t[i]=e[i]);return t},Ow=function(t){return function(e,i){for(var n in i)n in e||n==="duration"&&t||n==="ease"||(e[n]=i[n])}},Br=function(t,e){for(var i in e)t[i]=e[i];return t},eg=function r(t,e){for(var i in e)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(t[i]=pn(e[i])?r(t[i]||(t[i]={}),e[i]):e[i]);return t},ah=function(t,e){var i={},n;for(n in t)n in e||(i[n]=t[n]);return i},za=function(t){var e=t.parent||Ee,i=t.keyframes?Ow(ai(t.keyframes)):Fi;if(Mi(t.inherit))for(;e;)i(t,e.vars.defaults),e=e.parent||e._dp;return t},Fw=function(t,e){for(var i=t.length,n=i===e.length;n&&i--&&t[i]===e[i];);return i<0},_g=function(t,e,i,n,s){i===void 0&&(i="_first"),n===void 0&&(n="_last");var a=t[n],o;if(s)for(o=e[s];a&&a[s]>o;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[n]=e,e._prev=a,e.parent=e._dp=t,e},uh=function(t,e,i,n){i===void 0&&(i="_first"),n===void 0&&(n="_last");var s=e._prev,a=e._next;s?s._next=a:t[i]===e&&(t[i]=a),a?a._prev=s:t[n]===e&&(t[n]=s),e._next=e._prev=e.parent=null},rs=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Bs=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t},kw=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},lf=function(t,e,i,n){return t._startAt&&(Je?t._startAt.revert(eh):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,n))},Uw=function r(t){return!t||t._ts&&r(t.parent)},ig=function(t){return t._repeat?zr(t._tTime,t=t.duration()+t._rDelay)*t:0},zr=function(t,e){var i=Math.floor(t=Me(t/e));return t&&i===t?i-1:i},oh=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},dh=function(t){return t._end=Me(t._start+(t._tDur/Math.abs(t._ts||t._rts||ge)||0))},fh=function(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=Me(i._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),dh(t),i._dirty||Bs(i,t)),t},vg=function(t,e){var i;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(i=oh(t.rawTime(),e),(!e._dur||Ya(0,e.totalDuration(),i)-e._tTime>ge)&&e.render(i,!0)),Bs(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(i=t;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;t._zTime=-ge}},fn=function(t,e,i,n){return e.parent&&rs(e),e._start=Me((Fn(i)?i:i||t!==Ee?Wi(t,i,e):t._time)+e._delay),e._end=Me(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),_g(t,e,"_first","_last",t._sort?"_start":0),hf(e)||(t._recent=e),n||vg(t,e),t._ts<0&&fh(t,t._tTime),t},yg=function(t,e){return(Oi.ScrollTrigger||ch("scrollTrigger",e))&&Oi.ScrollTrigger.create(e,t)},xg=function(t,e,i,n,s){if(Rf(t,e,s),!t._initted)return 1;if(!i&&t._pt&&!Je&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&fg!==Ai.frame)return ns.push(t),t._lazy=[s,n],1},Bw=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},hf=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},zw=function(t,e,i,n){var s=t.ratio,a=e<0||!e&&(!t._start&&Bw(t)&&!(!t._initted&&hf(t))||(t._ts<0||t._dp._ts<0)&&!hf(t))?0:1,o=t._rDelay,l=0,h,c,u;if(o&&t._repeat&&(l=Ya(0,t._tDur,e),c=zr(l,o),t._yoyo&&c&1&&(a=1-a),c!==zr(t._tTime,o)&&(s=1-a,t.vars.repeatRefresh&&t._initted&&t.invalidate())),a!==s||Je||n||t._zTime===ge||!e&&t._zTime){if(!t._initted&&xg(t,e,n,i,l))return;for(u=t._zTime,t._zTime=e||(i?ge:0),i||(i=e&&!u),t.ratio=a,t._from&&(a=1-a),t._time=0,t._tTime=l,h=t._pt;h;)h.r(a,h.d),h=h._next;e<0&&lf(t,e,i,!0),t._onUpdate&&!i&&Ni(t,"onUpdate"),l&&t._repeat&&!i&&t.parent&&Ni(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===a&&(a&&rs(t,1),!i&&!Je&&(Ni(t,a?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},Hw=function(t,e,i){var n;if(i>e)for(n=t._first;n&&n._start<=i;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=i;){if(n.data==="isPause"&&n._start<e)return n;n=n._prev}},Hr=function(t,e,i,n){var s=t._repeat,a=Me(e)||0,o=t._tTime/t._tDur;return o&&!n&&(t._time*=a/t._dur),t._dur=a,t._tDur=s?s<0?1e10:Me(a*(s+1)+t._rDelay*s):a,o>0&&!n&&fh(t,t._tTime=t._tDur*o),t.parent&&dh(t),i||Bs(t.parent,t),t},ng=function(t){return t instanceof Ze?Bs(t):Hr(t,t._dur)},Vw={_start:0,endTime:Wa,totalDuration:Wa},Wi=function r(t,e,i){var n=t.labels,s=t._recent||Vw,a=t.duration()>=Xi?s.endTime(!1):t._dur,o,l,h;return He(e)&&(isNaN(e)||e in n)?(l=e.charAt(0),h=e.substr(-1)==="%",o=e.indexOf("="),l==="<"||l===">"?(o>=0&&(e=e.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(e.substr(1))||0)*(h?(o<0?s:i).totalDuration()/100:1)):o<0?(e in n||(n[e]=a),n[e]):(l=parseFloat(e.charAt(o-1)+e.substr(o+1)),h&&i&&(l=l/100*(ai(i)?i[0]:i).totalDuration()),o>1?r(t,e.substr(0,o-1),i)+l:a+l)):e==null?a:+e},Ha=function(t,e,i){var n=Fn(e[1]),s=(n?2:1)+(t<2?0:1),a=e[s],o,l;if(n&&(a.duration=e[1]),a.parent=i,t){for(o=a,l=i;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Mi(l.vars.inherit)&&l.parent;a.immediateRender=Mi(o.immediateRender),t<2?a.runBackwards=1:a.startAt=e[s-1]}return new Le(e[0],a,e[s+1])},as=function(t,e){return t||t===0?e(t):e},Ya=function(t,e,i){return i<t?t:i>e?e:i},Qe=function(t,e){return!He(t)||!(e=Iw.exec(t))?"":e[1]},Gw=function(t,e,i){return as(i,function(n){return Ya(t,e,n)})},cf=[].slice,bg=function(t,e){return t&&pn(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&pn(t[0]))&&!t.nodeType&&t!==dn},Ww=function(t,e,i){return i===void 0&&(i=[]),t.forEach(function(n){var s;return He(n)&&!e||bg(n,1)?(s=i).push.apply(s,qi(n)):i.push(n)})||i},qi=function(t,e,i){return Se&&!e&&Se.selector?Se.selector(t):He(t)&&!i&&(af||!Vr())?cf.call((e||yf).querySelectorAll(t),0):ai(t)?Ww(t,i):bg(t)?cf.call(t,0):t?[t]:[]},uf=function(t){return t=qi(t)[0]||Ga("Invalid scope")||{},function(e){var i=t.current||t.nativeElement||t;return qi(e,i.querySelectorAll?i:i===t?Ga("Invalid scope")||yf.createElement("div"):t)}},Sg=function(t){return t.sort(function(){return .5-Math.random()})},wg=function(t){if(Re(t))return t;var e=pn(t)?t:{each:t},i=zs(e.ease),n=e.from||0,s=parseFloat(e.base)||0,a={},o=n>0&&n<1,l=isNaN(n)||o,h=e.axis,c=n,u=n;return He(n)?c=u={center:.5,edges:.5,end:1}[n]||0:!o&&l&&(c=n[0],u=n[1]),function(d,f,p){var m=(p||e).length,_=a[m],g,y,v,x,E,w,A,P,b;if(!_){if(b=e.grid==="auto"?0:(e.grid||[1,Xi])[1],!b){for(A=-Xi;A<(A=p[b++].getBoundingClientRect().left)&&b<m;);b<m&&b--}for(_=a[m]=[],g=l?Math.min(b,m)*c-.5:n%b,y=b===Xi?0:l?m*u/b-.5:n/b|0,A=0,P=Xi,w=0;w<m;w++)v=w%b-g,x=y-(w/b|0),_[w]=E=h?Math.abs(h==="y"?x:v):lg(v*v+x*x),E>A&&(A=E),E<P&&(P=E);n==="random"&&Sg(_),_.max=A-P,_.min=P,_.v=m=(parseFloat(e.amount)||parseFloat(e.each)*(b>m?m-1:h?h==="y"?m/b:b:Math.max(b,m/b))||0)*(n==="edges"?-1:1),_.b=m<0?s-m:s,_.u=Qe(e.amount||e.each)||0,i=i&&m<0?Lg(i):i}return m=(_[d]-_.min)/_.max||0,Me(_.b+(i?i(m):m)*_.v)+_.u}},df=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(i){var n=Me(Math.round(parseFloat(i)/t)*t*e);return(n-n%1)/e+(Fn(i)?0:Qe(i))}},Ag=function(t,e){var i=ai(t),n,s;return!i&&pn(t)&&(n=i=t.radius||Xi,t.values?(t=qi(t.values),(s=!Fn(t[0]))&&(n*=n)):t=df(t.increment)),as(e,i?Re(t)?function(a){return s=t(a),Math.abs(s-a)<=n?s:a}:function(a){for(var o=parseFloat(s?a.x:a),l=parseFloat(s?a.y:0),h=Xi,c=0,u=t.length,d,f;u--;)s?(d=t[u].x-o,f=t[u].y-l,d=d*d+f*f):d=Math.abs(t[u]-o),d<h&&(h=d,c=u);return c=!n||h<=n?t[c]:a,s||c===a||Fn(a)?c:c+Qe(a)}:df(t))},Mg=function(t,e,i,n){return as(ai(t)?!e:i===!0?!!(i=0):!n,function(){return ai(t)?t[~~(Math.random()*t.length)]:(i=i||1e-5)&&(n=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((t-i/2+Math.random()*(e-t+i*.99))/i)*i*n)/n})},Xw=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(n){return e.reduce(function(s,a){return a(s)},n)}},qw=function(t,e){return function(i){return t(parseFloat(i))+(e||Qe(i))}},Yw=function(t,e,i){return Tg(t,e,0,1,i)},Eg=function(t,e,i){return as(i,function(n){return t[~~e(n)]})},$w=function r(t,e,i){var n=e-t;return ai(t)?Eg(t,r(0,t.length),e):as(i,function(s){return(n+(s-t)%n)%n+t})},Kw=function r(t,e,i){var n=e-t,s=n*2;return ai(t)?Eg(t,r(0,t.length-1),e):as(i,function(a){return a=(s+(a-t)%s)%s||0,t+(a>n?s-a:a)})},Gr=function(t){return t.replace(Cw,function(e){var i=e.indexOf("[")+1,n=e.substring(i||7,i?e.indexOf("]"):e.length-1).split(Rw);return Mg(i?n:+n[0],i?0:+n[1],+n[2]||1e-5)})},Tg=function(t,e,i,n,s){var a=e-t,o=n-i;return as(s,function(l){return i+((l-t)/a*o||0)})},jw=function r(t,e,i,n){var s=isNaN(t+e)?0:function(f){return(1-f)*t+f*e};if(!s){var a=He(t),o={},l,h,c,u,d;if(i===!0&&(n=1)&&(i=null),a)t={p:t},e={p:e};else if(ai(t)&&!ai(e)){for(c=[],u=t.length,d=u-2,h=1;h<u;h++)c.push(r(t[h-1],t[h]));u--,s=function(p){p*=u;var m=Math.min(d,~~p);return c[m](p-m)},i=e}else n||(t=Br(ai(t)?[]:{},t));if(!c){for(l in e)Tf.call(o,t,l,"get",e[l]);s=function(p){return Lf(p,o)||(a?t.p:t)}}}return as(i,s)},sg=function(t,e,i){var n=t.labels,s=Xi,a,o,l;for(a in n)o=n[a]-e,o<0==!!i&&o&&s>(o=Math.abs(o))&&(l=a,s=o);return l},Ni=function(t,e,i){var n=t.vars,s=n[e],a=Se,o=t._ctx,l,h,c;if(s)return l=n[e+"Params"],h=n.callbackScope||t,i&&ns.length&&rh(),o&&(Se=o),c=l?s.apply(h,l):s.call(h),Se=a,c},Ua=function(t){return rs(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Je),t.progress()<1&&Ni(t,"onInterrupt"),t},kr,Cg=[],Rg=function(t){if(t)if(t=!t.name&&t.default||t,gf()||t.headless){var e=t.name,i=Re(t),n=e&&!i&&t.init?function(){this._props=[]}:t,s={init:Wa,render:Lf,add:Tf,kill:dA,modifier:uA,rawVars:0},a={targetTest:0,get:0,getSetter:ph,aliases:{},register:0};if(Vr(),t!==n){if(wi[e])return;Fi(n,Fi(ah(t,s),a)),Br(n.prototype,Br(s,ah(t,a))),wi[n.prop=e]=n,t.targetTest&&(ih.push(n),xf[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}dg(e,n),t.register&&t.register(oi,n,pi)}else Cg.push(t)},me=255,Ba={aqua:[0,me,me],lime:[0,me,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,me],navy:[0,0,128],white:[me,me,me],olive:[128,128,0],yellow:[me,me,0],orange:[me,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[me,0,0],pink:[me,192,203],cyan:[0,me,me],transparent:[me,me,me,0]},Qd=function(t,e,i){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(i-e)*t*6:t<.5?i:t*3<2?e+(i-e)*(2/3-t)*6:e)*me+.5|0},Pg=function(t,e,i){var n=t?Fn(t)?[t>>16,t>>8&me,t&me]:0:Ba.black,s,a,o,l,h,c,u,d,f,p;if(!n){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Ba[t])n=Ba[t];else if(t.charAt(0)==="#"){if(t.length<6&&(s=t.charAt(1),a=t.charAt(2),o=t.charAt(3),t="#"+s+s+a+a+o+o+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return n=parseInt(t.substr(1,6),16),[n>>16,n>>8&me,n&me,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),n=[t>>16,t>>8&me,t&me]}else if(t.substr(0,3)==="hsl"){if(n=p=t.match(Qm),!e)l=+n[0]%360/360,h=+n[1]/100,c=+n[2]/100,a=c<=.5?c*(h+1):c+h-c*h,s=c*2-a,n.length>3&&(n[3]*=1),n[0]=Qd(l+1/3,s,a),n[1]=Qd(l,s,a),n[2]=Qd(l-1/3,s,a);else if(~t.indexOf("="))return n=t.match(_f),i&&n.length<4&&(n[3]=1),n}else n=t.match(Qm)||Ba.transparent;n=n.map(Number)}return e&&!p&&(s=n[0]/me,a=n[1]/me,o=n[2]/me,u=Math.max(s,a,o),d=Math.min(s,a,o),c=(u+d)/2,u===d?l=h=0:(f=u-d,h=c>.5?f/(2-u-d):f/(u+d),l=u===s?(a-o)/f+(a<o?6:0):u===a?(o-s)/f+2:(s-a)/f+4,l*=60),n[0]=~~(l+.5),n[1]=~~(h*100+.5),n[2]=~~(c*100+.5)),i&&n.length<4&&(n[3]=1),n},Ig=function(t){var e=[],i=[],n=-1;return t.split(On).forEach(function(s){var a=s.match(Vs)||[];e.push.apply(e,a),i.push(n+=a.length+1)}),e.c=i,e},rg=function(t,e,i){var n="",s=(t+n).match(On),a=e?"hsla(":"rgba(",o=0,l,h,c,u;if(!s)return t;if(s=s.map(function(d){return(d=Pg(d,e,1))&&a+(e?d[0]+","+d[1]+"%,"+d[2]+"%,"+d[3]:d.join(","))+")"}),i&&(c=Ig(t),l=i.c,l.join(n)!==c.c.join(n)))for(h=t.replace(On,"1").split(Vs),u=h.length-1;o<u;o++)n+=h[o]+(~l.indexOf(o)?s.shift()||a+"0,0,0,0)":(c.length?c:s.length?s:i).shift());if(!h)for(h=t.split(On),u=h.length-1;o<u;o++)n+=h[o]+s[o];return n+h[u]},On=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Ba)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),Zw=/hsl[a]?\(/,Mf=function(t){var e=t.join(" "),i;if(On.lastIndex=0,On.test(e))return i=Zw.test(e),t[1]=rg(t[1],i),t[0]=rg(t[0],i,Ig(t[1])),!0},Xa,Ai=function(){var r=Date.now,t=500,e=33,i=r(),n=i,s=1e3/240,a=s,o=[],l,h,c,u,d,f,p=function m(_){var g=r()-n,y=_===!0,v,x,E,w;if((g>t||g<0)&&(i+=g-e),n+=g,E=n-i,v=E-a,(v>0||y)&&(w=++u.frame,d=E-u.time*1e3,u.time=E=E/1e3,a+=v+(v>=s?4:s-v),x=1),y||(l=h(m)),x)for(f=0;f<o.length;f++)o[f](E,d,w,_)};return u={time:0,frame:0,tick:function(){p(!0)},deltaRatio:function(_){return d/(1e3/(_||60))},wake:function(){cg&&(!af&&gf()&&(dn=af=window,yf=dn.document||{},Oi.gsap=oi,(dn.gsapVersions||(dn.gsapVersions=[])).push(oi.version),ug(sh||dn.GreenSockGlobals||!dn.gsap&&dn||{}),Cg.forEach(Rg)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&u.sleep(),h=c||function(_){return setTimeout(_,a-u.time*1e3+1|0)},Xa=1,p(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(l),Xa=0,h=Wa},lagSmoothing:function(_,g){t=_||1/0,e=Math.min(g||33,t)},fps:function(_){s=1e3/(_||240),a=u.time*1e3+s},add:function(_,g,y){var v=g?function(x,E,w,A){_(x,E,w,A),u.remove(v)}:_;return u.remove(_),o[y?"unshift":"push"](v),Vr(),v},remove:function(_,g){~(g=o.indexOf(_))&&o.splice(g,1)&&f>=g&&f--},_listeners:o},u}(),Vr=function(){return!Xa&&Ai.wake()},ne={},Jw=/^[\d.\-M][\d.\-,\s]/,Qw=/["']/g,tA=function(t){for(var e={},i=t.substr(1,t.length-3).split(":"),n=i[0],s=1,a=i.length,o,l,h;s<a;s++)l=i[s],o=s!==a-1?l.lastIndexOf(","):l.length,h=l.substr(0,o),e[n]=isNaN(h)?h.replace(Qw,"").trim():+h,n=l.substr(o+1).trim();return e},eA=function(t){var e=t.indexOf("(")+1,i=t.indexOf(")"),n=t.indexOf("(",e);return t.substring(e,~n&&n<i?t.indexOf(")",i+1):i)},iA=function(t){var e=(t+"").split("("),i=ne[e[0]];return i&&e.length>1&&i.config?i.config.apply(null,~t.indexOf("{")?[tA(e[1])]:eA(t).split(",").map(mg)):ne._CE&&Jw.test(t)?ne._CE("",t):i},Lg=function(t){return function(e){return 1-t(1-e)}},Dg=function r(t,e){for(var i=t._first,n;i;)i instanceof Ze?r(i,e):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==e&&(i.timeline?r(i.timeline,e):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=e)),i=i._next},zs=function(t,e){return t&&(Re(t)?t:ne[t]||iA(t))||e},Ws=function(t,e,i,n){i===void 0&&(i=function(l){return 1-e(1-l)}),n===void 0&&(n=function(l){return l<.5?e(l*2)/2:1-e((1-l)*2)/2});var s={easeIn:e,easeOut:i,easeInOut:n},a;return fi(t,function(o){ne[o]=Oi[o]=s,ne[a=o.toLowerCase()]=i;for(var l in s)ne[a+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=ne[o+"."+l]=s[l]}),s},Ng=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},tf=function r(t,e,i){var n=e>=1?e:1,s=(i||(t?.3:.45))/(e<1?e:1),a=s/rf*(Math.asin(1/n)||0),o=function(c){return c===1?1:n*Math.pow(2,-10*c)*Tw((c-a)*s)+1},l=t==="out"?o:t==="in"?function(h){return 1-o(1-h)}:Ng(o);return s=rf/s,l.config=function(h,c){return r(t,h,c)},l},ef=function r(t,e){e===void 0&&(e=1.70158);var i=function(a){return a?--a*a*((e+1)*a+e)+1:0},n=t==="out"?i:t==="in"?function(s){return 1-i(1-s)}:Ng(i);return n.config=function(s){return r(t,s)},n};fi("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;Ws(r+",Power"+(e-1),t?function(i){return Math.pow(i,e)}:function(i){return i},function(i){return 1-Math.pow(1-i,e)},function(i){return i<.5?Math.pow(i*2,e)/2:1-Math.pow((1-i)*2,e)/2})});ne.Linear.easeNone=ne.none=ne.Linear.easeIn;Ws("Elastic",tf("in"),tf("out"),tf());(function(r,t){var e=1/t,i=2*e,n=2.5*e,s=function(o){return o<e?r*o*o:o<i?r*Math.pow(o-1.5/t,2)+.75:o<n?r*(o-=2.25/t)*o+.9375:r*Math.pow(o-2.625/t,2)+.984375};Ws("Bounce",function(a){return 1-s(1-a)},s)})(7.5625,2.75);Ws("Expo",function(r){return Math.pow(2,10*(r-1))*r+r*r*r*r*r*r*(1-r)});Ws("Circ",function(r){return-(lg(1-r*r)-1)});Ws("Sine",function(r){return r===1?1:-Ew(r*Aw)+1});Ws("Back",ef("in"),ef("out"),ef());ne.SteppedEase=ne.steps=Oi.SteppedEase={config:function(t,e){t===void 0&&(t=1);var i=1/t,n=t+(e?0:1),s=e?1:0,a=1-ge;return function(o){return((n*Ya(0,a,o)|0)+s)*i}}};Ur.ease=ne["quad.out"];fi("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return bf+=r+","+r+"Params,"});var Ef=function(t,e){this.id=Mw++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:wf,this.set=e?e.getSetter:ph},qa=function(){function r(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,Hr(this,+e.duration,1,1),this.data=e.data,Se&&(this._ctx=Se,Se.data.push(this)),Xa||Ai.wake()}var t=r.prototype;return t.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},t.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},t.totalDuration=function(i){return arguments.length?(this._dirty=0,Hr(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(i,n){if(Vr(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(fh(this,i),!s._dp||s.parent||vg(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&fn(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===ge||!this._initted&&this._dur&&i||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),pg(this,i,n)),this},t.time=function(i,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+ig(this))%(this._dur+this._rDelay)||(i?this._dur:0),n):this._time},t.totalProgress=function(i,n){return arguments.length?this.totalTime(this.totalDuration()*i,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(i,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+ig(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(i,n){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*s,n):this._repeat?zr(this._tTime,s)+1:1},t.timeScale=function(i,n){if(!arguments.length)return this._rts===-ge?0:this._rts;if(this._rts===i)return this;var s=this.parent&&this._ts?oh(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-ge?0:this._rts,this.totalTime(Ya(-Math.abs(this._delay),this.totalDuration(),s),n!==!1),dh(this),kw(this)},t.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Vr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==ge&&(this._tTime-=ge)))),this):this._ps},t.startTime=function(i){if(arguments.length){this._start=Me(i);var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&fn(n,this,this._start-this._delay),this}return this._start},t.endTime=function(i){return this._start+(Mi(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(i){var n=this.parent||this._dp;return n?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?oh(n.rawTime(i),this):this._tTime:this._tTime},t.revert=function(i){i===void 0&&(i=Dw);var n=Je;return Je=i,Af(this)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),Je=n,this},t.globalTime=function(i){for(var n=this,s=arguments.length?i:n.rawTime();n;)s=n._start+s/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(i):s},t.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,ng(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(i){if(arguments.length){var n=this._time;return this._rDelay=i,ng(this),n?this.time(n):this}return this._rDelay},t.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},t.seek=function(i,n){return this.totalTime(Wi(this,i),Mi(n))},t.restart=function(i,n){return this.play().totalTime(i?-this._delay:0,Mi(n)),this._dur||(this._zTime=-ge),this},t.play=function(i,n){return i!=null&&this.seek(i,n),this.reversed(!1).paused(!1)},t.reverse=function(i,n){return i!=null&&this.seek(i||this.totalDuration(),n),this.reversed(!0).paused(!1)},t.pause=function(i,n){return i!=null&&this.seek(i,n),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-ge:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-ge,this},t.isActive=function(){var i=this.parent||this._dp,n=this._start,s;return!!(!i||this._ts&&this._initted&&i.isActive()&&(s=i.rawTime(!0))>=n&&s<this.endTime(!0)-ge)},t.eventCallback=function(i,n,s){var a=this.vars;return arguments.length>1?(n?(a[i]=n,s&&(a[i+"Params"]=s),i==="onUpdate"&&(this._onUpdate=n)):delete a[i],this):a[i]},t.then=function(i){var n=this,s=n._prom;return new Promise(function(a){var o=Re(i)?i:gg,l=function(){var c=n.then;n.then=null,s&&s(),Re(o)&&(o=o(n))&&(o.then||o===n)&&(n.then=c),a(o),n.then=c};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?l():n._prom=l})},t.kill=function(){Ua(this)},r}();Fi(qa.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-ge,_prom:0,_ps:!1,_rts:1});var Ze=function(r){og(t,r);function t(i,n){var s;return i===void 0&&(i={}),s=r.call(this,i)||this,s.labels={},s.smoothChildTiming=!!i.smoothChildTiming,s.autoRemoveChildren=!!i.autoRemoveChildren,s._sort=Mi(i.sortChildren),Ee&&fn(i.parent||Ee,Nn(s),n),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&yg(Nn(s),i.scrollTrigger),s}var e=t.prototype;return e.to=function(n,s,a){return Ha(0,arguments,this),this},e.from=function(n,s,a){return Ha(1,arguments,this),this},e.fromTo=function(n,s,a,o){return Ha(2,arguments,this),this},e.set=function(n,s,a){return s.duration=0,s.parent=this,za(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Le(n,s,Wi(this,a),1),this},e.call=function(n,s,a){return fn(this,Le.delayedCall(0,n,s),a)},e.staggerTo=function(n,s,a,o,l,h,c){return a.duration=s,a.stagger=a.stagger||o,a.onComplete=h,a.onCompleteParams=c,a.parent=this,new Le(n,a,Wi(this,l)),this},e.staggerFrom=function(n,s,a,o,l,h,c){return a.runBackwards=1,za(a).immediateRender=Mi(a.immediateRender),this.staggerTo(n,s,a,o,l,h,c)},e.staggerFromTo=function(n,s,a,o,l,h,c,u){return o.startAt=a,za(o).immediateRender=Mi(o.immediateRender),this.staggerTo(n,s,o,l,h,c,u)},e.render=function(n,s,a){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,h=this._dur,c=n<=0?0:Me(n),u=this._zTime<0!=n<0&&(this._initted||!h),d,f,p,m,_,g,y,v,x,E,w,A;if(this!==Ee&&c>l&&n>=0&&(c=l),c!==this._tTime||a||u){if(o!==this._time&&h&&(c+=this._time-o,n+=this._time-o),d=c,x=this._start,v=this._ts,g=!v,u&&(h||(o=this._zTime),(n||!s)&&(this._zTime=n)),this._repeat){if(w=this._yoyo,_=h+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(_*100+n,s,a);if(d=Me(c%_),c===l?(m=this._repeat,d=h):(E=Me(c/_),m=~~E,m&&m===E&&(d=h,m--),d>h&&(d=h)),E=zr(this._tTime,_),!o&&this._tTime&&E!==m&&this._tTime-E*_-this._dur<=0&&(E=m),w&&m&1&&(d=h-d,A=1),m!==E&&!this._lock){var P=w&&E&1,b=P===(w&&m&1);if(m<E&&(P=!P),o=P?0:c%h?h:c,this._lock=1,this.render(o||(A?0:Me(m*_)),s,!h)._lock=0,this._tTime=c,!s&&this.parent&&Ni(this,"onRepeat"),this.vars.repeatRefresh&&!A&&(this.invalidate()._lock=1,E=m),o&&o!==this._time||g!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(h=this._dur,l=this._tDur,b&&(this._lock=2,o=P?h:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!A&&this.invalidate()),this._lock=0,!this._ts&&!g)return this;Dg(this,A)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=Hw(this,Me(o),Me(d)),y&&(c-=d-(d=y._start))),this._tTime=c,this._time=d,this._act=!v,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&c&&h&&!s&&!E&&(Ni(this,"onStart"),this._tTime!==c))return this;if(d>=o&&n>=0)for(f=this._first;f;){if(p=f._next,(f._act||d>=f._start)&&f._ts&&y!==f){if(f.parent!==this)return this.render(n,s,a);if(f.render(f._ts>0?(d-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(d-f._start)*f._ts,s,a),d!==this._time||!this._ts&&!g){y=0,p&&(c+=this._zTime=-ge);break}}f=p}else{f=this._last;for(var S=n<0?n:d;f;){if(p=f._prev,(f._act||S<=f._end)&&f._ts&&y!==f){if(f.parent!==this)return this.render(n,s,a);if(f.render(f._ts>0?(S-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(S-f._start)*f._ts,s,a||Je&&Af(f)),d!==this._time||!this._ts&&!g){y=0,p&&(c+=this._zTime=S?-ge:ge);break}}f=p}}if(y&&!s&&(this.pause(),y.render(d>=o?0:-ge)._zTime=d>=o?1:-1,this._ts))return this._start=x,dh(this),this.render(n,s,a);this._onUpdate&&!s&&Ni(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&o)&&(x===this._start||Math.abs(v)!==Math.abs(this._ts))&&(this._lock||((n||!h)&&(c===l&&this._ts>0||!c&&this._ts<0)&&rs(this,1),!s&&!(n<0&&!o)&&(c||o||!l)&&(Ni(this,c===l&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(n,s){var a=this;if(Fn(s)||(s=Wi(this,s,n)),!(n instanceof qa)){if(ai(n))return n.forEach(function(o){return a.add(o,s)}),this;if(He(n))return this.addLabel(n,s);if(Re(n))n=Le.delayedCall(0,n);else return this}return this!==n?fn(this,n,s):this},e.getChildren=function(n,s,a,o){n===void 0&&(n=!0),s===void 0&&(s=!0),a===void 0&&(a=!0),o===void 0&&(o=-Xi);for(var l=[],h=this._first;h;)h._start>=o&&(h instanceof Le?s&&l.push(h):(a&&l.push(h),n&&l.push.apply(l,h.getChildren(!0,s,a)))),h=h._next;return l},e.getById=function(n){for(var s=this.getChildren(1,1,1),a=s.length;a--;)if(s[a].vars.id===n)return s[a]},e.remove=function(n){return He(n)?this.removeLabel(n):Re(n)?this.killTweensOf(n):(n.parent===this&&uh(this,n),n===this._recent&&(this._recent=this._last),Bs(this))},e.totalTime=function(n,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Me(Ai.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,s),this._forcing=0,this):this._tTime},e.addLabel=function(n,s){return this.labels[n]=Wi(this,s),this},e.removeLabel=function(n){return delete this.labels[n],this},e.addPause=function(n,s,a){var o=Le.delayedCall(0,s||Wa,a);return o.data="isPause",this._hasPause=1,fn(this,o,Wi(this,n))},e.removePause=function(n){var s=this._first;for(n=Wi(this,n);s;)s._start===n&&s.data==="isPause"&&rs(s),s=s._next},e.killTweensOf=function(n,s,a){for(var o=this.getTweensOf(n,a),l=o.length;l--;)is!==o[l]&&o[l].kill(n,s);return this},e.getTweensOf=function(n,s){for(var a=[],o=qi(n),l=this._first,h=Fn(s),c;l;)l instanceof Le?Nw(l._targets,o)&&(h?(!is||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&a.push(l):(c=l.getTweensOf(o,s)).length&&a.push.apply(a,c),l=l._next;return a},e.tweenTo=function(n,s){s=s||{};var a=this,o=Wi(a,n),l=s,h=l.startAt,c=l.onStart,u=l.onStartParams,d=l.immediateRender,f,p=Le.to(a,Fi({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:s.duration||Math.abs((o-(h&&"time"in h?h.time:a._time))/a.timeScale())||ge,onStart:function(){if(a.pause(),!f){var _=s.duration||Math.abs((o-(h&&"time"in h?h.time:a._time))/a.timeScale());p._dur!==_&&Hr(p,_,0,1).render(p._time,!0,!0),f=1}c&&c.apply(p,u||[])}},s));return d?p.render(0):p},e.tweenFromTo=function(n,s,a){return this.tweenTo(s,Fi({startAt:{time:Wi(this,n)}},a))},e.recent=function(){return this._recent},e.nextLabel=function(n){return n===void 0&&(n=this._time),sg(this,Wi(this,n))},e.previousLabel=function(n){return n===void 0&&(n=this._time),sg(this,Wi(this,n),1)},e.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+ge)},e.shiftChildren=function(n,s,a){a===void 0&&(a=0);var o=this._first,l=this.labels,h;for(n=Me(n);o;)o._start>=a&&(o._start+=n,o._end+=n),o=o._next;if(s)for(h in l)l[h]>=a&&(l[h]+=n);return Bs(this)},e.invalidate=function(n){var s=this._first;for(this._lock=0;s;)s.invalidate(n),s=s._next;return r.prototype.invalidate.call(this,n)},e.clear=function(n){n===void 0&&(n=!0);for(var s=this._first,a;s;)a=s._next,this.remove(s),s=a;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Bs(this)},e.totalDuration=function(n){var s=0,a=this,o=a._last,l=Xi,h,c,u;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-n:n));if(a._dirty){for(u=a.parent;o;)h=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>l&&a._sort&&o._ts&&!a._lock?(a._lock=1,fn(a,o,c-o._delay,1)._lock=0):l=c,c<0&&o._ts&&(s-=c,(!u&&!a._dp||u&&u.smoothChildTiming)&&(a._start+=Me(c/a._ts),a._time-=c,a._tTime-=c),a.shiftChildren(-c,!1,-1/0),l=0),o._end>s&&o._ts&&(s=o._end),o=h;Hr(a,a===Ee&&a._time>s?a._time:s,1,1),a._dirty=0}return a._tDur},t.updateRoot=function(n){if(Ee._ts&&(pg(Ee,oh(n,Ee)),fg=Ai.frame),Ai.frame>=tg){tg+=Ei.autoSleep||120;var s=Ee._first;if((!s||!s._ts)&&Ei.autoSleep&&Ai._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||Ai.sleep()}}},t}(qa);Fi(Ze.prototype,{_lock:0,_hasPause:0,_forcing:0});var nA=function(t,e,i,n,s,a,o){var l=new pi(this._pt,t,e,0,1,If,null,s),h=0,c=0,u,d,f,p,m,_,g,y;for(l.b=i,l.e=n,i+="",n+="",(g=~n.indexOf("random("))&&(n=Gr(n)),a&&(y=[i,n],a(y,t,e),i=y[0],n=y[1]),d=i.match(Zd)||[];u=Zd.exec(n);)p=u[0],m=n.substring(h,u.index),f?f=(f+1)%5:m.substr(-5)==="rgba("&&(f=1),p!==d[c++]&&(_=parseFloat(d[c-1])||0,l._pt={_next:l._pt,p:m||c===1?m:",",s:_,c:p.charAt(1)==="="?Gs(_,p)-_:parseFloat(p)-_,m:f&&f<4?Math.round:0},h=Zd.lastIndex);return l.c=h<n.length?n.substring(h,n.length):"",l.fp=o,(vf.test(n)||g)&&(l.e=0),this._pt=l,l},Tf=function(t,e,i,n,s,a,o,l,h,c){Re(n)&&(n=n(s||0,t,a));var u=t[e],d=i!=="get"?i:Re(u)?h?t[e.indexOf("set")||!Re(t["get"+e.substr(3)])?e:"get"+e.substr(3)](h):t[e]():u,f=Re(u)?h?lA:kg:Pf,p;if(He(n)&&(~n.indexOf("random(")&&(n=Gr(n)),n.charAt(1)==="="&&(p=Gs(d,n)+(Qe(d)||0),(p||p===0)&&(n=p))),!c||d!==n||ff)return!isNaN(d*n)&&n!==""?(p=new pi(this._pt,t,e,+d||0,n-(d||0),typeof u=="boolean"?cA:Ug,0,f),h&&(p.fp=h),o&&p.modifier(o,this,t),this._pt=p):(!u&&!(e in t)&&ch(e,n),nA.call(this,t,e,d,n,f,l||Ei.stringFilter,h))},sA=function(t,e,i,n,s){if(Re(t)&&(t=Va(t,s,e,i,n)),!pn(t)||t.style&&t.nodeType||ai(t)||hg(t))return He(t)?Va(t,s,e,i,n):t;var a={},o;for(o in t)a[o]=Va(t[o],s,e,i,n);return a},Cf=function(t,e,i,n,s,a){var o,l,h,c;if(wi[t]&&(o=new wi[t]).init(s,o.rawVars?e[t]:sA(e[t],n,s,a,i),i,n,a)!==!1&&(i._pt=l=new pi(i._pt,s,t,0,1,o.render,o,0,o.priority),i!==kr))for(h=i._ptLookup[i._targets.indexOf(s)],c=o._props.length;c--;)h[o._props[c]]=l;return o},is,ff,Rf=function r(t,e,i){var n=t.vars,s=n.ease,a=n.startAt,o=n.immediateRender,l=n.lazy,h=n.onUpdate,c=n.runBackwards,u=n.yoyoEase,d=n.keyframes,f=n.autoRevert,p=t._dur,m=t._startAt,_=t._targets,g=t.parent,y=g&&g.data==="nested"?g.vars.targets:_,v=t._overwrite==="auto"&&!mf,x=t.timeline,E,w,A,P,b,S,I,B,F,H,J,O,V;if(x&&(!d||!s)&&(s="none"),t._ease=zs(s,Ur.ease),t._yEase=u?Lg(zs(u===!0?s:u,Ur.ease)):0,u&&t._yoyo&&!t._repeat&&(u=t._yEase,t._yEase=t._ease,t._ease=u),t._from=!x&&!!n.runBackwards,!x||d&&!n.stagger){if(B=_[0]?ss(_[0]).harness:0,O=B&&n[B.prop],E=ah(n,xf),m&&(m._zTime<0&&m.progress(1),e<0&&c&&o&&!f?m.render(-1,!0):m.revert(c&&p?eh:Lw),m._lazy=0),a){if(rs(t._startAt=Le.set(_,Fi({data:"isStart",overwrite:!1,parent:g,immediateRender:!0,lazy:!m&&Mi(l),startAt:null,delay:0,onUpdate:h&&function(){return Ni(t,"onUpdate")},stagger:0},a))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(Je||!o&&!f)&&t._startAt.revert(eh),o&&p&&e<=0&&i<=0){e&&(t._zTime=e);return}}else if(c&&p&&!m){if(e&&(o=!1),A=Fi({overwrite:!1,data:"isFromStart",lazy:o&&!m&&Mi(l),immediateRender:o,stagger:0,parent:g},E),O&&(A[B.prop]=O),rs(t._startAt=Le.set(_,A)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(Je?t._startAt.revert(eh):t._startAt.render(-1,!0)),t._zTime=e,!o)r(t._startAt,ge,ge);else if(!e)return}for(t._pt=t._ptCache=0,l=p&&Mi(l)||l&&!p,w=0;w<_.length;w++){if(b=_[w],I=b._gsap||Sf(_)[w]._gsap,t._ptLookup[w]=H={},of[I.id]&&ns.length&&rh(),J=y===_?w:y.indexOf(b),B&&(F=new B).init(b,O||E,t,J,y)!==!1&&(t._pt=P=new pi(t._pt,b,F.name,0,1,F.render,F,0,F.priority),F._props.forEach(function(q){H[q]=P}),F.priority&&(S=1)),!B||O)for(A in E)wi[A]&&(F=Cf(A,E,t,J,b,y))?F.priority&&(S=1):H[A]=P=Tf.call(t,b,A,"get",E[A],J,y,0,n.stringFilter);t._op&&t._op[w]&&t.kill(b,t._op[w]),v&&t._pt&&(is=t,Ee.killTweensOf(b,H,t.globalTime(e)),V=!t.parent,is=0),t._pt&&l&&(of[I.id]=1)}S&&Df(t),t._onInit&&t._onInit(t)}t._onUpdate=h,t._initted=(!t._op||t._pt)&&!V,d&&e<=0&&x.render(Xi,!0,!0)},rA=function(t,e,i,n,s,a,o,l){var h=(t._pt&&t._ptCache||(t._ptCache={}))[e],c,u,d,f;if(!h)for(h=t._ptCache[e]=[],d=t._ptLookup,f=t._targets.length;f--;){if(c=d[f][e],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==e&&c.fp!==e;)c=c._next;if(!c)return ff=1,t.vars[e]="+=0",Rf(t,o),ff=0,l?Ga(e+" not eligible for reset"):1;h.push(c)}for(f=h.length;f--;)u=h[f],c=u._pt||u,c.s=(n||n===0)&&!s?n:c.s+(n||0)+a*c.c,c.c=i-c.s,u.e&&(u.e=Pe(i)+Qe(u.e)),u.b&&(u.b=c.s+Qe(u.b))},aA=function(t,e){var i=t[0]?ss(t[0]).harness:0,n=i&&i.aliases,s,a,o,l;if(!n)return e;s=Br({},e);for(a in n)if(a in s)for(l=n[a].split(","),o=l.length;o--;)s[l[o]]=s[a];return s},oA=function(t,e,i,n){var s=e.ease||n||"power1.inOut",a,o;if(ai(e))o=i[t]||(i[t]=[]),e.forEach(function(l,h){return o.push({t:h/(e.length-1)*100,v:l,e:s})});else for(a in e)o=i[a]||(i[a]=[]),a==="ease"||o.push({t:parseFloat(t),v:e[a],e:s})},Va=function(t,e,i,n,s){return Re(t)?t.call(e,i,n,s):He(t)&&~t.indexOf("random(")?Gr(t):t},Og=bf+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Fg={};fi(Og+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return Fg[r]=1});var Le=function(r){og(t,r);function t(i,n,s,a){var o;typeof n=="number"&&(s.duration=n,n=s,s=null),o=r.call(this,a?n:za(n))||this;var l=o.vars,h=l.duration,c=l.delay,u=l.immediateRender,d=l.stagger,f=l.overwrite,p=l.keyframes,m=l.defaults,_=l.scrollTrigger,g=l.yoyoEase,y=n.parent||Ee,v=(ai(i)||hg(i)?Fn(i[0]):"length"in n)?[i]:qi(i),x,E,w,A,P,b,S,I;if(o._targets=v.length?Sf(v):Ga("GSAP target "+i+" not found. https://gsap.com",!Ei.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=f,p||d||th(h)||th(c)){if(n=o.vars,x=o.timeline=new Ze({data:"nested",defaults:m||{},targets:y&&y.data==="nested"?y.vars.targets:v}),x.kill(),x.parent=x._dp=Nn(o),x._start=0,d||th(h)||th(c)){if(A=v.length,S=d&&wg(d),pn(d))for(P in d)~Og.indexOf(P)&&(I||(I={}),I[P]=d[P]);for(E=0;E<A;E++)w=ah(n,Fg),w.stagger=0,g&&(w.yoyoEase=g),I&&Br(w,I),b=v[E],w.duration=+Va(h,Nn(o),E,b,v),w.delay=(+Va(c,Nn(o),E,b,v)||0)-o._delay,!d&&A===1&&w.delay&&(o._delay=c=w.delay,o._start+=c,w.delay=0),x.to(b,w,S?S(E,b,v):0),x._ease=ne.none;x.duration()?h=c=0:o.timeline=0}else if(p){za(Fi(x.vars.defaults,{ease:"none"})),x._ease=zs(p.ease||n.ease||"none");var B=0,F,H,J;if(ai(p))p.forEach(function(O){return x.to(v,O,">")}),x.duration();else{w={};for(P in p)P==="ease"||P==="easeEach"||oA(P,p[P],w,p.easeEach);for(P in w)for(F=w[P].sort(function(O,V){return O.t-V.t}),B=0,E=0;E<F.length;E++)H=F[E],J={ease:H.e,duration:(H.t-(E?F[E-1].t:0))/100*h},J[P]=H.v,x.to(v,J,B),B+=J.duration;x.duration()<h&&x.to({},{duration:h-x.duration()})}}h||o.duration(h=x.duration())}else o.timeline=0;return f===!0&&!mf&&(is=Nn(o),Ee.killTweensOf(v),is=0),fn(y,Nn(o),s),n.reversed&&o.reverse(),n.paused&&o.paused(!0),(u||!h&&!p&&o._start===Me(y._time)&&Mi(u)&&Uw(Nn(o))&&y.data!=="nested")&&(o._tTime=-ge,o.render(Math.max(0,-c)||0)),_&&yg(Nn(o),_),o}var e=t.prototype;return e.render=function(n,s,a){var o=this._time,l=this._tDur,h=this._dur,c=n<0,u=n>l-ge&&!c?l:n<ge?0:n,d,f,p,m,_,g,y,v,x;if(!h)zw(this,n,s,a);else if(u!==this._tTime||!n||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(d=u,v=this.timeline,this._repeat){if(m=h+this._rDelay,this._repeat<-1&&c)return this.totalTime(m*100+n,s,a);if(d=Me(u%m),u===l?(p=this._repeat,d=h):(_=Me(u/m),p=~~_,p&&p===_?(d=h,p--):d>h&&(d=h)),g=this._yoyo&&p&1,g&&(x=this._yEase,d=h-d),_=zr(this._tTime,m),d===o&&!a&&this._initted&&p===_)return this._tTime=u,this;p!==_&&(v&&this._yEase&&Dg(v,g),this.vars.repeatRefresh&&!g&&!this._lock&&d!==m&&this._initted&&(this._lock=a=1,this.render(Me(m*p),!0).invalidate()._lock=0))}if(!this._initted){if(xg(this,c?n:d,a,s,u))return this._tTime=0,this;if(o!==this._time&&!(a&&this.vars.repeatRefresh&&p!==_))return this;if(h!==this._dur)return this.render(n,s,a)}if(this._tTime=u,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(x||this._ease)(d/h),this._from&&(this.ratio=y=1-y),!o&&u&&!s&&!_&&(Ni(this,"onStart"),this._tTime!==u))return this;for(f=this._pt;f;)f.r(y,f.d),f=f._next;v&&v.render(n<0?n:v._dur*v._ease(d/this._dur),s,a)||this._startAt&&(this._zTime=n),this._onUpdate&&!s&&(c&&lf(this,n,s,a),Ni(this,"onUpdate")),this._repeat&&p!==_&&this.vars.onRepeat&&!s&&this.parent&&Ni(this,"onRepeat"),(u===this._tDur||!u)&&this._tTime===u&&(c&&!this._onUpdate&&lf(this,n,!0,!0),(n||!h)&&(u===this._tDur&&this._ts>0||!u&&this._ts<0)&&rs(this,1),!s&&!(c&&!o)&&(u||o||g)&&(Ni(this,u===l?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},e.resetTo=function(n,s,a,o,l){Xa||Ai.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||Rf(this,h),c=this._ease(h/this._dur),rA(this,n,s,a,o,c,h,l)?this.resetTo(n,s,a,o,1):(fh(this,0),this.parent||_g(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(n,s){if(s===void 0&&(s="all"),!n&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?Ua(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Je),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(n,s,is&&is.vars.overwrite!==!0)._first||Ua(this),this.parent&&a!==this.timeline.totalDuration()&&Hr(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,l=n?qi(n):o,h=this._ptLookup,c=this._pt,u,d,f,p,m,_,g;if((!s||s==="all")&&Fw(o,l))return s==="all"&&(this._pt=0),Ua(this);for(u=this._op=this._op||[],s!=="all"&&(He(s)&&(m={},fi(s,function(y){return m[y]=1}),s=m),s=aA(o,s)),g=o.length;g--;)if(~l.indexOf(o[g])){d=h[g],s==="all"?(u[g]=s,p=d,f={}):(f=u[g]=u[g]||{},p=s);for(m in p)_=d&&d[m],_&&((!("kill"in _.d)||_.d.kill(m)===!0)&&uh(this,_,"_pt"),delete d[m]),f!=="all"&&(f[m]=1)}return this._initted&&!this._pt&&c&&Ua(this),this},t.to=function(n,s){return new t(n,s,arguments[2])},t.from=function(n,s){return Ha(1,arguments)},t.delayedCall=function(n,s,a,o){return new t(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:s,onReverseComplete:s,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},t.fromTo=function(n,s,a){return Ha(2,arguments)},t.set=function(n,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new t(n,s)},t.killTweensOf=function(n,s,a){return Ee.killTweensOf(n,s,a)},t}(qa);Fi(Le.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});fi("staggerTo,staggerFrom,staggerFromTo",function(r){Le[r]=function(){var t=new Ze,e=cf.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var Pf=function(t,e,i){return t[e]=i},kg=function(t,e,i){return t[e](i)},lA=function(t,e,i,n){return t[e](n.fp,i)},hA=function(t,e,i){return t.setAttribute(e,i)},ph=function(t,e){return Re(t[e])?kg:hh(t[e])&&t.setAttribute?hA:Pf},Ug=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},cA=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},If=function(t,e){var i=e._pt,n="";if(!t&&e.b)n=e.b;else if(t===1&&e.e)n=e.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*t):Math.round((i.s+i.c*t)*1e4)/1e4)+n,i=i._next;n+=e.c}e.set(e.t,e.p,n,e)},Lf=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},uA=function(t,e,i,n){for(var s=this._pt,a;s;)a=s._next,s.p===n&&s.modifier(t,e,i),s=a},dA=function(t){for(var e=this._pt,i,n;e;)n=e._next,e.p===t&&!e.op||e.op===t?uh(this,e,"_pt"):e.dep||(i=1),e=n;return!i},fA=function(t,e,i,n){n.mSet(t,e,n.m.call(n.tween,i,n.mt),n)},Df=function(t){for(var e=t._pt,i,n,s,a;e;){for(i=e._next,n=s;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:a)?e._prev._next=e:s=e,(e._next=n)?n._prev=e:a=e,e=i}t._pt=s},pi=function(){function r(e,i,n,s,a,o,l,h,c){this.t=i,this.s=s,this.c=a,this.p=n,this.r=o||Ug,this.d=l||this,this.set=h||Pf,this.pr=c||0,this._next=e,e&&(e._prev=this)}var t=r.prototype;return t.modifier=function(i,n,s){this.mSet=this.mSet||this.set,this.set=fA,this.m=i,this.mt=s,this.tween=n},r}();fi(bf+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return xf[r]=1});Oi.TweenMax=Oi.TweenLite=Le;Oi.TimelineLite=Oi.TimelineMax=Ze;Ee=new Ze({sortChildren:!1,defaults:Ur,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ei.stringFilter=Mf;var Hs=[],nh={},pA=[],ag=0,mA=0,nf=function(t){return(nh[t]||pA).map(function(e){return e()})},pf=function(){var t=Date.now(),e=[];t-ag>2&&(nf("matchMediaInit"),Hs.forEach(function(i){var n=i.queries,s=i.conditions,a,o,l,h;for(o in n)a=dn.matchMedia(n[o]).matches,a&&(l=1),a!==s[o]&&(s[o]=a,h=1);h&&(i.revert(),l&&e.push(i))}),nf("matchMediaRevert"),e.forEach(function(i){return i.onMatch(i,function(n){return i.add(null,n)})}),ag=t,nf("matchMedia"))},Bg=function(){function r(e,i){this.selector=i&&uf(i),this.data=[],this._r=[],this.isReverted=!1,this.id=mA++,e&&this.add(e)}var t=r.prototype;return t.add=function(i,n,s){Re(i)&&(s=n,n=i,i=Re);var a=this,o=function(){var h=Se,c=a.selector,u;return h&&h!==a&&h.data.push(a),s&&(a.selector=uf(s)),Se=a,u=n.apply(a,arguments),Re(u)&&a._r.push(u),Se=h,a.selector=c,a.isReverted=!1,u};return a.last=o,i===Re?o(a,function(l){return a.add(null,l)}):i?a[i]=o:o},t.ignore=function(i){var n=Se;Se=null,i(this),Se=n},t.getTweens=function(){var i=[];return this.data.forEach(function(n){return n instanceof r?i.push.apply(i,n.getTweens()):n instanceof Le&&!(n.parent&&n.parent.data==="nested")&&i.push(n)}),i},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(i,n){var s=this;if(i?function(){for(var o=s.getTweens(),l=s.data.length,h;l--;)h=s.data[l],h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,u){return u.g-c.g||-1/0}).forEach(function(c){return c.t.revert(i)}),l=s.data.length;l--;)h=s.data[l],h instanceof Ze?h.data!=="nested"&&(h.scrollTrigger&&h.scrollTrigger.revert(),h.kill()):!(h instanceof Le)&&h.revert&&h.revert(i);s._r.forEach(function(c){return c(i,s)}),s.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),n)for(var a=Hs.length;a--;)Hs[a].id===this.id&&Hs.splice(a,1)},t.revert=function(i){this.kill(i||{})},r}(),gA=function(){function r(e){this.contexts=[],this.scope=e,Se&&Se.data.push(this)}var t=r.prototype;return t.add=function(i,n,s){pn(i)||(i={matches:i});var a=new Bg(0,s||this.scope),o=a.conditions={},l,h,c;Se&&!a.selector&&(a.selector=Se.selector),this.contexts.push(a),n=a.add("onMatch",n),a.queries=i;for(h in i)h==="all"?c=1:(l=dn.matchMedia(i[h]),l&&(Hs.indexOf(a)<0&&Hs.push(a),(o[h]=l.matches)&&(c=1),l.addListener?l.addListener(pf):l.addEventListener("change",pf)));return c&&n(a,function(u){return a.add(null,u)}),this},t.revert=function(i){this.kill(i||{})},t.kill=function(i){this.contexts.forEach(function(n){return n.kill(i,!0)})},r}(),lh={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach(function(n){return Rg(n)})},timeline:function(t){return new Ze(t)},getTweensOf:function(t,e){return Ee.getTweensOf(t,e)},getProperty:function(t,e,i,n){He(t)&&(t=qi(t)[0]);var s=ss(t||{}).get,a=i?gg:mg;return i==="native"&&(i=""),t&&(e?a((wi[e]&&wi[e].get||s)(t,e,i,n)):function(o,l,h){return a((wi[o]&&wi[o].get||s)(t,o,l,h))})},quickSetter:function(t,e,i){if(t=qi(t),t.length>1){var n=t.map(function(c){return oi.quickSetter(c,e,i)}),s=n.length;return function(c){for(var u=s;u--;)n[u](c)}}t=t[0]||{};var a=wi[e],o=ss(t),l=o.harness&&(o.harness.aliases||{})[e]||e,h=a?function(c){var u=new a;kr._pt=0,u.init(t,i?c+i:c,kr,0,[t]),u.render(1,u),kr._pt&&Lf(1,kr)}:o.set(t,l);return a?h:function(c){return h(t,l,i?c+i:c,o,1)}},quickTo:function(t,e,i){var n,s=oi.to(t,Fi((n={},n[e]="+=0.1",n.paused=!0,n.stagger=0,n),i||{})),a=function(l,h,c){return s.resetTo(e,l,h,c)};return a.tween=s,a},isTweening:function(t){return Ee.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=zs(t.ease,Ur.ease)),eg(Ur,t||{})},config:function(t){return eg(Ei,t||{})},registerEffect:function(t){var e=t.name,i=t.effect,n=t.plugins,s=t.defaults,a=t.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!wi[o]&&!Oi[o]&&Ga(e+" effect requires "+o+" plugin.")}),Jd[e]=function(o,l,h){return i(qi(o),Fi(l||{},s),h)},a&&(Ze.prototype[e]=function(o,l,h){return this.add(Jd[e](o,pn(l)?l:(h=l)&&{},this),h)})},registerEase:function(t,e){ne[t]=zs(e)},parseEase:function(t,e){return arguments.length?zs(t,e):ne},getById:function(t){return Ee.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var i=new Ze(t),n,s;for(i.smoothChildTiming=Mi(t.smoothChildTiming),Ee.remove(i),i._dp=0,i._time=i._tTime=Ee._time,n=Ee._first;n;)s=n._next,(e||!(!n._dur&&n instanceof Le&&n.vars.onComplete===n._targets[0]))&&fn(i,n,n._start-n._delay),n=s;return fn(Ee,i,0),i},context:function(t,e){return t?new Bg(t,e):Se},matchMedia:function(t){return new gA(t)},matchMediaRefresh:function(){return Hs.forEach(function(t){var e=t.conditions,i,n;for(n in e)e[n]&&(e[n]=!1,i=1);i&&t.revert()})||pf()},addEventListener:function(t,e){var i=nh[t]||(nh[t]=[]);~i.indexOf(e)||i.push(e)},removeEventListener:function(t,e){var i=nh[t],n=i&&i.indexOf(e);n>=0&&i.splice(n,1)},utils:{wrap:$w,wrapYoyo:Kw,distribute:wg,random:Mg,snap:Ag,normalize:Yw,getUnit:Qe,clamp:Gw,splitColor:Pg,toArray:qi,selector:uf,mapRange:Tg,pipe:Xw,unitize:qw,interpolate:jw,shuffle:Sg},install:ug,effects:Jd,ticker:Ai,updateRoot:Ze.updateRoot,plugins:wi,globalTimeline:Ee,core:{PropTween:pi,globals:dg,Tween:Le,Timeline:Ze,Animation:qa,getCache:ss,_removeLinkedListItem:uh,reverting:function(){return Je},context:function(t){return t&&Se&&(Se.data.push(t),t._ctx=Se),Se},suppressOverwrites:function(t){return mf=t}}};fi("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return lh[r]=Le[r]});Ai.add(Ze.updateRoot);kr=lh.to({},{duration:0});var _A=function(t,e){for(var i=t._pt;i&&i.p!==e&&i.op!==e&&i.fp!==e;)i=i._next;return i},vA=function(t,e){var i=t._targets,n,s,a;for(n in e)for(s=i.length;s--;)a=t._ptLookup[s][n],a&&(a=a.d)&&(a._pt&&(a=_A(a,n)),a&&a.modifier&&a.modifier(e[n],t,i[s],n))},sf=function(t,e){return{name:t,headless:1,rawVars:1,init:function(n,s,a){a._onInit=function(o){var l,h;if(He(s)&&(l={},fi(s,function(c){return l[c]=1}),s=l),e){l={};for(h in s)l[h]=e(s[h]);s=l}vA(o,s)}}}},oi=lh.registerPlugin({name:"attr",init:function(t,e,i,n,s){var a,o,l;this.tween=i;for(a in e)l=t.getAttribute(a)||"",o=this.add(t,"setAttribute",(l||0)+"",e[a],n,s,0,0,a),o.op=a,o.b=l,this._props.push(a)},render:function(t,e){for(var i=e._pt;i;)Je?i.set(i.t,i.p,i.b,i):i.r(t,i.d),i=i._next}},{name:"endArray",headless:1,init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i],0,0,0,0,0,1)}},sf("roundProps",df),sf("modifiers"),sf("snap",Ag))||lh;Le.version=Ze.version=oi.version="3.14.2";cg=1;gf()&&Vr();var yA=ne.Power0,xA=ne.Power1,bA=ne.Power2,SA=ne.Power3,wA=ne.Power4,AA=ne.Linear,MA=ne.Quad,EA=ne.Cubic,TA=ne.Quart,CA=ne.Quint,RA=ne.Strong,PA=ne.Elastic,IA=ne.Back,LA=ne.SteppedEase,DA=ne.Bounce,NA=ne.Sine,OA=ne.Expo,FA=ne.Circ;var zg,os,Xr,Bf,$s,kA,Hg,zf,UA=function(){return typeof window<"u"},Un={},Ys=180/Math.PI,qr=Math.PI/180,Wr=Math.atan2,Vg=1e8,Hf=/([A-Z])/g,BA=/(left|right|width|margin|padding|x)/i,zA=/[\s,\(]\S/,mn={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Of=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},HA=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},VA=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},GA=function(t,e){return e.set(e.t,e.p,t===1?e.e:t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},WA=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},jg=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Zg=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},XA=function(t,e,i){return t.style[e]=i},qA=function(t,e,i){return t.style.setProperty(e,i)},YA=function(t,e,i){return t._gsap[e]=i},$A=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},KA=function(t,e,i,n,s){var a=t._gsap;a.scaleX=a.scaleY=i,a.renderTransform(s,a)},jA=function(t,e,i,n,s){var a=t._gsap;a[e]=i,a.renderTransform(s,a)},Te="transform",Ti=Te+"Origin",ZA=function r(t,e){var i=this,n=this.target,s=n.style,a=n._gsap;if(t in Un&&s){if(this.tfm=this.tfm||{},t!=="transform")t=mn[t]||t,~t.indexOf(",")?t.split(",").forEach(function(o){return i.tfm[o]=kn(n,o)}):this.tfm[t]=a.x?a[t]:kn(n,t),t===Ti&&(this.tfm.zOrigin=a.zOrigin);else return mn.transform.split(",").forEach(function(o){return r.call(i,o,e)});if(this.props.indexOf(Te)>=0)return;a.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(Ti,e,"")),t=Te}(s||e)&&this.props.push(t,e,s[t])},Jg=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},JA=function(){var t=this.props,e=this.target,i=e.style,n=e._gsap,s,a;for(s=0;s<t.length;s+=3)t[s+1]?t[s+1]===2?e[t[s]](t[s+2]):e[t[s]]=t[s+2]:t[s+2]?i[t[s]]=t[s+2]:i.removeProperty(t[s].substr(0,2)==="--"?t[s]:t[s].replace(Hf,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)n[a]=this.tfm[a];n.svg&&(n.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),s=zf(),(!s||!s.isStart)&&!i[Te]&&(Jg(i),n.zOrigin&&i[Ti]&&(i[Ti]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},Qg=function(t,e){var i={target:t,props:[],revert:JA,save:ZA};return t._gsap||oi.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach(function(n){return i.save(n)}),i},t_,Ff=function(t,e){var i=os.createElementNS?os.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):os.createElement(t);return i&&i.style?i:os.createElement(t)},ki=function r(t,e,i){var n=getComputedStyle(t);return n[e]||n.getPropertyValue(e.replace(Hf,"-$1").toLowerCase())||n.getPropertyValue(e)||!i&&r(t,Yr(e)||e,1)||""},Gg="O,Moz,ms,Ms,Webkit".split(","),Yr=function(t,e,i){var n=e||$s,s=n.style,a=5;if(t in s&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);a--&&!(Gg[a]+t in s););return a<0?null:(a===3?"ms":a>=0?Gg[a]:"")+t},kf=function(){UA()&&window.document&&(zg=window,os=zg.document,Xr=os.documentElement,$s=Ff("div")||{style:{}},kA=Ff("div"),Te=Yr(Te),Ti=Te+"Origin",$s.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",t_=!!Yr("perspective"),zf=oi.core.reverting,Bf=1)},Wg=function(t){var e=t.ownerSVGElement,i=Ff("svg",e&&e.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=t.cloneNode(!0),s;n.style.display="block",i.appendChild(n),Xr.appendChild(i);try{s=n.getBBox()}catch{}return i.removeChild(n),Xr.removeChild(i),s},Xg=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},e_=function(t){var e,i;try{e=t.getBBox()}catch{e=Wg(t),i=1}return e&&(e.width||e.height)||i||(e=Wg(t)),e&&!e.width&&!e.x&&!e.y?{x:+Xg(t,["x","cx","x1"])||0,y:+Xg(t,["y","cy","y1"])||0,width:0,height:0}:e},i_=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&e_(t))},hs=function(t,e){if(e){var i=t.style,n;e in Un&&e!==Ti&&(e=Te),i.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),i.removeProperty(n==="--"?e:e.replace(Hf,"-$1").toLowerCase())):i.removeAttribute(e)}},ls=function(t,e,i,n,s,a){var o=new pi(t._pt,e,i,0,1,a?Zg:jg);return t._pt=o,o.b=n,o.e=s,t._props.push(i),o},qg={deg:1,rad:1,turn:1},QA={grid:1,flex:1},cs=function r(t,e,i,n){var s=parseFloat(i)||0,a=(i+"").trim().substr((s+"").length)||"px",o=$s.style,l=BA.test(e),h=t.tagName.toLowerCase()==="svg",c=(h?"client":"offset")+(l?"Width":"Height"),u=100,d=n==="px",f=n==="%",p,m,_,g;if(n===a||!s||qg[n]||qg[a])return s;if(a!=="px"&&!d&&(s=r(t,e,i,"px")),g=t.getCTM&&i_(t),(f||a==="%")&&(Un[e]||~e.indexOf("adius")))return p=g?t.getBBox()[l?"width":"height"]:t[c],Pe(f?s/p*u:s/100*p);if(o[l?"width":"height"]=u+(d?a:n),m=n!=="rem"&&~e.indexOf("adius")||n==="em"&&t.appendChild&&!h?t:t.parentNode,g&&(m=(t.ownerSVGElement||{}).parentNode),(!m||m===os||!m.appendChild)&&(m=os.body),_=m._gsap,_&&f&&_.width&&l&&_.time===Ai.time&&!_.uncache)return Pe(s/_.width*u);if(f&&(e==="height"||e==="width")){var y=t.style[e];t.style[e]=u+n,p=t[c],y?t.style[e]=y:hs(t,e)}else(f||a==="%")&&!QA[ki(m,"display")]&&(o.position=ki(t,"position")),m===t&&(o.position="static"),m.appendChild($s),p=$s[c],m.removeChild($s),o.position="absolute";return l&&f&&(_=ss(m),_.time=Ai.time,_.width=m[c]),Pe(d?p*s/u:p&&s?u/p*s:0)},kn=function(t,e,i,n){var s;return Bf||kf(),e in mn&&e!=="transform"&&(e=mn[e],~e.indexOf(",")&&(e=e.split(",")[0])),Un[e]&&e!=="transform"?(s=ja(t,n),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:gh(ki(t,Ti))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||n||~(s+"").indexOf("calc("))&&(s=mh[e]&&mh[e](t,e,i)||ki(t,e)||wf(t,e)||(e==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?cs(t,e,s,i)+i:s},tM=function(t,e,i,n){if(!i||i==="none"){var s=Yr(e,t,1),a=s&&ki(t,s,1);a&&a!==i?(e=s,i=a):e==="borderColor"&&(i=ki(t,"borderTopColor"))}var o=new pi(this._pt,t.style,e,0,1,If),l=0,h=0,c,u,d,f,p,m,_,g,y,v,x,E;if(o.b=i,o.e=n,i+="",n+="",n.substring(0,6)==="var(--"&&(n=ki(t,n.substring(4,n.indexOf(")")))),n==="auto"&&(m=t.style[e],t.style[e]=n,n=ki(t,e)||n,m?t.style[e]=m:hs(t,e)),c=[i,n],Mf(c),i=c[0],n=c[1],d=i.match(Vs)||[],E=n.match(Vs)||[],E.length){for(;u=Vs.exec(n);)_=u[0],y=n.substring(l,u.index),p?p=(p+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(p=1),_!==(m=d[h++]||"")&&(f=parseFloat(m)||0,x=m.substr((f+"").length),_.charAt(1)==="="&&(_=Gs(f,_)+x),g=parseFloat(_),v=_.substr((g+"").length),l=Vs.lastIndex-v.length,v||(v=v||Ei.units[e]||x,l===n.length&&(n+=v,o.e+=v)),x!==v&&(f=cs(t,e,m,v)||0),o._pt={_next:o._pt,p:y||h===1?y:",",s:f,c:g-f,m:p&&p<4||e==="zIndex"?Math.round:0});o.c=l<n.length?n.substring(l,n.length):""}else o.r=e==="display"&&n==="none"?Zg:jg;return vf.test(n)&&(o.e=0),this._pt=o,o},Yg={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},eM=function(t){var e=t.split(" "),i=e[0],n=e[1]||"50%";return(i==="top"||i==="bottom"||n==="left"||n==="right")&&(t=i,i=n,n=t),e[0]=Yg[i]||i,e[1]=Yg[n]||n,e.join(" ")},iM=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i=e.t,n=i.style,s=e.u,a=i._gsap,o,l,h;if(s==="all"||s===!0)n.cssText="",l=1;else for(s=s.split(","),h=s.length;--h>-1;)o=s[h],Un[o]&&(l=1,o=o==="transformOrigin"?Ti:Te),hs(i,o);l&&(hs(i,Te),a&&(a.svg&&i.removeAttribute("transform"),n.scale=n.rotate=n.translate="none",ja(i,1),a.uncache=1,Jg(n)))}},mh={clearProps:function(t,e,i,n,s){if(s.data!=="isFromStart"){var a=t._pt=new pi(t._pt,e,i,0,0,iM);return a.u=n,a.pr=-10,a.tween=s,t._props.push(i),1}}},Ka=[1,0,0,1,0,0],n_={},s_=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},$g=function(t){var e=ki(t,Te);return s_(e)?Ka:e.substr(7).match(_f).map(Pe)},Vf=function(t,e){var i=t._gsap||ss(t),n=t.style,s=$g(t),a,o,l,h;return i.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?Ka:s):(s===Ka&&!t.offsetParent&&t!==Xr&&!i.svg&&(l=n.display,n.display="block",a=t.parentNode,(!a||!t.offsetParent&&!t.getBoundingClientRect().width)&&(h=1,o=t.nextElementSibling,Xr.appendChild(t)),s=$g(t),l?n.display=l:hs(t,"display"),h&&(o?a.insertBefore(t,o):a?a.appendChild(t):Xr.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Uf=function(t,e,i,n,s,a){var o=t._gsap,l=s||Vf(t,!0),h=o.xOrigin||0,c=o.yOrigin||0,u=o.xOffset||0,d=o.yOffset||0,f=l[0],p=l[1],m=l[2],_=l[3],g=l[4],y=l[5],v=e.split(" "),x=parseFloat(v[0])||0,E=parseFloat(v[1])||0,w,A,P,b;i?l!==Ka&&(A=f*_-p*m)&&(P=x*(_/A)+E*(-m/A)+(m*y-_*g)/A,b=x*(-p/A)+E*(f/A)-(f*y-p*g)/A,x=P,E=b):(w=e_(t),x=w.x+(~v[0].indexOf("%")?x/100*w.width:x),E=w.y+(~(v[1]||v[0]).indexOf("%")?E/100*w.height:E)),n||n!==!1&&o.smooth?(g=x-h,y=E-c,o.xOffset=u+(g*f+y*m)-g,o.yOffset=d+(g*p+y*_)-y):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=E,o.smooth=!!n,o.origin=e,o.originIsAbsolute=!!i,t.style[Ti]="0px 0px",a&&(ls(a,o,"xOrigin",h,x),ls(a,o,"yOrigin",c,E),ls(a,o,"xOffset",u,o.xOffset),ls(a,o,"yOffset",d,o.yOffset)),t.setAttribute("data-svg-origin",x+" "+E)},ja=function(t,e){var i=t._gsap||new Ef(t);if("x"in i&&!e&&!i.uncache)return i;var n=t.style,s=i.scaleX<0,a="px",o="deg",l=getComputedStyle(t),h=ki(t,Ti)||"0",c,u,d,f,p,m,_,g,y,v,x,E,w,A,P,b,S,I,B,F,H,J,O,V,q,W,Q,tt,ht,nt,G,K;return c=u=d=m=_=g=y=v=x=0,f=p=1,i.svg=!!(t.getCTM&&i_(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(n[Te]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Te]!=="none"?l[Te]:"")),n.scale=n.rotate=n.translate="none"),A=Vf(t,i.svg),i.svg&&(i.uncache?(q=t.getBBox(),h=i.xOrigin-q.x+"px "+(i.yOrigin-q.y)+"px",V=""):V=!e&&t.getAttribute("data-svg-origin"),Uf(t,V||h,!!V||i.originIsAbsolute,i.smooth!==!1,A)),E=i.xOrigin||0,w=i.yOrigin||0,A!==Ka&&(I=A[0],B=A[1],F=A[2],H=A[3],c=J=A[4],u=O=A[5],A.length===6?(f=Math.sqrt(I*I+B*B),p=Math.sqrt(H*H+F*F),m=I||B?Wr(B,I)*Ys:0,y=F||H?Wr(F,H)*Ys+m:0,y&&(p*=Math.abs(Math.cos(y*qr))),i.svg&&(c-=E-(E*I+w*F),u-=w-(E*B+w*H))):(K=A[6],nt=A[7],Q=A[8],tt=A[9],ht=A[10],G=A[11],c=A[12],u=A[13],d=A[14],P=Wr(K,ht),_=P*Ys,P&&(b=Math.cos(-P),S=Math.sin(-P),V=J*b+Q*S,q=O*b+tt*S,W=K*b+ht*S,Q=J*-S+Q*b,tt=O*-S+tt*b,ht=K*-S+ht*b,G=nt*-S+G*b,J=V,O=q,K=W),P=Wr(-F,ht),g=P*Ys,P&&(b=Math.cos(-P),S=Math.sin(-P),V=I*b-Q*S,q=B*b-tt*S,W=F*b-ht*S,G=H*S+G*b,I=V,B=q,F=W),P=Wr(B,I),m=P*Ys,P&&(b=Math.cos(P),S=Math.sin(P),V=I*b+B*S,q=J*b+O*S,B=B*b-I*S,O=O*b-J*S,I=V,J=q),_&&Math.abs(_)+Math.abs(m)>359.9&&(_=m=0,g=180-g),f=Pe(Math.sqrt(I*I+B*B+F*F)),p=Pe(Math.sqrt(O*O+K*K)),P=Wr(J,O),y=Math.abs(P)>2e-4?P*Ys:0,x=G?1/(G<0?-G:G):0),i.svg&&(V=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!s_(ki(t,Te)),V&&t.setAttribute("transform",V))),Math.abs(y)>90&&Math.abs(y)<270&&(s?(f*=-1,y+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,y+=y<=0?180:-180)),e=e||i.uncache,i.x=c-((i.xPercent=c&&(!e&&i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+a,i.y=u-((i.yPercent=u&&(!e&&i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-u)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+a,i.z=d+a,i.scaleX=Pe(f),i.scaleY=Pe(p),i.rotation=Pe(m)+o,i.rotationX=Pe(_)+o,i.rotationY=Pe(g)+o,i.skewX=y+o,i.skewY=v+o,i.transformPerspective=x+a,(i.zOrigin=parseFloat(h.split(" ")[2])||!e&&i.zOrigin||0)&&(n[Ti]=gh(h)),i.xOffset=i.yOffset=0,i.force3D=Ei.force3D,i.renderTransform=i.svg?sM:t_?r_:nM,i.uncache=0,i},gh=function(t){return(t=t.split(" "))[0]+" "+t[1]},Nf=function(t,e,i){var n=Qe(e);return Pe(parseFloat(e)+parseFloat(cs(t,"x",i+"px",n)))+n},nM=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,r_(t,e)},Xs="0deg",$a="0px",qs=") ",r_=function(t,e){var i=e||this,n=i.xPercent,s=i.yPercent,a=i.x,o=i.y,l=i.z,h=i.rotation,c=i.rotationY,u=i.rotationX,d=i.skewX,f=i.skewY,p=i.scaleX,m=i.scaleY,_=i.transformPerspective,g=i.force3D,y=i.target,v=i.zOrigin,x="",E=g==="auto"&&t&&t!==1||g===!0;if(v&&(u!==Xs||c!==Xs)){var w=parseFloat(c)*qr,A=Math.sin(w),P=Math.cos(w),b;w=parseFloat(u)*qr,b=Math.cos(w),a=Nf(y,a,A*b*-v),o=Nf(y,o,-Math.sin(w)*-v),l=Nf(y,l,P*b*-v+v)}_!==$a&&(x+="perspective("+_+qs),(n||s)&&(x+="translate("+n+"%, "+s+"%) "),(E||a!==$a||o!==$a||l!==$a)&&(x+=l!==$a||E?"translate3d("+a+", "+o+", "+l+") ":"translate("+a+", "+o+qs),h!==Xs&&(x+="rotate("+h+qs),c!==Xs&&(x+="rotateY("+c+qs),u!==Xs&&(x+="rotateX("+u+qs),(d!==Xs||f!==Xs)&&(x+="skew("+d+", "+f+qs),(p!==1||m!==1)&&(x+="scale("+p+", "+m+qs),y.style[Te]=x||"translate(0, 0)"},sM=function(t,e){var i=e||this,n=i.xPercent,s=i.yPercent,a=i.x,o=i.y,l=i.rotation,h=i.skewX,c=i.skewY,u=i.scaleX,d=i.scaleY,f=i.target,p=i.xOrigin,m=i.yOrigin,_=i.xOffset,g=i.yOffset,y=i.forceCSS,v=parseFloat(a),x=parseFloat(o),E,w,A,P,b;l=parseFloat(l),h=parseFloat(h),c=parseFloat(c),c&&(c=parseFloat(c),h+=c,l+=c),l||h?(l*=qr,h*=qr,E=Math.cos(l)*u,w=Math.sin(l)*u,A=Math.sin(l-h)*-d,P=Math.cos(l-h)*d,h&&(c*=qr,b=Math.tan(h-c),b=Math.sqrt(1+b*b),A*=b,P*=b,c&&(b=Math.tan(c),b=Math.sqrt(1+b*b),E*=b,w*=b)),E=Pe(E),w=Pe(w),A=Pe(A),P=Pe(P)):(E=u,P=d,w=A=0),(v&&!~(a+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(v=cs(f,"x",a,"px"),x=cs(f,"y",o,"px")),(p||m||_||g)&&(v=Pe(v+p-(p*E+m*A)+_),x=Pe(x+m-(p*w+m*P)+g)),(n||s)&&(b=f.getBBox(),v=Pe(v+n/100*b.width),x=Pe(x+s/100*b.height)),b="matrix("+E+","+w+","+A+","+P+","+v+","+x+")",f.setAttribute("transform",b),y&&(f.style[Te]=b)},rM=function(t,e,i,n,s){var a=360,o=He(s),l=parseFloat(s)*(o&&~s.indexOf("rad")?Ys:1),h=l-n,c=n+h+"deg",u,d;return o&&(u=s.split("_")[1],u==="short"&&(h%=a,h!==h%(a/2)&&(h+=h<0?a:-a)),u==="cw"&&h<0?h=(h+a*Vg)%a-~~(h/a)*a:u==="ccw"&&h>0&&(h=(h-a*Vg)%a-~~(h/a)*a)),t._pt=d=new pi(t._pt,e,i,n,h,HA),d.e=c,d.u="deg",t._props.push(i),d},Kg=function(t,e){for(var i in e)t[i]=e[i];return t},aM=function(t,e,i){var n=Kg({},i._gsap),s="perspective,force3D,transformOrigin,svgOrigin",a=i.style,o,l,h,c,u,d,f,p;n.svg?(h=i.getAttribute("transform"),i.setAttribute("transform",""),a[Te]=e,o=ja(i,1),hs(i,Te),i.setAttribute("transform",h)):(h=getComputedStyle(i)[Te],a[Te]=e,o=ja(i,1),a[Te]=h);for(l in Un)h=n[l],c=o[l],h!==c&&s.indexOf(l)<0&&(f=Qe(h),p=Qe(c),u=f!==p?cs(i,l,h,p):parseFloat(h),d=parseFloat(c),t._pt=new pi(t._pt,o,l,u,d-u,Of),t._pt.u=p||0,t._props.push(l));Kg(o,n)};fi("padding,margin,Width,Radius",function(r,t){var e="Top",i="Right",n="Bottom",s="Left",a=(t<3?[e,i,n,s]:[e+s,e+i,n+i,n+s]).map(function(o){return t<2?r+o:"border"+o+r});mh[t>1?"border"+r:r]=function(o,l,h,c,u){var d,f;if(arguments.length<4)return d=a.map(function(p){return kn(o,p,h)}),f=d.join(" "),f.split(d[0]).length===5?d[0]:f;d=(c+"").split(" "),f={},a.forEach(function(p,m){return f[p]=d[m]=d[m]||d[(m-1)/2|0]}),o.init(l,f,u)}});var Gf={name:"css",register:kf,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,n,s){var a=this._props,o=t.style,l=i.vars.startAt,h,c,u,d,f,p,m,_,g,y,v,x,E,w,A,P,b;Bf||kf(),this.styles=this.styles||Qg(t),P=this.styles.props,this.tween=i;for(m in e)if(m!=="autoRound"&&(c=e[m],!(wi[m]&&Cf(m,e,i,n,t,s)))){if(f=typeof c,p=mh[m],f==="function"&&(c=c.call(i,n,t,s),f=typeof c),f==="string"&&~c.indexOf("random(")&&(c=Gr(c)),p)p(this,t,m,c,i)&&(A=1);else if(m.substr(0,2)==="--")h=(getComputedStyle(t).getPropertyValue(m)+"").trim(),c+="",On.lastIndex=0,On.test(h)||(_=Qe(h),g=Qe(c),g?_!==g&&(h=cs(t,m,h,g)+g):_&&(c+=_)),this.add(o,"setProperty",h,c,n,s,0,0,m),a.push(m),P.push(m,0,o[m]);else if(f!=="undefined"){if(l&&m in l?(h=typeof l[m]=="function"?l[m].call(i,n,t,s):l[m],He(h)&&~h.indexOf("random(")&&(h=Gr(h)),Qe(h+"")||h==="auto"||(h+=Ei.units[m]||Qe(kn(t,m))||""),(h+"").charAt(1)==="="&&(h=kn(t,m))):h=kn(t,m),d=parseFloat(h),y=f==="string"&&c.charAt(1)==="="&&c.substr(0,2),y&&(c=c.substr(2)),u=parseFloat(c),m in mn&&(m==="autoAlpha"&&(d===1&&kn(t,"visibility")==="hidden"&&u&&(d=0),P.push("visibility",0,o.visibility),ls(this,o,"visibility",d?"inherit":"hidden",u?"inherit":"hidden",!u)),m!=="scale"&&m!=="transform"&&(m=mn[m],~m.indexOf(",")&&(m=m.split(",")[0]))),v=m in Un,v){if(this.styles.save(m),b=c,f==="string"&&c.substring(0,6)==="var(--"){if(c=ki(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var S=t.style.perspective;t.style.perspective=c,c=ki(t,"perspective"),S?t.style.perspective=S:hs(t,"perspective")}u=parseFloat(c)}if(x||(E=t._gsap,E.renderTransform&&!e.parseTransform||ja(t,e.parseTransform),w=e.smoothOrigin!==!1&&E.smooth,x=this._pt=new pi(this._pt,o,Te,0,1,E.renderTransform,E,0,-1),x.dep=1),m==="scale")this._pt=new pi(this._pt,E,"scaleY",E.scaleY,(y?Gs(E.scaleY,y+u):u)-E.scaleY||0,Of),this._pt.u=0,a.push("scaleY",m),m+="X";else if(m==="transformOrigin"){P.push(Ti,0,o[Ti]),c=eM(c),E.svg?Uf(t,c,0,w,0,this):(g=parseFloat(c.split(" ")[2])||0,g!==E.zOrigin&&ls(this,E,"zOrigin",E.zOrigin,g),ls(this,o,m,gh(h),gh(c)));continue}else if(m==="svgOrigin"){Uf(t,c,1,w,0,this);continue}else if(m in n_){rM(this,E,m,d,y?Gs(d,y+c):c);continue}else if(m==="smoothOrigin"){ls(this,E,"smooth",E.smooth,c);continue}else if(m==="force3D"){E[m]=c;continue}else if(m==="transform"){aM(this,c,t);continue}}else m in o||(m=Yr(m)||m);if(v||(u||u===0)&&(d||d===0)&&!zA.test(c)&&m in o)_=(h+"").substr((d+"").length),u||(u=0),g=Qe(c)||(m in Ei.units?Ei.units[m]:_),_!==g&&(d=cs(t,m,h,g)),this._pt=new pi(this._pt,v?E:o,m,d,(y?Gs(d,y+u):u)-d,!v&&(g==="px"||m==="zIndex")&&e.autoRound!==!1?WA:Of),this._pt.u=g||0,v&&b!==c?(this._pt.b=h,this._pt.e=b,this._pt.r=GA):_!==g&&g!=="%"&&(this._pt.b=h,this._pt.r=VA);else if(m in o)tM.call(this,t,m,h,y?y+c:c);else if(m in t)this.add(t,m,h||t[m],y?y+c:c,n,s);else if(m!=="parseTransform"){ch(m,c);continue}v||(m in o?P.push(m,0,o[m]):typeof t[m]=="function"?P.push(m,2,t[m]()):P.push(m,1,h||t[m])),a.push(m)}}A&&Df(this)},render:function(t,e){if(e.tween._time||!zf())for(var i=e._pt;i;)i.r(t,i.d),i=i._next;else e.styles.revert()},get:kn,aliases:mn,getSetter:function(t,e,i){var n=mn[e];return n&&n.indexOf(",")<0&&(e=n),e in Un&&e!==Ti&&(t._gsap.x||kn(t,"x"))?i&&Hg===i?e==="scale"?$A:YA:(Hg=i||{})&&(e==="scale"?KA:jA):t.style&&!hh(t.style[e])?XA:~e.indexOf("-")?qA:ph(t,e)},core:{_removeProperty:hs,_getMatrix:Vf}};oi.utils.checkPrefix=Yr;oi.core.getStyleSaver=Qg;(function(r,t,e,i){var n=fi(r+","+t+","+e,function(s){Un[s]=1});fi(t,function(s){Ei.units[s]="deg",n_[s]=1}),mn[n[13]]=r+","+t,fi(i,function(s){var a=s.split(":");mn[a[1]]=n[a[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");fi("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Ei.units[r]="px"});oi.registerPlugin(Gf);var Wf=oi.registerPlugin(Gf)||oi,IE=Wf.core.Tween;var oM=.45,Xf=new j(.3,.5,1).normalize(),_h=class{constructor(t,e={}){this._container=t,this._options=e,this._pageDims={pageWidth:400,pageHeight:600,spreadWidth:800,spreadHeight:600},this._layout="double",this._currentLeftPage=1,this._totalPages=1,this._scene=null,this._camera=null,this._renderer=null,this._leftMesh=null,this._rightMesh=null,this._leftOverlay=null,this._rightOverlay=null,this._spineMesh=null,this._shadowMesh=null,this._shadowFwdTex=null,this._shadowBwdTex=null,this._flipRightMesh=null,this._flipLeftMesh=null,this._flipQueue=[],this._currentTimeline=null,this._isAnimating=!1,this._onPageChangeCb=null,this._onAnimationEndCb=null,this._loader=null,this._bookGroup=null,this._init()}_init(){this._scene=new Yl,this._bookGroup=new jn,this._scene.add(this._bookGroup),this._renderer=new ql({antialias:!0,alpha:!0}),this._renderer.setPixelRatio(window.devicePixelRatio||1);let t=this._renderer.domElement;t.classList.add("pfo-canvas"),t.style.display="block",this._container.appendChild(t),this._renderer.setAnimationLoop(()=>this._renderFrame())}setLoader(t){this._loader=t}onPageChange(t){this._onPageChangeCb=t}onAnimationEnd(t){this._onAnimationEndCb=t}buildScene(t,e,i,n){this._pageDims=t,this._layout=e,this._currentLeftPage=i,this._totalPages=n;let s=Math.max(1,this._container.clientWidth),a=Math.max(1,this._container.clientHeight-44);this._renderer.setSize(s,a);let o=a,l=2*Math.atan(a/2/o)*(180/Math.PI);this._camera=new di(l,s/a,.1,o*4),this._camera.position.set(0,0,o),this._camera.lookAt(0,0,0),this._clearMeshes(),this._bookGroup.position.x=this._getGroupOffsetX(i),this._buildPageMeshes(t.pageWidth,t.pageHeight,e),this._updateTextures()}_clearMeshes(){this._shadowFwdTex&&(this._shadowFwdTex.dispose(),this._shadowFwdTex=null),this._shadowBwdTex&&(this._shadowBwdTex.dispose(),this._shadowBwdTex=null),this._shadowMesh&&(this._shadowMesh.material.map=null);let t=[this._leftMesh,this._rightMesh,this._leftOverlay,this._rightOverlay,this._spineMesh,this._shadowMesh,this._flipRightMesh,this._flipLeftMesh];for(let e of t)e&&(this._bookGroup.remove(e),e.geometry.dispose(),Array.isArray(e.material)?e.material.forEach(i=>{i.map&&i.map.dispose(),i.dispose()}):(e.material.map&&e.material.map.dispose(),e.material.dispose()));this._leftMesh=null,this._rightMesh=null,this._leftOverlay=null,this._rightOverlay=null,this._spineMesh=null,this._shadowMesh=null,this._flipRightMesh=null,this._flipLeftMesh=null}_buildPageMeshes(t,e,i){let n=i==="double",s=t/2;if(this._leftMesh=new ke(new Gi(t,e),new Di({color:16777215})),this._leftMesh.position.set(n?-s:0,0,0),this._bookGroup.add(this._leftMesh),n){this._rightMesh=new ke(new Gi(t,e),new Di({color:16777215})),this._rightMesh.position.set(s,0,0),this._bookGroup.add(this._rightMesh);let o=this._makeGradientTex([[0,"rgba(0,0,0,0)"],[.4,"rgba(0,0,0,0)"],[.75,"rgba(0,0,0,0.05)"],[.9,"rgba(0,0,0,0.10)"],[1,"rgba(0,0,0,0.15)"]]);this._leftOverlay=new ke(new Gi(t,e),new Di({map:o,transparent:!0,depthWrite:!1})),this._leftOverlay.position.set(-s,0,.2),this._bookGroup.add(this._leftOverlay);let l=this._makeGradientTex([[0,"rgba(0,0,0,0.15)"],[.1,"rgba(0,0,0,0.10)"],[.25,"rgba(0,0,0,0.05)"],[.6,"rgba(0,0,0,0)"],[1,"rgba(0,0,0,0)"]]);this._rightOverlay=new ke(new Gi(t,e),new Di({map:l,transparent:!0,depthWrite:!1})),this._rightOverlay.position.set(s,0,.2),this._bookGroup.add(this._rightOverlay);let h=this._makeGradientTex([[0,"rgba(0,0,0,0.00)"],[.5,"rgba(0,0,0,0.08)"],[.51,"rgba(0,0,0,0.0)"],[1,"rgba(0,0,0,0)"]]);this._spineMesh=new ke(new Gi(t*.04,e),new Di({map:h,transparent:!0,depthWrite:!1})),this._spineMesh.position.set(0,0,.5),this._bookGroup.add(this._spineMesh)}let a=o=>{let l=new Gi(t,e,60,10);l.translate(o,0,0),l.userData.originalPositions=l.attributes.position.array.slice();let h=l.attributes.position.count;return l.setAttribute("color",new Si(new Float32Array(h*3).fill(1),3)),l};this._flipRightMesh=new ke(a(t/2),new Di({color:16777215,vertexColors:!0,side:en})),this._flipRightMesh.position.set(0,0,2),this._flipRightMesh.visible=!1,this._bookGroup.add(this._flipRightMesh),this._flipLeftMesh=new ke(a(-t/2),new Di({color:16777215,vertexColors:!0,side:en})),this._flipLeftMesh.position.set(0,0,2),this._flipLeftMesh.visible=!1,this._bookGroup.add(this._flipLeftMesh),this._shadowFwdTex=this._makeGradientTex([[0,"rgba(0,0,0,0)"],[.7,"rgba(0,0,0,0)"],[.88,"rgba(0,0,0,0.22)"],[1,"rgba(0,0,0,0.65)"]]),this._shadowBwdTex=this._makeGradientTex([[0,"rgba(0,0,0,0.65)"],[.12,"rgba(0,0,0,0.22)"],[.3,"rgba(0,0,0,0)"],[1,"rgba(0,0,0,0)"]]),this._shadowMesh=new ke(new Gi(t,e),new Di({map:this._shadowFwdTex,transparent:!0,opacity:0,depthWrite:!1})),this._shadowMesh.position.set(0,0,1),this._bookGroup.add(this._shadowMesh)}_makeGradientTex(t){let e=document.createElement("canvas");e.width=256,e.height=4;let i=e.getContext("2d"),n=i.createLinearGradient(0,0,256,0);for(let[a,o]of t)n.addColorStop(a,o);i.fillStyle=n,i.fillRect(0,0,256,4);let s=new Nr(e);return s.needsUpdate=!0,s}_isCoverSpread(t){return this._layout==="double"&&t===1&&this._totalPages>1}_isBackCoverSpread(t){return this._layout==="double"&&this._totalPages>1&&t===this._totalPages&&this._totalPages%2===0}_getGroupOffsetX(t){let e=this._pageDims.pageWidth/2;return this._isCoverSpread(t)?-e:this._isBackCoverSpread(t)?e:0}_deformPage(t,e,i){let n=t.geometry,s=n.userData.originalPositions,a=n.attributes.position;for(let h=0;h<a.count;h++){let c=h*3,u=s[c],d=s[c+1],f=Math.abs(u)/i,p=Math.PI/2*e*f;a.setXYZ(h,Math.cos(p)*u,d,Math.sin(p)*Math.abs(u)*oM)}a.needsUpdate=!0,n.computeVertexNormals();let o=n.attributes.normal,l=n.attributes.color;for(let h=0;h<a.count;h++){let c=h*3,u=Math.abs(s[c])/i,d=this._shade(o.getX(h),o.getY(h),o.getZ(h)),f=Math.max(0,.15*(1-u/.2)),p=Math.max(0,d-f);l.setXYZ(h,p,p,p)}l.needsUpdate=!0}_shade(t,e,i){let n=t*Xf.x+e*Xf.y+i*Xf.z;return .68+.32*Math.max(0,n)}async _updateTextures(){if(!this._loader)return;let t=this._currentLeftPage,e=this._isCoverSpread(t),i=this._isBackCoverSpread(t),n=this._layout==="double";if(e)this._leftMesh&&(this._leftMesh.visible=!1),this._leftOverlay&&(this._leftOverlay.visible=!1),this._rightMesh&&(this._rightMesh.visible=!0,this._applyTexture(this._rightMesh,1)),this._rightOverlay&&(this._rightOverlay.visible=!1),this._spineMesh&&(this._spineMesh.visible=!1);else if(i)this._leftMesh&&(this._leftMesh.visible=!0,this._applyTexture(this._leftMesh,t)),this._leftOverlay&&(this._leftOverlay.visible=!0),this._rightMesh&&(this._rightMesh.visible=!1),this._rightOverlay&&(this._rightOverlay.visible=!1),this._spineMesh&&(this._spineMesh.visible=!1);else if(this._leftMesh&&(this._leftMesh.visible=!0,this._applyTexture(this._leftMesh,t)),this._leftOverlay&&(this._leftOverlay.visible=n),this._rightOverlay&&(this._rightOverlay.visible=n),this._spineMesh&&(this._spineMesh.visible=n),n&&this._rightMesh){this._rightMesh.visible=!0;let s=t+1;s<=this._totalPages?this._applyTexture(this._rightMesh,s):(this._rightMesh.material.map=null,this._rightMesh.material.color.set(16448250),this._rightMesh.material.needsUpdate=!0)}}async _applyTexture(t,e){if(!(!this._loader||e<1||e>this._totalPages))try{let i=await this._loader.getTexture(e);t.material.map=i,t.material.color.set(16777215),t.material.needsUpdate=!0}catch(i){console.warn(`Failed to load texture for page ${e}:`,i)}}flipTo(t,e){if(t===this._currentLeftPage)return;let n=this._flipQueue.length>0?this._options.flipDuration*.4:this._options.flipDuration;this._flipQueue.push({targetLeftPage:t,direction:e,duration:n}),this._isAnimating||this._processQueue()}_processQueue(){if(this._flipQueue.length===0){this._isAnimating=!1,this._onAnimationEndCb&&this._onAnimationEndCb();return}this._isAnimating=!0,this._executeFlip(this._flipQueue.shift())}_executeFlip({targetLeftPage:t,direction:e,duration:i}){let n=this._layout==="double",s=e==="forward",a=this._pageDims.pageWidth,o=s?this._flipRightMesh:this._flipLeftMesh,l=s?this._flipLeftMesh:this._flipRightMesh,h=this._isCoverSpread(this._currentLeftPage),c=this._isCoverSpread(t),u=this._isBackCoverSpread(t),d=s?n?h?this._currentLeftPage:this._currentLeftPage+1:this._currentLeftPage:this._currentLeftPage;this._applyTexture(o,d);let f=s||c?t:Math.min(t+1,this._totalPages);if(l.material.map=null,l.material.color.set(16777215),this._applyTexture(l,f),s){if(n&&this._rightMesh)if(u)this._rightMesh.visible=!1,this._rightOverlay&&(this._rightOverlay.visible=!1);else{this._rightMesh.visible=!0,this._rightOverlay&&(this._rightOverlay.visible=!0);let _=t+1;_<=this._totalPages?this._applyTexture(this._rightMesh,_):(this._rightMesh.material.map=null,this._rightMesh.material.color.set(16448250),this._rightMesh.material.needsUpdate=!0)}}else c?(this._leftMesh&&(this._leftMesh.visible=!1),this._leftOverlay&&(this._leftOverlay.visible=!1)):(this._leftMesh&&(this._leftMesh.visible=!0),this._applyTexture(this._leftMesh,t));this._shadowMesh&&(this._shadowMesh.position.x=s?-(a/2):a/2,this._shadowMesh.material.map=s?this._shadowFwdTex:this._shadowBwdTex,this._shadowMesh.material.opacity=0,this._shadowMesh.material.needsUpdate=!0),this._deformPage(o,0,a),this._deformPage(l,0,a),o.scale.x=1,o.position.z=2,o.visible=!0,l.scale.x=1,l.position.z=2,l.visible=!1;let p={t:0},m=this._getGroupOffsetX(t);this._currentTimeline=Wf.timeline({onComplete:()=>{this._currentLeftPage=t,this._shadowMesh&&(this._shadowMesh.material.opacity=0),s&&this._leftMesh?(this._leftMesh.material.map=l.material.map,this._leftMesh.material.color.set(16777215),this._leftMesh.material.needsUpdate=!0):!s&&n&&this._rightMesh&&(this._rightMesh.material.map=l.material.map,this._rightMesh.material.color.set(16777215),this._rightMesh.material.needsUpdate=!0),o.visible=!1,l.visible=!1;let _=this._isCoverSpread(t),g=this._isBackCoverSpread(t);this._leftMesh&&(this._leftMesh.visible=!_),this._rightMesh&&(this._rightMesh.visible=!g),this._leftOverlay&&(this._leftOverlay.visible=!_&&n),this._rightOverlay&&(this._rightOverlay.visible=!g&&n),this._spineMesh&&(this._spineMesh.visible=!_&&!g&&n),this._onPageChangeCb&&this._onPageChangeCb(t),this._loader&&this._loader.prefetch(t,this._totalPages),this._processQueue()}}),this._bookGroup.position.x!==m&&this._currentTimeline.to(this._bookGroup.position,{x:m,duration:i/1e3,ease:"power2.inOut"},0),this._currentTimeline.to(p,{t:1,duration:i/1e3,ease:"power2.inOut",onUpdate:()=>{let _=p.t;_<=.5?(this._deformPage(o,_/.5,a),o.visible=!0,l.visible=!1):(this._deformPage(l,1-(_-.5)/.5,a),o.visible=!1,l.visible=!0),this._shadowMesh&&(this._shadowMesh.material.opacity=Math.sin(_*Math.PI)*.55)}},0)}cancelQueue(){this._flipQueue=[],this._currentTimeline&&(this._currentTimeline.kill(),this._currentTimeline=null),this._flipRightMesh&&(this._flipRightMesh.visible=!1),this._flipLeftMesh&&(this._flipLeftMesh.visible=!1),this._shadowMesh&&(this._shadowMesh.material.opacity=0),this._isAnimating=!1,this._onAnimationEndCb&&this._onAnimationEndCb()}_renderFrame(){this._renderer&&this._scene&&this._camera&&this._renderer.render(this._scene,this._camera)}getCanvas(){return this._renderer?this._renderer.domElement:null}get isAnimating(){return this._isAnimating}destroy(){this.cancelQueue(),this._renderer.setAnimationLoop(null),this._clearMeshes(),this._scene.clear(),this._renderer.dispose(),this._renderer.domElement.parentNode&&this._renderer.domElement.parentNode.removeChild(this._renderer.domElement)}};var qf=y_(a_(),1),lM=.3,hM=.7,yh=class{constructor(t,e,i={}){this._canvas=t,this._container=e,this._options=i,this._onNext=null,this._onPrev=null,this._onFirst=null,this._onLast=null,this._onZoomIn=null,this._onZoomOut=null,this._onToggleFullscreen=null,this._onEscape=null,this._onPinch=null,this._onDoubleTap=null,this._hammer=null,this._boundKeyDown=this._onKeyDown.bind(this),this._boundClick=this._onClick.bind(this),this._init()}_init(){this._options.enableKeyboard!==!1&&document.addEventListener("keydown",this._boundKeyDown),this._canvas.addEventListener("click",this._boundClick),this._options.enableTouch!==!1&&this._initHammer()}_initHammer(){this._hammer=new qf.default(this._canvas,{touchAction:"none"}),this._hammer.get("swipe").set({direction:qf.default.DIRECTION_HORIZONTAL,threshold:20,velocity:.3}),this._hammer.on("swipeleft",()=>{this._onNext&&this._onNext()}),this._hammer.on("swiperight",()=>{this._onPrev&&this._onPrev()}),this._hammer.get("pinch").set({enable:!0});let t=1;this._hammer.on("pinchstart",()=>{t=1}),this._hammer.on("pinchmove",e=>{let i=e.scale/t;t=e.scale,this._onPinch&&this._onPinch(i,e.center)}),this._hammer.get("doubletap").set({enable:!0}),this._hammer.on("doubletap",e=>{this._onDoubleTap&&this._onDoubleTap(e.center)})}_onClick(t){let e=this._canvas.getBoundingClientRect(),i=(t.clientX-e.left)/e.width;i<lM?this._onPrev&&this._onPrev():i>hM&&this._onNext&&this._onNext()}_onKeyDown(t){if(!(document.activeElement&&document.activeElement.tagName==="INPUT"))switch(t.key){case"ArrowRight":case"ArrowDown":t.preventDefault(),this._onNext&&this._onNext();break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this._onPrev&&this._onPrev();break;case"Home":t.preventDefault(),this._onFirst&&this._onFirst();break;case"End":t.preventDefault(),this._onLast&&this._onLast();break;case"+":case"=":t.preventDefault(),this._onZoomIn&&this._onZoomIn();break;case"-":t.preventDefault(),this._onZoomOut&&this._onZoomOut();break;case"f":case"F":t.preventDefault(),this._onToggleFullscreen&&this._onToggleFullscreen();break;case"Escape":this._onEscape&&this._onEscape();break}}onNext(t){this._onNext=t}onPrev(t){this._onPrev=t}onFirst(t){this._onFirst=t}onLast(t){this._onLast=t}onZoomIn(t){this._onZoomIn=t}onZoomOut(t){this._onZoomOut=t}onToggleFullscreen(t){this._onToggleFullscreen=t}onEscape(t){this._onEscape=t}onPinch(t){this._onPinch=t}onDoubleTap(t){this._onDoubleTap=t}destroy(){document.removeEventListener("keydown",this._boundKeyDown),this._canvas.removeEventListener("click",this._boundClick),this._hammer&&(this._hammer.destroy(),this._hammer=null)}};var Ve=function(){return Ve=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Ve.apply(this,arguments)};typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}));var cM=typeof document<"u"&&!!document.documentMode,Yf;function uM(){return Yf||(Yf=document.createElement("div").style)}var o_=["webkit","moz","ms"],xh={};function Qf(r){if(xh[r])return xh[r];var t=uM();if(r in t)return xh[r]=r;for(var e=r[0].toUpperCase()+r.slice(1),i=o_.length;i--;){var n="".concat(o_[i]).concat(e);if(n in t)return xh[r]=n}}function bh(r,t){return parseFloat(t[Qf(r)])||0}function Sh(r,t,e){e===void 0&&(e=window.getComputedStyle(r));var i=t==="border"?"Width":"";return{left:bh("".concat(t,"Left").concat(i),e),right:bh("".concat(t,"Right").concat(i),e),top:bh("".concat(t,"Top").concat(i),e),bottom:bh("".concat(t,"Bottom").concat(i),e)}}function $r(r,t,e){r.style[Qf(t)]=e}function dM(r,t){var e=Qf("transform");$r(r,"transition","".concat(e," ").concat(t.duration,"ms ").concat(t.easing))}function fM(r,t,e){var i=t.x,n=t.y,s=t.scale,a=t.isSVG;if($r(r,"transform","scale(".concat(s,") translate(").concat(i,"px, ").concat(n,"px)")),a&&cM){var o=window.getComputedStyle(r).getPropertyValue("transform");r.setAttribute("transform",o)}}function $f(r){var t=r.parentNode,e=window.getComputedStyle(r),i=window.getComputedStyle(t),n=r.getBoundingClientRect(),s=t.getBoundingClientRect();return{elem:{style:e,width:n.width,height:n.height,top:n.top,bottom:n.bottom,left:n.left,right:n.right,margin:Sh(r,"margin",e),border:Sh(r,"border",e)},parent:{style:i,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:Sh(t,"padding",i),border:Sh(t,"border",i)}}}var Za={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Za={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Za={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Kf(r,t,e,i){Za[r].split(" ").forEach(function(n){t.addEventListener(n,e,i)})}function jf(r,t,e){Za[r].split(" ").forEach(function(i){t.removeEventListener(i,e)})}function h_(r,t){for(var e=r.length;e--;)if(r[e].pointerId===t.pointerId)return e;return-1}function Jf(r,t){var e;if(t.touches){e=0;for(var i=0,n=t.touches;i<n.length;i++){var s=n[i];s.pointerId=e++,Jf(r,s)}return}e=h_(r,t),e>-1&&r.splice(e,1),r.push(t)}function pM(r,t){if(t.touches){for(;r.length;)r.pop();return}var e=h_(r,t);e>-1&&r.splice(e,1)}function l_(r){r=r.slice(0);for(var t=r.pop(),e;e=r.pop();)t={clientX:(e.clientX-t.clientX)/2+t.clientX,clientY:(e.clientY-t.clientY)/2+t.clientY};return t}function Zf(r){if(r.length<2)return 0;var t=r[0],e=r[1];return Math.sqrt(Math.pow(Math.abs(e.clientX-t.clientX),2)+Math.pow(Math.abs(e.clientY-t.clientY),2))}function mM(r){for(var t=r;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1}function gM(r){return(r.getAttribute("class")||"").trim()}function _M(r,t){return r.nodeType===1&&" ".concat(gM(r)," ").indexOf(" ".concat(t," "))>-1}function vM(r,t){for(var e=r;e!=null;e=e.parentNode)if(_M(e,t.excludeClass)||t.exclude.indexOf(e)>-1)return!0;return!1}var yM=/^http:[\w\.\/]+svg$/;function xM(r){return yM.test(r.namespaceURI)&&r.nodeName.toLowerCase()!=="svg"}function bM(r){var t={};for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return t}var c_={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:function(r){r.preventDefault(),r.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:fM,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function tp(r,t){if(!r)throw new Error("Panzoom requires an element as an argument");if(r.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!mM(r))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t=Ve(Ve({},c_),t);var e=xM(r),i=r.parentNode;i.style.overflow=t.overflow,i.style.userSelect="none",i.style.touchAction=t.touchAction,(t.canvas?i:r).style.cursor=t.cursor,r.style.userSelect="none",r.style.touchAction=t.touchAction,$r(r,"transformOrigin",typeof t.origin=="string"?t.origin:e?"0 0":"50% 50%");function n(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",r.style.cursor="",r.style.userSelect="",r.style.touchAction="",$r(r,"transformOrigin","")}function s(W){W===void 0&&(W={});for(var Q in W)W.hasOwnProperty(Q)&&(t[Q]=W[Q]);(W.hasOwnProperty("cursor")||W.hasOwnProperty("canvas"))&&(i.style.cursor=r.style.cursor="",(t.canvas?i:r).style.cursor=t.cursor),W.hasOwnProperty("overflow")&&(i.style.overflow=W.overflow),W.hasOwnProperty("touchAction")&&(i.style.touchAction=W.touchAction,r.style.touchAction=W.touchAction)}var a=0,o=0,l=1,h=!1;m(t.startScale,{animate:!1,force:!0}),setTimeout(function(){p(t.startX,t.startY,{animate:!1,force:!0})});function c(W,Q,tt){if(!tt.silent){var ht=new CustomEvent(W,{detail:Q});r.dispatchEvent(ht)}}function u(W,Q,tt){var ht={x:a,y:o,scale:l,isSVG:e,originalEvent:tt};return requestAnimationFrame(function(){typeof Q.animate=="boolean"&&(Q.animate?dM(r,Q):$r(r,"transition","none")),Q.setTransform(r,ht,Q),c(W,ht,Q),c("panzoomchange",ht,Q)}),ht}function d(W,Q,tt,ht){var nt=Ve(Ve({},t),ht),G={x:a,y:o,opts:nt};if(!(ht!=null&&ht.force)&&(nt.disablePan||nt.panOnlyWhenZoomed&&l===nt.startScale))return G;if(W=parseFloat(W),Q=parseFloat(Q),nt.disableXAxis||(G.x=(nt.relative?a:0)+W),nt.disableYAxis||(G.y=(nt.relative?o:0)+Q),nt.contain){var K=$f(r),rt=K.elem.width/l,st=K.elem.height/l,mt=rt*tt,Et=st*tt,Nt=(mt-rt)/2,Zt=(Et-st)/2;if(nt.contain==="inside"){var N=(-K.elem.margin.left-K.parent.padding.left+Nt)/tt,le=(K.parent.width-mt-K.parent.padding.left-K.elem.margin.left-K.parent.border.left-K.parent.border.right+Nt)/tt;G.x=Math.max(Math.min(G.x,le),N);var $t=(-K.elem.margin.top-K.parent.padding.top+Zt)/tt,Ht=(K.parent.height-Et-K.parent.padding.top-K.elem.margin.top-K.parent.border.top-K.parent.border.bottom+Zt)/tt;G.y=Math.max(Math.min(G.y,Ht),$t)}else if(nt.contain==="outside"){var N=(-(mt-K.parent.width)-K.parent.padding.left-K.parent.border.left-K.parent.border.right+Nt)/tt,le=(Nt-K.parent.padding.left)/tt;G.x=Math.max(Math.min(G.x,le),N);var $t=(-(Et-K.parent.height)-K.parent.padding.top-K.parent.border.top-K.parent.border.bottom+Zt)/tt,Ht=(Zt-K.parent.padding.top)/tt;G.y=Math.max(Math.min(G.y,Ht),$t)}}return nt.roundPixels&&(G.x=Math.round(G.x),G.y=Math.round(G.y)),G}function f(W,Q){var tt=Ve(Ve({},t),Q),ht={scale:l,opts:tt};if(!(Q!=null&&Q.force)&&tt.disableZoom)return ht;var nt=t.minScale,G=t.maxScale;if(tt.contain){var K=$f(r),rt=K.elem.width/l,st=K.elem.height/l;if(rt>1&&st>1){var mt=K.parent.width-K.parent.border.left-K.parent.border.right,Et=K.parent.height-K.parent.border.top-K.parent.border.bottom,Nt=mt/rt,Zt=Et/st;t.contain==="inside"?G=Math.min(G,Nt,Zt):t.contain==="outside"&&(nt=Math.max(nt,Nt,Zt))}}return ht.scale=Math.min(Math.max(W,nt),G),ht}function p(W,Q,tt,ht){var nt=d(W,Q,l,tt);return a!==nt.x||o!==nt.y?(a=nt.x,o=nt.y,u("panzoompan",nt.opts,ht)):{x:a,y:o,scale:l,isSVG:e,originalEvent:ht}}function m(W,Q,tt){var ht=f(W,Q),nt=ht.opts;if(!(!(Q!=null&&Q.force)&&nt.disableZoom)){W=ht.scale;var G=a,K=o;if(nt.focal){var rt=nt.focal;G=(rt.x/W-rt.x/l+a*W)/W,K=(rt.y/W-rt.y/l+o*W)/W}var st=d(G,K,W,{relative:!1,force:!0});return a=st.x,o=st.y,l=W,u("panzoomzoom",nt,tt)}}function _(W,Q){var tt=Ve(Ve(Ve({},t),{animate:!0}),Q);return m(l*Math.exp((W?1:-1)*tt.step),tt)}function g(W){return _(!0,W)}function y(W){return _(!1,W)}function v(W,Q,tt,ht){var nt=$f(r),G={width:nt.parent.width-nt.parent.padding.left-nt.parent.padding.right-nt.parent.border.left-nt.parent.border.right,height:nt.parent.height-nt.parent.padding.top-nt.parent.padding.bottom-nt.parent.border.top-nt.parent.border.bottom},K=Q.clientX-nt.parent.left-nt.parent.padding.left-nt.parent.border.left-nt.elem.margin.left,rt=Q.clientY-nt.parent.top-nt.parent.padding.top-nt.parent.border.top-nt.elem.margin.top;e||(K-=nt.elem.width/l/2,rt-=nt.elem.height/l/2);var st={x:K/G.width*(G.width*W),y:rt/G.height*(G.height*W)};return m(W,Ve(Ve({},tt),{animate:!1,focal:st}),ht)}function x(W,Q){W.preventDefault();var tt=Ve(Ve(Ve({},t),Q),{animate:!1}),ht=W.deltaY===0&&W.deltaX?W.deltaX:W.deltaY,nt=ht<0?1:-1,G=f(l*Math.exp(nt*tt.step/3),tt).scale;return v(G,W,tt,W)}function E(W){var Q=Ve(Ve(Ve({},t),{animate:!0,force:!0}),W);l=f(Q.startScale,Q).scale;var tt=d(Q.startX,Q.startY,l,Q);return a=tt.x,o=tt.y,u("panzoomreset",Q)}var w,A,P,b,S,I,B=[];function F(W){if(!vM(W.target,t)){Jf(B,W),h=!0,t.handleStartEvent(W),w=a,A=o,c("panzoomstart",{x:a,y:o,scale:l,isSVG:e,originalEvent:W},t);var Q=l_(B);P=Q.clientX,b=Q.clientY,S=l,I=Zf(B)}}function H(W){if(!(!h||w===void 0||A===void 0||P===void 0||b===void 0)){Jf(B,W);var Q=l_(B),tt=B.length>1,ht=l;if(tt){I===0&&(I=Zf(B));var nt=Zf(B)-I;ht=f(nt*t.step/80+S).scale,v(ht,Q,{animate:!1},W)}(!tt||t.pinchAndPan)&&p(w+(Q.clientX-P)/ht,A+(Q.clientY-b)/ht,{animate:!1},W)}}function J(W){B.length===1&&c("panzoomend",{x:a,y:o,scale:l,isSVG:e,originalEvent:W},t),pM(B,W),h&&(h=!1,w=A=P=b=void 0)}var O=!1;function V(){O||(O=!0,Kf("down",t.canvas?i:r,F),Kf("move",document,H,{passive:!0}),Kf("up",document,J,{passive:!0}))}function q(){O=!1,jf("down",t.canvas?i:r,F),jf("move",document,H),jf("up",document,J)}return t.noBind||V(),{bind:V,destroy:q,eventNames:Za,getPan:function(){return{x:a,y:o}},getScale:function(){return l},getOptions:function(){return bM(t)},handleDown:F,handleMove:H,handleUp:J,pan:p,reset:E,resetStyle:n,setOptions:s,setStyle:function(W,Q){return $r(r,W,Q)},zoom:m,zoomIn:g,zoomOut:y,zoomToPoint:v,zoomWithWheel:x}}tp.defaultOptions=c_;var wh=class{constructor(t,e,i={}){this._canvas=t,this._container=e,this._options=i,this._panzoom=null,this._onZoomChangeCb=null,this._isFullscreen=!1,this._boundFullscreenChange=this._onFullscreenChange.bind(this),this._boundPointerUp=()=>{(this._panzoom?this._panzoom.getScale():1)>1.01&&(this._canvas.style.cursor="grab")},this._boundWheelHandler=null,this._init()}_init(){let t=document.createElement("div");t.classList.add("pfo-panzoom-wrapper"),this._canvas.parentNode.insertBefore(t,this._canvas),t.appendChild(this._canvas),this._wrapper=t,this._panzoom=tp(this._canvas,{maxScale:this._options.zoomMax||3,minScale:this._options.zoomMin||1,step:.25,contain:"outside",cursor:"default",touchAction:"none",startScale:this._options.zoom||1}),this._boundWheelHandler=i=>{(i.ctrlKey||i.metaKey)&&(i.preventDefault(),this._panzoom.zoomWithWheel(i))},t.addEventListener("wheel",this._boundWheelHandler,{passive:!1}),this._canvas.addEventListener("panzoomchange",i=>{let n=i.detail.scale;n<=1.01?(this._panzoom.pan(0,0,{animate:!1}),this._canvas.style.cursor="default"):this._canvas.style.cursor="grab",this._onZoomChangeCb&&this._onZoomChangeCb(Math.round(n*100))}),this._canvas.addEventListener("pointerdown",()=>{this._panzoom.getScale()>1.01&&(this._canvas.style.cursor="grabbing")}),document.addEventListener("pointerup",this._boundPointerUp),this._options.enableFullscreen!==!1&&document.addEventListener("fullscreenchange",this._boundFullscreenChange)}onZoomChange(t){this._onZoomChangeCb=t}onFullscreenChange(t){this._onFullscreenChangeCb=t}zoomIn(){this._panzoom.zoomIn()}zoomOut(){this._panzoom.zoomOut()}zoomReset(){this._panzoom.reset({animate:!0})}adjustZoom(t,e){let n=this._panzoom.getScale()*t;e?this._panzoom.zoom(n,{animate:!1,focal:e}):this._panzoom.zoom(n,{animate:!1})}getScale(){return this._panzoom?this._panzoom.getScale():1}toggleFullscreen(){document.fullscreenElement?document.exitFullscreen():this._container.requestFullscreen().catch(t=>{console.warn("Fullscreen failed:",t)})}_onFullscreenChange(){this._isFullscreen=!!document.fullscreenElement,this._onFullscreenChangeCb&&this._onFullscreenChangeCb(this._isFullscreen)}get isFullscreen(){return this._isFullscreen}destroy(){if(this._panzoom&&(this._panzoom.destroy(),this._panzoom=null),this._wrapper&&this._canvas.parentNode===this._wrapper){let t=this._wrapper.parentNode;t&&(t.insertBefore(this._canvas,this._wrapper),t.removeChild(this._wrapper))}this._boundWheelHandler&&this._wrapper&&this._wrapper.removeEventListener("wheel",this._boundWheelHandler),document.removeEventListener("pointerup",this._boundPointerUp),document.removeEventListener("fullscreenchange",this._boundFullscreenChange)}};var gn={first:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="11 17 6 12 11 7"/><polyline points="18 17 13 12 18 7"/></svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>',last:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="13 17 18 12 13 7"/><polyline points="6 17 11 12 6 7"/></svg>',zoomIn:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',zoomOut:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',exitFullscreen:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="10" y1="14" x2="3" y2="21"/><line x1="21" y1="3" x2="14" y2="10"/></svg>'},SM=2e3,Ah=class{constructor(t,e={}){this._container=t,this._options=e,this._el=null,this._pageInput=null,this._totalPagesEl=null,this._zoomEl=null,this._btnFirst=null,this._btnPrev=null,this._btnNext=null,this._btnLast=null,this._btnZoomIn=null,this._btnZoomOut=null,this._btnFullscreen=null,this._btnDownload=null,this._currentPage=1,this._totalPages=1,this._fadeTimer=null,this._visible=!0,this._callbacks={},this._boundInteractionHandler=this._resetFadeTimer.bind(this),e.toolbar!==!1&&this._build()}_build(){let t=document.createElement("div");t.className="pfo-toolbar",t.innerHTML=`
|
|
3851
3851
|
<div class="pfo-toolbar-group">
|
|
3852
3852
|
<button class="pfo-btn pfo-btn-first" title="First page" aria-label="First page">${gn.first}</button>
|
|
3853
3853
|
<button class="pfo-btn pfo-btn-prev" title="Previous page" aria-label="Previous page">${gn.prev}</button>
|