@drincs/pixi-vn 0.10.8 → 0.10.10

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.
Files changed (111) hide show
  1. package/dist/classes/CharacterBaseModel.cjs +3 -3
  2. package/dist/classes/CharacterBaseModel.js +3 -3
  3. package/dist/classes/CharacterStoredClass.cjs +3 -3
  4. package/dist/classes/CharacterStoredClass.js +3 -3
  5. package/dist/classes/ChoiceMenuOption.cjs +2 -2
  6. package/dist/classes/ChoiceMenuOption.js +2 -2
  7. package/dist/classes/Sound.cjs +3 -3
  8. package/dist/classes/Sound.js +3 -3
  9. package/dist/classes/StoredClassModel.cjs +3 -3
  10. package/dist/classes/StoredClassModel.js +3 -3
  11. package/dist/classes/canvas/Container.cjs +3 -3
  12. package/dist/classes/canvas/Container.js +3 -3
  13. package/dist/classes/canvas/ImageContainer.cjs +3 -3
  14. package/dist/classes/canvas/ImageContainer.js +3 -3
  15. package/dist/classes/canvas/ImageSprite.cjs +3 -3
  16. package/dist/classes/canvas/ImageSprite.js +3 -3
  17. package/dist/classes/canvas/Sprite.cjs +3 -3
  18. package/dist/classes/canvas/Sprite.js +3 -3
  19. package/dist/classes/canvas/Text.cjs +3 -3
  20. package/dist/classes/canvas/Text.js +3 -3
  21. package/dist/classes/canvas/VideoSprite.cjs +3 -3
  22. package/dist/classes/canvas/VideoSprite.js +3 -3
  23. package/dist/classes/index.cjs +3 -3
  24. package/dist/classes/index.js +3 -3
  25. package/dist/classes/ticker/FadeAlphaTicker.cjs +2 -2
  26. package/dist/classes/ticker/FadeAlphaTicker.js +2 -2
  27. package/dist/classes/ticker/MoveTicker.cjs +3 -3
  28. package/dist/classes/ticker/MoveTicker.js +3 -3
  29. package/dist/classes/ticker/RotateTicker.cjs +2 -2
  30. package/dist/classes/ticker/RotateTicker.js +2 -2
  31. package/dist/classes/ticker/TickerBase.cjs +3 -3
  32. package/dist/classes/ticker/TickerBase.js +3 -3
  33. package/dist/classes/ticker/ZoomTicker.cjs +2 -2
  34. package/dist/classes/ticker/ZoomTicker.js +2 -2
  35. package/dist/classes/ticker/index.cjs +2 -2
  36. package/dist/classes/ticker/index.js +2 -2
  37. package/dist/constants.cjs +1 -1
  38. package/dist/constants.d.cts +1 -1
  39. package/dist/constants.d.ts +1 -1
  40. package/dist/constants.js +1 -1
  41. package/dist/decorators/index.cjs +2 -2
  42. package/dist/decorators/index.js +2 -2
  43. package/dist/decorators/label-decorator.cjs +2 -2
  44. package/dist/decorators/label-decorator.js +2 -2
  45. package/dist/functions/canvas/canvas-effect.cjs +2 -2
  46. package/dist/functions/canvas/canvas-effect.js +2 -2
  47. package/dist/functions/canvas/canvas-import-utility.cjs +3 -3
  48. package/dist/functions/canvas/canvas-import-utility.js +3 -3
  49. package/dist/functions/canvas/canvas-property-utility.cjs +3 -3
  50. package/dist/functions/canvas/canvas-property-utility.js +3 -3
  51. package/dist/functions/canvas/canvas-transition.cjs +3 -3
  52. package/dist/functions/canvas/canvas-transition.js +3 -3
  53. package/dist/functions/canvas/image-container-utility.cjs +3 -3
  54. package/dist/functions/canvas/image-container-utility.js +3 -3
  55. package/dist/functions/canvas/image-utility.cjs +3 -3
  56. package/dist/functions/canvas/image-utility.js +3 -3
  57. package/dist/functions/canvas/ticker-utility.cjs +3 -3
  58. package/dist/functions/canvas/ticker-utility.js +3 -3
  59. package/dist/functions/canvas/video-utility.cjs +3 -3
  60. package/dist/functions/canvas/video-utility.js +3 -3
  61. package/dist/functions/dialogue-utility.cjs +3 -3
  62. package/dist/functions/dialogue-utility.js +3 -3
  63. package/dist/functions/flags-utility.cjs +3 -3
  64. package/dist/functions/flags-utility.js +3 -3
  65. package/dist/functions/game-utility.cjs +3 -3
  66. package/dist/functions/game-utility.js +3 -3
  67. package/dist/functions/index.cjs +3 -3
  68. package/dist/functions/index.js +3 -3
  69. package/dist/functions/saves-utility.cjs +3 -3
  70. package/dist/functions/saves-utility.js +3 -3
  71. package/dist/index.cjs +3 -3
  72. package/dist/index.js +3 -3
  73. package/dist/labels/BaseCanvasElementTestLabel.cjs +2 -2
  74. package/dist/labels/BaseCanvasElementTestLabel.js +2 -2
  75. package/dist/labels/CustomTickerCanvasElementTestLabel.cjs +3 -3
  76. package/dist/labels/CustomTickerCanvasElementTestLabel.js +3 -3
  77. package/dist/labels/ImagesAnimationsTestLabel.cjs +3 -3
  78. package/dist/labels/ImagesAnimationsTestLabel.js +3 -3
  79. package/dist/labels/InputTestLabel.cjs +3 -3
  80. package/dist/labels/InputTestLabel.js +3 -3
  81. package/dist/labels/MarkdownTest.cjs +3 -3
  82. package/dist/labels/MarkdownTest.js +3 -3
  83. package/dist/labels/SoundTestLabel.cjs +3 -3
  84. package/dist/labels/SoundTestLabel.js +3 -3
  85. package/dist/labels/StartLabel.cjs +3 -3
  86. package/dist/labels/StartLabel.js +3 -3
  87. package/dist/labels/StepLabelTest.cjs +3 -3
  88. package/dist/labels/StepLabelTest.js +3 -3
  89. package/dist/labels/VideoTestLabel.cjs +3 -3
  90. package/dist/labels/VideoTestLabel.js +3 -3
  91. package/dist/labels/index.cjs +3 -3
  92. package/dist/labels/index.js +3 -3
  93. package/dist/managers/CanvasManager.cjs +2 -2
  94. package/dist/managers/CanvasManager.js +2 -2
  95. package/dist/managers/CanvasManagerStatic.cjs +3 -3
  96. package/dist/managers/CanvasManagerStatic.js +3 -3
  97. package/dist/managers/NarrationManager.cjs +3 -3
  98. package/dist/managers/NarrationManager.d.cts +13 -4
  99. package/dist/managers/NarrationManager.d.ts +13 -4
  100. package/dist/managers/NarrationManager.js +3 -3
  101. package/dist/managers/NarrationManagerStatic.cjs +3 -3
  102. package/dist/managers/NarrationManagerStatic.js +3 -3
  103. package/dist/managers/SoundManager.cjs +3 -3
  104. package/dist/managers/SoundManager.js +3 -3
  105. package/dist/managers/StorageManager.cjs +3 -3
  106. package/dist/managers/StorageManager.js +3 -3
  107. package/dist/managers/index.cjs +3 -3
  108. package/dist/managers/index.js +3 -3
  109. package/dist/pixi-devtools/additionalPositionsProperties.cjs +3 -3
  110. package/dist/pixi-devtools/additionalPositionsProperties.js +3 -3
  111. package/package.json +1 -1
@@ -3307,8 +3307,8 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
3307
3307
  u32v[offset + stride] = c;
3308
3308
  u32v[offset + (stride * 2)] = c;
3309
3309
  u32v[offset + (stride * 3)] = c;
