@drincs/pixi-vn 1.3.1 → 1.3.2

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.
@@ -3312,5 +3312,5 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
3312
3312
  u32v[offset + (stride * 3)] = c;
3313
3313
  `,dynamic:false}};});var V8,FI,OI,GI=p(()=>{Rt();ri();jC();V8=new be(0,0,0,0),FI=class $C extends st{constructor(e={}){e={...$C.defaultOptions,...e,dynamicProperties:{...$C.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in Gf){let l=Gf[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return V8}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){e??(e=0),t??(t=this.particleChildren.length);let i=this.particleChildren.splice(e,t-e);return this.onViewUpdate(),i}removeParticleAt(e){let t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};FI.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};OI=FI;});var UI,qC,Ob,NI=p(()=>{Ls();pe();ye();ri();Vx();UI=class LI extends st{constructor(e){e instanceof B&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??ci.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??ci.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??ci.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??ci.defaultOptions.bottomHeight,this._width=t??l.width??ci.defaultOptions.width,this._height=i??l.height??ci.defaultOptions.height,this.allowChildren=false,this.texture=l??LI.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new Ee({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=B.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};UI.defaultOptions={texture:B.EMPTY};qC=UI,Ob=class extends qC{constructor(...e){let t=e[0];t instanceof B&&(F(z,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),t={texture:t,leftWidth:e[1],topHeight:e[2],rightWidth:e[3],bottomHeight:e[4]}),F(z,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function Gb(r){let{text:e,style:t,chars:i}=r,s=t,n=li.getFont(e,s),o=je.graphemeSegmenter(e),a=Tn(o,s,n,true),u=a.scale,l=[],c=[],h=[],d=t.lineHeight?t.lineHeight:n.lineHeight*u,f=0;for(let x of a.lines){if(x.chars.length===0)continue;let _=new q({label:"line"});_.y=f,h.push(_);let g=new q({label:"word"}),m=0;for(let b=0;b<x.chars.length;b++){let v=x.chars[b];if(!v||!n.chars[v])continue;let A=v===" ",E=b===x.chars.length-1,w;i.length>0?(w=i.shift(),w.text=v,w.style=s,w.label=`char-${v}`,w.x=x.charPositions[b]*u-x.charPositions[m]*u):w=new Hn({text:v,style:s,label:`char-${v}`,x:x.charPositions[b]*u-x.charPositions[m]*u}),A||(l.push(w),g.addChild(w)),(A||E)&&g.children.length>0&&(g.x=x.charPositions[m]*u,c.push(g),_.addChild(g),g=new q({label:"word"}),m=b+1);}f+=d;}return {chars:l,lines:h,words:c}}var KC=p(()=>{Dt();bs();xl();Ab();nd();});var Wn,Ub=p(()=>{Dt();ui();Wn=class extends q{constructor(e){let{text:t,style:i,autoSplit:s,lineAnchor:n,wordAnchor:o,charAnchor:a,...u}=e;super(u),this._dirty=false,this._canReuseChars=false,this.chars=[],this.words=[],this.lines=[],this._originalText=t,this._autoSplit=s,this._lineAnchor=n,this._wordAnchor=o,this._charAnchor=a,this.style=i;}split(){let e=this.splitFn();this.chars=e.chars,this.words=e.words,this.lines=e.lines,this.addChild(...this.lines),this.charAnchor=this._charAnchor,this.wordAnchor=this._wordAnchor,this.lineAnchor=this._lineAnchor,this._dirty=false,this._canReuseChars=true;}get text(){return this._originalText}set text(e){this._originalText=e,this.lines.forEach(t=>t.destroy({children:true})),this.lines.length=0,this.words.length=0,this.chars.length=0,this._canReuseChars=false,this.onTextUpdate();}_setOrigin(e,t,i){let s;typeof e=="number"?s={x:e,y:e}:s={x:e.x,y:e.y},t.forEach(n=>{let o=n.getLocalBounds(),a=o.minX+o.width*s.x,u=o.minY+o.height*s.y;n.origin.set(a,u);}),this[i]=e;}get lineAnchor(){return this._lineAnchor}set lineAnchor(e){this._setOrigin(e,this.lines,"_lineAnchor");}get wordAnchor(){return this._wordAnchor}set wordAnchor(e){this._setOrigin(e,this.words,"_wordAnchor");}get charAnchor(){return this._charAnchor}set charAnchor(e){this._setOrigin(e,this.chars,"_charAnchor");}get style(){return this._style}set style(e){e||(e={}),this._style=new Je(e),this.words.forEach(t=>t.destroy()),this.words.length=0,this.lines.forEach(t=>t.destroy()),this.lines.length=0,this._canReuseChars=true,this.onTextUpdate();}onTextUpdate(){this._dirty=true,this._autoSplit&&this.split();}destroy(e){super.destroy(e),this.chars=[],this.words=[],this.lines=[],(typeof e=="boolean"?e:e?.style)&&this._style.destroy(e),this._style=null,this._originalText="";}};});var VI,HI,WI=p(()=>{ui();KC();Ub();VI=class Lb extends Wn{constructor(e){let t={...Lb.defaultOptions,...e};super(t);}static from(e,t){let i={...Lb.defaultOptions,...t,text:e.text,style:new Je(e.style)};return new Lb({...i})}splitFn(){return Gb({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};VI.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};HI=VI;});function H8(r,e,t){switch(r){case "center":return (t-e)/2;case "right":return t-e;case "left":default:return 0}}function zI(r){return r==="\r"||r===`
3314
3314
  `||r===`\r
3315
- `}function W8(r,e,t){let i=[],s=e.lines[0],n="",o=[],a=0;return t.wordWrap=false,r.forEach(u=>{let l=/^\s*$/.test(u),c=zI(u),h=n.length===0&&l;if(l&&!c&&h)return;c||(n+=u);let d=je.measureText(u,t);o.push({char:u,metric:d}),n.length>=s.length&&(i.push({line:n,chars:o,width:o.reduce((f,x)=>f+x.metric.width,0)}),o=[],n="",a++,s=e.lines[a]);}),i}function Nb(r){let{text:e,style:t,chars:i}=r,s=t,n=je.measureText(e,s),o=je.graphemeSegmenter(e),a=W8(o,n,s.clone()),u=s.align,l=n.lineWidths.reduce((g,m)=>Math.max(g,m),0),c=[],h=[],d=[],f=0,x=s.stroke?.width||0,_=s.dropShadow?.distance||0;return a.forEach((g,m)=>{let b=new q({label:`line-${m}`});b.y=f,h.push(b);let v=n.lineWidths[m],S=H8(u,v,l),A=new q({label:"word"});A.x=S,g.chars.forEach((E,w)=>{if(E.metric.width!==0){if(zI(E.char)){S+=E.metric.width-x;return}if(E.char===" ")A.children.length>0&&(d.push(A),b.addChild(A)),S+=E.metric.width+s.letterSpacing-x,A=new q({label:"word"}),A.x=S;else {let M;i.length>0?(M=i.shift(),M.text=E.char,M.style=s,M.setFromMatrix(I.IDENTITY),M.x=S-A.x-_*w):M=new pr({text:E.char,style:s,x:S-A.x-_*w}),c.push(M),A.addChild(M),S+=E.metric.width+s.letterSpacing-x;}}}),A.children.length>0&&(d.push(A),b.addChild(A)),f+=n.lineHeight;}),{chars:c,lines:h,words:d}}var ZC=p(()=>{fe();Dt();bs();If();});var XI,YI,jI=p(()=>{ui();ZC();Ub();XI=class Vb extends Wn{constructor(e){let t={...Vb.defaultOptions,...e};super(t);}static from(e,t){let i={...Vb.defaultOptions,...t,text:e.text,style:new Je(e.style)};return new Vb({...i})}splitFn(){return Nb({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};XI.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};YI=XI;});async function $I(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var qI=p(()=>{});function QC(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=z8[X8++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Se&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];QC(a,e,{...t});}}function JC(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];JC(o,e,{...t,index:n});}}var z8,X8,KI=p(()=>{Qs();z8=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],X8=0;});var ZI={};Wp(ZI,{AbstractBitmapFont:()=>vn,AbstractRenderer:()=>Ni,AbstractSplitText:()=>Wn,AbstractText:()=>$i,AccessibilitySystem:()=>wm,AlphaFilter:()=>pD,AlphaMask:()=>Eo,AlphaMaskPipe:()=>da,AnimatedSprite:()=>Ec,Application:()=>Zd,ApplicationInitHook:()=>ca,Assets:()=>ut,AssetsClass:()=>sf,BLEND_TO_NPM:()=>jm,BUFFER_TYPE:()=>Ga,BackgroundLoader:()=>Kl,BackgroundSystem:()=>u_,Batch:()=>Rh,BatchGeometry:()=>Xu,BatchTextureArray:()=>zu,BatchableGraphics:()=>xs,BatchableHTMLText:()=>_l,BatchableMesh:()=>Fi,BatchableSprite:()=>Vr,BatchableText:()=>ol,Batcher:()=>Qm,BatcherPipe:()=>Gd,BigPool:()=>De,BindGroup:()=>ht,BindGroupSystem:()=>ba,BitmapFont:()=>qa,BitmapFontManager:()=>li,BitmapText:()=>Hn,BitmapTextGraphics:()=>od,BitmapTextPipe:()=>Yo,BlendModeFilter:()=>ie,BlendModePipe:()=>ma,BlurFilter:()=>wf,BlurFilterPass:()=>Sc,Bounds:()=>be,BrowserAdapter:()=>Fm,Buffer:()=>Xe,BufferImageSource:()=>us,BufferResource:()=>Wi,BufferUsage:()=>ne,CLEAR:()=>dt,Cache:()=>me,CanvasObserver:()=>qs,CanvasPool:()=>Qt,CanvasPoolClass:()=>rd,CanvasSource:()=>xt,CanvasTextGenerator:()=>vs,CanvasTextMetrics:()=>je,CanvasTextPipe:()=>No,CanvasTextSystem:()=>Xo,Circle:()=>al,Color:()=>Z,ColorBlend:()=>fd,ColorBurnBlend:()=>pd,ColorDodgeBlend:()=>md,ColorMask:()=>Ao,ColorMaskPipe:()=>fa,ColorMatrixFilter:()=>gb,CompressedSource:()=>Wr,Container:()=>q,Culler:()=>Zy,CullerPlugin:()=>df,CustomRenderPipe:()=>sa,D3D10_RESOURCE_DIMENSION:()=>Wy,D3DFMT:()=>Jt,DATA_URI:()=>eM,DDS:()=>te,DEG_TO_RAD:()=>Zp,DEPRECATED_SCALE_MODES:()=>Of,DEPRECATED_WRAP_MODES:()=>Ff,DOMAdapter:()=>V,DOMContainer:()=>km,DOMPipe:()=>To,DRAW_MODES:()=>$D,DXGI_FORMAT:()=>Hy,DXGI_TO_TEXTURE_FORMAT:()=>Xt,DarkenBlend:()=>gd,DefaultBatcher:()=>Mo,DefaultShader:()=>Ku,DifferenceBlend:()=>xd,DisplacementFilter:()=>yb,DivideBlend:()=>_d,DynamicBitmapFont:()=>sd,Ellipse:()=>ul,EventBoundary:()=>Fu,EventEmitter:()=>de,EventSystem:()=>Ou,EventsTicker:()=>Dr,ExclusionBlend:()=>yd,ExtensionType:()=>y,ExtractSystem:()=>l_,FOURCC_TO_TEXTURE_FORMAT:()=>lf,FederatedContainer:()=>Im,FederatedEvent:()=>Di,FederatedMouseEvent:()=>ti,FederatedPointerEvent:()=>kt,FederatedWheelEvent:()=>Ir,FillGradient:()=>Wt,FillPattern:()=>oi,Filter:()=>St,FilterEffect:()=>Qr,FilterPipe:()=>Qo,FilterSystem:()=>Jo,FontStylePromiseCache:()=>ad,GAUSSIAN_VALUES:()=>Tc,GL_FORMATS:()=>Vl,GL_INTERNAL_FORMAT:()=>XA,GL_TARGETS:()=>zd,GL_TYPES:()=>xe,GL_WRAP_MODES:()=>_E,GenerateTextureSystem:()=>ga,Geometry:()=>Vt,GlBackBufferSystem:()=>N_,GlBatchAdaptor:()=>Oa,GlBuffer:()=>Nl,GlBufferSystem:()=>Ua,GlColorMaskSystem:()=>Na,GlContextSystem:()=>G_,GlEncoderSystem:()=>Va,GlGeometrySystem:()=>La,GlGraphicsAdaptor:()=>ka,GlLimitsSystem:()=>Ha,GlMeshAdaptor:()=>Fa,GlParticleContainerAdaptor:()=>tl,GlParticleContainerPipe:()=>Go,GlProgram:()=>Fe,GlProgramData:()=>zl,GlRenderTarget:()=>Hl,GlRenderTargetAdaptor:()=>Wl,GlRenderTargetSystem:()=>Xa,GlShaderSystem:()=>Ya,GlStateSystem:()=>ay,GlStencilSystem:()=>Wa,GlTexture:()=>Yl,GlTextureSystem:()=>$a,GlUboSystem:()=>za,GlUniformGroupSystem:()=>ja,GlobalUniformSystem:()=>xa,GpuBatchAdaptor:()=>ia,GpuBlendModesToPixi:()=>Gt,GpuBufferSystem:()=>va,GpuColorMaskSystem:()=>Ta,GpuDeviceSystem:()=>Dn,GpuEncoderSystem:()=>Sa,GpuGraphicsAdaptor:()=>ta,GpuGraphicsContext:()=>zh,GpuLimitsSystem:()=>Ea,GpuMeshAdapter:()=>ra,GpuMipmapGenerator:()=>Ll,GpuParticleContainerAdaptor:()=>sl,GpuParticleContainerPipe:()=>Uo,GpuProgram:()=>Oe,GpuRenderTarget:()=>Ol,GpuRenderTargetAdaptor:()=>Gl,GpuRenderTargetSystem:()=>Ma,GpuShaderSystem:()=>Ra,GpuStateSystem:()=>Da,GpuStencilModesToPixi:()=>Hr,GpuStencilSystem:()=>Aa,GpuTextureSystem:()=>Ia,GpuUboSystem:()=>wa,GpuUniformBatchPipe:()=>Pa,Graphics:()=>bn,GraphicsContext:()=>at,GraphicsContextRenderData:()=>Xh,GraphicsContextSystem:()=>pn,GraphicsGpuData:()=>jh,GraphicsPath:()=>Oi,GraphicsPipe:()=>Fo,HTMLText:()=>Pc,HTMLTextPipe:()=>jo,HTMLTextRenderData:()=>Sn,HTMLTextStyle:()=>wc,HTMLTextSystem:()=>$o,HardLightBlend:()=>bd,HardMixBlend:()=>vd,HelloSystem:()=>Rn,IGLUniformData:()=>Y_,ImageSource:()=>Nt,InstructionSet:()=>Ws,KTX:()=>qe,LightenBlend:()=>Td,LinearBurnBlend:()=>Sd,LinearDodgeBlend:()=>Ed,LinearLightBlend:()=>Ad,Loader:()=>Jl,LoaderParserPriority:()=>Ie,LuminosityBlend:()=>Cd,MaskEffectManager:()=>Pu,MaskEffectManagerClass:()=>dh,MaskFilter:()=>Cl,Matrix:()=>I,Mesh:()=>fr,MeshGeometry:()=>ur,MeshGpuData:()=>el,MeshPipe:()=>Oo,MeshPlane:()=>Ib,MeshRope:()=>wI,MeshSimple:()=>Fb,NOOP:()=>xh,NegationBlend:()=>wd,NineSliceGeometry:()=>ci,NineSlicePlane:()=>Ob,NineSliceSprite:()=>qC,NineSliceSpriteGpuData:()=>cd,NineSliceSpritePipe:()=>Zo,NoiseFilter:()=>SD,ObservablePoint:()=>Ee,OverlayBlend:()=>Pd,PI_2:()=>qp,Particle:()=>II,ParticleBuffer:()=>rl,ParticleContainer:()=>OI,ParticleContainerPipe:()=>mn,ParticleShader:()=>il,PerspectiveMesh:()=>bI,PerspectivePlaneGeometry:()=>Mc,PinLightBlend:()=>Bd,PipelineSystem:()=>Ba,PlaneGeometry:()=>Cn,Point:()=>ae,Polygon:()=>xn,Pool:()=>os,PoolGroupClass:()=>ch,PrepareBase:()=>Tb,PrepareQueue:()=>Cc,PrepareSystem:()=>kf,PrepareUpload:()=>Bc,QuadGeometry:()=>vl,RAD_TO_DEG:()=>Kp,Rectangle:()=>ee,RenderContainer:()=>Bb,RenderGroup:()=>Du,RenderGroupPipe:()=>oa,RenderGroupSystem:()=>ua,RenderLayer:()=>fI,RenderTarget:()=>ya,RenderTargetSystem:()=>Fn,RenderTexture:()=>wl,RenderableGCSystem:()=>f_,RendererInitHook:()=>ha,RendererType:()=>Ge,ResizePlugin:()=>bo,Resolver:()=>Ot,RopeGeometry:()=>kb,RoundedRectangle:()=>ll,SCALE_MODES:()=>ZD,STENCIL_MODES:()=>Re,SVGParser:()=>lx,SaturationBlend:()=>Md,SchedulerSystem:()=>_a,ScissorMask:()=>wb,SdfShader:()=>gl,Shader:()=>Ye,ShaderStage:()=>on,ShapePath:()=>fl,SharedRenderPipes:()=>Rl,SharedSystems:()=>Ml,SoftLightBlend:()=>Rd,SplitBitmapText:()=>HI,SplitText:()=>YI,Sprite:()=>Se,SpritePipe:()=>la,Spritesheet:()=>Ch,State:()=>Ne,StencilMask:()=>Co,StencilMaskPipe:()=>pa,SubtractBlend:()=>Dd,SystemRunner:()=>Bn,TEXTURE_FORMAT_BLOCK_SIZE:()=>zy,Text:()=>pr,TextStyle:()=>Je,Texture:()=>B,TextureGCSystem:()=>p_,TextureMatrix:()=>Xs,TexturePool:()=>Ae,TexturePoolClass:()=>_h,TextureSource:()=>ue,TextureStyle:()=>it,TextureUvs:()=>Pb,Ticker:()=>le,TickerListener:()=>$s,TickerPlugin:()=>vo,TilingSprite:()=>Eb,TilingSpriteGpuData:()=>ud,TilingSpritePipe:()=>Ko,TilingSpriteShader:()=>bl,Transform:()=>Ac,Triangle:()=>vb,UNIFORM_TO_ARRAY_SETTERS:()=>sy,UNIFORM_TO_SINGLE_SETTERS:()=>iy,UNIFORM_TYPES_MAP:()=>bg,UNIFORM_TYPES_VALUES:()=>Gh,UPDATE_BLEND:()=>Iu,UPDATE_COLOR:()=>yo,UPDATE_PRIORITY:()=>It,UPDATE_TRANSFORM:()=>OP,UPDATE_VISIBLE:()=>Ys,UboBatch:()=>kl,UboSystem:()=>In,UniformGroup:()=>ce,VERSION:()=>Mn,VideoSource:()=>ds,ViewContainer:()=>st,ViewSystem:()=>x_,ViewableBuffer:()=>kr,VividLightBlend:()=>Id,WGSL_ALIGN_SIZE_DATA:()=>Ca,WGSL_TO_STD40_SIZE:()=>Xd,WRAP_MODES:()=>KD,WebGLRenderer:()=>Kd,WebGPURenderer:()=>Wd,WebWorkerAdapter:()=>cD,WorkerManager:()=>rf,accessibilityTarget:()=>Pm,addBits:()=>Ih,addMaskBounds:()=>Js,addMaskLocalBounds:()=>en,addProgramDefines:()=>rg,alphaFrag:()=>ub,alphaWgsl:()=>Cf,applyMatrix:()=>Ux,applyProjectiveTransformationToPlane:()=>Mb,applyStyleParams:()=>qd,assignWithIgnore:()=>_o,autoDetectEnvironment:()=>qB,autoDetectRenderer:()=>xy,autoDetectSource:()=>c3,basisTranscoderUrls:()=>lc,bgr2rgb:()=>as,bitmapFontCachePlugin:()=>_y,bitmapFontTextParser:()=>ql,bitmapFontXMLParser:()=>Qd,bitmapFontXMLStringParser:()=>Jd,bitmapTextSplit:()=>Gb,blendTemplateFrag:()=>Wx,blendTemplateVert:()=>zx,blendTemplateWgsl:()=>Xx,blockDataMap:()=>Hd,blurTemplateWgsl:()=>fb,boundsPool:()=>Zt,browserExt:()=>zS,buildAdaptiveBezier:()=>hl,buildAdaptiveQuadratic:()=>Jg,buildArc:()=>dl,buildArcTo:()=>tx,buildArcToSvg:()=>rx,buildCircle:()=>fn,buildContextBatches:()=>Hg,buildEllipse:()=>Cg,buildLine:()=>Rg,buildPixelLine:()=>Dg,buildPolygon:()=>Ug,buildRectangle:()=>Lg,buildRoundedRectangle:()=>wg,buildSimpleUvs:()=>Eg,buildTriangle:()=>Ng,buildUvs:()=>Sg,cacheAsTextureMixin:()=>tm,cacheTextureArray:()=>by,calculateProjection:()=>M_,canvasTextSplit:()=>Nb,checkChildrenDidChange:()=>ph,checkDataUrl:()=>lr,checkExtension:()=>$e,checkMaxIfStatementsInShader:()=>Hu,childrenHelperMixin:()=>im,cleanArray:()=>d_,cleanHash:()=>h_,clearList:()=>aa,closePointEps:()=>Pg,collectAllRenderables:()=>nI,collectRenderablesMixin:()=>sm,color32BitToUniform:()=>Nr,colorBit:()=>un,colorBitGl:()=>ln,colorMatrixFilterFrag:()=>mb,colorMatrixFilterWgsl:()=>Pf,colorToUniform:()=>W3,compareModeToGlCompare:()=>fy,compileHighShader:()=>dg,compileHighShaderGl:()=>fg,compileHighShaderGlProgram:()=>Or,compileHighShaderGpuProgram:()=>Fr,compileHooks:()=>kh,compileInputs:()=>Fh,compileOutputs:()=>hg,compileShader:()=>Yd,compute2DProjection:()=>Db,convertFormatIfRequired:()=>iR,convertToList:()=>Ft,copySearchParams:()=>So,createIdFromString:()=>ni,createIndicesForQuads:()=>qh,createLevelBuffers:()=>WM,createLevelBuffersFromKTX:()=>nR,createStringVariations:()=>Om,createTexture:()=>zt,createUboElementsSTD40:()=>V_,createUboElementsWGSL:()=>b_,createUboSyncFunction:()=>Dl,createUboSyncFunctionSTD40:()=>z_,createUboSyncFunctionWGSL:()=>w_,crossOrigin:()=>IA,cullingMixin:()=>$p,curveEps:()=>Bg,defaultFilterVert:()=>Nn,defaultValue:()=>Xl,definedProps:()=>Tt,deprecation:()=>F,detectAvif:()=>Ty,detectBasis:()=>OM,detectCompressed:()=>dR,detectDefaults:()=>Sy,detectMp4:()=>Ey,detectOgv:()=>Ay,detectVideoAlphaMode:()=>Lu,detectWebm:()=>Cy,detectWebp:()=>wy,determineCrossOrigin:()=>FA,displacementFrag:()=>xb,displacementVert:()=>_b,displacementWgsl:()=>Bf,earcut:()=>Og,effectsMixin:()=>nm,ensureAttributes:()=>Fl,ensureIsBuffer:()=>Dh,ensurePrecision:()=>ig,ensureTextOptions:()=>Vn,executeInstructions:()=>na,extensions:()=>N,extractAttributesFromGlProgram:()=>Z_,extractAttributesFromGpuProgram:()=>ag,extractFontFamilies:()=>Cx,extractStructAndGroups:()=>ju,extractSvgUrlId:()=>ed,fastCopy:()=>Bo,findMixin:()=>om,fontStringFromTextStyle:()=>ys,formatShader:()=>ND,fragmentGPUTemplate:()=>mg,fragmentGlTemplate:()=>xg,generateArraySyncSTD40:()=>W_,generateArraySyncWGSL:()=>C_,generateBlurFragSource:()=>cb,generateBlurGlProgram:()=>db,generateBlurProgram:()=>pb,generateBlurVertSource:()=>hb,generateGPULayout:()=>OD,generateGpuLayoutGroups:()=>ug,generateLayout:()=>UD,generateLayoutHash:()=>lg,generateParticleUpdateFunction:()=>Wg,generateProgram:()=>ty,generateShaderSyncCode:()=>X_,generateTextStyleKey:()=>hx,generateTextureBatchBit:()=>cn,generateTextureBatchBitGl:()=>hn,generateTextureMatrix:()=>Vg,generateUniformsSync:()=>ny,getAdjustedBlendModeBlend:()=>si,getAttributeInfoFromFormat:()=>Ht,getBatchSamplersUniformGroup:()=>dn,getBitmapTextLayout:()=>Tn,getCanvasBoundingBox:()=>fx,getCanvasFillStyle:()=>yn,getCanvasTexture:()=>Bl,getDefaultUniformValue:()=>vg,getFastGlobalBounds:()=>rI,getFastGlobalBoundsMixin:()=>um,getFontCss:()=>Bx,getFontFamilyName:()=>EA,getGeometryBounds:()=>Jm,getGlTypeFromFormat:()=>L_,getGlobalBounds:()=>Mi,getGlobalMixin:()=>hm,getGlobalRenderableBounds:()=>Hx,getLocalBounds:()=>Hs,getMaxFragmentPrecision:()=>tg,getMaxTexturesPerBatch:()=>Zm,getOrientationOfPoints:()=>Mg,getPo2TextureFromSource:()=>ml,getResolutionOfUrl:()=>Gn,getSVGUrl:()=>Mx,getSupportedCompressedTextureFormats:()=>oc,getSupportedGPUCompressedTextureFormats:()=>of,getSupportedGlCompressedTextureFormats:()=>nf,getSupportedTextureFormats:()=>Xi,getTemporaryCanvasFromImage:()=>Rx,getTestContext:()=>Vu,getTextureBatchBindGroup:()=>tn,getTextureDefaultMatrix:()=>MI,getTextureFormatFromKTXTexture:()=>aR,getUboData:()=>Q_,getUniformData:()=>J_,getUrlExtension:()=>zv,glFormatToGPUFormat:()=>$y,glUploadBufferImageResource:()=>uy,glUploadCompressedTextureResource:()=>ly,glUploadImageResource:()=>jl,glUploadVideoResource:()=>hy,globalUniformsBit:()=>_g,globalUniformsBitGl:()=>yg,globalUniformsUBOBitGl:()=>E3,gpuFormatToBasisTranscoderFormat:()=>XM,gpuFormatToKTXBasisTranscoderFormat:()=>lR,gpuUploadBufferImageResource:()=>I_,gpuUploadCompressedTextureResource:()=>k_,gpuUploadImageResource:()=>Ul,gpuUploadVideoResource:()=>O_,groupD8:()=>re,hasCachedCanvasTexture:()=>lM,hslWgsl:()=>AD,hslgl:()=>wn,hslgpu:()=>Pn,injectBits:()=>Oh,insertVersion:()=>sg,isMobile:()=>Cm,isPow2:()=>mh,isRenderingToScreen:()=>R_,isSafari:()=>Ex,isSingleItem:()=>hs,isWebGLSupported:()=>Vi,isWebGPUSupported:()=>Hi,ktxTranscoderUrls:()=>hc,loadBasis:()=>VM,loadBasisOnWorker:()=>Vy,loadBitmapFont:()=>yy,loadDDS:()=>jM,loadEnvironmentExtensions:()=>kd,loadFontAsBase64:()=>wx,loadFontCSS:()=>Px,loadImageBitmap:()=>MA,loadJson:()=>Py,loadKTX:()=>qM,loadKTX2:()=>eR,loadKTX2onWorker:()=>jy,loadSVGImage:()=>Dx,loadSvg:()=>Ry,loadTextures:()=>ic,loadTxt:()=>By,loadVideoTextures:()=>Iy,loadWebFont:()=>My,localUniformBit:()=>Ts,localUniformBitGl:()=>An,localUniformBitGroup2:()=>kx,localUniformMSDFBit:()=>xx,localUniformMSDFBitGl:()=>_x,log2:()=>PP,logDebugTexture:()=>$I,logProgramError:()=>ey,logRenderGroupScene:()=>JC,logScene:()=>QC,mSDFBit:()=>yx,mSDFBitGl:()=>bx,mapFormatToGlFormat:()=>py,mapFormatToGlInternalFormat:()=>my,mapFormatToGlType:()=>gy,mapGlToVertexFormat:()=>q_,mapSize:()=>XD,mapType:()=>jd,mapWebGLBlendModesToPixi:()=>oy,maskFrag:()=>o_,maskVert:()=>a_,maskWgsl:()=>Ud,matrixPool:()=>rt,measureHtmlText:()=>yl,measureMixin:()=>fm,migrateFragmentFromV7toV8:()=>WD,mipmapScaleModeToGlFilter:()=>dy,multiplyColors:()=>Vs,multiplyHexColors:()=>Mu,nextPow2:()=>Jr,noiseFrag:()=>bb,noiseWgsl:()=>Mf,nonCompressedFormats:()=>NA,normalizeExtensionPriority:()=>Au,onRenderMixin:()=>pm,parseDDS:()=>Xy,parseFunctionBody:()=>eI,parseKTX:()=>Yy,parseSVGDefinitions:()=>ax,parseSVGFloatAttribute:()=>Ue,parseSVGPath:()=>$g,parseSVGStyle:()=>td,particleData:()=>Gf,particlesFrag:()=>zg,particlesVert:()=>Xg,particlesWgsl:()=>Kh,path:()=>ke,pointInTriangle:()=>Rf,preloadVideo:()=>kA,removeItems:()=>wu,removeStructAndGroupDuplicates:()=>cg,resetUids:()=>vP,resolveCharacters:()=>Tx,resolveCompressedTextureUrl:()=>hR,resolveJsonUrl:()=>Fy,resolveTextureUrl:()=>sc,resourceToTexture:()=>eT,roundPixelsBit:()=>Gr,roundPixelsBitGl:()=>Ur,roundedShapeArc:()=>ix,roundedShapeQuadraticCurve:()=>sx,sayHello:()=>c_,scaleModeToGlFilter:()=>$d,setBasisTranscoderPath:()=>LM,setKTXTranscoderPath:()=>QM,setPositions:()=>Gx,setProgramName:()=>ng,setUvs:()=>Lx,shapeBuilders:()=>Ju,sortMixin:()=>mm,spritesheetAsset:()=>Um,squaredDistanceToLineSegment:()=>gn,stripVersion:()=>og,styleAttributes:()=>ux,testImageFormat:()=>Zl,testVideoFormat:()=>zi,textStyleToCSS:()=>Cb,textureBit:()=>Kx,textureBitGl:()=>Zx,textureFrom:()=>tT,tilingBit:()=>Fx,tilingBitGl:()=>Ox,toFillStyle:()=>ai,toLocalGlobalMixin:()=>gm,toStrokeStyle:()=>_n,transformVertices:()=>Lh,triangulateWithHoles:()=>Qu,uboSyncFunctionsSTD40:()=>Nd,uboSyncFunctionsWGSL:()=>E_,uid:()=>se,uniformParsers:()=>hi,unpremultiplyAlpha:()=>vM,unsafeEvalSupported:()=>Tl,updateLocalTransform:()=>aI,updateQuadBounds:()=>Uu,updateRenderGroupTransform:()=>i1,updateRenderGroupTransforms:()=>Od,updateTextBounds:()=>Lo,updateTransformAndChildren:()=>r_,updateTransformBackwards:()=>Bu,updateWorldTransform:()=>lI,v8_0_0:()=>z,v8_3_4:()=>Jp,validFormats:()=>dc,validateRenderables:()=>i_,vertexGPUTemplate:()=>pg,vertexGlTemplate:()=>gg,vkFormatToGPUFormat:()=>qy,warn:()=>G,webworkerExt:()=>XS,wrapModeToGlAddress:()=>$l});var Te=p(()=>{SB();AB();C();C();zm();Lm();Rv();Dv();PB();BB();MB();RB();DB();IB();kB();FB();OB();GB();UB();LB();NB();VB();HB();WB();zB();XB();YB();jB();$B();BM();Iv();kv();FM();fA();Ii();pA();mA();gA();xA();_A();yA();bA();vy();Ql();vA();yr();TA();SA();AA();CA();Dy();OA();Ss();BA();GA();ky();Zs();On();Sr();Gu();Gm();Wv();Eh();ct();GM();HM();zM();YM();VA();HA();WA();$M();zA();KM();jA();YA();tR();sR();oR();uR();ZA();cR();$A();QA();qA();fR();JA();tC();pR();nv();Em();r3();Vv();ve();ZS();Hv();hD();Gv();Dm();Bm();yh();Nv();vh();Mm();Rm();jS();$S();qS();CD();xC();_C();TC();AC();CC();Af();wC();PC();BC();MC();RC();c1();h1();d1();et();hd();dd();mD();_D();EC();lb();yC();vC();bC();SC();yD();bD();ED();Li();hh();LS();HS();f1();gh();fe();Qp();Ru();qg();Ls();or();DC();I2();k2();F2();nt();O2();wD();IC();GC();FD();VC();dE();Km();iT();GD();LD();Bh();e1();oT();l1();lT();sT();Tg();NT();ms();IT();wT();PT();BT();MT();VD();RT();kT();$u();qu();FT();qo();gs();Qx();jv();m1();$v();g1();hv();HD();qv();x1();wh();Ph();oA();fE();pE();mE();ea();xE();bE();yE();TE();SE();EE();AE();ME();CE();BE();RE();DE();IE();Uh();ar();kE();HE();XE();zD();FE();j_();P_();GE();VE();hT();qm();UE();LE();NE();YD();K_();dT();fT();pT();mT();gT();H_();PE();wE();zE();WE();$E();YE();U_();qE();sA();KE();ZE();cy();QE();eA();UA();tA();rA();iA();JE();TM();nA();G1();U1();j1();L1();N1();V1();H1();W1();Y1();$1();q1();K1();Q1();J1();eE();fs();br();tE();v_();X1();bT();vT();z1();ST();ET();AT();rE();iE();B_();uE();sE();nE();F_();oE();LA();aE();lE();y1();b1();ps();Vd();ki();Ym();S1();A1();qD();sn();HT();aT();nn();uT();WT();xm();C1();Z1();m_();D_();w1();TT();Lr();UT();y_();ot();S_();LT();A_();T_();B1();rn();Nu();Tr();Sl();__();jx();Wo();QD();D1();E1();ym();wo();nc();Po();gt();Wm();pe();k1();bm();ei();Ri();JD();g_();Ly();ac();rT();Yu();tI();O1();vr();v2();T2();S2();Rt();iI();fo();fh();NS();Ns();uv();lv();cv();dv();fv();pv();dm();gv();xv();_v();yv();Dt();t1();sI();Tv();r1();o1();vm();mv();t_();oI();zs();e_();cm();lm();uI();s1();cI();n1();cE();ko();QS();Ag();Qg();N2();ex();V2();z2();zT();YT();jT();ZT();QT();JT();M3();Io();Zh();gx();Ho();Yh();f2();nx();X2();Y2();j2();ox();D2();q2();K2();$2();i2();cx();r2();XT();Gg();pI();vI();zC();HC();WC();TI();ld();PI();BI();XC();hE();JS();$h();RI();Za();En();m2();x2();C2();A2();w2();kI();b2();GI();Yg();jC();E2();_2();y2();kC();Vx();NI();GS();wS();MS();OC();FS();IS();RS();DS();kS();nl();Qs();a1();vx();lA();cA();hA();dA();uA();xl();Ab();fS();cS();KC();nd();hS();mS();NC();gS();Ax();LC();AS();_S();vS();TS();SS();yS();bS();ES();Ix();UC();Ub();WI();jI();Df();B2();mx();bs();M2();iS();id();px();lS();nS();oS();If();ui();ZC();Q2();dx();jg();ri();Xv();Yv();js();ls();Av();Vm();Bv();xS();El();Al();Yx();eS();s_();Mt();M1();rm();mt();Nm();Xm();n_();ye();qI();KI();ge();vv();FC();ef();Ks();em();Bi();P1();KT();N.add(zS,XS);});var ak=Pi((Qb,ok)=>{(function(r,e){typeof Qb=="object"?ok.exports=Qb=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(Qb,function(){var r=r||function(e,t){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof K0=="function")try{i=K0("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function m(){}return function(b){var v;return m.prototype=b,v=new m,m.prototype=null,v}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(m){var b=n(this);return m&&b.mixIn(m),(!b.hasOwnProperty("init")||this.init===b.init)&&(b.init=function(){b.$super.init.apply(this,arguments);}),b.init.prototype=b,b.$super=this,b},create:function(){var m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var b in m)m.hasOwnProperty(b)&&(this[b]=m[b]);m.hasOwnProperty("toString")&&(this.toString=m.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(m,b){m=this.words=m||[],b!=t?this.sigBytes=b:this.sigBytes=m.length*4;},toString:function(m){return (m||h).stringify(this)},concat:function(m){var b=this.words,v=m.words,S=this.sigBytes,A=m.sigBytes;if(this.clamp(),S%4)for(var E=0;E<A;E++){var w=v[E>>>2]>>>24-E%4*8&255;b[S+E>>>2]|=w<<24-(S+E)%4*8;}else for(var M=0;M<A;M+=4)b[S+M>>>2]=v[M>>>2];return this.sigBytes+=A,this},clamp:function(){var m=this.words,b=this.sigBytes;m[b>>>2]&=4294967295<<32-b%4*8,m.length=e.ceil(b/4);},clone:function(){var m=u.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var b=[],v=0;v<m;v+=4)b.push(s());return new l.init(b,m)}}),c=o.enc={},h=c.Hex={stringify:function(m){for(var b=m.words,v=m.sigBytes,S=[],A=0;A<v;A++){var E=b[A>>>2]>>>24-A%4*8&255;S.push((E>>>4).toString(16)),S.push((E&15).toString(16));}return S.join("")},parse:function(m){for(var b=m.length,v=[],S=0;S<b;S+=2)v[S>>>3]|=parseInt(m.substr(S,2),16)<<24-S%8*4;return new l.init(v,b/2)}},d=c.Latin1={stringify:function(m){for(var b=m.words,v=m.sigBytes,S=[],A=0;A<v;A++){var E=b[A>>>2]>>>24-A%4*8&255;S.push(String.fromCharCode(E));}return S.join("")},parse:function(m){for(var b=m.length,v=[],S=0;S<b;S++)v[S>>>2]|=(m.charCodeAt(S)&255)<<24-S%4*8;return new l.init(v,b)}},f=c.Utf8={stringify:function(m){try{return decodeURIComponent(escape(d.stringify(m)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(m){return d.parse(unescape(encodeURIComponent(m)))}},x=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(m){typeof m=="string"&&(m=f.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes;},_process:function(m){var b,v=this._data,S=v.words,A=v.sigBytes,E=this.blockSize,w=E*4,M=A/w;m?M=e.ceil(M):M=e.max((M|0)-this._minBufferSize,0);var P=M*E,U=e.min(P*4,A);if(P){for(var k=0;k<P;k+=E)this._doProcessBlock(S,k);b=S.splice(0,P),v.sigBytes-=U;}return new l.init(b,U)},clone:function(){var m=u.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});a.Hasher=x.extend({cfg:u.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset();},reset:function(){x.reset.call(this),this._doReset();},update:function(m){return this._append(m),this._process(),this},finalize:function(m){m&&this._append(m);var b=this._doFinalize();return b},blockSize:512/32,_createHelper:function(m){return function(b,v){return new m.init(v).finalize(b)}},_createHmacHelper:function(m){return function(b,v){return new g.HMAC.init(m,v).finalize(b)}}});var g=o.algo={};return o}(Math);return r});});var lk=Pi((Jb,uk)=>{(function(r,e){typeof Jb=="object"?uk.exports=Jb=e(ak()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(Jb,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],d=c[1],f=c[2],x=c[3],_=c[4],g=0;g<80;g++){if(g<16)o[g]=u[l+g]|0;else {var m=o[g-3]^o[g-8]^o[g-14]^o[g-16];o[g]=m<<1|m>>>31;}var b=(h<<5|h>>>27)+_+o[g];g<20?b+=(d&f|~d&x)+1518500249:g<40?b+=(d^f^x)+1859775393:g<60?b+=(d&f|d&x|f&x)-1894007588:b+=(d^f^x)-899497514,_=x,x=f,f=d<<30|d>>>2,d=h,h=b;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+f|0,c[3]=c[3]+x|0,c[4]=c[4]+_|0;},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,h=u.sigBytes*8;return l[h>>>5]|=128<<24-h%32,l[(h+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(h+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});Te();var qi={};Wp(qi,{DistortionFilter:()=>Hb,EqualizerFilter:()=>zr,Filter:()=>_t,MonoFilter:()=>Wb,ReverbFilter:()=>zb,StereoFilter:()=>Xb,StreamFilter:()=>Yb,TelephoneFilter:()=>jb});var QI;function JI(r){return QI=r,r}function Ce(){return QI}var _t=class{constructor(e,t){this.init(e,t);}init(e,t){this.destination=e,this.source=t||e;}connect(e){this.source?.connect(e);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var Hb=class extends _t{constructor(e=0){let t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Ce().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var ft=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Ce().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var we=class extends _t{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:we.F32,type:"lowshelf",gain:r},{f:we.F64,type:"peaking",gain:e},{f:we.F125,type:"peaking",gain:t},{f:we.F250,type:"peaking",gain:i},{f:we.F500,type:"peaking",gain:s},{f:we.F1K,type:"peaking",gain:n},{f:we.F2K,type:"peaking",gain:o},{f:we.F4K,type:"peaking",gain:a},{f:we.F8K,type:"peaking",gain:u},{f:we.F16K,type:"highshelf",gain:l}];Ce().useLegacy||(c=h.map(d=>{let f=Ce().context.audioContext.createBiquadFilter();return f.type=d.type,ft.setParamValue(f.Q,1),f.frequency.value=d.f,ft.setParamValue(f.gain,d.gain),f})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let f=this.bands[d];d>0&&this.bands[d-1].connect(f),this.bandsMap[f.frequency.value]=f;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);ft.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(we.F32,r);}get f32(){return this.getGain(we.F32)}set f64(r){this.setGain(we.F64,r);}get f64(){return this.getGain(we.F64)}set f125(r){this.setGain(we.F125,r);}get f125(){return this.getGain(we.F125)}set f250(r){this.setGain(we.F250,r);}get f250(){return this.getGain(we.F250)}set f500(r){this.setGain(we.F500,r);}get f500(){return this.getGain(we.F500)}set f1k(r){this.setGain(we.F1K,r);}get f1k(){return this.getGain(we.F1K)}set f2k(r){this.setGain(we.F2K,r);}get f2k(){return this.getGain(we.F2K)}set f4k(r){this.setGain(we.F4K,r);}get f4k(){return this.getGain(we.F4K)}set f8k(r){this.setGain(we.F8K,r);}get f8k(){return this.getGain(we.F8K)}set f16k(r){this.setGain(we.F16K,r);}get f16k(){return this.getGain(we.F16K)}reset(){this.bands.forEach(r=>{ft.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},zr=we;zr.F32=32;zr.F64=64;zr.F125=125;zr.F250=250;zr.F500=500;zr.F1K=1e3;zr.F2K=2e3;zr.F4K=4e3;zr.F8K=8e3;zr.F16K=16e3;var Wb=class extends _t{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context;t=i.createChannelSplitter(),e=i.createChannelMerger(),e.connect(t);}super(e,t),this._merger=e;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var zb=class extends _t{constructor(e=3,t=2,i=false){super(null),this._seconds=this._clamp(e,1,50),this._decay=this._clamp(t,0,100),this._reverse=i,this._rebuild();}_clamp(e,t,i){return Math.min(i,Math.max(t,e))}get seconds(){return this._seconds}set seconds(e){this._seconds=this._clamp(e,1,50),this._rebuild();}get decay(){return this._decay}set decay(e){this._decay=this._clamp(e,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(e){this._reverse=e,this._rebuild();}_rebuild(){if(Ce().useLegacy)return;let{audioContext:e}=Ce().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var Xb=class extends _t{constructor(e=0){let t,i,s;if(!Ce().useLegacy){let{audioContext:n}=Ce().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?ft.setParamValue(this._stereo.pan,e):this._panner&&this._panner.setPosition(e,0,1-Math.abs(e));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var Yb=class extends _t{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context;e=i.createMediaStreamDestination(),t=i.createMediaStreamSource(e.stream);}super(e,t),this._stream=e?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var jb=class extends _t{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",ft.setParamValue(s.frequency,2e3),n.type="lowpass",ft.setParamValue(n.frequency,2e3),o.type="highpass",ft.setParamValue(o.frequency,500),a.type="highpass",ft.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};Te();var Uf=class extends de{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};Te();var Y8=0,ew=class extends de{constructor(r){super(),this.id=Y8++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-ew.PADDING),this._end=Math.min(this._end+ew.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),le.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){le.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){le.shared.remove(this._onUpdate,this),this.removeAllListeners();let r=this._source;r&&(r.onended=null,r.onplay=null,r.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},$b=ew;$b.PADDING=.1;Te();var Lf=class extends de{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new $b(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};Te();var Nf=class{constructor(e,t){this.parent=e,Object.assign(this,t),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(e){return this.parent.play({complete:e,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var Qa=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],tw=["audio/mpeg","audio/ogg"],Ja={};function ek(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;Qa.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(Ja,i);}ek();Te();Te();var $8=0,Vf=class extends de{constructor(e){super(),this.id=$8++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);ft.setParamValue(this._gain.gain,n*s*i),ft.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){le.shared.remove(this._updateListener,this),e&&le.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var eu=class{constructor(e,t){this._output=t,this._input=e;}get destination(){return this._input}get filters(){return this._filters}set filters(e){if(this._filters&&(this._filters.forEach(t=>{t&&t.disconnect();}),this._filters=null,this._input.connect(this._output)),e&&e.length){this._filters=e.slice(0),this._input.disconnect();let t=null;e.forEach(i=>{t===null?this._input.connect(i.destination):t.connect(i.destination),t=i;}),t.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var tk=class extends eu{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(tk.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let r=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=r.buffer,ft.setParamValue(e.playbackRate,r.playbackRate.value),e.loop=r.loop;let t=this.context.audioContext.createGain();return e.connect(t),t.connect(this.destination),{source:e,gain:t}}get bufferSize(){return this.script.bufferSize}},qb=tk;qb.BUFFER_SIZE=0;var tu=class{init(e){this.parent=e,this._nodes=new qb(this.context),this._source=this._nodes.bufferSource,this.source=e.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null,this.source=null;}create(){return new Vf(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await V.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var Rc=class{static from(r){let e={};typeof r=="string"?e.url=r:r instanceof ArrayBuffer||r instanceof AudioBuffer||r instanceof HTMLAudioElement?e.source=r:Array.isArray(r)?e.url=r:e=r,e={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...e},Object.freeze(e);let t=Ce().useLegacy?new Lf:new tu;return new Rc(t,e)}constructor(r,e){this.media=r,this.options=e,this._instances=[],this._sprites={},this.media.init(this);let t=e.complete;this._autoPlayOptions=t?{complete:t}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=Array.isArray(e.url)?this.preferUrl(e.url):e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded);}preferUrl(r){let[e]=r.map(t=>({url:t,ext:ke.extname(t).slice(1)})).filter(({ext:t})=>Ja[t]).sort((t,i)=>Qa.indexOf(t.ext)-Qa.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Ce().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new Nf(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(Rc._pool.length>0){let r=Rc._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Rc._pool.indexOf(r)<0&&Rc._pool.push(r);}},zn=Rc;zn._pool=[];Te();var Dc=class r extends eu{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new de,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var Kb=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new Dc),this._htmlAudioContext=new Uf,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(e){this.useLegacy||(this._context.filters=e);}get supported(){return Dc.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof zn)return this._sounds[e]=t,t;let i=this._getOptions(t),s=zn.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};Te();Te();var rk=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=ke.basename(e,ke.extname(e))),t},ik={extension:y.Asset,detection:{test:async()=>true,add:async r=>[...r,...Qa.filter(e=>Ja[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[y.LoadParser],priority:Ie.High},test(r){let e=ke.extname(r).slice(1);return !!Ja[e]||tw.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>zn.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Ce().add(rk(e),t),t},async unload(r,e){Ce().remove(rk(e));}}};N.add(ik);JI(new Kb);var Hf="repeat";({DistortionFilter:qi.DistortionFilter,EqualizerFilter:qi.EqualizerFilter,MonoFilter:qi.MonoFilter,ReverbFilter:qi.ReverbFilter,StereoFilter:qi.StereoFilter,StreamFilter:qi.StreamFilter,TelephoneFilter:qi.TelephoneFilter});var sk=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],fi="__game_layer__",Ic="Container",Zb="ImageContainer",rw="Image",kc="Sprite",Fc="Text",iw="Video";var L;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(L||(L={}));function Ut(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw L.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function nk(r){var e;let t={importPixi:false,...r};t.app&&(t.renderer=t.app.renderer,t.stage=t.app.stage),t.importPixi&&!t.pixi&&(t.pixi=await Promise.resolve().then(()=>(Te(),ZI))),window.__PIXI_DEVTOOLS__={...window.__PIXI_DEVTOOLS__||{},app:t.app,stage:t.stage,renderer:t.renderer,extensions:[...((e=window.__PIXI_DEVTOOLS__)==null?void 0:e.extensions)||[],...t.extensions||[]],plugins:{}};}var hk=zp(lk());Te();var Z8={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Pe||r instanceof er||r instanceof Le},testProp(r){switch(r){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof Pe||r instanceof er||r instanceof Le)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "percentageX":r.percentageX=t/100;break;case "percentageY":r.percentageY=t/100;break}},getProperties(r){return [{value:r.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:r.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:r.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},ck=Z8;function Q8(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var X=class X{constructor(){}static get app(){if(!X._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return X._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(fi);return e||(e=new q,e.label=fi,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return X.canvasWidth=t,X.canvasHeight=i,X._app=new Zd,X.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=X.app,extensions:a=[],...u}=n||{};nk({app:o,extensions:[ck,...a],...u}),X._isInitialized=true,X.addCanvasIntoHTMLElement(e),window.addEventListener("resize",X.resize),X.resize(),X.gameLayer;})}static addCanvasIntoHTMLElement(e){X._isInitialized?e.appendChild(X.app.canvas):L.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return X.htmlLayers.push(s),X.resize(),n}static removeHtmlLayer(e){let t=X.htmlLayers.find(i=>i.id===e);t&&(t.remove(),X.htmlLayers=X.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return X.htmlLayers.find(t=>t.id===e)}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/X.canvasWidth,t/X.canvasHeight)}static get screenWidth(){return Math.floor(X.screenScale*X.canvasWidth)}static get screenHeight(){return Math.floor(X.screenScale*X.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-X.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-X.screenHeight)/2}static async resize(){await Q8(async()=>{if(X._isInitialized){let i=X.app.canvas.style;i.width=`${X.screenWidth}px`,i.height=`${X.screenHeight}px`,i.marginLeft=`${X.horizontalMargin}px`,i.marginRight=`${X.horizontalMargin}px`,i.marginTop=`${X.verticalMargin}px`,i.marginBottom=`${X.verticalMargin}px`;}let t=X.htmlLayers.map(i=>{i.style.width=`${X.screenWidth}px`,i.style.height=`${X.screenHeight}px`,i.style.marginLeft=`${X.horizontalMargin}px`,i.style.marginRight=`${X.horizontalMargin}px`,i.style.marginTop=`${X.verticalMargin}px`,i.style.marginBottom=`${X.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return X.gameLayer.children.filter(e=>e.label).sort((e,t)=>X.gameLayer.getChildIndex(e)-X.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(X._currentTickers).filter(([e,t])=>!t.createdByTicketSteps).map(([e,t])=>[e,{id:t.ticker.id,args:t.ticker.args,canvasElementAliases:t.ticker.canvasElementAliases,priority:t.ticker.priority,duration:t.ticker.duration,paused:t.ticker.paused}]))}static generateTickerId(e){try{return (0,hk.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),X._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),X._currentTickersTimeouts[e]&&delete X._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),X.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(X._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&X.removeTickerTimeout(i);}else X._currentTickersTimeouts[i].aliases=n;});}};O(X,"_app"),O(X,"htmlLayers",[]),O(X,"canvasWidth",300),O(X,"canvasHeight",300),O(X,"_isInitialized",false),O(X,"_currentTickers",{}),O(X,"_currentTickersSequence",{}),O(X,"_currentTickersTimeouts",{}),O(X,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),O(X,"_tickersOnPause",{});var R=X;Te();var Oc=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,mk=new Set,sw=typeof process=="object"&&process?process:{},gk=(r,e,t,i)=>{typeof sw.emitWarning=="function"?sw.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},r0=globalThis.AbortController,dk=globalThis.AbortSignal;if(typeof r0>"u"){dk=class{constructor(){O(this,"onabort");O(this,"_onabort",[]);O(this,"reason");O(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},r0=class{constructor(){O(this,"signal",new dk);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=sw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,gk("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var J8=r=>!mk.has(r),Xn=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),xk=r=>Xn(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Gc:null:null,Gc=class extends Array{constructor(e){super(e),this.fill(0);}},Uc,ru=class ru{constructor(e,t){O(this,"heap");O(this,"length");if(!T(ru,Uc))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=xk(e);if(!t)return [];K(ru,Uc,true);let i=new ru(e,t);return K(ru,Uc,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};Uc=new WeakMap,_e(ru,Uc,false);var nw=ru,fk,pk,pi,Er,mi,iu,gi,Lc,Nc,yt,xi,pt,He,oe,tr,Ar,jt,Ct,_i,wt,yi,bi,Cr,vi,qn,rr,Vc,H,ow,su,ws,zf,wr,_k,nu,Hc,Xf,Yn,jn,aw,e0,t0,Ve,uw,Wf,$n,lw,cw=class cw{constructor(e){_e(this,H);_e(this,pi);_e(this,Er);_e(this,mi);_e(this,iu);_e(this,gi);_e(this,Lc);_e(this,Nc);O(this,"ttl");O(this,"ttlResolution");O(this,"ttlAutopurge");O(this,"updateAgeOnGet");O(this,"updateAgeOnHas");O(this,"allowStale");O(this,"noDisposeOnSet");O(this,"noUpdateTTL");O(this,"maxEntrySize");O(this,"sizeCalculation");O(this,"noDeleteOnFetchRejection");O(this,"noDeleteOnStaleGet");O(this,"allowStaleOnFetchAbort");O(this,"allowStaleOnFetchRejection");O(this,"ignoreFetchAbort");_e(this,yt);_e(this,xi);_e(this,pt);_e(this,He);_e(this,oe);_e(this,tr);_e(this,Ar);_e(this,jt);_e(this,Ct);_e(this,_i);_e(this,wt);_e(this,yi);_e(this,bi);_e(this,Cr);_e(this,vi);_e(this,qn);_e(this,rr);_e(this,Vc);_e(this,su,()=>{});_e(this,ws,()=>{});_e(this,zf,()=>{});_e(this,wr,()=>false);_e(this,nu,e=>{});_e(this,Hc,(e,t,i)=>{});_e(this,Xf,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});O(this,fk,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:f,maxSize:x=0,maxEntrySize:_=0,sizeCalculation:g,fetchMethod:m,memoMethod:b,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:E,ignoreFetchAbort:w}=e;if(t!==0&&!Xn(t))throw new TypeError("max option must be a nonnegative integer");let M=t?xk(t):Array;if(!M)throw new Error("invalid max value: "+t);if(K(this,pi,t),K(this,Er,x),this.maxEntrySize=_||T(this,Er),this.sizeCalculation=g,this.sizeCalculation){if(!T(this,Er)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(K(this,Nc,b),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(K(this,Lc,m),K(this,qn,!!m),K(this,pt,new Map),K(this,He,new Array(t).fill(void 0)),K(this,oe,new Array(t).fill(void 0)),K(this,tr,new M(t)),K(this,Ar,new M(t)),K(this,jt,0),K(this,Ct,0),K(this,_i,nw.create(t)),K(this,yt,0),K(this,xi,0),typeof l=="function"&&K(this,mi,l),typeof c=="function"&&K(this,iu,c),typeof h=="function"?(K(this,gi,h),K(this,wt,[])):(K(this,gi,void 0),K(this,wt,void 0)),K(this,vi,!!T(this,mi)),K(this,Vc,!!T(this,iu)),K(this,rr,!!T(this,gi)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!w,this.maxEntrySize!==0){if(T(this,Er)!==0&&!Xn(T(this,Er)))throw new TypeError("maxSize must be a positive integer if specified");if(!Xn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Y(this,H,_k).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Xn(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!Xn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Y(this,H,ow).call(this);}if(T(this,pi)===0&&this.ttl===0&&T(this,Er)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!T(this,pi)&&!T(this,Er)){let P="LRU_CACHE_UNBOUNDED";J8(P)&&(mk.add(P),gk("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,cw));}}static unsafeExposeInternals(e){return {starts:T(e,bi),ttls:T(e,Cr),sizes:T(e,yi),keyMap:T(e,pt),keyList:T(e,He),valList:T(e,oe),next:T(e,tr),prev:T(e,Ar),get head(){return T(e,jt)},get tail(){return T(e,Ct)},free:T(e,_i),isBackgroundFetch:t=>{var i;return Y(i=e,H,Ve).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return Y(o=e,H,t0).call(o,t,i,s,n)},moveToTail:t=>{var i;return Y(i=e,H,Wf).call(i,t)},indexes:t=>{var i;return Y(i=e,H,Yn).call(i,t)},rindexes:t=>{var i;return Y(i=e,H,jn).call(i,t)},isStale:t=>{var i;return T(i=e,wr).call(i,t)}}}get max(){return T(this,pi)}get maxSize(){return T(this,Er)}get calculatedSize(){return T(this,xi)}get size(){return T(this,yt)}get fetchMethod(){return T(this,Lc)}get memoMethod(){return T(this,Nc)}get dispose(){return T(this,mi)}get onInsert(){return T(this,iu)}get disposeAfter(){return T(this,gi)}getRemainingTTL(e){return T(this,pt).has(e)?1/0:0}*entries(){for(let e of Y(this,H,Yn).call(this))T(this,oe)[e]!==void 0&&T(this,He)[e]!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield [T(this,He)[e],T(this,oe)[e]]);}*rentries(){for(let e of Y(this,H,jn).call(this))T(this,oe)[e]!==void 0&&T(this,He)[e]!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield [T(this,He)[e],T(this,oe)[e]]);}*keys(){for(let e of Y(this,H,Yn).call(this)){let t=T(this,He)[e];t!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield t);}}*rkeys(){for(let e of Y(this,H,jn).call(this)){let t=T(this,He)[e];t!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield t);}}*values(){for(let e of Y(this,H,Yn).call(this))T(this,oe)[e]!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield T(this,oe)[e]);}*rvalues(){for(let e of Y(this,H,jn).call(this))T(this,oe)[e]!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield T(this,oe)[e]);}[(pk=Symbol.iterator,fk=Symbol.toStringTag,pk)](){return this.entries()}find(e,t={}){for(let i of Y(this,H,Yn).call(this)){let s=T(this,oe)[i],n=Y(this,H,Ve).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,T(this,He)[i],this))return this.get(T(this,He)[i],t)}}forEach(e,t=this){for(let i of Y(this,H,Yn).call(this)){let s=T(this,oe)[i],n=Y(this,H,Ve).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,He)[i],this);}}rforEach(e,t=this){for(let i of Y(this,H,jn).call(this)){let s=T(this,oe)[i],n=Y(this,H,Ve).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,He)[i],this);}}purgeStale(){let e=false;for(let t of Y(this,H,jn).call(this,{allowStale:true}))T(this,wr).call(this,t)&&(Y(this,H,$n).call(this,T(this,He)[t],"expire"),e=true);return e}info(e){let t=T(this,pt).get(e);if(t===void 0)return;let i=T(this,oe)[t],s=Y(this,H,Ve).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(T(this,Cr)&&T(this,bi)){let o=T(this,Cr)[t],a=T(this,bi)[t];if(o&&a){let u=o-(Oc.now()-a);n.ttl=u,n.start=Date.now();}}return T(this,yi)&&(n.size=T(this,yi)[t]),n}dump(){let e=[];for(let t of Y(this,H,Yn).call(this,{allowStale:true})){let i=T(this,He)[t],s=T(this,oe)[t],n=Y(this,H,Ve).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(T(this,Cr)&&T(this,bi)){o.ttl=T(this,Cr)[t];let a=Oc.now()-T(this,bi)[t];o.start=Math.floor(Date.now()-a);}T(this,yi)&&(o.size=T(this,yi)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=Oc.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,f,x,_;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=T(this,Xf).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),Y(this,H,$n).call(this,e,"set"),this;let h=T(this,yt)===0?void 0:T(this,pt).get(e);if(h===void 0)h=T(this,yt)===0?T(this,Ct):T(this,_i).length!==0?T(this,_i).pop():T(this,yt)===T(this,pi)?Y(this,H,e0).call(this,false):T(this,yt),T(this,He)[h]=e,T(this,oe)[h]=t,T(this,pt).set(e,h),T(this,tr)[T(this,Ct)]=h,T(this,Ar)[h]=T(this,Ct),K(this,Ct,h),Xp(this,yt)._++,T(this,Hc).call(this,h,c,u),u&&(u.set="add"),l=false,T(this,Vc)&&((d=T(this,iu))==null||d.call(this,t,e,"add"));else {Y(this,H,Wf).call(this,h);let g=T(this,oe)[h];if(t!==g){if(T(this,qn)&&Y(this,H,Ve).call(this,g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=g;m!==void 0&&!o&&(T(this,vi)&&((f=T(this,mi))==null||f.call(this,m,e,"set")),T(this,rr)&&T(this,wt)?.push([m,e,"set"]));}else o||(T(this,vi)&&((x=T(this,mi))==null||x.call(this,g,e,"set")),T(this,rr)&&T(this,wt)?.push([g,e,"set"]));if(T(this,nu).call(this,h),T(this,Hc).call(this,h,c,u),T(this,oe)[h]=t,u){u.set="replace";let m=g&&Y(this,H,Ve).call(this,g)?g.__staleWhileFetching:g;m!==void 0&&(u.oldValue=m);}}else u&&(u.set="update");T(this,Vc)&&this.onInsert?.(t,e,t===g?"update":"replace");}if(s!==0&&!T(this,Cr)&&Y(this,H,ow).call(this),T(this,Cr)&&(l||T(this,zf).call(this,h,s,n),u&&T(this,ws).call(this,u,h)),!o&&T(this,rr)&&T(this,wt)){let g=T(this,wt),m;for(;m=g?.shift();)(_=T(this,gi))==null||_.call(this,...m);}return this}pop(){var e;try{for(;T(this,yt);){let t=T(this,oe)[T(this,jt)];if(Y(this,H,e0).call(this,!0),Y(this,H,Ve).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(T(this,rr)&&T(this,wt)){let t=T(this,wt),i;for(;i=t?.shift();)(e=T(this,gi))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=T(this,pt).get(e);if(n!==void 0){let o=T(this,oe)[n];if(Y(this,H,Ve).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(T(this,wr).call(this,n))s&&(s.has="stale",T(this,ws).call(this,s,n));else return i&&T(this,su).call(this,n),s&&(s.has="hit",T(this,ws).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=T(this,pt).get(e);if(s===void 0||!i&&T(this,wr).call(this,s))return;let n=T(this,oe)[s];return Y(this,H,Ve).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:x=this.allowStaleOnFetchAbort,context:_,forceRefresh:g=false,status:m,signal:b}=t;if(!T(this,qn))return m&&(m.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:m});let v={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:x,ignoreFetchAbort:f,status:m,signal:b},S=T(this,pt).get(e);if(S===void 0){m&&(m.fetch="miss");let A=Y(this,H,t0).call(this,e,S,v,_);return A.__returned=A}else {let A=T(this,oe)[S];if(Y(this,H,Ve).call(this,A)){let U=i&&A.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",U&&(m.returnedStale=true)),U?A.__staleWhileFetching:A.__returned=A}let E=T(this,wr).call(this,S);if(!g&&!E)return m&&(m.fetch="hit"),Y(this,H,Wf).call(this,S),s&&T(this,su).call(this,S),m&&T(this,ws).call(this,m,S),A;let w=Y(this,H,t0).call(this,e,S,v,_),P=w.__staleWhileFetching!==void 0&&i;return m&&(m.fetch=E?"stale":"refresh",P&&E&&(m.returnedStale=true)),P?w.__staleWhileFetching:w.__returned=w}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=T(this,Nc);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=T(this,pt).get(e);if(a!==void 0){let u=T(this,oe)[a],l=Y(this,H,Ve).call(this,u);return o&&T(this,ws).call(this,o,a),T(this,wr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||Y(this,H,$n).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(Y(this,H,Wf).call(this,a),s&&T(this,su).call(this,a),u))}else o&&(o.get="miss");}delete(e){return Y(this,H,$n).call(this,e,"delete")}clear(){return Y(this,H,lw).call(this,"delete")}};pi=new WeakMap,Er=new WeakMap,mi=new WeakMap,iu=new WeakMap,gi=new WeakMap,Lc=new WeakMap,Nc=new WeakMap,yt=new WeakMap,xi=new WeakMap,pt=new WeakMap,He=new WeakMap,oe=new WeakMap,tr=new WeakMap,Ar=new WeakMap,jt=new WeakMap,Ct=new WeakMap,_i=new WeakMap,wt=new WeakMap,yi=new WeakMap,bi=new WeakMap,Cr=new WeakMap,vi=new WeakMap,qn=new WeakMap,rr=new WeakMap,Vc=new WeakMap,H=new WeakSet,ow=function(){let e=new Gc(T(this,pi)),t=new Gc(T(this,pi));K(this,Cr,e),K(this,bi,t),K(this,zf,(n,o,a=Oc.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{T(this,wr).call(this,n)&&Y(this,H,$n).call(this,T(this,He)[n],"expire");},o+1);u.unref&&u.unref();}}),K(this,su,n=>{t[n]=e[n]!==0?Oc.now():0;}),K(this,ws,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=Oc.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=T(this,pt).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},K(this,wr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},su=new WeakMap,ws=new WeakMap,zf=new WeakMap,wr=new WeakMap,_k=function(){let e=new Gc(T(this,pi));K(this,xi,0),K(this,yi,e),K(this,nu,t=>{K(this,xi,T(this,xi)-e[t]),e[t]=0;}),K(this,Xf,(t,i,s,n)=>{if(Y(this,H,Ve).call(this,i))return 0;if(!Xn(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!Xn(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),K(this,Hc,(t,i,s)=>{if(e[t]=i,T(this,Er)){let n=T(this,Er)-e[t];for(;T(this,xi)>n;)Y(this,H,e0).call(this,true);}K(this,xi,T(this,xi)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=T(this,xi));});},nu=new WeakMap,Hc=new WeakMap,Xf=new WeakMap,Yn=function*({allowStale:e=this.allowStale}={}){if(T(this,yt))for(let t=T(this,Ct);!(!Y(this,H,aw).call(this,t)||((e||!T(this,wr).call(this,t))&&(yield t),t===T(this,jt)));)t=T(this,Ar)[t];},jn=function*({allowStale:e=this.allowStale}={}){if(T(this,yt))for(let t=T(this,jt);!(!Y(this,H,aw).call(this,t)||((e||!T(this,wr).call(this,t))&&(yield t),t===T(this,Ct)));)t=T(this,tr)[t];},aw=function(e){return e!==void 0&&T(this,pt).get(T(this,He)[e])===e},e0=function(e){var n;let t=T(this,jt),i=T(this,He)[t],s=T(this,oe)[t];return T(this,qn)&&Y(this,H,Ve).call(this,s)?s.__abortController.abort(new Error("evicted")):(T(this,vi)||T(this,rr))&&(T(this,vi)&&((n=T(this,mi))==null||n.call(this,s,i,"evict")),T(this,rr)&&T(this,wt)?.push([s,i,"evict"])),T(this,nu).call(this,t),e&&(T(this,He)[t]=void 0,T(this,oe)[t]=void 0,T(this,_i).push(t)),T(this,yt)===1?(K(this,jt,K(this,Ct,0)),T(this,_i).length=0):K(this,jt,T(this,tr)[t]),T(this,pt).delete(i),Xp(this,yt)._--,t},t0=function(e,t,i,s){let n=t===void 0?void 0:T(this,oe)[t];if(Y(this,H,Ve).call(this,n))return n;let o=new r0,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(_,g=false)=>{let{aborted:m}=o.signal,b=i.ignoreFetchAbort&&_!==void 0;if(i.status&&(m&&!g?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,b&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),m&&!b&&!g)return h(o.signal.reason);let v=f;return T(this,oe)[t]===f&&(_===void 0?v.__staleWhileFetching?T(this,oe)[t]=v.__staleWhileFetching:Y(this,H,$n).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,_,u.options))),_},c=_=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=_),h(_)),h=_=>{let{aborted:g}=o.signal,m=g&&i.allowStaleOnFetchAbort,b=m||i.allowStaleOnFetchRejection,v=b||i.noDeleteOnFetchRejection,S=f;if(T(this,oe)[t]===f&&(!v||S.__staleWhileFetching===void 0?Y(this,H,$n).call(this,e,"fetch"):m||(T(this,oe)[t]=S.__staleWhileFetching)),b)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw _},d=(_,g)=>{var b;let m=(b=T(this,Lc))==null?void 0:b.call(this,e,n,u);m&&m instanceof Promise&&m.then(v=>_(v===void 0?void 0:v),g),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=v=>l(v,true)));});};i.status&&(i.status.fetchDispatched=true);let f=new Promise(d).then(l,c),x=Object.assign(f,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,x,{...u.options,status:void 0}),t=T(this,pt).get(e)):T(this,oe)[t]=x,x},Ve=function(e){if(!T(this,qn))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof r0},uw=function(e,t){T(this,Ar)[t]=e,T(this,tr)[e]=t;},Wf=function(e){e!==T(this,Ct)&&(e===T(this,jt)?K(this,jt,T(this,tr)[e]):Y(this,H,uw).call(this,T(this,Ar)[e],T(this,tr)[e]),Y(this,H,uw).call(this,T(this,Ct),e),K(this,Ct,e));},$n=function(e,t){var s,n;let i=false;if(T(this,yt)!==0){let o=T(this,pt).get(e);if(o!==void 0)if(i=true,T(this,yt)===1)Y(this,H,lw).call(this,t);else {T(this,nu).call(this,o);let a=T(this,oe)[o];if(Y(this,H,Ve).call(this,a)?a.__abortController.abort(new Error("deleted")):(T(this,vi)||T(this,rr))&&(T(this,vi)&&((s=T(this,mi))==null||s.call(this,a,e,t)),T(this,rr)&&T(this,wt)?.push([a,e,t])),T(this,pt).delete(e),T(this,He)[o]=void 0,T(this,oe)[o]=void 0,o===T(this,Ct))K(this,Ct,T(this,Ar)[o]);else if(o===T(this,jt))K(this,jt,T(this,tr)[o]);else {let u=T(this,Ar)[o];T(this,tr)[u]=T(this,tr)[o];let l=T(this,tr)[o];T(this,Ar)[l]=T(this,Ar)[o];}Xp(this,yt)._--,T(this,_i).push(o);}}if(T(this,rr)&&T(this,wt)?.length){let o=T(this,wt),a;for(;a=o?.shift();)(n=T(this,gi))==null||n.call(this,...a);}return i},lw=function(e){var t,i;for(let s of Y(this,H,jn).call(this,{allowStale:true})){let n=T(this,oe)[s];if(Y(this,H,Ve).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=T(this,He)[s];T(this,vi)&&((t=T(this,mi))==null||t.call(this,n,o,e)),T(this,rr)&&T(this,wt)?.push([n,o,e]);}}if(T(this,pt).clear(),T(this,oe).fill(void 0),T(this,He).fill(void 0),T(this,Cr)&&T(this,bi)&&(T(this,Cr).fill(0),T(this,bi).fill(0)),T(this,yi)&&T(this,yi).fill(0),K(this,jt,0),K(this,Ct,0),T(this,_i).length=0,K(this,xi,0),K(this,yt,0),T(this,rr)&&T(this,wt)){let s=T(this,wt),n;for(;n=s?.shift();)(i=T(this,gi))==null||i.call(this,...n);}};var i0=cw;var Ki=class{constructor(e){O(this,"cache");O(this,"map",new Map);this.cache=new i0({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Yf=new Ki({cacheSize:5});function e5(r){return function(e){s0.add(e,r);}}var s0;(s=>{function r(n,o){o||(o=n.name),Yf.get(o)&&L.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Yf.set(o,n);}s.add=r;function e(n){try{let o=Yf.get(n);if(!o){L.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){L.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Yf.values())}s.values=t;function i(n){return Yf.has(n)}s.has=i;})(s0||(s0={}));var ir=s0;var Wc=new Ki({cacheSize:5});function t5(r){return function(e){n0.add(e,r);}}var n0;(n=>{function r(o,a){a||(a=o.name),Wc.get(a)&&L.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,Wc.set(a,o);}n.add=r;function e(o){try{let a=Wc.get(o);if(!a){L.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){L.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=Wc.get(o);if(!a){L.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){L.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(Wc.values())}n.values=i;function s(o){return Wc.has(o)}n.has=s;})(n0||(n0={}));var Ps=n0;async function o0(r){let e=r5(r.pixivnId);if(e)await e.setMemory(r);else throw new Error("[Pixi\u2019VN] The element "+r.pixivnId+" could not be created");return e}function r5(r){try{let e=ir.get(r);return e?new e:void 0}catch(e){L.error(`Error while getting CanvasElement ${r}`,e);return}}Te();function hw(r){return "memory"in r?r.memory:r instanceof pr?dw(r):r instanceof Se?jf(r):ou(r)}function i5(r){return {width:r.width,height:r.height,isRenderGroup:r.isRenderGroup,blendMode:r.blendMode,tint:r.tint,alpha:r.alpha,angle:r.angle,renderable:r.renderable,rotation:r.rotation,scale:{x:r.scale.x,y:r.scale.y},pivot:{x:r.pivot.x,y:r.pivot.y},position:{x:r.position.x,y:r.position.y},skew:{x:r.skew.x,y:r.skew.y},visible:r.visible,x:r.x,y:r.y,boundsArea:r.boundsArea,cursor:r.cursor,eventMode:r.eventMode,interactive:r.interactive,interactiveChildren:r.interactiveChildren,hitArea:r.hitArea}}function yk(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function ou(r,e){let t=s5(r,Ic),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>hw(n)):[];return {pixivnId:t,elements:s,...i5(r)}}function jf(r){let e=ou(r),t=e.pixivnId??kc,i=vk(r),s="textureAlias"in r?yk(r.texture,r.textureAlias):yk(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function dw(r){let e=ou(r),t=e.pixivnId??Fc,i=vk(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:n5(r.style),roundPixels:r.roundPixels,onEvents:i}}function s5(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function vk(r){return "onEvents"in r?r.onEvents:{}}function bk(r,e){if(typeof r!="object"||r===null)return r;L.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function n5(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:bk(r.stroke,"fill"),fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontVariant:r.fontVariant,fontWeight:r.fontWeight,leading:r.leading,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,padding:r.padding,stroke:bk(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var au=class extends q{constructor(t){super(t);O(this,"pixivnId",Ic);O(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Ic;}get memory(){return ou(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await Zi(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await o0(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ps.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):L.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ir.add(au,Ic);async function Zi(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}Te();var $f=class $f{static init(e){$f._getScreen=e.getScreen;}static get screen(){return $f._getScreen()}};O($f,"_getScreen");var mr=$f;function Xr(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(mr.screen.width-t)+i+n*t+(s?t:0):e*(mr.screen.height-t)+i+n*t+(s?t:0)}function Qi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(mr.screen.width-t):(e-i-n*t-(s?t:0))/(mr.screen.height-t)}function Yr(r,e){return r==="width"?e*mr.screen.width:e*mr.screen.height}function Ji(r,e){return r==="width"?e/mr.screen.width:e/mr.screen.height}function Ke(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.x*i-r.y*s,o=r.x*s+r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.y*s-r.x*i,o=r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.x*i+r.y*s,o=-r.x*s-r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.y*s-r.x*i,o=-r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}return {x:0,y:0}}function fw(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function jr(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?e:i===90||i===270?t:Math.abs(e*Math.cos(i*Math.PI/180))+Math.abs(t*Math.sin(i*Math.PI/180))}function $r(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?t:i===90||i===270?e:Math.abs(t*Math.cos(i*Math.PI/180))+Math.abs(e*Math.sin(i*Math.PI/180))}Te();var o5=new RegExp(`(${sk.join("|")})$`);function qf(r){let e=ut.cache.has(r)?ut.get(r):null;return e instanceof B&&(r=e.source?.label||r),o5.test(r)}function uu(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===void 0?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===void 0?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&r.percentageX===void 0&&(r.percentageX=r.xPercentagePosition),r.yPercentagePosition!=null&&r.percentageY===void 0&&(r.percentageY=r.yPercentagePosition),r.percentageX!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.percentageX},delete r.percentageX):(r.percentagePosition.x=r.percentageX,delete r.percentageX)),r.percentageY!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.percentageY},delete r.percentageY):(r.percentagePosition.y=r.percentageY,delete r.percentageY))),r)}Te();Te();async function zc(r){if(r!=="EMPTY"){if(!r){L.error("Texture not found",r);return}if(ut.cache.has(r)){let e=ut.get(r);if(e)return e}return ut.load(r).then(e=>{if(!e){L.error("Texture not found",r);return}if(!(e instanceof B)){L.error("File not is a file",r);return}return e}).catch(e=>{L.error("Error loading file",e);})}}Te();var Bs=class r extends Se{constructor(t){super(t);O(this,"pixivnId",kc);O(this,"_textureAlias");O(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||kc;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return jf(this)}set memory(t){}async setMemory(t){return this.memory=t,await Kf(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ps.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):L.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=Se.from(t,i),n=new r;return n.texture=s.texture,n}};ir.add(Bs,kc);async function Kf(r,e,t){let i=t?.ignoreTexture||false;if(await Zi(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await zc(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&ut.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await zc(n);o&&(r.texture=o);}}let s=t?.half;if(s?await s():"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=Ps.get(o);a&&r.onEvent(n,a);}}var Pe=class r extends Bs{constructor(t,i){t=uu(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);O(this,"pixivnId",rw);O(this,"_loadIsStarted",false);O(this,"_align");O(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...jf(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Zf(this,t),this.reloadPosition();}static from(t,i){let s=Se.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,zc(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,L.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return {x:Qi("width",this.x,jr(this),t.x,i.x<0,this.anchor.x),y:Qi("height",this.y,$r(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return Qi("width",this.x,jr(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return Qi("height",this.y,$r(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ji("width",this.x),y:Ji("height",this.y)}}get percentageX(){return Ji("width",this.x)}set percentageX(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageY(){return Ji("height",this.y)}set percentageY(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);this._align.x!==void 0&&(super.x=Xr("width",this._align.x,jr(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=Xr("height",this._align.y,$r(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Yr("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Yr("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};ir.add(Pe,rw);async function Zf(r,e,t){let i=t?.ignoreTexture||false;return e=uu(e),await Kf(r,e,{half:async()=>{i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition);},ignoreTexture:t?.ignoreTexture})}Te();var er=class r extends Pe{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);O(this,"pixivnId",iw);O(this,"_looop",false);O(this,"_paused",false);O(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await pw(this,t)}static from(t,i){let s=Se.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};ir.add(er,iw);async function pw(r,e,t){await Zf(r,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(r.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(r.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(r.paused=e.paused);}var Le=class extends au{constructor(t,i=[]){t=uu(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);O(this,"pixivnId",Zb);O(this,"_loadIsStarted",false);O(this,"_anchor");O(this,"_align");O(this,"_percentagePosition");t=uu(t),i&&i.forEach(a=>{let u;qf(a)?u=new er(void 0,a):u=new Pe(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:Zb,anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await mw(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,L.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new B}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return {x:Qi("width",this.x,jr(this),t.x,i.x<0,this.anchor.x),y:Qi("height",this.y,$r(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return Qi("width",this.x,jr(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return Qi("height",this.y,$r(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ji("width",this.x),y:Ji("height",this.y)}}set percentageX(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageX(){return Ji("width",this.x)}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}set percentageY(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get percentageY(){return Ji("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);this._align.x!==void 0&&(super.x=Xr("width",this._align.x,jr(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=Xr("height",this._align.y,$r(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Yr("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Yr("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};ir.add(Le,Zb);async function mw(r,e,t){e=uu(e),Zi(r,e,{...t,end:async()=>{"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}Te();var lu=class extends pr{constructor(t){super(t);O(this,"pixivnId",Fc);O(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Fc;}get memory(){return dw(this)}set memory(t){}async setMemory(t){return this.memory=t,await gw(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ps.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):L.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ir.add(lu,Fc);async function gw(r,e){if(await Zi(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=Ps.get(i);s&&r.onEvent(t,s);}}Te();var cu=class{constructor(e,t,i){O(this,"_args");O(this,"duration");O(this,"priority");O(this,"ticker",new le);O(this,"animation");O(this,"stopped",false);O(this,"ignoreOnComplete",true);O(this,"tickerId");O(this,"canvasElementAliases",[]);O(this,"timeout",50);O(this,"onComplete",()=>{if(this.ignoreOnComplete)return;let e=this.tickerId;if(!e){L.warn("MotionTicker.complete() called without tickerId set. This may cause issues.");return}let t=this._args.options?.aliasToRemoveAfter||[];typeof t=="string"&&(t=[t]);let i=this._args.options?.tickerAliasToResume||[];typeof i=="string"&&(i=[i]);let s=this._args.options?.tickerIdToResume||[];typeof s=="string"&&(s=[s]),D.onTickerComplete(e,{aliasToRemoveAfter:t,tickerAliasToResume:i,tickerIdToResume:s,stopTicker:false});});this._args=e,this.duration=t,this.priority=i;}get args(){return {...this._args,time:this.animation?.time}}getItemByAlias(e){if(!this.canvasElementAliases.includes(e))return;let t=D.find(e);if(t)return t}async complete(){if(!this.animation){L.warn("MotionTicker.complete() called without animation set. This may cause issues.");return}this.animation.complete(),await new Promise(e=>setTimeout(e,this.timeout));}stop(){if(this.stopped=true,!this.animation){L.warn("MotionTicker.stop() called without animation set. This may cause issues.");return}this.animation.stop();}start(e){if(this.tickerId=e,this._args.options.autoplay!==false)return this.initialize()}createItem(e){return new Proxy({alias:e},{set:({alias:t},i,s)=>{if(this.stopped||this._args.startState&&this._args.startState[i]===s)return true;let n=this.getItemByAlias(t);if(!n)return true;switch(this.ignoreOnComplete&&setTimeout(()=>{this.ignoreOnComplete=false;},10),i){case "pivotX":n.pivot.x=s;break;case "pivotY":n.pivot.y=s;break;case "scaleX":n.scale.x=s;break;case "scaleY":n.scale.y=s;break;default:n[i]=s;break}return true},get:({alias:t},i)=>{if(this._args.startState||(this._args.startState={}),i in this._args.startState)return this._args.startState[i];let s=this.getItemByAlias(t);if(!s)return;let n;switch(i){case "pivotX":n=s.pivot.x;break;case "pivotY":n=s.pivot.y;break;case "scaleX":n=s.scale.x;break;case "scaleY":n=s.scale.y;break;default:n=s[i];break}return this._args.startState={...this._args.startState,[i]:n},n},has:({alias:t},i)=>{let s=this.getItemByAlias(t);if(!s)return false;switch(i){case "pivotX":return "pivot"in s&&"x"in s.pivot;case "pivotY":return "pivot"in s&&"y"in s.pivot;case "scaleX":return "scale"in s&&"x"in s.scale;case "scaleY":return "scale"in s&&"y"in s.scale;default:return i in s}},ownKeys:({alias:t})=>{let i=this.getItemByAlias(t);return i?Object.keys(i):[]}})}pause(){if(!this.animation){L.warn("MotionTicker.pause() called without animation set. This may cause issues.");return}this.animation.pause();}play(){if(this.animation||this.initialize(),!this.animation){L.warn("MotionTicker.play() called without animation set. This may cause issues.");return}this.animation.play();}get paused(){return this.animation?this.animation.state==="paused":(L.warn("MotionTicker.paused() called without animation set. This may cause issues."),true)}};var hu=class extends cu{constructor(){super(...arguments);O(this,"id","motion-sequence");}initialize(){let t=this.canvasElementAliases[0],i=this.createItem(t),s=this._args.sequence.map((n,o)=>[i,n[0],{...n[1]||{},ticker:this.ticker,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat,onComplete:o===this._args.sequence.length-1?()=>this.onComplete():void 0}]);this.animation=Qf(s,{...this._args.options,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat}),this._args.time&&(this.animation.time=this._args.time);}};var du=class extends cu{constructor(){super(...arguments);O(this,"id","motion");}initialize(){let t=this.canvasElementAliases.map(i=>this.createItem(i));this.animation=Qf(t,this._args.keyframes,{...this._args.options,repeat:this._args.options?.repeat===null?1/0:this._args.options?.repeat,onComplete:()=>this.onComplete(),ticker:this.ticker}),this._args.time&&(this.animation.time=this._args.time);}};var Kn=new Ki({cacheSize:5});Kn.set("motion",du);Kn.set("motion-sequence",hu);function a5(r){return function(e){a0.add(e,r);}}var a0;(n=>{function r(o,a){a||(a=o.name),Kn.get(a)&&L.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,Kn.set(a,o);}n.add=r;function e(o){try{let a=Kn.get(o);if(!a){L.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){L.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=Kn.get(o);if(!c){L.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){L.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(Kn.values())}n.values=i;function s(o){return Kn.has(o)}n.has=s;})(a0||(a0={}));var sr=a0;var Tk="aliasToRemoveAfter";var Jf=class{get app(){return R.app}get gameLayer(){return R.gameLayer}get isInitialized(){return R._isInitialized}get canvasWidth(){return R.canvasWidth}get canvasHeight(){return R.canvasHeight}set canvasWidth(e){R.canvasWidth=e;}set canvasHeight(e){R.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await R.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await R.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}get children(){return R.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {L.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {L.error(`Canvas element ${e} not found`);return}}e instanceof q&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof er?await pw(t,e,{ignoreTexture:true}):t instanceof Pe?await Zf(t,e,{ignoreTexture:true}):t instanceof Bs?await Kf(t,e,{ignoreTexture:true}):t instanceof lu?await gw(t,e):t instanceof Le?await mw(t,e):t instanceof q&&await Zi(t,e);}add(e,t,i={}){if(e===fi){L.error(`The alias ${fi} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?L.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===fi){L.error(`The alias ${fi} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}find(e){if(e===fi)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return R._currentTickers}get currentTickersSteps(){return R._currentTickersSequence}findTicker(e){let t=R._currentTickers[e];if(t)return t.ticker}addTicker(e,t,i){let s=t.id;if(typeof e=="string"&&(e=[e]),t.canvasElementAliases=e,!sr.has(s)){L.error(`Ticker ${s} not found`);return}let n={ticker:t},{id:o=R.generateTickerId(n)}=i||{};if(R._currentTickers[o]=n,n.ticker.start(o),t.duration){let a=setTimeout(()=>{R.removeTickerTimeoutInfo(a),R._currentTickersTimeouts[a.toString()]&&n.ticker.complete({ignoreTickerSteps:true});},t.duration*1e3);R.addTickerTimeoutInfo(e,s,a.toString(),true);}return o}addTickersSequence(e,t,i=0){if(t.length==0){L.warn("The steps of the tickers is empty");return}e in R._currentTickersSequence||(R._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Hf||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:Ut(o.args),duration:o.duration})},n=R.generateTickerId(s);return R._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!R._currentTickersSequence[e]||!R._currentTickersSequence[e][t])return;let i=R._currentTickersSequence[e][t].steps[R._currentTickersSequence[e][t].currentStepNumber];if(i===Hf&&(i=R._currentTickersSequence[e][t].steps[0],R._currentTickersSequence[e][t].currentStepNumber=0,i===Hf)){L.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=R._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),R.removeTickerTimeoutInfo(u);},i.duration*1e3);R.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=sr.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){L.error(`Ticker ${i.ticker} not found`);return}s.canvasElementAliases=[e];let n=s.id,o={createdByTicketSteps:{canvasElementAlias:e,id:t},ticker:s},a=R.generateTickerId(o);if(R._currentTickers[a]=o,o.ticker.start(a),s.duration){let u=setTimeout(()=>{let l=R._currentTickersTimeouts[u.toString()];l&&(o.ticker.complete({ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),R.removeTickerTimeoutInfo(u);},s.duration*1e3);R.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(R._currentTickersSequence[e]&&R._currentTickersSequence[e][t]){let i=R._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,R._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&R._currentTickersSequence[e]&&R._currentTickersSequence[e][t]&&(delete R._currentTickersSequence[e][t],Object.entries(R._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){return this.onTickerComplete(e,t)}onTickerComplete(e,t){let{stopTicker:i=true,aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o}=t,a=R._currentTickers[e],u=t.ignoreTickerSteps||false;this.remove(s),n.forEach(l=>this.resumeTicker({canvasAlias:l})),this.resumeTicker({id:o}),a&&(this.removeTicker(e,{stopTicker:i}),!u&&a.ticker.duration==null&&a.createdByTicketSteps&&this.nextTickerStep(a.createdByTicketSteps.canvasElementAlias,a.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(R._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(s)&&(o.ticker.canvasElementAliases.length===1?this.removeTicker(n):o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(a=>a!==s));}),R._currentTickersSequence[s]&&delete R._currentTickersSequence[s],R.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:i=t.prototype.id,e.forEach(s=>{R._currentTickersSequence[s]&&Object.entries(R._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete R._currentTickersSequence[s][n];});}),Object.entries(R._currentTickers).forEach(([s,n])=>{n.ticker.id===i&&(R._currentTickers[s].ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(R._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(R._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(R._currentTickers).forEach(([e,t])=>{t.ticker.canvasElementAliases=t.ticker.canvasElementAliases.filter(i=>this.find(i)),t.ticker.canvasElementAliases.length===0&&t.ticker.complete({ignoreTickerSteps:true});}),Object.entries(R._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete R._currentTickersSequence[e];}),Object.entries(R._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&R.removeTickerTimeout(e);});}removeAllTickers(){R._currentTickersSequence={},Object.keys(R._currentTickers).forEach(e=>{this.removeTicker(e);}),R._currentTickers={};for(let e in R._currentTickersTimeouts)R.removeTickerTimeout(e);R._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},R._tickersOnPause={};}removeTicker(e,t={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(i=>{let s=R._currentTickers[i];s&&(t.stopTicker&&s.ticker.stop(),delete R._currentTickers[i]);});}pauseTicker(e){let t=[];if("canvasAlias"in e){let{canvasAlias:i,tickerIdsExcluded:s=[]}=e;Object.entries(R._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(i)&&!s.includes(o.ticker.id)&&o.ticker.paused===false&&(o.ticker.pause(),t.push(n));});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),i.forEach(s=>{let n=R._currentTickers[s];n?n.ticker.paused===false&&(n.ticker.pause(),t.push(s)):L.error(`Ticker with id ${s} not found`);});}return t}resumeTicker(e){if("canvasAlias"in e){let{canvasAlias:t}=e;Object.values(R._currentTickers).forEach(i=>{i.ticker.canvasElementAliases.includes(t)&&i.ticker.play();}),delete R._tickersOnPause[t];}else if("id"in e){let{id:t}=e;typeof t=="string"&&(t=[t]),t.forEach(i=>{let s=R._currentTickers[i];s?s.ticker.play():L.error(`Ticker with id ${i} not found`);});}}isTickerPaused(e,t){let i=R._tickersOnPause[e];if(i){if(t){if("tickerIdsIncluded"in i&&i.tickerIdsIncluded)return i.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in i&&i.tickerIdsExcluded)return !i.tickerIdsExcluded.includes(t)}return true}return false}transferTickers(e,t,i="move"){R._currentTickersSequence[e]&&(i==="move"?R._currentTickersSequence[t]=Ut(R._currentTickersSequence[e]):i==="duplicate"&&(R._currentTickersSequence[t]=Ut(R._currentTickersSequence[e]))),Object.entries(R._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.ticker.canvasElementAliases.includes(e)){let o=sr.getInstance(n.ticker.id,Ut(n.ticker.args),n.ticker.duration,n.ticker.priority);if(o?(o.canvasElementAliases=[t],this.addTicker(t,o),n.ticker.paused&&o.pause()):L.error(`Ticker ${n.ticker.id} not found`),i==="move"&&(n.ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(a=>a!==e)),n.ticker.args.hasOwnProperty(Tk)){let a=n.ticker.args.aliasToRemoveAfter;typeof a=="string"&&(a=[a]),Array.isArray(a)&&(i==="move"?n.ticker.args.aliasToRemoveAfter=a.map(u=>u===e?t:u):i==="duplicate"&&a.find(u=>u===e)&&(n.ticker.args.aliasToRemoveAfter=[...a,t]));}}}),Object.values(R._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),R._currentTickersSequence[t]&&Object.keys(R._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&R._currentTickersSequence[e]&&Object.keys(R._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}completeTickerOnStepEnd(e){e.alias?R._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):R._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,t){if(t){let i=R._currentTickersSequence[t];if(i&&i[e])if(i[e].steps.includes(Hf))L.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]);else {let s=i[e].steps.map(n=>{if(typeof n=="object"&&"ticker"in n){let o=sr.getInstance(n.ticker,n.args,n.duration,n.priority);if(o)return o.canvasElementAliases=[t],o.complete()}});await Promise.all(s);}}else {let i=R._currentTickers[e];i&&await i.ticker.complete();}}animate(e,t,i,s){try{t=Ut(t);}catch(l){throw L.error("animate keyframes cannot contain functions or classes"),l}try{i=Ut(i);}catch(l){throw L.error("animate options cannot contain functions or classes"),l}let n=[];typeof e=="string"?n=[e]:Array.isArray(e)?n=e.map(l=>typeof l=="string"?l:l.label):n=[e.label];let o;Array.isArray(t)?o=new hu({sequence:t,options:i},void 0,s):o=new du({keyframes:t,options:i},void 0,s);let a=this.addTicker(n,o),{forceCompleteBeforeNext:u}=i||{};return a&&u&&this.completeTickerOnStepEnd({id:a}),a}addLayer(e,t){if(e===fi){L.error(`The alias ${fi} is reserved`);return}return t.label=e,R.app.stage.addChild(t)}getLayer(e){return R.app.stage.getChildByLabel(e)}removeLayer(e){R.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return R.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return R.removeHtmlLayer(e)}getHtmlLayer(e){return R.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAllTickers(),this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=hw(t));}),{tickers:Ut(R.currentTickersWithoutCreatedBySteps),tickersSteps:Ut(R._currentTickersSequence),elements:Ut(e),stage:Ut(ou(this.gameLayer)),elementAliasesOrder:Ut(R.childrenAliasesOrder),tickersOnPause:Ut(R._tickersOnPause),tickersToCompleteOnStepEnd:Ut(R._tickersToCompleteOnStepEnd)}}async restore(e){this.clear();try{if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let t=e.elementAliasesOrder,i={},s=Object.entries(e.elements).map(async([n,o])=>{i[n]=await o0(o);});await Promise.all(s),t.forEach(n=>{let o=i[n];o&&this.add(n,o);});}else {L.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Zi(this.gameLayer,e.stage,{ignoreScale:!0}):L.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let t=e.tickers;Object.entries(t).forEach(([i,s])=>{let n=s.canvasElementAliases;if(n.length!==0){let o=sr.getInstance(s.id,s.args,s.duration,s.priority);o?(o.canvasElementAliases=n,this.addTicker(n,o,{id:i}),s.paused&&o.pause()):L.error(`Ticker ${s.id} not found`);}});}if(e.hasOwnProperty("tickersSteps")){let t=e.tickersSteps;Object.entries(t).forEach(([i,s])=>{R._currentTickersSequence[i]=s,Object.keys(s).forEach(n=>{this.runTickersSequence(i,n);});});}if(e.hasOwnProperty("tickersOnPause")){let t=e.tickersOnPause;Object.keys(t).forEach(i=>{let s=t[i];"tickerIdsExcluded"in s&&s.tickerIdsExcluded&&(t[i].tickerIdsExcluded=s.tickerIdsExcluded),"tickerIdsIncluded"in s&&s.tickerIdsIncluded&&(t[i].tickerIdsIncluded=s.tickerIdsIncluded);}),R._tickersOnPause=t;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let t=e.tickersToCompleteOnStepEnd,i=t.tikersIds,s=t.stepAlias.map(n=>({id:n.id,alias:n.alias}));R._tickersToCompleteOnStepEnd={tikersIds:i,stepAlias:s};}}catch(t){L.error("Error importing data",t);}}};var u0=class{constructor(){O(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var l0=class{constructor(){O(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};async function u5(r,e={},t){let i=D.find(r);if(!i){L.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},{shakeType:n="horizontal",maxShockSize:o=10,shocksNumber:a=10,...u}=e,l=a-1;if(l<2){L.error("The number of shocks must be at least 3.");return}let c=Math.floor(l/2),h=Math.ceil(l/2),d=[];for(let _=0;_<c;_++){let g=o*(_+1)/c;n==="horizontal"?_%2!==0?d.push(s.x+g):d.push(s.x-g):_%2!==0?d.push(s.y+g):d.push(s.y-g);}let f=c%2===0;for(let _=h;_>0;_--){let g=o*(_+1)/(h-1);n==="horizontal"?_%2===0&&!f||_%2!==0&&f?d.push(s.x-g):d.push(s.x+g):_%2===0&&!f||_%2!==0&&f?d.push(s.y-g):d.push(s.y+g);}let x;if(n==="horizontal"?(d.push(s.x),x=D.animate(r,{x:d},u,t)):(d.push(s.y),x=D.animate(r,{y:d},u,t)),x)return [x]}Te();function c0(r,e,t){let i=new Le(t,e);return D.add(r,i),i}async function l5(r,e,t){let i=new Le(t,e);return await i.load(),D.add(r,i),i}Te();function h0(r,e,t){if(!e)if(ut.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return D.add(r,i),i}async function c5(r,e,t){if(!e)if(ut.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return await i.load(),D.add(r,i),i}Te();function d0(r,e,t){if(!e)if(ut.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new er(t,e);return D.add(r,i),i}async function h5(r,e,t){if(!e)if(ut.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new er(t,e);return await i.load(),D.add(r,i),i}function xw(r,e){if(r.type==="align"){let t,i;e instanceof Se&&(t=e.anchor.x,i=e.anchor.y);let s=Ke(e.pivot,e.angle),n=Ke(e.scale,e.angle);r.x=Xr("width",r.x,jr(e),s.x,n.x<0,t),r.y=Xr("height",r.y,$r(e),s.y,n.y<0,i);}return r.type==="percentage"&&(r.x=Yr("width",r.x),r.y=Yr("height",r.y)),{x:r.x,y:r.y}}function ep(r,e){if(typeof e=="string")return qf(e)?d0(r,e):h0(r,e);if(Array.isArray(e))return c0(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return qf(e.value)?d0(r,e.value,e.options):h0(r,e.value,e.options);if(Array.isArray(e.value))return c0(r,e.value,e.options)}return D.add(r,e),e}async function Sk(r,e,t={},i){let{forceCompleteBeforeNext:s=true,tickerIdToResume:n=[],...o}=t,a=[];e||(e=r),typeof n=="string"&&(n=[n]);let u;if(D.find(r)&&(u=r+"_temp_disolve",D.editAlias(r,u)),e=ep(r,e),u&&D.copyCanvasElementProperty(u,r),u&&D.transferTickers(u,r,"duplicate"),e.alpha=0,u){let c=f0(u,{...t,autoplay:false,forceCompleteBeforeNext:s},i);c&&(a.push(...c),n.push(...c));}let l=D.animate(r,{alpha:1},{...o,tickerIdToResume:n,forceCompleteBeforeNext:s},i);if(l&&a.push(l),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function f0(r,e={},t){let{forceCompleteBeforeNext:i=true,aliasToRemoveAfter:s=[],...n}=e;typeof s=="string"&&(s=[s]),s.push(r);let o=D.animate(r,{alpha:0},{...n,aliasToRemoveAfter:s,forceCompleteBeforeNext:i},t);if(o)return [o]}async function d5(r,e,t={},i){let{forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=t,a=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!D.find(r))return Sk(r,e,t,i);let u=r+"_temp_fade";D.editAlias(r,u),n.push(u),e=ep(r,e),u&&D.copyCanvasElementProperty(u,r),u&&D.transferTickers(u,r,"duplicate"),e.alpha=0;let l=D.animate(r,{alpha:1},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},i);if(l){let c=f0(u,{...t,tickerIdToResume:l,forceCompleteBeforeNext:s},i);c&&a.push(...c),a.push(l),D.pauseTicker({id:l});}if((e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function f5(r,e={},t){return f0(r,e,t)}async function p5(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u,...l}=t,c=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let h;D.find(r)&&(h=r+"_temp_movein",D.editAlias(r,h)),e=ep(r,e),h&&D.copyCanvasElementProperty(h,r),h&&D.transferTickers(h,r,"move");let d;if(e instanceof Pe||e instanceof Le?d=e.positionInfo:d={x:e.x,y:e.y,type:"pixel"},h)if(u){let _=_w(h,{...t,autoplay:false,forceCompleteBeforeNext:n},i);_&&(c.push(..._),o.push(..._));}else a.push(h);switch((e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),s){case "up":e.y=D.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=D.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let f=D.pauseTicker({canvasAlias:r});o.push(...f);let x=D.animate(r,xw(d,e),{...l,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(x&&c.push(x),c.length>0)return c}function _w(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=D.find(r);if(!a){L.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y};switch(i){case "up":u.y=-a.height;break;case "down":u.y=D.canvasHeight+a.height;break;case "left":u.x=-a.width;break;case "right":u.x=D.canvasWidth+a.width;break}D.pauseTicker({canvasAlias:r});let l=D.animate(r,u,{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(l)return [l]}async function m5(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],...u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;D.find(r)&&(c=r+"_temp_zoom",D.editAlias(r,c)),e=ep(r,e),c&&D.copyCanvasElementProperty(c,r),c&&D.transferTickers(c,r,"move");let h;e instanceof Pe||e instanceof Le?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d={x:e.pivot.x,y:e.pivot.y},f={x:e.scale.x,y:e.scale.y};if(c)if(t.removeOldComponentWithZoomOut){let g=Ek(c,{...t,autoplay:false,forceCompleteBeforeNext:n},i);g&&(l.push(...g),o.push(...g));}else a.push(c);(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),s=="up"?(e.pivot.y=D.canvasHeight-e.y,e.pivot.x=D.canvasWidth/2-e.x,e.y=D.canvasHeight,e.x=D.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=D.canvasWidth/2-e.x,e.y=0,e.x=D.canvasWidth/2):s=="left"?(e.pivot.x=D.canvasWidth-e.x,e.pivot.y=D.canvasHeight/2-e.y,e.x=D.canvasWidth,e.y=D.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=D.canvasHeight/2-e.y,e.x=0,e.y=D.canvasHeight/2),e.pivot=fw(e.pivot,e.angle),e.scale.set(0);let x=D.pauseTicker({canvasAlias:r});o.push(...x);let _=D.animate(r,{...xw(h,e),pivotX:d.x,pivotY:d.y,scaleX:f.x,scaleY:f.y},{...u,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(_&&l.push(_),l.length>0)return l}function Ek(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=D.find(r);if(!a){L.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y},l={x:a.pivot.x,y:a.pivot.y};i=="down"?(u.y=D.canvasHeight,u.x=D.canvasWidth/2,l.y=D.canvasHeight-u.y,l.x=D.canvasWidth/2-u.x):i=="up"?(u.y=0,u.x=D.canvasWidth/2,l.y=0-u.y,l.x=D.canvasWidth/2-u.x):i=="right"?(u.x=D.canvasWidth,u.y=D.canvasHeight/2,l.x=D.canvasWidth-u.x,l.y=D.canvasHeight/2-u.y):i=="left"&&(u.x=0,u.y=D.canvasHeight/2,l.x=0-u.x,l.y=D.canvasHeight/2-u.y),l=fw(l,a.angle),D.pauseTicker({canvasAlias:r});let c=D.animate(r,{...u,pivotX:l.x,pivotY:l.y,scaleX:0,scaleY:0},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(c)return [c]}async function g5(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],...a}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]);let l;D.find(r)&&(l=r+"_temp_push",D.editAlias(r,l)),e=ep(r,e),l&&D.copyCanvasElementProperty(l,r),l&&D.transferTickers(l,r,"move");let c;switch((e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture?c=e.positionInfo:c={x:e.x,y:e.y,type:"pixel"},s){case "up":e.y=D.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=D.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let h=D.pauseTicker({canvasAlias:r});if(o.push(...h),l){let f=Ak(l,{...t,direction:s,forceCompleteBeforeNext:n});f&&u.push(...f);}let d=D.animate(r,xw(c,e),{...a,tickerIdToResume:o,forceCompleteBeforeNext:n},i);if(d&&u.push(d),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function Ak(r,e={direction:"right"},t){return _w(r,e,t)}Te();var qr=class{constructor(e,t,i){O(this,"id","ticker_id_not_set");O(this,"args");O(this,"duration");O(this,"priority");O(this,"ticker",new le);O(this,"tickerId");O(this,"canvasElementAliases",[]);O(this,"fnValue");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){L.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(e){this.tickerId=e;let t=()=>{let{createdByTicketSteps:i}=R._currentTickers[e],s=this.canvasElementAliases;if(i){if(D.isTickerPaused(i.canvasElementAlias,i.id))return}else s=s.filter(n=>!D.isTickerPaused(n,e));return this.fn(this.ticker,this.args,s,e)};this.fnValue=t,this.ticker.add(t,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};Te();Te();function Zn(r){return (r instanceof Pe||r instanceof Le)&&r.haveEmptyTexture?false:!(r instanceof Se&&r.texture?.label=="EMPTY")}function Qn(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=yw(r[e],t):t.type==="exponential"&&(r[e]=bw(r[e],t)):r[e]!==void 0&&typeof r[e]=="object"&&r[e].haveOwnProperty("x")&&r[e].haveOwnProperty("y")&&typeof r[e].x=="number"&&typeof r[e].y=="number"&&(t.type==="linear"?(r[e].x=yw(r[e].x,t),r[e].y=yw(r[e].y,t)):t.type==="exponential"&&(r[e].x=bw(r[e].x,t),r[e].y=bw(r[e].y,t))));}function yw(r,e){let{limit:t,amt:i}=e;if(t!==void 0){if(r>t&&i>0)return t;if(r<t&&i<0)return t}return r+i}function bw(r,e){let{limit:t}=e;if(t!==void 0){if(r>t&&e.percentage>0)return t;if(r<t&&e.percentage<0)return t}return r+r*e.percentage}var x5=5,tp=class extends qr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=x5:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=D.find(c);return !(!h||o&&!Zn(h))}).forEach(c=>{let h=D.find(c);if(h&&h instanceof q){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.complete();return}else if(n==="hide"&&h.alpha<=l){this.complete();return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){L.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.complete();return}}}),a&&Qn(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=D.find(s);if(n){let o=this.getLimit(i);n.alpha=o;}});}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){L.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),D.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};sr.add(tp);Te();var _5=10;function y5(r,e){let t=Ut(r.destination);if(t.type==="align"){let i,s;e instanceof Se&&(i=e.anchor.x,s=e.anchor.y);let n=Ke(e.pivot,e.angle),o=Ke(e.scale,e.angle);t.x=Xr("width",t.x,jr(e),n.x,o.x<0,i),t.y=Xr("height",t.y,$r(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=Yr("width",t.x),t.y=Yr("height",t.y)),t}var rp=class extends qr{fn(e,t,i,s){t.speed===void 0&&(t.speed=_5);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=D.find(u);return !(!l||o&&!Zn(l))}).forEach(u=>{let l=D.find(u);if(l&&l instanceof q){let c=y5(t,l),h=c.x-l.x,d=c.y-l.y,f=h>0?1:-1,x=d>0?1:-1,_,g;if(typeof n=="number"){let m=this.speedConvert(n);h===0||d===0?_=g=m:(_=Math.abs(h/(h+d))*m,g=Math.abs(d/(h+d))*m);}else _=this.speedConvert(n.x),g=this.speedConvert(n.y);if(_>0){l.x+=f*_*e.deltaTime;let m=c.x-l.x;(f<0&&m>0||f>0&&m<0)&&(l.x=c.x);}if(g>0){l.y+=x*g*e.deltaTime;let m=c.y-l.y;(x<0&&m>0||x>0&&m<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.complete();return}else if(_<1e-5&&g<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){L.warn("The speed of the MoveTicker must be greater than 0."),this.complete();return}}}),a&&Qn(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=D.find(s);if(n){let o=i.destination;n instanceof Pe||n instanceof Le?n.positionInfo=o:(n.x=o.x,n.y=o.y);}});}speedConvert(e){return e*(66/400)}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){L.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),D.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};sr.add(rp);Te();var b5=1,ip=class extends qr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=b5);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=D.find(l);return !(!c||t.startOnlyIfHaveTexture&&!Zn(c))}).forEach(l=>{let c=D.find(l);if(c&&c instanceof q&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.complete()):!n&&c.angle<=a&&(c.angle=a,this.complete())),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){L.warn("The speed of the RotateTicker must be greater than 0."),this.complete();return}}),o&&Qn(t,"speed",o);}onComplete(e,t,i){let{limit:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=D.find(n);o&&s!==void 0&&(o.angle=s);});}speedConvert(e){return e/100}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){L.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),D.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};sr.add(ip);Te();var v5=10,sp=class extends qr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=v5);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(d=>{let f=D.find(d);return !(!f||a&&!Zn(f))}).forEach(d=>{let f=D.find(d);if(f&&f instanceof q){if(o==="zoom"&&(f.scale.x<h.x||f.scale.y<h.y)?(f.scale.x+=l*e.deltaTime,f.scale.y+=c*e.deltaTime):o==="unzoom"&&(f.scale.x>h.x||f.scale.y>h.y)&&(f.scale.x-=l*e.deltaTime,f.scale.y-=c*e.deltaTime),o==="zoom"){if(f.scale.x>h.x&&(f.scale.x=h.x),f.scale.y>h.y&&(f.scale.y=h.y),f.scale.x>=h.x&&f.scale.y>=h.y){this.complete();return}}else if(o==="unzoom"&&(f.scale.x<h.x&&(f.scale.x=h.x),f.scale.y<h.y&&(f.scale.y=h.y),f.scale.x<=h.x&&f.scale.y<=h.y)){this.complete();return}if((l<1e-5&&c<1e-5||l<1e-5&&f.scale.y==h.y||c<1e-5&&f.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){L.warn("The speed of the ZoomTicker must be greater than 0."),this.complete();return}}}),u&&Qn(t,"speed",u);}speedConvert(e){return e/600}onComplete(e,t,i){let{isZoomInOut:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=D.find(n);if(o){let a=this.getLimit(i);if(o.scale.x=a.x,o.scale.y=a.y,s){let{pivot:u,position:l}=s;o.pivot=u.x,o.position=l;}}});}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){L.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),D.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};sr.add(sp);function vw(r,e){r.indexOf(e)===-1&&r.push(e);}function fu(r,e){let t=r.indexOf(e);t>-1&&r.splice(t,1);}var gr=(r,e,t)=>t>e?e:t<r?r:t;function np(r,e){return e?`${r}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:r}var es=()=>{},Pt=()=>{};process.env.NODE_ENV!=="production"&&(es=(r,e,t)=>{!r&&typeof console<"u"&&console.warn(np(e,t));},Pt=(r,e,t)=>{if(!r)throw new Error(np(e,t))});var $t={};var op=r=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(r);function Tw(r){return typeof r=="object"&&r!==null}var ap=r=>/^0[^.\s]+$/u.test(r);function pu(r){let e;return ()=>(e===void 0&&(e=r()),e)}var Pr=r=>r;var T5=(r,e)=>t=>e(r(t)),mu=(...r)=>r.reduce(T5);var gu=(r,e,t)=>{let i=e-r;return i===0?1:(t-r)/i};var xu=class{constructor(){this.subscriptions=[];}add(e){return vw(this.subscriptions,e),()=>fu(this.subscriptions,e)}notify(e,t,i){let s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,t,i);else for(let n=0;n<s;n++){let o=this.subscriptions[n];o&&o(e,t,i);}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0;}};var bt=r=>r*1e3,nr=r=>r/1e3;function up(r,e){return e?r*(1e3/e):0}var Ck=new Set;function lp(r,e,t){r||Ck.has(e)||(console.warn(np(e,t)),Ck.add(e));}var wk=(r,e,t)=>{let i=e-r;return ((t-r)%i+i)%i+r};var Pk=(r,e,t)=>(((1-3*t+3*e)*r+(3*t-6*e))*r+3*e)*r,S5=1e-7,E5=12;function A5(r,e,t,i,s){let n,o,a=0;do o=e+(t-e)/2,n=Pk(o,i,s)-r,n>0?t=o:e=o;while(Math.abs(n)>S5&&++a<E5);return o}function Jn(r,e,t,i){if(r===e&&t===i)return Pr;let s=n=>A5(n,0,1,r,t);return n=>n===0||n===1?n:Pk(s(n),e,i)}var p0=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2;var m0=r=>e=>1-r(1-e);var g0=Jn(.33,1.53,.69,.99),Xc=m0(g0),cp=p0(Xc);var hp=r=>(r*=2)<1?.5*Xc(r):.5*(2-Math.pow(2,-10*(r-1)));var dp=r=>1-Math.sin(Math.acos(r)),Sw=m0(dp),fp=p0(dp);var Ew=Jn(.42,0,1,1),Aw=Jn(0,0,.58,1),pp=Jn(.42,0,.58,1);var mp=r=>Array.isArray(r)&&typeof r[0]!="number";function gp(r,e){return mp(r)?r[wk(0,r.length,e)]:r}var xp=r=>Array.isArray(r)&&typeof r[0]=="number";var Bk={linear:Pr,easeIn:Ew,easeInOut:pp,easeOut:Aw,circIn:dp,circInOut:fp,circOut:Sw,backIn:Xc,backInOut:cp,backOut:g0,anticipate:hp},C5=r=>typeof r=="string",x0=r=>{if(xp(r)){Pt(r.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,t,i,s]=r;return Jn(e,t,i,s)}else if(C5(r))return Pt(Bk[r]!==void 0,`Invalid easing type '${r}'`,"invalid-easing-type"),Bk[r];return r};var _p=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Mk(r,e){let t=new Set,i=new Set,s=false,n=false,o=new WeakSet,a={delta:0,timestamp:0,isProcessing:false};function l(h){o.has(h)&&(c.schedule(h),r()),h(a);}let c={schedule:(h,d=false,f=false)=>{let _=f&&s?t:i;return d&&o.add(h),_.has(h)||_.add(h),h},cancel:h=>{i.delete(h),o.delete(h);},process:h=>{if(a=h,s){n=true;return}s=true,[t,i]=[i,t],t.forEach(l),t.clear(),s=false,n&&(n=false,c.process(h));}};return c}var w5=40;function _0(r,e){let t=false,i=true,s={delta:0,timestamp:0,isProcessing:false},n=()=>t=true,o=_p.reduce((v,S)=>(v[S]=Mk(n),v),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:d,render:f,postRender:x}=o,_=()=>{let v=$t.useManualTiming?s.timestamp:performance.now();t=false,$t.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(v-s.timestamp,w5),1)),s.timestamp=v,s.isProcessing=true,a.process(s),u.process(s),l.process(s),c.process(s),h.process(s),d.process(s),f.process(s),x.process(s),s.isProcessing=false,t&&e&&(i=false,r(_));},g=()=>{t=true,i=true,s.isProcessing||r(_);};return {schedule:_p.reduce((v,S)=>{let A=o[S];return v[S]=(E,w=false,M=false)=>(t||g(),A.schedule(E,w,M)),v},{}),cancel:v=>{for(let S=0;S<_p.length;S++)o[_p[S]].cancel(v);},state:s,steps:o}}var{schedule:qt,cancel:jc,state:_u}=_0(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pr,true);var y0;function B5(){y0=void 0;}var Bt={now:()=>(y0===void 0&&Bt.set(_u.isProcessing||$t.useManualTiming?_u.timestamp:performance.now()),y0),set:r=>{y0=r,queueMicrotask(B5);}};var Rk=r=>e=>typeof e=="string"&&e.startsWith(r),yp=Rk("--"),M5=Rk("var(--"),yu=r=>M5(r)?R5.test(r.split("/*")[0].trim()):false,R5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var ts={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},Ms={...ts,transform:r=>gr(0,1,r)},bp={...ts,default:1};var eo=r=>Math.round(r*1e5)/1e5;var qc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Dk(r){return r==null}var Ik=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Kc=(r,e)=>t=>!!(typeof t=="string"&&Ik.test(t)&&t.startsWith(r)||e&&!Dk(t)&&Object.prototype.hasOwnProperty.call(t,e)),b0=(r,e,t)=>i=>{if(typeof i!="string")return i;let[s,n,o,a]=i.match(qc);return {[r]:parseFloat(s),[e]:parseFloat(n),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var D5=r=>gr(0,255,r),Cw={...ts,transform:r=>Math.round(D5(r))},rs={test:Kc("rgb","red"),parse:b0("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:i=1})=>"rgba("+Cw.transform(r)+", "+Cw.transform(e)+", "+Cw.transform(t)+", "+eo(Ms.transform(i))+")"};function I5(r){let e="",t="",i="",s="";return r.length>5?(e=r.substring(1,3),t=r.substring(3,5),i=r.substring(5,7),s=r.substring(7,9)):(e=r.substring(1,2),t=r.substring(2,3),i=r.substring(3,4),s=r.substring(4,5),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}var vp={test:Kc("#"),parse:I5,transform:rs.transform};var Tp=r=>({test:e=>typeof e=="string"&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),Ti=Tp("deg"),Rs=Tp("%"),Q=Tp("px"),ww=Tp("vh"),Pw=Tp("vw"),v0={...Rs,parse:r=>Rs.parse(r)/100,transform:r=>Rs.transform(r*100)};var to={test:Kc("hsl","hue"),parse:b0("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(r)+", "+Rs.transform(eo(e))+", "+Rs.transform(eo(t))+", "+eo(Ms.transform(i))+")"};var Ze={test:r=>rs.test(r)||vp.test(r)||to.test(r),parse:r=>rs.test(r)?rs.parse(r):to.test(r)?to.parse(r):vp.parse(r),transform:r=>typeof r=="string"?r:r.hasOwnProperty("red")?rs.transform(r):to.transform(r),getAnimatableNone:r=>{let e=Ze.parse(r);return e.alpha=0,Ze.transform(e)}};var kk=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function k5(r){return isNaN(r)&&typeof r=="string"&&(r.match(qc)?.length||0)+(r.match(kk)?.length||0)>0}var Ok="number",Gk="color",F5="var",O5="var(",Fk="${}",G5=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ro(r){let e=r.toString(),t=[],i={color:[],number:[],var:[]},s=[],n=0,a=e.replace(G5,u=>(Ze.test(u)?(i.color.push(n),s.push(Gk),t.push(Ze.parse(u))):u.startsWith(O5)?(i.var.push(n),s.push(F5),t.push(u)):(i.number.push(n),s.push(Ok),t.push(parseFloat(u))),++n,Fk)).split(Fk);return {values:t,split:a,indexes:i,types:s}}function Uk(r){return ro(r).values}function Lk(r){let{split:e,types:t}=ro(r),i=e.length;return s=>{let n="";for(let o=0;o<i;o++)if(n+=e[o],s[o]!==void 0){let a=t[o];a===Ok?n+=eo(s[o]):a===Gk?n+=Ze.transform(s[o]):n+=s[o];}return n}}var U5=r=>typeof r=="number"?0:Ze.test(r)?Ze.getAnimatableNone(r):r;function L5(r){let e=Uk(r);return Lk(r)(e.map(U5))}var Br={test:k5,parse:Uk,createTransformer:Lk,getAnimatableNone:L5};function Bw(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function Nk({hue:r,saturation:e,lightness:t,alpha:i}){r/=360,e/=100,t/=100;let s=0,n=0,o=0;if(!e)s=n=o=t;else {let a=t<.5?t*(1+e):t+e-t*e,u=2*t-a;s=Bw(u,a,r+1/3),n=Bw(u,a,r),o=Bw(u,a,r-1/3);}return {red:Math.round(s*255),green:Math.round(n*255),blue:Math.round(o*255),alpha:i}}function Zc(r,e){return t=>t>0?e:r}var Si=(r,e,t)=>r+(e-r)*t;var Mw=(r,e,t)=>{let i=r*r,s=t*(e*e-i)+i;return s<0?0:Math.sqrt(s)},N5=[vp,rs,to],V5=r=>N5.find(e=>e.test(r));function Vk(r){let e=V5(r);if(es(!!e,`'${r}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return false;let t=e.parse(r);return e===to&&(t=Nk(t)),t}var Rw=(r,e)=>{let t=Vk(r),i=Vk(e);if(!t||!i)return Zc(r,e);let s={...t};return n=>(s.red=Mw(t.red,i.red,n),s.green=Mw(t.green,i.green,n),s.blue=Mw(t.blue,i.blue,n),s.alpha=Si(t.alpha,i.alpha,n),rs.transform(s))};var T0=new Set(["none","hidden"]);function Hk(r,e){return T0.has(r)?t=>t<=0?r:e:t=>t>=1?e:r}function H5(r,e){return t=>Si(r,e,t)}function S0(r){return typeof r=="number"?H5:typeof r=="string"?yu(r)?Zc:Ze.test(r)?Rw:X5:Array.isArray(r)?Wk:typeof r=="object"?Ze.test(r)?Rw:W5:Zc}function Wk(r,e){let t=[...r],i=t.length,s=r.map((n,o)=>S0(n)(n,e[o]));return n=>{for(let o=0;o<i;o++)t[o]=s[o](n);return t}}function W5(r,e){let t={...r,...e},i={};for(let s in t)r[s]!==void 0&&e[s]!==void 0&&(i[s]=S0(r[s])(r[s],e[s]));return s=>{for(let n in i)t[n]=i[n](s);return t}}function z5(r,e){let t=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let n=e.types[s],o=r.indexes[n][i[n]],a=r.values[o]??0;t[s]=a,i[n]++;}return t}var X5=(r,e)=>{let t=Br.createTransformer(e),i=ro(r),s=ro(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?T0.has(r)&&!s.values.length||T0.has(e)&&!i.values.length?Hk(r,e):mu(Wk(z5(i,s),s.values),t):(es(true,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Zc(r,e))};function E0(r,e,t){return typeof r=="number"&&typeof e=="number"&&typeof t=="number"?Si(r,e,t):S0(r)(r,e)}var zk=r=>{let e=({timestamp:t})=>r(t);return {start:(t=true)=>qt.update(e,t),stop:()=>jc(e),now:()=>_u.isProcessing?_u.timestamp:Bt.now()}};var A0=(r,e,t=10)=>{let i="",s=Math.max(Math.round(e/t),2);for(let n=0;n<s;n++)i+=Math.round(r(n/(s-1))*1e4)/1e4+", ";return `linear(${i.substring(0,i.length-2)})`};function Qc(r){let e=0,t=50,i=r.next(e);for(;!i.done&&e<2e4;)e+=t,i=r.next(e);return e>=2e4?1/0:e}function Sp(r,e=100,t){let i=t({...r,keyframes:[0,e]}),s=Math.min(Qc(i),2e4);return {type:"keyframes",ease:n=>i.next(s*n).value/e,duration:nr(s)}}var Y5=5;function C0(r,e,t){let i=Math.max(e-Y5,0);return up(t-r(i),e-i)}var We={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Iw=.001;function Xk({duration:r=We.duration,bounce:e=We.bounce,velocity:t=We.velocity,mass:i=We.mass}){let s,n;es(r<=bt(We.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=gr(We.minDamping,We.maxDamping,o),r=gr(We.minDuration,We.maxDuration,nr(r)),o<1?(s=l=>{let c=l*o,h=c*r,d=c-t,f=w0(l,o),x=Math.exp(-h);return Iw-d/f*x},n=l=>{let h=l*o*r,d=h*t+t,f=Math.pow(o,2)*Math.pow(l,2)*r,x=Math.exp(-h),_=w0(Math.pow(l,2),o);return (-s(l)+Iw>0?-1:1)*((d-f)*x)/_}):(s=l=>{let c=Math.exp(-l*r),h=(l-t)*r+1;return -Iw+c*h},n=l=>{let c=Math.exp(-l*r),h=(t-l)*(r*r);return c*h});let a=5/r,u=$5(s,n,a);if(r=bt(r),isNaN(u))return {stiffness:We.stiffness,damping:We.damping,duration:r};{let l=Math.pow(u,2)*i;return {stiffness:l,damping:o*2*Math.sqrt(i*l),duration:r}}}var j5=12;function $5(r,e,t){let i=t;for(let s=1;s<j5;s++)i=i-r(i)/e(i);return i}function w0(r,e){return r*Math.sqrt(1-e*e)}var q5=["duration","bounce"],K5=["stiffness","damping","mass"];function Yk(r,e){return e.some(t=>r[t]!==void 0)}function Z5(r){let e={velocity:We.velocity,stiffness:We.stiffness,damping:We.damping,mass:We.mass,isResolvedFromDuration:false,...r};if(!Yk(r,K5)&&Yk(r,q5))if(r.visualDuration){let t=r.visualDuration,i=2*Math.PI/(t*1.2),s=i*i,n=2*gr(.05,1,1-(r.bounce||0))*Math.sqrt(s);e={...e,mass:We.mass,stiffness:s,damping:n};}else {let t=Xk(r);e={...e,...t,mass:We.mass},e.isResolvedFromDuration=true;}return e}function Ds(r=We.visualDuration,e=We.bounce){let t=typeof r!="object"?{visualDuration:r,keyframes:[0,1],bounce:e}:r,{restSpeed:i,restDelta:s}=t,n=t.keyframes[0],o=t.keyframes[t.keyframes.length-1],a={done:false,value:n},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=Z5({...t,velocity:-nr(t.velocity||0)}),x=d||0,_=l/(2*Math.sqrt(u*c)),g=o-n,m=nr(Math.sqrt(u/c)),b=Math.abs(g)<5;i||(i=b?We.restSpeed.granular:We.restSpeed.default),s||(s=b?We.restDelta.granular:We.restDelta.default);let v;if(_<1){let A=w0(m,_);v=E=>{let w=Math.exp(-_*m*E);return o-w*((x+_*m*g)/A*Math.sin(A*E)+g*Math.cos(A*E))};}else if(_===1)v=A=>o-Math.exp(-m*A)*(g+(x+m*g)*A);else {let A=m*Math.sqrt(_*_-1);v=E=>{let w=Math.exp(-_*m*E),M=Math.min(A*E,300);return o-w*((x+_*m*g)*Math.sinh(M)+A*g*Math.cosh(M))/A};}let S={calculatedDuration:f&&h||null,next:A=>{let E=v(A);if(f)a.done=A>=h;else {let w=A===0?x:0;_<1&&(w=A===0?bt(x):C0(v,A,E));let M=Math.abs(w)<=i,P=Math.abs(o-E)<=s;a.done=M&&P;}return a.value=a.done?o:E,a},toString:()=>{let A=Math.min(Qc(S),2e4),E=A0(w=>S.next(A*w).value,A,30);return A+"ms "+E},toTransition:()=>{}};return S}Ds.applyToOptions=r=>{let e=Sp(r,100,Ds);return r.ease=e.ease,r.duration=bt(e.duration),r.type="keyframes",r};function Ep({keyframes:r,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:n=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){let h=r[0],d={done:false,value:h},f=M=>a!==void 0&&M<a||u!==void 0&&M>u,x=M=>a===void 0?u:u===void 0||Math.abs(a-M)<Math.abs(u-M)?a:u,_=t*e,g=h+_,m=o===void 0?g:o(g);m!==g&&(_=m-h);let b=M=>-_*Math.exp(-M/i),v=M=>m+b(M),S=M=>{let P=b(M),U=v(M);d.done=Math.abs(P)<=l,d.value=d.done?m:U;},A,E,w=M=>{f(d.value)&&(A=M,E=Ds({keyframes:[d.value,x(d.value)],velocity:C0(v,M,d.value),damping:s,stiffness:n,restDelta:l,restSpeed:c}));};return w(0),{calculatedDuration:null,next:M=>{let P=false;return !E&&A===void 0&&(P=true,S(M),w(M)),A!==void 0&&M>=A?E.next(M-A):(!P&&S(M),d)}}}function Q5(r,e,t){let i=[],s=t||$t.mix||E0,n=r.length-1;for(let o=0;o<n;o++){let a=s(r[o],r[o+1]);if(e){let u=Array.isArray(e)?e[o]||Pr:e;a=mu(u,a);}i.push(a);}return i}function jk(r,e,{clamp:t=true,ease:i,mixer:s}={}){let n=r.length;if(Pt(n===e.length,"Both input and output ranges must be the same length","range-length"),n===1)return ()=>e[0];if(n===2&&e[0]===e[1])return ()=>e[1];let o=r[0]===r[1];r[0]>r[n-1]&&(r=[...r].reverse(),e=[...e].reverse());let a=Q5(e,i,s),u=a.length,l=c=>{if(o&&c<r[0])return e[0];let h=0;if(u>1)for(;h<r.length-2&&!(c<r[h+1]);h++);let d=gu(r[h],r[h+1],c);return a[h](d)};return t?c=>l(gr(r[0],r[n-1],c)):l}function Ap(r,e){let t=r[r.length-1];for(let i=1;i<=e;i++){let s=gu(0,e,i);r.push(Si(t,1,s));}}function Cp(r){let e=[0];return Ap(e,r.length-1),e}function $k(r,e){return r.map(t=>t*e)}function J5(r,e){return r.map(()=>e||pp).splice(0,r.length-1)}function io({duration:r=300,keyframes:e,times:t,ease:i="easeInOut"}){let s=mp(i)?i.map(x0):x0(i),n={done:false,value:e[0]},o=$k(t&&t.length===e.length?t:Cp(e),r),a=jk(o,e,{ease:Array.isArray(s)?s:J5(e,s)});return {calculatedDuration:r,next:u=>(n.value=a(u),n.done=u>=r,n)}}var eL=r=>r!==null;function Jc(r,{repeat:e,repeatType:t="loop"},i,s=1){let n=r.filter(eL),a=s<0||e&&t!=="loop"&&e%2===1?0:n.length-1;return !a||i===void 0?n[a]:i}var tL={decay:Ep,inertia:Ep,tween:io,keyframes:io,spring:Ds};function P0(r){typeof r.type=="string"&&(r.type=tL[r.type]);}var so=class{constructor(){this.updateFinished();}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e;});}notifyFinished(){this.resolve();}then(e,t){return this.finished.then(e,t)}};var rL=r=>r/100,Is=class extends so{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=false,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==Bt.now()&&this.tick(Bt.now()),this.isStopped=true,this.state!=="idle"&&(this.teardown(),this.options.onStop?.());},this.options=e,this.initAnimation(),this.play(),e.autoplay===false&&this.pause();}initAnimation(){let{options:e}=this;P0(e);let{type:t=io,repeat:i=0,repeatDelay:s=0,repeatType:n,velocity:o=0}=e,{keyframes:a}=e,u=t||io;process.env.NODE_ENV!=="production"&&u!==io&&Pt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),u!==io&&typeof a[0]!="number"&&(this.mixKeyframes=mu(rL,E0(a[0],a[1])),a=[0,100]);let l=u({...e,keyframes:a});n==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=Qc(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=l;}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t;}tick(e,t=false){let{generator:i,totalDuration:s,mixKeyframes:n,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return i.next(0);let{delay:l=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:f,type:x,onUpdate:_,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let m=this.currentTime-l*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?m<0:m>s;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,S=i;if(h){let M=Math.min(this.currentTime,s)/a,P=Math.floor(M),U=M%1;!U&&M>=1&&(U=1),U===1&&P--,P=Math.min(P,h+1),!!(P%2)&&(d==="reverse"?(U=1-U,f&&(U-=f/a)):d==="mirror"&&(S=o)),v=gr(0,1,U)*a;}let A=b?{done:false,value:c[0]}:S.next(v);n&&(A.value=n(A.value));let{done:E}=A;!b&&u!==null&&(E=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);let w=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return w&&x!==Ep&&(A.value=Jc(c,this.options,g,this.speed)),_&&_(A.value),w&&this.finish(),A}then(e,t){return this.finished.then(e,t)}get duration(){return nr(this.calculatedDuration)}get time(){return nr(this.currentTime)}set time(e){e=bt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(false);}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Bt.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=nr(this.currentTime));}play(){if(this.isStopped)return;let{driver:e=zk,startTime:t}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),this.options.onPlay?.();let i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=t??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start();}pause(){this.state="paused",this.updateTime(Bt.now()),this.holdTime=this.currentTime;}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null;}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.();}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.();}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null;}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0);}sample(e){return this.startTime=0,this.tick(e,true)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function qk(r){for(let e=1;e<r.length;e++)r[e]??(r[e]=r[e-1]);}var bu=r=>r*180/Math.PI,kw=r=>{let e=bu(Math.atan2(r[1],r[0]));return Fw(e)},iL={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:r=>(Math.abs(r[0])+Math.abs(r[3]))/2,rotate:kw,rotateZ:kw,skewX:r=>bu(Math.atan(r[1])),skewY:r=>bu(Math.atan(r[2])),skew:r=>(Math.abs(r[1])+Math.abs(r[2]))/2},Fw=r=>(r=r%360,r<0&&(r+=360),r),Kk=kw,Zk=r=>Math.sqrt(r[0]*r[0]+r[1]*r[1]),Qk=r=>Math.sqrt(r[4]*r[4]+r[5]*r[5]),sL={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Zk,scaleY:Qk,scale:r=>(Zk(r)+Qk(r))/2,rotateX:r=>Fw(bu(Math.atan2(r[6],r[5]))),rotateY:r=>Fw(bu(Math.atan2(-r[2],r[0]))),rotateZ:Kk,rotate:Kk,skewX:r=>bu(Math.atan(r[4])),skewY:r=>bu(Math.atan(r[1])),skew:r=>(Math.abs(r[1])+Math.abs(r[4]))/2};function wp(r){return r.includes("scale")?1:0}function Pp(r,e){if(!r||r==="none")return wp(e);let t=r.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),i,s;if(t)i=sL,s=t;else {let a=r.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=iL,s=a;}if(!s)return wp(e);let n=i[e],o=s[1].split(",").map(nL);return typeof n=="function"?n(o):o[n]}var Ow=(r,e)=>{let{transform:t="none"}=getComputedStyle(r);return Pp(t,e)};function nL(r){return parseFloat(r.trim())}var Ei=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Mr=new Set(Ei);var Gw=r=>r===ts||r===Q,oL=new Set(["x","y","z"]),aL=Ei.filter(r=>!oL.has(r));function Jk(r){let e=[];return aL.forEach(t=>{let i=r.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0));}),e}var no={width:({x:r},{paddingLeft:e="0",paddingRight:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),height:({y:r},{paddingTop:e="0",paddingBottom:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),top:(r,{top:e})=>parseFloat(e),left:(r,{left:e})=>parseFloat(e),bottom:({y:r},{top:e})=>parseFloat(e)+(r.max-r.min),right:({x:r},{left:e})=>parseFloat(e)+(r.max-r.min),x:(r,{transform:e})=>Pp(e,"x"),y:(r,{transform:e})=>Pp(e,"y")};no.translateX=no.x;no.translateY=no.y;var vu=new Set,Uw=false,Lw=false,Nw=false;function eF(){if(Lw){let r=Array.from(vu).filter(i=>i.needsMeasurement),e=new Set(r.map(i=>i.element)),t=new Map;e.forEach(i=>{let s=Jk(i);s.length&&(t.set(i,s),i.render());}),r.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();let s=t.get(i);s&&s.forEach(([n,o])=>{i.getValue(n)?.set(o);});}),r.forEach(i=>i.measureEndState()),r.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY);});}Lw=false,Uw=false,vu.forEach(r=>r.complete(Nw)),vu.clear();}function tF(){vu.forEach(r=>{r.readKeyframes(),r.needsMeasurement&&(Lw=true);});}function Vw(){Nw=true,tF(),eF(),Nw=false;}var ks=class{constructor(e,t,i,s,n,o=false){this.state="pending",this.isAsync=false,this.needsMeasurement=false,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=s,this.element=n,this.isAsync=o;}scheduleResolve(){this.state="scheduled",this.isAsync?(vu.add(this),Uw||(Uw=true,qt.read(tF),qt.resolveKeyframes(eF))):(this.readKeyframes(),this.complete());}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:i,motionValue:s}=this;if(e[0]===null){let n=s?.get(),o=e[e.length-1];if(n!==void 0)e[0]=n;else if(i&&t){let a=i.readValue(t,o);a!=null&&(e[0]=a);}e[0]===void 0&&(e[0]=o),s&&n===void 0&&s.set(e[0]);}qk(e);}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=false){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),vu.delete(this);}cancel(){this.state==="scheduled"&&(vu.delete(this),this.state="pending");}resume(){this.state==="pending"&&this.scheduleResolve();}};var rF=r=>r.startsWith("--");function iF(r,e,t){rF(e)?r.style.setProperty(e,t):r.style[e]=t;}var sF=pu(()=>window.ScrollTimeline!==void 0);var nF={};function oF(r,e){let t=pu(r);return ()=>nF[e]??t()}var B0=oF(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"});}catch{return false}return true},"linearEasing");var Tu=([r,e,t,i])=>`cubic-bezier(${r}, ${e}, ${t}, ${i})`;var Hw={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tu([0,.65,.55,1]),circOut:Tu([.55,0,1,.45]),backIn:Tu([.31,.01,.66,-0.59]),backOut:Tu([.33,1.53,.69,.99])};function Ww(r,e){if(r)return typeof r=="function"?B0()?A0(r,e):"ease-out":xp(r)?Tu(r):Array.isArray(r)?r.map(t=>Ww(t,e)||Hw.easeOut):Hw[r]}function aF(r,e,t,{delay:i=0,duration:s=300,repeat:n=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){let c={[e]:t};u&&(c.offset=u);let h=Ww(a,s);Array.isArray(h)&&(c.easing=h);let d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:n+1,direction:o==="reverse"?"alternate":"normal"};l&&(d.pseudoElement=l);let f=r.animate(c,d);return f}function Su(r){return typeof r=="function"&&"applyToOptions"in r}function uF({type:r,...e}){return Su(r)&&B0()?r.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}var M0=class extends so{constructor(e){if(super(),this.finishedTime=null,this.isStopped=false,!e)return;let{element:t,name:i,keyframes:s,pseudoElement:n,allowFlatten:o=false,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!n,this.allowFlatten=o,this.options=e,Pt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let l=uF(e);this.animation=aF(t,i,s,l,n),l.autoplay===false&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){let c=Jc(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):iF(t,i,c),this.animation.cancel();}u?.(),this.notifyFinished();};}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished());}pause(){this.animation.pause();}complete(){this.animation.finish?.();}cancel(){try{this.animation.cancel();}catch{}}stop(){if(this.isStopped)return;this.isStopped=true;let{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel());}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.();}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return nr(Number(e))}get time(){return nr(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=bt(e);}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e;}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e;}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&sF()?(this.animation.timeline=e,Pr):t(this)}};var lF={anticipate:hp,backInOut:cp,circInOut:fp};function uL(r){return r in lF}function cF(r){typeof r.ease=="string"&&uL(r.ease)&&(r.ease=lF[r.ease]);}var hF=10,R0=class extends M0{constructor(e){cF(e),P0(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e;}updateMotionValue(e){let{motionValue:t,onUpdate:i,onComplete:s,element:n,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let a=new Is({...o,autoplay:false}),u=bt(this.finishedTime??this.time);t.setWithVelocity(a.sample(u-hF).value,a.sample(u).value,hF),a.stop();}};var zw=(r,e)=>e==="zIndex"?false:!!(typeof r=="number"||Array.isArray(r)||typeof r=="string"&&(Br.test(r)||r==="0")&&!r.startsWith("url("));function lL(r){let e=r[0];if(r.length===1)return true;for(let t=0;t<r.length;t++)if(r[t]!==e)return true}function dF(r,e,t,i){let s=r[0];if(s===null)return false;if(e==="display"||e==="visibility")return true;let n=r[r.length-1],o=zw(s,e),a=zw(n,e);return es(o===a,`You are trying to animate ${e} from "${s}" to "${n}". "${o?n:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?false:lL(r)||(t==="spring"||Su(t))&&i}function eh(r){r.duration=0,r.type;}var cL=new Set(["opacity","clipPath","filter","transform"]),hL=pu(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function fF(r){let{motionValue:e,name:t,repeatDelay:i,repeatType:s,damping:n,type:o}=r;if(!(e?.owner?.current instanceof HTMLElement))return false;let{onUpdate:u,transformTemplate:l}=e.owner.getProps();return hL()&&t&&cL.has(t)&&(t!=="transform"||!l)&&!u&&!i&&s!=="mirror"&&n!==0&&o!=="inertia"}var dL=40,Bp=class extends so{constructor({autoplay:e=true,delay:t=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel();},this.createdAt=Bt.now();let d={autoplay:e,delay:t,type:i,repeat:s,repeatDelay:n,repeatType:o,name:u,motionValue:l,element:c,...h},f=c?.KeyframeResolver||ks;this.keyframeResolver=new f(a,(x,_,g)=>this.onKeyframesResolved(x,_,d,!g),u,l,c),this.keyframeResolver?.scheduleResolve();}onKeyframesResolved(e,t,i,s){this.keyframeResolver=void 0;let{name:n,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=i;this.resolvedAt=Bt.now(),dF(e,n,o,a)||(($t.instantAnimations||!u)&&c?.(Jc(e,i,t)),e[0]=e[e.length-1],eh(i),i.repeat=0);let d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>dL?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...i,keyframes:e},f=!l&&fF(d)?new R0({...d,element:d.motionValue.owner.current}):new Is(d);f.finished.then(()=>this.notifyFinished()).catch(Pr),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f;}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Vw()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e;}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e;}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play();}pause(){this.animation.pause();}complete(){this.animation.complete();}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel();}};var D0=class{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean);}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t;}attachTimeline(e){let t=this.animations.map(i=>i.attachTimeline(e));return ()=>{t.forEach((i,s)=>{i&&i(),this.animations[s].stop();});}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e);}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e);}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]());}play(){this.runAll("play");}pause(){this.runAll("pause");}cancel(){this.runAll("cancel");}complete(){this.runAll("complete");}};var Mp=class extends D0{then(e,t){return this.finished.finally(e).then(()=>{})}};var fL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pL(r){let e=fL.exec(r);if(!e)return [,];let[,t,i,s]=e;return [`--${t??i}`,s]}var mL=4;function Xw(r,e,t=1){Pt(t<=mL,`Max CSS variable fallback depth detected in property "${r}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[i,s]=pL(r);if(!i)return;let n=window.getComputedStyle(e).getPropertyValue(i);if(n){let o=n.trim();return op(o)?parseFloat(o):o}return yu(s)?Xw(s,e,t+1):s}function Rp(r,e){return r?.[e]??r?.default??r}var Dp=new Set(["width","height","top","left","right","bottom",...Ei]);var pF={test:r=>r==="auto",parse:r=>r};var I0=r=>e=>e.test(r);var Yw=[ts,Q,Rs,Ti,Pw,ww,pF],jw=r=>Yw.find(I0(r));function mF(r){return typeof r=="number"?r===0:r!==null?r==="none"||r==="0"||ap(r):true}var gL=new Set(["brightness","contrast","saturate","opacity"]);function xL(r){let[e,t]=r.slice(0,-1).split("(");if(e==="drop-shadow")return r;let[i]=t.match(qc)||[];if(!i)return r;let s=t.replace(i,""),n=gL.has(e)?1:0;return i!==t&&(n*=100),e+"("+n+s+")"}var _L=/\b([a-z-]*)\(.*?\)/gu,Ip={...Br,getAnimatableNone:r=>{let e=r.match(_L);return e?e.map(xL).join(" "):r}};var $w={...ts,transform:Math.round};var gF={rotate:Ti,rotateX:Ti,rotateY:Ti,rotateZ:Ti,scale:bp,scaleX:bp,scaleY:bp,scaleZ:bp,skew:Ti,skewX:Ti,skewY:Ti,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:Ms,originX:v0,originY:v0,originZ:Q};var Eu={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,radius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,backgroundPositionX:Q,backgroundPositionY:Q,...gF,zIndex:$w,fillOpacity:Ms,strokeOpacity:Ms,numOctaves:$w};var xF={...Eu,color:Ze,backgroundColor:Ze,outlineColor:Ze,fill:Ze,stroke:Ze,borderColor:Ze,borderTopColor:Ze,borderRightColor:Ze,borderBottomColor:Ze,borderLeftColor:Ze,filter:Ip,WebkitFilter:Ip},kp=r=>xF[r];function Fp(r,e){let t=kp(r);return t!==Ip&&(t=Br),t.getAnimatableNone?t.getAnimatableNone(e):void 0}var yL=new Set(["auto","none","0"]);function _F(r,e,t){let i=0,s;for(;i<r.length&&!s;){let n=r[i];typeof n=="string"&&!yL.has(n)&&ro(n).values.length&&(s=r[i]),i++;}if(s&&t)for(let n of e)r[n]=Fp(t,s);}var Op=class extends ks{constructor(e,t,i,s,n){super(e,t,i,s,n,true);}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let l=e[u];if(typeof l=="string"&&(l=l.trim(),yu(l))){let c=Xw(l,t.current);c!==void 0&&(e[u]=c),u===e.length-1&&(this.finalKeyframe=l);}}if(this.resolveNoneKeyframes(),!Dp.has(i)||e.length!==2)return;let[s,n]=e,o=jw(s),a=jw(n);if(o!==a)if(Gw(o)&&Gw(a))for(let u=0;u<e.length;u++){let l=e[u];typeof l=="string"&&(e[u]=parseFloat(l));}else no[i]&&(this.needsMeasurement=true);}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||mF(e[s]))&&i.push(s);i.length&&_F(e,i,t);}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=no[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let s=t[t.length-1];s!==void 0&&e.getValue(i,s).jump(s,false);}measureEndState(){let{element:e,name:t,unresolvedKeyframes:i}=this;if(!e||!e.current)return;let s=e.getValue(t);s&&s.jump(this.measuredOrigin,false);let n=i.length-1,o=i[n];i[n]=no[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u);}),this.resolveNoneKeyframes();}};function qw(r,e,t){if(r instanceof EventTarget)return [r];if(typeof r=="string"){let i=document;let s=t?.[r]??i.querySelectorAll(r);return s?Array.from(s):[]}return Array.from(r)}var Gp=(r,e)=>e&&typeof r=="number"?e.transform(r):r;var yF=30,bL=r=>!isNaN(parseFloat(r)),k0=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{let s=Bt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let n of this.dependents)n.dirty();},this.hasAnimated=false,this.setCurrent(e),this.owner=t.owner;}setCurrent(e){this.current=e,this.updatedAt=Bt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=bL(this.current));}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt;}onChange(e){return process.env.NODE_ENV!=="production"&&lp(false,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new xu);let i=this.events[e].add(t);return e==="change"?()=>{i(),qt.read(()=>{this.events.change.getSize()||this.stop();});}:i}clearListeners(){for(let e in this.events)this.events[e].clear();}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t;}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e);}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i;}jump(e,t=true){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}dirty(){this.events.change?.notify(this.current);}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e);}removeDependent(e){this.dependents&&this.dependents.delete(e);}get(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=Bt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>yF)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,yF);return up(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=true,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify();}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation();})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation();}isAnimating(){return !!this.animation}clearAnimation(){delete this.animation;}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}};function is(r,e){return new k0(r,e)}var{schedule:Zw}=_0(queueMicrotask,false);function Up(r){return Tw(r)&&"ownerSVGElement"in r}function Qw(r){return Up(r)&&r.tagName==="svg"}var ze=r=>!!(r&&r.getVelocity);var TL=[...Yw,Ze,Br],Jw=r=>TL.find(I0(r));function Lp(r){return typeof r=="object"&&!Array.isArray(r)}function F0(r,e,t,i){return typeof r=="string"&&Lp(e)?qw(r,t,i):r instanceof NodeList?Array.from(r):Array.isArray(r)?r:[r]}function bF(r,e,t){return r*(e+1)}function eP(r,e,t,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,r+parseFloat(e)):e==="<"?t:e.startsWith("<")?Math.max(0,t+parseFloat(e.slice(1))):i.get(e)??r}function SL(r,e,t){for(let i=0;i<r.length;i++){let s=r[i];s.at>e&&s.at<t&&(fu(r,s),i--);}}function vF(r,e,t,i,s,n){SL(r,s,n);for(let o=0;o<e.length;o++)r.push({value:e[o],at:Si(s,n,i[o]),easing:gp(t,o)});}function TF(r,e){for(let t=0;t<r.length;t++)r[t]=r[t]/(e+1);}function SF(r,e){return r.at===e.at?r.value===null?1:e.value===null?-1:0:r.at-e.at}var EL="easeInOut",AL=20;function CF(r,{defaultTransition:e={},...t}={},i,s){let n=e.duration||.3,o=new Map,a=new Map,u={},l=new Map,c=0,h=0,d=0;for(let f=0;f<r.length;f++){let x=r[f];if(typeof x=="string"){l.set(x,h);continue}else if(!Array.isArray(x)){l.set(x.name,eP(h,x.at,c,l));continue}let[_,g,m={}]=x;m.at!==void 0&&(h=eP(h,m.at,c,l));let b=0,v=(S,A,E,w=0,M=0)=>{let P=CL(S),{delay:U=0,times:k=Cp(P),type:J="keyframes",repeat:he,repeatType:tt,repeatDelay:ss=0,...W}=A,{ease:j=e.ease||"easeOut",duration:xr}=A,Be=typeof U=="function"?U(w,M):U,Kr=P.length,Fs=Su(J)?J:s?.[J||"keyframes"];if(Kr<=2&&Fs){let Ai=100;if(Kr===2&&BL(P)){let Us=P[1]-P[0];Ai=Math.abs(Us);}let Ci={...W};xr!==void 0&&(Ci.duration=bt(xr));let ao=Sp(Ci,Ai,Fs);j=ao.ease,xr=ao.duration;}xr??(xr=n);let Os=h+Be;k.length===1&&k[0]===0&&(k[1]=1);let Gs=k.length-P.length;if(Gs>0&&Ap(k,Gs),P.length===1&&P.unshift(null),he){Pt(he<AL,"Repeat count too high, must be less than 20","repeat-count-high"),xr=bF(xr,he);let Ai=[...P],Ci=[...k];j=Array.isArray(j)?[...j]:[j];let ao=[...j];for(let Us=0;Us<he;Us++){P.push(...Ai);for(let wi=0;wi<Ai.length;wi++)k.push(Ci[wi]+(Us+1)),j.push(wi===0?"linear":gp(ao,wi-1));}TF(k,he);}let nh=Os+xr;vF(E,P,j,k,Os,nh),b=Math.max(Be+xr,b),d=Math.max(nh,d);};if(ze(_)){let S=EF(_,a);v(g,m,AF("default",S));}else {let S=F0(_,g,i,u),A=S.length;for(let E=0;E<A;E++){g=g,m=m;let w=S[E],M=EF(w,a);for(let P in g)v(g[P],wL(m,P),AF(P,M),E,A);}}c=h,h+=b;}return a.forEach((f,x)=>{for(let _ in f){let g=f[_];g.sort(SF);let m=[],b=[],v=[];for(let A=0;A<g.length;A++){let{at:E,value:w,easing:M}=g[A];m.push(w),b.push(gu(0,d,E)),v.push(M||"easeOut");}b[0]!==0&&(b.unshift(0),m.unshift(m[0]),v.unshift(EL)),b[b.length-1]!==1&&(b.push(1),m.push(null)),o.has(x)||o.set(x,{keyframes:{},transition:{}});let S=o.get(x);S.keyframes[_]=m,S.transition[_]={...e,duration:d,ease:v,times:b,...t};}}),o}function EF(r,e){return !e.has(r)&&e.set(r,{}),e.get(r)}function AF(r,e){return e[r]||(e[r]=[]),e[r]}function CL(r){return Array.isArray(r)?r:[r]}function wL(r,e){return r&&r[e]?{...r,...r[e]}:{...r}}var PL=r=>typeof r=="number",BL=r=>r.every(PL);var oo=new WeakMap;var wF=r=>Array.isArray(r);function PF(r){let e=[{},{}];return r?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity();}),e}function O0(r,e,t,i){if(typeof e=="function"){let[s,n]=PF(i);e=e(t!==void 0?t:r.custom,s,n);}if(typeof e=="string"&&(e=r.variants&&r.variants[e]),typeof e=="function"){let[s,n]=PF(i);e=e(t!==void 0?t:r.custom,s,n);}return e}function BF(r,e,t){let i=r.getProps();return O0(i,e,i.custom,r)}function ML(r,e,t){r.hasValue(e)?r.getValue(e).set(t):r.addValue(e,is(t));}function RL(r){return wF(r)?r[r.length-1]||0:r}function MF(r,e){let t=BF(r,e),{transitionEnd:i={},transition:s={},...n}=t||{};n={...n,...i};for(let o in n){let a=RL(n[o]);ML(r,o,a);}}function RF(r){return !!(ze(r)&&r.add)}function DF(r,e){let t=r.getValue("willChange");if(RF(t))return t.add(e);if(!t&&$t.WillChange){let i=new $t.WillChange("auto");r.addValue("willChange",i),i.add(e);}}var th=r=>r.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var DL="framerAppearId",IF="data-"+th(DL);function kF(r){return r.props[IF]}var IL=r=>r!==null;function FF(r,{repeat:e,repeatType:t="loop"},i){let s=r.filter(IL),n=e&&t!=="loop"&&e%2===1?0:s.length-1;return !n||i===void 0?s[n]:i}var kL={type:"spring",stiffness:500,damping:25,restSpeed:10},FL=r=>({type:"spring",stiffness:550,damping:r===0?2*Math.sqrt(550):30,restSpeed:10}),OL={type:"keyframes",duration:.8},GL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},OF=(r,{keyframes:e})=>e.length>2?OL:Mr.has(r)?r.startsWith("scale")?FL(e[1]):kL:GL;function GF({when:r,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:s,repeat:n,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return !!Object.keys(c).length}var G0=(r,e,t,i={},s,n)=>o=>{let a=Rp(i,r)||{},u=a.delay||i.delay||0,{elapsed:l=0}=i;l=l-bt(u);let c={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d);},onComplete:()=>{o(),a.onComplete&&a.onComplete();},name:r,motionValue:e,element:n?void 0:s};GF(a)||Object.assign(c,OF(r,c)),c.duration&&(c.duration=bt(c.duration)),c.repeatDelay&&(c.repeatDelay=bt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=false;if((c.type===false||c.duration===0&&!c.repeatDelay)&&(eh(c),c.delay===0&&(h=true)),($t.instantAnimations||$t.skipAnimations)&&(h=true,eh(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!n&&e.get()!==void 0){let d=FF(c.keyframes,a);if(d!==void 0){qt.update(()=>{c.onUpdate(d),c.onComplete();});return}}return a.isSync?new Is(c):new Bp(c)};function UL({protectedKeys:r,needsAnimating:e},t){let i=r.hasOwnProperty(t)&&e[t]!==true;return e[t]=false,i}function UF(r,e,{delay:t=0,transitionOverride:i,type:s}={}){let{transition:n=r.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(n=i);let u=[],l=s&&r.animationState&&r.animationState.getState()[s];for(let c in a){let h=r.getValue(c,r.latestValues[c]??null),d=a[c];if(d===void 0||l&&UL(l,c))continue;let f={delay:t,...Rp(n||{},c)},x=h.get();if(x!==void 0&&!h.isAnimating&&!Array.isArray(d)&&d===x&&!f.velocity)continue;let _=false;if(window.MotionHandoffAnimation){let m=kF(r);if(m){let b=window.MotionHandoffAnimation(m,c,qt);b!==null&&(f.startTime=b,_=true);}}DF(r,c),h.start(G0(c,h,d,r.shouldReduceMotion&&Dp.has(c)?{type:false}:f,r,_));let g=h.animation;g&&u.push(g);}return o&&Promise.all(u).then(()=>{qt.update(()=>{o&&MF(r,o);});}),u}function LF({top:r,left:e,right:t,bottom:i}){return {x:{min:e,max:t},y:{min:r,max:i}}}function NF(r,e){if(!e)return r;let t=e({x:r.left,y:r.top}),i=e({x:r.right,y:r.bottom});return {top:t.y,left:t.x,bottom:i.y,right:i.x}}function VF(r,e){return LF(NF(r.getBoundingClientRect(),e))}var HF={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},U0={};for(let r in HF)U0[r]={isEnabled:e=>HF[r].some(t=>!!e[t])};var WF=()=>({min:0,max:0}),rh=()=>({x:WF(),y:WF()});var zF=typeof window<"u";var Np={current:null},L0={current:false};function XF(){if(L0.current=true,!!zF)if(window.matchMedia){let r=window.matchMedia("(prefers-reduced-motion)"),e=()=>Np.current=r.matches;r.addEventListener("change",e),e();}else Np.current=false;}function YF(r){return r!==null&&typeof r=="object"&&typeof r.start=="function"}function jF(r){return typeof r=="string"||Array.isArray(r)}var LL=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$F=["initial",...LL];function tP(r){return YF(r.animate)||$F.some(e=>jF(r[e]))}function qF(r){return !!(tP(r)||r.variants)}function KF(r,e,t){for(let i in e){let s=e[i],n=t[i];if(ze(s))r.addValue(i,s);else if(ze(n))r.addValue(i,is(s,{owner:r}));else if(n!==s)if(r.hasValue(i)){let o=r.getValue(i);o.liveStyle===true?o.jump(s):o.hasAnimated||o.set(s);}else {let o=r.getStaticValue(i);r.addValue(i,is(o!==void 0?o:s,{owner:r}));}}for(let i in t)e[i]===void 0&&r.removeValue(i);return e}var ZF=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ih=class{scrapeMotionValuesFromProps(e,t,i){return {}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:n,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=false,this.isControllingVariants=false,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ks,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection));},this.renderScheduledAt=0,this.scheduleRender=()=>{let d=Bt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,qt.render(this.render,false,true));};let{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=t.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!n,this.isControllingVariants=tP(t),this.isVariantNode=qF(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...h}=this.scrapeMotionValuesFromProps(t,{},this);for(let d in h){let f=h[d];u[d]!==void 0&&ze(f)&&f.set(u[d]);}}mount(e){this.current=e,oo.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),L0.current||XF(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?false:this.reducedMotionConfig==="always"?true:Np.current,process.env.NODE_ENV!=="production"&&lp(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext);}unmount(){this.projection&&this.projection.unmount(),jc(this.notifyUpdate),jc(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=false);}this.current=null;}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e);}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e);}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let i=Mr.has(e);i&&this.onBindTransform&&this.onBindTransform();let s=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&qt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=true),this.scheduleRender();}),n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{s(),n&&n(),t.owner&&t.stop();});}sortNodePosition(e){return !this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in U0){let t=U0[e];if(!t)continue;let{isEnabled:i,Feature:s}=t;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){let n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=true);}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props);}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):rh()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t;}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<ZF.length;i++){let s=ZF[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);let n="on"+s,o=e[n];o&&(this.propEventSubscriptions[s]=this.on(s,o));}this.prevMotionValues=KF(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue();}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get());}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState);}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=is(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(op(i)||ap(i))?i=parseFloat(i):!Jw(i)&&Br.test(t)&&(i=Fp(e,t)),this.setBaseTarget(e,ze(i)?i.get():i)),ze(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t;}getBaseTarget(e){let{initial:t}=this.props,i;if(typeof t=="string"||typeof t=="object"){let n=O0(this.props,t,this.presenceContext?.custom);n&&(i=n[e]);}if(t&&i!==void 0)return i;let s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!ze(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new xu),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t);}scheduleRenderMicrotask(){Zw.render(this.render);}};var sh=class extends ih{constructor(){super(...arguments),this.KeyframeResolver=Op;}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e];}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ze(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`);}));}};var NL={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},VL=Ei.length;function QF(r,e,t){let i="",s=true;for(let n=0;n<VL;n++){let o=Ei[n],a=r[o];if(a===void 0)continue;let u=true;if(typeof a=="number"?u=a===(o.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||t){let l=Gp(a,Eu[o]);if(!u){s=false;let c=NL[o]||o;i+=`${c}(${l}) `;}t&&(e[o]=l);}}return i=i.trim(),t?i=t(e,s?"":i):s&&(i="none"),i}function N0(r,e,t){let{style:i,vars:s,transformOrigin:n}=r,o=false,a=false;for(let u in e){let l=e[u];if(Mr.has(u)){o=true;continue}else if(yp(u)){s[u]=l;continue}else {let c=Gp(l,Eu[u]);u.startsWith("origin")?(a=true,n[u]=c):i[u]=c;}}if(e.transform||(o||t?i.transform=QF(e,r.transform,t):i.transform&&(i.transform="none")),a){let{originX:u="50%",originY:l="50%",originZ:c=0}=n;i.transformOrigin=`${u} ${l} ${c}`;}}function V0(r,{style:e,vars:t},i,s){let n=r.style,o;for(o in e)n[o]=e[o];s?.applyProjectionStyles(n,i);for(o in t)n.setProperty(o,t[o]);}var JF={};function eO(r,{layout:e,layoutId:t}){return Mr.has(r)||r.startsWith("origin")||(e||t!==void 0)&&(!!JF[r]||r==="opacity")}function H0(r,e,t){let{style:i}=r,s={};for(let n in i)(ze(i[n])||e.style&&ze(e.style[n])||eO(n,r)||t?.getValue(n)?.liveStyle!==void 0)&&(s[n]=i[n]);return s}function HL(r){return window.getComputedStyle(r)}var W0=class extends sh{constructor(){super(...arguments),this.type="html",this.renderInstance=V0;}readValueFromInstance(e,t){if(Mr.has(t))return this.projection?.isProjecting?wp(t):Ow(e,t);{let i=HL(e),s=(yp(t)?i.getPropertyValue(t):i[t])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:t}){return VF(e,t)}build(e,t,i){N0(e,t,i.transformTemplate);}scrapeMotionValuesFromProps(e,t,i){return H0(e,t,i)}};function WL(r,e){return r in e}var z0=class extends ih{constructor(){super(...arguments),this.type="object";}readValueFromInstance(e,t){if(WL(t,e)){let i=e[t];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e];}measureInstanceViewportBox(){return rh()}build(e,t){Object.assign(e.output,t);}renderInstance(e,{output:t}){Object.assign(e,t);}sortInstanceNodePosition(){return 0}};var zL={offset:"stroke-dashoffset",array:"stroke-dasharray"},XL={offset:"strokeDashoffset",array:"strokeDasharray"};function tO(r,e,t=1,i=0,s=true){r.pathLength=1;let n=s?zL:XL;r[n.offset]=Q.transform(-i);let o=Q.transform(e),a=Q.transform(t);r[n.array]=`${o} ${a}`;}function rO(r,{attrX:e,attrY:t,attrScale:i,pathLength:s,pathSpacing:n=1,pathOffset:o=0,...a},u,l,c){if(N0(r,a,l),u){r.style.viewBox&&(r.attrs.viewBox=r.style.viewBox);return}r.attrs=r.style,r.style={};let{attrs:h,style:d}=r;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),t!==void 0&&(h.y=t),i!==void 0&&(h.scale=i),s!==void 0&&tO(h,s,n,o,false);}var X0=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);var iO=r=>typeof r=="string"&&r.toLowerCase()==="svg";function sO(r,e,t,i){V0(r,e,void 0,i);for(let s in e.attrs)r.setAttribute(X0.has(s)?s:th(s),e.attrs[s]);}function nO(r,e,t){let i=H0(r,e,t);for(let s in r)if(ze(r[s])||ze(e[s])){let n=Ei.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[n]=r[s];}return i}var Y0=class extends sh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=false,this.measureInstanceViewportBox=rh;}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Mr.has(t)){let i=kp(t);return i&&i.default||0}return t=X0.has(t)?t:th(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return nO(e,t,i)}build(e,t,i){rO(e,t,this.isSVGTag,i.transformTemplate,i.style);}renderInstance(e,t,i,s){sO(e,t,i,s);}mount(e){this.isSVGTag=iO(e.tagName),super.mount(e);}};function oO(r){let e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},t=Up(r)&&!Qw(r)?new Y0(e):new W0(e);t.mount(r),oo.set(r,t);}function aO(r){let e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},t=new z0(e);t.mount(r),oo.set(r,t);}function uO(r,e,t){let i=ze(r)?r:is(r);return i.start(G0("",i,e,t)),i.animation}function YL(r,e){return ze(r)||typeof r=="number"||typeof r=="string"&&!Lp(e)}function j0(r,e,t,i){let s=[];if(YL(r,e))s.push(uO(r,Lp(e)&&e.default||e,t&&(t.default||t)));else {let n=F0(r,e,i),o=n.length;Pt(!!o,"No valid elements provided.","no-valid-elements");for(let a=0;a<o;a++){let u=n[a];Pt(u!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");let l=u instanceof Element?oO:aO;oo.has(u)||l(u);let c=oo.get(u),h={...t};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),s.push(...UF(c,{...e,transition:h},{}));}}return s}function lO(r,e,t){let i=[];return CF(r,e,t,{spring:Ds}).forEach(({keyframes:n,transition:o},a)=>{i.push(...j0(a,n,o));}),i}function jL(r){return Array.isArray(r)&&r.some(Array.isArray)}function cO(r){function e(t,i,s){let n=[];jL(t)?n=lO(t,i,r):n=j0(t,i,s,r);let o=new Mp(n);return o}return e}var $0=cO();Te();function $L(r,e,t){if(Array.isArray(r)&&Array.isArray(r[0])){let i=r.map(s=>{let{ticker:n=new le,...o}=s[2]||{};return [s[0],s[1],{driver:a=>{let u=({lastTime:l})=>a(l);return {start:(l=true)=>{n.add(u),n.start();},stop:()=>n.remove(u),now:()=>n.lastTime}},...o}]});return $0(i,e)}else {let{ticker:i=new le}=t||{};return $0(r,e,{driver:s=>{let n=({lastTime:o})=>s(o);return {start:(o=true)=>{i.add(n),i.start();},stop:()=>i.remove(n),now:()=>i.lastTime}},...t||{}})}}var Qf=$L;var D=new Jf;mr.init({getScreen:()=>D.screen});
3315
+ `}function W8(r,e,t){let i=[],s=e.lines[0],n="",o=[],a=0;return t.wordWrap=false,r.forEach(u=>{let l=/^\s*$/.test(u),c=zI(u),h=n.length===0&&l;if(l&&!c&&h)return;c||(n+=u);let d=je.measureText(u,t);o.push({char:u,metric:d}),n.length>=s.length&&(i.push({line:n,chars:o,width:o.reduce((f,x)=>f+x.metric.width,0)}),o=[],n="",a++,s=e.lines[a]);}),i}function Nb(r){let{text:e,style:t,chars:i}=r,s=t,n=je.measureText(e,s),o=je.graphemeSegmenter(e),a=W8(o,n,s.clone()),u=s.align,l=n.lineWidths.reduce((g,m)=>Math.max(g,m),0),c=[],h=[],d=[],f=0,x=s.stroke?.width||0,_=s.dropShadow?.distance||0;return a.forEach((g,m)=>{let b=new q({label:`line-${m}`});b.y=f,h.push(b);let v=n.lineWidths[m],S=H8(u,v,l),A=new q({label:"word"});A.x=S,g.chars.forEach((E,w)=>{if(E.metric.width!==0){if(zI(E.char)){S+=E.metric.width-x;return}if(E.char===" ")A.children.length>0&&(d.push(A),b.addChild(A)),S+=E.metric.width+s.letterSpacing-x,A=new q({label:"word"}),A.x=S;else {let M;i.length>0?(M=i.shift(),M.text=E.char,M.style=s,M.setFromMatrix(I.IDENTITY),M.x=S-A.x-_*w):M=new pr({text:E.char,style:s,x:S-A.x-_*w}),c.push(M),A.addChild(M),S+=E.metric.width+s.letterSpacing-x;}}}),A.children.length>0&&(d.push(A),b.addChild(A)),f+=n.lineHeight;}),{chars:c,lines:h,words:d}}var ZC=p(()=>{fe();Dt();bs();If();});var XI,YI,jI=p(()=>{ui();ZC();Ub();XI=class Vb extends Wn{constructor(e){let t={...Vb.defaultOptions,...e};super(t);}static from(e,t){let i={...Vb.defaultOptions,...t,text:e.text,style:new Je(e.style)};return new Vb({...i})}splitFn(){return Nb({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};XI.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};YI=XI;});async function $I(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var qI=p(()=>{});function QC(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=z8[X8++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Se&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];QC(a,e,{...t});}}function JC(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];JC(o,e,{...t,index:n});}}var z8,X8,KI=p(()=>{Qs();z8=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],X8=0;});var ZI={};Wp(ZI,{AbstractBitmapFont:()=>vn,AbstractRenderer:()=>Ni,AbstractSplitText:()=>Wn,AbstractText:()=>$i,AccessibilitySystem:()=>wm,AlphaFilter:()=>pD,AlphaMask:()=>Eo,AlphaMaskPipe:()=>da,AnimatedSprite:()=>Ec,Application:()=>Zd,ApplicationInitHook:()=>ca,Assets:()=>ut,AssetsClass:()=>sf,BLEND_TO_NPM:()=>jm,BUFFER_TYPE:()=>Ga,BackgroundLoader:()=>Kl,BackgroundSystem:()=>u_,Batch:()=>Rh,BatchGeometry:()=>Xu,BatchTextureArray:()=>zu,BatchableGraphics:()=>xs,BatchableHTMLText:()=>_l,BatchableMesh:()=>Fi,BatchableSprite:()=>Vr,BatchableText:()=>ol,Batcher:()=>Qm,BatcherPipe:()=>Gd,BigPool:()=>De,BindGroup:()=>ht,BindGroupSystem:()=>ba,BitmapFont:()=>qa,BitmapFontManager:()=>li,BitmapText:()=>Hn,BitmapTextGraphics:()=>od,BitmapTextPipe:()=>Yo,BlendModeFilter:()=>ie,BlendModePipe:()=>ma,BlurFilter:()=>wf,BlurFilterPass:()=>Sc,Bounds:()=>be,BrowserAdapter:()=>Fm,Buffer:()=>Xe,BufferImageSource:()=>us,BufferResource:()=>Wi,BufferUsage:()=>ne,CLEAR:()=>dt,Cache:()=>me,CanvasObserver:()=>qs,CanvasPool:()=>Qt,CanvasPoolClass:()=>rd,CanvasSource:()=>xt,CanvasTextGenerator:()=>vs,CanvasTextMetrics:()=>je,CanvasTextPipe:()=>No,CanvasTextSystem:()=>Xo,Circle:()=>al,Color:()=>Z,ColorBlend:()=>fd,ColorBurnBlend:()=>pd,ColorDodgeBlend:()=>md,ColorMask:()=>Ao,ColorMaskPipe:()=>fa,ColorMatrixFilter:()=>gb,CompressedSource:()=>Wr,Container:()=>q,Culler:()=>Zy,CullerPlugin:()=>df,CustomRenderPipe:()=>sa,D3D10_RESOURCE_DIMENSION:()=>Wy,D3DFMT:()=>Jt,DATA_URI:()=>eM,DDS:()=>te,DEG_TO_RAD:()=>Zp,DEPRECATED_SCALE_MODES:()=>Of,DEPRECATED_WRAP_MODES:()=>Ff,DOMAdapter:()=>V,DOMContainer:()=>km,DOMPipe:()=>To,DRAW_MODES:()=>$D,DXGI_FORMAT:()=>Hy,DXGI_TO_TEXTURE_FORMAT:()=>Xt,DarkenBlend:()=>gd,DefaultBatcher:()=>Mo,DefaultShader:()=>Ku,DifferenceBlend:()=>xd,DisplacementFilter:()=>yb,DivideBlend:()=>_d,DynamicBitmapFont:()=>sd,Ellipse:()=>ul,EventBoundary:()=>Fu,EventEmitter:()=>de,EventSystem:()=>Ou,EventsTicker:()=>Dr,ExclusionBlend:()=>yd,ExtensionType:()=>y,ExtractSystem:()=>l_,FOURCC_TO_TEXTURE_FORMAT:()=>lf,FederatedContainer:()=>Im,FederatedEvent:()=>Di,FederatedMouseEvent:()=>ti,FederatedPointerEvent:()=>kt,FederatedWheelEvent:()=>Ir,FillGradient:()=>Wt,FillPattern:()=>oi,Filter:()=>St,FilterEffect:()=>Qr,FilterPipe:()=>Qo,FilterSystem:()=>Jo,FontStylePromiseCache:()=>ad,GAUSSIAN_VALUES:()=>Tc,GL_FORMATS:()=>Vl,GL_INTERNAL_FORMAT:()=>XA,GL_TARGETS:()=>zd,GL_TYPES:()=>xe,GL_WRAP_MODES:()=>_E,GenerateTextureSystem:()=>ga,Geometry:()=>Vt,GlBackBufferSystem:()=>N_,GlBatchAdaptor:()=>Oa,GlBuffer:()=>Nl,GlBufferSystem:()=>Ua,GlColorMaskSystem:()=>Na,GlContextSystem:()=>G_,GlEncoderSystem:()=>Va,GlGeometrySystem:()=>La,GlGraphicsAdaptor:()=>ka,GlLimitsSystem:()=>Ha,GlMeshAdaptor:()=>Fa,GlParticleContainerAdaptor:()=>tl,GlParticleContainerPipe:()=>Go,GlProgram:()=>Fe,GlProgramData:()=>zl,GlRenderTarget:()=>Hl,GlRenderTargetAdaptor:()=>Wl,GlRenderTargetSystem:()=>Xa,GlShaderSystem:()=>Ya,GlStateSystem:()=>ay,GlStencilSystem:()=>Wa,GlTexture:()=>Yl,GlTextureSystem:()=>$a,GlUboSystem:()=>za,GlUniformGroupSystem:()=>ja,GlobalUniformSystem:()=>xa,GpuBatchAdaptor:()=>ia,GpuBlendModesToPixi:()=>Gt,GpuBufferSystem:()=>va,GpuColorMaskSystem:()=>Ta,GpuDeviceSystem:()=>Dn,GpuEncoderSystem:()=>Sa,GpuGraphicsAdaptor:()=>ta,GpuGraphicsContext:()=>zh,GpuLimitsSystem:()=>Ea,GpuMeshAdapter:()=>ra,GpuMipmapGenerator:()=>Ll,GpuParticleContainerAdaptor:()=>sl,GpuParticleContainerPipe:()=>Uo,GpuProgram:()=>Oe,GpuRenderTarget:()=>Ol,GpuRenderTargetAdaptor:()=>Gl,GpuRenderTargetSystem:()=>Ma,GpuShaderSystem:()=>Ra,GpuStateSystem:()=>Da,GpuStencilModesToPixi:()=>Hr,GpuStencilSystem:()=>Aa,GpuTextureSystem:()=>Ia,GpuUboSystem:()=>wa,GpuUniformBatchPipe:()=>Pa,Graphics:()=>bn,GraphicsContext:()=>at,GraphicsContextRenderData:()=>Xh,GraphicsContextSystem:()=>pn,GraphicsGpuData:()=>jh,GraphicsPath:()=>Oi,GraphicsPipe:()=>Fo,HTMLText:()=>Pc,HTMLTextPipe:()=>jo,HTMLTextRenderData:()=>Sn,HTMLTextStyle:()=>wc,HTMLTextSystem:()=>$o,HardLightBlend:()=>bd,HardMixBlend:()=>vd,HelloSystem:()=>Rn,IGLUniformData:()=>Y_,ImageSource:()=>Nt,InstructionSet:()=>Ws,KTX:()=>qe,LightenBlend:()=>Td,LinearBurnBlend:()=>Sd,LinearDodgeBlend:()=>Ed,LinearLightBlend:()=>Ad,Loader:()=>Jl,LoaderParserPriority:()=>Ie,LuminosityBlend:()=>Cd,MaskEffectManager:()=>Pu,MaskEffectManagerClass:()=>dh,MaskFilter:()=>Cl,Matrix:()=>I,Mesh:()=>fr,MeshGeometry:()=>ur,MeshGpuData:()=>el,MeshPipe:()=>Oo,MeshPlane:()=>Ib,MeshRope:()=>wI,MeshSimple:()=>Fb,NOOP:()=>xh,NegationBlend:()=>wd,NineSliceGeometry:()=>ci,NineSlicePlane:()=>Ob,NineSliceSprite:()=>qC,NineSliceSpriteGpuData:()=>cd,NineSliceSpritePipe:()=>Zo,NoiseFilter:()=>SD,ObservablePoint:()=>Ee,OverlayBlend:()=>Pd,PI_2:()=>qp,Particle:()=>II,ParticleBuffer:()=>rl,ParticleContainer:()=>OI,ParticleContainerPipe:()=>mn,ParticleShader:()=>il,PerspectiveMesh:()=>bI,PerspectivePlaneGeometry:()=>Mc,PinLightBlend:()=>Bd,PipelineSystem:()=>Ba,PlaneGeometry:()=>Cn,Point:()=>ae,Polygon:()=>xn,Pool:()=>os,PoolGroupClass:()=>ch,PrepareBase:()=>Tb,PrepareQueue:()=>Cc,PrepareSystem:()=>kf,PrepareUpload:()=>Bc,QuadGeometry:()=>vl,RAD_TO_DEG:()=>Kp,Rectangle:()=>ee,RenderContainer:()=>Bb,RenderGroup:()=>Du,RenderGroupPipe:()=>oa,RenderGroupSystem:()=>ua,RenderLayer:()=>fI,RenderTarget:()=>ya,RenderTargetSystem:()=>Fn,RenderTexture:()=>wl,RenderableGCSystem:()=>f_,RendererInitHook:()=>ha,RendererType:()=>Ge,ResizePlugin:()=>bo,Resolver:()=>Ot,RopeGeometry:()=>kb,RoundedRectangle:()=>ll,SCALE_MODES:()=>ZD,STENCIL_MODES:()=>Re,SVGParser:()=>lx,SaturationBlend:()=>Md,SchedulerSystem:()=>_a,ScissorMask:()=>wb,SdfShader:()=>gl,Shader:()=>Ye,ShaderStage:()=>on,ShapePath:()=>fl,SharedRenderPipes:()=>Rl,SharedSystems:()=>Ml,SoftLightBlend:()=>Rd,SplitBitmapText:()=>HI,SplitText:()=>YI,Sprite:()=>Se,SpritePipe:()=>la,Spritesheet:()=>Ch,State:()=>Ne,StencilMask:()=>Co,StencilMaskPipe:()=>pa,SubtractBlend:()=>Dd,SystemRunner:()=>Bn,TEXTURE_FORMAT_BLOCK_SIZE:()=>zy,Text:()=>pr,TextStyle:()=>Je,Texture:()=>B,TextureGCSystem:()=>p_,TextureMatrix:()=>Xs,TexturePool:()=>Ae,TexturePoolClass:()=>_h,TextureSource:()=>ue,TextureStyle:()=>it,TextureUvs:()=>Pb,Ticker:()=>le,TickerListener:()=>$s,TickerPlugin:()=>vo,TilingSprite:()=>Eb,TilingSpriteGpuData:()=>ud,TilingSpritePipe:()=>Ko,TilingSpriteShader:()=>bl,Transform:()=>Ac,Triangle:()=>vb,UNIFORM_TO_ARRAY_SETTERS:()=>sy,UNIFORM_TO_SINGLE_SETTERS:()=>iy,UNIFORM_TYPES_MAP:()=>bg,UNIFORM_TYPES_VALUES:()=>Gh,UPDATE_BLEND:()=>Iu,UPDATE_COLOR:()=>yo,UPDATE_PRIORITY:()=>It,UPDATE_TRANSFORM:()=>OP,UPDATE_VISIBLE:()=>Ys,UboBatch:()=>kl,UboSystem:()=>In,UniformGroup:()=>ce,VERSION:()=>Mn,VideoSource:()=>ds,ViewContainer:()=>st,ViewSystem:()=>x_,ViewableBuffer:()=>kr,VividLightBlend:()=>Id,WGSL_ALIGN_SIZE_DATA:()=>Ca,WGSL_TO_STD40_SIZE:()=>Xd,WRAP_MODES:()=>KD,WebGLRenderer:()=>Kd,WebGPURenderer:()=>Wd,WebWorkerAdapter:()=>cD,WorkerManager:()=>rf,accessibilityTarget:()=>Pm,addBits:()=>Ih,addMaskBounds:()=>Js,addMaskLocalBounds:()=>en,addProgramDefines:()=>rg,alphaFrag:()=>ub,alphaWgsl:()=>Cf,applyMatrix:()=>Ux,applyProjectiveTransformationToPlane:()=>Mb,applyStyleParams:()=>qd,assignWithIgnore:()=>_o,autoDetectEnvironment:()=>qB,autoDetectRenderer:()=>xy,autoDetectSource:()=>c3,basisTranscoderUrls:()=>lc,bgr2rgb:()=>as,bitmapFontCachePlugin:()=>_y,bitmapFontTextParser:()=>ql,bitmapFontXMLParser:()=>Qd,bitmapFontXMLStringParser:()=>Jd,bitmapTextSplit:()=>Gb,blendTemplateFrag:()=>Wx,blendTemplateVert:()=>zx,blendTemplateWgsl:()=>Xx,blockDataMap:()=>Hd,blurTemplateWgsl:()=>fb,boundsPool:()=>Zt,browserExt:()=>zS,buildAdaptiveBezier:()=>hl,buildAdaptiveQuadratic:()=>Jg,buildArc:()=>dl,buildArcTo:()=>tx,buildArcToSvg:()=>rx,buildCircle:()=>fn,buildContextBatches:()=>Hg,buildEllipse:()=>Cg,buildLine:()=>Rg,buildPixelLine:()=>Dg,buildPolygon:()=>Ug,buildRectangle:()=>Lg,buildRoundedRectangle:()=>wg,buildSimpleUvs:()=>Eg,buildTriangle:()=>Ng,buildUvs:()=>Sg,cacheAsTextureMixin:()=>tm,cacheTextureArray:()=>by,calculateProjection:()=>M_,canvasTextSplit:()=>Nb,checkChildrenDidChange:()=>ph,checkDataUrl:()=>lr,checkExtension:()=>$e,checkMaxIfStatementsInShader:()=>Hu,childrenHelperMixin:()=>im,cleanArray:()=>d_,cleanHash:()=>h_,clearList:()=>aa,closePointEps:()=>Pg,collectAllRenderables:()=>nI,collectRenderablesMixin:()=>sm,color32BitToUniform:()=>Nr,colorBit:()=>un,colorBitGl:()=>ln,colorMatrixFilterFrag:()=>mb,colorMatrixFilterWgsl:()=>Pf,colorToUniform:()=>W3,compareModeToGlCompare:()=>fy,compileHighShader:()=>dg,compileHighShaderGl:()=>fg,compileHighShaderGlProgram:()=>Or,compileHighShaderGpuProgram:()=>Fr,compileHooks:()=>kh,compileInputs:()=>Fh,compileOutputs:()=>hg,compileShader:()=>Yd,compute2DProjection:()=>Db,convertFormatIfRequired:()=>iR,convertToList:()=>Ft,copySearchParams:()=>So,createIdFromString:()=>ni,createIndicesForQuads:()=>qh,createLevelBuffers:()=>WM,createLevelBuffersFromKTX:()=>nR,createStringVariations:()=>Om,createTexture:()=>zt,createUboElementsSTD40:()=>V_,createUboElementsWGSL:()=>b_,createUboSyncFunction:()=>Dl,createUboSyncFunctionSTD40:()=>z_,createUboSyncFunctionWGSL:()=>w_,crossOrigin:()=>IA,cullingMixin:()=>$p,curveEps:()=>Bg,defaultFilterVert:()=>Nn,defaultValue:()=>Xl,definedProps:()=>Tt,deprecation:()=>F,detectAvif:()=>Ty,detectBasis:()=>OM,detectCompressed:()=>dR,detectDefaults:()=>Sy,detectMp4:()=>Ey,detectOgv:()=>Ay,detectVideoAlphaMode:()=>Lu,detectWebm:()=>Cy,detectWebp:()=>wy,determineCrossOrigin:()=>FA,displacementFrag:()=>xb,displacementVert:()=>_b,displacementWgsl:()=>Bf,earcut:()=>Og,effectsMixin:()=>nm,ensureAttributes:()=>Fl,ensureIsBuffer:()=>Dh,ensurePrecision:()=>ig,ensureTextOptions:()=>Vn,executeInstructions:()=>na,extensions:()=>N,extractAttributesFromGlProgram:()=>Z_,extractAttributesFromGpuProgram:()=>ag,extractFontFamilies:()=>Cx,extractStructAndGroups:()=>ju,extractSvgUrlId:()=>ed,fastCopy:()=>Bo,findMixin:()=>om,fontStringFromTextStyle:()=>ys,formatShader:()=>ND,fragmentGPUTemplate:()=>mg,fragmentGlTemplate:()=>xg,generateArraySyncSTD40:()=>W_,generateArraySyncWGSL:()=>C_,generateBlurFragSource:()=>cb,generateBlurGlProgram:()=>db,generateBlurProgram:()=>pb,generateBlurVertSource:()=>hb,generateGPULayout:()=>OD,generateGpuLayoutGroups:()=>ug,generateLayout:()=>UD,generateLayoutHash:()=>lg,generateParticleUpdateFunction:()=>Wg,generateProgram:()=>ty,generateShaderSyncCode:()=>X_,generateTextStyleKey:()=>hx,generateTextureBatchBit:()=>cn,generateTextureBatchBitGl:()=>hn,generateTextureMatrix:()=>Vg,generateUniformsSync:()=>ny,getAdjustedBlendModeBlend:()=>si,getAttributeInfoFromFormat:()=>Ht,getBatchSamplersUniformGroup:()=>dn,getBitmapTextLayout:()=>Tn,getCanvasBoundingBox:()=>fx,getCanvasFillStyle:()=>yn,getCanvasTexture:()=>Bl,getDefaultUniformValue:()=>vg,getFastGlobalBounds:()=>rI,getFastGlobalBoundsMixin:()=>um,getFontCss:()=>Bx,getFontFamilyName:()=>EA,getGeometryBounds:()=>Jm,getGlTypeFromFormat:()=>L_,getGlobalBounds:()=>Mi,getGlobalMixin:()=>hm,getGlobalRenderableBounds:()=>Hx,getLocalBounds:()=>Hs,getMaxFragmentPrecision:()=>tg,getMaxTexturesPerBatch:()=>Zm,getOrientationOfPoints:()=>Mg,getPo2TextureFromSource:()=>ml,getResolutionOfUrl:()=>Gn,getSVGUrl:()=>Mx,getSupportedCompressedTextureFormats:()=>oc,getSupportedGPUCompressedTextureFormats:()=>of,getSupportedGlCompressedTextureFormats:()=>nf,getSupportedTextureFormats:()=>Xi,getTemporaryCanvasFromImage:()=>Rx,getTestContext:()=>Vu,getTextureBatchBindGroup:()=>tn,getTextureDefaultMatrix:()=>MI,getTextureFormatFromKTXTexture:()=>aR,getUboData:()=>Q_,getUniformData:()=>J_,getUrlExtension:()=>zv,glFormatToGPUFormat:()=>$y,glUploadBufferImageResource:()=>uy,glUploadCompressedTextureResource:()=>ly,glUploadImageResource:()=>jl,glUploadVideoResource:()=>hy,globalUniformsBit:()=>_g,globalUniformsBitGl:()=>yg,globalUniformsUBOBitGl:()=>E3,gpuFormatToBasisTranscoderFormat:()=>XM,gpuFormatToKTXBasisTranscoderFormat:()=>lR,gpuUploadBufferImageResource:()=>I_,gpuUploadCompressedTextureResource:()=>k_,gpuUploadImageResource:()=>Ul,gpuUploadVideoResource:()=>O_,groupD8:()=>re,hasCachedCanvasTexture:()=>lM,hslWgsl:()=>AD,hslgl:()=>wn,hslgpu:()=>Pn,injectBits:()=>Oh,insertVersion:()=>sg,isMobile:()=>Cm,isPow2:()=>mh,isRenderingToScreen:()=>R_,isSafari:()=>Ex,isSingleItem:()=>hs,isWebGLSupported:()=>Vi,isWebGPUSupported:()=>Hi,ktxTranscoderUrls:()=>hc,loadBasis:()=>VM,loadBasisOnWorker:()=>Vy,loadBitmapFont:()=>yy,loadDDS:()=>jM,loadEnvironmentExtensions:()=>kd,loadFontAsBase64:()=>wx,loadFontCSS:()=>Px,loadImageBitmap:()=>MA,loadJson:()=>Py,loadKTX:()=>qM,loadKTX2:()=>eR,loadKTX2onWorker:()=>jy,loadSVGImage:()=>Dx,loadSvg:()=>Ry,loadTextures:()=>ic,loadTxt:()=>By,loadVideoTextures:()=>Iy,loadWebFont:()=>My,localUniformBit:()=>Ts,localUniformBitGl:()=>An,localUniformBitGroup2:()=>kx,localUniformMSDFBit:()=>xx,localUniformMSDFBitGl:()=>_x,log2:()=>PP,logDebugTexture:()=>$I,logProgramError:()=>ey,logRenderGroupScene:()=>JC,logScene:()=>QC,mSDFBit:()=>yx,mSDFBitGl:()=>bx,mapFormatToGlFormat:()=>py,mapFormatToGlInternalFormat:()=>my,mapFormatToGlType:()=>gy,mapGlToVertexFormat:()=>q_,mapSize:()=>XD,mapType:()=>jd,mapWebGLBlendModesToPixi:()=>oy,maskFrag:()=>o_,maskVert:()=>a_,maskWgsl:()=>Ud,matrixPool:()=>rt,measureHtmlText:()=>yl,measureMixin:()=>fm,migrateFragmentFromV7toV8:()=>WD,mipmapScaleModeToGlFilter:()=>dy,multiplyColors:()=>Vs,multiplyHexColors:()=>Mu,nextPow2:()=>Jr,noiseFrag:()=>bb,noiseWgsl:()=>Mf,nonCompressedFormats:()=>NA,normalizeExtensionPriority:()=>Au,onRenderMixin:()=>pm,parseDDS:()=>Xy,parseFunctionBody:()=>eI,parseKTX:()=>Yy,parseSVGDefinitions:()=>ax,parseSVGFloatAttribute:()=>Ue,parseSVGPath:()=>$g,parseSVGStyle:()=>td,particleData:()=>Gf,particlesFrag:()=>zg,particlesVert:()=>Xg,particlesWgsl:()=>Kh,path:()=>ke,pointInTriangle:()=>Rf,preloadVideo:()=>kA,removeItems:()=>wu,removeStructAndGroupDuplicates:()=>cg,resetUids:()=>vP,resolveCharacters:()=>Tx,resolveCompressedTextureUrl:()=>hR,resolveJsonUrl:()=>Fy,resolveTextureUrl:()=>sc,resourceToTexture:()=>eT,roundPixelsBit:()=>Gr,roundPixelsBitGl:()=>Ur,roundedShapeArc:()=>ix,roundedShapeQuadraticCurve:()=>sx,sayHello:()=>c_,scaleModeToGlFilter:()=>$d,setBasisTranscoderPath:()=>LM,setKTXTranscoderPath:()=>QM,setPositions:()=>Gx,setProgramName:()=>ng,setUvs:()=>Lx,shapeBuilders:()=>Ju,sortMixin:()=>mm,spritesheetAsset:()=>Um,squaredDistanceToLineSegment:()=>gn,stripVersion:()=>og,styleAttributes:()=>ux,testImageFormat:()=>Zl,testVideoFormat:()=>zi,textStyleToCSS:()=>Cb,textureBit:()=>Kx,textureBitGl:()=>Zx,textureFrom:()=>tT,tilingBit:()=>Fx,tilingBitGl:()=>Ox,toFillStyle:()=>ai,toLocalGlobalMixin:()=>gm,toStrokeStyle:()=>_n,transformVertices:()=>Lh,triangulateWithHoles:()=>Qu,uboSyncFunctionsSTD40:()=>Nd,uboSyncFunctionsWGSL:()=>E_,uid:()=>se,uniformParsers:()=>hi,unpremultiplyAlpha:()=>vM,unsafeEvalSupported:()=>Tl,updateLocalTransform:()=>aI,updateQuadBounds:()=>Uu,updateRenderGroupTransform:()=>i1,updateRenderGroupTransforms:()=>Od,updateTextBounds:()=>Lo,updateTransformAndChildren:()=>r_,updateTransformBackwards:()=>Bu,updateWorldTransform:()=>lI,v8_0_0:()=>z,v8_3_4:()=>Jp,validFormats:()=>dc,validateRenderables:()=>i_,vertexGPUTemplate:()=>pg,vertexGlTemplate:()=>gg,vkFormatToGPUFormat:()=>qy,warn:()=>G,webworkerExt:()=>XS,wrapModeToGlAddress:()=>$l});var Te=p(()=>{SB();AB();C();C();zm();Lm();Rv();Dv();PB();BB();MB();RB();DB();IB();kB();FB();OB();GB();UB();LB();NB();VB();HB();WB();zB();XB();YB();jB();$B();BM();Iv();kv();FM();fA();Ii();pA();mA();gA();xA();_A();yA();bA();vy();Ql();vA();yr();TA();SA();AA();CA();Dy();OA();Ss();BA();GA();ky();Zs();On();Sr();Gu();Gm();Wv();Eh();ct();GM();HM();zM();YM();VA();HA();WA();$M();zA();KM();jA();YA();tR();sR();oR();uR();ZA();cR();$A();QA();qA();fR();JA();tC();pR();nv();Em();r3();Vv();ve();ZS();Hv();hD();Gv();Dm();Bm();yh();Nv();vh();Mm();Rm();jS();$S();qS();CD();xC();_C();TC();AC();CC();Af();wC();PC();BC();MC();RC();c1();h1();d1();et();hd();dd();mD();_D();EC();lb();yC();vC();bC();SC();yD();bD();ED();Li();hh();LS();HS();f1();gh();fe();Qp();Ru();qg();Ls();or();DC();I2();k2();F2();nt();O2();wD();IC();GC();FD();VC();dE();Km();iT();GD();LD();Bh();e1();oT();l1();lT();sT();Tg();NT();ms();IT();wT();PT();BT();MT();VD();RT();kT();$u();qu();FT();qo();gs();Qx();jv();m1();$v();g1();hv();HD();qv();x1();wh();Ph();oA();fE();pE();mE();ea();xE();bE();yE();TE();SE();EE();AE();ME();CE();BE();RE();DE();IE();Uh();ar();kE();HE();XE();zD();FE();j_();P_();GE();VE();hT();qm();UE();LE();NE();YD();K_();dT();fT();pT();mT();gT();H_();PE();wE();zE();WE();$E();YE();U_();qE();sA();KE();ZE();cy();QE();eA();UA();tA();rA();iA();JE();TM();nA();G1();U1();j1();L1();N1();V1();H1();W1();Y1();$1();q1();K1();Q1();J1();eE();fs();br();tE();v_();X1();bT();vT();z1();ST();ET();AT();rE();iE();B_();uE();sE();nE();F_();oE();LA();aE();lE();y1();b1();ps();Vd();ki();Ym();S1();A1();qD();sn();HT();aT();nn();uT();WT();xm();C1();Z1();m_();D_();w1();TT();Lr();UT();y_();ot();S_();LT();A_();T_();B1();rn();Nu();Tr();Sl();__();jx();Wo();QD();D1();E1();ym();wo();nc();Po();gt();Wm();pe();k1();bm();ei();Ri();JD();g_();Ly();ac();rT();Yu();tI();O1();vr();v2();T2();S2();Rt();iI();fo();fh();NS();Ns();uv();lv();cv();dv();fv();pv();dm();gv();xv();_v();yv();Dt();t1();sI();Tv();r1();o1();vm();mv();t_();oI();zs();e_();cm();lm();uI();s1();cI();n1();cE();ko();QS();Ag();Qg();N2();ex();V2();z2();zT();YT();jT();ZT();QT();JT();M3();Io();Zh();gx();Ho();Yh();f2();nx();X2();Y2();j2();ox();D2();q2();K2();$2();i2();cx();r2();XT();Gg();pI();vI();zC();HC();WC();TI();ld();PI();BI();XC();hE();JS();$h();RI();Za();En();m2();x2();C2();A2();w2();kI();b2();GI();Yg();jC();E2();_2();y2();kC();Vx();NI();GS();wS();MS();OC();FS();IS();RS();DS();kS();nl();Qs();a1();vx();lA();cA();hA();dA();uA();xl();Ab();fS();cS();KC();nd();hS();mS();NC();gS();Ax();LC();AS();_S();vS();TS();SS();yS();bS();ES();Ix();UC();Ub();WI();jI();Df();B2();mx();bs();M2();iS();id();px();lS();nS();oS();If();ui();ZC();Q2();dx();jg();ri();Xv();Yv();js();ls();Av();Vm();Bv();xS();El();Al();Yx();eS();s_();Mt();M1();rm();mt();Nm();Xm();n_();ye();qI();KI();ge();vv();FC();ef();Ks();em();Bi();P1();KT();N.add(zS,XS);});var ak=Pi((Qb,ok)=>{(function(r,e){typeof Qb=="object"?ok.exports=Qb=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(Qb,function(){var r=r||function(e,t){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof K0=="function")try{i=K0("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function m(){}return function(b){var v;return m.prototype=b,v=new m,m.prototype=null,v}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(m){var b=n(this);return m&&b.mixIn(m),(!b.hasOwnProperty("init")||this.init===b.init)&&(b.init=function(){b.$super.init.apply(this,arguments);}),b.init.prototype=b,b.$super=this,b},create:function(){var m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var b in m)m.hasOwnProperty(b)&&(this[b]=m[b]);m.hasOwnProperty("toString")&&(this.toString=m.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(m,b){m=this.words=m||[],b!=t?this.sigBytes=b:this.sigBytes=m.length*4;},toString:function(m){return (m||h).stringify(this)},concat:function(m){var b=this.words,v=m.words,S=this.sigBytes,A=m.sigBytes;if(this.clamp(),S%4)for(var E=0;E<A;E++){var w=v[E>>>2]>>>24-E%4*8&255;b[S+E>>>2]|=w<<24-(S+E)%4*8;}else for(var M=0;M<A;M+=4)b[S+M>>>2]=v[M>>>2];return this.sigBytes+=A,this},clamp:function(){var m=this.words,b=this.sigBytes;m[b>>>2]&=4294967295<<32-b%4*8,m.length=e.ceil(b/4);},clone:function(){var m=u.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var b=[],v=0;v<m;v+=4)b.push(s());return new l.init(b,m)}}),c=o.enc={},h=c.Hex={stringify:function(m){for(var b=m.words,v=m.sigBytes,S=[],A=0;A<v;A++){var E=b[A>>>2]>>>24-A%4*8&255;S.push((E>>>4).toString(16)),S.push((E&15).toString(16));}return S.join("")},parse:function(m){for(var b=m.length,v=[],S=0;S<b;S+=2)v[S>>>3]|=parseInt(m.substr(S,2),16)<<24-S%8*4;return new l.init(v,b/2)}},d=c.Latin1={stringify:function(m){for(var b=m.words,v=m.sigBytes,S=[],A=0;A<v;A++){var E=b[A>>>2]>>>24-A%4*8&255;S.push(String.fromCharCode(E));}return S.join("")},parse:function(m){for(var b=m.length,v=[],S=0;S<b;S++)v[S>>>2]|=(m.charCodeAt(S)&255)<<24-S%4*8;return new l.init(v,b)}},f=c.Utf8={stringify:function(m){try{return decodeURIComponent(escape(d.stringify(m)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(m){return d.parse(unescape(encodeURIComponent(m)))}},x=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(m){typeof m=="string"&&(m=f.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes;},_process:function(m){var b,v=this._data,S=v.words,A=v.sigBytes,E=this.blockSize,w=E*4,M=A/w;m?M=e.ceil(M):M=e.max((M|0)-this._minBufferSize,0);var P=M*E,U=e.min(P*4,A);if(P){for(var k=0;k<P;k+=E)this._doProcessBlock(S,k);b=S.splice(0,P),v.sigBytes-=U;}return new l.init(b,U)},clone:function(){var m=u.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});a.Hasher=x.extend({cfg:u.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset();},reset:function(){x.reset.call(this),this._doReset();},update:function(m){return this._append(m),this._process(),this},finalize:function(m){m&&this._append(m);var b=this._doFinalize();return b},blockSize:512/32,_createHelper:function(m){return function(b,v){return new m.init(v).finalize(b)}},_createHmacHelper:function(m){return function(b,v){return new g.HMAC.init(m,v).finalize(b)}}});var g=o.algo={};return o}(Math);return r});});var lk=Pi((Jb,uk)=>{(function(r,e){typeof Jb=="object"?uk.exports=Jb=e(ak()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(Jb,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],d=c[1],f=c[2],x=c[3],_=c[4],g=0;g<80;g++){if(g<16)o[g]=u[l+g]|0;else {var m=o[g-3]^o[g-8]^o[g-14]^o[g-16];o[g]=m<<1|m>>>31;}var b=(h<<5|h>>>27)+_+o[g];g<20?b+=(d&f|~d&x)+1518500249:g<40?b+=(d^f^x)+1859775393:g<60?b+=(d&f|d&x|f&x)-1894007588:b+=(d^f^x)-899497514,_=x,x=f,f=d<<30|d>>>2,d=h,h=b;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+f|0,c[3]=c[3]+x|0,c[4]=c[4]+_|0;},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,h=u.sigBytes*8;return l[h>>>5]|=128<<24-h%32,l[(h+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(h+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});Te();var qi={};Wp(qi,{DistortionFilter:()=>Hb,EqualizerFilter:()=>zr,Filter:()=>_t,MonoFilter:()=>Wb,ReverbFilter:()=>zb,StereoFilter:()=>Xb,StreamFilter:()=>Yb,TelephoneFilter:()=>jb});var QI;function JI(r){return QI=r,r}function Ce(){return QI}var _t=class{constructor(e,t){this.init(e,t);}init(e,t){this.destination=e,this.source=t||e;}connect(e){this.source?.connect(e);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var Hb=class extends _t{constructor(e=0){let t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Ce().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var ft=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Ce().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var we=class extends _t{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:we.F32,type:"lowshelf",gain:r},{f:we.F64,type:"peaking",gain:e},{f:we.F125,type:"peaking",gain:t},{f:we.F250,type:"peaking",gain:i},{f:we.F500,type:"peaking",gain:s},{f:we.F1K,type:"peaking",gain:n},{f:we.F2K,type:"peaking",gain:o},{f:we.F4K,type:"peaking",gain:a},{f:we.F8K,type:"peaking",gain:u},{f:we.F16K,type:"highshelf",gain:l}];Ce().useLegacy||(c=h.map(d=>{let f=Ce().context.audioContext.createBiquadFilter();return f.type=d.type,ft.setParamValue(f.Q,1),f.frequency.value=d.f,ft.setParamValue(f.gain,d.gain),f})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let f=this.bands[d];d>0&&this.bands[d-1].connect(f),this.bandsMap[f.frequency.value]=f;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);ft.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(we.F32,r);}get f32(){return this.getGain(we.F32)}set f64(r){this.setGain(we.F64,r);}get f64(){return this.getGain(we.F64)}set f125(r){this.setGain(we.F125,r);}get f125(){return this.getGain(we.F125)}set f250(r){this.setGain(we.F250,r);}get f250(){return this.getGain(we.F250)}set f500(r){this.setGain(we.F500,r);}get f500(){return this.getGain(we.F500)}set f1k(r){this.setGain(we.F1K,r);}get f1k(){return this.getGain(we.F1K)}set f2k(r){this.setGain(we.F2K,r);}get f2k(){return this.getGain(we.F2K)}set f4k(r){this.setGain(we.F4K,r);}get f4k(){return this.getGain(we.F4K)}set f8k(r){this.setGain(we.F8K,r);}get f8k(){return this.getGain(we.F8K)}set f16k(r){this.setGain(we.F16K,r);}get f16k(){return this.getGain(we.F16K)}reset(){this.bands.forEach(r=>{ft.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},zr=we;zr.F32=32;zr.F64=64;zr.F125=125;zr.F250=250;zr.F500=500;zr.F1K=1e3;zr.F2K=2e3;zr.F4K=4e3;zr.F8K=8e3;zr.F16K=16e3;var Wb=class extends _t{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context;t=i.createChannelSplitter(),e=i.createChannelMerger(),e.connect(t);}super(e,t),this._merger=e;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var zb=class extends _t{constructor(e=3,t=2,i=false){super(null),this._seconds=this._clamp(e,1,50),this._decay=this._clamp(t,0,100),this._reverse=i,this._rebuild();}_clamp(e,t,i){return Math.min(i,Math.max(t,e))}get seconds(){return this._seconds}set seconds(e){this._seconds=this._clamp(e,1,50),this._rebuild();}get decay(){return this._decay}set decay(e){this._decay=this._clamp(e,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(e){this._reverse=e,this._rebuild();}_rebuild(){if(Ce().useLegacy)return;let{audioContext:e}=Ce().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var Xb=class extends _t{constructor(e=0){let t,i,s;if(!Ce().useLegacy){let{audioContext:n}=Ce().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?ft.setParamValue(this._stereo.pan,e):this._panner&&this._panner.setPosition(e,0,1-Math.abs(e));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var Yb=class extends _t{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context;e=i.createMediaStreamDestination(),t=i.createMediaStreamSource(e.stream);}super(e,t),this._stream=e?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var jb=class extends _t{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",ft.setParamValue(s.frequency,2e3),n.type="lowpass",ft.setParamValue(n.frequency,2e3),o.type="highpass",ft.setParamValue(o.frequency,500),a.type="highpass",ft.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};Te();var Uf=class extends de{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};Te();var Y8=0,ew=class extends de{constructor(r){super(),this.id=Y8++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-ew.PADDING),this._end=Math.min(this._end+ew.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),le.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){le.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){le.shared.remove(this._onUpdate,this),this.removeAllListeners();let r=this._source;r&&(r.onended=null,r.onplay=null,r.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},$b=ew;$b.PADDING=.1;Te();var Lf=class extends de{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new $b(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};Te();var Nf=class{constructor(e,t){this.parent=e,Object.assign(this,t),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(e){return this.parent.play({complete:e,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var Qa=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],tw=["audio/mpeg","audio/ogg"],Ja={};function ek(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;Qa.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(Ja,i);}ek();Te();Te();var $8=0,Vf=class extends de{constructor(e){super(),this.id=$8++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);ft.setParamValue(this._gain.gain,n*s*i),ft.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){le.shared.remove(this._updateListener,this),e&&le.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var eu=class{constructor(e,t){this._output=t,this._input=e;}get destination(){return this._input}get filters(){return this._filters}set filters(e){if(this._filters&&(this._filters.forEach(t=>{t&&t.disconnect();}),this._filters=null,this._input.connect(this._output)),e&&e.length){this._filters=e.slice(0),this._input.disconnect();let t=null;e.forEach(i=>{t===null?this._input.connect(i.destination):t.connect(i.destination),t=i;}),t.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var tk=class extends eu{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(tk.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let r=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=r.buffer,ft.setParamValue(e.playbackRate,r.playbackRate.value),e.loop=r.loop;let t=this.context.audioContext.createGain();return e.connect(t),t.connect(this.destination),{source:e,gain:t}}get bufferSize(){return this.script.bufferSize}},qb=tk;qb.BUFFER_SIZE=0;var tu=class{init(e){this.parent=e,this._nodes=new qb(this.context),this._source=this._nodes.bufferSource,this.source=e.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null,this.source=null;}create(){return new Vf(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await V.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var Rc=class{static from(r){let e={};typeof r=="string"?e.url=r:r instanceof ArrayBuffer||r instanceof AudioBuffer||r instanceof HTMLAudioElement?e.source=r:Array.isArray(r)?e.url=r:e=r,e={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...e},Object.freeze(e);let t=Ce().useLegacy?new Lf:new tu;return new Rc(t,e)}constructor(r,e){this.media=r,this.options=e,this._instances=[],this._sprites={},this.media.init(this);let t=e.complete;this._autoPlayOptions=t?{complete:t}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=Array.isArray(e.url)?this.preferUrl(e.url):e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded);}preferUrl(r){let[e]=r.map(t=>({url:t,ext:ke.extname(t).slice(1)})).filter(({ext:t})=>Ja[t]).sort((t,i)=>Qa.indexOf(t.ext)-Qa.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Ce().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new Nf(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(Rc._pool.length>0){let r=Rc._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Rc._pool.indexOf(r)<0&&Rc._pool.push(r);}},zn=Rc;zn._pool=[];Te();var Dc=class r extends eu{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new de,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var Kb=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new Dc),this._htmlAudioContext=new Uf,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(e){this.useLegacy||(this._context.filters=e);}get supported(){return Dc.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof zn)return this._sounds[e]=t,t;let i=this._getOptions(t),s=zn.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};Te();Te();var rk=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=ke.basename(e,ke.extname(e))),t},ik={extension:y.Asset,detection:{test:async()=>true,add:async r=>[...r,...Qa.filter(e=>Ja[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[y.LoadParser],priority:Ie.High},test(r){let e=ke.extname(r).slice(1);return !!Ja[e]||tw.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>zn.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Ce().add(rk(e),t),t},async unload(r,e){Ce().remove(rk(e));}}};N.add(ik);JI(new Kb);var Hf="repeat";({DistortionFilter:qi.DistortionFilter,EqualizerFilter:qi.EqualizerFilter,MonoFilter:qi.MonoFilter,ReverbFilter:qi.ReverbFilter,StereoFilter:qi.StereoFilter,StreamFilter:qi.StreamFilter,TelephoneFilter:qi.TelephoneFilter});var sk=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],fi="__game_layer__",Ic="Container",Zb="ImageContainer",rw="Image",kc="Sprite",Fc="Text",iw="Video";var L;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(L||(L={}));function Ut(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw L.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function nk(r){var e;let t={importPixi:false,...r};t.app&&(t.renderer=t.app.renderer,t.stage=t.app.stage),t.importPixi&&!t.pixi&&(t.pixi=await Promise.resolve().then(()=>(Te(),ZI))),window.__PIXI_DEVTOOLS__={...window.__PIXI_DEVTOOLS__||{},app:t.app,stage:t.stage,renderer:t.renderer,extensions:[...((e=window.__PIXI_DEVTOOLS__)==null?void 0:e.extensions)||[],...t.extensions||[]],plugins:{}};}var hk=zp(lk());Te();var Z8={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Pe||r instanceof er||r instanceof Le},testProp(r){switch(r){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof Pe||r instanceof er||r instanceof Le)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "percentageX":r.percentageX=t/100;break;case "percentageY":r.percentageY=t/100;break}},getProperties(r){return [{value:r.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:r.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:r.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},ck=Z8;function Q8(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var X=class X{constructor(){}static get app(){if(!X._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return X._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(fi);return e||(e=new q,e.label=fi,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return X.canvasWidth=t,X.canvasHeight=i,X._app=new Zd,X.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=X.app,extensions:a=[],...u}=n||{};nk({app:o,extensions:[ck,...a],...u}),X._isInitialized=true,X.addCanvasIntoHTMLElement(e),window.addEventListener("resize",X.resize),X.resize(),X.gameLayer;})}static addCanvasIntoHTMLElement(e){X._isInitialized?e.appendChild(X.app.canvas):L.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return X.htmlLayers.push(s),X.resize(),n}static removeHtmlLayer(e){let t=X.htmlLayers.find(i=>i.id===e);t&&(t.remove(),X.htmlLayers=X.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return X.htmlLayers.find(t=>t.id===e)}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/X.canvasWidth,t/X.canvasHeight)}static get screenWidth(){return Math.floor(X.screenScale*X.canvasWidth)}static get screenHeight(){return Math.floor(X.screenScale*X.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-X.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-X.screenHeight)/2}static async resize(){await Q8(async()=>{if(X._isInitialized){let i=X.app.canvas.style;i.width=`${X.screenWidth}px`,i.height=`${X.screenHeight}px`,i.marginLeft=`${X.horizontalMargin}px`,i.marginRight=`${X.horizontalMargin}px`,i.marginTop=`${X.verticalMargin}px`,i.marginBottom=`${X.verticalMargin}px`;}let t=X.htmlLayers.map(i=>{i.style.width=`${X.screenWidth}px`,i.style.height=`${X.screenHeight}px`,i.style.marginLeft=`${X.horizontalMargin}px`,i.style.marginRight=`${X.horizontalMargin}px`,i.style.marginTop=`${X.verticalMargin}px`,i.style.marginBottom=`${X.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return X.gameLayer.children.filter(e=>e.label).sort((e,t)=>X.gameLayer.getChildIndex(e)-X.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(X._currentTickers).filter(([e,t])=>!t.createdByTicketSteps).map(([e,t])=>[e,{id:t.ticker.id,args:t.ticker.args,canvasElementAliases:t.ticker.canvasElementAliases,priority:t.ticker.priority,duration:t.ticker.duration,paused:t.ticker.paused}]))}static generateTickerId(e){try{return (0,hk.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),X._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),X._currentTickersTimeouts[e]&&delete X._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),X.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(X._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&X.removeTickerTimeout(i);}else X._currentTickersTimeouts[i].aliases=n;});}};O(X,"_app"),O(X,"htmlLayers",[]),O(X,"canvasWidth",300),O(X,"canvasHeight",300),O(X,"_isInitialized",false),O(X,"_currentTickers",{}),O(X,"_currentTickersSequence",{}),O(X,"_currentTickersTimeouts",{}),O(X,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),O(X,"_tickersOnPause",{});var R=X;Te();var Oc=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,mk=new Set,sw=typeof process=="object"&&process?process:{},gk=(r,e,t,i)=>{typeof sw.emitWarning=="function"?sw.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},r0=globalThis.AbortController,dk=globalThis.AbortSignal;if(typeof r0>"u"){dk=class{constructor(){O(this,"onabort");O(this,"_onabort",[]);O(this,"reason");O(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},r0=class{constructor(){O(this,"signal",new dk);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=sw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,gk("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var J8=r=>!mk.has(r),Xn=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),xk=r=>Xn(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Gc:null:null,Gc=class extends Array{constructor(e){super(e),this.fill(0);}},Uc,ru=class ru{constructor(e,t){O(this,"heap");O(this,"length");if(!T(ru,Uc))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=xk(e);if(!t)return [];K(ru,Uc,true);let i=new ru(e,t);return K(ru,Uc,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};Uc=new WeakMap,_e(ru,Uc,false);var nw=ru,fk,pk,pi,Er,mi,iu,gi,Lc,Nc,yt,xi,pt,He,oe,tr,Ar,jt,Ct,_i,wt,yi,bi,Cr,vi,qn,rr,Vc,H,ow,su,ws,zf,wr,_k,nu,Hc,Xf,Yn,jn,aw,e0,t0,Ve,uw,Wf,$n,lw,cw=class cw{constructor(e){_e(this,H);_e(this,pi);_e(this,Er);_e(this,mi);_e(this,iu);_e(this,gi);_e(this,Lc);_e(this,Nc);O(this,"ttl");O(this,"ttlResolution");O(this,"ttlAutopurge");O(this,"updateAgeOnGet");O(this,"updateAgeOnHas");O(this,"allowStale");O(this,"noDisposeOnSet");O(this,"noUpdateTTL");O(this,"maxEntrySize");O(this,"sizeCalculation");O(this,"noDeleteOnFetchRejection");O(this,"noDeleteOnStaleGet");O(this,"allowStaleOnFetchAbort");O(this,"allowStaleOnFetchRejection");O(this,"ignoreFetchAbort");_e(this,yt);_e(this,xi);_e(this,pt);_e(this,He);_e(this,oe);_e(this,tr);_e(this,Ar);_e(this,jt);_e(this,Ct);_e(this,_i);_e(this,wt);_e(this,yi);_e(this,bi);_e(this,Cr);_e(this,vi);_e(this,qn);_e(this,rr);_e(this,Vc);_e(this,su,()=>{});_e(this,ws,()=>{});_e(this,zf,()=>{});_e(this,wr,()=>false);_e(this,nu,e=>{});_e(this,Hc,(e,t,i)=>{});_e(this,Xf,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});O(this,fk,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:f,maxSize:x=0,maxEntrySize:_=0,sizeCalculation:g,fetchMethod:m,memoMethod:b,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:E,ignoreFetchAbort:w}=e;if(t!==0&&!Xn(t))throw new TypeError("max option must be a nonnegative integer");let M=t?xk(t):Array;if(!M)throw new Error("invalid max value: "+t);if(K(this,pi,t),K(this,Er,x),this.maxEntrySize=_||T(this,Er),this.sizeCalculation=g,this.sizeCalculation){if(!T(this,Er)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(K(this,Nc,b),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(K(this,Lc,m),K(this,qn,!!m),K(this,pt,new Map),K(this,He,new Array(t).fill(void 0)),K(this,oe,new Array(t).fill(void 0)),K(this,tr,new M(t)),K(this,Ar,new M(t)),K(this,jt,0),K(this,Ct,0),K(this,_i,nw.create(t)),K(this,yt,0),K(this,xi,0),typeof l=="function"&&K(this,mi,l),typeof c=="function"&&K(this,iu,c),typeof h=="function"?(K(this,gi,h),K(this,wt,[])):(K(this,gi,void 0),K(this,wt,void 0)),K(this,vi,!!T(this,mi)),K(this,Vc,!!T(this,iu)),K(this,rr,!!T(this,gi)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!w,this.maxEntrySize!==0){if(T(this,Er)!==0&&!Xn(T(this,Er)))throw new TypeError("maxSize must be a positive integer if specified");if(!Xn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Y(this,H,_k).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Xn(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!Xn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Y(this,H,ow).call(this);}if(T(this,pi)===0&&this.ttl===0&&T(this,Er)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!T(this,pi)&&!T(this,Er)){let P="LRU_CACHE_UNBOUNDED";J8(P)&&(mk.add(P),gk("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,cw));}}static unsafeExposeInternals(e){return {starts:T(e,bi),ttls:T(e,Cr),sizes:T(e,yi),keyMap:T(e,pt),keyList:T(e,He),valList:T(e,oe),next:T(e,tr),prev:T(e,Ar),get head(){return T(e,jt)},get tail(){return T(e,Ct)},free:T(e,_i),isBackgroundFetch:t=>{var i;return Y(i=e,H,Ve).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return Y(o=e,H,t0).call(o,t,i,s,n)},moveToTail:t=>{var i;return Y(i=e,H,Wf).call(i,t)},indexes:t=>{var i;return Y(i=e,H,Yn).call(i,t)},rindexes:t=>{var i;return Y(i=e,H,jn).call(i,t)},isStale:t=>{var i;return T(i=e,wr).call(i,t)}}}get max(){return T(this,pi)}get maxSize(){return T(this,Er)}get calculatedSize(){return T(this,xi)}get size(){return T(this,yt)}get fetchMethod(){return T(this,Lc)}get memoMethod(){return T(this,Nc)}get dispose(){return T(this,mi)}get onInsert(){return T(this,iu)}get disposeAfter(){return T(this,gi)}getRemainingTTL(e){return T(this,pt).has(e)?1/0:0}*entries(){for(let e of Y(this,H,Yn).call(this))T(this,oe)[e]!==void 0&&T(this,He)[e]!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield [T(this,He)[e],T(this,oe)[e]]);}*rentries(){for(let e of Y(this,H,jn).call(this))T(this,oe)[e]!==void 0&&T(this,He)[e]!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield [T(this,He)[e],T(this,oe)[e]]);}*keys(){for(let e of Y(this,H,Yn).call(this)){let t=T(this,He)[e];t!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield t);}}*rkeys(){for(let e of Y(this,H,jn).call(this)){let t=T(this,He)[e];t!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield t);}}*values(){for(let e of Y(this,H,Yn).call(this))T(this,oe)[e]!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield T(this,oe)[e]);}*rvalues(){for(let e of Y(this,H,jn).call(this))T(this,oe)[e]!==void 0&&!Y(this,H,Ve).call(this,T(this,oe)[e])&&(yield T(this,oe)[e]);}[(pk=Symbol.iterator,fk=Symbol.toStringTag,pk)](){return this.entries()}find(e,t={}){for(let i of Y(this,H,Yn).call(this)){let s=T(this,oe)[i],n=Y(this,H,Ve).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,T(this,He)[i],this))return this.get(T(this,He)[i],t)}}forEach(e,t=this){for(let i of Y(this,H,Yn).call(this)){let s=T(this,oe)[i],n=Y(this,H,Ve).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,He)[i],this);}}rforEach(e,t=this){for(let i of Y(this,H,jn).call(this)){let s=T(this,oe)[i],n=Y(this,H,Ve).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,He)[i],this);}}purgeStale(){let e=false;for(let t of Y(this,H,jn).call(this,{allowStale:true}))T(this,wr).call(this,t)&&(Y(this,H,$n).call(this,T(this,He)[t],"expire"),e=true);return e}info(e){let t=T(this,pt).get(e);if(t===void 0)return;let i=T(this,oe)[t],s=Y(this,H,Ve).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(T(this,Cr)&&T(this,bi)){let o=T(this,Cr)[t],a=T(this,bi)[t];if(o&&a){let u=o-(Oc.now()-a);n.ttl=u,n.start=Date.now();}}return T(this,yi)&&(n.size=T(this,yi)[t]),n}dump(){let e=[];for(let t of Y(this,H,Yn).call(this,{allowStale:true})){let i=T(this,He)[t],s=T(this,oe)[t],n=Y(this,H,Ve).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(T(this,Cr)&&T(this,bi)){o.ttl=T(this,Cr)[t];let a=Oc.now()-T(this,bi)[t];o.start=Math.floor(Date.now()-a);}T(this,yi)&&(o.size=T(this,yi)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=Oc.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,f,x,_;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=T(this,Xf).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),Y(this,H,$n).call(this,e,"set"),this;let h=T(this,yt)===0?void 0:T(this,pt).get(e);if(h===void 0)h=T(this,yt)===0?T(this,Ct):T(this,_i).length!==0?T(this,_i).pop():T(this,yt)===T(this,pi)?Y(this,H,e0).call(this,false):T(this,yt),T(this,He)[h]=e,T(this,oe)[h]=t,T(this,pt).set(e,h),T(this,tr)[T(this,Ct)]=h,T(this,Ar)[h]=T(this,Ct),K(this,Ct,h),Xp(this,yt)._++,T(this,Hc).call(this,h,c,u),u&&(u.set="add"),l=false,T(this,Vc)&&((d=T(this,iu))==null||d.call(this,t,e,"add"));else {Y(this,H,Wf).call(this,h);let g=T(this,oe)[h];if(t!==g){if(T(this,qn)&&Y(this,H,Ve).call(this,g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=g;m!==void 0&&!o&&(T(this,vi)&&((f=T(this,mi))==null||f.call(this,m,e,"set")),T(this,rr)&&T(this,wt)?.push([m,e,"set"]));}else o||(T(this,vi)&&((x=T(this,mi))==null||x.call(this,g,e,"set")),T(this,rr)&&T(this,wt)?.push([g,e,"set"]));if(T(this,nu).call(this,h),T(this,Hc).call(this,h,c,u),T(this,oe)[h]=t,u){u.set="replace";let m=g&&Y(this,H,Ve).call(this,g)?g.__staleWhileFetching:g;m!==void 0&&(u.oldValue=m);}}else u&&(u.set="update");T(this,Vc)&&this.onInsert?.(t,e,t===g?"update":"replace");}if(s!==0&&!T(this,Cr)&&Y(this,H,ow).call(this),T(this,Cr)&&(l||T(this,zf).call(this,h,s,n),u&&T(this,ws).call(this,u,h)),!o&&T(this,rr)&&T(this,wt)){let g=T(this,wt),m;for(;m=g?.shift();)(_=T(this,gi))==null||_.call(this,...m);}return this}pop(){var e;try{for(;T(this,yt);){let t=T(this,oe)[T(this,jt)];if(Y(this,H,e0).call(this,!0),Y(this,H,Ve).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(T(this,rr)&&T(this,wt)){let t=T(this,wt),i;for(;i=t?.shift();)(e=T(this,gi))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=T(this,pt).get(e);if(n!==void 0){let o=T(this,oe)[n];if(Y(this,H,Ve).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(T(this,wr).call(this,n))s&&(s.has="stale",T(this,ws).call(this,s,n));else return i&&T(this,su).call(this,n),s&&(s.has="hit",T(this,ws).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=T(this,pt).get(e);if(s===void 0||!i&&T(this,wr).call(this,s))return;let n=T(this,oe)[s];return Y(this,H,Ve).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:x=this.allowStaleOnFetchAbort,context:_,forceRefresh:g=false,status:m,signal:b}=t;if(!T(this,qn))return m&&(m.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:m});let v={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:x,ignoreFetchAbort:f,status:m,signal:b},S=T(this,pt).get(e);if(S===void 0){m&&(m.fetch="miss");let A=Y(this,H,t0).call(this,e,S,v,_);return A.__returned=A}else {let A=T(this,oe)[S];if(Y(this,H,Ve).call(this,A)){let U=i&&A.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",U&&(m.returnedStale=true)),U?A.__staleWhileFetching:A.__returned=A}let E=T(this,wr).call(this,S);if(!g&&!E)return m&&(m.fetch="hit"),Y(this,H,Wf).call(this,S),s&&T(this,su).call(this,S),m&&T(this,ws).call(this,m,S),A;let w=Y(this,H,t0).call(this,e,S,v,_),P=w.__staleWhileFetching!==void 0&&i;return m&&(m.fetch=E?"stale":"refresh",P&&E&&(m.returnedStale=true)),P?w.__staleWhileFetching:w.__returned=w}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=T(this,Nc);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=T(this,pt).get(e);if(a!==void 0){let u=T(this,oe)[a],l=Y(this,H,Ve).call(this,u);return o&&T(this,ws).call(this,o,a),T(this,wr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||Y(this,H,$n).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(Y(this,H,Wf).call(this,a),s&&T(this,su).call(this,a),u))}else o&&(o.get="miss");}delete(e){return Y(this,H,$n).call(this,e,"delete")}clear(){return Y(this,H,lw).call(this,"delete")}};pi=new WeakMap,Er=new WeakMap,mi=new WeakMap,iu=new WeakMap,gi=new WeakMap,Lc=new WeakMap,Nc=new WeakMap,yt=new WeakMap,xi=new WeakMap,pt=new WeakMap,He=new WeakMap,oe=new WeakMap,tr=new WeakMap,Ar=new WeakMap,jt=new WeakMap,Ct=new WeakMap,_i=new WeakMap,wt=new WeakMap,yi=new WeakMap,bi=new WeakMap,Cr=new WeakMap,vi=new WeakMap,qn=new WeakMap,rr=new WeakMap,Vc=new WeakMap,H=new WeakSet,ow=function(){let e=new Gc(T(this,pi)),t=new Gc(T(this,pi));K(this,Cr,e),K(this,bi,t),K(this,zf,(n,o,a=Oc.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{T(this,wr).call(this,n)&&Y(this,H,$n).call(this,T(this,He)[n],"expire");},o+1);u.unref&&u.unref();}}),K(this,su,n=>{t[n]=e[n]!==0?Oc.now():0;}),K(this,ws,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=Oc.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=T(this,pt).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},K(this,wr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},su=new WeakMap,ws=new WeakMap,zf=new WeakMap,wr=new WeakMap,_k=function(){let e=new Gc(T(this,pi));K(this,xi,0),K(this,yi,e),K(this,nu,t=>{K(this,xi,T(this,xi)-e[t]),e[t]=0;}),K(this,Xf,(t,i,s,n)=>{if(Y(this,H,Ve).call(this,i))return 0;if(!Xn(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!Xn(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),K(this,Hc,(t,i,s)=>{if(e[t]=i,T(this,Er)){let n=T(this,Er)-e[t];for(;T(this,xi)>n;)Y(this,H,e0).call(this,true);}K(this,xi,T(this,xi)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=T(this,xi));});},nu=new WeakMap,Hc=new WeakMap,Xf=new WeakMap,Yn=function*({allowStale:e=this.allowStale}={}){if(T(this,yt))for(let t=T(this,Ct);!(!Y(this,H,aw).call(this,t)||((e||!T(this,wr).call(this,t))&&(yield t),t===T(this,jt)));)t=T(this,Ar)[t];},jn=function*({allowStale:e=this.allowStale}={}){if(T(this,yt))for(let t=T(this,jt);!(!Y(this,H,aw).call(this,t)||((e||!T(this,wr).call(this,t))&&(yield t),t===T(this,Ct)));)t=T(this,tr)[t];},aw=function(e){return e!==void 0&&T(this,pt).get(T(this,He)[e])===e},e0=function(e){var n;let t=T(this,jt),i=T(this,He)[t],s=T(this,oe)[t];return T(this,qn)&&Y(this,H,Ve).call(this,s)?s.__abortController.abort(new Error("evicted")):(T(this,vi)||T(this,rr))&&(T(this,vi)&&((n=T(this,mi))==null||n.call(this,s,i,"evict")),T(this,rr)&&T(this,wt)?.push([s,i,"evict"])),T(this,nu).call(this,t),e&&(T(this,He)[t]=void 0,T(this,oe)[t]=void 0,T(this,_i).push(t)),T(this,yt)===1?(K(this,jt,K(this,Ct,0)),T(this,_i).length=0):K(this,jt,T(this,tr)[t]),T(this,pt).delete(i),Xp(this,yt)._--,t},t0=function(e,t,i,s){let n=t===void 0?void 0:T(this,oe)[t];if(Y(this,H,Ve).call(this,n))return n;let o=new r0,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(_,g=false)=>{let{aborted:m}=o.signal,b=i.ignoreFetchAbort&&_!==void 0;if(i.status&&(m&&!g?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,b&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),m&&!b&&!g)return h(o.signal.reason);let v=f;return T(this,oe)[t]===f&&(_===void 0?v.__staleWhileFetching?T(this,oe)[t]=v.__staleWhileFetching:Y(this,H,$n).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,_,u.options))),_},c=_=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=_),h(_)),h=_=>{let{aborted:g}=o.signal,m=g&&i.allowStaleOnFetchAbort,b=m||i.allowStaleOnFetchRejection,v=b||i.noDeleteOnFetchRejection,S=f;if(T(this,oe)[t]===f&&(!v||S.__staleWhileFetching===void 0?Y(this,H,$n).call(this,e,"fetch"):m||(T(this,oe)[t]=S.__staleWhileFetching)),b)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw _},d=(_,g)=>{var b;let m=(b=T(this,Lc))==null?void 0:b.call(this,e,n,u);m&&m instanceof Promise&&m.then(v=>_(v===void 0?void 0:v),g),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=v=>l(v,true)));});};i.status&&(i.status.fetchDispatched=true);let f=new Promise(d).then(l,c),x=Object.assign(f,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,x,{...u.options,status:void 0}),t=T(this,pt).get(e)):T(this,oe)[t]=x,x},Ve=function(e){if(!T(this,qn))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof r0},uw=function(e,t){T(this,Ar)[t]=e,T(this,tr)[e]=t;},Wf=function(e){e!==T(this,Ct)&&(e===T(this,jt)?K(this,jt,T(this,tr)[e]):Y(this,H,uw).call(this,T(this,Ar)[e],T(this,tr)[e]),Y(this,H,uw).call(this,T(this,Ct),e),K(this,Ct,e));},$n=function(e,t){var s,n;let i=false;if(T(this,yt)!==0){let o=T(this,pt).get(e);if(o!==void 0)if(i=true,T(this,yt)===1)Y(this,H,lw).call(this,t);else {T(this,nu).call(this,o);let a=T(this,oe)[o];if(Y(this,H,Ve).call(this,a)?a.__abortController.abort(new Error("deleted")):(T(this,vi)||T(this,rr))&&(T(this,vi)&&((s=T(this,mi))==null||s.call(this,a,e,t)),T(this,rr)&&T(this,wt)?.push([a,e,t])),T(this,pt).delete(e),T(this,He)[o]=void 0,T(this,oe)[o]=void 0,o===T(this,Ct))K(this,Ct,T(this,Ar)[o]);else if(o===T(this,jt))K(this,jt,T(this,tr)[o]);else {let u=T(this,Ar)[o];T(this,tr)[u]=T(this,tr)[o];let l=T(this,tr)[o];T(this,Ar)[l]=T(this,Ar)[o];}Xp(this,yt)._--,T(this,_i).push(o);}}if(T(this,rr)&&T(this,wt)?.length){let o=T(this,wt),a;for(;a=o?.shift();)(n=T(this,gi))==null||n.call(this,...a);}return i},lw=function(e){var t,i;for(let s of Y(this,H,jn).call(this,{allowStale:true})){let n=T(this,oe)[s];if(Y(this,H,Ve).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=T(this,He)[s];T(this,vi)&&((t=T(this,mi))==null||t.call(this,n,o,e)),T(this,rr)&&T(this,wt)?.push([n,o,e]);}}if(T(this,pt).clear(),T(this,oe).fill(void 0),T(this,He).fill(void 0),T(this,Cr)&&T(this,bi)&&(T(this,Cr).fill(0),T(this,bi).fill(0)),T(this,yi)&&T(this,yi).fill(0),K(this,jt,0),K(this,Ct,0),T(this,_i).length=0,K(this,xi,0),K(this,yt,0),T(this,rr)&&T(this,wt)){let s=T(this,wt),n;for(;n=s?.shift();)(i=T(this,gi))==null||i.call(this,...n);}};var i0=cw;var Ki=class{constructor(e){O(this,"cache");O(this,"map",new Map);this.cache=new i0({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Yf=new Ki({cacheSize:5});function e5(r){return function(e){s0.add(e,r);}}var s0;(s=>{function r(n,o){o||(o=n.name),Yf.get(o)&&L.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Yf.set(o,n);}s.add=r;function e(n){try{let o=Yf.get(n);if(!o){L.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){L.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Yf.values())}s.values=t;function i(n){return Yf.has(n)}s.has=i;})(s0||(s0={}));var ir=s0;var Wc=new Ki({cacheSize:5});function t5(r){return function(e){n0.add(e,r);}}var n0;(n=>{function r(o,a){a||(a=o.name),Wc.get(a)&&L.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,Wc.set(a,o);}n.add=r;function e(o){try{let a=Wc.get(o);if(!a){L.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){L.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=Wc.get(o);if(!a){L.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){L.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(Wc.values())}n.values=i;function s(o){return Wc.has(o)}n.has=s;})(n0||(n0={}));var Ps=n0;async function o0(r){let e=r5(r.pixivnId);if(e)await e.setMemory(r);else throw new Error("[Pixi\u2019VN] The element "+r.pixivnId+" could not be created");return e}function r5(r){try{let e=ir.get(r);return e?new e:void 0}catch(e){L.error(`Error while getting CanvasElement ${r}`,e);return}}Te();function hw(r){return "memory"in r?r.memory:r instanceof pr?dw(r):r instanceof Se?jf(r):ou(r)}function i5(r){return {width:r.width,height:r.height,isRenderGroup:r.isRenderGroup,blendMode:r.blendMode,tint:r.tint,alpha:r.alpha,angle:r.angle,renderable:r.renderable,rotation:r.rotation,scale:{x:r.scale.x,y:r.scale.y},pivot:{x:r.pivot.x,y:r.pivot.y},position:{x:r.position.x,y:r.position.y},skew:{x:r.skew.x,y:r.skew.y},visible:r.visible,x:r.x,y:r.y,boundsArea:r.boundsArea,cursor:r.cursor,eventMode:r.eventMode,interactive:r.interactive,interactiveChildren:r.interactiveChildren,hitArea:r.hitArea}}function yk(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function ou(r,e){let t=s5(r,Ic),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>hw(n)):[];return {pixivnId:t,elements:s,...i5(r)}}function jf(r){let e=ou(r),t=e.pixivnId??kc,i=vk(r),s="textureAlias"in r?yk(r.texture,r.textureAlias):yk(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function dw(r){let e=ou(r),t=e.pixivnId??Fc,i=vk(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:n5(r.style),roundPixels:r.roundPixels,onEvents:i}}function s5(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function vk(r){return "onEvents"in r?r.onEvents:{}}function bk(r,e){if(typeof r!="object"||r===null)return r;L.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function n5(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:bk(r.stroke,"fill"),fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontVariant:r.fontVariant,fontWeight:r.fontWeight,leading:r.leading,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,padding:r.padding,stroke:bk(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var au=class extends q{constructor(t){super(t);O(this,"pixivnId",Ic);O(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Ic;}get memory(){return ou(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await Zi(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await o0(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ps.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):L.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ir.add(au,Ic);async function Zi(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}Te();var $f=class $f{static init(e){$f._getScreen=e.getScreen;}static get screen(){return $f._getScreen()}};O($f,"_getScreen");var mr=$f;function Xr(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(mr.screen.width-t)+i+n*t+(s?t:0):e*(mr.screen.height-t)+i+n*t+(s?t:0)}function Qi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(mr.screen.width-t):(e-i-n*t-(s?t:0))/(mr.screen.height-t)}function Yr(r,e){return r==="width"?e*mr.screen.width:e*mr.screen.height}function Ji(r,e){return r==="width"?e/mr.screen.width:e/mr.screen.height}function Ke(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.x*i-r.y*s,o=r.x*s+r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.y*s-r.x*i,o=r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.x*i+r.y*s,o=-r.x*s-r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.y*s-r.x*i,o=-r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}return {x:0,y:0}}function fw(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function jr(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?e:i===90||i===270?t:Math.abs(e*Math.cos(i*Math.PI/180))+Math.abs(t*Math.sin(i*Math.PI/180))}function $r(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?t:i===90||i===270?e:Math.abs(t*Math.cos(i*Math.PI/180))+Math.abs(e*Math.sin(i*Math.PI/180))}Te();var o5=new RegExp(`(${sk.join("|")})$`);function qf(r){let e=ut.cache.has(r)?ut.get(r):null;return e instanceof B&&(r=e.source?.label||r),o5.test(r)}function uu(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===void 0?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===void 0?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&r.percentageX===void 0&&(r.percentageX=r.xPercentagePosition),r.yPercentagePosition!=null&&r.percentageY===void 0&&(r.percentageY=r.yPercentagePosition),r.percentageX!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.percentageX},delete r.percentageX):(r.percentagePosition.x=r.percentageX,delete r.percentageX)),r.percentageY!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.percentageY},delete r.percentageY):(r.percentagePosition.y=r.percentageY,delete r.percentageY))),r)}Te();Te();async function zc(r){if(r!=="EMPTY"){if(!r){L.error("Texture not found",r);return}if(ut.cache.has(r)){let e=ut.get(r);if(e)return e}return ut.load(r).then(e=>{if(!e){L.error("Texture not found",r);return}if(!(e instanceof B)){L.error("File not is a file",r);return}return e}).catch(e=>{L.error("Error loading file",e);})}}Te();var Bs=class r extends Se{constructor(t){super(t);O(this,"pixivnId",kc);O(this,"_textureAlias");O(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||kc;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return jf(this)}set memory(t){}async setMemory(t){return this.memory=t,await Kf(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ps.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):L.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=Se.from(t,i),n=new r;return n.texture=s.texture,n}};ir.add(Bs,kc);async function Kf(r,e,t){let i=t?.ignoreTexture||false;if(await Zi(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await zc(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&ut.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await zc(n);o&&(r.texture=o);}}let s=t?.half;if(s?await s():"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=Ps.get(o);a&&r.onEvent(n,a);}}var Pe=class r extends Bs{constructor(t,i){t=uu(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);O(this,"pixivnId",rw);O(this,"_loadIsStarted",false);O(this,"_align");O(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...jf(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Zf(this,t),this.reloadPosition();}static from(t,i){let s=Se.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,zc(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,L.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return {x:Qi("width",this.x,jr(this),t.x,i.x<0,this.anchor.x),y:Qi("height",this.y,$r(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return Qi("width",this.x,jr(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return Qi("height",this.y,$r(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ji("width",this.x),y:Ji("height",this.y)}}get percentageX(){return Ji("width",this.x)}set percentageX(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageY(){return Ji("height",this.y)}set percentageY(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);this._align.x!==void 0&&(super.x=Xr("width",this._align.x,jr(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=Xr("height",this._align.y,$r(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Yr("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Yr("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};ir.add(Pe,rw);async function Zf(r,e,t){let i=t?.ignoreTexture||false;return e=uu(e),await Kf(r,e,{half:async()=>{i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition);},ignoreTexture:t?.ignoreTexture})}Te();var er=class r extends Pe{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);O(this,"pixivnId",iw);O(this,"_looop",false);O(this,"_paused",false);O(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await pw(this,t)}static from(t,i){let s=Se.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};ir.add(er,iw);async function pw(r,e,t){await Zf(r,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(r.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(r.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(r.paused=e.paused);}var Le=class extends au{constructor(t,i=[]){t=uu(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);O(this,"pixivnId",Zb);O(this,"_loadIsStarted",false);O(this,"_anchor");O(this,"_align");O(this,"_percentagePosition");t=uu(t),i&&i.forEach(a=>{let u;qf(a)?u=new er(void 0,a):u=new Pe(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:Zb,anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await mw(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,L.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new B}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return {x:Qi("width",this.x,jr(this),t.x,i.x<0,this.anchor.x),y:Qi("height",this.y,$r(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return Qi("width",this.x,jr(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);return Qi("height",this.y,$r(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ji("width",this.x),y:Ji("height",this.y)}}set percentageX(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageX(){return Ji("width",this.x)}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}set percentageY(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get percentageY(){return Ji("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=Ke(this.pivot,this.angle),i=Ke(this.scale,this.angle);this._align.x!==void 0&&(super.x=Xr("width",this._align.x,jr(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=Xr("height",this._align.y,$r(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Yr("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Yr("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};ir.add(Le,Zb);async function mw(r,e,t){e=uu(e),Zi(r,e,{...t,end:async()=>{"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}Te();var lu=class extends pr{constructor(t){super(t);O(this,"pixivnId",Fc);O(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Fc;}get memory(){return dw(this)}set memory(t){}async setMemory(t){return this.memory=t,await gw(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ps.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):L.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ir.add(lu,Fc);async function gw(r,e){if(await Zi(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=Ps.get(i);s&&r.onEvent(t,s);}}Te();var cu=class{constructor(e,t,i){O(this,"_args");O(this,"duration");O(this,"priority");O(this,"ticker",new le);O(this,"animation");O(this,"stopped",false);O(this,"ignoreOnComplete",true);O(this,"tickerId");O(this,"canvasElementAliases",[]);O(this,"timeout",50);O(this,"onComplete",()=>{if(this.ignoreOnComplete)return;let e=this.tickerId;if(!e){L.warn("MotionTicker.complete() called without tickerId set. This may cause issues.");return}let t=this._args.options?.aliasToRemoveAfter||[];typeof t=="string"&&(t=[t]);let i=this._args.options?.tickerAliasToResume||[];typeof i=="string"&&(i=[i]);let s=this._args.options?.tickerIdToResume||[];typeof s=="string"&&(s=[s]),D.onTickerComplete(e,{aliasToRemoveAfter:t,tickerAliasToResume:i,tickerIdToResume:s,stopTicker:false});});this._args=e,this.duration=t,this.priority=i;}get args(){return {...this._args,time:this.animation?.time}}getItemByAlias(e){if(!this.canvasElementAliases.includes(e))return;let t=D.find(e);if(t)return t}async complete(){if(!this.animation){L.warn("MotionTicker.complete() called without animation set. This may cause issues.");return}this.animation.complete(),await new Promise(e=>setTimeout(e,this.timeout));}stop(){if(this.stopped=true,!this.animation){L.warn("MotionTicker.stop() called without animation set. This may cause issues.");return}this.animation.stop();}start(e){if(this.tickerId=e,this._args.options.autoplay!==false)return this.initialize()}createItem(e){return new Proxy({alias:e},{set:({alias:t},i,s)=>{if(this.stopped||this._args.startState&&this._args.startState[i]===s)return true;let n=this.getItemByAlias(t);if(!n)return true;switch(this.ignoreOnComplete&&setTimeout(()=>{this.ignoreOnComplete=false;},10),i){case "pivotX":n.pivot.x=s;break;case "pivotY":n.pivot.y=s;break;case "scaleX":n.scale.x=s;break;case "scaleY":n.scale.y=s;break;default:n[i]=s;break}return true},get:({alias:t},i)=>{if(this._args.startState||(this._args.startState={}),i in this._args.startState)return this._args.startState[i];let s=this.getItemByAlias(t);if(!s)return;let n;switch(i){case "pivotX":n=s.pivot.x;break;case "pivotY":n=s.pivot.y;break;case "scaleX":n=s.scale.x;break;case "scaleY":n=s.scale.y;break;default:n=s[i];break}return this._args.startState={...this._args.startState,[i]:n},n},has:({alias:t},i)=>{let s=this.getItemByAlias(t);if(!s)return false;switch(i){case "pivotX":return "pivot"in s&&"x"in s.pivot;case "pivotY":return "pivot"in s&&"y"in s.pivot;case "scaleX":return "scale"in s&&"x"in s.scale;case "scaleY":return "scale"in s&&"y"in s.scale;default:return i in s}},ownKeys:({alias:t})=>{let i=this.getItemByAlias(t);return i?Object.keys(i):[]}})}pause(){this.animation&&this.animation.pause();}play(){if(this.animation||this.initialize(),!this.animation){L.warn("MotionTicker.play() called without animation set. This may cause issues.");return}this.animation.play();}get paused(){return this.animation?this.animation.state==="paused":true}};var hu=class extends cu{constructor(){super(...arguments);O(this,"id","motion-sequence");}initialize(){let t=this.canvasElementAliases[0],i=this.createItem(t),s=this._args.sequence.map((n,o)=>[i,n[0],{...n[1]||{},ticker:this.ticker,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat,onComplete:o===this._args.sequence.length-1?()=>this.onComplete():void 0}]);this.animation=Qf(s,{...this._args.options,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat}),this._args.time&&(this.animation.time=this._args.time);}};var du=class extends cu{constructor(){super(...arguments);O(this,"id","motion");}initialize(){let t=this.canvasElementAliases.map(i=>this.createItem(i));this.animation=Qf(t,this._args.keyframes,{...this._args.options,repeat:this._args.options?.repeat===null?1/0:this._args.options?.repeat,onComplete:()=>this.onComplete(),ticker:this.ticker}),this._args.time&&(this.animation.time=this._args.time);}};var Kn=new Ki({cacheSize:5});Kn.set("motion",du);Kn.set("motion-sequence",hu);function a5(r){return function(e){a0.add(e,r);}}var a0;(n=>{function r(o,a){a||(a=o.name),Kn.get(a)&&L.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,Kn.set(a,o);}n.add=r;function e(o){try{let a=Kn.get(o);if(!a){L.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){L.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=Kn.get(o);if(!c){L.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){L.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(Kn.values())}n.values=i;function s(o){return Kn.has(o)}n.has=s;})(a0||(a0={}));var sr=a0;var Tk="aliasToRemoveAfter";var Jf=class{get app(){return R.app}get gameLayer(){return R.gameLayer}get isInitialized(){return R._isInitialized}get canvasWidth(){return R.canvasWidth}get canvasHeight(){return R.canvasHeight}set canvasWidth(e){R.canvasWidth=e;}set canvasHeight(e){R.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await R.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await R.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}get children(){return R.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {L.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {L.error(`Canvas element ${e} not found`);return}}e instanceof q&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof er?await pw(t,e,{ignoreTexture:true}):t instanceof Pe?await Zf(t,e,{ignoreTexture:true}):t instanceof Bs?await Kf(t,e,{ignoreTexture:true}):t instanceof lu?await gw(t,e):t instanceof Le?await mw(t,e):t instanceof q&&await Zi(t,e);}add(e,t,i={}){if(e===fi){L.error(`The alias ${fi} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?L.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===fi){L.error(`The alias ${fi} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}find(e){if(e===fi)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return R._currentTickers}get currentTickersSteps(){return R._currentTickersSequence}findTicker(e){let t=R._currentTickers[e];if(t)return t.ticker}addTicker(e,t,i){let s=t.id;if(typeof e=="string"&&(e=[e]),t.canvasElementAliases=e,!sr.has(s)){L.error(`Ticker ${s} not found`);return}let n={ticker:t},{id:o=R.generateTickerId(n)}=i||{};if(R._currentTickers[o]=n,n.ticker.start(o),t.duration){let a=setTimeout(()=>{R.removeTickerTimeoutInfo(a),R._currentTickersTimeouts[a.toString()]&&n.ticker.complete({ignoreTickerSteps:true});},t.duration*1e3);R.addTickerTimeoutInfo(e,s,a.toString(),true);}return o}addTickersSequence(e,t,i=0){if(t.length==0){L.warn("The steps of the tickers is empty");return}e in R._currentTickersSequence||(R._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Hf||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:Ut(o.args),duration:o.duration})},n=R.generateTickerId(s);return R._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!R._currentTickersSequence[e]||!R._currentTickersSequence[e][t])return;let i=R._currentTickersSequence[e][t].steps[R._currentTickersSequence[e][t].currentStepNumber];if(i===Hf&&(i=R._currentTickersSequence[e][t].steps[0],R._currentTickersSequence[e][t].currentStepNumber=0,i===Hf)){L.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=R._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),R.removeTickerTimeoutInfo(u);},i.duration*1e3);R.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=sr.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){L.error(`Ticker ${i.ticker} not found`);return}s.canvasElementAliases=[e];let n=s.id,o={createdByTicketSteps:{canvasElementAlias:e,id:t},ticker:s},a=R.generateTickerId(o);if(R._currentTickers[a]=o,o.ticker.start(a),s.duration){let u=setTimeout(()=>{let l=R._currentTickersTimeouts[u.toString()];l&&(o.ticker.complete({ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),R.removeTickerTimeoutInfo(u);},s.duration*1e3);R.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(R._currentTickersSequence[e]&&R._currentTickersSequence[e][t]){let i=R._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,R._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&R._currentTickersSequence[e]&&R._currentTickersSequence[e][t]&&(delete R._currentTickersSequence[e][t],Object.entries(R._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){return this.onTickerComplete(e,t)}onTickerComplete(e,t){let{stopTicker:i=true,aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o}=t,a=R._currentTickers[e],u=t.ignoreTickerSteps||false;this.remove(s),n.forEach(l=>this.resumeTicker({canvasAlias:l})),this.resumeTicker({id:o}),a&&(this.removeTicker(e,{stopTicker:i}),!u&&a.ticker.duration==null&&a.createdByTicketSteps&&this.nextTickerStep(a.createdByTicketSteps.canvasElementAlias,a.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(R._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(s)&&(o.ticker.canvasElementAliases.length===1?this.removeTicker(n):o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(a=>a!==s));}),R._currentTickersSequence[s]&&delete R._currentTickersSequence[s],R.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:i=t.prototype.id,e.forEach(s=>{R._currentTickersSequence[s]&&Object.entries(R._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete R._currentTickersSequence[s][n];});}),Object.entries(R._currentTickers).forEach(([s,n])=>{n.ticker.id===i&&(R._currentTickers[s].ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(R._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(R._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(R._currentTickers).forEach(([e,t])=>{t.ticker.canvasElementAliases=t.ticker.canvasElementAliases.filter(i=>this.find(i)),t.ticker.canvasElementAliases.length===0&&t.ticker.complete({ignoreTickerSteps:true});}),Object.entries(R._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete R._currentTickersSequence[e];}),Object.entries(R._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&R.removeTickerTimeout(e);});}removeAllTickers(){R._currentTickersSequence={},Object.keys(R._currentTickers).forEach(e=>{this.removeTicker(e);}),R._currentTickers={};for(let e in R._currentTickersTimeouts)R.removeTickerTimeout(e);R._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},R._tickersOnPause={};}removeTicker(e,t={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(i=>{let s=R._currentTickers[i];s&&(t.stopTicker&&s.ticker.stop(),delete R._currentTickers[i]);});}pauseTicker(e){let t=[];if("canvasAlias"in e){let{canvasAlias:i,tickerIdsExcluded:s=[]}=e;Object.entries(R._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(i)&&!s.includes(o.ticker.id)&&o.ticker.paused===false&&(o.ticker.pause(),t.push(n));});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),i.forEach(s=>{let n=R._currentTickers[s];n?n.ticker.paused===false&&(n.ticker.pause(),t.push(s)):L.error(`Ticker with id ${s} not found`);});}return t}resumeTicker(e){if("canvasAlias"in e){let{canvasAlias:t}=e;Object.values(R._currentTickers).forEach(i=>{i.ticker.canvasElementAliases.includes(t)&&i.ticker.play();}),delete R._tickersOnPause[t];}else if("id"in e){let{id:t}=e;typeof t=="string"&&(t=[t]),t.forEach(i=>{let s=R._currentTickers[i];s?s.ticker.play():L.error(`Ticker with id ${i} not found`);});}}isTickerPaused(e,t){let i=R._tickersOnPause[e];if(i){if(t){if("tickerIdsIncluded"in i&&i.tickerIdsIncluded)return i.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in i&&i.tickerIdsExcluded)return !i.tickerIdsExcluded.includes(t)}return true}return false}transferTickers(e,t,i="move"){R._currentTickersSequence[e]&&(i==="move"?R._currentTickersSequence[t]=Ut(R._currentTickersSequence[e]):i==="duplicate"&&(R._currentTickersSequence[t]=Ut(R._currentTickersSequence[e]))),Object.entries(R._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.ticker.canvasElementAliases.includes(e)){let o=sr.getInstance(n.ticker.id,Ut(n.ticker.args),n.ticker.duration,n.ticker.priority);if(o?(o.canvasElementAliases=[t],this.addTicker(t,o),n.ticker.paused&&o.pause()):L.error(`Ticker ${n.ticker.id} not found`),i==="move"&&(n.ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(a=>a!==e)),n.ticker.args.hasOwnProperty(Tk)){let a=n.ticker.args.aliasToRemoveAfter;typeof a=="string"&&(a=[a]),Array.isArray(a)&&(i==="move"?n.ticker.args.aliasToRemoveAfter=a.map(u=>u===e?t:u):i==="duplicate"&&a.find(u=>u===e)&&(n.ticker.args.aliasToRemoveAfter=[...a,t]));}}}),Object.values(R._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),R._currentTickersSequence[t]&&Object.keys(R._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&R._currentTickersSequence[e]&&Object.keys(R._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}completeTickerOnStepEnd(e){e.alias?R._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):R._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,t){if(t){let i=R._currentTickersSequence[t];if(i&&i[e])if(i[e].steps.includes(Hf))L.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]);else {let s=i[e].steps.map(n=>{if(typeof n=="object"&&"ticker"in n){let o=sr.getInstance(n.ticker,n.args,n.duration,n.priority);if(o)return o.canvasElementAliases=[t],o.complete()}});await Promise.all(s);}}else {let i=R._currentTickers[e];i&&await i.ticker.complete();}}animate(e,t,i,s){try{t=Ut(t);}catch(l){throw L.error("animate keyframes cannot contain functions or classes"),l}try{i=Ut(i);}catch(l){throw L.error("animate options cannot contain functions or classes"),l}let n=[];typeof e=="string"?n=[e]:Array.isArray(e)?n=e.map(l=>typeof l=="string"?l:l.label):n=[e.label];let o;Array.isArray(t)?o=new hu({sequence:t,options:i},void 0,s):o=new du({keyframes:t,options:i},void 0,s);let a=this.addTicker(n,o),{forceCompleteBeforeNext:u}=i||{};return a&&u&&this.completeTickerOnStepEnd({id:a}),a}addLayer(e,t){if(e===fi){L.error(`The alias ${fi} is reserved`);return}return t.label=e,R.app.stage.addChild(t)}getLayer(e){return R.app.stage.getChildByLabel(e)}removeLayer(e){R.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return R.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return R.removeHtmlLayer(e)}getHtmlLayer(e){return R.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAllTickers(),this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=hw(t));}),{tickers:Ut(R.currentTickersWithoutCreatedBySteps),tickersSteps:Ut(R._currentTickersSequence),elements:Ut(e),stage:Ut(ou(this.gameLayer)),elementAliasesOrder:Ut(R.childrenAliasesOrder),tickersOnPause:Ut(R._tickersOnPause),tickersToCompleteOnStepEnd:Ut(R._tickersToCompleteOnStepEnd)}}async restore(e){this.clear();try{if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let t=e.elementAliasesOrder,i={},s=Object.entries(e.elements).map(async([n,o])=>{i[n]=await o0(o);});await Promise.all(s),t.forEach(n=>{let o=i[n];o&&this.add(n,o);});}else {L.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Zi(this.gameLayer,e.stage,{ignoreScale:!0}):L.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let t=e.tickers;Object.entries(t).forEach(([i,s])=>{let n=s.canvasElementAliases;if(n.length!==0){let o=sr.getInstance(s.id,s.args,s.duration,s.priority);o?(o.canvasElementAliases=n,this.addTicker(n,o,{id:i}),s.paused&&o.pause()):L.error(`Ticker ${s.id} not found`);}});}if(e.hasOwnProperty("tickersSteps")){let t=e.tickersSteps;Object.entries(t).forEach(([i,s])=>{R._currentTickersSequence[i]=s,Object.keys(s).forEach(n=>{this.runTickersSequence(i,n);});});}if(e.hasOwnProperty("tickersOnPause")){let t=e.tickersOnPause;Object.keys(t).forEach(i=>{let s=t[i];"tickerIdsExcluded"in s&&s.tickerIdsExcluded&&(t[i].tickerIdsExcluded=s.tickerIdsExcluded),"tickerIdsIncluded"in s&&s.tickerIdsIncluded&&(t[i].tickerIdsIncluded=s.tickerIdsIncluded);}),R._tickersOnPause=t;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let t=e.tickersToCompleteOnStepEnd,i=t.tikersIds,s=t.stepAlias.map(n=>({id:n.id,alias:n.alias}));R._tickersToCompleteOnStepEnd={tikersIds:i,stepAlias:s};}}catch(t){L.error("Error importing data",t);}}};var u0=class{constructor(){O(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var l0=class{constructor(){O(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};async function u5(r,e={},t){let i=D.find(r);if(!i){L.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},{shakeType:n="horizontal",maxShockSize:o=10,shocksNumber:a=10,...u}=e,l=a-1;if(l<2){L.error("The number of shocks must be at least 3.");return}let c=Math.floor(l/2),h=Math.ceil(l/2),d=[];for(let _=0;_<c;_++){let g=o*(_+1)/c;n==="horizontal"?_%2!==0?d.push(s.x+g):d.push(s.x-g):_%2!==0?d.push(s.y+g):d.push(s.y-g);}let f=c%2===0;for(let _=h;_>0;_--){let g=o*(_+1)/(h-1);n==="horizontal"?_%2===0&&!f||_%2!==0&&f?d.push(s.x-g):d.push(s.x+g):_%2===0&&!f||_%2!==0&&f?d.push(s.y-g):d.push(s.y+g);}let x;if(n==="horizontal"?(d.push(s.x),x=D.animate(r,{x:d},u,t)):(d.push(s.y),x=D.animate(r,{y:d},u,t)),x)return [x]}Te();function c0(r,e,t){let i=new Le(t,e);return D.add(r,i),i}async function l5(r,e,t){let i=new Le(t,e);return await i.load(),D.add(r,i),i}Te();function h0(r,e,t){if(!e)if(ut.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return D.add(r,i),i}async function c5(r,e,t){if(!e)if(ut.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return await i.load(),D.add(r,i),i}Te();function d0(r,e,t){if(!e)if(ut.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new er(t,e);return D.add(r,i),i}async function h5(r,e,t){if(!e)if(ut.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new er(t,e);return await i.load(),D.add(r,i),i}function xw(r,e){if(r.type==="align"){let t,i;e instanceof Se&&(t=e.anchor.x,i=e.anchor.y);let s=Ke(e.pivot,e.angle),n=Ke(e.scale,e.angle);r.x=Xr("width",r.x,jr(e),s.x,n.x<0,t),r.y=Xr("height",r.y,$r(e),s.y,n.y<0,i);}return r.type==="percentage"&&(r.x=Yr("width",r.x),r.y=Yr("height",r.y)),{x:r.x,y:r.y}}function ep(r,e){if(typeof e=="string")return qf(e)?d0(r,e):h0(r,e);if(Array.isArray(e))return c0(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return qf(e.value)?d0(r,e.value,e.options):h0(r,e.value,e.options);if(Array.isArray(e.value))return c0(r,e.value,e.options)}return D.add(r,e),e}async function Sk(r,e,t={},i){let{forceCompleteBeforeNext:s=true,tickerIdToResume:n=[],...o}=t,a=[];e||(e=r),typeof n=="string"&&(n=[n]);let u;if(D.find(r)&&(u=r+"_temp_disolve",D.editAlias(r,u)),e=ep(r,e),u&&D.copyCanvasElementProperty(u,r),u&&D.transferTickers(u,r,"duplicate"),e.alpha=0,u){let c=f0(u,{...t,autoplay:false,forceCompleteBeforeNext:s},i);c&&(a.push(...c),n.push(...c));}let l=D.animate(r,{alpha:1},{...o,tickerIdToResume:n,forceCompleteBeforeNext:s},i);if(l&&a.push(l),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function f0(r,e={},t){let{forceCompleteBeforeNext:i=true,aliasToRemoveAfter:s=[],...n}=e;typeof s=="string"&&(s=[s]),s.push(r);let o=D.animate(r,{alpha:0},{...n,aliasToRemoveAfter:s,forceCompleteBeforeNext:i},t);if(o)return [o]}async function d5(r,e,t={},i){let{forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=t,a=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!D.find(r))return Sk(r,e,t,i);let u=r+"_temp_fade";D.editAlias(r,u),n.push(u),e=ep(r,e),u&&D.copyCanvasElementProperty(u,r),u&&D.transferTickers(u,r,"duplicate"),e.alpha=0;let l=D.animate(r,{alpha:1},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},i);if(l){let c=f0(u,{...t,tickerIdToResume:l,forceCompleteBeforeNext:s},i);c&&a.push(...c),a.push(l),D.pauseTicker({id:l});}if((e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function f5(r,e={},t){return f0(r,e,t)}async function p5(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u,...l}=t,c=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let h;D.find(r)&&(h=r+"_temp_movein",D.editAlias(r,h)),e=ep(r,e),h&&D.copyCanvasElementProperty(h,r),h&&D.transferTickers(h,r,"move");let d;if(e instanceof Pe||e instanceof Le?d=e.positionInfo:d={x:e.x,y:e.y,type:"pixel"},h)if(u){let _=_w(h,{...t,autoplay:false,forceCompleteBeforeNext:n},i);_&&(c.push(..._),o.push(..._));}else a.push(h);switch((e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),s){case "up":e.y=D.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=D.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let f=D.pauseTicker({canvasAlias:r});o.push(...f);let x=D.animate(r,xw(d,e),{...l,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(x&&c.push(x),c.length>0)return c}function _w(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=D.find(r);if(!a){L.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y};switch(i){case "up":u.y=-a.height;break;case "down":u.y=D.canvasHeight+a.height;break;case "left":u.x=-a.width;break;case "right":u.x=D.canvasWidth+a.width;break}D.pauseTicker({canvasAlias:r});let l=D.animate(r,u,{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(l)return [l]}async function m5(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],...u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;D.find(r)&&(c=r+"_temp_zoom",D.editAlias(r,c)),e=ep(r,e),c&&D.copyCanvasElementProperty(c,r),c&&D.transferTickers(c,r,"move");let h;e instanceof Pe||e instanceof Le?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d={x:e.pivot.x,y:e.pivot.y},f={x:e.scale.x,y:e.scale.y};if(c)if(t.removeOldComponentWithZoomOut){let g=Ek(c,{...t,autoplay:false,forceCompleteBeforeNext:n},i);g&&(l.push(...g),o.push(...g));}else a.push(c);(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),s=="up"?(e.pivot.y=D.canvasHeight-e.y,e.pivot.x=D.canvasWidth/2-e.x,e.y=D.canvasHeight,e.x=D.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=D.canvasWidth/2-e.x,e.y=0,e.x=D.canvasWidth/2):s=="left"?(e.pivot.x=D.canvasWidth-e.x,e.pivot.y=D.canvasHeight/2-e.y,e.x=D.canvasWidth,e.y=D.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=D.canvasHeight/2-e.y,e.x=0,e.y=D.canvasHeight/2),e.pivot=fw(e.pivot,e.angle),e.scale.set(0);let x=D.pauseTicker({canvasAlias:r});o.push(...x);let _=D.animate(r,{...xw(h,e),pivotX:d.x,pivotY:d.y,scaleX:f.x,scaleY:f.y},{...u,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(_&&l.push(_),l.length>0)return l}function Ek(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=D.find(r);if(!a){L.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y},l={x:a.pivot.x,y:a.pivot.y};i=="down"?(u.y=D.canvasHeight,u.x=D.canvasWidth/2,l.y=D.canvasHeight-u.y,l.x=D.canvasWidth/2-u.x):i=="up"?(u.y=0,u.x=D.canvasWidth/2,l.y=0-u.y,l.x=D.canvasWidth/2-u.x):i=="right"?(u.x=D.canvasWidth,u.y=D.canvasHeight/2,l.x=D.canvasWidth-u.x,l.y=D.canvasHeight/2-u.y):i=="left"&&(u.x=0,u.y=D.canvasHeight/2,l.x=0-u.x,l.y=D.canvasHeight/2-u.y),l=fw(l,a.angle),D.pauseTicker({canvasAlias:r});let c=D.animate(r,{...u,pivotX:l.x,pivotY:l.y,scaleX:0,scaleY:0},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(c)return [c]}async function g5(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],...a}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]);let l;D.find(r)&&(l=r+"_temp_push",D.editAlias(r,l)),e=ep(r,e),l&&D.copyCanvasElementProperty(l,r),l&&D.transferTickers(l,r,"move");let c;switch((e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture?c=e.positionInfo:c={x:e.x,y:e.y,type:"pixel"},s){case "up":e.y=D.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=D.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let h=D.pauseTicker({canvasAlias:r});if(o.push(...h),l){let f=Ak(l,{...t,direction:s,forceCompleteBeforeNext:n});f&&u.push(...f);}let d=D.animate(r,xw(c,e),{...a,tickerIdToResume:o,forceCompleteBeforeNext:n},i);if(d&&u.push(d),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function Ak(r,e={direction:"right"},t){return _w(r,e,t)}Te();var qr=class{constructor(e,t,i){O(this,"id","ticker_id_not_set");O(this,"args");O(this,"duration");O(this,"priority");O(this,"ticker",new le);O(this,"tickerId");O(this,"canvasElementAliases",[]);O(this,"fnValue");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){L.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(e){this.tickerId=e;let t=()=>{let{createdByTicketSteps:i}=R._currentTickers[e],s=this.canvasElementAliases;if(i){if(D.isTickerPaused(i.canvasElementAlias,i.id))return}else s=s.filter(n=>!D.isTickerPaused(n,e));return this.fn(this.ticker,this.args,s,e)};this.fnValue=t,this.ticker.add(t,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};Te();Te();function Zn(r){return (r instanceof Pe||r instanceof Le)&&r.haveEmptyTexture?false:!(r instanceof Se&&r.texture?.label=="EMPTY")}function Qn(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=yw(r[e],t):t.type==="exponential"&&(r[e]=bw(r[e],t)):r[e]!==void 0&&typeof r[e]=="object"&&r[e].haveOwnProperty("x")&&r[e].haveOwnProperty("y")&&typeof r[e].x=="number"&&typeof r[e].y=="number"&&(t.type==="linear"?(r[e].x=yw(r[e].x,t),r[e].y=yw(r[e].y,t)):t.type==="exponential"&&(r[e].x=bw(r[e].x,t),r[e].y=bw(r[e].y,t))));}function yw(r,e){let{limit:t,amt:i}=e;if(t!==void 0){if(r>t&&i>0)return t;if(r<t&&i<0)return t}return r+i}function bw(r,e){let{limit:t}=e;if(t!==void 0){if(r>t&&e.percentage>0)return t;if(r<t&&e.percentage<0)return t}return r+r*e.percentage}var x5=5,tp=class extends qr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=x5:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=D.find(c);return !(!h||o&&!Zn(h))}).forEach(c=>{let h=D.find(c);if(h&&h instanceof q){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.complete();return}else if(n==="hide"&&h.alpha<=l){this.complete();return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){L.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.complete();return}}}),a&&Qn(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=D.find(s);if(n){let o=this.getLimit(i);n.alpha=o;}});}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){L.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),D.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};sr.add(tp);Te();var _5=10;function y5(r,e){let t=Ut(r.destination);if(t.type==="align"){let i,s;e instanceof Se&&(i=e.anchor.x,s=e.anchor.y);let n=Ke(e.pivot,e.angle),o=Ke(e.scale,e.angle);t.x=Xr("width",t.x,jr(e),n.x,o.x<0,i),t.y=Xr("height",t.y,$r(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=Yr("width",t.x),t.y=Yr("height",t.y)),t}var rp=class extends qr{fn(e,t,i,s){t.speed===void 0&&(t.speed=_5);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=D.find(u);return !(!l||o&&!Zn(l))}).forEach(u=>{let l=D.find(u);if(l&&l instanceof q){let c=y5(t,l),h=c.x-l.x,d=c.y-l.y,f=h>0?1:-1,x=d>0?1:-1,_,g;if(typeof n=="number"){let m=this.speedConvert(n);h===0||d===0?_=g=m:(_=Math.abs(h/(h+d))*m,g=Math.abs(d/(h+d))*m);}else _=this.speedConvert(n.x),g=this.speedConvert(n.y);if(_>0){l.x+=f*_*e.deltaTime;let m=c.x-l.x;(f<0&&m>0||f>0&&m<0)&&(l.x=c.x);}if(g>0){l.y+=x*g*e.deltaTime;let m=c.y-l.y;(x<0&&m>0||x>0&&m<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.complete();return}else if(_<1e-5&&g<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){L.warn("The speed of the MoveTicker must be greater than 0."),this.complete();return}}}),a&&Qn(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=D.find(s);if(n){let o=i.destination;n instanceof Pe||n instanceof Le?n.positionInfo=o:(n.x=o.x,n.y=o.y);}});}speedConvert(e){return e*(66/400)}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){L.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),D.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};sr.add(rp);Te();var b5=1,ip=class extends qr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=b5);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=D.find(l);return !(!c||t.startOnlyIfHaveTexture&&!Zn(c))}).forEach(l=>{let c=D.find(l);if(c&&c instanceof q&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.complete()):!n&&c.angle<=a&&(c.angle=a,this.complete())),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){L.warn("The speed of the RotateTicker must be greater than 0."),this.complete();return}}),o&&Qn(t,"speed",o);}onComplete(e,t,i){let{limit:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=D.find(n);o&&s!==void 0&&(o.angle=s);});}speedConvert(e){return e/100}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){L.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),D.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};sr.add(ip);Te();var v5=10,sp=class extends qr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=v5);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(d=>{let f=D.find(d);return !(!f||a&&!Zn(f))}).forEach(d=>{let f=D.find(d);if(f&&f instanceof q){if(o==="zoom"&&(f.scale.x<h.x||f.scale.y<h.y)?(f.scale.x+=l*e.deltaTime,f.scale.y+=c*e.deltaTime):o==="unzoom"&&(f.scale.x>h.x||f.scale.y>h.y)&&(f.scale.x-=l*e.deltaTime,f.scale.y-=c*e.deltaTime),o==="zoom"){if(f.scale.x>h.x&&(f.scale.x=h.x),f.scale.y>h.y&&(f.scale.y=h.y),f.scale.x>=h.x&&f.scale.y>=h.y){this.complete();return}}else if(o==="unzoom"&&(f.scale.x<h.x&&(f.scale.x=h.x),f.scale.y<h.y&&(f.scale.y=h.y),f.scale.x<=h.x&&f.scale.y<=h.y)){this.complete();return}if((l<1e-5&&c<1e-5||l<1e-5&&f.scale.y==h.y||c<1e-5&&f.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){L.warn("The speed of the ZoomTicker must be greater than 0."),this.complete();return}}}),u&&Qn(t,"speed",u);}speedConvert(e){return e/600}onComplete(e,t,i){let{isZoomInOut:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=D.find(n);if(o){let a=this.getLimit(i);if(o.scale.x=a.x,o.scale.y=a.y,s){let{pivot:u,position:l}=s;o.pivot=u.x,o.position=l;}}});}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){L.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),D.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};sr.add(sp);function vw(r,e){r.indexOf(e)===-1&&r.push(e);}function fu(r,e){let t=r.indexOf(e);t>-1&&r.splice(t,1);}var gr=(r,e,t)=>t>e?e:t<r?r:t;function np(r,e){return e?`${r}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:r}var es=()=>{},Pt=()=>{};process.env.NODE_ENV!=="production"&&(es=(r,e,t)=>{!r&&typeof console<"u"&&console.warn(np(e,t));},Pt=(r,e,t)=>{if(!r)throw new Error(np(e,t))});var $t={};var op=r=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(r);function Tw(r){return typeof r=="object"&&r!==null}var ap=r=>/^0[^.\s]+$/u.test(r);function pu(r){let e;return ()=>(e===void 0&&(e=r()),e)}var Pr=r=>r;var T5=(r,e)=>t=>e(r(t)),mu=(...r)=>r.reduce(T5);var gu=(r,e,t)=>{let i=e-r;return i===0?1:(t-r)/i};var xu=class{constructor(){this.subscriptions=[];}add(e){return vw(this.subscriptions,e),()=>fu(this.subscriptions,e)}notify(e,t,i){let s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,t,i);else for(let n=0;n<s;n++){let o=this.subscriptions[n];o&&o(e,t,i);}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0;}};var bt=r=>r*1e3,nr=r=>r/1e3;function up(r,e){return e?r*(1e3/e):0}var Ck=new Set;function lp(r,e,t){r||Ck.has(e)||(console.warn(np(e,t)),Ck.add(e));}var wk=(r,e,t)=>{let i=e-r;return ((t-r)%i+i)%i+r};var Pk=(r,e,t)=>(((1-3*t+3*e)*r+(3*t-6*e))*r+3*e)*r,S5=1e-7,E5=12;function A5(r,e,t,i,s){let n,o,a=0;do o=e+(t-e)/2,n=Pk(o,i,s)-r,n>0?t=o:e=o;while(Math.abs(n)>S5&&++a<E5);return o}function Jn(r,e,t,i){if(r===e&&t===i)return Pr;let s=n=>A5(n,0,1,r,t);return n=>n===0||n===1?n:Pk(s(n),e,i)}var p0=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2;var m0=r=>e=>1-r(1-e);var g0=Jn(.33,1.53,.69,.99),Xc=m0(g0),cp=p0(Xc);var hp=r=>(r*=2)<1?.5*Xc(r):.5*(2-Math.pow(2,-10*(r-1)));var dp=r=>1-Math.sin(Math.acos(r)),Sw=m0(dp),fp=p0(dp);var Ew=Jn(.42,0,1,1),Aw=Jn(0,0,.58,1),pp=Jn(.42,0,.58,1);var mp=r=>Array.isArray(r)&&typeof r[0]!="number";function gp(r,e){return mp(r)?r[wk(0,r.length,e)]:r}var xp=r=>Array.isArray(r)&&typeof r[0]=="number";var Bk={linear:Pr,easeIn:Ew,easeInOut:pp,easeOut:Aw,circIn:dp,circInOut:fp,circOut:Sw,backIn:Xc,backInOut:cp,backOut:g0,anticipate:hp},C5=r=>typeof r=="string",x0=r=>{if(xp(r)){Pt(r.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,t,i,s]=r;return Jn(e,t,i,s)}else if(C5(r))return Pt(Bk[r]!==void 0,`Invalid easing type '${r}'`,"invalid-easing-type"),Bk[r];return r};var _p=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Mk(r,e){let t=new Set,i=new Set,s=false,n=false,o=new WeakSet,a={delta:0,timestamp:0,isProcessing:false};function l(h){o.has(h)&&(c.schedule(h),r()),h(a);}let c={schedule:(h,d=false,f=false)=>{let _=f&&s?t:i;return d&&o.add(h),_.has(h)||_.add(h),h},cancel:h=>{i.delete(h),o.delete(h);},process:h=>{if(a=h,s){n=true;return}s=true,[t,i]=[i,t],t.forEach(l),t.clear(),s=false,n&&(n=false,c.process(h));}};return c}var w5=40;function _0(r,e){let t=false,i=true,s={delta:0,timestamp:0,isProcessing:false},n=()=>t=true,o=_p.reduce((v,S)=>(v[S]=Mk(n),v),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:d,render:f,postRender:x}=o,_=()=>{let v=$t.useManualTiming?s.timestamp:performance.now();t=false,$t.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(v-s.timestamp,w5),1)),s.timestamp=v,s.isProcessing=true,a.process(s),u.process(s),l.process(s),c.process(s),h.process(s),d.process(s),f.process(s),x.process(s),s.isProcessing=false,t&&e&&(i=false,r(_));},g=()=>{t=true,i=true,s.isProcessing||r(_);};return {schedule:_p.reduce((v,S)=>{let A=o[S];return v[S]=(E,w=false,M=false)=>(t||g(),A.schedule(E,w,M)),v},{}),cancel:v=>{for(let S=0;S<_p.length;S++)o[_p[S]].cancel(v);},state:s,steps:o}}var{schedule:qt,cancel:jc,state:_u}=_0(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pr,true);var y0;function B5(){y0=void 0;}var Bt={now:()=>(y0===void 0&&Bt.set(_u.isProcessing||$t.useManualTiming?_u.timestamp:performance.now()),y0),set:r=>{y0=r,queueMicrotask(B5);}};var Rk=r=>e=>typeof e=="string"&&e.startsWith(r),yp=Rk("--"),M5=Rk("var(--"),yu=r=>M5(r)?R5.test(r.split("/*")[0].trim()):false,R5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var ts={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},Ms={...ts,transform:r=>gr(0,1,r)},bp={...ts,default:1};var eo=r=>Math.round(r*1e5)/1e5;var qc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Dk(r){return r==null}var Ik=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Kc=(r,e)=>t=>!!(typeof t=="string"&&Ik.test(t)&&t.startsWith(r)||e&&!Dk(t)&&Object.prototype.hasOwnProperty.call(t,e)),b0=(r,e,t)=>i=>{if(typeof i!="string")return i;let[s,n,o,a]=i.match(qc);return {[r]:parseFloat(s),[e]:parseFloat(n),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var D5=r=>gr(0,255,r),Cw={...ts,transform:r=>Math.round(D5(r))},rs={test:Kc("rgb","red"),parse:b0("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:i=1})=>"rgba("+Cw.transform(r)+", "+Cw.transform(e)+", "+Cw.transform(t)+", "+eo(Ms.transform(i))+")"};function I5(r){let e="",t="",i="",s="";return r.length>5?(e=r.substring(1,3),t=r.substring(3,5),i=r.substring(5,7),s=r.substring(7,9)):(e=r.substring(1,2),t=r.substring(2,3),i=r.substring(3,4),s=r.substring(4,5),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}var vp={test:Kc("#"),parse:I5,transform:rs.transform};var Tp=r=>({test:e=>typeof e=="string"&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),Ti=Tp("deg"),Rs=Tp("%"),Q=Tp("px"),ww=Tp("vh"),Pw=Tp("vw"),v0={...Rs,parse:r=>Rs.parse(r)/100,transform:r=>Rs.transform(r*100)};var to={test:Kc("hsl","hue"),parse:b0("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(r)+", "+Rs.transform(eo(e))+", "+Rs.transform(eo(t))+", "+eo(Ms.transform(i))+")"};var Ze={test:r=>rs.test(r)||vp.test(r)||to.test(r),parse:r=>rs.test(r)?rs.parse(r):to.test(r)?to.parse(r):vp.parse(r),transform:r=>typeof r=="string"?r:r.hasOwnProperty("red")?rs.transform(r):to.transform(r),getAnimatableNone:r=>{let e=Ze.parse(r);return e.alpha=0,Ze.transform(e)}};var kk=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function k5(r){return isNaN(r)&&typeof r=="string"&&(r.match(qc)?.length||0)+(r.match(kk)?.length||0)>0}var Ok="number",Gk="color",F5="var",O5="var(",Fk="${}",G5=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ro(r){let e=r.toString(),t=[],i={color:[],number:[],var:[]},s=[],n=0,a=e.replace(G5,u=>(Ze.test(u)?(i.color.push(n),s.push(Gk),t.push(Ze.parse(u))):u.startsWith(O5)?(i.var.push(n),s.push(F5),t.push(u)):(i.number.push(n),s.push(Ok),t.push(parseFloat(u))),++n,Fk)).split(Fk);return {values:t,split:a,indexes:i,types:s}}function Uk(r){return ro(r).values}function Lk(r){let{split:e,types:t}=ro(r),i=e.length;return s=>{let n="";for(let o=0;o<i;o++)if(n+=e[o],s[o]!==void 0){let a=t[o];a===Ok?n+=eo(s[o]):a===Gk?n+=Ze.transform(s[o]):n+=s[o];}return n}}var U5=r=>typeof r=="number"?0:Ze.test(r)?Ze.getAnimatableNone(r):r;function L5(r){let e=Uk(r);return Lk(r)(e.map(U5))}var Br={test:k5,parse:Uk,createTransformer:Lk,getAnimatableNone:L5};function Bw(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function Nk({hue:r,saturation:e,lightness:t,alpha:i}){r/=360,e/=100,t/=100;let s=0,n=0,o=0;if(!e)s=n=o=t;else {let a=t<.5?t*(1+e):t+e-t*e,u=2*t-a;s=Bw(u,a,r+1/3),n=Bw(u,a,r),o=Bw(u,a,r-1/3);}return {red:Math.round(s*255),green:Math.round(n*255),blue:Math.round(o*255),alpha:i}}function Zc(r,e){return t=>t>0?e:r}var Si=(r,e,t)=>r+(e-r)*t;var Mw=(r,e,t)=>{let i=r*r,s=t*(e*e-i)+i;return s<0?0:Math.sqrt(s)},N5=[vp,rs,to],V5=r=>N5.find(e=>e.test(r));function Vk(r){let e=V5(r);if(es(!!e,`'${r}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return false;let t=e.parse(r);return e===to&&(t=Nk(t)),t}var Rw=(r,e)=>{let t=Vk(r),i=Vk(e);if(!t||!i)return Zc(r,e);let s={...t};return n=>(s.red=Mw(t.red,i.red,n),s.green=Mw(t.green,i.green,n),s.blue=Mw(t.blue,i.blue,n),s.alpha=Si(t.alpha,i.alpha,n),rs.transform(s))};var T0=new Set(["none","hidden"]);function Hk(r,e){return T0.has(r)?t=>t<=0?r:e:t=>t>=1?e:r}function H5(r,e){return t=>Si(r,e,t)}function S0(r){return typeof r=="number"?H5:typeof r=="string"?yu(r)?Zc:Ze.test(r)?Rw:X5:Array.isArray(r)?Wk:typeof r=="object"?Ze.test(r)?Rw:W5:Zc}function Wk(r,e){let t=[...r],i=t.length,s=r.map((n,o)=>S0(n)(n,e[o]));return n=>{for(let o=0;o<i;o++)t[o]=s[o](n);return t}}function W5(r,e){let t={...r,...e},i={};for(let s in t)r[s]!==void 0&&e[s]!==void 0&&(i[s]=S0(r[s])(r[s],e[s]));return s=>{for(let n in i)t[n]=i[n](s);return t}}function z5(r,e){let t=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let n=e.types[s],o=r.indexes[n][i[n]],a=r.values[o]??0;t[s]=a,i[n]++;}return t}var X5=(r,e)=>{let t=Br.createTransformer(e),i=ro(r),s=ro(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?T0.has(r)&&!s.values.length||T0.has(e)&&!i.values.length?Hk(r,e):mu(Wk(z5(i,s),s.values),t):(es(true,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Zc(r,e))};function E0(r,e,t){return typeof r=="number"&&typeof e=="number"&&typeof t=="number"?Si(r,e,t):S0(r)(r,e)}var zk=r=>{let e=({timestamp:t})=>r(t);return {start:(t=true)=>qt.update(e,t),stop:()=>jc(e),now:()=>_u.isProcessing?_u.timestamp:Bt.now()}};var A0=(r,e,t=10)=>{let i="",s=Math.max(Math.round(e/t),2);for(let n=0;n<s;n++)i+=Math.round(r(n/(s-1))*1e4)/1e4+", ";return `linear(${i.substring(0,i.length-2)})`};function Qc(r){let e=0,t=50,i=r.next(e);for(;!i.done&&e<2e4;)e+=t,i=r.next(e);return e>=2e4?1/0:e}function Sp(r,e=100,t){let i=t({...r,keyframes:[0,e]}),s=Math.min(Qc(i),2e4);return {type:"keyframes",ease:n=>i.next(s*n).value/e,duration:nr(s)}}var Y5=5;function C0(r,e,t){let i=Math.max(e-Y5,0);return up(t-r(i),e-i)}var We={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Iw=.001;function Xk({duration:r=We.duration,bounce:e=We.bounce,velocity:t=We.velocity,mass:i=We.mass}){let s,n;es(r<=bt(We.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=gr(We.minDamping,We.maxDamping,o),r=gr(We.minDuration,We.maxDuration,nr(r)),o<1?(s=l=>{let c=l*o,h=c*r,d=c-t,f=w0(l,o),x=Math.exp(-h);return Iw-d/f*x},n=l=>{let h=l*o*r,d=h*t+t,f=Math.pow(o,2)*Math.pow(l,2)*r,x=Math.exp(-h),_=w0(Math.pow(l,2),o);return (-s(l)+Iw>0?-1:1)*((d-f)*x)/_}):(s=l=>{let c=Math.exp(-l*r),h=(l-t)*r+1;return -Iw+c*h},n=l=>{let c=Math.exp(-l*r),h=(t-l)*(r*r);return c*h});let a=5/r,u=$5(s,n,a);if(r=bt(r),isNaN(u))return {stiffness:We.stiffness,damping:We.damping,duration:r};{let l=Math.pow(u,2)*i;return {stiffness:l,damping:o*2*Math.sqrt(i*l),duration:r}}}var j5=12;function $5(r,e,t){let i=t;for(let s=1;s<j5;s++)i=i-r(i)/e(i);return i}function w0(r,e){return r*Math.sqrt(1-e*e)}var q5=["duration","bounce"],K5=["stiffness","damping","mass"];function Yk(r,e){return e.some(t=>r[t]!==void 0)}function Z5(r){let e={velocity:We.velocity,stiffness:We.stiffness,damping:We.damping,mass:We.mass,isResolvedFromDuration:false,...r};if(!Yk(r,K5)&&Yk(r,q5))if(r.visualDuration){let t=r.visualDuration,i=2*Math.PI/(t*1.2),s=i*i,n=2*gr(.05,1,1-(r.bounce||0))*Math.sqrt(s);e={...e,mass:We.mass,stiffness:s,damping:n};}else {let t=Xk(r);e={...e,...t,mass:We.mass},e.isResolvedFromDuration=true;}return e}function Ds(r=We.visualDuration,e=We.bounce){let t=typeof r!="object"?{visualDuration:r,keyframes:[0,1],bounce:e}:r,{restSpeed:i,restDelta:s}=t,n=t.keyframes[0],o=t.keyframes[t.keyframes.length-1],a={done:false,value:n},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=Z5({...t,velocity:-nr(t.velocity||0)}),x=d||0,_=l/(2*Math.sqrt(u*c)),g=o-n,m=nr(Math.sqrt(u/c)),b=Math.abs(g)<5;i||(i=b?We.restSpeed.granular:We.restSpeed.default),s||(s=b?We.restDelta.granular:We.restDelta.default);let v;if(_<1){let A=w0(m,_);v=E=>{let w=Math.exp(-_*m*E);return o-w*((x+_*m*g)/A*Math.sin(A*E)+g*Math.cos(A*E))};}else if(_===1)v=A=>o-Math.exp(-m*A)*(g+(x+m*g)*A);else {let A=m*Math.sqrt(_*_-1);v=E=>{let w=Math.exp(-_*m*E),M=Math.min(A*E,300);return o-w*((x+_*m*g)*Math.sinh(M)+A*g*Math.cosh(M))/A};}let S={calculatedDuration:f&&h||null,next:A=>{let E=v(A);if(f)a.done=A>=h;else {let w=A===0?x:0;_<1&&(w=A===0?bt(x):C0(v,A,E));let M=Math.abs(w)<=i,P=Math.abs(o-E)<=s;a.done=M&&P;}return a.value=a.done?o:E,a},toString:()=>{let A=Math.min(Qc(S),2e4),E=A0(w=>S.next(A*w).value,A,30);return A+"ms "+E},toTransition:()=>{}};return S}Ds.applyToOptions=r=>{let e=Sp(r,100,Ds);return r.ease=e.ease,r.duration=bt(e.duration),r.type="keyframes",r};function Ep({keyframes:r,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:n=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){let h=r[0],d={done:false,value:h},f=M=>a!==void 0&&M<a||u!==void 0&&M>u,x=M=>a===void 0?u:u===void 0||Math.abs(a-M)<Math.abs(u-M)?a:u,_=t*e,g=h+_,m=o===void 0?g:o(g);m!==g&&(_=m-h);let b=M=>-_*Math.exp(-M/i),v=M=>m+b(M),S=M=>{let P=b(M),U=v(M);d.done=Math.abs(P)<=l,d.value=d.done?m:U;},A,E,w=M=>{f(d.value)&&(A=M,E=Ds({keyframes:[d.value,x(d.value)],velocity:C0(v,M,d.value),damping:s,stiffness:n,restDelta:l,restSpeed:c}));};return w(0),{calculatedDuration:null,next:M=>{let P=false;return !E&&A===void 0&&(P=true,S(M),w(M)),A!==void 0&&M>=A?E.next(M-A):(!P&&S(M),d)}}}function Q5(r,e,t){let i=[],s=t||$t.mix||E0,n=r.length-1;for(let o=0;o<n;o++){let a=s(r[o],r[o+1]);if(e){let u=Array.isArray(e)?e[o]||Pr:e;a=mu(u,a);}i.push(a);}return i}function jk(r,e,{clamp:t=true,ease:i,mixer:s}={}){let n=r.length;if(Pt(n===e.length,"Both input and output ranges must be the same length","range-length"),n===1)return ()=>e[0];if(n===2&&e[0]===e[1])return ()=>e[1];let o=r[0]===r[1];r[0]>r[n-1]&&(r=[...r].reverse(),e=[...e].reverse());let a=Q5(e,i,s),u=a.length,l=c=>{if(o&&c<r[0])return e[0];let h=0;if(u>1)for(;h<r.length-2&&!(c<r[h+1]);h++);let d=gu(r[h],r[h+1],c);return a[h](d)};return t?c=>l(gr(r[0],r[n-1],c)):l}function Ap(r,e){let t=r[r.length-1];for(let i=1;i<=e;i++){let s=gu(0,e,i);r.push(Si(t,1,s));}}function Cp(r){let e=[0];return Ap(e,r.length-1),e}function $k(r,e){return r.map(t=>t*e)}function J5(r,e){return r.map(()=>e||pp).splice(0,r.length-1)}function io({duration:r=300,keyframes:e,times:t,ease:i="easeInOut"}){let s=mp(i)?i.map(x0):x0(i),n={done:false,value:e[0]},o=$k(t&&t.length===e.length?t:Cp(e),r),a=jk(o,e,{ease:Array.isArray(s)?s:J5(e,s)});return {calculatedDuration:r,next:u=>(n.value=a(u),n.done=u>=r,n)}}var eL=r=>r!==null;function Jc(r,{repeat:e,repeatType:t="loop"},i,s=1){let n=r.filter(eL),a=s<0||e&&t!=="loop"&&e%2===1?0:n.length-1;return !a||i===void 0?n[a]:i}var tL={decay:Ep,inertia:Ep,tween:io,keyframes:io,spring:Ds};function P0(r){typeof r.type=="string"&&(r.type=tL[r.type]);}var so=class{constructor(){this.updateFinished();}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e;});}notifyFinished(){this.resolve();}then(e,t){return this.finished.then(e,t)}};var rL=r=>r/100,Is=class extends so{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=false,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==Bt.now()&&this.tick(Bt.now()),this.isStopped=true,this.state!=="idle"&&(this.teardown(),this.options.onStop?.());},this.options=e,this.initAnimation(),this.play(),e.autoplay===false&&this.pause();}initAnimation(){let{options:e}=this;P0(e);let{type:t=io,repeat:i=0,repeatDelay:s=0,repeatType:n,velocity:o=0}=e,{keyframes:a}=e,u=t||io;process.env.NODE_ENV!=="production"&&u!==io&&Pt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),u!==io&&typeof a[0]!="number"&&(this.mixKeyframes=mu(rL,E0(a[0],a[1])),a=[0,100]);let l=u({...e,keyframes:a});n==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=Qc(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=l;}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t;}tick(e,t=false){let{generator:i,totalDuration:s,mixKeyframes:n,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return i.next(0);let{delay:l=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:f,type:x,onUpdate:_,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let m=this.currentTime-l*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?m<0:m>s;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,S=i;if(h){let M=Math.min(this.currentTime,s)/a,P=Math.floor(M),U=M%1;!U&&M>=1&&(U=1),U===1&&P--,P=Math.min(P,h+1),!!(P%2)&&(d==="reverse"?(U=1-U,f&&(U-=f/a)):d==="mirror"&&(S=o)),v=gr(0,1,U)*a;}let A=b?{done:false,value:c[0]}:S.next(v);n&&(A.value=n(A.value));let{done:E}=A;!b&&u!==null&&(E=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);let w=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return w&&x!==Ep&&(A.value=Jc(c,this.options,g,this.speed)),_&&_(A.value),w&&this.finish(),A}then(e,t){return this.finished.then(e,t)}get duration(){return nr(this.calculatedDuration)}get time(){return nr(this.currentTime)}set time(e){e=bt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(false);}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Bt.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=nr(this.currentTime));}play(){if(this.isStopped)return;let{driver:e=zk,startTime:t}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),this.options.onPlay?.();let i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=t??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start();}pause(){this.state="paused",this.updateTime(Bt.now()),this.holdTime=this.currentTime;}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null;}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.();}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.();}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null;}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0);}sample(e){return this.startTime=0,this.tick(e,true)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function qk(r){for(let e=1;e<r.length;e++)r[e]??(r[e]=r[e-1]);}var bu=r=>r*180/Math.PI,kw=r=>{let e=bu(Math.atan2(r[1],r[0]));return Fw(e)},iL={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:r=>(Math.abs(r[0])+Math.abs(r[3]))/2,rotate:kw,rotateZ:kw,skewX:r=>bu(Math.atan(r[1])),skewY:r=>bu(Math.atan(r[2])),skew:r=>(Math.abs(r[1])+Math.abs(r[2]))/2},Fw=r=>(r=r%360,r<0&&(r+=360),r),Kk=kw,Zk=r=>Math.sqrt(r[0]*r[0]+r[1]*r[1]),Qk=r=>Math.sqrt(r[4]*r[4]+r[5]*r[5]),sL={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Zk,scaleY:Qk,scale:r=>(Zk(r)+Qk(r))/2,rotateX:r=>Fw(bu(Math.atan2(r[6],r[5]))),rotateY:r=>Fw(bu(Math.atan2(-r[2],r[0]))),rotateZ:Kk,rotate:Kk,skewX:r=>bu(Math.atan(r[4])),skewY:r=>bu(Math.atan(r[1])),skew:r=>(Math.abs(r[1])+Math.abs(r[4]))/2};function wp(r){return r.includes("scale")?1:0}function Pp(r,e){if(!r||r==="none")return wp(e);let t=r.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),i,s;if(t)i=sL,s=t;else {let a=r.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=iL,s=a;}if(!s)return wp(e);let n=i[e],o=s[1].split(",").map(nL);return typeof n=="function"?n(o):o[n]}var Ow=(r,e)=>{let{transform:t="none"}=getComputedStyle(r);return Pp(t,e)};function nL(r){return parseFloat(r.trim())}var Ei=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Mr=new Set(Ei);var Gw=r=>r===ts||r===Q,oL=new Set(["x","y","z"]),aL=Ei.filter(r=>!oL.has(r));function Jk(r){let e=[];return aL.forEach(t=>{let i=r.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0));}),e}var no={width:({x:r},{paddingLeft:e="0",paddingRight:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),height:({y:r},{paddingTop:e="0",paddingBottom:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),top:(r,{top:e})=>parseFloat(e),left:(r,{left:e})=>parseFloat(e),bottom:({y:r},{top:e})=>parseFloat(e)+(r.max-r.min),right:({x:r},{left:e})=>parseFloat(e)+(r.max-r.min),x:(r,{transform:e})=>Pp(e,"x"),y:(r,{transform:e})=>Pp(e,"y")};no.translateX=no.x;no.translateY=no.y;var vu=new Set,Uw=false,Lw=false,Nw=false;function eF(){if(Lw){let r=Array.from(vu).filter(i=>i.needsMeasurement),e=new Set(r.map(i=>i.element)),t=new Map;e.forEach(i=>{let s=Jk(i);s.length&&(t.set(i,s),i.render());}),r.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();let s=t.get(i);s&&s.forEach(([n,o])=>{i.getValue(n)?.set(o);});}),r.forEach(i=>i.measureEndState()),r.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY);});}Lw=false,Uw=false,vu.forEach(r=>r.complete(Nw)),vu.clear();}function tF(){vu.forEach(r=>{r.readKeyframes(),r.needsMeasurement&&(Lw=true);});}function Vw(){Nw=true,tF(),eF(),Nw=false;}var ks=class{constructor(e,t,i,s,n,o=false){this.state="pending",this.isAsync=false,this.needsMeasurement=false,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=s,this.element=n,this.isAsync=o;}scheduleResolve(){this.state="scheduled",this.isAsync?(vu.add(this),Uw||(Uw=true,qt.read(tF),qt.resolveKeyframes(eF))):(this.readKeyframes(),this.complete());}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:i,motionValue:s}=this;if(e[0]===null){let n=s?.get(),o=e[e.length-1];if(n!==void 0)e[0]=n;else if(i&&t){let a=i.readValue(t,o);a!=null&&(e[0]=a);}e[0]===void 0&&(e[0]=o),s&&n===void 0&&s.set(e[0]);}qk(e);}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=false){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),vu.delete(this);}cancel(){this.state==="scheduled"&&(vu.delete(this),this.state="pending");}resume(){this.state==="pending"&&this.scheduleResolve();}};var rF=r=>r.startsWith("--");function iF(r,e,t){rF(e)?r.style.setProperty(e,t):r.style[e]=t;}var sF=pu(()=>window.ScrollTimeline!==void 0);var nF={};function oF(r,e){let t=pu(r);return ()=>nF[e]??t()}var B0=oF(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"});}catch{return false}return true},"linearEasing");var Tu=([r,e,t,i])=>`cubic-bezier(${r}, ${e}, ${t}, ${i})`;var Hw={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tu([0,.65,.55,1]),circOut:Tu([.55,0,1,.45]),backIn:Tu([.31,.01,.66,-0.59]),backOut:Tu([.33,1.53,.69,.99])};function Ww(r,e){if(r)return typeof r=="function"?B0()?A0(r,e):"ease-out":xp(r)?Tu(r):Array.isArray(r)?r.map(t=>Ww(t,e)||Hw.easeOut):Hw[r]}function aF(r,e,t,{delay:i=0,duration:s=300,repeat:n=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){let c={[e]:t};u&&(c.offset=u);let h=Ww(a,s);Array.isArray(h)&&(c.easing=h);let d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:n+1,direction:o==="reverse"?"alternate":"normal"};l&&(d.pseudoElement=l);let f=r.animate(c,d);return f}function Su(r){return typeof r=="function"&&"applyToOptions"in r}function uF({type:r,...e}){return Su(r)&&B0()?r.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}var M0=class extends so{constructor(e){if(super(),this.finishedTime=null,this.isStopped=false,!e)return;let{element:t,name:i,keyframes:s,pseudoElement:n,allowFlatten:o=false,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!n,this.allowFlatten=o,this.options=e,Pt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let l=uF(e);this.animation=aF(t,i,s,l,n),l.autoplay===false&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){let c=Jc(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):iF(t,i,c),this.animation.cancel();}u?.(),this.notifyFinished();};}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished());}pause(){this.animation.pause();}complete(){this.animation.finish?.();}cancel(){try{this.animation.cancel();}catch{}}stop(){if(this.isStopped)return;this.isStopped=true;let{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel());}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.();}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return nr(Number(e))}get time(){return nr(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=bt(e);}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e;}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e;}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&sF()?(this.animation.timeline=e,Pr):t(this)}};var lF={anticipate:hp,backInOut:cp,circInOut:fp};function uL(r){return r in lF}function cF(r){typeof r.ease=="string"&&uL(r.ease)&&(r.ease=lF[r.ease]);}var hF=10,R0=class extends M0{constructor(e){cF(e),P0(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e;}updateMotionValue(e){let{motionValue:t,onUpdate:i,onComplete:s,element:n,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let a=new Is({...o,autoplay:false}),u=bt(this.finishedTime??this.time);t.setWithVelocity(a.sample(u-hF).value,a.sample(u).value,hF),a.stop();}};var zw=(r,e)=>e==="zIndex"?false:!!(typeof r=="number"||Array.isArray(r)||typeof r=="string"&&(Br.test(r)||r==="0")&&!r.startsWith("url("));function lL(r){let e=r[0];if(r.length===1)return true;for(let t=0;t<r.length;t++)if(r[t]!==e)return true}function dF(r,e,t,i){let s=r[0];if(s===null)return false;if(e==="display"||e==="visibility")return true;let n=r[r.length-1],o=zw(s,e),a=zw(n,e);return es(o===a,`You are trying to animate ${e} from "${s}" to "${n}". "${o?n:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?false:lL(r)||(t==="spring"||Su(t))&&i}function eh(r){r.duration=0,r.type;}var cL=new Set(["opacity","clipPath","filter","transform"]),hL=pu(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function fF(r){let{motionValue:e,name:t,repeatDelay:i,repeatType:s,damping:n,type:o}=r;if(!(e?.owner?.current instanceof HTMLElement))return false;let{onUpdate:u,transformTemplate:l}=e.owner.getProps();return hL()&&t&&cL.has(t)&&(t!=="transform"||!l)&&!u&&!i&&s!=="mirror"&&n!==0&&o!=="inertia"}var dL=40,Bp=class extends so{constructor({autoplay:e=true,delay:t=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel();},this.createdAt=Bt.now();let d={autoplay:e,delay:t,type:i,repeat:s,repeatDelay:n,repeatType:o,name:u,motionValue:l,element:c,...h},f=c?.KeyframeResolver||ks;this.keyframeResolver=new f(a,(x,_,g)=>this.onKeyframesResolved(x,_,d,!g),u,l,c),this.keyframeResolver?.scheduleResolve();}onKeyframesResolved(e,t,i,s){this.keyframeResolver=void 0;let{name:n,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=i;this.resolvedAt=Bt.now(),dF(e,n,o,a)||(($t.instantAnimations||!u)&&c?.(Jc(e,i,t)),e[0]=e[e.length-1],eh(i),i.repeat=0);let d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>dL?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...i,keyframes:e},f=!l&&fF(d)?new R0({...d,element:d.motionValue.owner.current}):new Is(d);f.finished.then(()=>this.notifyFinished()).catch(Pr),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f;}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Vw()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e;}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e;}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play();}pause(){this.animation.pause();}complete(){this.animation.complete();}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel();}};var D0=class{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean);}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t;}attachTimeline(e){let t=this.animations.map(i=>i.attachTimeline(e));return ()=>{t.forEach((i,s)=>{i&&i(),this.animations[s].stop();});}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e);}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e);}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]());}play(){this.runAll("play");}pause(){this.runAll("pause");}cancel(){this.runAll("cancel");}complete(){this.runAll("complete");}};var Mp=class extends D0{then(e,t){return this.finished.finally(e).then(()=>{})}};var fL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pL(r){let e=fL.exec(r);if(!e)return [,];let[,t,i,s]=e;return [`--${t??i}`,s]}var mL=4;function Xw(r,e,t=1){Pt(t<=mL,`Max CSS variable fallback depth detected in property "${r}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[i,s]=pL(r);if(!i)return;let n=window.getComputedStyle(e).getPropertyValue(i);if(n){let o=n.trim();return op(o)?parseFloat(o):o}return yu(s)?Xw(s,e,t+1):s}function Rp(r,e){return r?.[e]??r?.default??r}var Dp=new Set(["width","height","top","left","right","bottom",...Ei]);var pF={test:r=>r==="auto",parse:r=>r};var I0=r=>e=>e.test(r);var Yw=[ts,Q,Rs,Ti,Pw,ww,pF],jw=r=>Yw.find(I0(r));function mF(r){return typeof r=="number"?r===0:r!==null?r==="none"||r==="0"||ap(r):true}var gL=new Set(["brightness","contrast","saturate","opacity"]);function xL(r){let[e,t]=r.slice(0,-1).split("(");if(e==="drop-shadow")return r;let[i]=t.match(qc)||[];if(!i)return r;let s=t.replace(i,""),n=gL.has(e)?1:0;return i!==t&&(n*=100),e+"("+n+s+")"}var _L=/\b([a-z-]*)\(.*?\)/gu,Ip={...Br,getAnimatableNone:r=>{let e=r.match(_L);return e?e.map(xL).join(" "):r}};var $w={...ts,transform:Math.round};var gF={rotate:Ti,rotateX:Ti,rotateY:Ti,rotateZ:Ti,scale:bp,scaleX:bp,scaleY:bp,scaleZ:bp,skew:Ti,skewX:Ti,skewY:Ti,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:Ms,originX:v0,originY:v0,originZ:Q};var Eu={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,radius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,backgroundPositionX:Q,backgroundPositionY:Q,...gF,zIndex:$w,fillOpacity:Ms,strokeOpacity:Ms,numOctaves:$w};var xF={...Eu,color:Ze,backgroundColor:Ze,outlineColor:Ze,fill:Ze,stroke:Ze,borderColor:Ze,borderTopColor:Ze,borderRightColor:Ze,borderBottomColor:Ze,borderLeftColor:Ze,filter:Ip,WebkitFilter:Ip},kp=r=>xF[r];function Fp(r,e){let t=kp(r);return t!==Ip&&(t=Br),t.getAnimatableNone?t.getAnimatableNone(e):void 0}var yL=new Set(["auto","none","0"]);function _F(r,e,t){let i=0,s;for(;i<r.length&&!s;){let n=r[i];typeof n=="string"&&!yL.has(n)&&ro(n).values.length&&(s=r[i]),i++;}if(s&&t)for(let n of e)r[n]=Fp(t,s);}var Op=class extends ks{constructor(e,t,i,s,n){super(e,t,i,s,n,true);}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let l=e[u];if(typeof l=="string"&&(l=l.trim(),yu(l))){let c=Xw(l,t.current);c!==void 0&&(e[u]=c),u===e.length-1&&(this.finalKeyframe=l);}}if(this.resolveNoneKeyframes(),!Dp.has(i)||e.length!==2)return;let[s,n]=e,o=jw(s),a=jw(n);if(o!==a)if(Gw(o)&&Gw(a))for(let u=0;u<e.length;u++){let l=e[u];typeof l=="string"&&(e[u]=parseFloat(l));}else no[i]&&(this.needsMeasurement=true);}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||mF(e[s]))&&i.push(s);i.length&&_F(e,i,t);}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=no[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let s=t[t.length-1];s!==void 0&&e.getValue(i,s).jump(s,false);}measureEndState(){let{element:e,name:t,unresolvedKeyframes:i}=this;if(!e||!e.current)return;let s=e.getValue(t);s&&s.jump(this.measuredOrigin,false);let n=i.length-1,o=i[n];i[n]=no[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u);}),this.resolveNoneKeyframes();}};function qw(r,e,t){if(r instanceof EventTarget)return [r];if(typeof r=="string"){let i=document;let s=t?.[r]??i.querySelectorAll(r);return s?Array.from(s):[]}return Array.from(r)}var Gp=(r,e)=>e&&typeof r=="number"?e.transform(r):r;var yF=30,bL=r=>!isNaN(parseFloat(r)),k0=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{let s=Bt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let n of this.dependents)n.dirty();},this.hasAnimated=false,this.setCurrent(e),this.owner=t.owner;}setCurrent(e){this.current=e,this.updatedAt=Bt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=bL(this.current));}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt;}onChange(e){return process.env.NODE_ENV!=="production"&&lp(false,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new xu);let i=this.events[e].add(t);return e==="change"?()=>{i(),qt.read(()=>{this.events.change.getSize()||this.stop();});}:i}clearListeners(){for(let e in this.events)this.events[e].clear();}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t;}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e);}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i;}jump(e,t=true){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}dirty(){this.events.change?.notify(this.current);}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e);}removeDependent(e){this.dependents&&this.dependents.delete(e);}get(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=Bt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>yF)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,yF);return up(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=true,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify();}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation();})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation();}isAnimating(){return !!this.animation}clearAnimation(){delete this.animation;}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}};function is(r,e){return new k0(r,e)}var{schedule:Zw}=_0(queueMicrotask,false);function Up(r){return Tw(r)&&"ownerSVGElement"in r}function Qw(r){return Up(r)&&r.tagName==="svg"}var ze=r=>!!(r&&r.getVelocity);var TL=[...Yw,Ze,Br],Jw=r=>TL.find(I0(r));function Lp(r){return typeof r=="object"&&!Array.isArray(r)}function F0(r,e,t,i){return typeof r=="string"&&Lp(e)?qw(r,t,i):r instanceof NodeList?Array.from(r):Array.isArray(r)?r:[r]}function bF(r,e,t){return r*(e+1)}function eP(r,e,t,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,r+parseFloat(e)):e==="<"?t:e.startsWith("<")?Math.max(0,t+parseFloat(e.slice(1))):i.get(e)??r}function SL(r,e,t){for(let i=0;i<r.length;i++){let s=r[i];s.at>e&&s.at<t&&(fu(r,s),i--);}}function vF(r,e,t,i,s,n){SL(r,s,n);for(let o=0;o<e.length;o++)r.push({value:e[o],at:Si(s,n,i[o]),easing:gp(t,o)});}function TF(r,e){for(let t=0;t<r.length;t++)r[t]=r[t]/(e+1);}function SF(r,e){return r.at===e.at?r.value===null?1:e.value===null?-1:0:r.at-e.at}var EL="easeInOut",AL=20;function CF(r,{defaultTransition:e={},...t}={},i,s){let n=e.duration||.3,o=new Map,a=new Map,u={},l=new Map,c=0,h=0,d=0;for(let f=0;f<r.length;f++){let x=r[f];if(typeof x=="string"){l.set(x,h);continue}else if(!Array.isArray(x)){l.set(x.name,eP(h,x.at,c,l));continue}let[_,g,m={}]=x;m.at!==void 0&&(h=eP(h,m.at,c,l));let b=0,v=(S,A,E,w=0,M=0)=>{let P=CL(S),{delay:U=0,times:k=Cp(P),type:J="keyframes",repeat:he,repeatType:tt,repeatDelay:ss=0,...W}=A,{ease:j=e.ease||"easeOut",duration:xr}=A,Be=typeof U=="function"?U(w,M):U,Kr=P.length,Fs=Su(J)?J:s?.[J||"keyframes"];if(Kr<=2&&Fs){let Ai=100;if(Kr===2&&BL(P)){let Us=P[1]-P[0];Ai=Math.abs(Us);}let Ci={...W};xr!==void 0&&(Ci.duration=bt(xr));let ao=Sp(Ci,Ai,Fs);j=ao.ease,xr=ao.duration;}xr??(xr=n);let Os=h+Be;k.length===1&&k[0]===0&&(k[1]=1);let Gs=k.length-P.length;if(Gs>0&&Ap(k,Gs),P.length===1&&P.unshift(null),he){Pt(he<AL,"Repeat count too high, must be less than 20","repeat-count-high"),xr=bF(xr,he);let Ai=[...P],Ci=[...k];j=Array.isArray(j)?[...j]:[j];let ao=[...j];for(let Us=0;Us<he;Us++){P.push(...Ai);for(let wi=0;wi<Ai.length;wi++)k.push(Ci[wi]+(Us+1)),j.push(wi===0?"linear":gp(ao,wi-1));}TF(k,he);}let nh=Os+xr;vF(E,P,j,k,Os,nh),b=Math.max(Be+xr,b),d=Math.max(nh,d);};if(ze(_)){let S=EF(_,a);v(g,m,AF("default",S));}else {let S=F0(_,g,i,u),A=S.length;for(let E=0;E<A;E++){g=g,m=m;let w=S[E],M=EF(w,a);for(let P in g)v(g[P],wL(m,P),AF(P,M),E,A);}}c=h,h+=b;}return a.forEach((f,x)=>{for(let _ in f){let g=f[_];g.sort(SF);let m=[],b=[],v=[];for(let A=0;A<g.length;A++){let{at:E,value:w,easing:M}=g[A];m.push(w),b.push(gu(0,d,E)),v.push(M||"easeOut");}b[0]!==0&&(b.unshift(0),m.unshift(m[0]),v.unshift(EL)),b[b.length-1]!==1&&(b.push(1),m.push(null)),o.has(x)||o.set(x,{keyframes:{},transition:{}});let S=o.get(x);S.keyframes[_]=m,S.transition[_]={...e,duration:d,ease:v,times:b,...t};}}),o}function EF(r,e){return !e.has(r)&&e.set(r,{}),e.get(r)}function AF(r,e){return e[r]||(e[r]=[]),e[r]}function CL(r){return Array.isArray(r)?r:[r]}function wL(r,e){return r&&r[e]?{...r,...r[e]}:{...r}}var PL=r=>typeof r=="number",BL=r=>r.every(PL);var oo=new WeakMap;var wF=r=>Array.isArray(r);function PF(r){let e=[{},{}];return r?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity();}),e}function O0(r,e,t,i){if(typeof e=="function"){let[s,n]=PF(i);e=e(t!==void 0?t:r.custom,s,n);}if(typeof e=="string"&&(e=r.variants&&r.variants[e]),typeof e=="function"){let[s,n]=PF(i);e=e(t!==void 0?t:r.custom,s,n);}return e}function BF(r,e,t){let i=r.getProps();return O0(i,e,i.custom,r)}function ML(r,e,t){r.hasValue(e)?r.getValue(e).set(t):r.addValue(e,is(t));}function RL(r){return wF(r)?r[r.length-1]||0:r}function MF(r,e){let t=BF(r,e),{transitionEnd:i={},transition:s={},...n}=t||{};n={...n,...i};for(let o in n){let a=RL(n[o]);ML(r,o,a);}}function RF(r){return !!(ze(r)&&r.add)}function DF(r,e){let t=r.getValue("willChange");if(RF(t))return t.add(e);if(!t&&$t.WillChange){let i=new $t.WillChange("auto");r.addValue("willChange",i),i.add(e);}}var th=r=>r.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var DL="framerAppearId",IF="data-"+th(DL);function kF(r){return r.props[IF]}var IL=r=>r!==null;function FF(r,{repeat:e,repeatType:t="loop"},i){let s=r.filter(IL),n=e&&t!=="loop"&&e%2===1?0:s.length-1;return !n||i===void 0?s[n]:i}var kL={type:"spring",stiffness:500,damping:25,restSpeed:10},FL=r=>({type:"spring",stiffness:550,damping:r===0?2*Math.sqrt(550):30,restSpeed:10}),OL={type:"keyframes",duration:.8},GL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},OF=(r,{keyframes:e})=>e.length>2?OL:Mr.has(r)?r.startsWith("scale")?FL(e[1]):kL:GL;function GF({when:r,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:s,repeat:n,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return !!Object.keys(c).length}var G0=(r,e,t,i={},s,n)=>o=>{let a=Rp(i,r)||{},u=a.delay||i.delay||0,{elapsed:l=0}=i;l=l-bt(u);let c={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d);},onComplete:()=>{o(),a.onComplete&&a.onComplete();},name:r,motionValue:e,element:n?void 0:s};GF(a)||Object.assign(c,OF(r,c)),c.duration&&(c.duration=bt(c.duration)),c.repeatDelay&&(c.repeatDelay=bt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=false;if((c.type===false||c.duration===0&&!c.repeatDelay)&&(eh(c),c.delay===0&&(h=true)),($t.instantAnimations||$t.skipAnimations)&&(h=true,eh(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!n&&e.get()!==void 0){let d=FF(c.keyframes,a);if(d!==void 0){qt.update(()=>{c.onUpdate(d),c.onComplete();});return}}return a.isSync?new Is(c):new Bp(c)};function UL({protectedKeys:r,needsAnimating:e},t){let i=r.hasOwnProperty(t)&&e[t]!==true;return e[t]=false,i}function UF(r,e,{delay:t=0,transitionOverride:i,type:s}={}){let{transition:n=r.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(n=i);let u=[],l=s&&r.animationState&&r.animationState.getState()[s];for(let c in a){let h=r.getValue(c,r.latestValues[c]??null),d=a[c];if(d===void 0||l&&UL(l,c))continue;let f={delay:t,...Rp(n||{},c)},x=h.get();if(x!==void 0&&!h.isAnimating&&!Array.isArray(d)&&d===x&&!f.velocity)continue;let _=false;if(window.MotionHandoffAnimation){let m=kF(r);if(m){let b=window.MotionHandoffAnimation(m,c,qt);b!==null&&(f.startTime=b,_=true);}}DF(r,c),h.start(G0(c,h,d,r.shouldReduceMotion&&Dp.has(c)?{type:false}:f,r,_));let g=h.animation;g&&u.push(g);}return o&&Promise.all(u).then(()=>{qt.update(()=>{o&&MF(r,o);});}),u}function LF({top:r,left:e,right:t,bottom:i}){return {x:{min:e,max:t},y:{min:r,max:i}}}function NF(r,e){if(!e)return r;let t=e({x:r.left,y:r.top}),i=e({x:r.right,y:r.bottom});return {top:t.y,left:t.x,bottom:i.y,right:i.x}}function VF(r,e){return LF(NF(r.getBoundingClientRect(),e))}var HF={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},U0={};for(let r in HF)U0[r]={isEnabled:e=>HF[r].some(t=>!!e[t])};var WF=()=>({min:0,max:0}),rh=()=>({x:WF(),y:WF()});var zF=typeof window<"u";var Np={current:null},L0={current:false};function XF(){if(L0.current=true,!!zF)if(window.matchMedia){let r=window.matchMedia("(prefers-reduced-motion)"),e=()=>Np.current=r.matches;r.addEventListener("change",e),e();}else Np.current=false;}function YF(r){return r!==null&&typeof r=="object"&&typeof r.start=="function"}function jF(r){return typeof r=="string"||Array.isArray(r)}var LL=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$F=["initial",...LL];function tP(r){return YF(r.animate)||$F.some(e=>jF(r[e]))}function qF(r){return !!(tP(r)||r.variants)}function KF(r,e,t){for(let i in e){let s=e[i],n=t[i];if(ze(s))r.addValue(i,s);else if(ze(n))r.addValue(i,is(s,{owner:r}));else if(n!==s)if(r.hasValue(i)){let o=r.getValue(i);o.liveStyle===true?o.jump(s):o.hasAnimated||o.set(s);}else {let o=r.getStaticValue(i);r.addValue(i,is(o!==void 0?o:s,{owner:r}));}}for(let i in t)e[i]===void 0&&r.removeValue(i);return e}var ZF=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ih=class{scrapeMotionValuesFromProps(e,t,i){return {}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:n,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=false,this.isControllingVariants=false,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ks,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection));},this.renderScheduledAt=0,this.scheduleRender=()=>{let d=Bt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,qt.render(this.render,false,true));};let{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=t.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!n,this.isControllingVariants=tP(t),this.isVariantNode=qF(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...h}=this.scrapeMotionValuesFromProps(t,{},this);for(let d in h){let f=h[d];u[d]!==void 0&&ze(f)&&f.set(u[d]);}}mount(e){this.current=e,oo.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),L0.current||XF(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?false:this.reducedMotionConfig==="always"?true:Np.current,process.env.NODE_ENV!=="production"&&lp(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext);}unmount(){this.projection&&this.projection.unmount(),jc(this.notifyUpdate),jc(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=false);}this.current=null;}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e);}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e);}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let i=Mr.has(e);i&&this.onBindTransform&&this.onBindTransform();let s=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&qt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=true),this.scheduleRender();}),n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{s(),n&&n(),t.owner&&t.stop();});}sortNodePosition(e){return !this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in U0){let t=U0[e];if(!t)continue;let{isEnabled:i,Feature:s}=t;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){let n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=true);}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props);}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):rh()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t;}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<ZF.length;i++){let s=ZF[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);let n="on"+s,o=e[n];o&&(this.propEventSubscriptions[s]=this.on(s,o));}this.prevMotionValues=KF(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue();}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get());}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState);}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=is(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(op(i)||ap(i))?i=parseFloat(i):!Jw(i)&&Br.test(t)&&(i=Fp(e,t)),this.setBaseTarget(e,ze(i)?i.get():i)),ze(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t;}getBaseTarget(e){let{initial:t}=this.props,i;if(typeof t=="string"||typeof t=="object"){let n=O0(this.props,t,this.presenceContext?.custom);n&&(i=n[e]);}if(t&&i!==void 0)return i;let s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!ze(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new xu),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t);}scheduleRenderMicrotask(){Zw.render(this.render);}};var sh=class extends ih{constructor(){super(...arguments),this.KeyframeResolver=Op;}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e];}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ze(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`);}));}};var NL={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},VL=Ei.length;function QF(r,e,t){let i="",s=true;for(let n=0;n<VL;n++){let o=Ei[n],a=r[o];if(a===void 0)continue;let u=true;if(typeof a=="number"?u=a===(o.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||t){let l=Gp(a,Eu[o]);if(!u){s=false;let c=NL[o]||o;i+=`${c}(${l}) `;}t&&(e[o]=l);}}return i=i.trim(),t?i=t(e,s?"":i):s&&(i="none"),i}function N0(r,e,t){let{style:i,vars:s,transformOrigin:n}=r,o=false,a=false;for(let u in e){let l=e[u];if(Mr.has(u)){o=true;continue}else if(yp(u)){s[u]=l;continue}else {let c=Gp(l,Eu[u]);u.startsWith("origin")?(a=true,n[u]=c):i[u]=c;}}if(e.transform||(o||t?i.transform=QF(e,r.transform,t):i.transform&&(i.transform="none")),a){let{originX:u="50%",originY:l="50%",originZ:c=0}=n;i.transformOrigin=`${u} ${l} ${c}`;}}function V0(r,{style:e,vars:t},i,s){let n=r.style,o;for(o in e)n[o]=e[o];s?.applyProjectionStyles(n,i);for(o in t)n.setProperty(o,t[o]);}var JF={};function eO(r,{layout:e,layoutId:t}){return Mr.has(r)||r.startsWith("origin")||(e||t!==void 0)&&(!!JF[r]||r==="opacity")}function H0(r,e,t){let{style:i}=r,s={};for(let n in i)(ze(i[n])||e.style&&ze(e.style[n])||eO(n,r)||t?.getValue(n)?.liveStyle!==void 0)&&(s[n]=i[n]);return s}function HL(r){return window.getComputedStyle(r)}var W0=class extends sh{constructor(){super(...arguments),this.type="html",this.renderInstance=V0;}readValueFromInstance(e,t){if(Mr.has(t))return this.projection?.isProjecting?wp(t):Ow(e,t);{let i=HL(e),s=(yp(t)?i.getPropertyValue(t):i[t])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:t}){return VF(e,t)}build(e,t,i){N0(e,t,i.transformTemplate);}scrapeMotionValuesFromProps(e,t,i){return H0(e,t,i)}};function WL(r,e){return r in e}var z0=class extends ih{constructor(){super(...arguments),this.type="object";}readValueFromInstance(e,t){if(WL(t,e)){let i=e[t];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e];}measureInstanceViewportBox(){return rh()}build(e,t){Object.assign(e.output,t);}renderInstance(e,{output:t}){Object.assign(e,t);}sortInstanceNodePosition(){return 0}};var zL={offset:"stroke-dashoffset",array:"stroke-dasharray"},XL={offset:"strokeDashoffset",array:"strokeDasharray"};function tO(r,e,t=1,i=0,s=true){r.pathLength=1;let n=s?zL:XL;r[n.offset]=Q.transform(-i);let o=Q.transform(e),a=Q.transform(t);r[n.array]=`${o} ${a}`;}function rO(r,{attrX:e,attrY:t,attrScale:i,pathLength:s,pathSpacing:n=1,pathOffset:o=0,...a},u,l,c){if(N0(r,a,l),u){r.style.viewBox&&(r.attrs.viewBox=r.style.viewBox);return}r.attrs=r.style,r.style={};let{attrs:h,style:d}=r;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),t!==void 0&&(h.y=t),i!==void 0&&(h.scale=i),s!==void 0&&tO(h,s,n,o,false);}var X0=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);var iO=r=>typeof r=="string"&&r.toLowerCase()==="svg";function sO(r,e,t,i){V0(r,e,void 0,i);for(let s in e.attrs)r.setAttribute(X0.has(s)?s:th(s),e.attrs[s]);}function nO(r,e,t){let i=H0(r,e,t);for(let s in r)if(ze(r[s])||ze(e[s])){let n=Ei.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[n]=r[s];}return i}var Y0=class extends sh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=false,this.measureInstanceViewportBox=rh;}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Mr.has(t)){let i=kp(t);return i&&i.default||0}return t=X0.has(t)?t:th(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return nO(e,t,i)}build(e,t,i){rO(e,t,this.isSVGTag,i.transformTemplate,i.style);}renderInstance(e,t,i,s){sO(e,t,i,s);}mount(e){this.isSVGTag=iO(e.tagName),super.mount(e);}};function oO(r){let e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},t=Up(r)&&!Qw(r)?new Y0(e):new W0(e);t.mount(r),oo.set(r,t);}function aO(r){let e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},t=new z0(e);t.mount(r),oo.set(r,t);}function uO(r,e,t){let i=ze(r)?r:is(r);return i.start(G0("",i,e,t)),i.animation}function YL(r,e){return ze(r)||typeof r=="number"||typeof r=="string"&&!Lp(e)}function j0(r,e,t,i){let s=[];if(YL(r,e))s.push(uO(r,Lp(e)&&e.default||e,t&&(t.default||t)));else {let n=F0(r,e,i),o=n.length;Pt(!!o,"No valid elements provided.","no-valid-elements");for(let a=0;a<o;a++){let u=n[a];Pt(u!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");let l=u instanceof Element?oO:aO;oo.has(u)||l(u);let c=oo.get(u),h={...t};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),s.push(...UF(c,{...e,transition:h},{}));}}return s}function lO(r,e,t){let i=[];return CF(r,e,t,{spring:Ds}).forEach(({keyframes:n,transition:o},a)=>{i.push(...j0(a,n,o));}),i}function jL(r){return Array.isArray(r)&&r.some(Array.isArray)}function cO(r){function e(t,i,s){let n=[];jL(t)?n=lO(t,i,r):n=j0(t,i,s,r);let o=new Mp(n);return o}return e}var $0=cO();Te();function $L(r,e,t){if(Array.isArray(r)&&Array.isArray(r[0])){let i=r.map(s=>{let{ticker:n=new le,...o}=s[2]||{};return [s[0],s[1],{driver:a=>{let u=({lastTime:l})=>a(l);return {start:(l=true)=>{n.add(u),n.start();},stop:()=>n.remove(u),now:()=>n.lastTime}},...o}]});return $0(i,e)}else {let{ticker:i=new le}=t||{};return $0(r,e,{driver:s=>{let n=({lastTime:o})=>s(o);return {start:(o=true)=>{i.add(n),i.start();},stop:()=>i.remove(n),now:()=>i.lastTime}},...t||{}})}}var Qf=$L;var D=new Jf;mr.init({getScreen:()=>D.screen});
3316
3316
  exports.CanvasBaseItem=l0;exports.CanvasEvent=u0;exports.CanvasManagerStatic=R;exports.Container=au;exports.FadeAlphaTicker=tp;exports.ImageContainer=Le;exports.ImageSprite=Pe;exports.MoveTicker=rp;exports.RegisteredCanvasComponents=ir;exports.RegisteredEvents=Ps;exports.RegisteredTickers=sr;exports.RotateTicker=ip;exports.Sprite=Bs;exports.Text=lu;exports.TickerBase=qr;exports.VideoSprite=er;exports.ZoomTicker=sp;exports.addImage=h0;exports.addImageCointainer=c0;exports.addVideo=d0;exports.animate=Qf;exports.canvas=D;exports.canvasComponentDecorator=e5;exports.eventDecorator=t5;exports.getTexture=zc;exports.moveIn=p5;exports.moveOut=_w;exports.pushIn=g5;exports.pushOut=Ak;exports.removeWithDissolve=f0;exports.removeWithFade=f5;exports.shakeEffect=u5;exports.showImage=c5;exports.showImageContainer=l5;exports.showVideo=h5;exports.showWithDissolve=Sk;exports.showWithFade=d5;exports.tickerDecorator=a5;exports.zoomIn=m5;exports.zoomOut=Ek;