3310
- `,dynamic:false}};});var eL,BM,MM,RM=d(()=>{Et();di();a1();eL=new ge(0,0,0,0),BM=class u1 extends nt{constructor(e={}){e={...u1.defaultOptions,...e,dynamicProperties:{...u1.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 Ad){let l=Ad[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 eL}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){let i=this.particleChildren.splice(e,t);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")}};BM.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};MM=BM;});var IM,l1,H_,kM=d(()=>{he();ye();di();$m();IM=class DM extends nt{constructor(e){e instanceof M&&(e={texture:e});let{width:t,height:i,leftWidth:s,rightWidth:n,topHeight:o,bottomHeight:a,texture:u,roundPixels:l,...c}=e;super({label:"NineSliceSprite",...c}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=s??u?.defaultBorders?.left??ri.defaultOptions.leftWidth,this._topHeight=o??u?.defaultBorders?.top??ri.defaultOptions.topHeight,this._rightWidth=n??u?.defaultBorders?.right??ri.defaultOptions.rightWidth,this._bottomHeight=a??u?.defaultBorders?.bottom??ri.defaultOptions.bottomHeight,this.bounds.maxX=this._width=t??u.width??ri.defaultOptions.width,this.bounds.maxY=this._height=i??u.height??ri.defaultOptions.height,this.allowChildren=false,this.texture=u??DM.defaultOptions.texture,this.roundPixels=l??false;}updateBounds(){}get width(){return this._width}set width(e){this.bounds.maxX=this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this.bounds.maxY=this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this.bounds.maxX=this._width=e,this.bounds.maxY=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=M.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;}};IM.defaultOptions={texture:M.EMPTY};l1=IM,H_=class extends l1{constructor(...e){let t=e[0];t instanceof M&&(L(W,"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]}),L(W,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function OM(r,e){return e instanceof Ye||e instanceof ti?e:r==="html"?new ti(e):new Ye(e)}var LM=d(()=>{Zc();Xi();});async function FM(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 GM=d(()=>{});function c1(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=tL[rL++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Me&&(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];c1(a,e,{...t});}}function h1(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];h1(o,e,{...t,index:n});}}var tL,rL,UM=d(()=>{bs();tL=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],rL=0;});var NM={};li(NM,{AbstractBitmapFont:()=>Vs,AbstractRenderer:()=>_i,AbstractText:()=>Ai,AccessibilitySystem:()=>Of,AlphaFilter:()=>rB,AlphaMask:()=>Gn,AlphaMaskPipe:()=>Ao,AnimatedSprite:()=>Ml,Application:()=>Nh,ApplicationInitHook:()=>So,Assets:()=>ke,AssetsClass:()=>$h,BLEND_TO_NPM:()=>sp,BUFFER_TYPE:()=>qo,BackgroundLoader:()=>il,BackgroundSystem:()=>pg,Batch:()=>Ec,BatchGeometry:()=>$a,BatchTextureArray:()=>Ya,BatchableGraphics:()=>zi,BatchableMesh:()=>mi,BatchableSprite:()=>Ir,Batcher:()=>op,BatcherPipe:()=>Ch,BigPool:()=>K,BindGroup:()=>ot,BindGroupSystem:()=>Do,BitmapFont:()=>oa,BitmapFontManager:()=>$i,BitmapText:()=>Dl,BitmapTextPipe:()=>no,BlendModeFilter:()=>te,BlendModePipe:()=>wo,BlurFilter:()=>gd,BlurFilterPass:()=>Bl,Bounds:()=>ge,BrowserAdapter:()=>Vf,Buffer:()=>Ne,BufferImageSource:()=>Gi,BufferResource:()=>vi,BufferUsage:()=>J,CLEAR:()=>at,Cache:()=>pe,CanvasPool:()=>Gt,CanvasPoolClass:()=>Hc,CanvasSource:()=>mt,CanvasTextMetrics:()=>tr,CanvasTextPipe:()=>eo,CanvasTextSystem:()=>so,Circle:()=>du,Color:()=>j,ColorBlend:()=>rh,ColorBurnBlend:()=>ih,ColorDodgeBlend:()=>sh,ColorMask:()=>Un,ColorMaskPipe:()=>Co,ColorMatrixFilter:()=>T_,CompressedSource:()=>Lr,Container:()=>X,Culler:()=>i_,CullerPlugin:()=>td,CustomRenderPipe:()=>xo,D3D10_RESOURCE_DIMENSION:()=>qx,D3DFMT:()=>jt,DATA_URI:()=>HP,DDS:()=>Q,DEG_TO_RAD:()=>sf,DEPRECATED_SCALE_MODES:()=>Ed,DEPRECATED_WRAP_MODES:()=>Sd,DOMAdapter:()=>z,DRAW_MODES:()=>kB,DXGI_FORMAT:()=>jx,DXGI_TO_TEXTURE_FORMAT:()=>Ht,DarkenBlend:()=>nh,DefaultBatcher:()=>zn,DefaultShader:()=>Qa,DifferenceBlend:()=>oh,DisplacementFilter:()=>A_,DivideBlend:()=>ah,DynamicBitmapFont:()=>qc,Ellipse:()=>fu,EventBoundary:()=>Ga,EventEmitter:()=>le,EventSystem:()=>Ua,EventsTicker:()=>Tr,ExclusionBlend:()=>uh,ExtensionType:()=>m,ExtractSystem:()=>mg,FOURCC_TO_TEXTURE_FORMAT:()=>Qh,FederatedContainer:()=>Hf,FederatedEvent:()=>hi,FederatedMouseEvent:()=>$r,FederatedPointerEvent:()=>At,FederatedWheelEvent:()=>Sr,FillGradient:()=>Dr,FillPattern:()=>Qr,Filter:()=>xt,FilterEffect:()=>zr,FilterPipe:()=>co,FilterSystem:()=>ho,FontStylePromiseCache:()=>Au,GAUSSIAN_VALUES:()=>wl,GL_FORMATS:()=>ju,GL_INTERNAL_FORMAT:()=>sE,GL_TARGETS:()=>Dh,GL_TYPES:()=>me,GL_WRAP_MODES:()=>k2,GenerateTextureSystem:()=>Bo,Geometry:()=>Lt,GlBackBufferSystem:()=>Yg,GlBatchAdaptor:()=>jo,GlBuffer:()=>$u,GlBufferSystem:()=>Ko,GlColorMaskSystem:()=>Qo,GlContextSystem:()=>Wg,GlEncoderSystem:()=>Jo,GlGeometrySystem:()=>Zo,GlGraphicsAdaptor:()=>Yo,GlMeshAdaptor:()=>$o,GlParticleContainerAdaptor:()=>au,GlParticleContainerPipe:()=>Zn,GlProgram:()=>He,GlProgramData:()=>Zu,GlRenderTarget:()=>qu,GlRenderTargetAdaptor:()=>Ku,GlRenderTargetSystem:()=>ra,GlShaderSystem:()=>ia,GlStateSystem:()=>fx,GlStencilSystem:()=>ea,GlTexture:()=>Ju,GlTextureSystem:()=>na,GlUboSystem:()=>ta,GlUniformGroupSystem:()=>sa,GlobalUniformSystem:()=>Mo,GpuBatchAdaptor:()=>go,GpuBlendModesToPixi:()=>wt,GpuBufferSystem:()=>ko,GpuColorMaskSystem:()=>Oo,GpuDeviceSystem:()=>Qs,GpuEncoderSystem:()=>Lo,GpuGraphicsAdaptor:()=>po,GpuGraphicsContext:()=>Oc,GpuMeshAdapter:()=>mo,GpuMipmapGenerator:()=>Yu,GpuParticleContainerAdaptor:()=>cu,GpuParticleContainerPipe:()=>Qn,GpuProgram:()=>Ve,GpuReadBuffer:()=>RB,GpuRenderTarget:()=>Wu,GpuRenderTargetAdaptor:()=>zu,GpuRenderTargetSystem:()=>Vo,GpuShaderSystem:()=>Wo,GpuStateSystem:()=>zo,GpuStencilModesToPixi:()=>Or,GpuStencilSystem:()=>Fo,GpuTextureSystem:()=>Xo,GpuUboSystem:()=>Uo,GpuUniformBatchPipe:()=>No,Graphics:()=>Hs,GraphicsContext:()=>et,GraphicsContextRenderData:()=>Lc,GraphicsContextSystem:()=>Os,GraphicsPath:()=>kr,GraphicsPipe:()=>qn,HTMLText:()=>kl,HTMLTextPipe:()=>oo,HTMLTextRenderData:()=>Ws,HTMLTextStyle:()=>ti,HTMLTextSystem:()=>zs,HardLightBlend:()=>lh,HardMixBlend:()=>ch,HelloSystem:()=>Zs,IGLUniformData:()=>Qg,ImageSource:()=>$t,InstructionSet:()=>ds,KTX:()=>qe,LightenBlend:()=>hh,LinearBurnBlend:()=>dh,LinearDodgeBlend:()=>fh,LinearLightBlend:()=>ph,Loader:()=>nl,LoaderParserPriority:()=>Oe,LuminosityBlend:()=>mh,MSAA_QUALITY:()=>e1,MaskEffectManager:()=>Ma,MaskEffectManagerClass:()=>oc,MaskFilter:()=>Du,Matrix:()=>k,Mesh:()=>or,MeshGeometry:()=>Ut,MeshPipe:()=>Kn,MeshPlane:()=>G_,MeshRope:()=>vM,MeshSimple:()=>N_,NOOP:()=>cc,NegationBlend:()=>gh,NineSliceGeometry:()=>ri,NineSlicePlane:()=>H_,NineSliceSprite:()=>l1,NineSliceSpritePipe:()=>lo,NoiseFilter:()=>hB,ObservablePoint:()=>Ue,OverlayBlend:()=>xh,PI_2:()=>tf,Particle:()=>PM,ParticleBuffer:()=>uu,ParticleContainer:()=>MM,ParticleContainerPipe:()=>Ls,ParticleShader:()=>lu,PerspectiveMesh:()=>pM,PerspectivePlaneGeometry:()=>Ll,PinLightBlend:()=>_h,PipelineSystem:()=>Ho,PlaneGeometry:()=>Ys,Point:()=>se,Polygon:()=>Gs,Pool:()=>Li,PoolGroupClass:()=>sc,PrepareBase:()=>w_,PrepareQueue:()=>Il,PrepareSystem:()=>Td,PrepareUpload:()=>Ol,QuadGeometry:()=>wu,RAD_TO_DEG:()=>rf,Rectangle:()=>q,RenderContainer:()=>k_,RenderGroup:()=>Oa,RenderGroupPipe:()=>bo,RenderGroupSystem:()=>vo,RenderLayer:()=>aM,RenderLayerClass:()=>t1,RenderTarget:()=>Io,RenderTargetSystem:()=>tn,RenderTexture:()=>ku,RenderableGCSystem:()=>bg,RendererInitHook:()=>Eo,RendererType:()=>We,ResizePlugin:()=>kn,Resolver:()=>Pt,RopeGeometry:()=>U_,RoundedRectangle:()=>pu,SCALE_MODES:()=>UB,STENCIL_MODES:()=>De,SVGParser:()=>pm,SVGToGraphicsPath:()=>im,SaturationBlend:()=>bh,SchedulerSystem:()=>Ro,ScissorMask:()=>I_,SdfShader:()=>Tu,Shader:()=>$e,ShaderStage:()=>ws,ShapePath:()=>_u,SharedRenderPipes:()=>Gu,SharedSystems:()=>Fu,SoftLightBlend:()=>yh,Sprite:()=>Me,SpritePipe:()=>To,Spritesheet:()=>bc,State:()=>Xe,StencilMask:()=>Nn,StencilMaskPipe:()=>Po,SubtractBlend:()=>vh,SystemRunner:()=>qs,TEXTURE_FORMAT_BLOCK_SIZE:()=>Kx,Text:()=>Fr,TextStyle:()=>Ye,Texture:()=>M,TextureGCSystem:()=>yg,TextureMatrix:()=>fs,TexturePool:()=>Ee,TexturePoolClass:()=>hc,TextureSource:()=>ce,TextureStyle:()=>ka,TextureUvs:()=>D_,Ticker:()=>Ae,TickerListener:()=>ms,TickerPlugin:()=>Ln,TilingSprite:()=>M_,TilingSpritePipe:()=>uo,TilingSpriteShader:()=>Pu,Transform:()=>Rl,Triangle:()=>P_,UNIFORM_TO_ARRAY_SETTERS:()=>cx,UNIFORM_TO_SINGLE_SETTERS:()=>lx,UNIFORM_TYPES_MAP:()=>wp,UNIFORM_TYPES_VALUES:()=>Mc,UPDATE_BLEND:()=>La,UPDATE_COLOR:()=>Dn,UPDATE_PRIORITY:()=>Yt,UPDATE_TRANSFORM:()=>RA,UPDATE_VISIBLE:()=>ps,UboBatch:()=>Hu,UboSystem:()=>Js,UniformGroup:()=>oe,VERSION:()=>Ks,VideoSource:()=>Ts,ViewContainer:()=>nt,ViewSystem:()=>Sg,ViewableBuffer:()=>Er,VividLightBlend:()=>Th,WGSL_ALIGN_SIZE_DATA:()=>Go,WGSL_TO_STD40_SIZE:()=>kh,WRAP_MODES:()=>GB,WebGLRenderer:()=>Uh,WebGPURenderer:()=>Ih,WebWorkerAdapter:()=>Q3,WorkerManager:()=>Yh,_getGlobalBounds:()=>gf,accessibilityTarget:()=>Lf,addBits:()=>Cc,addMaskBounds:()=>ys,addMaskLocalBounds:()=>vs,addProgramDefines:()=>cp,alphaFrag:()=>p_,alphaWgsl:()=>md,applyMatrix:()=>zm,applyProjectiveTransformationToPlane:()=>O_,applyStyleParams:()=>Gh,assignWithIgnore:()=>In,autoDetectEnvironment:()=>LP,autoDetectRenderer:()=>Sx,autoDetectSource:()=>tC,basisTranscoderUrls:()=>ml,bgr2rgb:()=>Fi,bitmapFontCachePlugin:()=>Ex,bitmapFontTextParser:()=>rl,bitmapFontXMLParser:()=>Hh,bitmapFontXMLStringParser:()=>Vh,blendTemplateFrag:()=>qm,blendTemplateVert:()=>Km,blendTemplateWgsl:()=>Zm,blockDataMap:()=>Rh,blurTemplateWgsl:()=>b_,boundsPool:()=>Xt,browserExt:()=>aT,buildAdaptiveBezier:()=>gu,buildAdaptiveQuadratic:()=>um,buildArc:()=>xu,buildArcTo:()=>cm,buildArcToSvg:()=>hm,buildCircle:()=>Mr,buildContextBatches:()=>Kp,buildEllipse:()=>kp,buildGeometryFromPath:()=>iM,buildLine:()=>Np,buildPixelLine:()=>Hp,buildPolygon:()=>iu,buildRectangle:()=>su,buildRoundedRectangle:()=>Op,buildSimpleUvs:()=>eu,buildTriangle:()=>nu,buildUvs:()=>Ja,cacheAsTextureMixin:()=>uf,cacheTextureArray:()=>Cx,calculateProjection:()=>Lg,checkChildrenDidChange:()=>uc,checkDataUrl:()=>rr,checkExtension:()=>je,checkMaxIfStatementsInShader:()=>tp,childrenHelperMixin:()=>cf,cleanArray:()=>_g,cleanHash:()=>xg,clearList:()=>yo,closePointEps:()=>Fp,collectAllRenderables:()=>qB,collectRenderablesMixin:()=>hf,color32BitToUniform:()=>Rr,colorBit:()=>Ms,colorBitGl:()=>Rs,colorMatrixFilterFrag:()=>v_,colorMatrixFilterWgsl:()=>xd,colorToUniform:()=>MC,compareModeToGlCompare:()=>bx,compileHighShader:()=>yp,compileHighShaderGl:()=>vp,compileHighShaderGlProgram:()=>Cr,compileHighShaderGpuProgram:()=>Ar,compileHooks:()=>Pc,compileInputs:()=>wc,compileOutputs:()=>bp,compileShader:()=>Oh,compute2DProjection:()=>F_,convertFormatIfRequired:()=>Xw,convertToList:()=>Ct,copySearchParams:()=>Fn,createIdFromString:()=>Zr,createIndicesForQuads:()=>Uc,createLevelBuffers:()=>Rw,createLevelBuffersFromKTX:()=>$w,createStringVariations:()=>Wf,createTexture:()=>Nt,createUboElementsSTD40:()=>$g,createUboElementsWGSL:()=>Cg,createUboSyncFunction:()=>Uu,createUboSyncFunctionSTD40:()=>Kg,createUboSyncFunctionWGSL:()=>Dg,crossOrigin:()=>YS,cullingMixin:()=>ef,curveEps:()=>Gp,defaultFilterVert:()=>un,defaultValue:()=>Qu,definedProps:()=>Ot,deprecation:()=>L,detectAvif:()=>wx,detectBasis:()=>Ew,detectCompressed:()=>e3,detectDefaults:()=>Bx,detectMp4:()=>Mx,detectOgv:()=>Rx,detectVideoAlphaMode:()=>Va,detectWebm:()=>Ix,detectWebp:()=>Dx,determineCrossOrigin:()=>jS,displacementFrag:()=>S_,displacementVert:()=>E_,displacementWgsl:()=>_d,earcut:()=>HM.default,effectsMixin:()=>df,ensureAttributes:()=>Vu,ensureIsBuffer:()=>Ac,ensureOptions:()=>ln,ensurePrecision:()=>hp,ensureTextStyle:()=>OM,executeInstructions:()=>_o,extensions:()=>H,extractAttributesFromGlProgram:()=>ix,extractAttributesFromGpuProgram:()=>mp,extractFontFamilies:()=>Dm,extractStructAndGroups:()=>qa,fastCopy:()=>Wn,findHooksRx:()=>n0,findMixin:()=>ff,fontStringFromTextStyle:()=>Yi,formatShader:()=>EB,fragmentGPUTemplate:()=>Sp,fragmentGlTemplate:()=>Ap,generateArraySyncSTD40:()=>qg,generateArraySyncWGSL:()=>Ig,generateBlurFragSource:()=>g_,generateBlurGlProgram:()=>__,generateBlurProgram:()=>y_,generateBlurVertSource:()=>x_,generateGPULayout:()=>yB,generateGpuLayoutGroups:()=>gp,generateLayout:()=>TB,generateLayoutHash:()=>xp,generateParticleUpdateFunction:()=>Zp,generateProgram:()=>ax,generateShaderSyncCode:()=>Zg,generateTextStyleKey:()=>bu,generateTextureBatchBit:()=>Is,generateTextureBatchBitGl:()=>Ds,generateUID:()=>VB,generateUniformsSync:()=>hx,getAdjustedBlendModeBlend:()=>qr,getAttributeInfoFromFormat:()=>Ft,getBatchSamplersUniformGroup:()=>ks,getBitmapTextLayout:()=>Eu,getCanvasBoundingBox:()=>rm,getCanvasFillStyle:()=>Ns,getCanvasTexture:()=>Lu,getDefaultUniformValue:()=>Bp,getFastGlobalBounds:()=>YB,getFastGlobalBoundsMixin:()=>mf,getFontCss:()=>Om,getFontFamilyName:()=>US,getGeometryBounds:()=>ap,getGlTypeFromFormat:()=>Xg,getGlobalBounds:()=>ci,getGlobalMixin:()=>bf,getGlobalRenderableBounds:()=>jm,getLocalBounds:()=>hs,getMatrixRelativeToParent:()=>jf,getMaxFragmentPrecision:()=>lp,getMaxTexturesPerBatch:()=>Jt,getOrientationOfPoints:()=>Up,getParent:()=>zb,getPo2TextureFromSource:()=>vu,getResolutionOfUrl:()=>nn,getSVGUrl:()=>Lm,getSupportedCompressedTextureFormats:()=>dl,getSupportedGPUCompressedTextureFormats:()=>qh,getSupportedGlCompressedTextureFormats:()=>jh,getSupportedTextureFormats:()=>Ti,getTemporaryCanvasFromImage:()=>Fm,getTestContext:()=>Wa,getTextureBatchBindGroup:()=>Es,getTextureDefaultMatrix:()=>EM,getTextureFormatFromKTXTexture:()=>qw,getUboData:()=>sx,getUniformData:()=>nx,getUrlExtension:()=>yy,glFormatToGPUFormat:()=>e_,glUploadBufferImageResource:()=>px,glUploadCompressedTextureResource:()=>mx,glUploadImageResource:()=>el,glUploadVideoResource:()=>xx,globalUniformsBit:()=>Cp,globalUniformsBitGl:()=>Pp,globalUniformsUBOBitGl:()=>pC,gpuFormatToBasisTranscoderFormat:()=>Dw,gpuFormatToKTXBasisTranscoderFormat:()=>Zw,gpuUploadBufferImageResource:()=>Ug,gpuUploadCompressedTextureResource:()=>Ng,gpuUploadImageResource:()=>Xu,gpuUploadVideoResource:()=>Vg,groupD8:()=>ae,hasCachedCanvasTexture:()=>KP,hslWgsl:()=>fB,hslgl:()=>$s,hslgpu:()=>js,injectBits:()=>Bc,insertVersion:()=>dp,isMobile:()=>Df,isPow2:()=>lc,isRenderingToScreen:()=>Fg,isSafari:()=>wm,isSingleItem:()=>Ni,isWebGLSupported:()=>bi,isWebGPUSupported:()=>yi,ktxTranscoderUrls:()=>xl,loadBasis:()=>Bw,loadBasisOnWorker:()=>$x,loadBitmapFont:()=>Ax,loadDDS:()=>Ow,loadEnvironmentExtensions:()=>Sh,loadFontAsBase64:()=>km,loadFontCSS:()=>Qc,loadImageBitmap:()=>XS,loadJson:()=>kx,loadKTX:()=>Fw,loadKTX2:()=>Vw,loadKTX2onWorker:()=>Jx,loadSVGImage:()=>Gm,loadSvg:()=>Fx,loadTextures:()=>ll,loadTxt:()=>Ox,loadVideoTextures:()=>Ux,loadWebFont:()=>Lx,localUniformBit:()=>qi,localUniformBitGl:()=>Xs,localUniformBitGroup2:()=>Nm,localUniformMSDFBit:()=>ym,localUniformMSDFBitGl:()=>vm,log2:()=>SA,logDebugTexture:()=>FM,logProgramError:()=>ox,logRenderGroupScene:()=>h1,logScene:()=>c1,mSDFBit:()=>Tm,mSDFBitGl:()=>Sm,mapFormatToGlFormat:()=>yx,mapFormatToGlInternalFormat:()=>vx,mapFormatToGlType:()=>Tx,mapGlToVertexFormat:()=>tx,mapSize:()=>BB,mapType:()=>Lh,mapWebGLBlendModesToPixi:()=>dx,maskFrag:()=>dg,maskVert:()=>fg,maskWgsl:()=>Ph,matrixPool:()=>Qe,measureHtmlText:()=>Cu,measureMixin:()=>vf,migrateFragmentFromV7toV8:()=>PB,mipmapScaleModeToGlFilter:()=>_x,mixHexColors:()=>ZB,multiplyColors:()=>cs,multiplyHexColors:()=>Ia,nextPow2:()=>Xr,noiseFrag:()=>C_,noiseWgsl:()=>bd,nonCompressedFormats:()=>JS,normalizeExtensionPriority:()=>Pa,nssvg:()=>Bm,nsxhtml:()=>Mm,onRenderMixin:()=>Tf,parseDDS:()=>Zx,parseFunctionBody:()=>zB,parseKTX:()=>Qx,particleData:()=>Ad,particlesFrag:()=>Qp,particlesVert:()=>Jp,particlesWgsl:()=>Nc,path:()=>Le,pointInTriangle:()=>yd,preloadVideo:()=>$S,removeItems:()=>Ba,removeStructAndGroupDuplicates:()=>_p,resetUids:()=>xA,resolveCharacters:()=>Su,resolveCompressedTextureUrl:()=>Jw,resolveJsonUrl:()=>Hx,resolveTextureUrl:()=>cl,resourceToTexture:()=>My,roundPixelsBit:()=>Pr,roundPixelsBitGl:()=>wr,roundedShapeArc:()=>dm,roundedShapeQuadraticCurve:()=>fm,sayHello:()=>gg,scaleModeToGlFilter:()=>Fh,setBasisTranscoderPath:()=>Pw,setKTXTranscoderPath:()=>Nw,setPositions:()=>Wm,setProgramName:()=>fp,setUvs:()=>Xm,shapeBuilders:()=>ou,sortMixin:()=>Sf,spritesheetAsset:()=>Xf,squaredDistanceToLineSegment:()=>Fs,stripVersion:()=>pp,testImageFormat:()=>sl,testVideoFormat:()=>rn,textStyleToCSS:()=>Im,textureBit:()=>rg,textureBitGl:()=>ig,textureFrom:()=>Ry,tilingBit:()=>Hm,tilingBitGl:()=>Vm,toFillStyle:()=>Jr,toLocalGlobalMixin:()=>Ef,toStrokeStyle:()=>Us,transformVertices:()=>Xn,triangulateWithHoles:()=>ru,uboSyncFunctionsSTD40:()=>Bh,uboSyncFunctionsWGSL:()=>Mg,uid:()=>ne,uniformParsers:()=>ii,unpremultiplyAlpha:()=>uw,unsafeEvalSupported:()=>Bu,updateLocalTransform:()=>JB,updateQuadBounds:()=>Ha,updateRenderGroupTransform:()=>yT,updateRenderGroupTransforms:()=>Ah,updateTextBounds:()=>Jn,updateTransformAndChildren:()=>ug,updateTransformBackwards:()=>Ra,updateWorldTransform:()=>tM,v8_0_0:()=>W,v8_3_4:()=>of,validFormats:()=>_l,validateRenderables:()=>lg,vertexGPUTemplate:()=>Tp,vertexGlTemplate:()=>Ep,viewportFromFrame:()=>LB,vkFormatToGPUFormat:()=>t_,warn:()=>U,webworkerExt:()=>uT,wrapModeToGlAddress:()=>tl});var HM,xe=d(()=>{cP();dP();P();P();Qf();Yf();ay();uy();mP();gP();xP();_P();bP();yP();vP();TP();SP();EP();AP();CP();PP();wP();BP();MP();RP();IP();DP();kP();OP();gw();ly();hy();Sw();wS();fi();BS();MS();RS();IS();DS();kS();OS();Px();Wh();LS();lr();FS();GS();NS();HS();Gx();qS();Ki();zS();KS();Nx();_s();sn();fr();Na();zf();by();xc();ct();Aw();Mw();Iw();kw();eE();tE();rE();Lw();iE();Gw();oE();nE();Ww();Yw();jw();Kw();cE();Qw();aE();hE();uE();t3();dE();pE();r3();kb();Re();pT();_y();J3();py();Nf();Ff();dc();xy();pc();Gf();Uf();cT();hT();dT();pB();ME();RE();OE();GE();UE();pd();NE();HE();VE();WE();zE();PT();wT();BT();Ze();eh();th();iB();oB();FE();m_();IE();kE();DE();LE();aB();uB();dB();xi();nc();iT();nT();MT();wf();fe();nf();Da();sm();An();Zt();XE();sv();nv();ov();st();av();mB();YE();KE();bB();JE();w2();Dy();Ss();vB();SB();Tc();xT();Fy();CT();Ny();Oy();Mp();_0();Vi();h0();s0();o0();a0();u0();AB();l0();d0();Ka();Za();f0();ao();Wi();sg();Sy();IT();Ey();DT();Ub();CB();Ay();kT();yc();vc();vS();B2();M2();R2();fo();D2();L2();O2();G2();U2();N2();X2();H2();z2();Y2();$2();j2();Rc();er();q2();iS();oS();wB();K2();Jg();kg();Q2();rS();Vy();ep();J2();eS();tS();MB();rx();Wy();zy();Xy();Yy();$y();jg();W2();V2();nS();sS();lS();aS();zg();cS();bS();hS();dS();gx();fS();mS();ZS();gS();xS();_S();pS();lw();yS();e2();t2();IB();l2();r2();i2();s2();n2();u2();c2();h2();d2();p2();m2();g2();Hi();cr();x2();Pg();a2();Zy();Qy();o2();e0();t0();r0();_2();b2();Og();E2();y2();v2();Hg();T2();QS();S2();A2();LT();FT();pi();Mh();Kr();ip();NT();VT();OB();Cs();Rp();Gy();Ps();Uy();Ip();Af();WT();f2();vg();Gg();FB();zT();Jy();Br();g0();Ag();Je();Bg();x0();Rg();wg();YT();As();Xa();dr();Mu();Eg();Jm();to();NB();qT();HT();Bf();Hn();hl();Vn();pt();Zf();he();ZT();Mf();Yr();Cf();HB();WB();Tg();Xx();fl();Iy();ja();XB();JT();hr();X0();Y0();$0();Et();$B();Cn();ac();sT();ls();Lb();Fb();Gb();Nb();Hb();Vb();yf();Yb();$b();jb();qb();Qt();_T();jB();Qb();bT();ST();Rf();Xb();ag();KB();Pn();og();QB();_f();xf();eM();vT();rM();TT();C2();jn();mT();Dp();am();hv();lm();dv();mv();Lp();y0();v0();$p();jp();qp();vC();Vc();Wc();bm();io();Fc();F0();Yc();gv();xv();_v();iv();P0();sM();mm();b0();Yp();uM();mM();s1();r1();i1();gM();Jc();TM();SM();n1();P2();gT();Gc();AM();ua();ji();U0();H0();K0();q0();Z0();wM();z0();RM();em();a1();j0();V0();W0();$E();$m();kM();tT();Xv();jv();qE();Jv();Zv();qv();Kv();Qv();hu();bs();ET();Em();ES();AS();CS();PS();SS();Kc();ZE();Rv();Bv();Cm();Am();QE();Dv();Rm();Zc();Wv();Lv();Uv();Nv();Hv();Fv();Gv();Vv();Um();Ov();vd();jc();J0();Tv();$c();_m();wv();Ev();Av();R_();Xi();LM();gm();xm();tm();di();vy();Ty();On();gs();cy();qf();ny();kv();Ru();Iu();Qm();ev();cg();Dt();$T();lf();ft();$f();rp();hg();ye();GM();UM();ve();Zb();jE();zh();xs();af();kt();XT();HM=us(C0());H.add(aT,uT);});var PR=yr((Tb,CR)=>{(function(r,e){typeof Tb=="object"?CR.exports=Tb=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(Tb,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 Cb=="function")try{i=Cb("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 x(){}return function(y){var E;return x.prototype=y,E=new x,x.prototype=null,E}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(x){var y=n(this);return x&&y.mixIn(x),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var y in x)x.hasOwnProperty(y)&&(this[y]=x[y]);x.hasOwnProperty("toString")&&(this.toString=x.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(x,y){x=this.words=x||[],y!=t?this.sigBytes=y:this.sigBytes=x.length*4;},toString:function(x){return (x||h).stringify(this)},concat:function(x){var y=this.words,E=x.words,S=this.sigBytes,D=x.sigBytes;if(this.clamp(),S%4)for(var v=0;v<D;v++){var T=E[v>>>2]>>>24-v%4*8&255;y[S+v>>>2]|=T<<24-(S+v)%4*8;}else for(var A=0;A<D;A+=4)y[S+A>>>2]=E[A>>>2];return this.sigBytes+=D,this},clamp:function(){var x=this.words,y=this.sigBytes;x[y>>>2]&=4294967295<<32-y%4*8,x.length=e.ceil(y/4);},clone:function(){var x=u.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var y=[],E=0;E<x;E+=4)y.push(s());return new l.init(y,x)}}),c=o.enc={},h=c.Hex={stringify:function(x){for(var y=x.words,E=x.sigBytes,S=[],D=0;D<E;D++){var v=y[D>>>2]>>>24-D%4*8&255;S.push((v>>>4).toString(16)),S.push((v&15).toString(16));}return S.join("")},parse:function(x){for(var y=x.length,E=[],S=0;S<y;S+=2)E[S>>>3]|=parseInt(x.substr(S,2),16)<<24-S%8*4;return new l.init(E,y/2)}},f=c.Latin1={stringify:function(x){for(var y=x.words,E=x.sigBytes,S=[],D=0;D<E;D++){var v=y[D>>>2]>>>24-D%4*8&255;S.push(String.fromCharCode(v));}return S.join("")},parse:function(x){for(var y=x.length,E=[],S=0;S<y;S++)E[S>>>2]|=(x.charCodeAt(S)&255)<<24-S%4*8;return new l.init(E,y)}},p=c.Utf8={stringify:function(x){try{return decodeURIComponent(escape(f.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return f.parse(unescape(encodeURIComponent(x)))}},g=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(x){typeof x=="string"&&(x=p.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes;},_process:function(x){var y,E=this._data,S=E.words,D=E.sigBytes,v=this.blockSize,T=v*4,A=D/T;x?A=e.ceil(A):A=e.max((A|0)-this._minBufferSize,0);var w=A*v,B=e.min(w*4,D);if(w){for(var R=0;R<w;R+=v)this._doProcessBlock(S,R);y=S.splice(0,w),E.sigBytes-=B;}return new l.init(y,B)},clone:function(){var x=u.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});a.Hasher=g.extend({cfg:u.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset();},reset:function(){g.reset.call(this),this._doReset();},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(x){return function(y,E){return new x.init(E).finalize(y)}},_createHmacHelper:function(x){return function(y,E){return new _.HMAC.init(x,E).finalize(y)}}});var _=o.algo={};return o}(Math);return r});});var j1=yr((Sb,wR)=>{(function(r,e){typeof Sb=="object"?wR.exports=Sb=e(PR()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(Sb,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],f=c[1],p=c[2],g=c[3],b=c[4],_=0;_<80;_++){if(_<16)o[_]=u[l+_]|0;else {var x=o[_-3]^o[_-8]^o[_-14]^o[_-16];o[_]=x<<1|x>>>31;}var y=(h<<5|h>>>27)+b+o[_];_<20?y+=(f&p|~f&g)+1518500249:_<40?y+=(f^p^g)+1859775393:_<60?y+=(f&p|f&g|p&g)-1894007588:y+=(f^p^g)-899497514,b=g,g=p,p=f<<30|f>>>2,f=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+f|0,c[2]=c[2]+p|0,c[3]=c[3]+g|0,c[4]=c[4]+b|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});});var OR=yr((q1,kR)=>{(function(r,e){var t=e(r);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return t});else if(typeof q1=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))kR.exports=t;else {var i=r.DeepDiff;t.noConflict=function(){return r.DeepDiff===t&&(r.DeepDiff=i),t},r.DeepDiff=t;}})(q1,function(r){var e=["N","E","A","D"];function t(v,T){v.super_=T,v.prototype=Object.create(T.prototype,{constructor:{value:v,enumerable:false,writable:true,configurable:true}});}function i(v,T){Object.defineProperty(this,"kind",{value:v,enumerable:true}),T&&T.length&&Object.defineProperty(this,"path",{value:T,enumerable:true});}function s(v,T,A){s.super_.call(this,"E",v),Object.defineProperty(this,"lhs",{value:T,enumerable:true}),Object.defineProperty(this,"rhs",{value:A,enumerable:true});}t(s,i);function n(v,T){n.super_.call(this,"N",v),Object.defineProperty(this,"rhs",{value:T,enumerable:true});}t(n,i);function o(v,T){o.super_.call(this,"D",v),Object.defineProperty(this,"lhs",{value:T,enumerable:true});}t(o,i);function a(v,T,A){a.super_.call(this,"A",v),Object.defineProperty(this,"index",{value:T,enumerable:true}),Object.defineProperty(this,"item",{value:A,enumerable:true});}t(a,i);function u(v,T,A){var w=v.slice((T)+1||v.length);return v.length=T<0?v.length+T:T,v.push.apply(v,w),v}function l(v){var T=typeof v;return T!=="object"?T:v===Math?"math":v===null?"null":Array.isArray(v)?"array":Object.prototype.toString.call(v)==="[object Date]"?"date":typeof v.toString=="function"&&/^\/.*\//.test(v.toString())?"regexp":"object"}function c(v){var T=0;if(v.length===0)return T;for(var A=0;A<v.length;A++){var w=v.charCodeAt(A);T=(T<<5)-T+w,T=T&T;}return T}function h(v){var T=0,A=l(v);if(A==="array"){v.forEach(function(ue){T+=h(ue);});var w="[type: array, hash: "+T+"]";return T+c(w)}if(A==="object"){for(var B in v)if(v.hasOwnProperty(B)){var R="[ type: object, key: "+B+", value hash: "+h(v[B])+"]";T+=c(R);}return T}var F="[ type: "+A+" ; value: "+v+"]";return T+c(F)}function f(v,T,A,w,B,R,F,ue){A=A||[],B=B||[],F=F||[];var de=B.slice(0);if(typeof R<"u"&&R!==null){if(w){if(typeof w=="function"&&w(de,R))return;if(typeof w=="object"){if(w.prefilter&&w.prefilter(de,R))return;if(w.normalize){var br=w.normalize(de,R,v,T);br&&(v=br[0],T=br[1]);}}}de.push(R);}l(v)==="regexp"&&l(T)==="regexp"&&(v=v.toString(),T=T.toString());var V=typeof v,$=typeof T,Ge,be,it,Hr,os=V!=="undefined"||F&&F.length>0&&F[F.length-1].lhs&&Object.getOwnPropertyDescriptor(F[F.length-1].lhs,R),as=$!=="undefined"||F&&F.length>0&&F[F.length-1].rhs&&Object.getOwnPropertyDescriptor(F[F.length-1].rhs,R);if(!os&&as)A.push(new n(de,T));else if(!as&&os)A.push(new o(de,v));else if(l(v)!==l(T))A.push(new s(de,v,T));else if(l(v)==="date"&&v-T!==0)A.push(new s(de,v,T));else if(V==="object"&&v!==null&&T!==null){for(Ge=F.length-1;Ge>-1;--Ge)if(F[Ge].lhs===v){Hr=true;break}if(Hr)v!==T&&A.push(new s(de,v,T));else {if(F.push({lhs:v,rhs:T}),Array.isArray(v)){for(ue&&(v.sort(function(ki,Ca){return h(ki)-h(Ca)}),T.sort(function(ki,Ca){return h(ki)-h(Ca)})),Ge=T.length-1,be=v.length-1;Ge>be;)A.push(new a(de,Ge,new n(undefined,T[Ge--])));for(;be>Ge;)A.push(new a(de,be,new o(undefined,v[be--])));for(;Ge>=0;--Ge)f(v[Ge],T[Ge],A,w,de,Ge,F,ue);}else {var Jl=Object.keys(v),Di=Object.keys(T);for(Ge=0;Ge<Jl.length;++Ge)it=Jl[Ge],Hr=Di.indexOf(it),Hr>=0?(f(v[it],T[it],A,w,de,it,F,ue),Di[Hr]=null):f(v[it],undefined,A,w,de,it,F,ue);for(Ge=0;Ge<Di.length;++Ge)it=Di[Ge],it&&f(undefined,T[it],A,w,de,it,F,ue);}F.length=F.length-1;}}else v!==T&&(V==="number"&&isNaN(v)&&isNaN(T)||A.push(new s(de,v,T)));}function p(v,T,A,w,B){var R=[];if(f(v,T,R,w,null,null,null,B),A)for(var F=0;F<R.length;++F)A(R[F]);return R}function g(v,T,A,w,B,R,F){return f(v,T,A,w,B,R,F,true)}function b(v,T,A,w){var B=w?function(F){F&&w.push(F);}:undefined,R=p(v,T,B,A);return w||(R.length?R:undefined)}function _(v,T,A,w){var B=w?function(F){F&&w.push(F);}:undefined,R=p(v,T,B,A,true);return w||(R.length?R:undefined)}function x(v,T,A){if(A.path&&A.path.length){var w=v[T],B,R=A.path.length-1;for(B=0;B<R;B++)w=w[A.path[B]];switch(A.kind){case "A":x(w[A.path[B]],A.index,A.item);break;case "D":delete w[A.path[B]];break;case "E":case "N":w[A.path[B]]=A.rhs;break}}else switch(A.kind){case "A":x(v[T],A.index,A.item);break;case "D":v=u(v,T);break;case "E":case "N":v[T]=A.rhs;break}return v}function y(v,T,A){if(typeof A>"u"&&T&&~e.indexOf(T.kind)&&(A=T),v&&A&&A.kind){for(var w=v,B=-1,R=A.path?A.path.length-1:0;++B<R;)typeof w[A.path[B]]>"u"&&(w[A.path[B]]=typeof A.path[B+1]<"u"&&typeof A.path[B+1]=="number"?[]:{}),w=w[A.path[B]];switch(A.kind){case "A":A.path&&typeof w[A.path[B]]>"u"&&(w[A.path[B]]=[]),x(A.path?w[A.path[B]]:w,A.index,A.item);break;case "D":delete w[A.path[B]];break;case "E":case "N":w[A.path[B]]=A.rhs;break}}}function E(v,T,A){if(A.path&&A.path.length){var w=v[T],B,R=A.path.length-1;for(B=0;B<R;B++)w=w[A.path[B]];switch(A.kind){case "A":E(w[A.path[B]],A.index,A.item);break;case "D":w[A.path[B]]=A.lhs;break;case "E":w[A.path[B]]=A.lhs;break;case "N":delete w[A.path[B]];break}}else switch(A.kind){case "A":E(v[T],A.index,A.item);break;case "D":v[T]=A.lhs;break;case "E":v[T]=A.lhs;break;case "N":v=u(v,T);break}return v}function S(v,T,A){if(v&&T&&A&&A.kind){var w=v,B,R;for(R=A.path.length-1,B=0;B<R;B++)typeof w[A.path[B]]>"u"&&(w[A.path[B]]={}),w=w[A.path[B]];switch(A.kind){case "A":E(w[A.path[B]],A.index,A.item);break;case "D":w[A.path[B]]=A.lhs;break;case "E":w[A.path[B]]=A.lhs;break;case "N":delete w[A.path[B]];break}}}function D(v,T,A){if(v&&T){var w=function(B){(!A||A(v,T,B))&&y(v,T,B);};p(v,T,w);}}return Object.defineProperties(b,{diff:{value:b,enumerable:true},orderIndependentDiff:{value:_,enumerable:true},observableDiff:{value:p,enumerable:true},orderIndependentObservableDiff:{value:g,enumerable:true},orderIndepHash:{value:h,enumerable:true},applyDiff:{value:D,enumerable:true},applyChange:{value:y,enumerable:true},revertChange:{value:S,enumerable:true},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:true}}),b.DeepDiff=b,r&&(r.DeepDiff=b),b});});var S1={};li(S1,{CanvasManagerStatic:()=>I,GameStepManager:()=>Ea,GameStorageManager:()=>Aa,GameWindowManager:()=>Sa,NarrationManagerStatic:()=>G,SoundManagerStatic:()=>re,StorageManagerStatic:()=>Be,canvas:()=>C,narration:()=>N,sound:()=>St,storage:()=>O});xe();var T1={};li(T1,{CanvasBase:()=>Zl,CanvasBaseItem:()=>Zl,CanvasContainer:()=>Ur,CanvasEvent:()=>Xd,CanvasImage:()=>ee,CanvasSprite:()=>Bt,CanvasText:()=>ar,CanvasVideo:()=>Tt,CharacterBaseModel:()=>Yd,CharacterStoredClass:()=>Ta,ChoiceMenuOption:()=>Te,ChoiceMenuOptionClose:()=>ns,Container:()=>Ur,Dialogue:()=>ui,DialogueBaseModel:()=>ui,ImageContainer:()=>we,ImageSprite:()=>ee,Label:()=>ie,LabelAbstract:()=>ya,Sound:()=>yn,Sprite:()=>Bt,StoredClassModel:()=>va,Text:()=>ar,VideoSprite:()=>Tt});xe();var Fe={};li(Fe,{DistortionFilter:()=>V_,EqualizerFilter:()=>Gr,Filter:()=>ht,MonoFilter:()=>W_,ReverbFilter:()=>z_,StereoFilter:()=>X_,StreamFilter:()=>Y_,TelephoneFilter:()=>$_});var VM;function WM(r){return VM=r,r}function Ce(){return VM}var ht=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 V_=class extends ht{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 ut=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 Pe=class extends ht{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:Pe.F32,type:"lowshelf",gain:r},{f:Pe.F64,type:"peaking",gain:e},{f:Pe.F125,type:"peaking",gain:t},{f:Pe.F250,type:"peaking",gain:i},{f:Pe.F500,type:"peaking",gain:s},{f:Pe.F1K,type:"peaking",gain:n},{f:Pe.F2K,type:"peaking",gain:o},{f:Pe.F4K,type:"peaking",gain:a},{f:Pe.F8K,type:"peaking",gain:u},{f:Pe.F16K,type:"highshelf",gain:l}];Ce().useLegacy||(c=h.map(f=>{let p=Ce().context.audioContext.createBiquadFilter();return p.type=f.type,ut.setParamValue(p.Q,1),p.frequency.value=f.f,ut.setParamValue(p.gain,f.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let f=0;f<this.bands.length;f++){let p=this.bands[f];f>0&&this.bands[f-1].connect(p),this.bandsMap[p.frequency.value]=p;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);ut.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(Pe.F32,r);}get f32(){return this.getGain(Pe.F32)}set f64(r){this.setGain(Pe.F64,r);}get f64(){return this.getGain(Pe.F64)}set f125(r){this.setGain(Pe.F125,r);}get f125(){return this.getGain(Pe.F125)}set f250(r){this.setGain(Pe.F250,r);}get f250(){return this.getGain(Pe.F250)}set f500(r){this.setGain(Pe.F500,r);}get f500(){return this.getGain(Pe.F500)}set f1k(r){this.setGain(Pe.F1K,r);}get f1k(){return this.getGain(Pe.F1K)}set f2k(r){this.setGain(Pe.F2K,r);}get f2k(){return this.getGain(Pe.F2K)}set f4k(r){this.setGain(Pe.F4K,r);}get f4k(){return this.getGain(Pe.F4K)}set f8k(r){this.setGain(Pe.F8K,r);}get f8k(){return this.getGain(Pe.F8K)}set f16k(r){this.setGain(Pe.F16K,r);}get f16k(){return this.getGain(Pe.F16K)}reset(){this.bands.forEach(r=>{ut.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},Gr=Pe;Gr.F32=32;Gr.F64=64;Gr.F125=125;Gr.F250=250;Gr.F500=500;Gr.F1K=1e3;Gr.F2K=2e3;Gr.F4K=4e3;Gr.F8K=8e3;Gr.F16K=16e3;var W_=class extends ht{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 z_=class extends ht{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 X_=class extends ht{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?ut.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 Y_=class extends ht{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 $_=class extends ht{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",ut.setParamValue(s.frequency,2e3),n.type="lowpass",ut.setParamValue(n.frequency,2e3),o.type="highpass",ut.setParamValue(o.frequency,500),a.type="highpass",ut.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};xe();var Cd=class extends le{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();}};xe();var iL=0,d1=class extends le{constructor(r){super(),this.id=iL++,this.init(r);}set(r,e){if(this[r]===undefined)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-d1.PADDING),this._end=Math.min(this._end+d1.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),Ae.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(){Ae.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){Ae.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}]`}},j_=d1;j_.PADDING=.1;xe();var Pd=class extends le{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new j_(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();}};xe();var wd=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 la=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],f1=["audio/mpeg","audio/ogg"],ca={};function zM(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$/;la.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(ca,i);}zM();xe();xe();var nL=0,Bd=class extends le{constructor(e){super(),this.id=nL++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===undefined)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);ut.setParamValue(this._gain.gain,n*s*i),ut.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){Ae.shared.remove(this._updateListener,this),e&&Ae.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 ha=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 XM=class extends ha{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(XM.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,ut.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}},q_=XM;q_.BUFFER_SIZE=0;var da=class{init(e){this.parent=e,this._nodes=new q_(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 Bd(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 z.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 Fl=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 Pd:new da;return new Fl(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:Le.extname(t).slice(1)})).filter(({ext:t})=>ca[t]).sort((t,i)=>la.indexOf(t.ext)-la.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 wd(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!==undefined&&(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(Fl._pool.length>0){let r=Fl._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Fl._pool.indexOf(r)<0&&Fl._pool.push(r);}},pr=Fl;pr._pool=[];xe();var Gl=class r extends ha{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 le,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 Ul=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new Gl),this._htmlAudioContext=new Cd,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 Gl.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 pr)return this._sounds[e]=t,t;let i=this._getOptions(t),s=pr.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!==undefined&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==undefined&&(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}};xe();xe();var YM=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=Le.basename(e,Le.extname(e))),t},$M={extension:m.Asset,detection:{test:async()=>true,add:async r=>[...r,...la.filter(e=>ca[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[m.LoadParser],priority:Oe.High},test(r){let e=Le.extname(r).slice(1);return !!ca[e]||f1.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>pr.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Ce().add(YM(e),t),t},async unload(r,e){Ce().remove(YM(e));}}};H.add($M);var _e=WM(new Ul);var Md="0.10.8";var qt="repeat";function es(r){return {type:"pause",duration:r}}var Rd={DistortionFilter:Fe.DistortionFilter,EqualizerFilter:Fe.EqualizerFilter,MonoFilter:Fe.MonoFilter,ReverbFilter:Fe.ReverbFilter,StereoFilter:Fe.StereoFilter,StreamFilter:Fe.StreamFilter,TelephoneFilter:Fe.TelephoneFilter},jM=["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"],Wt="__game_layer__",fa="Container",Id="ImageContainer",K_="Image",pa="Sprite",ma="Text",Z_="Video";xe();var v1={};li(v1,{addImage:()=>Nr,addImageCointainer:()=>_a,addVideo:()=>Gd,clearAllGameDatas:()=>SR,clearChoiceMenuOptions:()=>yR,clearDialogue:()=>xR,createExportableElement:()=>Se,getChoiceMenuOptions:()=>bR,getDialogue:()=>gR,getFlag:()=>TR,getSaveData:()=>z1,getSaveJson:()=>ER,getTexture:()=>oi,loadImage:()=>sR,loadSaveData:()=>X1,loadSaveJson:()=>AR,loadVideo:()=>nR,moveIn:()=>dn,moveOut:()=>ss,pushIn:()=>mn,pushOut:()=>gn,removeWithDissolve:()=>hn,removeWithDissolveTransition:()=>hn,removeWithFade:()=>Nd,removeWithFadeTransition:()=>Nd,setChoiceMenuOptions:()=>_R,setDialogue:()=>mR,setFlag:()=>vR,shakeEffect:()=>Hd,showImage:()=>Kl,showImageContainer:()=>iR,showVideo:()=>oR,showWithDissolve:()=>ai,showWithDissolveTransition:()=>ai,showWithFade:()=>ba,showWithFadeTransition:()=>ba,zoomIn:()=>fn,zoomOut:()=>pn});var y1={};li(y1,{FadeAlphaTicker:()=>lt,MoveTicker:()=>ze,RotateTicker:()=>vt,TickerBase:()=>Mt,ZoomTicker:()=>Rt});xe();var b1={};li(b1,{canvasComponentDecorator:()=>Nl,canvasElementDecorator:()=>Nl,eventDecorator:()=>m1,getAllCharacters:()=>qM,getCharacterById:()=>eb,getLabelById:()=>_r,newLabel:()=>fR,saveCharacter:()=>p1,saveLabel:()=>pR,tickerDecorator:()=>xr});var Q_={};function Nl(r){return function(e){Q_[r]&&console.warn(`[Pixi\u2019VN] CanvasElement ${r} already registered`),e.prototype.pixivnId=r,Q_[r]=e;}}var J_={___pixivn_juliette___:{id:"___pixivn_juliette___",name:"Juliette",age:25,icon:"https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media",color:"#ac0086"}};function p1(r){if(Array.isArray(r)){r.forEach(e=>p1(e));return}J_[r.id]&&console.info(`[Pixi\u2019VN] Character id ${r.id} already exists, it will be overwritten`),J_[r.id]=r;}function eb(r){try{let e=J_[r];if(!e){console.error(`[Pixi\u2019VN] Character ${r} not found`);return}return e}catch(e){console.error(`[Pixi\u2019VN] Error while getting Character ${r}`,e);return}}function qM(){return Object.values(J_)}var tb={};function m1(r){return function(e){r||(r=e.name),tb[r]&&console.info(`[Pixi\u2019VN] Event ${r} already exists, it will be overwritten`),e.prototype.id=r,tb[r]=e;}}function rb(r){try{let e=tb[r];if(!e){console.error(`[Pixi\u2019VN] Event ${r} not found`);return}return new e,e}catch(e){console.error(`[Pixi\u2019VN] Error while getting Event ${r}`,e);return}}function ib(r){try{let e=tb[r];if(!e){console.error(`[Pixi\u2019VN] Event ${r} not found`);return}return new e}catch(e){console.error(`[Pixi\u2019VN] Error while getting Event ${r}`,e);return}}var _1={};li(_1,{juliette:()=>Z,pixivnTestStartLabel:()=>_b});var Z="___pixivn_juliette___",Kt="https://pixijs.com/assets/eggHead.png",yt='<span style="color:purple">Egg Head</span>',Ci="https://pixijs.com/assets/flowerTop.png",ni='<span style="color:green">Flower Top</span>',Pi="https://pixijs.com/assets/helmlok.png",mr='<span style="color:blue">Helmlok</span>',ts="https://pixijs.com/assets/skully.png",gr='<span style="color:red">Skully</span>',KM="https://pixijs.com/assets/bunny.png";var ZM="https://pixijs.com/assets/video.mp4";var g1="https://pixijs.io/sound/examples/resources/musical.mp3",sb="___pixi_vn_example_start_label___",nb="___pixi_vn_open_link___",Dd="___pixi_vn_restart_test_label___",Hl="___pixi_vn_base_canvas_element_label___",Vl="___pixi_vn_custom_ticker_canvas_element_test___",Wl="___pixi_vn_images_animations_test___",zl="___pixi_vn_input_test___",Xl="___pixi_vn_markdown_test___",Yl="___pixi_vn_sound_test___",$l="___pixi_vn_step_label_test___",jl="___pixi_vn_video_test___",ob="___pixi_vn_images_dissolve_test___",ab="___pixi_vn_images_fade_test___",ub="___pixi_vn_images_rotate_test___",lb="___pixi_vn_images_move_test___",cb="___pixi_vn_images_zoom_test___",hb="___pixi_vn_images_move_in_out_test___",db="___pixi_vn_images_zoom_in_out_test___",fb="___pixi_vn_images_push_in_out_test___",pb="___pixi_vn_images_add_same_tag_test___",mb="___pixi_vn_images_shake_stage_test___",gb="___pixi_vn_image_container_test___",xb="___pixi_vn_images_custom_position_test___";var _b=new ie(sb,[()=>{let r="",e=new Date().getHours();e>=5&&e<12?r="morning\u{1F505}":e>=12&&e<18?r="afternoon\u{1F506}":e>=18&&e<22?r="evening\u26C5":r="night\u{1F319}";let t=eb(Z);N.dialogue={character:Z,text:`Good ${r}! I'm ${t.name}, your virtual assistant. I'm here to help you with your tests.`};},()=>N.dialogue={character:Z,text:`You are running the Pixi\u2019VN v${Md} test. This test will guide you through the different features of the library.`},r=>N.jumpLabel(x1,r)]),kd=new ie(nb,[async r=>{window.open(r.link),await N.goNext(r);}]),x1=new ie(Dd,[()=>{C.clear(),N.dialogue={character:Z,text:"Which test would you like to start with?"},N.choiceMenuOptions=[new Te("Open Pixi\u2019VN Wiki",kd,{link:"https://pixi-vn.web.app/"}),new Te("Open Pixi\u2019VN Discord",kd,{link:"https://discord.gg/E95FZWakzp"}),new Te("Open Pixi\u2019VN Github Issues",kd,{link:"https://github.com/DRincs-Productions/pixi-vn/issues"}),new Te("Images, Transitions and Animations Test",Wl,{}),new Te("Video Test",jl,{}),new Te("Sound Test",Yl,{}),new Te("Base Canvas Element Test",Hl,{}),new Te("Custom Ticker Canvas Element Test",Vl,{}),new Te("Steps and Labels Test",$l,{}),new Te("Markdown Test",Xl,{}),new Te("Input Test",zl,{})];},r=>N.jumpLabel(Dd,r)]);xe();var QM=new ie(Hl,[async()=>{let r=25;N.dialogue={character:Z,text:`Here's what's going to happen: I'm going to create ${r} bunnies (CanvasSprites) and put them in a Container.`};let e=new Ur;C.add("container",e);let t=await ke.load(KM);for(let i=0;i<r;i++){let s=new Bt(t);s.x=i%5*40,s.y=Math.floor(i/5)*40,e.addChild(s);}e.x=C.screen.width/2,e.y=C.screen.height/2,e.pivot.x=e.width/2,e.pivot.y=e.height/2,C.addTicker("container",new vt({speed:1}));},async()=>{C.remove("container"),N.dialogue={character:Z,text:`Here's what's going to happen: I'm going to create some Text with different styles and put them on the stage.
3311
- But it will generate a warn message, because the FillGradient or FillPattern has not yet been supported by the Pixi\u2019VN ( you can see the status of the issue here: [#76](https://github.com/DRincs-Productions/pixi-vn/issues/76)).`};let r=new Ye({fill:"#ffffff"}),e=new ar({text:"Basic text in pixi",style:r});e.x=50,e.y=100,C.add("basicText",e);let t=new Dr(0,0,0,36*1.7*7),i=[16777215,65433].map(u=>j.shared.setValue(u).toNumber());i.forEach((u,l)=>{let c=l/i.length;t.addColorStop(c,u);});let s=new Ye({fontFamily:"Arial",fontSize:36,fontStyle:"italic",fontWeight:"bold",fill:{fill:t},stroke:{color:"#4a1850",width:5,join:"round"},dropShadow:{color:"#ff5f74",blur:4,angle:Math.PI/6,distance:6},wordWrap:true,wordWrapWidth:440}),n=new ar({text:"Rich text with a lot of options and across multiple lines",style:s});n.x=50,n.y=220,C.add("richText",n);let o=new Ye({fontFamily:"Arial",dropShadow:{alpha:.8,angle:2.1,blur:4,color:"0x111111",distance:10},fill:"#ffffff",stroke:{color:"#004620",width:12,join:"round"},fontSize:60,fontWeight:"lighter"}),a=new ar({text:"SKEW IS COOL",style:o});a.skew.set(.65,-0.3),a.anchor.set(.5,.5),a.x=300,a.y=480,C.add("skewText",a);}]);xe();xe();var ql="close";xe();({...T1,...y1,...b1,...v1,..._1,...S1});var cn=class extends Bt{get memory(){return {...super.memory,direction:this.direction,turningSpeed:this.turningSpeed,speed:this.speed}}set memory(e){super.memory=e,this.direction=e.direction,this.turningSpeed=e.turningSpeed,this.speed=e.speed;}direction=0;turningSpeed=0;speed=0;static from(e,t){let i=Bt.from(e,t),s=new cn;return s.texture=i.texture,s}};cn=Vr([Nl("___pixi_vn_custom_canvas_element___")],cn);var Od=class extends Mt{fn(e,t,i){i.forEach(s=>{let o=new q(-100,-100,C.screen.width+200,C.screen.height+200),a=C.find(s);a&&a instanceof cn&&(a.direction+=a.turningSpeed*.01,a.x+=Math.sin(a.direction)*a.speed,a.y+=Math.cos(a.direction)*a.speed,a.rotation=-a.direction-Math.PI/2,a.x<o.x?a.x+=o.width:a.x>o.x+o.width&&(a.x-=o.width),a.y<o.y?a.y+=o.height:a.y>o.y+o.height&&(a.y-=o.height));});}};Od=Vr([xr("___pixi_vn_custom_ticker___")],Od);var eR=new ie(Vl,[async()=>{for(let e=0;e<100;e++){let t=await ke.load(Kt),i=cn.from(t);i.anchor.set(.5),i.scale.set(.8+Math.random()*.3),i.x=Math.random()*C.screen.width,i.y=Math.random()*C.screen.height,i.tint=Math.random()*16777215,i.direction=Math.random()*Math.PI*2,i.turningSpeed=Math.random()-.8,i.speed=2+Math.random()*2,C.add("alien"+e,i);let s={};C.addTicker("alien"+e,new Od(s));}N.dialogue={character:Z,text:`This is a test of custom ticker and canvas element. In this test, we have created 100 ${yt} with random tint, scale, position, direction, turning speed, and speed. With the custom ticker, we are moving the custom canvas element in a random direction. (This example is from the official [PixiJS website](https://pixijs.com/8.x/examples/events/interactivity).)`};}]);xe();function rs(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(C.screen.width-t)+i+n*t+(s?t:0):e*(C.screen.height-t)+i+n*t+(s?t:0)}function wi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(C.screen.width-t):(e-i-n*t-(s?t:0))/(C.screen.height-t)}function is(r,e){return r==="width"?e*C.screen.width:e*C.screen.height}function Bi(r,e){return r==="width"?e/C.screen.width:e/C.screen.height}function rt(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*s-r.x*i,y:r.y*i-r.x*s}}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*s-r.x*i,y:-r.y*i-r.x*s}}return {x:0,y:0}}function E1(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 Mi(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 Ri(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))}xe();function A1(r,e){let t=r.source.label;return {url:t,alias:e===t?undefined:e}}function Ld(r){if(ke.cache.has(r)){let e=ke.get(r);e&&e instanceof M&&(r=e.source.label);}return !!r.match(new RegExp(`(${jM.join("|")})$`))}xe();function ga(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===undefined?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===undefined?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&(r.percentagePosition===undefined?(r.percentagePosition={x:r.xPercentagePosition},delete r.xPercentagePosition):(r.percentagePosition.x=r.xPercentagePosition,delete r.xPercentagePosition)),r.yPercentagePosition!=null&&(r.percentagePosition===undefined?(r.percentagePosition={y:r.yPercentagePosition},delete r.yPercentagePosition):(r.percentagePosition.y=r.yPercentagePosition,delete r.yPercentagePosition))),r)}xe();async function bb(r){let e=lL(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 lL(r){try{let e=Q_[r];if(e||(r===fa?e=Ur:r===Z_?e=Tt:r===K_?e=ee:r===pa?e=Bt:r===ma?e=ar:r===Id&&(e=we)),!e){console.error(`[Pixi\u2019VN] CanvasElement ${r} not found`);return}return new e}catch(e){console.error(`[Pixi\u2019VN] Error while getting CanvasElement ${r}`,e);return}}xe();xe();async function oi(r){if(r!=="EMPTY"){if(!r){console.error("[Pixi\u2019VN] Texture not found",r);return}if(ke.cache.has(r)){let e=ke.get(r);if(e)return e}return ke.load(r).then(e=>{if(!e){console.error("[Pixi\u2019VN] Texture not found",r);return}if(!(e instanceof M)){console.error("[Pixi\u2019VN] File not is a file",r);return}return e}).catch(e=>{console.error("[Pixi\u2019VN] Error loading file",e);})}}function tR(r,e){if(!(r instanceof Object))return r;console.warn(`[Pixi\u2019VN] Text.style.${e} is a FillGradient or FillPattern, this is not supported yet.`,r);}function rR(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:tR(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:tR(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}function C1(r){return "memory"in r?r.memory:r instanceof Fr?P1(r):r instanceof Me?Fd(r):xa(r)}function xa(r,e){let t=fa,i=e?.childrenExport||false;r.hasOwnProperty("pixivnId")&&(t=r.pixivnId);let s=[];return i&&r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).forEach(n=>{s.push(C1(n));}),{pixivnId:t,elements:s,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 Fd(r){let e=xa(r),t=e.pixivnId??pa,i={};"onEvents"in r&&(i=r.onEvents);let s;return "textureAlias"in r?s=A1(r.texture,r.textureAlias):s=A1(r.texture),{...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function P1(r){let e=xa(r),t=e.pixivnId??ma,i={};return "onEvents"in r&&(i=r.onEvents),{...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:rR(r.style),roundPixels:r.roundPixels,onEvents:i}}var Ur=class extends X{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||fa;}pixivnId=fa;get memory(){return xa(this,{childrenExport:true})}set memory(e){}async setMemory(e){return this.memory=e,await this.importChildren(e),await Ii(this,e)}async importChildren(e){for(let t=0;t<e.elements.length;t++){let i=e.elements[t],s=await bb(i);this.addChild(s);}}};async function Ii(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==undefined&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==undefined&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==undefined&&(r.tint=e.tint),"alpha"in e&&e.alpha!==undefined&&(r.alpha=e.alpha),"angle"in e&&e.angle!==undefined&&(r.angle=e.angle),"renderable"in e&&e.renderable!==undefined&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==undefined&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==undefined&&(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!==undefined&&(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!==undefined&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==undefined&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==undefined&&(r.visible=e.visible),"x"in e&&e.x!==undefined&&(r.x=e.x),"y"in e&&e.y!==undefined&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==undefined&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==undefined&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==undefined&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==undefined&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==undefined&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==undefined&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==undefined&&(r.width=e.width),"height"in e&&e.height!==undefined&&(r.height=e.height));}var we=class extends Ur{constructor(e,t=[]){e=ga(e);let i,s,n;e&&"anchor"in e&&e?.anchor!==undefined&&(n=e.anchor,delete e.anchor),e&&"align"in e&&e?.align!==undefined&&(i=e.align,delete e.align),e&&"percentagePosition"in e&&e?.percentagePosition!==undefined&&(s=e.percentagePosition,delete e.percentagePosition),super(e),e=ga(e),t&&t.forEach(o=>{let a;Ld(o)?a=new Tt(undefined,o):a=new ee(undefined,o),this.addChild(a);}),n&&(this.anchor=n),i&&(this.align=i),s&&(this.percentagePosition=s);}get memory(){return {...super.memory,pixivnId:Id,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(e){}async setMemory(e){this.memory=e,await this.importChildren(e),await w1(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=Id;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=Array(this.children.length);for(let t=0;t<this.children.length;t++)e[t]=this.children[t].load();return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(t=>{this._loadIsStarted=false,console.error("[Pixi\u2019VN] Error into ImageContainer.load()",t);})}get texture(){return this.children.length>0?this.children[0].texture:new M}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}_anchor;get anchor(){let e=super.pivot.x/this.width,t=super.pivot.y/this.height;return {x:e,y:t}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,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(e){this._anchor=undefined,super.pivot=e;}_align=undefined;set align(e){this._percentagePosition=undefined,this._align===undefined&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==undefined&&(this._align.x=e.x),e.y!==undefined&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=rt(this.pivot,this.angle),t=rt(this.scale,this.angle);return {x:wi("width",this.x,Mi(this),e.x,t.x<0,this.anchor.x),y:wi("height",this.y,Ri(this),e.y,t.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=undefined),this._align===undefined&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=rt(this.pivot,this.angle),t=rt(this.scale,this.angle);return wi("width",this.x,Mi(this),e.x,t.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=undefined),this._align===undefined&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=rt(this.pivot,this.angle),t=rt(this.scale,this.angle);return wi("height",this.y,Ri(this),e.y,t.y<0,this.anchor.y)}_percentagePosition=undefined;set percentagePosition(e){this._align=undefined,this._percentagePosition===undefined&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==undefined&&(this._percentagePosition.x=e.x),e.y!==undefined&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:Bi("width",this.x),y:Bi("height",this.y)}}set xPercentagePosition(e){this._align&&(this._align=undefined),this._percentagePosition===undefined&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get xPercentagePosition(){return Bi("width",this.x)}set yPercentagePosition(e){this._align&&(this._align=undefined),this._percentagePosition===undefined&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get yPercentagePosition(){return Bi("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(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=rt(this.pivot,this.angle),t=rt(this.scale,this.angle);this._align.x!==undefined&&(super.x=rs("width",this._align.x,Mi(this),e.x,t.x<0)),this._align.y!==undefined&&(super.y=rs("height",this._align.y,Ri(this),e.y,t.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==undefined&&(super.x=is("width",this._percentagePosition.x)),this._percentagePosition.y!==undefined&&(super.y=is("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=undefined,this._percentagePosition=undefined,super.position=e;}get x(){return super.x}set x(e){this._align=undefined,this._percentagePosition=undefined,super.x=e;}get y(){return super.y}set y(e){this._align=undefined,this._percentagePosition=undefined,super.y=e;}};async function w1(r,e,t){e=ga(e),Ii(r,e,{...t,end:async()=>{"anchor"in e&&e.anchor!==undefined&&(r.anchor=e.anchor),"align"in e&&e.align!==undefined&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==undefined&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}function _a(r,e,t){let i=new we(t,e);return C.add(r,i),i}async function iR(r,e,t){let i=new we(t,e);return await i.load(),C.add(r,i),i}xe();function Nr(r,e,t){if(!e)if(ke.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new ee(t,e);return C.add(r,i),i}async function sR(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=oi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function Kl(r,e,t){if(!e)if(ke.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new ee(t,e);return await i.load(),C.add(r,i),i}xe();function Gd(r,e,t){if(!e)if(ke.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Tt(t,e);return C.add(r,i),i}async function nR(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=oi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function oR(r,e,t){if(!e)if(ke.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Tt(t,e);return await i.load(),C.add(r,i),i}function Ud(r,e){if(typeof e=="string")return Ld(e)?Gd(r,e):Nr(r,e);if(Array.isArray(e))return _a(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Ld(e.value)?Gd(r,e.value,e.options):Nr(r,e.value,e.options);if(Array.isArray(e.value))return _a(r,e.value,e.options)}return C.add(r,e),e}async function ai(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(C.find(r)&&(a=r+"_temp_disolve",C.editAlias(r,a)),e=Ud(r,e),a&&C.copyCanvasElementProperty(a,r),a&&C.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=hn(a,t,i);c&&(o.push(...c),C.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new lt({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},undefined,i),l=C.addTicker(r,u);if(l&&(s&&C.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof ee||e instanceof we)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function hn(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:s=[]}=e;typeof r=="string"&&(r=[r]),typeof s=="string"&&(s=[s]),s.push(...r);let n=new lt({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},undefined,t),o=C.addTicker(r,n);if(o)return i&&C.completeTickerOnStepEnd({id:o}),[o]}async function ba(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!C.find(r))return ai(r,e,t,i);let a=r+"_temp_fade";C.editAlias(r,a),n.push(a),e=Ud(r,e),a&&C.copyCanvasElementProperty(a,r),a&&C.transferTickers(a,r,"duplicate"),e.alpha=0;let u=hn(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new lt({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},undefined,i),c=C.addTicker(r,l);if(c&&(s&&C.completeTickerOnStepEnd({id:c}),o.push(c),C.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof ee||e instanceof we)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function Nd(r,e={},t){return hn(r,e,t)}async function dn(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;C.find(r)&&(c=r+"_temp_movein",C.editAlias(r,c)),e=Ud(r,e),c&&C.copyCanvasElementProperty(c,r),c&&C.transferTickers(c,r,"move");let h;e instanceof ee||e instanceof we?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let f;switch(c&&(u?(f=ss(c,t,i),f&&(l.push(...f),o.push(c))):a.push(c)),(e instanceof ee||e instanceof we)&&e.haveEmptyTexture&&await e.load(),c&&C.pauseTicker(c,{tickerIdsIncluded:f}),s){case "up":e.y=C.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=C.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new ze({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},undefined,i),g=C.addTicker(r,p);if(g&&(C.pauseTicker(r,{tickerIdsExcluded:[g]}),n&&C.completeTickerOnStepEnd({id:g}),l.push(g)),l.length>0)return l}function ss(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=C.find(r);if(!o){console.warn("[Pixi\u2019VN] The canvas component is not found.");return}let a={x:o.x,y:o.y};switch(i){case "up":a.y=C.canvasHeight+o.height;break;case "down":a.y=-o.height;break;case "left":a.x=C.canvasWidth+o.width;break;case "right":a.x=-o.width;break}let u=new ze({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},undefined,t),l=C.addTicker(r,u);if(l)return C.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&C.completeTickerOnStepEnd({id:l}),[l]}async function fn(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=C.find(r);c&&(l=r+"_temp_zoom",C.editAlias(r,l)),e=Ud(r,e),l&&C.copyCanvasElementProperty(l,r),l&&C.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=C.canvasHeight-e.y,e.pivot.x=C.canvasWidth/2-e.x,e.y=C.canvasHeight,e.x=C.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=C.canvasWidth/2-e.x,e.y=0,e.x=C.canvasWidth/2):s=="left"?(e.pivot.x=C.canvasWidth-e.x,e.pivot.y=C.canvasHeight/2-e.y,e.x=C.canvasWidth,e.y=C.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=C.canvasHeight/2-e.y,e.x=0,e.y=C.canvasHeight/2),e.pivot=E1(e.pivot,e.angle),e.scale.set(0);let h=c?{pivot:{x:c.pivot.x,y:c.pivot.y},position:{x:c.x,y:c.y}}:undefined;if(l){if(t.removeOldComponentWithZoomOut){let g=pn(l,t,i);g&&(u.push(...g),o.push(l));}else a.push(l);C.pauseTicker(l);}o.push(r);let f=new Rt({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},undefined,i),p=C.addTicker(r,f);if(p&&(C.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&C.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof ee||e instanceof we)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function pn(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=C.find(r);if(!o){console.warn("[Pixi\u2019VN] The canvas component is not found.");return}i=="up"?(o.pivot.y=C.canvasHeight-o.y,o.pivot.x=C.canvasWidth/2-o.x,o.y=C.canvasHeight,o.x=C.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=C.canvasWidth/2-o.x,o.y=0,o.x=C.canvasWidth/2):i=="left"?(o.pivot.x=C.canvasWidth-o.x,o.pivot.y=C.canvasHeight/2-o.y,o.x=C.canvasWidth,o.y=C.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=C.canvasHeight/2-o.y,o.x=0,o.y=C.canvasHeight/2),o.pivot=E1(o.pivot,o.angle),o.scale.set(1);let a=new Rt({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},undefined,t),u=C.addTicker(r,a);if(u)return C.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&C.completeTickerOnStepEnd({id:u}),[u]}async function mn(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;C.find(r)&&(u=r+"_temp_push",C.editAlias(r,u)),e=Ud(r,e),u&&C.copyCanvasElementProperty(u,r),u&&C.transferTickers(u,r,"move");let l;if((e instanceof ee||e instanceof we)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-C.canvasHeight+e.y:s=="down"?e.y=C.canvasHeight+e.y:s=="left"?e.x=-C.canvasWidth+e.x:s=="right"&&(e.x=C.canvasWidth+e.x),u){let f=gn(u,t,i);f&&a.push(...f);}o.push(r);let c=new ze({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},undefined,i),h=C.addTicker(r,c);if(h&&(C.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&C.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof ee||e instanceof we)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function gn(r,e={direction:"right"},t){return ss(r,e,t)}var aR=new ie(Wl,[async()=>{C.removeAll(),N.dialogue={character:Z,text:`These are my 4 puppets: ${yt}, ${ni}, ${mr} and ${gr}. They can appear, disappear and animate at my will.`};let r=Nr("eggHead",Kt);await r.load(),r.x=100,r.y=100;let e=Nr("flowerTop",Ci);e.x=300,e.y=100,e.load(),Kl("helmlok",Pi,{x:100,y:300}),Kl("skully",ts,{x:300,y:300});},async()=>{N.dialogue={character:Z,text:"Here's what they can do."},N.choiceMenuOptions=[new Te("Dissolve effect",B1,{}),new Te("Fade effect",M1,{}),new Te("Rotate",R1,{}),new Te("Move",I1,{}),new Te("Zoom",D1,{}),new Te("Move in/out",k1,{}),new Te("Zoom in/out",O1,{}),new Te("Push in/out",L1,{}),new Te("Shake",G1,{}),new Te("Add same alias",F1,{}),new Te("Image container",U1,{}),new Te("Additional Positions",N1,{}),new ns("Cancel",{closeCurrentLabel:true})];},(r,{labelId:e})=>N.jumpLabel(e,r)]),B1=new ie(ob,[()=>{N.dialogue={character:Z,text:`Here's what's going to happen:
3310
+ `,dynamic:false}};});var eL,BM,MM,RM=d(()=>{Et();di();a1();eL=new ge(0,0,0,0),BM=class u1 extends nt{constructor(e={}){e={...u1.defaultOptions,...e,dynamicProperties:{...u1.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 Ad){let l=Ad[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 eL}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){let i=this.particleChildren.splice(e,t);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")}};BM.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};MM=BM;});var IM,l1,H_,kM=d(()=>{he();ye();di();$m();IM=class DM extends nt{constructor(e){e instanceof M&&(e={texture:e});let{width:t,height:i,leftWidth:s,rightWidth:n,topHeight:o,bottomHeight:a,texture:u,roundPixels:l,...c}=e;super({label:"NineSliceSprite",...c}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=s??u?.defaultBorders?.left??ri.defaultOptions.leftWidth,this._topHeight=o??u?.defaultBorders?.top??ri.defaultOptions.topHeight,this._rightWidth=n??u?.defaultBorders?.right??ri.defaultOptions.rightWidth,this._bottomHeight=a??u?.defaultBorders?.bottom??ri.defaultOptions.bottomHeight,this.bounds.maxX=this._width=t??u.width??ri.defaultOptions.width,this.bounds.maxY=this._height=i??u.height??ri.defaultOptions.height,this.allowChildren=false,this.texture=u??DM.defaultOptions.texture,this.roundPixels=l??false;}updateBounds(){}get width(){return this._width}set width(e){this.bounds.maxX=this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this.bounds.maxY=this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this.bounds.maxX=this._width=e,this.bounds.maxY=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=M.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;}};IM.defaultOptions={texture:M.EMPTY};l1=IM,H_=class extends l1{constructor(...e){let t=e[0];t instanceof M&&(L(W,"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]}),L(W,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function OM(r,e){return e instanceof Ye||e instanceof ti?e:r==="html"?new ti(e):new Ye(e)}var LM=d(()=>{Zc();Xi();});async function FM(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 GM=d(()=>{});function c1(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=tL[rL++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Me&&(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];c1(a,e,{...t});}}function h1(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];h1(o,e,{...t,index:n});}}var tL,rL,UM=d(()=>{bs();tL=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],rL=0;});var NM={};li(NM,{AbstractBitmapFont:()=>Vs,AbstractRenderer:()=>_i,AbstractText:()=>Ai,AccessibilitySystem:()=>Of,AlphaFilter:()=>rB,AlphaMask:()=>Gn,AlphaMaskPipe:()=>Ao,AnimatedSprite:()=>Ml,Application:()=>Nh,ApplicationInitHook:()=>So,Assets:()=>ke,AssetsClass:()=>$h,BLEND_TO_NPM:()=>sp,BUFFER_TYPE:()=>qo,BackgroundLoader:()=>il,BackgroundSystem:()=>pg,Batch:()=>Ec,BatchGeometry:()=>$a,BatchTextureArray:()=>Ya,BatchableGraphics:()=>zi,BatchableMesh:()=>mi,BatchableSprite:()=>Ir,Batcher:()=>op,BatcherPipe:()=>Ch,BigPool:()=>K,BindGroup:()=>ot,BindGroupSystem:()=>Do,BitmapFont:()=>oa,BitmapFontManager:()=>$i,BitmapText:()=>Dl,BitmapTextPipe:()=>no,BlendModeFilter:()=>te,BlendModePipe:()=>wo,BlurFilter:()=>gd,BlurFilterPass:()=>Bl,Bounds:()=>ge,BrowserAdapter:()=>Vf,Buffer:()=>Ne,BufferImageSource:()=>Gi,BufferResource:()=>vi,BufferUsage:()=>J,CLEAR:()=>at,Cache:()=>pe,CanvasPool:()=>Gt,CanvasPoolClass:()=>Hc,CanvasSource:()=>mt,CanvasTextMetrics:()=>tr,CanvasTextPipe:()=>eo,CanvasTextSystem:()=>so,Circle:()=>du,Color:()=>j,ColorBlend:()=>rh,ColorBurnBlend:()=>ih,ColorDodgeBlend:()=>sh,ColorMask:()=>Un,ColorMaskPipe:()=>Co,ColorMatrixFilter:()=>T_,CompressedSource:()=>Lr,Container:()=>X,Culler:()=>i_,CullerPlugin:()=>td,CustomRenderPipe:()=>xo,D3D10_RESOURCE_DIMENSION:()=>qx,D3DFMT:()=>jt,DATA_URI:()=>HP,DDS:()=>Q,DEG_TO_RAD:()=>sf,DEPRECATED_SCALE_MODES:()=>Ed,DEPRECATED_WRAP_MODES:()=>Sd,DOMAdapter:()=>z,DRAW_MODES:()=>kB,DXGI_FORMAT:()=>jx,DXGI_TO_TEXTURE_FORMAT:()=>Ht,DarkenBlend:()=>nh,DefaultBatcher:()=>zn,DefaultShader:()=>Qa,DifferenceBlend:()=>oh,DisplacementFilter:()=>A_,DivideBlend:()=>ah,DynamicBitmapFont:()=>qc,Ellipse:()=>fu,EventBoundary:()=>Ga,EventEmitter:()=>le,EventSystem:()=>Ua,EventsTicker:()=>Tr,ExclusionBlend:()=>uh,ExtensionType:()=>m,ExtractSystem:()=>mg,FOURCC_TO_TEXTURE_FORMAT:()=>Qh,FederatedContainer:()=>Hf,FederatedEvent:()=>hi,FederatedMouseEvent:()=>$r,FederatedPointerEvent:()=>At,FederatedWheelEvent:()=>Sr,FillGradient:()=>Dr,FillPattern:()=>Qr,Filter:()=>xt,FilterEffect:()=>zr,FilterPipe:()=>co,FilterSystem:()=>ho,FontStylePromiseCache:()=>Au,GAUSSIAN_VALUES:()=>wl,GL_FORMATS:()=>ju,GL_INTERNAL_FORMAT:()=>sE,GL_TARGETS:()=>Dh,GL_TYPES:()=>me,GL_WRAP_MODES:()=>k2,GenerateTextureSystem:()=>Bo,Geometry:()=>Lt,GlBackBufferSystem:()=>Yg,GlBatchAdaptor:()=>jo,GlBuffer:()=>$u,GlBufferSystem:()=>Ko,GlColorMaskSystem:()=>Qo,GlContextSystem:()=>Wg,GlEncoderSystem:()=>Jo,GlGeometrySystem:()=>Zo,GlGraphicsAdaptor:()=>Yo,GlMeshAdaptor:()=>$o,GlParticleContainerAdaptor:()=>au,GlParticleContainerPipe:()=>Zn,GlProgram:()=>He,GlProgramData:()=>Zu,GlRenderTarget:()=>qu,GlRenderTargetAdaptor:()=>Ku,GlRenderTargetSystem:()=>ra,GlShaderSystem:()=>ia,GlStateSystem:()=>fx,GlStencilSystem:()=>ea,GlTexture:()=>Ju,GlTextureSystem:()=>na,GlUboSystem:()=>ta,GlUniformGroupSystem:()=>sa,GlobalUniformSystem:()=>Mo,GpuBatchAdaptor:()=>go,GpuBlendModesToPixi:()=>wt,GpuBufferSystem:()=>ko,GpuColorMaskSystem:()=>Oo,GpuDeviceSystem:()=>Qs,GpuEncoderSystem:()=>Lo,GpuGraphicsAdaptor:()=>po,GpuGraphicsContext:()=>Oc,GpuMeshAdapter:()=>mo,GpuMipmapGenerator:()=>Yu,GpuParticleContainerAdaptor:()=>cu,GpuParticleContainerPipe:()=>Qn,GpuProgram:()=>Ve,GpuReadBuffer:()=>RB,GpuRenderTarget:()=>Wu,GpuRenderTargetAdaptor:()=>zu,GpuRenderTargetSystem:()=>Vo,GpuShaderSystem:()=>Wo,GpuStateSystem:()=>zo,GpuStencilModesToPixi:()=>Or,GpuStencilSystem:()=>Fo,GpuTextureSystem:()=>Xo,GpuUboSystem:()=>Uo,GpuUniformBatchPipe:()=>No,Graphics:()=>Hs,GraphicsContext:()=>et,GraphicsContextRenderData:()=>Lc,GraphicsContextSystem:()=>Os,GraphicsPath:()=>kr,GraphicsPipe:()=>qn,HTMLText:()=>kl,HTMLTextPipe:()=>oo,HTMLTextRenderData:()=>Ws,HTMLTextStyle:()=>ti,HTMLTextSystem:()=>zs,HardLightBlend:()=>lh,HardMixBlend:()=>ch,HelloSystem:()=>Zs,IGLUniformData:()=>Qg,ImageSource:()=>$t,InstructionSet:()=>ds,KTX:()=>qe,LightenBlend:()=>hh,LinearBurnBlend:()=>dh,LinearDodgeBlend:()=>fh,LinearLightBlend:()=>ph,Loader:()=>nl,LoaderParserPriority:()=>Oe,LuminosityBlend:()=>mh,MSAA_QUALITY:()=>e1,MaskEffectManager:()=>Ma,MaskEffectManagerClass:()=>oc,MaskFilter:()=>Du,Matrix:()=>k,Mesh:()=>or,MeshGeometry:()=>Ut,MeshPipe:()=>Kn,MeshPlane:()=>G_,MeshRope:()=>vM,MeshSimple:()=>N_,NOOP:()=>cc,NegationBlend:()=>gh,NineSliceGeometry:()=>ri,NineSlicePlane:()=>H_,NineSliceSprite:()=>l1,NineSliceSpritePipe:()=>lo,NoiseFilter:()=>hB,ObservablePoint:()=>Ue,OverlayBlend:()=>xh,PI_2:()=>tf,Particle:()=>PM,ParticleBuffer:()=>uu,ParticleContainer:()=>MM,ParticleContainerPipe:()=>Ls,ParticleShader:()=>lu,PerspectiveMesh:()=>pM,PerspectivePlaneGeometry:()=>Ll,PinLightBlend:()=>_h,PipelineSystem:()=>Ho,PlaneGeometry:()=>Ys,Point:()=>se,Polygon:()=>Gs,Pool:()=>Li,PoolGroupClass:()=>sc,PrepareBase:()=>w_,PrepareQueue:()=>Il,PrepareSystem:()=>Td,PrepareUpload:()=>Ol,QuadGeometry:()=>wu,RAD_TO_DEG:()=>rf,Rectangle:()=>q,RenderContainer:()=>k_,RenderGroup:()=>Oa,RenderGroupPipe:()=>bo,RenderGroupSystem:()=>vo,RenderLayer:()=>aM,RenderLayerClass:()=>t1,RenderTarget:()=>Io,RenderTargetSystem:()=>tn,RenderTexture:()=>ku,RenderableGCSystem:()=>bg,RendererInitHook:()=>Eo,RendererType:()=>We,ResizePlugin:()=>kn,Resolver:()=>Pt,RopeGeometry:()=>U_,RoundedRectangle:()=>pu,SCALE_MODES:()=>UB,STENCIL_MODES:()=>De,SVGParser:()=>pm,SVGToGraphicsPath:()=>im,SaturationBlend:()=>bh,SchedulerSystem:()=>Ro,ScissorMask:()=>I_,SdfShader:()=>Tu,Shader:()=>$e,ShaderStage:()=>ws,ShapePath:()=>_u,SharedRenderPipes:()=>Gu,SharedSystems:()=>Fu,SoftLightBlend:()=>yh,Sprite:()=>Me,SpritePipe:()=>To,Spritesheet:()=>bc,State:()=>Xe,StencilMask:()=>Nn,StencilMaskPipe:()=>Po,SubtractBlend:()=>vh,SystemRunner:()=>qs,TEXTURE_FORMAT_BLOCK_SIZE:()=>Kx,Text:()=>Fr,TextStyle:()=>Ye,Texture:()=>M,TextureGCSystem:()=>yg,TextureMatrix:()=>fs,TexturePool:()=>Ee,TexturePoolClass:()=>hc,TextureSource:()=>ce,TextureStyle:()=>ka,TextureUvs:()=>D_,Ticker:()=>Ae,TickerListener:()=>ms,TickerPlugin:()=>Ln,TilingSprite:()=>M_,TilingSpritePipe:()=>uo,TilingSpriteShader:()=>Pu,Transform:()=>Rl,Triangle:()=>P_,UNIFORM_TO_ARRAY_SETTERS:()=>cx,UNIFORM_TO_SINGLE_SETTERS:()=>lx,UNIFORM_TYPES_MAP:()=>wp,UNIFORM_TYPES_VALUES:()=>Mc,UPDATE_BLEND:()=>La,UPDATE_COLOR:()=>Dn,UPDATE_PRIORITY:()=>Yt,UPDATE_TRANSFORM:()=>RA,UPDATE_VISIBLE:()=>ps,UboBatch:()=>Hu,UboSystem:()=>Js,UniformGroup:()=>oe,VERSION:()=>Ks,VideoSource:()=>Ts,ViewContainer:()=>nt,ViewSystem:()=>Sg,ViewableBuffer:()=>Er,VividLightBlend:()=>Th,WGSL_ALIGN_SIZE_DATA:()=>Go,WGSL_TO_STD40_SIZE:()=>kh,WRAP_MODES:()=>GB,WebGLRenderer:()=>Uh,WebGPURenderer:()=>Ih,WebWorkerAdapter:()=>Q3,WorkerManager:()=>Yh,_getGlobalBounds:()=>gf,accessibilityTarget:()=>Lf,addBits:()=>Cc,addMaskBounds:()=>ys,addMaskLocalBounds:()=>vs,addProgramDefines:()=>cp,alphaFrag:()=>p_,alphaWgsl:()=>md,applyMatrix:()=>zm,applyProjectiveTransformationToPlane:()=>O_,applyStyleParams:()=>Gh,assignWithIgnore:()=>In,autoDetectEnvironment:()=>LP,autoDetectRenderer:()=>Sx,autoDetectSource:()=>tC,basisTranscoderUrls:()=>ml,bgr2rgb:()=>Fi,bitmapFontCachePlugin:()=>Ex,bitmapFontTextParser:()=>rl,bitmapFontXMLParser:()=>Hh,bitmapFontXMLStringParser:()=>Vh,blendTemplateFrag:()=>qm,blendTemplateVert:()=>Km,blendTemplateWgsl:()=>Zm,blockDataMap:()=>Rh,blurTemplateWgsl:()=>b_,boundsPool:()=>Xt,browserExt:()=>aT,buildAdaptiveBezier:()=>gu,buildAdaptiveQuadratic:()=>um,buildArc:()=>xu,buildArcTo:()=>cm,buildArcToSvg:()=>hm,buildCircle:()=>Mr,buildContextBatches:()=>Kp,buildEllipse:()=>kp,buildGeometryFromPath:()=>iM,buildLine:()=>Np,buildPixelLine:()=>Hp,buildPolygon:()=>iu,buildRectangle:()=>su,buildRoundedRectangle:()=>Op,buildSimpleUvs:()=>eu,buildTriangle:()=>nu,buildUvs:()=>Ja,cacheAsTextureMixin:()=>uf,cacheTextureArray:()=>Cx,calculateProjection:()=>Lg,checkChildrenDidChange:()=>uc,checkDataUrl:()=>rr,checkExtension:()=>je,checkMaxIfStatementsInShader:()=>tp,childrenHelperMixin:()=>cf,cleanArray:()=>_g,cleanHash:()=>xg,clearList:()=>yo,closePointEps:()=>Fp,collectAllRenderables:()=>qB,collectRenderablesMixin:()=>hf,color32BitToUniform:()=>Rr,colorBit:()=>Ms,colorBitGl:()=>Rs,colorMatrixFilterFrag:()=>v_,colorMatrixFilterWgsl:()=>xd,colorToUniform:()=>MC,compareModeToGlCompare:()=>bx,compileHighShader:()=>yp,compileHighShaderGl:()=>vp,compileHighShaderGlProgram:()=>Cr,compileHighShaderGpuProgram:()=>Ar,compileHooks:()=>Pc,compileInputs:()=>wc,compileOutputs:()=>bp,compileShader:()=>Oh,compute2DProjection:()=>F_,convertFormatIfRequired:()=>Xw,convertToList:()=>Ct,copySearchParams:()=>Fn,createIdFromString:()=>Zr,createIndicesForQuads:()=>Uc,createLevelBuffers:()=>Rw,createLevelBuffersFromKTX:()=>$w,createStringVariations:()=>Wf,createTexture:()=>Nt,createUboElementsSTD40:()=>$g,createUboElementsWGSL:()=>Cg,createUboSyncFunction:()=>Uu,createUboSyncFunctionSTD40:()=>Kg,createUboSyncFunctionWGSL:()=>Dg,crossOrigin:()=>YS,cullingMixin:()=>ef,curveEps:()=>Gp,defaultFilterVert:()=>un,defaultValue:()=>Qu,definedProps:()=>Ot,deprecation:()=>L,detectAvif:()=>wx,detectBasis:()=>Ew,detectCompressed:()=>e3,detectDefaults:()=>Bx,detectMp4:()=>Mx,detectOgv:()=>Rx,detectVideoAlphaMode:()=>Va,detectWebm:()=>Ix,detectWebp:()=>Dx,determineCrossOrigin:()=>jS,displacementFrag:()=>S_,displacementVert:()=>E_,displacementWgsl:()=>_d,earcut:()=>HM.default,effectsMixin:()=>df,ensureAttributes:()=>Vu,ensureIsBuffer:()=>Ac,ensureOptions:()=>ln,ensurePrecision:()=>hp,ensureTextStyle:()=>OM,executeInstructions:()=>_o,extensions:()=>H,extractAttributesFromGlProgram:()=>ix,extractAttributesFromGpuProgram:()=>mp,extractFontFamilies:()=>Dm,extractStructAndGroups:()=>qa,fastCopy:()=>Wn,findHooksRx:()=>n0,findMixin:()=>ff,fontStringFromTextStyle:()=>Yi,formatShader:()=>EB,fragmentGPUTemplate:()=>Sp,fragmentGlTemplate:()=>Ap,generateArraySyncSTD40:()=>qg,generateArraySyncWGSL:()=>Ig,generateBlurFragSource:()=>g_,generateBlurGlProgram:()=>__,generateBlurProgram:()=>y_,generateBlurVertSource:()=>x_,generateGPULayout:()=>yB,generateGpuLayoutGroups:()=>gp,generateLayout:()=>TB,generateLayoutHash:()=>xp,generateParticleUpdateFunction:()=>Zp,generateProgram:()=>ax,generateShaderSyncCode:()=>Zg,generateTextStyleKey:()=>bu,generateTextureBatchBit:()=>Is,generateTextureBatchBitGl:()=>Ds,generateUID:()=>VB,generateUniformsSync:()=>hx,getAdjustedBlendModeBlend:()=>qr,getAttributeInfoFromFormat:()=>Ft,getBatchSamplersUniformGroup:()=>ks,getBitmapTextLayout:()=>Eu,getCanvasBoundingBox:()=>rm,getCanvasFillStyle:()=>Ns,getCanvasTexture:()=>Lu,getDefaultUniformValue:()=>Bp,getFastGlobalBounds:()=>YB,getFastGlobalBoundsMixin:()=>mf,getFontCss:()=>Om,getFontFamilyName:()=>US,getGeometryBounds:()=>ap,getGlTypeFromFormat:()=>Xg,getGlobalBounds:()=>ci,getGlobalMixin:()=>bf,getGlobalRenderableBounds:()=>jm,getLocalBounds:()=>hs,getMatrixRelativeToParent:()=>jf,getMaxFragmentPrecision:()=>lp,getMaxTexturesPerBatch:()=>Jt,getOrientationOfPoints:()=>Up,getParent:()=>zb,getPo2TextureFromSource:()=>vu,getResolutionOfUrl:()=>nn,getSVGUrl:()=>Lm,getSupportedCompressedTextureFormats:()=>dl,getSupportedGPUCompressedTextureFormats:()=>qh,getSupportedGlCompressedTextureFormats:()=>jh,getSupportedTextureFormats:()=>Ti,getTemporaryCanvasFromImage:()=>Fm,getTestContext:()=>Wa,getTextureBatchBindGroup:()=>Es,getTextureDefaultMatrix:()=>EM,getTextureFormatFromKTXTexture:()=>qw,getUboData:()=>sx,getUniformData:()=>nx,getUrlExtension:()=>yy,glFormatToGPUFormat:()=>e_,glUploadBufferImageResource:()=>px,glUploadCompressedTextureResource:()=>mx,glUploadImageResource:()=>el,glUploadVideoResource:()=>xx,globalUniformsBit:()=>Cp,globalUniformsBitGl:()=>Pp,globalUniformsUBOBitGl:()=>pC,gpuFormatToBasisTranscoderFormat:()=>Dw,gpuFormatToKTXBasisTranscoderFormat:()=>Zw,gpuUploadBufferImageResource:()=>Ug,gpuUploadCompressedTextureResource:()=>Ng,gpuUploadImageResource:()=>Xu,gpuUploadVideoResource:()=>Vg,groupD8:()=>ae,hasCachedCanvasTexture:()=>KP,hslWgsl:()=>fB,hslgl:()=>$s,hslgpu:()=>js,injectBits:()=>Bc,insertVersion:()=>dp,isMobile:()=>Df,isPow2:()=>lc,isRenderingToScreen:()=>Fg,isSafari:()=>wm,isSingleItem:()=>Ni,isWebGLSupported:()=>bi,isWebGPUSupported:()=>yi,ktxTranscoderUrls:()=>xl,loadBasis:()=>Bw,loadBasisOnWorker:()=>$x,loadBitmapFont:()=>Ax,loadDDS:()=>Ow,loadEnvironmentExtensions:()=>Sh,loadFontAsBase64:()=>km,loadFontCSS:()=>Qc,loadImageBitmap:()=>XS,loadJson:()=>kx,loadKTX:()=>Fw,loadKTX2:()=>Vw,loadKTX2onWorker:()=>Jx,loadSVGImage:()=>Gm,loadSvg:()=>Fx,loadTextures:()=>ll,loadTxt:()=>Ox,loadVideoTextures:()=>Ux,loadWebFont:()=>Lx,localUniformBit:()=>qi,localUniformBitGl:()=>Xs,localUniformBitGroup2:()=>Nm,localUniformMSDFBit:()=>ym,localUniformMSDFBitGl:()=>vm,log2:()=>SA,logDebugTexture:()=>FM,logProgramError:()=>ox,logRenderGroupScene:()=>h1,logScene:()=>c1,mSDFBit:()=>Tm,mSDFBitGl:()=>Sm,mapFormatToGlFormat:()=>yx,mapFormatToGlInternalFormat:()=>vx,mapFormatToGlType:()=>Tx,mapGlToVertexFormat:()=>tx,mapSize:()=>BB,mapType:()=>Lh,mapWebGLBlendModesToPixi:()=>dx,maskFrag:()=>dg,maskVert:()=>fg,maskWgsl:()=>Ph,matrixPool:()=>Qe,measureHtmlText:()=>Cu,measureMixin:()=>vf,migrateFragmentFromV7toV8:()=>PB,mipmapScaleModeToGlFilter:()=>_x,mixHexColors:()=>ZB,multiplyColors:()=>cs,multiplyHexColors:()=>Ia,nextPow2:()=>Xr,noiseFrag:()=>C_,noiseWgsl:()=>bd,nonCompressedFormats:()=>JS,normalizeExtensionPriority:()=>Pa,nssvg:()=>Bm,nsxhtml:()=>Mm,onRenderMixin:()=>Tf,parseDDS:()=>Zx,parseFunctionBody:()=>zB,parseKTX:()=>Qx,particleData:()=>Ad,particlesFrag:()=>Qp,particlesVert:()=>Jp,particlesWgsl:()=>Nc,path:()=>Le,pointInTriangle:()=>yd,preloadVideo:()=>$S,removeItems:()=>Ba,removeStructAndGroupDuplicates:()=>_p,resetUids:()=>xA,resolveCharacters:()=>Su,resolveCompressedTextureUrl:()=>Jw,resolveJsonUrl:()=>Hx,resolveTextureUrl:()=>cl,resourceToTexture:()=>My,roundPixelsBit:()=>Pr,roundPixelsBitGl:()=>wr,roundedShapeArc:()=>dm,roundedShapeQuadraticCurve:()=>fm,sayHello:()=>gg,scaleModeToGlFilter:()=>Fh,setBasisTranscoderPath:()=>Pw,setKTXTranscoderPath:()=>Nw,setPositions:()=>Wm,setProgramName:()=>fp,setUvs:()=>Xm,shapeBuilders:()=>ou,sortMixin:()=>Sf,spritesheetAsset:()=>Xf,squaredDistanceToLineSegment:()=>Fs,stripVersion:()=>pp,testImageFormat:()=>sl,testVideoFormat:()=>rn,textStyleToCSS:()=>Im,textureBit:()=>rg,textureBitGl:()=>ig,textureFrom:()=>Ry,tilingBit:()=>Hm,tilingBitGl:()=>Vm,toFillStyle:()=>Jr,toLocalGlobalMixin:()=>Ef,toStrokeStyle:()=>Us,transformVertices:()=>Xn,triangulateWithHoles:()=>ru,uboSyncFunctionsSTD40:()=>Bh,uboSyncFunctionsWGSL:()=>Mg,uid:()=>ne,uniformParsers:()=>ii,unpremultiplyAlpha:()=>uw,unsafeEvalSupported:()=>Bu,updateLocalTransform:()=>JB,updateQuadBounds:()=>Ha,updateRenderGroupTransform:()=>yT,updateRenderGroupTransforms:()=>Ah,updateTextBounds:()=>Jn,updateTransformAndChildren:()=>ug,updateTransformBackwards:()=>Ra,updateWorldTransform:()=>tM,v8_0_0:()=>W,v8_3_4:()=>of,validFormats:()=>_l,validateRenderables:()=>lg,vertexGPUTemplate:()=>Tp,vertexGlTemplate:()=>Ep,viewportFromFrame:()=>LB,vkFormatToGPUFormat:()=>t_,warn:()=>U,webworkerExt:()=>uT,wrapModeToGlAddress:()=>tl});var HM,xe=d(()=>{cP();dP();P();P();Qf();Yf();ay();uy();mP();gP();xP();_P();bP();yP();vP();TP();SP();EP();AP();CP();PP();wP();BP();MP();RP();IP();DP();kP();OP();gw();ly();hy();Sw();wS();fi();BS();MS();RS();IS();DS();kS();OS();Px();Wh();LS();lr();FS();GS();NS();HS();Gx();qS();Ki();zS();KS();Nx();_s();sn();fr();Na();zf();by();xc();ct();Aw();Mw();Iw();kw();eE();tE();rE();Lw();iE();Gw();oE();nE();Ww();Yw();jw();Kw();cE();Qw();aE();hE();uE();t3();dE();pE();r3();kb();Re();pT();_y();J3();py();Nf();Ff();dc();xy();pc();Gf();Uf();cT();hT();dT();pB();ME();RE();OE();GE();UE();pd();NE();HE();VE();WE();zE();PT();wT();BT();Ze();eh();th();iB();oB();FE();m_();IE();kE();DE();LE();aB();uB();dB();xi();nc();iT();nT();MT();wf();fe();nf();Da();sm();An();Zt();XE();sv();nv();ov();st();av();mB();YE();KE();bB();JE();w2();Dy();Ss();vB();SB();Tc();xT();Fy();CT();Ny();Oy();Mp();_0();Vi();h0();s0();o0();a0();u0();AB();l0();d0();Ka();Za();f0();ao();Wi();sg();Sy();IT();Ey();DT();Ub();CB();Ay();kT();yc();vc();vS();B2();M2();R2();fo();D2();L2();O2();G2();U2();N2();X2();H2();z2();Y2();$2();j2();Rc();er();q2();iS();oS();wB();K2();Jg();kg();Q2();rS();Vy();ep();J2();eS();tS();MB();rx();Wy();zy();Xy();Yy();$y();jg();W2();V2();nS();sS();lS();aS();zg();cS();bS();hS();dS();gx();fS();mS();ZS();gS();xS();_S();pS();lw();yS();e2();t2();IB();l2();r2();i2();s2();n2();u2();c2();h2();d2();p2();m2();g2();Hi();cr();x2();Pg();a2();Zy();Qy();o2();e0();t0();r0();_2();b2();Og();E2();y2();v2();Hg();T2();QS();S2();A2();LT();FT();pi();Mh();Kr();ip();NT();VT();OB();Cs();Rp();Gy();Ps();Uy();Ip();Af();WT();f2();vg();Gg();FB();zT();Jy();Br();g0();Ag();Je();Bg();x0();Rg();wg();YT();As();Xa();dr();Mu();Eg();Jm();to();NB();qT();HT();Bf();Hn();hl();Vn();pt();Zf();he();ZT();Mf();Yr();Cf();HB();WB();Tg();Xx();fl();Iy();ja();XB();JT();hr();X0();Y0();$0();Et();$B();Cn();ac();sT();ls();Lb();Fb();Gb();Nb();Hb();Vb();yf();Yb();$b();jb();qb();Qt();_T();jB();Qb();bT();ST();Rf();Xb();ag();KB();Pn();og();QB();_f();xf();eM();vT();rM();TT();C2();jn();mT();Dp();am();hv();lm();dv();mv();Lp();y0();v0();$p();jp();qp();vC();Vc();Wc();bm();io();Fc();F0();Yc();gv();xv();_v();iv();P0();sM();mm();b0();Yp();uM();mM();s1();r1();i1();gM();Jc();TM();SM();n1();P2();gT();Gc();AM();ua();ji();U0();H0();K0();q0();Z0();wM();z0();RM();em();a1();j0();V0();W0();$E();$m();kM();tT();Xv();jv();qE();Jv();Zv();qv();Kv();Qv();hu();bs();ET();Em();ES();AS();CS();PS();SS();Kc();ZE();Rv();Bv();Cm();Am();QE();Dv();Rm();Zc();Wv();Lv();Uv();Nv();Hv();Fv();Gv();Vv();Um();Ov();vd();jc();J0();Tv();$c();_m();wv();Ev();Av();R_();Xi();LM();gm();xm();tm();di();vy();Ty();On();gs();cy();qf();ny();kv();Ru();Iu();Qm();ev();cg();Dt();$T();lf();ft();$f();rp();hg();ye();GM();UM();ve();Zb();jE();zh();xs();af();kt();XT();HM=us(C0());H.add(aT,uT);});var PR=yr((Tb,CR)=>{(function(r,e){typeof Tb=="object"?CR.exports=Tb=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(Tb,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 Cb=="function")try{i=Cb("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 x(){}return function(y){var E;return x.prototype=y,E=new x,x.prototype=null,E}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(x){var y=n(this);return x&&y.mixIn(x),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var y in x)x.hasOwnProperty(y)&&(this[y]=x[y]);x.hasOwnProperty("toString")&&(this.toString=x.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(x,y){x=this.words=x||[],y!=t?this.sigBytes=y:this.sigBytes=x.length*4;},toString:function(x){return (x||h).stringify(this)},concat:function(x){var y=this.words,E=x.words,S=this.sigBytes,D=x.sigBytes;if(this.clamp(),S%4)for(var v=0;v<D;v++){var T=E[v>>>2]>>>24-v%4*8&255;y[S+v>>>2]|=T<<24-(S+v)%4*8;}else for(var A=0;A<D;A+=4)y[S+A>>>2]=E[A>>>2];return this.sigBytes+=D,this},clamp:function(){var x=this.words,y=this.sigBytes;x[y>>>2]&=4294967295<<32-y%4*8,x.length=e.ceil(y/4);},clone:function(){var x=u.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var y=[],E=0;E<x;E+=4)y.push(s());return new l.init(y,x)}}),c=o.enc={},h=c.Hex={stringify:function(x){for(var y=x.words,E=x.sigBytes,S=[],D=0;D<E;D++){var v=y[D>>>2]>>>24-D%4*8&255;S.push((v>>>4).toString(16)),S.push((v&15).toString(16));}return S.join("")},parse:function(x){for(var y=x.length,E=[],S=0;S<y;S+=2)E[S>>>3]|=parseInt(x.substr(S,2),16)<<24-S%8*4;return new l.init(E,y/2)}},f=c.Latin1={stringify:function(x){for(var y=x.words,E=x.sigBytes,S=[],D=0;D<E;D++){var v=y[D>>>2]>>>24-D%4*8&255;S.push(String.fromCharCode(v));}return S.join("")},parse:function(x){for(var y=x.length,E=[],S=0;S<y;S++)E[S>>>2]|=(x.charCodeAt(S)&255)<<24-S%4*8;return new l.init(E,y)}},p=c.Utf8={stringify:function(x){try{return decodeURIComponent(escape(f.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return f.parse(unescape(encodeURIComponent(x)))}},g=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(x){typeof x=="string"&&(x=p.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes;},_process:function(x){var y,E=this._data,S=E.words,D=E.sigBytes,v=this.blockSize,T=v*4,A=D/T;x?A=e.ceil(A):A=e.max((A|0)-this._minBufferSize,0);var w=A*v,B=e.min(w*4,D);if(w){for(var R=0;R<w;R+=v)this._doProcessBlock(S,R);y=S.splice(0,w),E.sigBytes-=B;}return new l.init(y,B)},clone:function(){var x=u.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});a.Hasher=g.extend({cfg:u.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset();},reset:function(){g.reset.call(this),this._doReset();},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(x){return function(y,E){return new x.init(E).finalize(y)}},_createHmacHelper:function(x){return function(y,E){return new _.HMAC.init(x,E).finalize(y)}}});var _=o.algo={};return o}(Math);return r});});var j1=yr((Sb,wR)=>{(function(r,e){typeof Sb=="object"?wR.exports=Sb=e(PR()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(Sb,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],f=c[1],p=c[2],g=c[3],b=c[4],_=0;_<80;_++){if(_<16)o[_]=u[l+_]|0;else {var x=o[_-3]^o[_-8]^o[_-14]^o[_-16];o[_]=x<<1|x>>>31;}var y=(h<<5|h>>>27)+b+o[_];_<20?y+=(f&p|~f&g)+1518500249:_<40?y+=(f^p^g)+1859775393:_<60?y+=(f&p|f&g|p&g)-1894007588:y+=(f^p^g)-899497514,b=g,g=p,p=f<<30|f>>>2,f=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+f|0,c[2]=c[2]+p|0,c[3]=c[3]+g|0,c[4]=c[4]+b|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});});var OR=yr((q1,kR)=>{(function(r,e){var t=e(r);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return t});else if(typeof q1=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))kR.exports=t;else {var i=r.DeepDiff;t.noConflict=function(){return r.DeepDiff===t&&(r.DeepDiff=i),t},r.DeepDiff=t;}})(q1,function(r){var e=["N","E","A","D"];function t(v,T){v.super_=T,v.prototype=Object.create(T.prototype,{constructor:{value:v,enumerable:false,writable:true,configurable:true}});}function i(v,T){Object.defineProperty(this,"kind",{value:v,enumerable:true}),T&&T.length&&Object.defineProperty(this,"path",{value:T,enumerable:true});}function s(v,T,A){s.super_.call(this,"E",v),Object.defineProperty(this,"lhs",{value:T,enumerable:true}),Object.defineProperty(this,"rhs",{value:A,enumerable:true});}t(s,i);function n(v,T){n.super_.call(this,"N",v),Object.defineProperty(this,"rhs",{value:T,enumerable:true});}t(n,i);function o(v,T){o.super_.call(this,"D",v),Object.defineProperty(this,"lhs",{value:T,enumerable:true});}t(o,i);function a(v,T,A){a.super_.call(this,"A",v),Object.defineProperty(this,"index",{value:T,enumerable:true}),Object.defineProperty(this,"item",{value:A,enumerable:true});}t(a,i);function u(v,T,A){var w=v.slice((T)+1||v.length);return v.length=T<0?v.length+T:T,v.push.apply(v,w),v}function l(v){var T=typeof v;return T!=="object"?T:v===Math?"math":v===null?"null":Array.isArray(v)?"array":Object.prototype.toString.call(v)==="[object Date]"?"date":typeof v.toString=="function"&&/^\/.*\//.test(v.toString())?"regexp":"object"}function c(v){var T=0;if(v.length===0)return T;for(var A=0;A<v.length;A++){var w=v.charCodeAt(A);T=(T<<5)-T+w,T=T&T;}return T}function h(v){var T=0,A=l(v);if(A==="array"){v.forEach(function(ue){T+=h(ue);});var w="[type: array, hash: "+T+"]";return T+c(w)}if(A==="object"){for(var B in v)if(v.hasOwnProperty(B)){var R="[ type: object, key: "+B+", value hash: "+h(v[B])+"]";T+=c(R);}return T}var F="[ type: "+A+" ; value: "+v+"]";return T+c(F)}function f(v,T,A,w,B,R,F,ue){A=A||[],B=B||[],F=F||[];var de=B.slice(0);if(typeof R<"u"&&R!==null){if(w){if(typeof w=="function"&&w(de,R))return;if(typeof w=="object"){if(w.prefilter&&w.prefilter(de,R))return;if(w.normalize){var br=w.normalize(de,R,v,T);br&&(v=br[0],T=br[1]);}}}de.push(R);}l(v)==="regexp"&&l(T)==="regexp"&&(v=v.toString(),T=T.toString());var V=typeof v,$=typeof T,Ge,be,it,Hr,os=V!=="undefined"||F&&F.length>0&&F[F.length-1].lhs&&Object.getOwnPropertyDescriptor(F[F.length-1].lhs,R),as=$!=="undefined"||F&&F.length>0&&F[F.length-1].rhs&&Object.getOwnPropertyDescriptor(F[F.length-1].rhs,R);if(!os&&as)A.push(new n(de,T));else if(!as&&os)A.push(new o(de,v));else if(l(v)!==l(T))A.push(new s(de,v,T));else if(l(v)==="date"&&v-T!==0)A.push(new s(de,v,T));else if(V==="object"&&v!==null&&T!==null){for(Ge=F.length-1;Ge>-1;--Ge)if(F[Ge].lhs===v){Hr=true;break}if(Hr)v!==T&&A.push(new s(de,v,T));else {if(F.push({lhs:v,rhs:T}),Array.isArray(v)){for(ue&&(v.sort(function(ki,Ca){return h(ki)-h(Ca)}),T.sort(function(ki,Ca){return h(ki)-h(Ca)})),Ge=T.length-1,be=v.length-1;Ge>be;)A.push(new a(de,Ge,new n(undefined,T[Ge--])));for(;be>Ge;)A.push(new a(de,be,new o(undefined,v[be--])));for(;Ge>=0;--Ge)f(v[Ge],T[Ge],A,w,de,Ge,F,ue);}else {var Jl=Object.keys(v),Di=Object.keys(T);for(Ge=0;Ge<Jl.length;++Ge)it=Jl[Ge],Hr=Di.indexOf(it),Hr>=0?(f(v[it],T[it],A,w,de,it,F,ue),Di[Hr]=null):f(v[it],undefined,A,w,de,it,F,ue);for(Ge=0;Ge<Di.length;++Ge)it=Di[Ge],it&&f(undefined,T[it],A,w,de,it,F,ue);}F.length=F.length-1;}}else v!==T&&(V==="number"&&isNaN(v)&&isNaN(T)||A.push(new s(de,v,T)));}function p(v,T,A,w,B){var R=[];if(f(v,T,R,w,null,null,null,B),A)for(var F=0;F<R.length;++F)A(R[F]);return R}function g(v,T,A,w,B,R,F){return f(v,T,A,w,B,R,F,true)}function b(v,T,A,w){var B=w?function(F){F&&w.push(F);}:undefined,R=p(v,T,B,A);return w||(R.length?R:undefined)}function _(v,T,A,w){var B=w?function(F){F&&w.push(F);}:undefined,R=p(v,T,B,A,true);return w||(R.length?R:undefined)}function x(v,T,A){if(A.path&&A.path.length){var w=v[T],B,R=A.path.length-1;for(B=0;B<R;B++)w=w[A.path[B]];switch(A.kind){case "A":x(w[A.path[B]],A.index,A.item);break;case "D":delete w[A.path[B]];break;case "E":case "N":w[A.path[B]]=A.rhs;break}}else switch(A.kind){case "A":x(v[T],A.index,A.item);break;case "D":v=u(v,T);break;case "E":case "N":v[T]=A.rhs;break}return v}function y(v,T,A){if(typeof A>"u"&&T&&~e.indexOf(T.kind)&&(A=T),v&&A&&A.kind){for(var w=v,B=-1,R=A.path?A.path.length-1:0;++B<R;)typeof w[A.path[B]]>"u"&&(w[A.path[B]]=typeof A.path[B+1]<"u"&&typeof A.path[B+1]=="number"?[]:{}),w=w[A.path[B]];switch(A.kind){case "A":A.path&&typeof w[A.path[B]]>"u"&&(w[A.path[B]]=[]),x(A.path?w[A.path[B]]:w,A.index,A.item);break;case "D":delete w[A.path[B]];break;case "E":case "N":w[A.path[B]]=A.rhs;break}}}function E(v,T,A){if(A.path&&A.path.length){var w=v[T],B,R=A.path.length-1;for(B=0;B<R;B++)w=w[A.path[B]];switch(A.kind){case "A":E(w[A.path[B]],A.index,A.item);break;case "D":w[A.path[B]]=A.lhs;break;case "E":w[A.path[B]]=A.lhs;break;case "N":delete w[A.path[B]];break}}else switch(A.kind){case "A":E(v[T],A.index,A.item);break;case "D":v[T]=A.lhs;break;case "E":v[T]=A.lhs;break;case "N":v=u(v,T);break}return v}function S(v,T,A){if(v&&T&&A&&A.kind){var w=v,B,R;for(R=A.path.length-1,B=0;B<R;B++)typeof w[A.path[B]]>"u"&&(w[A.path[B]]={}),w=w[A.path[B]];switch(A.kind){case "A":E(w[A.path[B]],A.index,A.item);break;case "D":w[A.path[B]]=A.lhs;break;case "E":w[A.path[B]]=A.lhs;break;case "N":delete w[A.path[B]];break}}}function D(v,T,A){if(v&&T){var w=function(B){(!A||A(v,T,B))&&y(v,T,B);};p(v,T,w);}}return Object.defineProperties(b,{diff:{value:b,enumerable:true},orderIndependentDiff:{value:_,enumerable:true},observableDiff:{value:p,enumerable:true},orderIndependentObservableDiff:{value:g,enumerable:true},orderIndepHash:{value:h,enumerable:true},applyDiff:{value:D,enumerable:true},applyChange:{value:y,enumerable:true},revertChange:{value:S,enumerable:true},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:true}}),b.DeepDiff=b,r&&(r.DeepDiff=b),b});});var S1={};li(S1,{CanvasManagerStatic:()=>I,GameStepManager:()=>Ea,GameStorageManager:()=>Aa,GameWindowManager:()=>Sa,NarrationManagerStatic:()=>G,SoundManagerStatic:()=>re,StorageManagerStatic:()=>Be,canvas:()=>C,narration:()=>N,sound:()=>St,storage:()=>O});xe();var T1={};li(T1,{CanvasBase:()=>Zl,CanvasBaseItem:()=>Zl,CanvasContainer:()=>Ur,CanvasEvent:()=>Xd,CanvasImage:()=>ee,CanvasSprite:()=>Bt,CanvasText:()=>ar,CanvasVideo:()=>Tt,CharacterBaseModel:()=>Yd,CharacterStoredClass:()=>Ta,ChoiceMenuOption:()=>Te,ChoiceMenuOptionClose:()=>ns,Container:()=>Ur,Dialogue:()=>ui,DialogueBaseModel:()=>ui,ImageContainer:()=>we,ImageSprite:()=>ee,Label:()=>ie,LabelAbstract:()=>ya,Sound:()=>yn,Sprite:()=>Bt,StoredClassModel:()=>va,Text:()=>ar,VideoSprite:()=>Tt});xe();var Fe={};li(Fe,{DistortionFilter:()=>V_,EqualizerFilter:()=>Gr,Filter:()=>ht,MonoFilter:()=>W_,ReverbFilter:()=>z_,StereoFilter:()=>X_,StreamFilter:()=>Y_,TelephoneFilter:()=>$_});var VM;function WM(r){return VM=r,r}function Ce(){return VM}var ht=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 V_=class extends ht{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 ut=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 Pe=class extends ht{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:Pe.F32,type:"lowshelf",gain:r},{f:Pe.F64,type:"peaking",gain:e},{f:Pe.F125,type:"peaking",gain:t},{f:Pe.F250,type:"peaking",gain:i},{f:Pe.F500,type:"peaking",gain:s},{f:Pe.F1K,type:"peaking",gain:n},{f:Pe.F2K,type:"peaking",gain:o},{f:Pe.F4K,type:"peaking",gain:a},{f:Pe.F8K,type:"peaking",gain:u},{f:Pe.F16K,type:"highshelf",gain:l}];Ce().useLegacy||(c=h.map(f=>{let p=Ce().context.audioContext.createBiquadFilter();return p.type=f.type,ut.setParamValue(p.Q,1),p.frequency.value=f.f,ut.setParamValue(p.gain,f.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let f=0;f<this.bands.length;f++){let p=this.bands[f];f>0&&this.bands[f-1].connect(p),this.bandsMap[p.frequency.value]=p;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);ut.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(Pe.F32,r);}get f32(){return this.getGain(Pe.F32)}set f64(r){this.setGain(Pe.F64,r);}get f64(){return this.getGain(Pe.F64)}set f125(r){this.setGain(Pe.F125,r);}get f125(){return this.getGain(Pe.F125)}set f250(r){this.setGain(Pe.F250,r);}get f250(){return this.getGain(Pe.F250)}set f500(r){this.setGain(Pe.F500,r);}get f500(){return this.getGain(Pe.F500)}set f1k(r){this.setGain(Pe.F1K,r);}get f1k(){return this.getGain(Pe.F1K)}set f2k(r){this.setGain(Pe.F2K,r);}get f2k(){return this.getGain(Pe.F2K)}set f4k(r){this.setGain(Pe.F4K,r);}get f4k(){return this.getGain(Pe.F4K)}set f8k(r){this.setGain(Pe.F8K,r);}get f8k(){return this.getGain(Pe.F8K)}set f16k(r){this.setGain(Pe.F16K,r);}get f16k(){return this.getGain(Pe.F16K)}reset(){this.bands.forEach(r=>{ut.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},Gr=Pe;Gr.F32=32;Gr.F64=64;Gr.F125=125;Gr.F250=250;Gr.F500=500;Gr.F1K=1e3;Gr.F2K=2e3;Gr.F4K=4e3;Gr.F8K=8e3;Gr.F16K=16e3;var W_=class extends ht{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 z_=class extends ht{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 X_=class extends ht{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?ut.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 Y_=class extends ht{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 $_=class extends ht{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",ut.setParamValue(s.frequency,2e3),n.type="lowpass",ut.setParamValue(n.frequency,2e3),o.type="highpass",ut.setParamValue(o.frequency,500),a.type="highpass",ut.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};xe();var Cd=class extends le{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();}};xe();var iL=0,d1=class extends le{constructor(r){super(),this.id=iL++,this.init(r);}set(r,e){if(this[r]===undefined)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-d1.PADDING),this._end=Math.min(this._end+d1.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),Ae.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(){Ae.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){Ae.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}]`}},j_=d1;j_.PADDING=.1;xe();var Pd=class extends le{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new j_(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();}};xe();var wd=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 la=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],f1=["audio/mpeg","audio/ogg"],ca={};function zM(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$/;la.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(ca,i);}zM();xe();xe();var nL=0,Bd=class extends le{constructor(e){super(),this.id=nL++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===undefined)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);ut.setParamValue(this._gain.gain,n*s*i),ut.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){Ae.shared.remove(this._updateListener,this),e&&Ae.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 ha=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 XM=class extends ha{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(XM.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,ut.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}},q_=XM;q_.BUFFER_SIZE=0;var da=class{init(e){this.parent=e,this._nodes=new q_(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 Bd(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 z.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 Fl=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 Pd:new da;return new Fl(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:Le.extname(t).slice(1)})).filter(({ext:t})=>ca[t]).sort((t,i)=>la.indexOf(t.ext)-la.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 wd(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!==undefined&&(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(Fl._pool.length>0){let r=Fl._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Fl._pool.indexOf(r)<0&&Fl._pool.push(r);}},pr=Fl;pr._pool=[];xe();var Gl=class r extends ha{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 le,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 Ul=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new Gl),this._htmlAudioContext=new Cd,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 Gl.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 pr)return this._sounds[e]=t,t;let i=this._getOptions(t),s=pr.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!==undefined&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==undefined&&(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}};xe();xe();var YM=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=Le.basename(e,Le.extname(e))),t},$M={extension:m.Asset,detection:{test:async()=>true,add:async r=>[...r,...la.filter(e=>ca[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[m.LoadParser],priority:Oe.High},test(r){let e=Le.extname(r).slice(1);return !!ca[e]||f1.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>pr.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Ce().add(YM(e),t),t},async unload(r,e){Ce().remove(YM(e));}}};H.add($M);var _e=WM(new Ul);var Md="0.10.10";var qt="repeat";function es(r){return {type:"pause",duration:r}}var Rd={DistortionFilter:Fe.DistortionFilter,EqualizerFilter:Fe.EqualizerFilter,MonoFilter:Fe.MonoFilter,ReverbFilter:Fe.ReverbFilter,StereoFilter:Fe.StereoFilter,StreamFilter:Fe.StreamFilter,TelephoneFilter:Fe.TelephoneFilter},jM=["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"],Wt="__game_layer__",fa="Container",Id="ImageContainer",K_="Image",pa="Sprite",ma="Text",Z_="Video";xe();var v1={};li(v1,{addImage:()=>Nr,addImageCointainer:()=>_a,addVideo:()=>Gd,clearAllGameDatas:()=>SR,clearChoiceMenuOptions:()=>yR,clearDialogue:()=>xR,createExportableElement:()=>Se,getChoiceMenuOptions:()=>bR,getDialogue:()=>gR,getFlag:()=>TR,getSaveData:()=>z1,getSaveJson:()=>ER,getTexture:()=>oi,loadImage:()=>sR,loadSaveData:()=>X1,loadSaveJson:()=>AR,loadVideo:()=>nR,moveIn:()=>dn,moveOut:()=>ss,pushIn:()=>mn,pushOut:()=>gn,removeWithDissolve:()=>hn,removeWithDissolveTransition:()=>hn,removeWithFade:()=>Nd,removeWithFadeTransition:()=>Nd,setChoiceMenuOptions:()=>_R,setDialogue:()=>mR,setFlag:()=>vR,shakeEffect:()=>Hd,showImage:()=>Kl,showImageContainer:()=>iR,showVideo:()=>oR,showWithDissolve:()=>ai,showWithDissolveTransition:()=>ai,showWithFade:()=>ba,showWithFadeTransition:()=>ba,zoomIn:()=>fn,zoomOut:()=>pn});var y1={};li(y1,{FadeAlphaTicker:()=>lt,MoveTicker:()=>ze,RotateTicker:()=>vt,TickerBase:()=>Mt,ZoomTicker:()=>Rt});xe();var b1={};li(b1,{canvasComponentDecorator:()=>Nl,canvasElementDecorator:()=>Nl,eventDecorator:()=>m1,getAllCharacters:()=>qM,getCharacterById:()=>eb,getLabelById:()=>_r,newLabel:()=>fR,saveCharacter:()=>p1,saveLabel:()=>pR,tickerDecorator:()=>xr});var Q_={};function Nl(r){return function(e){Q_[r]&&console.warn(`[Pixi\u2019VN] CanvasElement ${r} already registered`),e.prototype.pixivnId=r,Q_[r]=e;}}var J_={___pixivn_juliette___:{id:"___pixivn_juliette___",name:"Juliette",age:25,icon:"https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media",color:"#ac0086"}};function p1(r){if(Array.isArray(r)){r.forEach(e=>p1(e));return}J_[r.id]&&console.info(`[Pixi\u2019VN] Character id ${r.id} already exists, it will be overwritten`),J_[r.id]=r;}function eb(r){try{let e=J_[r];if(!e){console.error(`[Pixi\u2019VN] Character ${r} not found`);return}return e}catch(e){console.error(`[Pixi\u2019VN] Error while getting Character ${r}`,e);return}}function qM(){return Object.values(J_)}var tb={};function m1(r){return function(e){r||(r=e.name),tb[r]&&console.info(`[Pixi\u2019VN] Event ${r} already exists, it will be overwritten`),e.prototype.id=r,tb[r]=e;}}function rb(r){try{let e=tb[r];if(!e){console.error(`[Pixi\u2019VN] Event ${r} not found`);return}return new e,e}catch(e){console.error(`[Pixi\u2019VN] Error while getting Event ${r}`,e);return}}function ib(r){try{let e=tb[r];if(!e){console.error(`[Pixi\u2019VN] Event ${r} not found`);return}return new e}catch(e){console.error(`[Pixi\u2019VN] Error while getting Event ${r}`,e);return}}var _1={};li(_1,{juliette:()=>Z,pixivnTestStartLabel:()=>_b});var Z="___pixivn_juliette___",Kt="https://pixijs.com/assets/eggHead.png",yt='<span style="color:purple">Egg Head</span>',Ci="https://pixijs.com/assets/flowerTop.png",ni='<span style="color:green">Flower Top</span>',Pi="https://pixijs.com/assets/helmlok.png",mr='<span style="color:blue">Helmlok</span>',ts="https://pixijs.com/assets/skully.png",gr='<span style="color:red">Skully</span>',KM="https://pixijs.com/assets/bunny.png";var ZM="https://pixijs.com/assets/video.mp4";var g1="https://pixijs.io/sound/examples/resources/musical.mp3",sb="___pixi_vn_example_start_label___",nb="___pixi_vn_open_link___",Dd="___pixi_vn_restart_test_label___",Hl="___pixi_vn_base_canvas_element_label___",Vl="___pixi_vn_custom_ticker_canvas_element_test___",Wl="___pixi_vn_images_animations_test___",zl="___pixi_vn_input_test___",Xl="___pixi_vn_markdown_test___",Yl="___pixi_vn_sound_test___",$l="___pixi_vn_step_label_test___",jl="___pixi_vn_video_test___",ob="___pixi_vn_images_dissolve_test___",ab="___pixi_vn_images_fade_test___",ub="___pixi_vn_images_rotate_test___",lb="___pixi_vn_images_move_test___",cb="___pixi_vn_images_zoom_test___",hb="___pixi_vn_images_move_in_out_test___",db="___pixi_vn_images_zoom_in_out_test___",fb="___pixi_vn_images_push_in_out_test___",pb="___pixi_vn_images_add_same_tag_test___",mb="___pixi_vn_images_shake_stage_test___",gb="___pixi_vn_image_container_test___",xb="___pixi_vn_images_custom_position_test___";var _b=new ie(sb,[()=>{let r="",e=new Date().getHours();e>=5&&e<12?r="morning\u{1F505}":e>=12&&e<18?r="afternoon\u{1F506}":e>=18&&e<22?r="evening\u26C5":r="night\u{1F319}";let t=eb(Z);N.dialogue={character:Z,text:`Good ${r}! I'm ${t.name}, your virtual assistant. I'm here to help you with your tests.`};},()=>N.dialogue={character:Z,text:`You are running the Pixi\u2019VN v${Md} test. This test will guide you through the different features of the library.`},r=>N.jumpLabel(x1,r)]),kd=new ie(nb,[async r=>{window.open(r.link),await N.goNext(r);}]),x1=new ie(Dd,[()=>{C.clear(),N.dialogue={character:Z,text:"Which test would you like to start with?"},N.choiceMenuOptions=[new Te("Open Pixi\u2019VN Wiki",kd,{link:"https://pixi-vn.web.app/"}),new Te("Open Pixi\u2019VN Discord",kd,{link:"https://discord.gg/E95FZWakzp"}),new Te("Open Pixi\u2019VN Github Issues",kd,{link:"https://github.com/DRincs-Productions/pixi-vn/issues"}),new Te("Images, Transitions and Animations Test",Wl,{}),new Te("Video Test",jl,{}),new Te("Sound Test",Yl,{}),new Te("Base Canvas Element Test",Hl,{}),new Te("Custom Ticker Canvas Element Test",Vl,{}),new Te("Steps and Labels Test",$l,{}),new Te("Markdown Test",Xl,{}),new Te("Input Test",zl,{})];},r=>N.jumpLabel(Dd,r)]);xe();var QM=new ie(Hl,[async()=>{let r=25;N.dialogue={character:Z,text:`Here's what's going to happen: I'm going to create ${r} bunnies (CanvasSprites) and put them in a Container.`};let e=new Ur;C.add("container",e);let t=await ke.load(KM);for(let i=0;i<r;i++){let s=new Bt(t);s.x=i%5*40,s.y=Math.floor(i/5)*40,e.addChild(s);}e.x=C.screen.width/2,e.y=C.screen.height/2,e.pivot.x=e.width/2,e.pivot.y=e.height/2,C.addTicker("container",new vt({speed:1}));},async()=>{C.remove("container"),N.dialogue={character:Z,text:`Here's what's going to happen: I'm going to create some Text with different styles and put them on the stage.
3311
+ But it will generate a warn message, because the FillGradient or FillPattern has not yet been supported by the Pixi\u2019VN ( you can see the status of the issue here: [#76](https://github.com/DRincs-Productions/pixi-vn/issues/76)).`};let r=new Ye({fill:"#ffffff"}),e=new ar({text:"Basic text in pixi",style:r});e.x=50,e.y=100,C.add("basicText",e);let t=new Dr(0,0,0,36*1.7*7),i=[16777215,65433].map(u=>j.shared.setValue(u).toNumber());i.forEach((u,l)=>{let c=l/i.length;t.addColorStop(c,u);});let s=new Ye({fontFamily:"Arial",fontSize:36,fontStyle:"italic",fontWeight:"bold",fill:{fill:t},stroke:{color:"#4a1850",width:5,join:"round"},dropShadow:{color:"#ff5f74",blur:4,angle:Math.PI/6,distance:6},wordWrap:true,wordWrapWidth:440}),n=new ar({text:"Rich text with a lot of options and across multiple lines",style:s});n.x=50,n.y=220,C.add("richText",n);let o=new Ye({fontFamily:"Arial",dropShadow:{alpha:.8,angle:2.1,blur:4,color:"0x111111",distance:10},fill:"#ffffff",stroke:{color:"#004620",width:12,join:"round"},fontSize:60,fontWeight:"lighter"}),a=new ar({text:"SKEW IS COOL",style:o});a.skew.set(.65,-0.3),a.anchor.set(.5,.5),a.x=300,a.y=480,C.add("skewText",a);}]);xe();xe();var ql="close";xe();({...T1,...y1,...b1,...v1,..._1,...S1});var cn=class extends Bt{get memory(){return {...super.memory,direction:this.direction,turningSpeed:this.turningSpeed,speed:this.speed}}set memory(e){super.memory=e,this.direction=e.direction,this.turningSpeed=e.turningSpeed,this.speed=e.speed;}direction=0;turningSpeed=0;speed=0;static from(e,t){let i=Bt.from(e,t),s=new cn;return s.texture=i.texture,s}};cn=Vr([Nl("___pixi_vn_custom_canvas_element___")],cn);var Od=class extends Mt{fn(e,t,i){i.forEach(s=>{let o=new q(-100,-100,C.screen.width+200,C.screen.height+200),a=C.find(s);a&&a instanceof cn&&(a.direction+=a.turningSpeed*.01,a.x+=Math.sin(a.direction)*a.speed,a.y+=Math.cos(a.direction)*a.speed,a.rotation=-a.direction-Math.PI/2,a.x<o.x?a.x+=o.width:a.x>o.x+o.width&&(a.x-=o.width),a.y<o.y?a.y+=o.height:a.y>o.y+o.height&&(a.y-=o.height));});}};Od=Vr([xr("___pixi_vn_custom_ticker___")],Od);var eR=new ie(Vl,[async()=>{for(let e=0;e<100;e++){let t=await ke.load(Kt),i=cn.from(t);i.anchor.set(.5),i.scale.set(.8+Math.random()*.3),i.x=Math.random()*C.screen.width,i.y=Math.random()*C.screen.height,i.tint=Math.random()*16777215,i.direction=Math.random()*Math.PI*2,i.turningSpeed=Math.random()-.8,i.speed=2+Math.random()*2,C.add("alien"+e,i);let s={};C.addTicker("alien"+e,new Od(s));}N.dialogue={character:Z,text:`This is a test of custom ticker and canvas element. In this test, we have created 100 ${yt} with random tint, scale, position, direction, turning speed, and speed. With the custom ticker, we are moving the custom canvas element in a random direction. (This example is from the official [PixiJS website](https://pixijs.com/8.x/examples/events/interactivity).)`};}]);xe();function rs(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(C.screen.width-t)+i+n*t+(s?t:0):e*(C.screen.height-t)+i+n*t+(s?t:0)}function wi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(C.screen.width-t):(e-i-n*t-(s?t:0))/(C.screen.height-t)}function is(r,e){return r==="width"?e*C.screen.width:e*C.screen.height}function Bi(r,e){return r==="width"?e/C.screen.width:e/C.screen.height}function rt(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*s-r.x*i,y:r.y*i-r.x*s}}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*s-r.x*i,y:-r.y*i-r.x*s}}return {x:0,y:0}}function E1(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 Mi(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 Ri(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))}xe();function A1(r,e){let t=r.source.label;return {url:t,alias:e===t?undefined:e}}function Ld(r){if(ke.cache.has(r)){let e=ke.get(r);e&&e instanceof M&&(r=e.source.label);}return !!r.match(new RegExp(`(${jM.join("|")})$`))}xe();function ga(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===undefined?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===undefined?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&(r.percentagePosition===undefined?(r.percentagePosition={x:r.xPercentagePosition},delete r.xPercentagePosition):(r.percentagePosition.x=r.xPercentagePosition,delete r.xPercentagePosition)),r.yPercentagePosition!=null&&(r.percentagePosition===undefined?(r.percentagePosition={y:r.yPercentagePosition},delete r.yPercentagePosition):(r.percentagePosition.y=r.yPercentagePosition,delete r.yPercentagePosition))),r)}xe();async function bb(r){let e=lL(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 lL(r){try{let e=Q_[r];if(e||(r===fa?e=Ur:r===Z_?e=Tt:r===K_?e=ee:r===pa?e=Bt:r===ma?e=ar:r===Id&&(e=we)),!e){console.error(`[Pixi\u2019VN] CanvasElement ${r} not found`);return}return new e}catch(e){console.error(`[Pixi\u2019VN] Error while getting CanvasElement ${r}`,e);return}}xe();xe();async function oi(r){if(r!=="EMPTY"){if(!r){console.error("[Pixi\u2019VN] Texture not found",r);return}if(ke.cache.has(r)){let e=ke.get(r);if(e)return e}return ke.load(r).then(e=>{if(!e){console.error("[Pixi\u2019VN] Texture not found",r);return}if(!(e instanceof M)){console.error("[Pixi\u2019VN] File not is a file",r);return}return e}).catch(e=>{console.error("[Pixi\u2019VN] Error loading file",e);})}}function tR(r,e){if(!(r instanceof Object))return r;console.warn(`[Pixi\u2019VN] Text.style.${e} is a FillGradient or FillPattern, this is not supported yet.`,r);}function rR(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:tR(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:tR(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}function C1(r){return "memory"in r?r.memory:r instanceof Fr?P1(r):r instanceof Me?Fd(r):xa(r)}function xa(r,e){let t=fa,i=e?.childrenExport||false;r.hasOwnProperty("pixivnId")&&(t=r.pixivnId);let s=[];return i&&r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).forEach(n=>{s.push(C1(n));}),{pixivnId:t,elements:s,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 Fd(r){let e=xa(r),t=e.pixivnId??pa,i={};"onEvents"in r&&(i=r.onEvents);let s;return "textureAlias"in r?s=A1(r.texture,r.textureAlias):s=A1(r.texture),{...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function P1(r){let e=xa(r),t=e.pixivnId??ma,i={};return "onEvents"in r&&(i=r.onEvents),{...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:rR(r.style),roundPixels:r.roundPixels,onEvents:i}}var Ur=class extends X{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||fa;}pixivnId=fa;get memory(){return xa(this,{childrenExport:true})}set memory(e){}async setMemory(e){return this.memory=e,await this.importChildren(e),await Ii(this,e)}async importChildren(e){for(let t=0;t<e.elements.length;t++){let i=e.elements[t],s=await bb(i);this.addChild(s);}}};async function Ii(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==undefined&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==undefined&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==undefined&&(r.tint=e.tint),"alpha"in e&&e.alpha!==undefined&&(r.alpha=e.alpha),"angle"in e&&e.angle!==undefined&&(r.angle=e.angle),"renderable"in e&&e.renderable!==undefined&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==undefined&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==undefined&&(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!==undefined&&(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!==undefined&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==undefined&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==undefined&&(r.visible=e.visible),"x"in e&&e.x!==undefined&&(r.x=e.x),"y"in e&&e.y!==undefined&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==undefined&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==undefined&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==undefined&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==undefined&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==undefined&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==undefined&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==undefined&&(r.width=e.width),"height"in e&&e.height!==undefined&&(r.height=e.height));}var we=class extends Ur{constructor(e,t=[]){e=ga(e);let i,s,n;e&&"anchor"in e&&e?.anchor!==undefined&&(n=e.anchor,delete e.anchor),e&&"align"in e&&e?.align!==undefined&&(i=e.align,delete e.align),e&&"percentagePosition"in e&&e?.percentagePosition!==undefined&&(s=e.percentagePosition,delete e.percentagePosition),super(e),e=ga(e),t&&t.forEach(o=>{let a;Ld(o)?a=new Tt(undefined,o):a=new ee(undefined,o),this.addChild(a);}),n&&(this.anchor=n),i&&(this.align=i),s&&(this.percentagePosition=s);}get memory(){return {...super.memory,pixivnId:Id,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(e){}async setMemory(e){this.memory=e,await this.importChildren(e),await w1(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=Id;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=Array(this.children.length);for(let t=0;t<this.children.length;t++)e[t]=this.children[t].load();return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(t=>{this._loadIsStarted=false,console.error("[Pixi\u2019VN] Error into ImageContainer.load()",t);})}get texture(){return this.children.length>0?this.children[0].texture:new M}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}_anchor;get anchor(){let e=super.pivot.x/this.width,t=super.pivot.y/this.height;return {x:e,y:t}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,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(e){this._anchor=undefined,super.pivot=e;}_align=undefined;set align(e){this._percentagePosition=undefined,this._align===undefined&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==undefined&&(this._align.x=e.x),e.y!==undefined&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=rt(this.pivot,this.angle),t=rt(this.scale,this.angle);return {x:wi("width",this.x,Mi(this),e.x,t.x<0,this.anchor.x),y:wi("height",this.y,Ri(this),e.y,t.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=undefined),this._align===undefined&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=rt(this.pivot,this.angle),t=rt(this.scale,this.angle);return wi("width",this.x,Mi(this),e.x,t.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=undefined),this._align===undefined&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=rt(this.pivot,this.angle),t=rt(this.scale,this.angle);return wi("height",this.y,Ri(this),e.y,t.y<0,this.anchor.y)}_percentagePosition=undefined;set percentagePosition(e){this._align=undefined,this._percentagePosition===undefined&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==undefined&&(this._percentagePosition.x=e.x),e.y!==undefined&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:Bi("width",this.x),y:Bi("height",this.y)}}set xPercentagePosition(e){this._align&&(this._align=undefined),this._percentagePosition===undefined&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get xPercentagePosition(){return Bi("width",this.x)}set yPercentagePosition(e){this._align&&(this._align=undefined),this._percentagePosition===undefined&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get yPercentagePosition(){return Bi("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(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=rt(this.pivot,this.angle),t=rt(this.scale,this.angle);this._align.x!==undefined&&(super.x=rs("width",this._align.x,Mi(this),e.x,t.x<0)),this._align.y!==undefined&&(super.y=rs("height",this._align.y,Ri(this),e.y,t.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==undefined&&(super.x=is("width",this._percentagePosition.x)),this._percentagePosition.y!==undefined&&(super.y=is("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=undefined,this._percentagePosition=undefined,super.position=e;}get x(){return super.x}set x(e){this._align=undefined,this._percentagePosition=undefined,super.x=e;}get y(){return super.y}set y(e){this._align=undefined,this._percentagePosition=undefined,super.y=e;}};async function w1(r,e,t){e=ga(e),Ii(r,e,{...t,end:async()=>{"anchor"in e&&e.anchor!==undefined&&(r.anchor=e.anchor),"align"in e&&e.align!==undefined&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==undefined&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}function _a(r,e,t){let i=new we(t,e);return C.add(r,i),i}async function iR(r,e,t){let i=new we(t,e);return await i.load(),C.add(r,i),i}xe();function Nr(r,e,t){if(!e)if(ke.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new ee(t,e);return C.add(r,i),i}async function sR(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=oi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function Kl(r,e,t){if(!e)if(ke.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new ee(t,e);return await i.load(),C.add(r,i),i}xe();function Gd(r,e,t){if(!e)if(ke.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Tt(t,e);return C.add(r,i),i}async function nR(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=oi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function oR(r,e,t){if(!e)if(ke.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Tt(t,e);return await i.load(),C.add(r,i),i}function Ud(r,e){if(typeof e=="string")return Ld(e)?Gd(r,e):Nr(r,e);if(Array.isArray(e))return _a(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Ld(e.value)?Gd(r,e.value,e.options):Nr(r,e.value,e.options);if(Array.isArray(e.value))return _a(r,e.value,e.options)}return C.add(r,e),e}async function ai(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(C.find(r)&&(a=r+"_temp_disolve",C.editAlias(r,a)),e=Ud(r,e),a&&C.copyCanvasElementProperty(a,r),a&&C.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=hn(a,t,i);c&&(o.push(...c),C.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new lt({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},undefined,i),l=C.addTicker(r,u);if(l&&(s&&C.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof ee||e instanceof we)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function hn(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:s=[]}=e;typeof r=="string"&&(r=[r]),typeof s=="string"&&(s=[s]),s.push(...r);let n=new lt({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},undefined,t),o=C.addTicker(r,n);if(o)return i&&C.completeTickerOnStepEnd({id:o}),[o]}async function ba(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!C.find(r))return ai(r,e,t,i);let a=r+"_temp_fade";C.editAlias(r,a),n.push(a),e=Ud(r,e),a&&C.copyCanvasElementProperty(a,r),a&&C.transferTickers(a,r,"duplicate"),e.alpha=0;let u=hn(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new lt({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},undefined,i),c=C.addTicker(r,l);if(c&&(s&&C.completeTickerOnStepEnd({id:c}),o.push(c),C.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof ee||e instanceof we)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function Nd(r,e={},t){return hn(r,e,t)}async function dn(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;C.find(r)&&(c=r+"_temp_movein",C.editAlias(r,c)),e=Ud(r,e),c&&C.copyCanvasElementProperty(c,r),c&&C.transferTickers(c,r,"move");let h;e instanceof ee||e instanceof we?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let f;switch(c&&(u?(f=ss(c,t,i),f&&(l.push(...f),o.push(c))):a.push(c)),(e instanceof ee||e instanceof we)&&e.haveEmptyTexture&&await e.load(),c&&C.pauseTicker(c,{tickerIdsIncluded:f}),s){case "up":e.y=C.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=C.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new ze({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},undefined,i),g=C.addTicker(r,p);if(g&&(C.pauseTicker(r,{tickerIdsExcluded:[g]}),n&&C.completeTickerOnStepEnd({id:g}),l.push(g)),l.length>0)return l}function ss(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=C.find(r);if(!o){console.warn("[Pixi\u2019VN] The canvas component is not found.");return}let a={x:o.x,y:o.y};switch(i){case "up":a.y=-o.height;break;case "down":a.y=C.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=C.canvasWidth+o.width;break}let u=new ze({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},undefined,t),l=C.addTicker(r,u);if(l)return C.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&C.completeTickerOnStepEnd({id:l}),[l]}async function fn(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=C.find(r);c&&(l=r+"_temp_zoom",C.editAlias(r,l)),e=Ud(r,e),l&&C.copyCanvasElementProperty(l,r),l&&C.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=C.canvasHeight-e.y,e.pivot.x=C.canvasWidth/2-e.x,e.y=C.canvasHeight,e.x=C.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=C.canvasWidth/2-e.x,e.y=0,e.x=C.canvasWidth/2):s=="left"?(e.pivot.x=C.canvasWidth-e.x,e.pivot.y=C.canvasHeight/2-e.y,e.x=C.canvasWidth,e.y=C.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=C.canvasHeight/2-e.y,e.x=0,e.y=C.canvasHeight/2),e.pivot=E1(e.pivot,e.angle),e.scale.set(0);let h=c?{pivot:{x:c.pivot.x,y:c.pivot.y},position:{x:c.x,y:c.y}}:undefined;if(l){if(t.removeOldComponentWithZoomOut){let g=pn(l,t,i);g&&(u.push(...g),o.push(l));}else a.push(l);C.pauseTicker(l);}o.push(r);let f=new Rt({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},undefined,i),p=C.addTicker(r,f);if(p&&(C.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&C.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof ee||e instanceof we)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function pn(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=C.find(r);if(!o){console.warn("[Pixi\u2019VN] The canvas component is not found.");return}i=="up"?(o.pivot.y=C.canvasHeight-o.y,o.pivot.x=C.canvasWidth/2-o.x,o.y=C.canvasHeight,o.x=C.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=C.canvasWidth/2-o.x,o.y=0,o.x=C.canvasWidth/2):i=="left"?(o.pivot.x=C.canvasWidth-o.x,o.pivot.y=C.canvasHeight/2-o.y,o.x=C.canvasWidth,o.y=C.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=C.canvasHeight/2-o.y,o.x=0,o.y=C.canvasHeight/2),o.pivot=E1(o.pivot,o.angle),o.scale.set(1);let a=new Rt({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},undefined,t),u=C.addTicker(r,a);if(u)return C.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&C.completeTickerOnStepEnd({id:u}),[u]}async function mn(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;C.find(r)&&(u=r+"_temp_push",C.editAlias(r,u)),e=Ud(r,e),u&&C.copyCanvasElementProperty(u,r),u&&C.transferTickers(u,r,"move");let l;if((e instanceof ee||e instanceof we)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-C.canvasHeight+e.y:s=="down"?e.y=C.canvasHeight+e.y:s=="left"?e.x=-C.canvasWidth+e.x:s=="right"&&(e.x=C.canvasWidth+e.x),u){let f=gn(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);f&&a.push(...f);}o.push(r);let c=new ze({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},undefined,i),h=C.addTicker(r,c);if(h&&(C.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&C.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof ee||e instanceof we)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function gn(r,e={direction:"right"},t){return ss(r,e,t)}var aR=new ie(Wl,[async()=>{C.removeAll(),N.dialogue={character:Z,text:`These are my 4 puppets: ${yt}, ${ni}, ${mr} and ${gr}. They can appear, disappear and animate at my will.`};let r=Nr("eggHead",Kt);await r.load(),r.x=100,r.y=100;let e=Nr("flowerTop",Ci);e.x=300,e.y=100,e.load(),Kl("helmlok",Pi,{x:100,y:300}),Kl("skully",ts,{x:300,y:300});},async()=>{N.dialogue={character:Z,text:"Here's what they can do."},N.choiceMenuOptions=[new Te("Dissolve effect",B1,{}),new Te("Fade effect",M1,{}),new Te("Rotate",R1,{}),new Te("Move",I1,{}),new Te("Zoom",D1,{}),new Te("Move in/out",k1,{}),new Te("Zoom in/out",O1,{}),new Te("Push in/out",L1,{}),new Te("Shake",G1,{}),new Te("Add same alias",F1,{}),new Te("Image container",U1,{}),new Te("Additional Positions",N1,{}),new ns("Cancel",{closeCurrentLabel:true})];},(r,{labelId:e})=>N.jumpLabel(e,r)]),B1=new ie(ob,[()=>{N.dialogue={character:Z,text:`Here's what's going to happen:
3312
3312
  - ${yt} will disappear with a dissolve effect. If you go next, ${yt} reappears with a dissolve effect without stopping the dissolve effect
3313
3313
  - ${yt} will appear instead of ${ni}.
3314
3314
  - ${mr} will disappear with a fade effect and reappear with a fade effect, and repeat.
@@ -3412,5 +3412,5 @@ Footer
3412
3412
  _| |_ | | > ' < | | \\ ' / _| |_\\ |_
3413
3413
  |_____| [___][__]\`\\_][___] \\_/ |_____|\\____|
3414
3414
 
3415
- `);}var gL={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof ee||r instanceof Tt||r instanceof we},testProp(r){switch(r){case "xAlign":case "yAlign":case "xPercentagePosition":case "yPercentagePosition":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof ee||r instanceof Tt||r instanceof we)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "xPercentagePosition":r.xPercentagePosition=t/100;break;case "yPercentagePosition":r.yPercentagePosition=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.xPercentagePosition*100,prop:"xPercentagePosition",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yPercentagePosition*100,prop:"yPercentagePosition",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},IR=gL;var I=class r{constructor(){}static _app=undefined;static get app(){if(!r._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return r._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(Wt);return e||(e=new X,e.label=Wt,this.app.stage.addChild(e)),e}static htmlLayout;static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async initialize(e,t,i,s,n){return r.canvasWidth=t,r.canvasHeight=i,r._app=new Nh,r.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=r.app,extensions:a=[],...u}=n||{};MR({app:o,extensions:[IR,...a],...u}),r._isInitialized=true,r.addCanvasIntoHTMLElement(e),window.addEventListener("resize",r.resize),r.resize(),r.gameLayer,RR();})}static addCanvasIntoHTMLElement(e){r._isInitialized?e.appendChild(r.app.canvas):console.error("[Pixi\u2019VN] GameWindowManager is not initialized");}static initializeHTMLLayout(e){let t=document.createElement("div");t.style.position="absolute",t.style.pointerEvents="none",e.appendChild(t),r.htmlLayout=t,r.resize();}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/r.canvasWidth,t/r.canvasHeight)}static get screenWidth(){return Math.floor(r.screenScale*r.canvasWidth)}static get screenHeight(){return Math.floor(r.screenScale*r.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-r.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-r.screenHeight)/2}static resize(){if(r._isInitialized){let e=r.app.canvas.style;e.width=`${r.screenWidth}px`,e.height=`${r.screenHeight}px`,e.marginLeft=`${r.horizontalMargin}px`,e.marginRight=`${r.horizontalMargin}px`,e.marginTop=`${r.verticalMargin}px`,e.marginBottom=`${r.verticalMargin}px`;}r.htmlLayout&&(r.htmlLayout.style.width=`${r.screenWidth}px`,r.htmlLayout.style.height=`${r.screenHeight}px`,r.htmlLayout.style.marginLeft=`${r.horizontalMargin}px`,r.htmlLayout.style.marginRight=`${r.horizontalMargin}px`,r.htmlLayout.style.marginTop=`${r.verticalMargin}px`,r.htmlLayout.style.marginBottom=`${r.verticalMargin}px`);}static get childrenAliasesOrder(){return r.gameLayer.children.filter(e=>e.label).sort((e,t)=>r.gameLayer.getChildIndex(e)-r.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(r._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static _currentTickers={};static _currentTickersSequence={};static _currentTickersTimeouts={};static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static _tickersOnPause={};static generateTickerId(e){try{return (0,DR.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]),r._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),r._currentTickersTimeouts[e]&&delete r._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),r.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(r._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&r.removeTickerTimeout(i);}else r._currentTickersTimeouts[i].aliases=n;});}};var Sa=class{get app(){return I.app}get gameLayer(){return I.gameLayer}get isInitialized(){return I._isInitialized}get htmlLayout(){return I.htmlLayout}set htmlLayout(e){I.htmlLayout=e;}get canvasWidth(){return I.canvasWidth}get canvasHeight(){return I.canvasHeight}set canvasWidth(e){I.canvasWidth=e;}set canvasHeight(e){I.canvasHeight=e;}get screen(){return this.app.screen}async initialize(e,t,i,s,n){return await I.initialize(e,t,i,s,n)}initializeHTMLLayout(e){return I.initializeHTMLLayout(e)}get children(){return I.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {console.error(`[Pixi\u2019VN] Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {console.error(`[Pixi\u2019VN] Canvas element ${e} not found`);return}}e instanceof X&&(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 Tt?await Y1(t,e,{ignoreTexture:true}):t instanceof ee?await zd(t,e,{ignoreTexture:true}):t instanceof Bt?await Wd(t,e,{ignoreTexture:true}):t instanceof ar?await $1(t,e):t instanceof we?await w1(t,e):t instanceof X&&await Ii(t,e);}transferTickers(e,t,i="move"){I._currentTickersSequence[e]&&(i==="move"?I._currentTickersSequence[t]=Se(I._currentTickersSequence[e]):i==="duplicate"&&(I._currentTickersSequence[t]=Se(I._currentTickersSequence[e]))),Object.entries(I._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.canvasElementAliases.includes(e)&&(i==="move"?n.canvasElementAliases=n.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&n.canvasElementAliases.find(o=>o===e)&&n.canvasElementAliases.push(t),n.args.hasOwnProperty(Ql))){let o=n.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?n.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(n.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(I._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));}),I._currentTickersSequence[t]&&Object.keys(I._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&I._currentTickersSequence[e]&&Object.keys(I._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===Wt){console.error(`[Pixi\u2019VN] The alias ${Wt} 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)?console.error(`[Pixi\u2019VN] The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===undefined&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==undefined?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}addCanvasElement(e,t){this.add(e,t);}remove(e,t={}){if(e===Wt){console.error(`[Pixi\u2019VN] The alias ${Wt} 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);});});}removeCanvasElement(e){this.remove(e);}find(e){if(e===Wt)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}getCanvasElement(e){return this.find(e)}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren(),this.removeAllTickers();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return I._currentTickers}get currentTickersList(){return Object.values(I._currentTickers)}get currentTickersSteps(){return I._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!Vd(i,t.args,t.duration,t.priority)){console.error(`[Pixi\u2019VN] Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:Se(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=I.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{I.removeTickerTimeoutInfo(o),I._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:Ql in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);I.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){I._currentTickers[e]=t,t.fn=s=>{let n=I._currentTickers[e];if(n){let o=n.canvasElementAliases;if(t.createdByTicketSteps){if(this.isTickerPaused(t.createdByTicketSteps.canvasElementAlias,t.createdByTicketSteps.id))return}else o=o.filter(a=>!this.isTickerPaused(a,e));i?.fn(s,n.args,o,e);}},this.app.ticker.add(t.fn,undefined,t.priority);}pushEndOfTicker(e,t,i){t.onEndOfTicker=()=>{i.onEndOfTicker(t.canvasElementAliases,e,t.args);};}addTickersSteps(e,t,i=0){return this.addTickersSequence(e,t,i)}addTickersSequence(e,t,i=0){if(t.length==0){console.warn("[Pixi\u2019VN] The steps of the tickers is empty");return}e in I._currentTickersSequence||(I._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===qt||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:Se(o.args),duration:o.duration})},n=I.generateTickerId(s);return I._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!I._currentTickersSequence[e]||!I._currentTickersSequence[e][t])return;let i=I._currentTickersSequence[e][t].steps[I._currentTickersSequence[e][t].currentStepNumber];if(i===qt&&(i=I._currentTickersSequence[e][t].steps[0],I._currentTickersSequence[e][t].currentStepNumber=0,i===qt)){console.error("[Pixi\u2019VN] TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=I._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),I.removeTickerTimeoutInfo(u);},i.duration*1e3);I.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=Vd(i.ticker,i.args,i.duration,i.priority);if(!s){console.error(`[Pixi\u2019VN] Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:Se(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=I.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=I._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Ql in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),I.removeTickerTimeoutInfo(u);},s.duration*1e3);I.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(I._currentTickersSequence[e]&&I._currentTickersSequence[e][t]){let i=I._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,I._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&I._currentTickersSequence[e]&&I._currentTickersSequence[e][t]&&(delete I._currentTickersSequence[e][t],Object.entries(I._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=I._currentTickers[e],s=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!s&&i.duration==null&&i.createdByTicketSteps&&this.nextTickerStep(i.createdByTicketSteps.canvasElementAlias,i.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(I._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),I._currentTickersSequence[s]&&delete I._currentTickersSequence[s],I.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof Mt?i=t.id:i=t.prototype.id,e.forEach(s=>{I._currentTickersSequence[s]&&Object.entries(I._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete I._currentTickersSequence[s][n];});}),Object.entries(I._currentTickers).forEach(([s,n])=>{n.id===i&&(I._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(I._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(I._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(I._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Ql in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(I._currentTickersSequence).forEach(([e,t])=>{t===undefined&&delete I._currentTickersSequence[e];}),Object.entries(I._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&I.removeTickerTimeout(e);});}removeAllTickers(){I._currentTickersSequence={},Object.keys(I._currentTickers).forEach(e=>{this.removeTicker(e);}),I._currentTickers={};for(let e in I._currentTickersTimeouts)I.removeTickerTimeout(e);I._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},I._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=I._currentTickers[t];if(i){if(i.args.hasOwnProperty(Ql)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete I._currentTickers[t];}});}putOnPauseTicker(e,t={}){this.pauseTicker(e,t);}pauseTicker(e,t={}){let i=I._tickersOnPause[e];if(!i){I._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?I._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:I._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?I._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:I._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTickerPaused(e){this.resumeTicker(e);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete I._tickersOnPause[t];});}isTickerPaused(e,t){let i=I._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}completeTickerOnStepEnd(e){e.alias?I._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):I._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=I._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(qt)?console.error(`[Pixi\u2019VN] The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(s=>{if(typeof s=="object"&&"ticker"in s){let n=Vd(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=I._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===Wt){console.error(`[Pixi\u2019VN] The alias ${Wt} is reserved`);return}return I.app.stage.addChild(t)}getLayer(e){return I.app.stage.getChildByLabel(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAll();}exportJson(){return JSON.stringify(this.export())}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=C1(t));}),{tickers:Se(I.currentTickersWithoutCreatedBySteps),tickersSteps:Se(I._currentTickersSequence),elements:Se(e),stage:Se(xa(this.gameLayer)),elementAliasesOrder:Se(I.childrenAliasesOrder),tickersOnPause:Se(I._tickersOnPause),tickersToCompleteOnStepEnd:Se(I._tickersToCompleteOnStepEnd)}}async importJson(e){await this.import(JSON.parse(e));}async import(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,s=e.elementAliasesOrder,n=s.filter(a=>i[a]).map(a=>bb(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),I.childrenAliasesOrder.push(l);});}else {console.error("[Pixi\u2019VN] The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Ii(this.gameLayer,e.stage,{ignoreScale:!0}):console.error("[Pixi\u2019VN] The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([s,n])=>{let o=n.canvasElementAliases,a=Vd(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else console.error(`[Pixi\u2019VN] Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{I._currentTickersSequence[s]=n,Object.keys(n).forEach(o=>{this.runTickersSequence(s,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(s=>{let n=i[s];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(i[s].tickerIdsExcluded=n.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(i[s].tickerIdsIncluded=n.tickerIdsIncluded.map(o=>t[o]||o));}),I._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds.map(o=>({id:t[o.id]||o.id})),n=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));I._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){console.error("[Pixi\u2019VN] Error importing data",t);}}};var FR=us(OR());function LR(r,e){let t=Se(r);return e.forEach(i=>{let s=t;i.path&&i.path.length>0?i.path.forEach((n,o)=>{if(i.path&&o===i.path.length-1){if(i.kind==="E"||i.kind==="D")s[n]=i.lhs;else if(i.kind==="N")Number.isInteger(n)?Array.isArray(s)&&s.splice(n,1):typeof n=="string"&&delete s[n];else if(i.kind==="A"){let a=i.index;i.item.kind==="N"?s[n].splice(a,1):i.item.kind==="E"||i.item.kind==="D"?s[n][a]=i.item.lhs:i.item.kind==="A"?console.warn("[Pixi\u2019VN] Nested array found, skipping diff",i):console.warn("[Pixi\u2019VN] No array found, skipping diff",i);}}else s=s[n];}):console.warn("[Pixi\u2019VN] No path found, skipping diff",i);}),t}var G=class r{constructor(){}static _stepsHistory=[];static stepsRunning=0;static goNextRequests=0;static choiseMadeTemp=undefined;static get allOpenedLabels(){return O.getVariable(O.keysSystem.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(e){O.setVariable(O.keysSystem.OPENED_LABELS_COUNTER_KEY,e);}static getCurrentStepTimesCounterData(e=""){let t=r.currentLabelStepIndex;if(t===null)return console.error("[Pixi\u2019VN] currentLabelStepIndex is null"),null;let i=`${t}${e}`,s=r.currentLabelId,n=r._currentLabel;if(!s||t===null||!n)return console.error("[Pixi\u2019VN] currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let o=n.getStepSha1(t)||"error",a=O.getVariable(O.keysSystem.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[s]||(a[s]={}),(!a[s][i]||a[s][i].stepSha1!=o)&&(a[s][i]={stepSha1:o}),a[s][i]}static setCurrentStepTimesCounterData(e="",t){let i=r.currentLabelStepIndex,s=i+e,n=r.currentLabelId;if(!n||i===null){console.error("[Pixi\u2019VN] currentLabelId or currentLabelStepIndex is null");return}let o=O.getVariable(O.keysSystem.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[n]||(o[n]={}),o[n][s]=t,O.setVariable(O.keysSystem.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static getCurrentStepTimesCounter(e=""){let t=r._lastStepIndex,i=r.getCurrentStepTimesCounterData(e);if(!i)return console.error("[Pixi\u2019VN] getCurrentStepTimesCounter obj is null"),0;let s=i.lastStepIndexs||[];return s.find(o=>o===t)||(s.push(t),i.lastStepIndexs=s,r.setCurrentStepTimesCounterData(e,i)),s.length}static getRandomNumber(e,t,i={}){let s=i.nestedId||"";if(i.onceOnly||false){let o=r.getCurrentStepTimesCounterData(s);if(!o)return;let a=o.usedRandomNumbers||{},u=Array.from({length:t-e+1},(h,f)=>f+e).filter(h=>!a[`${e}-${t}`]?.includes(h));if(u.length===0)return;let l=Math.floor(Math.random()*u.length),c=u[l];return a[`${e}-${t}`]||(a[`${e}-${t}`]=[]),a[`${e}-${t}`].push(c),o.usedRandomNumbers=a,r.setCurrentStepTimesCounterData(s,o),c}return Math.floor(Math.random()*(t-e+1))+e}static resetCurrentStepTimesCounter(e=""){let t=r.currentLabelStepIndex,i=t+e,s=r.currentLabelId;if(!s||t===null){console.error("[Pixi\u2019VN] currentLabelId or currentLabelStepIndex is null");return}let n=O.getVariable(O.keysSystem.CURRENT_STEP_TIMES_COUNTER_KEY)||{};n[s]||(n[s]={}),n[s][i]={lastStepIndexs:[],stepSha1:""},O.setVariable(O.keysSystem.CURRENT_STEP_TIMES_COUNTER_KEY,n);}static get allChoicesMade(){return O.getVariable(O.keysSystem.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(e){O.setVariable(O.keysSystem.ALL_CHOICES_MADE_KEY,e);}static _lastStepIndex=0;static increaseLastStepIndex(){r._lastStepIndex++;}static _openedLabels=[];static get _currentLabel(){if(r.currentLabelId)return _r(r.currentLabelId)}static get currentLabelId(){if(r._openedLabels.length>0)return r._openedLabels[r._openedLabels.length-1].label}static get currentLabelStepIndex(){return r._openedLabels.length>0?r._openedLabels[r._openedLabels.length-1].currentStepIndex:null}static get lastHistoryStep(){return r._stepsHistory.length>0?r._stepsHistory[r._stepsHistory.length-1]:null}static _originalStepData=undefined;static get originalStepData(){return r._originalStepData?Se(r._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:undefined},labelIndex:-1,openedLabels:[]}}static set originalStepData(e){r._originalStepData=Se(e);}static get currentStepData(){return {path:vb(),storage:O.export(),canvas:C.export(),sound:St.removeOldSoundAndExport(),labelIndex:r.currentLabelStepIndex||0,openedLabels:Se(r._openedLabels)}}static addLabelHistory(e,t){let i=r.allOpenedLabels,s=r.allOpenedLabels[e]?.biggestStep||0,n=r.allOpenedLabels[e]?.openCount||0;(!s||s<t)&&(i[e]={biggestStep:t,openCount:n},r.allOpenedLabels=i);}static addChoicesMade(e,t,i,s){let n=r.allChoicesMade,o=n.findIndex(a=>a.labelId===e&&a.stepIndex===t&&a.choiceIndex===s&&a.stepSha1===i);o<0?n.push({labelId:e,stepIndex:t,choiceIndex:s,stepSha1:i,madeTimes:1}):n[o].madeTimes++,r.allChoicesMade=n;}static pushNewLabel(e){if(!_r(e))throw new Error(`[Pixi\u2019VN] Label ${e} not found`);r._openedLabels.push({label:e,currentStepIndex:0});let i=r.allOpenedLabels,s=r.allOpenedLabels[e]?.biggestStep||0,n=r.allOpenedLabels[e]?.openCount||0;i[e]={biggestStep:s,openCount:n+1},r.allOpenedLabels=i;}static increaseCurrentStepIndex(){if(r._openedLabels.length>0){let e=r._openedLabels[r._openedLabels.length-1];r._openedLabels[r._openedLabels.length-1]={...e,currentStepIndex:e.currentStepIndex+1};}}static restoreLastLabelList(){r._openedLabels=r.originalStepData.openedLabels;}static goBackInternal(e,t){if(e<=0||r._stepsHistory.length==0)return t;let i=r.lastHistoryStep;if(i)try{let s=LR(t,i.diff);return r._lastStepIndex=i.index,r._stepsHistory.pop(),r.goBackInternal(e-1,s)}catch(s){return console.error("[Pixi\u2019VN] Error applying diff",s),t}else return t}static async restoreFromHistoryStep(e,t){r._originalStepData=e,r._openedLabels=Se(e.openedLabels),O.import(Se(e.storage)),await C.import(Se(e.canvas)),St.import(Se(e.sound),r._lastStepIndex-1),t(e.path);}};var Be=class r{static storage={};static baseStorage={};constructor(){}static get _keysSystem(){return {CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",FLAGS_CATEGORY_KEY:"___flags___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",TEMP_STORAGE_KEY:"___temp_storage___",TEMP_STORAGE_DEADLINES_KEY:"___temp_storage_deadlines___"}}static get tempStorage(){return r.storage[r._keysSystem.TEMP_STORAGE_KEY]||{}}static set tempStorage(e){r.storage[r._keysSystem.TEMP_STORAGE_KEY]=e;}static get tempStorageDeadlines(){return r.storage[r._keysSystem.TEMP_STORAGE_DEADLINES_KEY]||{}}static set tempStorageDeadlines(e){r.storage[r._keysSystem.TEMP_STORAGE_DEADLINES_KEY]=e;}static getTempVariable(e){if(e=e.toLowerCase(),r.tempStorage.hasOwnProperty(e))return Se(r.tempStorage[e])}static clearOldTempVariables(e){let t=r.tempStorage,i=r.tempStorageDeadlines;if(e===0)t={},i={};else for(let s in i)i[s]<e&&(delete t[s],delete i[s]);r.tempStorage=t,r.tempStorageDeadlines=i;}static saveStorageAsBasicStorage(){r.baseStorage={...r.storage};}};var Ea=class{get stepsHistory(){return G._stepsHistory}get currentStepTimesCounter(){return G.getCurrentStepTimesCounter()}set currentStepTimesCounter(e){G.resetCurrentStepTimesCounter();}getRandomNumber(e,t,i={}){return G.getRandomNumber(e,t,i)}get lastStepIndex(){return G._lastStepIndex}get openedLabels(){return G._openedLabels}get currentLabel(){return G._currentLabel}addStepHistory(e,t){let i=G.currentStepData;if(G.originalStepData&&G.originalStepData.openedLabels.length===i.openedLabels.length)try{let n=JSON.stringify(G.originalStepData.openedLabels),o=JSON.stringify(i.openedLabels);if(n===o&&G.originalStepData.path===i.path&&G.originalStepData.labelIndex===i.labelIndex)return}catch(n){console.error("[Pixi\u2019VN] Error comparing openedLabels",n);}let s=(0, FR.diff)(G.originalStepData,i);if(s){let n,o,a;O.getVariable(O.keysSystem.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.lastStepIndex&&(n=this.dialogue),O.getVariable(O.keysSystem.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.lastStepIndex&&(o=O.getVariable(O.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY)),O.getVariable(O.keysSystem.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.lastStepIndex&&(a=O.getVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY)),G._stepsHistory.push({diff:s,currentLabel:G.currentLabelId,dialoge:n,choices:o,stepSha1:e,index:this.lastStepIndex,labelStepIndex:G.currentLabelStepIndex,choiceIndexMade:t,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices}),G.originalStepData=i;}G.increaseLastStepIndex();}closeCurrentLabel(){if(!G.currentLabelId){console.warn("[Pixi\u2019VN] No label to close");return}if(!this.currentLabel){console.error("[Pixi\u2019VN] currentLabel not found");return}G._openedLabels.pop(),Be.clearOldTempVariables(this.openedLabels.length);}closeAllLabels(){for(;G._openedLabels.length>0;)this.closeCurrentLabel(),Be.clearOldTempVariables(this.openedLabels.length);}get narrativeHistory(){let e=[];return G._stepsHistory.forEach(t=>{let i=t.dialoge,s=t.choices,n=t.inputValue;if(e.length>0&&e[e.length-1].choices&&!e[e.length-1].playerMadeChoice&&t.currentLabel){let o=e[e.length-1].choices;if(o){let a=false;t.choiceIndexMade!==undefined&&o.length>t.choiceIndexMade&&(o[t.choiceIndexMade].isResponse=true,a=true),e[e.length-1].playerMadeChoice=a,e[e.length-1].choices=o;}}if(n&&e.length>0&&(e[e.length-1].inputValue=n),i||s){let o=s?.map((a,u)=>{let l=false;return a.oneTime&&t.alreadyMadeChoices&&t.alreadyMadeChoices.includes(u)&&(l=true),{text:a.text,type:a.type,isResponse:false,hidden:l}});if(o&&o.every(a=>a.hidden)){let a=o.find(u=>u.hidden===false);a&&(a.hidden=false);}e.push({dialoge:i,playerMadeChoice:false,choices:o,stepIndex:t.index});}}),e}removeNarrativeHistory(e){e?G._stepsHistory.splice(0,e):G._stepsHistory=[];}isLabelAlreadyCompleted(e){let t;typeof e=="string"?t=e:t=e.id;let s=G.allOpenedLabels[t]?.biggestStep||0;if(s){let n=_r(t);if(n)return n.steps.length<=s}return false}get alreadyCurrentStepMadeChoicesObj(){let e=G.currentLabelStepIndex,t=this.currentLabel;if(e===null||!t)return;let i=t.getStepSha1(e);return i||console.warn("[Pixi\u2019VN] stepSha not found"),G.allChoicesMade.filter(s=>s.labelId===t?.id&&s.stepIndex===e&&s.stepSha1===i)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(e=>e.choiceIndex)}get isCurrentStepAlreadyOpened(){let e=G.currentLabelId;if(e){let t=G.allOpenedLabels[e]?.openCount||0;if(G.currentLabelStepIndex&&t>=G.currentLabelStepIndex)return true}return false}getTimesLabelOpened(e){return G.allOpenedLabels[e]?.openCount||0}getTimesChoiceMade(e){return this.alreadyCurrentStepMadeChoicesObj?.find(t=>t.choiceIndex===e)?.madeTimes||0}getCanGoNext(e){let t=e?.showWarn||false,i=this.choiceMenuOptions;return i&&i.length>0?(t&&console.warn("[Pixi\u2019VN] The player must make a choice"),false):this.isRequiredInput?(t&&console.warn("[Pixi\u2019VN] The player must enter a value"),false):true}get canGoNext(){return G.stepsRunning!==0?false:this.getCanGoNext()}async goNext(e,t){if(this.getCanGoNext({showWarn:true})){if(G.stepsRunning!==0){G.goNextRequests++;return}return this.currentLabel&&this.currentLabel.onStepEnd&&await this.currentLabel.onStepEnd(G.currentLabelStepIndex||0,this.currentLabel),G.stepsRunning===0&&(I._tickersToCompleteOnStepEnd.tikersIds.forEach(({id:i})=>{C.forceCompletionOfTicker(i);}),I._tickersToCompleteOnStepEnd.stepAlias.forEach(({alias:i,id:s})=>{C.forceCompletionOfTicker(s,i);}),I._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]}),G.increaseCurrentStepIndex(),await this.runCurrentStep(e,t)}}async runCurrentStep(e,t){if(G.currentLabelId){let i=G.currentLabelStepIndex;if(i===null){console.error("[Pixi\u2019VN] currentLabelStepIndex is null");return}let s=G._currentLabel;if(!s){console.error("[Pixi\u2019VN] currentLabel not found");return}if(s.steps.length>i){let n=s.onStepStart;n&&await n(i,s);let o=s.steps[i],a=s.getStepSha1(i);a||console.warn("[Pixi\u2019VN] stepSha not found");try{G.stepsRunning++;let u=await o(e,{labelId:s.id});if(this.choiceMenuOptions?.length===1&&this.choiceMenuOptions[0].autoSelect){let l=this.choiceMenuOptions[0];u=await this.selectChoice(l,e);}if(t!==void 0&&G._stepsHistory.length>0){let l=G._stepsHistory[G._stepsHistory.length-1];G.addChoicesMade(l.currentLabel||"error",typeof l.labelStepIndex=="number"?l.labelStepIndex:-1,l.stepSha1||"error",t),G.choiseMadeTemp=t;}return G.stepsRunning--,G.stepsRunning===0&&(G.addLabelHistory(s.id,i),this.addStepHistory(a||"error",G.choiseMadeTemp),G.choiseMadeTemp=void 0,G.goNextRequests>0)?(G.goNextRequests--,await this.goNext(e)):u}catch(u){console.error("[Pixi\u2019VN] Error running step",u),this.onStepError&&this.onStepError(u,e);return}}else {if(this.openedLabels.length>1)return this.closeCurrentLabel(),await this.goNext(e,t);if(this.openedLabels.length===1)return G.restoreLastLabelList(),this.onGameEnd?await this.onGameEnd(e,{labelId:"end"}):undefined}}else if(this.openedLabels.length===0){if(G.restoreLastLabelList(),this.onGameEnd)return await this.onGameEnd(e,{labelId:"end"});console.error("[Pixi\u2019VN] The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");return}else console.error("[Pixi\u2019VN] currentLabelId not found");}async callLabel(e,t){let i,s;typeof e=="string"?s=e:(s=e.id,typeof e.choiseIndex=="number"&&(i=e.choiseIndex));try{if(s===Eb){let a={label:bn(i),text:"",closeCurrentLabel:!1,type:"close",oneTime:!1,onlyHaveNoChoice:!1,autoSelect:!1,props:{}};return this.closeChoiceMenu(a,t)}let n=_r(s);if(!n)throw new Error(`[Pixi\u2019VN] Label ${s} not found`);this.currentLabel&&this.currentLabel.onStepEnd&&await this.currentLabel.onStepEnd(G.currentLabelStepIndex||0,this.currentLabel),G.pushNewLabel(n.id);}catch(n){console.error("[Pixi\u2019VN] Error calling label",n);return}return await this.runCurrentStep(t,i)}async jumpLabel(e,t){this.closeCurrentLabel();let i,s;typeof e=="string"?s=e:(s=e.id,typeof e.choiseIndex=="number"&&(i=e.choiseIndex));try{if(s===Eb){let a={label:bn(i),text:"",closeCurrentLabel:!1,type:"close",oneTime:!1,onlyHaveNoChoice:!1,autoSelect:!1,props:{}};return this.closeChoiceMenu(a,t)}let n=_r(s);if(!n)throw new Error(`[Pixi\u2019VN] Label ${s} not found`);this.currentLabel&&this.currentLabel.onStepEnd&&await this.currentLabel.onStepEnd(G.currentLabelStepIndex||0,this.currentLabel),G.pushNewLabel(n.id);}catch(n){console.error("[Pixi\u2019VN] Error jumping label",n);return}return await this.runCurrentStep(t,i)}async selectChoice(e,t){if(this.choiceMenuOptions=undefined,e.type=="call")return await this.callLabel(e.label,t);if(e.type=="jump")return await this.jumpLabel(e.label,t);if(e.type=="close")return await this.closeChoiceMenu(e,t);throw new Error(`[Pixi\u2019VN] Type ${e.type} not found`)}async closeChoiceMenu(e,t){let i=e.label,s;return typeof i.choiseIndex=="number"&&(s=i.choiseIndex),e.closeCurrentLabel&&this.closeCurrentLabel(),this.goNext(t,s)}async goBack(e,t=1){if(t<=0){console.warn("[Pixi\u2019VN] Steps must be greater than 0");return}if(G._stepsHistory.length<=1){console.warn("[Pixi\u2019VN] No steps to go back");return}let i=G.goBackInternal(t,G.originalStepData);i?await G.restoreFromHistoryStep(i,e):console.error("[Pixi\u2019VN] Error going back");}get canGoBack(){return G._stepsHistory.length>1}onGameEnd=undefined;onStepError=undefined;get dialogue(){return O.getVariable(O.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY)}set dialogue(e){if(!e){O.setVariable(O.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY,undefined);return}let t="",i,s;if(typeof e=="string"?(t=e,s=new ui(t,i)):Array.isArray(e)?(t=e.join(),s=new ui(t,i)):e instanceof ui?s=e:(Array.isArray(e.text)?t=e.text.join():t=e.text,e.character&&(typeof e.character=="string"?i=e.character:i=e.character.id),s=new ui(t,i)),this.dialogGlue){let n=O.getVariable(O.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY);n&&(s.text=`${n.text}${s.text}`,s.character=s.character||n.character),this.dialogGlue=false;}O.setVariable(O.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY,s),O.setVariable(O.keysSystem.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.lastStepIndex);}get choiceMenuOptions(){let e=O.getVariable(O.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(e){let t=[],i=[];e.forEach((n,o)=>{if(n.type===ql){let u=bn(o),l=new ns(n.text,{closeCurrentLabel:n.closeCurrentLabel,oneTime:n.oneTime,onlyHaveNoChoice:n.onlyHaveNoChoice,autoSelect:n.autoSelect});l.label=u,t.push(l);return}let a=_r(n.label);if(a){let u=new ie(a.id,a.steps,{onStepStart:a.onStepStart,choiseIndex:o});t.push(new Te(n.text,u,n.props,{type:n.type,oneTime:n.oneTime,onlyHaveNoChoice:n.onlyHaveNoChoice,autoSelect:n.autoSelect}));}});let s=this.alreadyCurrentStepMadeChoices;if(t=t.filter((n,o)=>n.oneTime&&s&&s.includes(o)?false:n.onlyHaveNoChoice?(i.push(n),false):true),t.length>0)return t;if(i.length>0)return [i[0]]}}set choiceMenuOptions(e){if(!e){O.setVariable(O.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY,undefined);return}let t=e.map(i=>i instanceof ns?{text:i.text,type:ql,closeCurrentLabel:i.closeCurrentLabel,oneTime:i.oneTime,onlyHaveNoChoice:i.onlyHaveNoChoice,autoSelect:i.autoSelect}:{...i,label:i.label.id});O.setVariable(O.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY,t),O.setVariable(O.keysSystem.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.lastStepIndex);}get dialogGlue(){return O.getFlag(O.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(e){O.setFlag(O.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,e);}get inputValue(){return O.getVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(e){this.removeInputRequest(),O.setVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY,e),O.setVariable(O.keysSystem.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.lastStepIndex);}get isRequiredInput(){return O.getVariable(O.keysSystem.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return O.getVariable(O.keysSystem.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(e,t){e.isRequired=true,O.setVariable(O.keysSystem.CURRENT_INPUT_INFO_MEMORY_KEY,e),t!==undefined?O.setVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY,t):O.removeVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){O.removeVariable(O.keysSystem.CURRENT_INPUT_INFO_MEMORY_KEY),O.removeVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){G._stepsHistory=[],G._openedLabels=[],G._lastStepIndex=0,G._originalStepData=undefined;}exportJson(){return JSON.stringify(this.export())}export(){return {stepsHistory:G._stepsHistory,openedLabels:G._openedLabels,lastStepIndex:this.lastStepIndex,originalStepData:G._originalStepData}}async importJson(e){await this.import(JSON.parse(e));}async import(e){this.clear();try{if(e.hasOwnProperty("stepsHistory")?G._stepsHistory=e.stepsHistory:console.warn("[Pixi\u2019VN] Could not import stepsHistory data, so will be ignored"),e.hasOwnProperty("openedLabels")?G._openedLabels=e.openedLabels:console.warn("[Pixi\u2019VN] Could not import openedLabels data, so will be ignored"),e.hasOwnProperty("lastStepIndex")?G._lastStepIndex=e.lastStepIndex:console.warn("[Pixi\u2019VN] Could not import lastStepIndex data, so will be ignored"),e.hasOwnProperty("originalStepData")?G._originalStepData=e.originalStepData:console.warn("[Pixi\u2019VN] Could not import originalStepData data, so will be ignored"),this.currentLabel&&this.currentLabel.onLoadingLabel){await this.currentLabel.onLoadingLabel(G.currentLabelStepIndex||0,this.currentLabel);for(let t=0;t<this.openedLabels.length;t++){let i=this.openedLabels[t],s=_r(i.label);s&&s.onLoadingLabel&&await s.onLoadingLabel(i.currentStepIndex,s);}}}catch(t){console.error("[Pixi\u2019VN] Error importing data",t);}}};function $d(r){let e=[];for(let t of r)t.type==="TelephoneFilter"?e.push(new Fe.TelephoneFilter):t.type==="StreamFilter"?e.push(new Fe.StreamFilter):t.type==="StereoFilter"?e.push(new Fe.StereoFilter(t.pan)):t.type==="ReverbFilter"?e.push(new Fe.ReverbFilter(t.seconds,t.decay,t.reverse)):t.type==="MonoFilter"?e.push(new Fe.MonoFilter):t.type==="EqualizerFilter"?e.push(new Fe.EqualizerFilter(t.f32,t.f64,t.f125,t.f250,t.f500,t.f1k,t.f2k,t.f4k,t.f8k,t.f16k)):t.type==="DistortionFilter"?e.push(new Fe.DistortionFilter(t.amount)):console.error("[Pixi\u2019VN] Unknown sound filter type");return e}function K1(r){if(!r)return;let e=[];for(let t of r)t instanceof Fe.TelephoneFilter?e.push({type:"TelephoneFilter"}):t instanceof Fe.StreamFilter?e.push({type:"StreamFilter"}):t instanceof Fe.StereoFilter?e.push({type:"StereoFilter",pan:t.pan}):t instanceof Fe.ReverbFilter?e.push({type:"ReverbFilter",seconds:t.seconds,decay:t.decay,reverse:t.reverse}):t instanceof Fe.MonoFilter?e.push({type:"MonoFilter"}):t instanceof Fe.EqualizerFilter?e.push({type:"EqualizerFilter",f32:t.f32,f64:t.f64,f125:t.f125,f250:t.f250,f500:t.f500,f1k:t.f1k,f2k:t.f2k,f4k:t.f4k,f8k:t.f8k,f16k:t.f16k}):t instanceof Fe.DistortionFilter?e.push({type:"DistortionFilter",amount:t.amount}):console.error("[Pixi\u2019VN] Unknown sound filter type");return e}var jd=class extends Ul{get context(){return _e.context}get filtersAll(){return _e.filtersAll}set filtersAll(e){_e.filtersAll=e.filter(t=>!(t instanceof Fe.Filter));}get supported(){return _e.supported}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}add(e,t){if(typeof e=="object")throw new Error("[Pixi\u2019VN] The method add(map: SoundSourceMap, globalOptions?: Options) is deprecated. Use add(alias: string, options: Options | string | ArrayBuffer | AudioBuffer | HTMLAudioElement | Sound): Sound; instead.");this.exists(e)&&this.remove(e),t instanceof pr&&(t=t.options);let i;if(t instanceof yn)i=t;else {let s=this.getOptions(t||{});i=yn.from(s);}return i.alias=e,!re.soundAliasesOrder.includes(e)&&re.soundAliasesOrder.push(e),re.sounds[e]=i,_e.add(e,i),i}get useLegacy(){return _e.useLegacy}set useLegacy(e){_e.useLegacy=e;}get disableAutoPause(){return _e.disableAutoPause}set disableAutoPause(e){_e.disableAutoPause=e;}remove(e){return re.soundAliasesOrder=re.soundAliasesOrder.filter(t=>t!==e),delete re.soundsPlaying[e],delete re.sounds[e],_e.remove(e)}get volumeAll(){return _e.volumeAll}set volumeAll(e){_e.volumeAll=e;}get speedAll(){return _e.speedAll}set speedAll(e){_e.speedAll=e;}togglePauseAll(){return _e.togglePauseAll()}pauseAll(){return _e.pauseAll()}resumeAll(){return _e.resumeAll()}toggleMuteAll(){return _e.toggleMuteAll()}muteAll(){return _e.muteAll()}unmuteAll(){return _e.unmuteAll()}removeAll(){return re.soundAliasesOrder=[],re.soundsPlaying={},re.sounds={},_e.removeAll()}stopAll(){for(let e in re.sounds)re.sounds[e].stop();return re.soundsPlaying={},_e.stopAll()}exists(e,t){return _e.exists(e,t)||e in re.sounds}isPlaying(){return _e.isPlaying()}find(e){let t=re.sounds[e];return t||(t=_e.find(e),t&&(re.sounds[e]=t),t)}play(e,t){if(!this.exists(e))throw new Error("[Pixi\u2019VN] The alias is not found in the sound library.");return re.soundsPlaying[e]={stepIndex:N.lastStepIndex,options:t,paused:false},_e.play(e,t)}stop(e){return delete re.soundsPlaying[e],_e.stop(e)}pause(e){let t=re.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return re.soundsPlaying[e]={...t,paused:true},_e.pause(e)}resume(e){let t=re.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return re.soundsPlaying[e]={options:t.options,stepIndex:N.lastStepIndex,paused:false},_e.resume(e)}volume(e,t){return _e.volume(e,t)}speed(e,t){return _e.speed(e,t)}duration(e){return _e.duration(e)}close(){return _e.close()}clear(){this.stopAll();}exportJson(){return JSON.stringify(this.export())}export(){let e={};for(let t in re.soundsPlaying){let i=re.soundsPlaying[t],s=this.find(t);s&&(e[t]={...i,sound:{options:{...s.options,autoPlay:s.autoPlay,loop:s.loop,preload:s.preload,singleInstance:s.singleInstance,url:s.options.url,volume:s.options.volume},filters:K1(s.media.filters)}});}return {soundsPlaying:e,soundAliasesOrder:re.soundAliasesOrder,filters:K1(this.filtersAll)}}removeOldSoundAndExport(){return this.export()}importJson(e){this.import(JSON.parse(e));}import(e,t=N.lastStepIndex){this.clear();try{if(e.hasOwnProperty("soundAliasesOrder"))re.soundAliasesOrder=e.soundAliasesOrder;else {console.error("[Pixi\u2019VN] The data does not have the properties soundAliasesOrder");return}if(e.hasOwnProperty("filters")){let i=e.filters;i&&(this.filtersAll=$d(i));}if(e.hasOwnProperty("playInStepIndex")){let i=e.playInStepIndex;i&&(re.soundsPlaying=i);}if(e.hasOwnProperty("sounds")){let i=e.sounds;for(let s in i){let n=i[s],o=!1,a=this.add(s,{...n.options,autoPlay:!1});if(s in re.soundsPlaying){let u=re.soundsPlaying[s];(n.options.loop||u.options&&typeof u.options=="object"&&u.options.loop||u.stepIndex===t)&&(o=!0),n.filters&&(a.filters=$d(n.filters)),o&&a.play();}}}if(e.hasOwnProperty("soundsPlaying")){let i=e.soundsPlaying;for(let s in i){let n=i[s];re.soundsPlaying[s]={paused:n.paused,stepIndex:n.stepIndex,options:n.options};let o=i[s].sound,a=!1,u;if(this.exists(s)?(u=this.find(s),o.options.url=u.options.url,o.options.volume=u.options.volume,u.options=o.options,u.autoPlay=!1,u.filters=o.filters?$d(o.filters):[]):u=this.add(s,{...o.options,autoPlay:!1}),s in re.soundsPlaying){let l=re.soundsPlaying[s];(o.options.loop||l.options&&typeof l.options=="object"&&l.options.loop||l.stepIndex===t)&&(a=!0),o.filters&&(u.filters=$d(o.filters)),a&&u.play();}}}else {console.error("[Pixi\u2019VN] The data does not have the properties soundsPlaying");return}}catch(i){console.error("[Pixi\u2019VN] Error importing data",i);}}};var Aa=class{get keysSystem(){return Be._keysSystem}setVariable(e,t){if(e=e.toLowerCase(),t==null){Be.storage.hasOwnProperty(e)&&delete Be.storage[e];return}Be.storage[e]=t;}getVariable(e){if(e=e.toLowerCase(),Be.tempStorage.hasOwnProperty(e))return Be.getTempVariable(e);if(Be.storage.hasOwnProperty(e))return Se(Be.storage[e])}removeVariable(e){e=e.toLowerCase(),Be.storage.hasOwnProperty(e)&&delete Be.storage[e];}setTempVariable(e,t){e=e.toLowerCase();let i=Be.tempStorage,s=Be.tempStorageDeadlines;if(t==null){this.removeTempVariable(e);return}else i[e]=t,s.hasOwnProperty(e)||(s[e]=N.openedLabels.length);Be.tempStorage=i,Be.tempStorageDeadlines=s;}removeTempVariable(e){e=e.toLowerCase();let t=Be.tempStorage,i=Be.tempStorageDeadlines;t.hasOwnProperty(e)&&(delete t[e],delete i[e]),Be.tempStorage=t,Be.tempStorageDeadlines=i;}setFlag(e,t){let i=this.getVariable(this.keysSystem.FLAGS_CATEGORY_KEY)||[];if(t)i.includes(e)||i.push(e);else {let s=i.indexOf(e);s>-1&&i.splice(s,1);}this.setVariable(this.keysSystem.FLAGS_CATEGORY_KEY,i);}getFlag(e){return (this.getVariable(this.keysSystem.FLAGS_CATEGORY_KEY)||[]).includes(e)}clear(){Be.storage={...Be.baseStorage};}exportJson(){return JSON.stringify(this.export())}export(){return Se(Be.storage)}importJson(e){this.import(JSON.parse(e));}import(e){this.clear();try{e?Be.storage=e:console.warn("[Pixi\u2019VN] No storage data found");}catch(t){console.error("[Pixi\u2019VN] Error importing data",t);}}};var St=new jd,N=new Ea,O=new Aa,C=new Sa;var xL="@",Ta=class extends va{sourceId;constructor(e,t=""){super(O.keysSystem.CHARACTER_CATEGORY_KEY,e+(t?xL+t:"")),this.sourceId=e;}getStorageProperty(e){let t=super.getStorageProperty(e);return t===undefined&&(t=super.getStorageProperty(e,this.sourceId)),t}};var Yd=class extends Ta{constructor(e,t){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion),this.defaultName=t.name,this.defaultSurname=t.surname,this.defaultAge=t.age,this._icon=t.icon,this._color=t.color;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}defaultSurname;get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}defaultAge;get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}_icon;get icon(){return this._icon}_color;get color(){return this._color}};
3415
+ `);}var gL={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof ee||r instanceof Tt||r instanceof we},testProp(r){switch(r){case "xAlign":case "yAlign":case "xPercentagePosition":case "yPercentagePosition":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof ee||r instanceof Tt||r instanceof we)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "xPercentagePosition":r.xPercentagePosition=t/100;break;case "yPercentagePosition":r.yPercentagePosition=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.xPercentagePosition*100,prop:"xPercentagePosition",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yPercentagePosition*100,prop:"yPercentagePosition",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},IR=gL;var I=class r{constructor(){}static _app=undefined;static get app(){if(!r._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return r._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(Wt);return e||(e=new X,e.label=Wt,this.app.stage.addChild(e)),e}static htmlLayout;static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async initialize(e,t,i,s,n){return r.canvasWidth=t,r.canvasHeight=i,r._app=new Nh,r.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=r.app,extensions:a=[],...u}=n||{};MR({app:o,extensions:[IR,...a],...u}),r._isInitialized=true,r.addCanvasIntoHTMLElement(e),window.addEventListener("resize",r.resize),r.resize(),r.gameLayer,RR();})}static addCanvasIntoHTMLElement(e){r._isInitialized?e.appendChild(r.app.canvas):console.error("[Pixi\u2019VN] GameWindowManager is not initialized");}static initializeHTMLLayout(e){let t=document.createElement("div");t.style.position="absolute",t.style.pointerEvents="none",e.appendChild(t),r.htmlLayout=t,r.resize();}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/r.canvasWidth,t/r.canvasHeight)}static get screenWidth(){return Math.floor(r.screenScale*r.canvasWidth)}static get screenHeight(){return Math.floor(r.screenScale*r.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-r.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-r.screenHeight)/2}static resize(){if(r._isInitialized){let e=r.app.canvas.style;e.width=`${r.screenWidth}px`,e.height=`${r.screenHeight}px`,e.marginLeft=`${r.horizontalMargin}px`,e.marginRight=`${r.horizontalMargin}px`,e.marginTop=`${r.verticalMargin}px`,e.marginBottom=`${r.verticalMargin}px`;}r.htmlLayout&&(r.htmlLayout.style.width=`${r.screenWidth}px`,r.htmlLayout.style.height=`${r.screenHeight}px`,r.htmlLayout.style.marginLeft=`${r.horizontalMargin}px`,r.htmlLayout.style.marginRight=`${r.horizontalMargin}px`,r.htmlLayout.style.marginTop=`${r.verticalMargin}px`,r.htmlLayout.style.marginBottom=`${r.verticalMargin}px`);}static get childrenAliasesOrder(){return r.gameLayer.children.filter(e=>e.label).sort((e,t)=>r.gameLayer.getChildIndex(e)-r.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(r._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static _currentTickers={};static _currentTickersSequence={};static _currentTickersTimeouts={};static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static _tickersOnPause={};static generateTickerId(e){try{return (0,DR.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]),r._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),r._currentTickersTimeouts[e]&&delete r._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),r.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(r._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&r.removeTickerTimeout(i);}else r._currentTickersTimeouts[i].aliases=n;});}};var Sa=class{get app(){return I.app}get gameLayer(){return I.gameLayer}get isInitialized(){return I._isInitialized}get htmlLayout(){return I.htmlLayout}set htmlLayout(e){I.htmlLayout=e;}get canvasWidth(){return I.canvasWidth}get canvasHeight(){return I.canvasHeight}set canvasWidth(e){I.canvasWidth=e;}set canvasHeight(e){I.canvasHeight=e;}get screen(){return this.app.screen}async initialize(e,t,i,s,n){return await I.initialize(e,t,i,s,n)}initializeHTMLLayout(e){return I.initializeHTMLLayout(e)}get children(){return I.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {console.error(`[Pixi\u2019VN] Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {console.error(`[Pixi\u2019VN] Canvas element ${e} not found`);return}}e instanceof X&&(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 Tt?await Y1(t,e,{ignoreTexture:true}):t instanceof ee?await zd(t,e,{ignoreTexture:true}):t instanceof Bt?await Wd(t,e,{ignoreTexture:true}):t instanceof ar?await $1(t,e):t instanceof we?await w1(t,e):t instanceof X&&await Ii(t,e);}transferTickers(e,t,i="move"){I._currentTickersSequence[e]&&(i==="move"?I._currentTickersSequence[t]=Se(I._currentTickersSequence[e]):i==="duplicate"&&(I._currentTickersSequence[t]=Se(I._currentTickersSequence[e]))),Object.entries(I._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.canvasElementAliases.includes(e)&&(i==="move"?n.canvasElementAliases=n.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&n.canvasElementAliases.find(o=>o===e)&&n.canvasElementAliases.push(t),n.args.hasOwnProperty(Ql))){let o=n.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?n.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(n.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(I._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));}),I._currentTickersSequence[t]&&Object.keys(I._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&I._currentTickersSequence[e]&&Object.keys(I._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===Wt){console.error(`[Pixi\u2019VN] The alias ${Wt} 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)?console.error(`[Pixi\u2019VN] The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===undefined&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==undefined?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}addCanvasElement(e,t){this.add(e,t);}remove(e,t={}){if(e===Wt){console.error(`[Pixi\u2019VN] The alias ${Wt} 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);});});}removeCanvasElement(e){this.remove(e);}find(e){if(e===Wt)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}getCanvasElement(e){return this.find(e)}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren(),this.removeAllTickers();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return I._currentTickers}get currentTickersList(){return Object.values(I._currentTickers)}get currentTickersSteps(){return I._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!Vd(i,t.args,t.duration,t.priority)){console.error(`[Pixi\u2019VN] Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:Se(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=I.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{I.removeTickerTimeoutInfo(o),I._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:Ql in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);I.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){I._currentTickers[e]=t,t.fn=s=>{let n=I._currentTickers[e];if(n){let o=n.canvasElementAliases;if(t.createdByTicketSteps){if(this.isTickerPaused(t.createdByTicketSteps.canvasElementAlias,t.createdByTicketSteps.id))return}else o=o.filter(a=>!this.isTickerPaused(a,e));i?.fn(s,n.args,o,e);}},this.app.ticker.add(t.fn,undefined,t.priority);}pushEndOfTicker(e,t,i){t.onEndOfTicker=()=>{i.onEndOfTicker(t.canvasElementAliases,e,t.args);};}addTickersSteps(e,t,i=0){return this.addTickersSequence(e,t,i)}addTickersSequence(e,t,i=0){if(t.length==0){console.warn("[Pixi\u2019VN] The steps of the tickers is empty");return}e in I._currentTickersSequence||(I._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===qt||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:Se(o.args),duration:o.duration})},n=I.generateTickerId(s);return I._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!I._currentTickersSequence[e]||!I._currentTickersSequence[e][t])return;let i=I._currentTickersSequence[e][t].steps[I._currentTickersSequence[e][t].currentStepNumber];if(i===qt&&(i=I._currentTickersSequence[e][t].steps[0],I._currentTickersSequence[e][t].currentStepNumber=0,i===qt)){console.error("[Pixi\u2019VN] TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=I._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),I.removeTickerTimeoutInfo(u);},i.duration*1e3);I.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=Vd(i.ticker,i.args,i.duration,i.priority);if(!s){console.error(`[Pixi\u2019VN] Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:Se(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=I.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=I._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Ql in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),I.removeTickerTimeoutInfo(u);},s.duration*1e3);I.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(I._currentTickersSequence[e]&&I._currentTickersSequence[e][t]){let i=I._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,I._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&I._currentTickersSequence[e]&&I._currentTickersSequence[e][t]&&(delete I._currentTickersSequence[e][t],Object.entries(I._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=I._currentTickers[e],s=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!s&&i.duration==null&&i.createdByTicketSteps&&this.nextTickerStep(i.createdByTicketSteps.canvasElementAlias,i.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(I._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),I._currentTickersSequence[s]&&delete I._currentTickersSequence[s],I.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof Mt?i=t.id:i=t.prototype.id,e.forEach(s=>{I._currentTickersSequence[s]&&Object.entries(I._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete I._currentTickersSequence[s][n];});}),Object.entries(I._currentTickers).forEach(([s,n])=>{n.id===i&&(I._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(I._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(I._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(I._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Ql in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(I._currentTickersSequence).forEach(([e,t])=>{t===undefined&&delete I._currentTickersSequence[e];}),Object.entries(I._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&I.removeTickerTimeout(e);});}removeAllTickers(){I._currentTickersSequence={},Object.keys(I._currentTickers).forEach(e=>{this.removeTicker(e);}),I._currentTickers={};for(let e in I._currentTickersTimeouts)I.removeTickerTimeout(e);I._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},I._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=I._currentTickers[t];if(i){if(i.args.hasOwnProperty(Ql)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete I._currentTickers[t];}});}putOnPauseTicker(e,t={}){this.pauseTicker(e,t);}pauseTicker(e,t={}){let i=I._tickersOnPause[e];if(!i){I._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?I._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:I._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?I._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:I._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTickerPaused(e){this.resumeTicker(e);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete I._tickersOnPause[t];});}isTickerPaused(e,t){let i=I._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}completeTickerOnStepEnd(e){e.alias?I._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):I._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=I._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(qt)?console.error(`[Pixi\u2019VN] The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(s=>{if(typeof s=="object"&&"ticker"in s){let n=Vd(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=I._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===Wt){console.error(`[Pixi\u2019VN] The alias ${Wt} is reserved`);return}return I.app.stage.addChild(t)}getLayer(e){return I.app.stage.getChildByLabel(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAll();}exportJson(){return JSON.stringify(this.export())}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=C1(t));}),{tickers:Se(I.currentTickersWithoutCreatedBySteps),tickersSteps:Se(I._currentTickersSequence),elements:Se(e),stage:Se(xa(this.gameLayer)),elementAliasesOrder:Se(I.childrenAliasesOrder),tickersOnPause:Se(I._tickersOnPause),tickersToCompleteOnStepEnd:Se(I._tickersToCompleteOnStepEnd)}}async importJson(e){await this.import(JSON.parse(e));}async import(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,s=e.elementAliasesOrder,n=s.filter(a=>i[a]).map(a=>bb(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),I.childrenAliasesOrder.push(l);});}else {console.error("[Pixi\u2019VN] The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Ii(this.gameLayer,e.stage,{ignoreScale:!0}):console.error("[Pixi\u2019VN] The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([s,n])=>{let o=n.canvasElementAliases,a=Vd(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else console.error(`[Pixi\u2019VN] Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{I._currentTickersSequence[s]=n,Object.keys(n).forEach(o=>{this.runTickersSequence(s,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(s=>{let n=i[s];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(i[s].tickerIdsExcluded=n.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(i[s].tickerIdsIncluded=n.tickerIdsIncluded.map(o=>t[o]||o));}),I._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds.map(o=>({id:t[o.id]||o.id})),n=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));I._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){console.error("[Pixi\u2019VN] Error importing data",t);}}};var FR=us(OR());function LR(r,e){let t=Se(r);return e.forEach(i=>{let s=t;i.path&&i.path.length>0?i.path.forEach((n,o)=>{if(i.path&&o===i.path.length-1){if(i.kind==="E"||i.kind==="D")s[n]=i.lhs;else if(i.kind==="N")Number.isInteger(n)?Array.isArray(s)&&s.splice(n,1):typeof n=="string"&&delete s[n];else if(i.kind==="A"){let a=i.index;i.item.kind==="N"?s[n].splice(a,1):i.item.kind==="E"||i.item.kind==="D"?s[n][a]=i.item.lhs:i.item.kind==="A"?console.warn("[Pixi\u2019VN] Nested array found, skipping diff",i):console.warn("[Pixi\u2019VN] No array found, skipping diff",i);}}else s=s[n];}):console.warn("[Pixi\u2019VN] No path found, skipping diff",i);}),t}var G=class r{constructor(){}static _stepsHistory=[];static stepsRunning=0;static goNextRequests=0;static choiseMadeTemp=undefined;static get allOpenedLabels(){return O.getVariable(O.keysSystem.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(e){O.setVariable(O.keysSystem.OPENED_LABELS_COUNTER_KEY,e);}static getCurrentStepTimesCounterData(e=""){let t=r.currentLabelStepIndex;if(t===null)return console.error("[Pixi\u2019VN] currentLabelStepIndex is null"),null;let i=`${t}${e}`,s=r.currentLabelId,n=r._currentLabel;if(!s||t===null||!n)return console.error("[Pixi\u2019VN] currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let o=n.getStepSha1(t)||"error",a=O.getVariable(O.keysSystem.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[s]||(a[s]={}),(!a[s][i]||a[s][i].stepSha1!=o)&&(a[s][i]={stepSha1:o}),a[s][i]}static setCurrentStepTimesCounterData(e="",t){let i=r.currentLabelStepIndex,s=i+e,n=r.currentLabelId;if(!n||i===null){console.error("[Pixi\u2019VN] currentLabelId or currentLabelStepIndex is null");return}let o=O.getVariable(O.keysSystem.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[n]||(o[n]={}),o[n][s]=t,O.setVariable(O.keysSystem.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static getCurrentStepTimesCounter(e=""){let t=r._lastStepIndex,i=r.getCurrentStepTimesCounterData(e);if(!i)return console.error("[Pixi\u2019VN] getCurrentStepTimesCounter obj is null"),0;let s=i.lastStepIndexs||[];return s.find(o=>o===t)||(s.push(t),i.lastStepIndexs=s,r.setCurrentStepTimesCounterData(e,i)),s.length}static getRandomNumber(e,t,i={}){let s=i.nestedId||"";if(i.onceOnly||false){let o=r.getCurrentStepTimesCounterData(s);if(!o)return;let a=o.usedRandomNumbers||{},u=Array.from({length:t-e+1},(h,f)=>f+e).filter(h=>!a[`${e}-${t}`]?.includes(h));if(u.length===0)return;let l=Math.floor(Math.random()*u.length),c=u[l];return a[`${e}-${t}`]||(a[`${e}-${t}`]=[]),a[`${e}-${t}`].push(c),o.usedRandomNumbers=a,r.setCurrentStepTimesCounterData(s,o),c}return Math.floor(Math.random()*(t-e+1))+e}static resetCurrentStepTimesCounter(e=""){let t=r.currentLabelStepIndex,i=t+e,s=r.currentLabelId;if(!s||t===null){console.error("[Pixi\u2019VN] currentLabelId or currentLabelStepIndex is null");return}let n=O.getVariable(O.keysSystem.CURRENT_STEP_TIMES_COUNTER_KEY)||{};n[s]||(n[s]={}),n[s][i]={lastStepIndexs:[],stepSha1:""},O.setVariable(O.keysSystem.CURRENT_STEP_TIMES_COUNTER_KEY,n);}static get allChoicesMade(){return O.getVariable(O.keysSystem.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(e){O.setVariable(O.keysSystem.ALL_CHOICES_MADE_KEY,e);}static _lastStepIndex=0;static increaseLastStepIndex(){r._lastStepIndex++;}static _openedLabels=[];static get _currentLabel(){if(r.currentLabelId)return _r(r.currentLabelId)}static get currentLabelId(){if(r._openedLabels.length>0)return r._openedLabels[r._openedLabels.length-1].label}static get currentLabelStepIndex(){return r._openedLabels.length>0?r._openedLabels[r._openedLabels.length-1].currentStepIndex:null}static get lastHistoryStep(){return r._stepsHistory.length>0?r._stepsHistory[r._stepsHistory.length-1]:null}static _originalStepData=undefined;static get originalStepData(){return r._originalStepData?Se(r._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:undefined},labelIndex:-1,openedLabels:[]}}static set originalStepData(e){r._originalStepData=Se(e);}static get currentStepData(){return {path:vb(),storage:O.export(),canvas:C.export(),sound:St.removeOldSoundAndExport(),labelIndex:r.currentLabelStepIndex||0,openedLabels:Se(r._openedLabels)}}static addLabelHistory(e,t){let i=r.allOpenedLabels,s=r.allOpenedLabels[e]?.biggestStep||0,n=r.allOpenedLabels[e]?.openCount||0;(!s||s<t)&&(i[e]={biggestStep:t,openCount:n},r.allOpenedLabels=i);}static addChoicesMade(e,t,i,s){let n=r.allChoicesMade,o=n.findIndex(a=>a.labelId===e&&a.stepIndex===t&&a.choiceIndex===s&&a.stepSha1===i);o<0?n.push({labelId:e,stepIndex:t,choiceIndex:s,stepSha1:i,madeTimes:1}):n[o].madeTimes++,r.allChoicesMade=n;}static pushNewLabel(e){if(!_r(e))throw new Error(`[Pixi\u2019VN] Label ${e} not found`);r._openedLabels.push({label:e,currentStepIndex:0});let i=r.allOpenedLabels,s=r.allOpenedLabels[e]?.biggestStep||0,n=r.allOpenedLabels[e]?.openCount||0;i[e]={biggestStep:s,openCount:n+1},r.allOpenedLabels=i;}static increaseCurrentStepIndex(){if(r._openedLabels.length>0){let e=r._openedLabels[r._openedLabels.length-1];r._openedLabels[r._openedLabels.length-1]={...e,currentStepIndex:e.currentStepIndex+1};}}static restoreLastLabelList(){r._openedLabels=r.originalStepData.openedLabels;}static goBackInternal(e,t){if(e<=0||r._stepsHistory.length==0)return t;let i=r.lastHistoryStep;if(i)try{let s=LR(t,i.diff);return r._lastStepIndex=i.index,r._stepsHistory.pop(),r.goBackInternal(e-1,s)}catch(s){return console.error("[Pixi\u2019VN] Error applying diff",s),t}else return t}static async restoreFromHistoryStep(e,t){r._originalStepData=e,r._openedLabels=Se(e.openedLabels),O.import(Se(e.storage)),await C.import(Se(e.canvas)),St.import(Se(e.sound),r._lastStepIndex-1),t(e.path);}};var Be=class r{static storage={};static baseStorage={};constructor(){}static get _keysSystem(){return {CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",FLAGS_CATEGORY_KEY:"___flags___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",TEMP_STORAGE_KEY:"___temp_storage___",TEMP_STORAGE_DEADLINES_KEY:"___temp_storage_deadlines___"}}static get tempStorage(){return r.storage[r._keysSystem.TEMP_STORAGE_KEY]||{}}static set tempStorage(e){r.storage[r._keysSystem.TEMP_STORAGE_KEY]=e;}static get tempStorageDeadlines(){return r.storage[r._keysSystem.TEMP_STORAGE_DEADLINES_KEY]||{}}static set tempStorageDeadlines(e){r.storage[r._keysSystem.TEMP_STORAGE_DEADLINES_KEY]=e;}static getTempVariable(e){if(e=e.toLowerCase(),r.tempStorage.hasOwnProperty(e))return Se(r.tempStorage[e])}static clearOldTempVariables(e){let t=r.tempStorage,i=r.tempStorageDeadlines;if(e===0)t={},i={};else for(let s in i)i[s]<e&&(delete t[s],delete i[s]);r.tempStorage=t,r.tempStorageDeadlines=i;}static saveStorageAsBasicStorage(){r.baseStorage={...r.storage};}};var Ea=class{get stepsHistory(){return G._stepsHistory}get currentStepTimesCounter(){return G.getCurrentStepTimesCounter()}set currentStepTimesCounter(e){G.resetCurrentStepTimesCounter();}getRandomNumber(e,t,i={}){return G.getRandomNumber(e,t,i)}get lastStepIndex(){return G._lastStepIndex}get openedLabels(){return G._openedLabels}get currentLabel(){return G._currentLabel}addStepHistory(e,t){let i=G.currentStepData;if(G.originalStepData&&G.originalStepData.openedLabels.length===i.openedLabels.length)try{let n=JSON.stringify(G.originalStepData.openedLabels),o=JSON.stringify(i.openedLabels);if(n===o&&G.originalStepData.path===i.path&&G.originalStepData.labelIndex===i.labelIndex)return}catch(n){console.error("[Pixi\u2019VN] Error comparing openedLabels",n);}let s=(0, FR.diff)(G.originalStepData,i);if(s){let n,o,a;O.getVariable(O.keysSystem.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.lastStepIndex&&(n=this.dialogue),O.getVariable(O.keysSystem.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.lastStepIndex&&(o=O.getVariable(O.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY)),O.getVariable(O.keysSystem.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.lastStepIndex&&(a=O.getVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY)),G._stepsHistory.push({diff:s,currentLabel:G.currentLabelId,dialoge:n,choices:o,stepSha1:e,index:this.lastStepIndex,labelStepIndex:G.currentLabelStepIndex,choiceIndexMade:t,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices}),G.originalStepData=i;}G.increaseLastStepIndex();}closeCurrentLabel(){if(!G.currentLabelId){console.warn("[Pixi\u2019VN] No label to close");return}if(!this.currentLabel){console.error("[Pixi\u2019VN] currentLabel not found");return}G._openedLabels.pop(),Be.clearOldTempVariables(this.openedLabels.length);}closeAllLabels(){for(;G._openedLabels.length>0;)this.closeCurrentLabel(),Be.clearOldTempVariables(this.openedLabels.length);}get narrativeHistory(){let e=[];return G._stepsHistory.forEach(t=>{let i=t.dialoge,s=t.choices,n=t.inputValue;if(e.length>0&&e[e.length-1].choices&&!e[e.length-1].playerMadeChoice&&t.currentLabel){let o=e[e.length-1].choices;if(o){let a=false;t.choiceIndexMade!==undefined&&o.length>t.choiceIndexMade&&(o[t.choiceIndexMade].isResponse=true,a=true),e[e.length-1].playerMadeChoice=a,e[e.length-1].choices=o;}}if(n&&e.length>0&&(e[e.length-1].inputValue=n),i||s){let o=s?.map((a,u)=>{let l=false;return a.oneTime&&t.alreadyMadeChoices&&t.alreadyMadeChoices.includes(u)&&(l=true),{text:a.text,type:a.type,isResponse:false,hidden:l}});if(o&&o.every(a=>a.hidden)){let a=o.find(u=>u.hidden===false);a&&(a.hidden=false);}e.push({dialoge:i,playerMadeChoice:false,choices:o,stepIndex:t.index});}}),e}removeNarrativeHistory(e){e?G._stepsHistory.splice(0,e):G._stepsHistory=[];}isLabelAlreadyCompleted(e){let t;typeof e=="string"?t=e:t=e.id;let s=G.allOpenedLabels[t]?.biggestStep||0;if(s){let n=_r(t);if(n)return n.steps.length<=s}return false}get alreadyCurrentStepMadeChoicesObj(){let e=G.currentLabelStepIndex,t=this.currentLabel;if(e===null||!t)return;let i=t.getStepSha1(e);return i||console.warn("[Pixi\u2019VN] stepSha not found"),G.allChoicesMade.filter(s=>s.labelId===t?.id&&s.stepIndex===e&&s.stepSha1===i)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(e=>e.choiceIndex)}get isCurrentStepAlreadyOpened(){let e=G.currentLabelId;if(e){let t=G.allOpenedLabels[e]?.openCount||0;if(G.currentLabelStepIndex&&t>=G.currentLabelStepIndex)return true}return false}getTimesLabelOpened(e){return G.allOpenedLabels[e]?.openCount||0}getTimesChoiceMade(e){return this.alreadyCurrentStepMadeChoicesObj?.find(t=>t.choiceIndex===e)?.madeTimes||0}getCanGoNext(e){let t=e?.showWarn||false,i=this.choiceMenuOptions;return i&&i.length>0?(t&&console.warn("[Pixi\u2019VN] The player must make a choice"),false):this.isRequiredInput?(t&&console.warn("[Pixi\u2019VN] The player must enter a value"),false):true}get canGoNext(){return G.stepsRunning!==0?false:this.getCanGoNext()}async goNext(e,t={}){let{runNow:i=false}=t;if(!(!i&&!this.getCanGoNext({showWarn:true}))){if(!i&&G.stepsRunning!==0){G.goNextRequests++;return}return this.currentLabel&&this.currentLabel.onStepEnd&&await this.currentLabel.onStepEnd(G.currentLabelStepIndex||0,this.currentLabel),G.stepsRunning===0&&(I._tickersToCompleteOnStepEnd.tikersIds.forEach(({id:s})=>{C.forceCompletionOfTicker(s);}),I._tickersToCompleteOnStepEnd.stepAlias.forEach(({alias:s,id:n})=>{C.forceCompletionOfTicker(n,s);}),I._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]}),G.increaseCurrentStepIndex(),await this.runCurrentStep(e,t)}}async runCurrentStep(e,t={}){let{choiseMade:i}=t;if(G.currentLabelId){let s=G.currentLabelStepIndex;if(s===null){console.error("[Pixi\u2019VN] currentLabelStepIndex is null");return}let n=G._currentLabel;if(!n){console.error("[Pixi\u2019VN] currentLabel not found");return}if(n.steps.length>s){let o=n.onStepStart;o&&await o(s,n);let a=n.steps[s],u=n.getStepSha1(s);u||console.warn("[Pixi\u2019VN] stepSha not found");try{G.stepsRunning++;let l=await a(e,{labelId:n.id});if(this.choiceMenuOptions?.length===1&&this.choiceMenuOptions[0].autoSelect){let c=this.choiceMenuOptions[0];l=await this.selectChoice(c,e);}if(i!==void 0&&G._stepsHistory.length>0){let c=G._stepsHistory[G._stepsHistory.length-1];G.addChoicesMade(c.currentLabel||"error",typeof c.labelStepIndex=="number"?c.labelStepIndex:-1,c.stepSha1||"error",i),G.choiseMadeTemp=i;}return G.stepsRunning--,G.stepsRunning===0&&(G.addLabelHistory(n.id,s),this.addStepHistory(u||"error",G.choiseMadeTemp),G.choiseMadeTemp=void 0,G.goNextRequests>0)?(G.goNextRequests--,await this.goNext(e)):l}catch(l){console.error("[Pixi\u2019VN] Error running step",l),this.onStepError&&this.onStepError(l,e);return}}else {if(this.openedLabels.length>1)return this.closeCurrentLabel(),await this.goNext(e,t);if(this.openedLabels.length===1)return G.restoreLastLabelList(),this.onGameEnd?await this.onGameEnd(e,{labelId:"end"}):undefined}}else if(this.openedLabels.length===0){if(G.restoreLastLabelList(),this.onGameEnd)return await this.onGameEnd(e,{labelId:"end"});console.error("[Pixi\u2019VN] The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");return}else console.error("[Pixi\u2019VN] currentLabelId not found");}async callLabel(e,t){let i,s;typeof e=="string"?s=e:(s=e.id,typeof e.choiseIndex=="number"&&(i=e.choiseIndex));try{if(s===Eb){let a={label:bn(i),text:"",closeCurrentLabel:!1,type:"close",oneTime:!1,onlyHaveNoChoice:!1,autoSelect:!1,props:{}};return this.closeChoiceMenu(a,t)}let n=_r(s);if(!n)throw new Error(`[Pixi\u2019VN] Label ${s} not found`);this.currentLabel&&this.currentLabel.onStepEnd&&await this.currentLabel.onStepEnd(G.currentLabelStepIndex||0,this.currentLabel),G.pushNewLabel(n.id);}catch(n){console.error("[Pixi\u2019VN] Error calling label",n);return}return await this.runCurrentStep(t,{choiseMade:i})}async jumpLabel(e,t){this.closeCurrentLabel();let i,s;typeof e=="string"?s=e:(s=e.id,typeof e.choiseIndex=="number"&&(i=e.choiseIndex));try{if(s===Eb){let a={label:bn(i),text:"",closeCurrentLabel:!1,type:"close",oneTime:!1,onlyHaveNoChoice:!1,autoSelect:!1,props:{}};return this.closeChoiceMenu(a,t)}let n=_r(s);if(!n)throw new Error(`[Pixi\u2019VN] Label ${s} not found`);this.currentLabel&&this.currentLabel.onStepEnd&&await this.currentLabel.onStepEnd(G.currentLabelStepIndex||0,this.currentLabel),G.pushNewLabel(n.id);}catch(n){console.error("[Pixi\u2019VN] Error jumping label",n);return}return await this.runCurrentStep(t,{choiseMade:i})}async selectChoice(e,t){if(this.choiceMenuOptions=undefined,e.type=="call")return await this.callLabel(e.label,t);if(e.type=="jump")return await this.jumpLabel(e.label,t);if(e.type=="close")return await this.closeChoiceMenu(e,t);throw new Error(`[Pixi\u2019VN] Type ${e.type} not found`)}async closeChoiceMenu(e,t){let i=e.label,s;return typeof i.choiseIndex=="number"&&(s=i.choiseIndex),e.closeCurrentLabel&&this.closeCurrentLabel(),this.goNext(t,{choiseMade:s})}async goBack(e,t=1){if(t<=0){console.warn("[Pixi\u2019VN] Steps must be greater than 0");return}if(G._stepsHistory.length<=1){console.warn("[Pixi\u2019VN] No steps to go back");return}let i=G.goBackInternal(t,G.originalStepData);i?await G.restoreFromHistoryStep(i,e):console.error("[Pixi\u2019VN] Error going back");}get canGoBack(){return G._stepsHistory.length>1}onGameEnd=undefined;onStepError=undefined;get dialogue(){return O.getVariable(O.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY)}set dialogue(e){if(!e){O.setVariable(O.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY,undefined);return}let t="",i,s;if(typeof e=="string"?(t=e,s=new ui(t,i)):Array.isArray(e)?(t=e.join(),s=new ui(t,i)):e instanceof ui?s=e:(Array.isArray(e.text)?t=e.text.join():t=e.text,e.character&&(typeof e.character=="string"?i=e.character:i=e.character.id),s=new ui(t,i)),this.dialogGlue){let n=O.getVariable(O.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY);n&&(s.text=`${n.text}${s.text}`,s.character=s.character||n.character),this.dialogGlue=false;}O.setVariable(O.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY,s),O.setVariable(O.keysSystem.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.lastStepIndex);}get choiceMenuOptions(){let e=O.getVariable(O.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(e){let t=[],i=[];e.forEach((n,o)=>{if(n.type===ql){let u=bn(o),l=new ns(n.text,{closeCurrentLabel:n.closeCurrentLabel,oneTime:n.oneTime,onlyHaveNoChoice:n.onlyHaveNoChoice,autoSelect:n.autoSelect});l.label=u,t.push(l);return}let a=_r(n.label);if(a){let u=new ie(a.id,a.steps,{onStepStart:a.onStepStart,choiseIndex:o});t.push(new Te(n.text,u,n.props,{type:n.type,oneTime:n.oneTime,onlyHaveNoChoice:n.onlyHaveNoChoice,autoSelect:n.autoSelect}));}});let s=this.alreadyCurrentStepMadeChoices;if(t=t.filter((n,o)=>n.oneTime&&s&&s.includes(o)?false:n.onlyHaveNoChoice?(i.push(n),false):true),t.length>0)return t;if(i.length>0)return [i[0]]}}set choiceMenuOptions(e){if(!e){O.setVariable(O.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY,undefined);return}let t=e.map(i=>i instanceof ns?{text:i.text,type:ql,closeCurrentLabel:i.closeCurrentLabel,oneTime:i.oneTime,onlyHaveNoChoice:i.onlyHaveNoChoice,autoSelect:i.autoSelect}:{...i,label:i.label.id});O.setVariable(O.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY,t),O.setVariable(O.keysSystem.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.lastStepIndex);}get dialogGlue(){return O.getFlag(O.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(e){O.setFlag(O.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,e);}get inputValue(){return O.getVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(e){this.removeInputRequest(),O.setVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY,e),O.setVariable(O.keysSystem.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.lastStepIndex);}get isRequiredInput(){return O.getVariable(O.keysSystem.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return O.getVariable(O.keysSystem.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(e,t){e.isRequired=true,O.setVariable(O.keysSystem.CURRENT_INPUT_INFO_MEMORY_KEY,e),t!==undefined?O.setVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY,t):O.removeVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){O.removeVariable(O.keysSystem.CURRENT_INPUT_INFO_MEMORY_KEY),O.removeVariable(O.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){G._stepsHistory=[],G._openedLabels=[],G._lastStepIndex=0,G._originalStepData=undefined;}exportJson(){return JSON.stringify(this.export())}export(){return {stepsHistory:G._stepsHistory,openedLabels:G._openedLabels,lastStepIndex:this.lastStepIndex,originalStepData:G._originalStepData}}async importJson(e){await this.import(JSON.parse(e));}async import(e){this.clear();try{if(e.hasOwnProperty("stepsHistory")?G._stepsHistory=e.stepsHistory:console.warn("[Pixi\u2019VN] Could not import stepsHistory data, so will be ignored"),e.hasOwnProperty("openedLabels")?G._openedLabels=e.openedLabels:console.warn("[Pixi\u2019VN] Could not import openedLabels data, so will be ignored"),e.hasOwnProperty("lastStepIndex")?G._lastStepIndex=e.lastStepIndex:console.warn("[Pixi\u2019VN] Could not import lastStepIndex data, so will be ignored"),e.hasOwnProperty("originalStepData")?G._originalStepData=e.originalStepData:console.warn("[Pixi\u2019VN] Could not import originalStepData data, so will be ignored"),this.currentLabel&&this.currentLabel.onLoadingLabel){await this.currentLabel.onLoadingLabel(G.currentLabelStepIndex||0,this.currentLabel);for(let t=0;t<this.openedLabels.length;t++){let i=this.openedLabels[t],s=_r(i.label);s&&s.onLoadingLabel&&await s.onLoadingLabel(i.currentStepIndex,s);}}}catch(t){console.error("[Pixi\u2019VN] Error importing data",t);}}};function $d(r){let e=[];for(let t of r)t.type==="TelephoneFilter"?e.push(new Fe.TelephoneFilter):t.type==="StreamFilter"?e.push(new Fe.StreamFilter):t.type==="StereoFilter"?e.push(new Fe.StereoFilter(t.pan)):t.type==="ReverbFilter"?e.push(new Fe.ReverbFilter(t.seconds,t.decay,t.reverse)):t.type==="MonoFilter"?e.push(new Fe.MonoFilter):t.type==="EqualizerFilter"?e.push(new Fe.EqualizerFilter(t.f32,t.f64,t.f125,t.f250,t.f500,t.f1k,t.f2k,t.f4k,t.f8k,t.f16k)):t.type==="DistortionFilter"?e.push(new Fe.DistortionFilter(t.amount)):console.error("[Pixi\u2019VN] Unknown sound filter type");return e}function K1(r){if(!r)return;let e=[];for(let t of r)t instanceof Fe.TelephoneFilter?e.push({type:"TelephoneFilter"}):t instanceof Fe.StreamFilter?e.push({type:"StreamFilter"}):t instanceof Fe.StereoFilter?e.push({type:"StereoFilter",pan:t.pan}):t instanceof Fe.ReverbFilter?e.push({type:"ReverbFilter",seconds:t.seconds,decay:t.decay,reverse:t.reverse}):t instanceof Fe.MonoFilter?e.push({type:"MonoFilter"}):t instanceof Fe.EqualizerFilter?e.push({type:"EqualizerFilter",f32:t.f32,f64:t.f64,f125:t.f125,f250:t.f250,f500:t.f500,f1k:t.f1k,f2k:t.f2k,f4k:t.f4k,f8k:t.f8k,f16k:t.f16k}):t instanceof Fe.DistortionFilter?e.push({type:"DistortionFilter",amount:t.amount}):console.error("[Pixi\u2019VN] Unknown sound filter type");return e}var jd=class extends Ul{get context(){return _e.context}get filtersAll(){return _e.filtersAll}set filtersAll(e){_e.filtersAll=e.filter(t=>!(t instanceof Fe.Filter));}get supported(){return _e.supported}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}add(e,t){if(typeof e=="object")throw new Error("[Pixi\u2019VN] The method add(map: SoundSourceMap, globalOptions?: Options) is deprecated. Use add(alias: string, options: Options | string | ArrayBuffer | AudioBuffer | HTMLAudioElement | Sound): Sound; instead.");this.exists(e)&&this.remove(e),t instanceof pr&&(t=t.options);let i;if(t instanceof yn)i=t;else {let s=this.getOptions(t||{});i=yn.from(s);}return i.alias=e,!re.soundAliasesOrder.includes(e)&&re.soundAliasesOrder.push(e),re.sounds[e]=i,_e.add(e,i),i}get useLegacy(){return _e.useLegacy}set useLegacy(e){_e.useLegacy=e;}get disableAutoPause(){return _e.disableAutoPause}set disableAutoPause(e){_e.disableAutoPause=e;}remove(e){return re.soundAliasesOrder=re.soundAliasesOrder.filter(t=>t!==e),delete re.soundsPlaying[e],delete re.sounds[e],_e.remove(e)}get volumeAll(){return _e.volumeAll}set volumeAll(e){_e.volumeAll=e;}get speedAll(){return _e.speedAll}set speedAll(e){_e.speedAll=e;}togglePauseAll(){return _e.togglePauseAll()}pauseAll(){return _e.pauseAll()}resumeAll(){return _e.resumeAll()}toggleMuteAll(){return _e.toggleMuteAll()}muteAll(){return _e.muteAll()}unmuteAll(){return _e.unmuteAll()}removeAll(){return re.soundAliasesOrder=[],re.soundsPlaying={},re.sounds={},_e.removeAll()}stopAll(){for(let e in re.sounds)re.sounds[e].stop();return re.soundsPlaying={},_e.stopAll()}exists(e,t){return _e.exists(e,t)||e in re.sounds}isPlaying(){return _e.isPlaying()}find(e){let t=re.sounds[e];return t||(t=_e.find(e),t&&(re.sounds[e]=t),t)}play(e,t){if(!this.exists(e))throw new Error("[Pixi\u2019VN] The alias is not found in the sound library.");return re.soundsPlaying[e]={stepIndex:N.lastStepIndex,options:t,paused:false},_e.play(e,t)}stop(e){return delete re.soundsPlaying[e],_e.stop(e)}pause(e){let t=re.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return re.soundsPlaying[e]={...t,paused:true},_e.pause(e)}resume(e){let t=re.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return re.soundsPlaying[e]={options:t.options,stepIndex:N.lastStepIndex,paused:false},_e.resume(e)}volume(e,t){return _e.volume(e,t)}speed(e,t){return _e.speed(e,t)}duration(e){return _e.duration(e)}close(){return _e.close()}clear(){this.stopAll();}exportJson(){return JSON.stringify(this.export())}export(){let e={};for(let t in re.soundsPlaying){let i=re.soundsPlaying[t],s=this.find(t);s&&(e[t]={...i,sound:{options:{...s.options,autoPlay:s.autoPlay,loop:s.loop,preload:s.preload,singleInstance:s.singleInstance,url:s.options.url,volume:s.options.volume},filters:K1(s.media.filters)}});}return {soundsPlaying:e,soundAliasesOrder:re.soundAliasesOrder,filters:K1(this.filtersAll)}}removeOldSoundAndExport(){return this.export()}importJson(e){this.import(JSON.parse(e));}import(e,t=N.lastStepIndex){this.clear();try{if(e.hasOwnProperty("soundAliasesOrder"))re.soundAliasesOrder=e.soundAliasesOrder;else {console.error("[Pixi\u2019VN] The data does not have the properties soundAliasesOrder");return}if(e.hasOwnProperty("filters")){let i=e.filters;i&&(this.filtersAll=$d(i));}if(e.hasOwnProperty("playInStepIndex")){let i=e.playInStepIndex;i&&(re.soundsPlaying=i);}if(e.hasOwnProperty("sounds")){let i=e.sounds;for(let s in i){let n=i[s],o=!1,a=this.add(s,{...n.options,autoPlay:!1});if(s in re.soundsPlaying){let u=re.soundsPlaying[s];(n.options.loop||u.options&&typeof u.options=="object"&&u.options.loop||u.stepIndex===t)&&(o=!0),n.filters&&(a.filters=$d(n.filters)),o&&a.play();}}}if(e.hasOwnProperty("soundsPlaying")){let i=e.soundsPlaying;for(let s in i){let n=i[s];re.soundsPlaying[s]={paused:n.paused,stepIndex:n.stepIndex,options:n.options};let o=i[s].sound,a=!1,u;if(this.exists(s)?(u=this.find(s),o.options.url=u.options.url,o.options.volume=u.options.volume,u.options=o.options,u.autoPlay=!1,u.filters=o.filters?$d(o.filters):[]):u=this.add(s,{...o.options,autoPlay:!1}),s in re.soundsPlaying){let l=re.soundsPlaying[s];(o.options.loop||l.options&&typeof l.options=="object"&&l.options.loop||l.stepIndex===t)&&(a=!0),o.filters&&(u.filters=$d(o.filters)),a&&u.play();}}}else {console.error("[Pixi\u2019VN] The data does not have the properties soundsPlaying");return}}catch(i){console.error("[Pixi\u2019VN] Error importing data",i);}}};var Aa=class{get keysSystem(){return Be._keysSystem}setVariable(e,t){if(e=e.toLowerCase(),t==null){Be.storage.hasOwnProperty(e)&&delete Be.storage[e];return}Be.storage[e]=t;}getVariable(e){if(e=e.toLowerCase(),Be.tempStorage.hasOwnProperty(e))return Be.getTempVariable(e);if(Be.storage.hasOwnProperty(e))return Se(Be.storage[e])}removeVariable(e){e=e.toLowerCase(),Be.storage.hasOwnProperty(e)&&delete Be.storage[e];}setTempVariable(e,t){e=e.toLowerCase();let i=Be.tempStorage,s=Be.tempStorageDeadlines;if(t==null){this.removeTempVariable(e);return}else i[e]=t,s.hasOwnProperty(e)||(s[e]=N.openedLabels.length);Be.tempStorage=i,Be.tempStorageDeadlines=s;}removeTempVariable(e){e=e.toLowerCase();let t=Be.tempStorage,i=Be.tempStorageDeadlines;t.hasOwnProperty(e)&&(delete t[e],delete i[e]),Be.tempStorage=t,Be.tempStorageDeadlines=i;}setFlag(e,t){let i=this.getVariable(this.keysSystem.FLAGS_CATEGORY_KEY)||[];if(t)i.includes(e)||i.push(e);else {let s=i.indexOf(e);s>-1&&i.splice(s,1);}this.setVariable(this.keysSystem.FLAGS_CATEGORY_KEY,i);}getFlag(e){return (this.getVariable(this.keysSystem.FLAGS_CATEGORY_KEY)||[]).includes(e)}clear(){Be.storage={...Be.baseStorage};}exportJson(){return JSON.stringify(this.export())}export(){return Se(Be.storage)}importJson(e){this.import(JSON.parse(e));}import(e){this.clear();try{e?Be.storage=e:console.warn("[Pixi\u2019VN] No storage data found");}catch(t){console.error("[Pixi\u2019VN] Error importing data",t);}}};var St=new jd,N=new Ea,O=new Aa,C=new Sa;var xL="@",Ta=class extends va{sourceId;constructor(e,t=""){super(O.keysSystem.CHARACTER_CATEGORY_KEY,e+(t?xL+t:"")),this.sourceId=e;}getStorageProperty(e){let t=super.getStorageProperty(e);return t===undefined&&(t=super.getStorageProperty(e,this.sourceId)),t}};var Yd=class extends Ta{constructor(e,t){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion),this.defaultName=t.name,this.defaultSurname=t.surname,this.defaultAge=t.age,this._icon=t.icon,this._color=t.color;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}defaultSurname;get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}defaultAge;get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}_icon;get icon(){return this._icon}_color;get color(){return this._color}};
3416
3416
  module.exports=Yd;