route-graphics 1.1.4 → 1.1.5

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.
@@ -1141,7 +1141,7 @@ ${u}`)}});return await Promise.all(l),o?s[n[0].src]:s}async unload(t){let i=Ue(t
1141
1141
  };
1142
1142
 
1143
1143
  })();
1144
- `,Yo=null,Sl=class{constructor(){Yo||(Yo=URL.createObjectURL(new Blob([kk],{type:"application/javascript"}))),this.worker=new Worker(Yo)}};Sl.revokeObjectURL=function(){Yo&&(URL.revokeObjectURL(Yo),Yo=null)};var _P=0,hx,cx=class{constructor(){this._initialized=!1,this._createdWorkers=0,this._workerPool=[],this._queue=[],this._resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(t=>{let{worker:e}=new jo;e.addEventListener("message",i=>{e.terminate(),jo.revokeObjectURL(),t(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t,e){return this._run("loadImageBitmap",[t,e?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=!0)}_getWorker(){hx===void 0&&(hx=navigator.hardwareConcurrency||4);let t=this._workerPool.pop();return!t&&this._createdWorkers<hx&&(this._createdWorkers++,t=new Sl().worker,t.addEventListener("message",e=>{this._complete(e.data),this._returnWorker(e.target),this._next()})),t}_returnWorker(t){this._workerPool.push(t)}_complete(t){t.error!==void 0?this._resolveHash[t.uuid].reject(t.error):this._resolveHash[t.uuid].resolve(t.data),this._resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();let i=new Promise((s,o)=>{this._queue.push({id:t,arguments:e,resolve:s,reject:o})});return this._next(),i}_next(){if(!this._queue.length)return;let t=this._getWorker();if(!t)return;let e=this._queue.pop(),i=e.id;this._resolveHash[_P]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:_P++,id:i})}},ux=new cx;Pi();var Uk=[".jpeg",".jpg",".png",".webp",".avif"],Gk=["image/jpeg","image/png","image/webp","image/avif"];async function Ok(r,t){let e=await Y.get().fetch(r);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${e.status} ${e.statusText}`);let i=await e.blob();return t?.data?.alphaMode==="premultiplied-alpha"?createImageBitmap(i,{premultiplyAlpha:"none"}):createImageBitmap(i)}var Lu={name:"loadTextures",extension:{type:T.LoadParser,priority:ke.High,name:"loadTextures"},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(r){return dr(r,Gk)||fr(r,Uk)},async load(r,t,e){let i=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await ux.isImageBitmapSupported()?i=await ux.loadImageBitmap(r,t):i=await Ok(r,t):i=await new Promise((o,n)=>{i=new Image,i.crossOrigin=this.config.crossOrigin,i.src=r,i.complete?o(i):(i.onload=()=>{o(i)},i.onerror=n)});let s=new ze({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:t.data?.resolution||zo(r),...t.data});return $o(s,e,r)},unload(r){r.destroy(!0)}};F();Ap();Ep();var bP=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],Lk=bP.map(r=>`video/${r.substring(1)}`);function Dk(r,t,e){e===void 0&&!t.startsWith("data:")?r.crossOrigin=Hk(t):e!==!1&&(r.crossOrigin=typeof e=="string"?e:"anonymous")}function Nk(r){return new Promise((t,e)=>{r.addEventListener("canplaythrough",i),r.addEventListener("error",s),r.load();function i(){o(),t()}function s(n){o(),e(n)}function o(){r.removeEventListener("canplaythrough",i),r.removeEventListener("error",s)}})}function Hk(r,t=globalThis.location){if(r.startsWith("data:"))return"";t||(t=globalThis.location);let e=new URL(r,document.baseURI);return e.hostname!==t.hostname||e.port!==t.port||e.protocol!==t.protocol?"anonymous":""}var vP={name:"loadVideo",extension:{type:T.LoadParser,name:"loadVideo"},test(r){let t=dr(r,Lk),e=fr(r,bP);return t||e},async load(r,t,e){let i={...oo.defaultOptions,resolution:t.data?.resolution||zo(r),alphaMode:t.data?.alphaMode||await dc(),...t.data},s=document.createElement("video"),o={preload:i.autoLoad!==!1?"auto":void 0,"webkit-playsinline":i.playsinline!==!1?"":void 0,playsinline:i.playsinline!==!1?"":void 0,muted:i.muted===!0?"":void 0,loop:i.loop===!0?"":void 0,autoplay:i.autoPlay!==!1?"":void 0};Object.keys(o).forEach(l=>{let h=o[l];h!==void 0&&s.setAttribute(l,h)}),i.muted===!0&&(s.muted=!0),Dk(s,r,i.crossorigin);let n=document.createElement("source"),a;if(r.startsWith("data:"))a=r.slice(5,r.indexOf(";"));else if(!r.startsWith("blob:")){let l=r.split("?")[0].slice(r.lastIndexOf(".")+1).toLowerCase();a=oo.MIME_TYPES[l]||`video/${l}`}return n.src=r,a&&(n.type=a),new Promise(l=>{let h=async()=>{let c=new oo({...i,resource:s});s.removeEventListener("canplay",h),t.data.preload&&await Nk(s),l($o(c,e,r))};s.addEventListener("canplay",h),s.appendChild(n)})},unload(r){r.destroy(!0)}};F();ro();F();ro();var Du={extension:{type:T.ResolveParser,name:"resolveTexture"},test:Lu.test,parse:r=>({resolution:parseFloat(Qe.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})};var TP={extension:{type:T.ResolveParser,priority:-2,name:"resolveJson"},test:r=>Qe.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:Du.parse};ro();zn();ac();var Nu=class{constructor(){this._detections=[],this._initialized=!1,this.resolver=new Qe,this.loader=new Ou,this.cache=St,this._backgroundLoader=new Uu(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized){V("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let o=t.manifest;typeof o=="string"&&(o=await this.load(o)),this.resolver.addManifest(o)}let e=t.texturePreference?.resolution??1,i=typeof e=="number"?[e]:e,s=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:i}}),t.preferences&&this.setPreferences(t.preferences)}add(t){this.resolver.add(t)}async load(t,e){this._initialized||await this.init();let i=as(t),s=Ue(t).map(a=>{if(typeof a!="string"){let l=this.resolver.getAlias(a);return l.some(h=>!this.resolver.hasKey(h))&&this.add(a),Array.isArray(l)?l[0]:l}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),o=this.resolver.resolve(s),n=await this._mapLoadToResolve(o,e);return i?n[s[0]]:n}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let i=!1;typeof t=="string"&&(i=!0,t=[t]);let s=this.resolver.resolveBundle(t),o={},n=Object.keys(s),a=0,l=0,h=()=>{e?.(++a/l)},c=n.map(u=>{let d=s[u];return l+=Object.keys(d).length,this._mapLoadToResolve(d,h).then(f=>{o[u]=f})});return await Promise.all(c),i?o[t[0]]:o}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);let e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);let e=this.resolver.resolveBundle(t);Object.values(e).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return St.get(t);let e={};for(let i=0;i<t.length;i++)e[i]=St.get(t[i]);return e}async _mapLoadToResolve(t,e){let i=[...new Set(Object.values(t))];this._backgroundLoader.active=!1;let s=await this.loader.load(i,e);this._backgroundLoader.active=!0;let o={};return i.forEach(n=>{let a=s[n.src],l=[n.src];n.alias&&l.push(...n.alias),l.forEach(h=>{o[h]=a}),St.set(l,a)}),o}async unload(t){this._initialized||await this.init();let e=Ue(t).map(s=>typeof s!="string"?s.src:s),i=this.resolver.resolve(e);await this._unloadFromResolved(i)}async unloadBundle(t){this._initialized||await this.init(),t=Ue(t);let e=this.resolver.resolveBundle(t),i=Object.keys(e).map(s=>this._unloadFromResolved(e[s]));await Promise.all(i)}async _unloadFromResolved(t){let e=Object.values(t);e.forEach(i=>{St.remove(i.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(let i of t.detections)t.skipDetections||await i.test()?e=await i.add(e):t.skipDetections||(e=await i.remove(e));return e=e.filter((i,s)=>e.indexOf(i)===s),e}get detections(){return this._detections}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(i=>i in t).forEach(i=>{e.config[i]=t[i]})})}},pr=new Nu;H.handleByList(T.LoadParser,pr.loader.parsers).handleByList(T.ResolveParser,pr.resolver.parsers).handleByList(T.CacheParser,pr.cache.parsers).handleByList(T.DetectionParser,pr.detections);H.add(aP,cP,lP,pP,uP,dP,fP,mP,gP,xP,yP,Lu,vP,nP,oP,Du,TP);var SP={loader:T.LoadParser,resolver:T.ResolveParser,cache:T.CacheParser,detection:T.DetectionParser};H.handle(T.Asset,r=>{let t=r.ref;Object.entries(SP).filter(([e])=>!!t[e]).forEach(([e,i])=>H.add(Object.assign(t[e],{extension:t[e].extension??i})))},r=>{let t=r.ref;Object.keys(SP).filter(e=>!!t[e]).forEach(e=>H.remove(t[e]))});Tt();Dn();eo();jn();var wl=class r extends kt{constructor(...t){let e=t[0];Array.isArray(t[0])&&(e={textures:t[0],autoUpdate:t[1]});let{animationSpeed:i=1,autoPlay:s=!1,autoUpdate:o=!0,loop:n=!0,onComplete:a=null,onFrameChange:l=null,onLoop:h=null,textures:c,updateAnchor:u=!1,...d}=e,[f]=c;super({...d,texture:f instanceof I?f:f.texture}),this._textures=null,this._durations=null,this._autoUpdate=o,this._isConnectedToTicker=!1,this.animationSpeed=i,this.loop=n,this.updateAnchor=u,this.onComplete=a,this.onFrameChange=l,this.onLoop=h,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=c,s&&this.play()}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(ce.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(ce.shared.add(this.update,this,Ir.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(t){this.stop(),this.currentFrame=t}gotoAndPlay(t){this.currentFrame=t,this.play()}update(t){if(!this._playing)return;let e=t.deltaTime,i=this.animationSpeed*e,s=this.currentFrame;if(this._durations!==null){let o=this._currentTime%1*this._durations[this.currentFrame];for(o+=i/60*1e3;o<0;)this._currentTime--,o+=this._durations[this.currentFrame];let n=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);o>=this._durations[this.currentFrame];)o-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=o/this._durations[this.currentFrame]}else this._currentTime+=i;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<s||this.animationSpeed<0&&this.currentFrame>s)&&this.onLoop(),this._updateTexture())}_updateTexture(){let t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this.texture=this._textures[t],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(){this.stop(),super.destroy(),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){let e=[];for(let i=0;i<t.length;++i)e.push(I.from(t[i]));return new r(e)}static fromImages(t){let e=[];for(let i=0;i<t.length;++i)e.push(I.from(t[i]));return new r(e)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(t){if(t[0]instanceof I)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(let e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this._updateTexture()}get currentFrame(){let t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}set currentFrame(t){if(t<0||t>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);let e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this._updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(ce.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(ce.shared.add(this.update,this),this._isConnectedToTicker=!0))}};Vh();Wt();nc();var Hu=class extends Ai{constructor(t,e){let{text:i,resolution:s,style:o,anchor:n,width:a,height:l,roundPixels:h,...c}=t;super({...c}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=e,this.text=i??"",this.style=o,this.resolution=s??null,this.allowChildren=!1,this._anchor=new Te({_onUpdate:()=>{this.onViewUpdate()}}),n&&(this.anchor=n),this.roundPixels=h??!1,a!==void 0&&(this.width=a),l!==void 0&&(this.height=l)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}set text(t){t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())}get text(){return this._text}set resolution(t){this._autoResolution=t===null,this._resolution=t,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(t){t||(t={}),this._style?.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(t){this._setWidth(t,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(t){this._setHeight(t,this.bounds.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this.bounds.width),e!==void 0&&this._setHeight(e,this.bounds.height)}containsPoint(t){let e=this.bounds.width,i=this.bounds.height,s=-e*this.anchor.x,o=0;return t.x>=s&&t.x<=s+e&&(o=-i*this.anchor.y,t.y>=o&&t.y<=o+i)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}_getKey(){return`${this.text}:${this._style.styleKey}:${this._resolution}`}destroy(t=!1){super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,(typeof t=="boolean"?t:t?.style)&&this._style.destroy(t),this._style=null,this._text=null}};function wP(r,t){let e=r[0]??{};return(typeof e=="string"||r[1])&&(j(rt,`use new ${t}({ text: "hi!", style }) instead`),e={text:e,style:r[1]}),e}ga();gs();var Ni=class extends Hu{constructor(...t){let e=wP(t,"Text");super(e,Ht),this.renderPipeId="text"}updateBounds(){let t=this._bounds,e=this._anchor,i=Jt.measureText(this._text,this._style),{width:s,height:o}=i;t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*o,t.maxY=t.minY+o}};mt();he();Ag();Tt();du();Rp();br();$m();jn();ga();gs();bp();Ae();var Vk=Zi(Rc(),1);H.add(Fw,Uw);var Wk=new(window.AudioContext||window.webkitAudioContext),dx={},zk=async(r,t)=>{if(!dx[r]&&t.byteLength!==0)try{let e=await Wk.decodeAudioData(t);dx[r]=e}catch(e){console.error(`AudioAsset.load: Failed to decode ${r}:`,e)}},$k=r=>dx[r],qo={load:zk,getAsset:$k};var fe=({type:r,add:t,update:e,delete:i,parse:s})=>({type:r,add:t,update:e,delete:i,parse:s});var fx=({type:r})=>({type:r});var px=({type:r,add:t,update:e,delete:i})=>({type:r,add:t,update:e,delete:i});var Vu={alpha:"alpha",x:"x",y:"y",scaleX:"scaleX",scaleY:"scaleY",rotation:"rotation"};var Wu={scaleX:["scale","x"],scaleY:["scale","y"],x:["x"],y:["y"],alpha:["alpha"],rotation:["rotation"]};var bs={RECT:"rect",TEXT:"text",CONTAINER:"container",SPRITE:"sprite",TEXT_REVEALING:"text-revealing",SLIDER:"slider",PARTICLES:"particles",ANIMATED_SPRITE:"animated-sprite",VIDEO:"video"};var _e={fill:"black",fontFamily:"Arial",fontSize:16,align:"left",lineHeight:1.2,wordWrap:!1,breakWords:!1,strokeColor:"transparent",strokeWidth:0,wordWrapWidth:0};var vs=(r,t)=>{let e={fill:t?.fill??_e.fill,fontFamily:t?.fontFamily??_e.fontFamily,fontSize:t?.fontSize??_e.fontSize,align:t?.align??_e.align,lineHeight:t?.lineHeight??_e.lineHeight,wordWrap:t?.wordWrap??_e.wordWrap,breakWords:t?.breakWords??_e.breakWords,strokeColor:t?.strokeColor??_e.strokeColor,strokeWidth:t?.strokeWidth??_e.strokeWidth,wordWrapWidth:t?.wordWrapWidth??_e.wordWrapWidth};r.style=e};var Xk=(r,t)=>typeof t!="string"?t:r[t]??t,jk=(r,t,e,i)=>{let s=Xk(e,t);if(typeof s=="string")return r[s]=i,r;let o=r;for(let n=0;n<s.length-1;n++){let a=s[n];a in o||(o[a]={}),o=o[a]}return o[s[s.length-1]]=i,r},EP=(r,t,e=Wu)=>{for(let i of t)for(let[s,o]of Object.entries(i.tween)){if(!Vu[s])throw new Error(`${s} is not a supported property for animation.`);o.initialValue!==void 0&&jk(r,s,e,o.initialValue)}},zu=({animations:r,animationBus:t,completionTracker:e,element:i,targetState:s,onComplete:o})=>{for(let n of r){let a=e.getVersion();e.track(a),t.dispatch({type:"START",payload:{id:n.id,element:i,properties:n.tween,targetState:s,onComplete:()=>{e.complete(a),o?.(n)}}})}};function mx(r,t){let e=r.text.substring(0,t),s=Jt.measureText(e,r.style).width;return r.x+s}var Yk=async(r,t)=>new Promise((e,i)=>{if(t?.aborted)return i(new DOMException("The operation was aborted.","AbortError"));let s,o=()=>{s&&t?.removeEventListener("abort",s)},n=setTimeout(()=>{o(),e()},r);s=()=>{clearTimeout(n),o(),i(t.reason)},t?.addEventListener("abort",s,{once:!0})}),gx=Yk;var ui=Symbol("textRevealRuntime"),qk=18,Kk=64,Zk=1.25,PP=r=>typeof r=="number"&&r>0?r:1,Qk=r=>{let t=new kt(I.EMPTY);if(r?.indicator?.revealing?.src){let e=I.from(r.indicator.revealing.src);t=new kt(e),t.width=r.indicator.revealing.width??e.width,t.height=r.indicator.revealing.height??e.height}return t},El=(r,t)=>{if(!t?.indicator?.complete?.src)return;let e=I.from(t.indicator.complete.src);r.texture=e,r.width=t.indicator.complete.width??e.width,r.height=t.indicator.complete.height??e.height},Al=(r,t,e)=>{r.x=e,r.y=t?t.y+(t.lineMaxHeight-r.height):0},$u=(r,t,e)=>{if(!t||t.text.length===0){r.x=e;return}r.x=mx(t,t.text.length-1)+e},Jk=(r,t)=>{if(r[ui]){let e=r[ui];delete r[ui],e()}r[ui]=t},xx=r=>{if(r[ui]){let e=r[ui];delete r[ui],e()}r.onRender=void 0,r.removeChildren().forEach(e=>{e.destroy({children:!0})})},CP=(r,t="",e="")=>{let i=new Ht(r.textStyle),s=new Ni({text:t,style:i,x:Math.round(r.x),y:Math.round(r.y)}),o=null;if(r.furigana){let n=new Ht(r.furigana.textStyle);o=new Ni({text:e,style:n,x:Math.round(r.furigana.x),y:Math.round(r.furigana.y)})}return{text:s,furiganaText:o}},RP=(r,t)=>{let e=null,i=null,s=0,o=0,n=[];for(let a=0;a<t.content.length;a++){let l=t.content[a],h=new nt({label:`${t.id}-line-${a}`}),c=[],u=null,d=0;r.addChild(h),i=l,o=Math.max(o,l.lineMaxHeight??0);for(let f=0;f<l.lineParts.length;f++){let p=l.lineParts[f],{text:m,furiganaText:g}=CP(p,p.text,p.furigana?.text||"");g&&(h.addChild(g),c.push(g)),h.addChild(m),c.push(m),e=m,u=m,s+=p.text.length,d+=p.text.length}if(c.length>0){let f=h.getLocalBounds();n.push({chunk:l,container:h,lastTextObject:u,totalCharacters:d,bounds:{x:f.x,y:f.y,width:f.width,height:f.height}})}else h.destroy()}return{lines:n,lastTextObject:e,lastChunk:i,totalCharacters:s,maxLineHeight:o,bounds:r.getLocalBounds()}},AP=({contentContainer:r,indicatorSprite:t,element:e})=>{let i=e?.indicator?.offset??12,{lastTextObject:s,lastChunk:o}=RP(r,e);Al(t,o,i),$u(t,s,i),El(t,e)},tU=({indicatorSprite:r,element:t})=>{let e=t?.indicator?.offset??12,i=t.content[0]??null;Al(r,i,e)},eU=async({contentContainer:r,indicatorSprite:t,element:e,signal:i})=>{let s=PP(e.speed??50),o=e?.indicator?.offset??12,n=Math.max(1,Math.floor(1e3/s)),a=Math.max(1,Math.floor(4e3/s));for(let l=0;l<e.content.length;l++){if(i?.aborted||r.destroyed)return!1;let h=e.content[l];Al(t,h,o);for(let c=0;c<h.lineParts.length;c++){if(i?.aborted||r.destroyed)return!1;let u=h.lineParts[c],{text:d,furiganaText:f}=CP(u);f&&r.addChild(f),r.addChild(d);let p=u.text,m=u.furigana?.text||"",g=m.length;for(let _=0;_<p.length;_++){if(i?.aborted||r.destroyed)return!1;if(d.text=p.substring(0,_+1),t.x=mx(d,_)+o,f){let b=Math.round((_+1)/p.length*g);f.text=m.substring(0,b)}_<p.length-1&&await gx(n,i)}}l<e.content.length-1&&await gx(a,i)}return El(t,e),!0},rU=({container:r,contentContainer:t,indicatorSprite:e,element:i,animationBus:s,completionTracker:o})=>{let n=i?.indicator?.offset??12,a=PP(i.speed??50),{lines:l,lastTextObject:h,lastChunk:c,totalCharacters:u,maxLineHeight:d,bounds:f}=RP(t,i);if(Al(e,c,n),l.length===0||u===0||!l.some(A=>A.bounds.width>0&&A.bounds.height>0)||!globalThis.document||!s)return $u(e,h,n),El(e,i),!1;let p=Math.max(qk,Math.min(Kk,Math.round(d*Zk))),m=Math.max(1,Math.round(u/a*1e3)),g=l.map(A=>{let C=Math.max(1,A.totalCharacters),M=1+p/Math.max(1,A.bounds.width);return C*M}),_=g.reduce((A,C)=>A+C,0),b=[],y=0;for(let A=0;A<l.length;A++){let C=g[A],M=_>0?y/_:0;y+=C,b.push({...l[A],startProgress:M,endProgress:_>0?y/_:1})}let w=o.getVersion(),E=`${i.id}-soft-wipe`,v=b.map(A=>{let C=document.createElement("canvas");C.width=Math.max(1,Math.ceil(A.bounds.width+p)),C.height=Math.max(1,Math.ceil(A.bounds.height));let M=C.getContext("2d");if(!M)return null;let B=_s(C),k=new kt(B);return k.x=Math.floor(A.bounds.x-p),k.y=Math.floor(A.bounds.y),A.container.mask=k,t.addChild(k),{canvas:C,context:M,texture:B,sprite:k,line:A}});if(v.some(A=>A===null))return v.forEach(A=>{A&&(A.line.container.mask===A.sprite&&(A.line.container.mask=null),A.sprite.parent&&A.sprite.parent.removeChild(A.sprite),A.sprite.destroy(),A.texture.destroy(!0))}),$u(e,h,n),El(e,i),!1;let S=!1,P=A=>{S||(S=!0,r[ui]===R&&delete r[ui],v.forEach(C=>{C.line.container.mask===C.sprite&&(C.line.container.mask=null),C.sprite.parent&&C.sprite.parent.removeChild(C.sprite),C.sprite.destroy(),C.texture.destroy(!0)}),A&&($u(e,h,n),El(e,i)))},R=()=>{s.dispatch({type:"CANCEL",id:E}),P(!1)};return Jk(r,R),o.track(w),s.dispatch({type:"START",payload:{id:E,driver:"custom",duration:m,applyFrame:A=>{let C=m>0?Math.min(A/m,1):1,M=b[0],B=0;for(let k=0;k<b.length;k++){let U=b[k],O=v[k],$=Math.max(1e-6,U.endProgress-U.startProgress),N=Math.max(0,Math.min((C-U.startProgress)/$,1)),{context:L,canvas:z,texture:st}=O;if(L.clearRect(0,0,z.width,z.height),N<=0){st.source.update();continue}let Q=p,bt=0,Bt=U.bounds.width+p,Mt=Q+N*Bt,jt=Math.max(Q,Mt-p);jt>Q&&(L.fillStyle="#ffffff",L.fillRect(Q,bt,Math.min(jt-Q,U.bounds.width),U.bounds.height));let Zt=Math.max(Q,Mt-p),xt=Math.min(Q+U.bounds.width,Mt);if(xt>Zt){let ct=L.createLinearGradient(Zt,0,xt,0);ct.addColorStop(0,"rgba(255, 255, 255, 1)"),ct.addColorStop(1,"rgba(255, 255, 255, 0)"),L.fillStyle=ct,L.fillRect(Zt,bt,xt-Zt,U.bounds.height)}st.source.update(),(N<1||k===b.length-1)&&(M=U,B=Math.min(1,(Mt-Q)/Math.max(1,U.bounds.width)))}Al(e,M.chunk,n),e.x=M.bounds.x+Math.min(M.bounds.width,M.bounds.width*B)+n},applyTargetState:()=>{P(!1)},onComplete:()=>{o.complete(w),P(!0)},onCancel:()=>{o.complete(w),P(!1)},isValid:()=>!!r&&!r.destroyed&&!t.destroyed&&!e.destroyed}}),!0},Hi=async({container:r,element:t,completionTracker:e,animationBus:i,zIndex:s,signal:o,playback:n="autoplay"})=>{if(o?.aborted||r.destroyed)return;xx(r),r.zIndex=s;let a=new nt({label:`${t.id}-content`}),l=Qk(t);r.addChild(a),r.addChild(l);try{if(n==="paused-initial"){t.revealEffect==="none"?AP({contentContainer:a,indicatorSprite:l,element:t}):tU({indicatorSprite:l,element:t});return}if(t.revealEffect==="softWipe"){if(!rU({container:r,contentContainer:a,indicatorSprite:l,element:t,animationBus:i,completionTracker:e})&&!o?.aborted&&!r.destroyed){let d=e.getVersion();e.track(d),e.complete(d)}return}let h=e.getVersion(),c=!1;e.track(h),t.revealEffect==="none"?(AP({contentContainer:a,indicatorSprite:l,element:t}),c=!0):c=await eU({contentContainer:a,indicatorSprite:l,element:t,signal:o}),c&&!o?.aborted&&!r.destroyed&&e.complete(h)}catch(h){if(h?.name!=="AbortError"&&!o?.aborted)throw h}};var Xu=({suppressAnimations:r=!1,deferredMountOperations:t=[]}={})=>({suppressAnimations:r,deferredMountOperations:t}),MP=r=>{switch(r?.type){case"play-animated-sprite":r.animatedSprite?.destroyed||r.animatedSprite?.play();return;case"play-video":r.video?.play();return;case"start-particles":if(r.app?.debug){let t=e=>{if(r.emitter.destroyed){window.removeEventListener("snapShotKeyFrame",t);return}e?.detail?.deltaMS&&r.emitter.update(Number(e.detail.deltaMS)/1e3)};window.addEventListener("snapShotKeyFrame",t),r.container.customTickerHandler=t;return}r.app.ticker.add(r.tickerCallback);return;case"autoplay-text-reveal":Hi({container:r.container,element:r.element,completionTracker:r.completionTracker,animationBus:r.animationBus,zIndex:r.zIndex,signal:r.signal,playback:"autoplay"});return;case"start-update-animations":if(!r.element||r.element.destroyed)return;zu({animations:r.animations,animationBus:r.animationBus,completionTracker:r.completionTracker,element:r.element,targetState:r.targetState});return}},Pl=(r,t)=>{if(t?.type){if(!r?.suppressAnimations){MP(t);return}r.deferredMountOperations.push(t)}},ju=r=>{r?.deferredMountOperations&&(r.deferredMountOperations.length=0)},IP=(r,t)=>Pl(r,{type:"play-animated-sprite",animatedSprite:t}),BP=(r,t)=>Pl(r,{type:"play-video",video:t}),FP=(r,{app:t,emitter:e,container:i,tickerCallback:s})=>Pl(r,{type:"start-particles",app:t,emitter:e,container:i,tickerCallback:s}),Yu=(r,{container:t,element:e,completionTracker:i,animationBus:s,zIndex:o,signal:n})=>Pl(r,{type:"autoplay-text-reveal",container:t,element:e,completionTracker:i,animationBus:s,zIndex:o,signal:n}),kP=(r,{animations:t,animationBus:e,completionTracker:i,element:s,targetState:o})=>Pl(r,{type:"start-update-animations",animations:t,animationBus:e,completionTracker:i,element:s,targetState:o}),UP=r=>{if(!r?.deferredMountOperations?.length)return;let t=r.deferredMountOperations.splice(0);for(let e of t)MP(e)};var GP=(r=[])=>{if(r instanceof Map)return r;let t=new Map;for(let e of r)t.has(e.targetId)||t.set(e.targetId,[]),t.get(e.targetId).push(e);return t},qu=(r,t)=>r instanceof Map?r.get(t)??[]:r.filter(e=>e.targetId===t),iU=(r,t)=>qu(r,t).filter(e=>e.type==="update"),Ku=(r,t)=>qu(r,t).find(e=>e.type==="transition")??null,sU=({animations:r,targetId:t,animationBus:e,completionTracker:i,element:s,targetState:o,onComplete:n,renderContext:a})=>{let l=iU(r,t);if(l.length===0)return!1;if(a?.suppressAnimations){if(n)throw new Error("Deferred update animations do not support onComplete hooks.");return EP(s,l),kP(a,{animations:l,animationBus:e,completionTracker:i,element:s,targetState:o}),!0}return zu({animations:l,animationBus:e,completionTracker:i,element:s,targetState:o,onComplete:n}),!0};var at=sU;var DP=Symbol("routeGraphicsTextAnchorRatios"),NP=Symbol("routeGraphicsTextLayoutState"),OP=(r,t)=>typeof r!="number"||r===0?0:t/r,yx=r=>r?.align??_e.align,LP=r=>{let t=r[NP];return t?.fixedWidth&&typeof t.layoutWidth=="number"?t.layoutWidth:r.width},_x=(r,t,e)=>{let i=Math.max(0,r-t);return e==="center"?i/2:e==="right"?i:0},Cl=r=>{let t=r.measuredWidth??r.width,e=_x(r.width,t,yx(r.textStyle));return{x:r.x+e,y:r.y}},Zu=(r,t)=>{let e=t.__fixedWidth&&typeof t.width=="number"?t.width:r.width||t.width,i=r.height||t.height,s=typeof t.__anchorXRatio=="number"?t.__anchorXRatio:OP(e,t.originX),o=typeof t.__anchorYRatio=="number"?t.__anchorYRatio:OP(i,t.originY);r[DP]={x:s,y:o},r[NP]={fixedWidth:!!t.__fixedWidth,layoutWidth:t.width}},oU=r=>typeof r?.fontSize!="number"||r.fontSize===0||typeof r?.lineHeight!="number"?_e.lineHeight:r.lineHeight/r.fontSize,nU=(r,t)=>{if(!t)return r;let e={...r,...t};if(t.fontSize!==void 0||t.lineHeight!==void 0){let i=t.lineHeight??oU(r);e.lineHeight=Math.round(e.fontSize*i)}return e},zr=(r,t,e)=>{let i=r[DP],s=LP(r),o=nU(t,e);if(!i){vs(r,o);return}let n=_x(s,r.width,yx(r.style)),l=r.x-n+s*i.x,h=r.y+r.height*i.y;vs(r,o);let c=LP(r),u=_x(c,r.width,yx(r.style));r.x=l-c*i.x+u,r.y=h-r.height*i.y},Qu=(r,t)=>{let e=Cl({...t,measuredWidth:r.width,width:t.__fixedWidth&&typeof t.width=="number"?t.width:r.width});r.x=e.x,r.y=e.y};var aU=r=>{if(!(!r||typeof r!="object")){if(typeof r.button=="number")return r.button;if(typeof r.data?.button=="number")return r.data.button;if(typeof r.nativeEvent?.button=="number")return r.nativeEvent.button}},oe=r=>{let t=aU(r);return t===void 0||t===0};var HP=({app:r,parent:t,element:e,animations:i,eventHandler:s,animationBus:o,completionTracker:n,renderContext:a,zIndex:l})=>{let h=new Ni({label:e.id});h.zIndex=l,h.text=e.content,vs(h,e.textStyle),Zu(h,e),h.alpha=e.alpha,Qu(h,e);let c=e?.hover,u=e?.click,d=e?.rightClick,f={isHovering:!1,isPressed:!1,isRightPressed:!1},p=({isHovering:m,isPressed:g,isRightPressed:_})=>{_&&d?.textStyle?zr(h,e.textStyle,d.textStyle):g&&u?.textStyle?zr(h,e.textStyle,u.textStyle):m&&c?.textStyle?zr(h,e.textStyle,c.textStyle):zr(h,e.textStyle)};if(c){let{cursor:m,soundSrc:g,payload:_}=c;h.eventMode="static";let b=()=>{f.isHovering=!0,_&&s&&s("hover",{_event:{id:h.label},..._}),m&&(h.cursor=m),g&&r.audioStage.add({id:`hover-${Date.now()}`,url:g,loop:!1}),p(f)},y=()=>{f.isHovering=!1,h.cursor="auto",p(f)};h.on("pointerover",b),h.on("pointerout",y)}if(u){let{soundSrc:m,soundVolume:g,payload:_}=u;h.eventMode="static";let b=E=>{oe(E)&&(f.isPressed=!0,p(f))},y=E=>{oe(E)&&(f.isPressed=!1,p(f),_&&s&&s("click",{_event:{id:h.label},..._}),m&&r.audioStage.add({id:`click-${Date.now()}`,url:m,loop:!1,volume:(g??1e3)/1e3}))},w=()=>{f.isPressed=!1,p(f)};h.on("pointerdown",b),h.on("pointerup",y),h.on("pointerupoutside",w)}if(d){let{soundSrc:m,payload:g}=d;h.eventMode="static";let _=()=>{f.isRightPressed=!0,p(f)},b=()=>{f.isRightPressed=!1,p(f)},y=()=>{f.isRightPressed=!1,p(f),g&&s&&s("rightClick",{_event:{id:h.label},...g}),m&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:m,loop:!1})},w=()=>{f.isRightPressed=!1,p(f)};h.on("rightdown",_),h.on("rightup",b),h.on("rightclick",y),h.on("rightupoutside",w)}t.addChild(h),at({animations:i,targetId:e.id,animationBus:o,completionTracker:n,element:h,targetState:{...Cl(e),alpha:e.alpha},renderContext:a})};var lU=Object.prototype.hasOwnProperty,Et=(r,t)=>{if(Object.is(r,t))return!0;if(r===null||t===null||typeof r!="object"||typeof t!="object")return!1;let e=Array.isArray(r),i=Array.isArray(t);if(e!==i)return!1;if(e&&i){if(r.length!==t.length)return!1;for(let n=0;n<r.length;n++)if(!Et(r[n],t[n]))return!1;return!0}let s=Object.keys(r),o=Object.keys(t);if(s.length!==o.length)return!1;for(let n of s)if(!lU.call(t,n)||!Et(r[n],t[n]))return!1;return!0};var VP=({app:r,parent:t,prevElement:e,nextElement:i,eventHandler:s,animations:o,animationBus:n,completionTracker:a,zIndex:l})=>{let h=t.children.find(f=>f.label===e.id);if(!h)return;h.zIndex=l;let{alpha:c}=i,u=()=>{if(!Et(e,i)){h.text=i.content,vs(h,i.textStyle),Zu(h,i),Qu(h,i),h.alpha=c,h.removeAllListeners("pointerover"),h.removeAllListeners("pointerout"),h.removeAllListeners("pointerdown"),h.removeAllListeners("pointerupoutside"),h.removeAllListeners("pointerup"),h.removeAllListeners("rightdown"),h.removeAllListeners("rightclick"),h.removeAllListeners("rightup"),h.removeAllListeners("rightupoutside");let f=i?.hover,p=i?.click,m=i?.rightClick,g={isHovering:!1,isPressed:!1,isRightPressed:!1},_=({isHovering:b,isPressed:y,isRightPressed:w})=>{w&&m?.textStyle?zr(h,i.textStyle,m.textStyle):y&&p?.textStyle?zr(h,i.textStyle,p.textStyle):b&&f?.textStyle?zr(h,i.textStyle,f.textStyle):zr(h,i.textStyle)};if(f){let{cursor:b,soundSrc:y,payload:w}=f;h.eventMode="static";let E=()=>{g.isHovering=!0,w&&s&&s("hover",{_event:{id:h.label},...w}),b&&(h.cursor=b),y&&r.audioStage.add({id:`hover-${Date.now()}`,url:y,loop:!1}),_(g)},v=()=>{g.isHovering=!1,h.cursor="auto",_(g)};h.on("pointerover",E),h.on("pointerout",v)}if(p){let{soundSrc:b,soundVolume:y,payload:w}=p;h.eventMode="static";let E=P=>{oe(P)&&(g.isPressed=!0,_(g))},v=P=>{oe(P)&&(g.isPressed=!1,_(g),w&&s&&s("click",{_event:{id:h.label},...w}),b&&r.audioStage.add({id:`click-${Date.now()}`,url:b,loop:!1,volume:(y??1e3)/1e3}))},S=()=>{g.isPressed=!1,_(g)};h.on("pointerdown",E),h.on("pointerup",v),h.on("pointerupoutside",S)}if(m){let{soundSrc:b,payload:y}=m;h.eventMode="static";let w=()=>{g.isRightPressed=!0,_(g)},E=()=>{g.isRightPressed=!1,_(g)},v=()=>{g.isRightPressed=!1,_(g),y&&s&&s("rightClick",{_event:{id:h.label},...y}),b&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:b,loop:!1})},S=()=>{g.isRightPressed=!1,_(g)};h.on("rightdown",w),h.on("rightup",E),h.on("rightclick",v),h.on("rightupoutside",S)}}};at({animations:o,targetId:e.id,animationBus:n,completionTracker:a,element:h,targetState:{...Cl(i),alpha:c},onComplete:()=>{u()}})||u()};var WP=({parent:r,element:t,animations:e,animationBus:i,completionTracker:s})=>{let o=r.getChildByLabel(t.id);if(!o)return;at({animations:e,targetId:t.id,animationBus:i,completionTracker:s,element:o,targetState:null,onComplete:()=>{o&&!o.destroyed&&o.destroy()}})||o.destroy()};var zP=({positionX:r=0,positionY:t=0,width:e,height:i,anchorX:s=0,anchorY:o=0})=>{if(typeof e!="number"||typeof i!="number")throw new Error("Input Error: Width or height is missing");let n={x:e*s,y:i*o},a=r-n.x,l=t-n.y;return{x:a,y:l,originX:n.x,originY:n.y}};var Ce=r=>{if(typeof r.width!="number"||typeof r.height!="number")throw new Error("Input Error: Width or height is missing");if(!Object.values(bs).includes(r.type))throw new Error("Input Error: Type must be one of "+Object.values(bs).join(", "));if(!r.id)throw new Error("Input Error: Id is missing");let t=r.scaleX?r.scaleX*r.width:r.width,e=r.scaleY?r.scaleY*r.height:r.height;r.type===bs.CONTAINER&&(t=r.width,e=r.height);let{x:i,y:s,originX:o,originY:n}=zP({positionX:r.x,positionY:r.y,width:t,height:e,anchorX:r.anchorX,anchorY:r.anchorY}),a={id:r.id,type:r.type,width:Math.round(t),height:Math.round(e),x:Math.round(i),y:Math.round(s),originX:Math.round(o),originY:Math.round(n),alpha:r.alpha??1};return r.hover&&(a.hover=r.hover),r.click&&(a.click=r.click),a};var $P=({state:r})=>{let t={..._e,...r.textStyle};t.lineHeight=Math.round(t.fontSize*t.lineHeight),typeof r.width=="number"&&(t.wordWrapWidth=r.width,t.wordWrap=!0);let e=String(r.content??""),{width:i,height:s}=Jt.measureText(e,new Ht(t)),o=Math.round(i),n=Math.round(s),a=typeof r.width=="number"?Math.round(r.width):o,h={...Ce({...r,width:a,height:n}),content:e,measuredWidth:o,textStyle:{...t},...r.hover&&{hover:r.hover},...r.click&&{click:r.click},...r.rightClick&&{rightClick:r.rightClick}};return Object.defineProperties(h,{__anchorXRatio:{value:r.anchorX??0,enumerable:!1},__anchorYRatio:{value:r.anchorY??0,enumerable:!1},__fixedWidth:{value:typeof r.width=="number",enumerable:!1}}),h};var hU=fe({type:"text",add:HP,update:VP,delete:WP,parse:$P});var XP="__rtglRectScrollHandled",Ju=({canvas:r,rect:t,width:e,height:i,scrollUpEvent:s,scrollDownEvent:o,eventHandler:n})=>{if(!s&&!o)return;let a=!1;t.eventMode="static",t.hitArea=new tt(0,0,Math.round(e),Math.round(i));let l=(f,p)=>{p?.[XP]||(p&&(p[XP]=!0),f<0&&s?.payload&&n?n("scrollUp",{_event:{id:t.label},...s.payload}):f>0&&o?.payload&&n&&n("scrollDown",{_event:{id:t.label},...o.payload}))},h=()=>{a=!0},c=()=>{a=!1},u=f=>{f.preventDefault?.(),l(f.deltaY,f.nativeEvent)},d=f=>{a&&(f.preventDefault(),l(f.deltaY,f))};t.on("pointerover",h),t.on("pointerout",c),t.on("wheel",u),r?.addEventListener("wheel",d,{passive:!1}),t._cleanupScrollInteraction=()=>{a=!1,t.off("pointerover",h),t.off("pointerout",c),t.off("wheel",u),r?.removeEventListener("wheel",d),t.hitArea=null,delete t._cleanupScrollInteraction}};var cU=r=>r==null||r===""||r==="transparent"?{color:0,alpha:0}:r,jP=({app:r,parent:t,element:e,animations:i,animationBus:s,eventHandler:o,zIndex:n,completionTracker:a,renderContext:l})=>{let{id:h,x:c,y:u,width:d,height:f,fill:p,border:m,alpha:g,scaleX:_,scaleY:b}=e,y=new de;y.label=h,y.zIndex=n;let w={x:c,y:u,alpha:g};_!==void 0&&(w.scaleX=_),b!==void 0&&(w.scaleY=b),(()=>{y.clear(),y.rect(0,0,Math.round(d),Math.round(f)).fill(cU(p)),y.x=Math.round(c),y.y=Math.round(u),y.alpha=g,y.scale.x=_??1,y.scale.y=b??1,m&&y.stroke({color:m.color,alpha:m.alpha,width:Math.round(m.width)})})();let v=e?.hover,S=e?.click,P=e?.rightClick,R=e?.scrollUp,A=e?.scrollDown,C=e?.drag;if(v){let{cursor:M,soundSrc:B,payload:k}=v;y.eventMode="static";let U=()=>{k&&o&&o("hover",{_event:{id:y.label},...k}),M&&(y.cursor=M),B&&r.audioStage.add({id:`hover-${Date.now()}`,url:B,loop:!1})},O=()=>{y.cursor="auto"};y.on("pointerover",U),y.on("pointerout",O)}if(S){let{soundSrc:M,soundVolume:B,payload:k}=S;y.eventMode="static";let U=O=>{oe(O)&&(k&&o&&o("click",{_event:{id:y.label},...k}),M&&r.audioStage.add({id:`click-${Date.now()}`,url:M,loop:!1,volume:(B??1e3)/1e3}))};y.on("pointerup",U)}if(P){let{soundSrc:M,payload:B}=P;y.eventMode="static";let k=()=>{B&&o&&o("rightClick",{_event:{id:y.label},...B}),M&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:M,loop:!1})};y.on("rightclick",k)}if((R||A)&&Ju({canvas:r.canvas,rect:y,width:d,height:f,scrollUpEvent:R,scrollDownEvent:A,eventHandler:o}),C){let{start:M,end:B,move:k}=C;y.eventMode="static";let U=()=>{y._isDragging=!0,M&&o&&o("dragStart",{_event:{id:y.label},...typeof M?.payload=="object"?M.payload:{}})},O=()=>{y._isDragging=!1,B&&o&&o("dragEnd",{_event:{id:y.label},...typeof B?.payload=="object"?B.payload:{}})},$=N=>{k&&o&&y._isDragging&&o("dragMove",{_event:{id:y.label,x:N.global.x,y:N.global.y},...typeof k?.payload=="object"?k.payload:{}})};y.on("pointerdown",U),y.on("pointerup",O),y.on("globalpointermove",$),y.on("pointerupoutside",O)}t.addChild(y),at({animations:i,targetId:h,animationBus:s,completionTracker:a,element:y,targetState:w,renderContext:l})};var uU=r=>r==null||r===""||r==="transparent"?{color:0,alpha:0}:r,YP=({app:r,parent:t,prevElement:e,nextElement:i,animations:s,animationBus:o,eventHandler:n,zIndex:a,completionTracker:l})=>{let h=t.children.find(v=>v.label===e.id);if(!h)return;h.zIndex=a;let{x:c,y:u,width:d,height:f,fill:p,border:m,alpha:g,scaleX:_,scaleY:b}=i,y={x:c,y:u,alpha:g};_!==void 0&&(y.scaleX=_),b!==void 0&&(y.scaleY=b);let w=()=>{if(!Et(e,i)){h._cleanupScrollInteraction?.(),h.clear(),h.rect(0,0,Math.round(d),Math.round(f)).fill(uU(p)),h.x=Math.round(c),h.y=Math.round(u),h.alpha=g,h.scale.x=_??1,h.scale.y=b??1,m&&h.stroke({color:m.color,alpha:m.alpha,width:Math.round(m.width)}),h.removeAllListeners("pointerover"),h.removeAllListeners("pointerout"),h.removeAllListeners("pointerup"),h.removeAllListeners("rightclick"),h.removeAllListeners("wheel"),h.removeAllListeners("pointerdown"),h.removeAllListeners("globalpointermove"),h.removeAllListeners("pointerupoutside");let v=i?.hover,S=i?.click,P=i?.rightClick,R=i?.scrollUp,A=i?.scrollDown,C=i?.drag;if(v){let{cursor:M,soundSrc:B,payload:k}=v;h.eventMode="static";let U=()=>{k&&n&&n("hover",{_event:{id:h.label},...k}),M&&(h.cursor=M),B&&r.audioStage.add({id:`hover-${Date.now()}`,url:B,loop:!1})},O=()=>{h.cursor="auto"};h.on("pointerover",U),h.on("pointerout",O)}if(S){let{soundSrc:M,soundVolume:B,payload:k}=S;h.eventMode="static";let U=O=>{oe(O)&&(k&&n&&n("click",{_event:{id:h.label},...k}),M&&r.audioStage.add({id:`click-${Date.now()}`,url:M,loop:!1,volume:(B??1e3)/1e3}))};h.on("pointerup",U)}if(P){let{soundSrc:M,payload:B}=P;h.eventMode="static";let k=()=>{B&&n&&n("rightClick",{_event:{id:h.label},...B}),M&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:M,loop:!1})};h.on("rightclick",k)}if((R||A)&&Ju({canvas:r.canvas,rect:h,width:d,height:f,scrollUpEvent:R,scrollDownEvent:A,eventHandler:n}),C){let{start:M,end:B,move:k}=C;h.eventMode="static";let U=()=>{h._isDragging=!0,M&&n&&n("dragStart",{_event:{id:h.label},...typeof M?.payload=="object"?M.payload:{}})},O=()=>{h._isDragging=!1,B&&n&&n("dragEnd",{_event:{id:h.label},...typeof B?.payload=="object"?B.payload:{}})},$=N=>{k&&n&&h._isDragging&&n("dragMove",{_event:{id:h.label,x:N.global.x,y:N.global.y},...typeof k?.payload=="object"?k.payload:{}})};h.on("pointerdown",U),h.on("pointerup",O),h.on("globalpointermove",$),h.on("pointerupoutside",O)}}};at({animations:s,targetId:e.id,animationBus:o,completionTracker:l,element:h,targetState:y,onComplete:()=>{w()}})||w()};var qP=({parent:r,element:t,animations:e,animationBus:i,completionTracker:s})=>{let o=r.getChildByLabel(t.id);if(!o)return;at({animations:e,targetId:t.id,animationBus:i,completionTracker:s,element:o,targetState:null,onComplete:()=>{o&&!o.destroyed&&(o._cleanupScrollInteraction?.(),o.destroy())}})||(o._cleanupScrollInteraction?.(),o.destroy())};var KP=({state:r})=>{let t=Ce(r),e=r.border?.width,i=t;return typeof e=="number"&&e>0&&(i={...t,border:{alpha:r.border?.alpha??1,color:r.border?.color??"black",width:e}}),{...i,...r.fill!==void 0?{fill:r.fill}:{},rotation:r.rotation??0,...r.drag&&{drag:r.drag},...r.rightClick&&{rightClick:r.rightClick},...r.scrollUp&&{scrollUp:r.scrollUp},...r.scrollDown&&{scrollDown:r.scrollDown}}};var dU=fe({type:"rect",add:jP,update:YP,delete:qP,parse:KP});var ZP=({app:r,parent:t,element:e,animations:i,eventHandler:s,animationBus:o,completionTracker:n,renderContext:a,zIndex:l})=>{let{id:h,x:c,y:u,width:d,height:f,src:p,alpha:m}=e,g=p?I.from(p):I.EMPTY,_=new kt(g);_.label=h,_.zIndex=l,_.x=Math.round(c),_.y=Math.round(u),_.width=Math.round(d),_.height=Math.round(f),_.alpha=m;let b=e?.hover,y=e?.click,w=e?.rightClick,E={isHovering:!1,isPressed:!1,isRightPressed:!1},v=({isHovering:S,isPressed:P,isRightPressed:R})=>{if(R&&w?.src){let A=I.from(w.src);_.texture=A}else if(P&&y?.src){let A=I.from(y.src);_.texture=A}else if(S&&b?.src){let A=I.from(b.src);_.texture=A}else _.texture=g};if(b){let{cursor:S,soundSrc:P,payload:R}=b;_.eventMode="static";let A=()=>{E.isHovering=!0,R&&s&&s("hover",{_event:{id:_.label},...R}),S&&(_.cursor=S),P&&r.audioStage.add({id:`hover-${Date.now()}`,url:P,loop:!1}),v(E)},C=()=>{E.isHovering=!1,_.cursor="auto",v(E)};_.on("pointerover",A),_.on("pointerout",C)}if(y){let{soundSrc:S,soundVolume:P,payload:R}=y;_.eventMode="static";let A=B=>{oe(B)&&(E.isPressed=!0,v(E))},C=B=>{oe(B)&&(E.isPressed=!1,v(E),R&&s&&s("click",{_event:{id:_.label},...R}),S&&r.audioStage.add({id:`click-${Date.now()}`,url:S,loop:!1,volume:(P??1e3)/1e3}))},M=()=>{E.isPressed=!1,v(E)};_.on("pointerdown",A),_.on("pointerup",C),_.on("pointerupoutside",M)}if(w){let{soundSrc:S,payload:P}=w;_.eventMode="static";let R=()=>{E.isRightPressed=!0,v(E)},A=()=>{E.isRightPressed=!1,v(E)},C=()=>{E.isRightPressed=!1,v(E),P&&s&&s("rightClick",{_event:{id:_.label},...P}),S&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:S,loop:!1})},M=()=>{E.isRightPressed=!1,v(E)};_.on("rightdown",R),_.on("rightup",A),_.on("rightclick",C),_.on("rightupoutside",M)}t.addChild(_),at({animations:i,targetId:h,animationBus:o,completionTracker:n,element:_,targetState:{x:c,y:u,width:d,height:f,alpha:m},renderContext:a})};var QP=({app:r,parent:t,prevElement:e,nextElement:i,animations:s,animationBus:o,completionTracker:n,eventHandler:a,zIndex:l})=>{let h=t.children.find(y=>y.label===e.id);if(!h)return;h.zIndex=l;let{id:c,x:u,y:d,width:f,height:p,src:m,alpha:g}=i,_=()=>{if(!Et(e,i)){let y=m?I.from(m):I.EMPTY;h.texture=y,h.x=Math.round(u),h.y=Math.round(d),h.width=Math.round(f),h.height=Math.round(p),h.alpha=g,h.removeAllListeners("pointerover"),h.removeAllListeners("pointerout"),h.removeAllListeners("pointerdown"),h.removeAllListeners("pointerupoutside"),h.removeAllListeners("pointerup"),h.removeAllListeners("rightdown"),h.removeAllListeners("rightclick"),h.removeAllListeners("rightup"),h.removeAllListeners("rightupoutside");let w=i?.hover,E=i?.click,v=i?.rightClick,S={isHovering:!1,isPressed:!1,isRightPressed:!1},P=({isHovering:R,isPressed:A,isRightPressed:C})=>{if(C&&v?.src){let M=I.from(v.src);h.texture=M}else if(A&&E?.src){let M=I.from(E.src);h.texture=M}else if(R&&w?.src){let M=I.from(w.src);h.texture=M}else h.texture=y};if(w){let{cursor:R,soundSrc:A,payload:C}=w;h.eventMode="static";let M=()=>{S.isHovering=!0,C&&a&&a("hover",{_event:{id:h.label},...C}),R&&(h.cursor=R),A&&r.audioStage.add({id:`hover-${Date.now()}`,url:A,loop:!1}),P(S)},B=()=>{S.isHovering=!1,h.cursor="auto",P(S)};h.on("pointerover",M),h.on("pointerout",B)}if(E){let{soundSrc:R,soundVolume:A,payload:C}=E;h.eventMode="static";let M=U=>{oe(U)&&(S.isPressed=!0,P(S))},B=U=>{oe(U)&&(S.isPressed=!1,P(S),C&&a&&a("click",{_event:{id:h.label},...C}),R&&r.audioStage.add({id:`click-${Date.now()}`,url:R,loop:!1,volume:(A??1e3)/1e3}))},k=()=>{S.isPressed=!1,P(S)};h.on("pointerdown",M),h.on("pointerup",B),h.on("pointerupoutside",k)}if(v){let{soundSrc:R,payload:A}=v;h.eventMode="static";let C=()=>{S.isRightPressed=!0,P(S)},M=()=>{S.isRightPressed=!1,P(S)},B=()=>{S.isRightPressed=!1,P(S),A&&a&&a("rightClick",{_event:{id:h.label},...A}),R&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:R,loop:!1})},k=()=>{S.isRightPressed=!1,P(S)};h.on("rightdown",C),h.on("rightup",M),h.on("rightclick",B),h.on("rightupoutside",k)}}};at({animations:s,targetId:e.id,animationBus:o,completionTracker:n,element:h,targetState:{x:u,y:d,width:f,height:p,alpha:g},onComplete:()=>{_()}})||_()};var JP=({parent:r,element:t,animations:e,animationBus:i,completionTracker:s})=>{let o=r.children.find(a=>a.label===t.id);if(!o)return;at({animations:e,targetId:t.id,animationBus:i,completionTracker:s,element:o,targetState:null,onComplete:()=>{o&&!o.destroyed&&o.destroy()}})||o.destroy()};var tC=({state:r})=>({...Ce(r),src:r.src??"",alpha:r.alpha??1,...r.hover&&{hover:r.hover},...r.click&&{click:r.click},...r.rightClick&&{rightClick:r.rightClick}});var fU=fe({type:"sprite",add:ZP,update:QP,delete:JP,parse:tC});var pU=r=>!r||r.ended?!0:Number.isFinite(r.duration)&&r.duration>0&&r.currentTime>=r.duration,bx=({videoElement:r,video:t})=>{t&&r?._videoEndedListener&&t.removeEventListener("ended",r._videoEndedListener),r&&(r._videoEndedListener=void 0,r._playbackStateVersion=null)},td=({videoElement:r,video:t,loop:e,completionTracker:i})=>{if(bx({videoElement:r,video:t}),(e??!1)||pU(t))return;let s=i.getVersion();i.track(s);let o=()=>{i.complete(s)};t.addEventListener("ended",o),r._videoEndedListener=o,r._playbackStateVersion=s};var eC=({parent:r,element:t,renderContext:e,completionTracker:i,zIndex:s})=>{let{id:o,x:n,y:a,width:l,height:h,src:c,volume:u,loop:d,alpha:f}=t,p=I.from(c),m=p.source.resource;m.pause(),m.currentTime=0,m.loop=d??!1,m.volume=u/1e3,m.muted=!1;let g=new kt(p);g.label=o,g.zIndex=s,g._videoEndedListener=void 0,g._playbackStateVersion=null,g.x=Math.round(n),g.y=Math.round(a),g.width=Math.round(l),g.height=Math.round(h),g.alpha=f??1,td({videoElement:g,video:m,loop:d,completionTracker:i}),BP(e,m),r.addChild(g)};var rC=({parent:r,prevElement:t,nextElement:e,animations:i,animationBus:s,eventHandler:o,completionTracker:n,zIndex:a})=>{let l=r.children.find(g=>g.label===t.id);if(!l)return;l.zIndex=a;let{x:h,y:c,width:u,height:d,alpha:f}=e,p=()=>{if(!Et(t,e)){l.x=Math.round(h),l.y=Math.round(c),l.width=Math.round(u),l.height=Math.round(d),l.alpha=f??1;let g=l.texture.source.resource;if(t.src!==e.src){let _=g;bx({videoElement:l,video:_}),_&&_.pause();let b=I.from(e.src);l.texture=b,g=b.source.resource,g.muted=!1,g.pause(),g.currentTime=0}td({videoElement:l,video:g,loop:e.loop,completionTracker:n}),g.volume=e.volume/1e3,g.loop=e.loop??!1,t.src!==e.src&&g.play()}};at({animations:i,targetId:t.id,animationBus:s,completionTracker:n,element:l,targetState:{x:h,y:c,width:u,height:d,alpha:f??1},onComplete:p})||p()};var iC=({parent:r,element:t,animations:e,animationBus:i,completionTracker:s})=>{let o=r.children.find(l=>l.label===t.id);if(!o)return;let n=()=>{if(o&&!o.destroyed){o._playbackStateVersion!==null&&s.complete(o._playbackStateVersion);let l=o.texture.source.resource;l&&(o._videoEndedListener&&l.removeEventListener("ended",o._videoEndedListener),l.pause()),r.removeChild(o),o.destroy()}};at({animations:e,targetId:t.id,animationBus:i,completionTracker:s,element:o,targetState:null,onComplete:n})||n()};var sC=({state:r})=>({...Ce(r),src:r.src,volume:r.volume??1e3,loop:r.loop??!1});var mU=fe({type:"video",add:eC,update:rC,delete:iC,parse:sC});var oC=({app:r,parent:t,element:e,animations:i,animationBus:s,completionTracker:o,eventHandler:n,renderContext:a,zIndex:l})=>{let{id:h,x:c,y:u,width:d,height:f,alpha:p,thumbSrc:m,barSrc:g,direction:_,min:b,max:y,step:w,initialValue:E,originX:v,originY:S,hover:P,change:R}=e,A=new nt;A.label=h,A.zIndex=l,A.x=c,A.y=u,A.alpha=p,A.sortableChildren=!0,A.eventMode="static";let C=0,M=g?I.from(g):I.EMPTY,B=new kt(M);B.label=`${h}-bar`,B.eventMode="static";let k=m?I.from(m):I.EMPTY,U=new kt(k);U.label=`${h}-thumb`,U.eventMode="static";let O=E??b,$=y-b,N=xt=>{let ct=(xt-b)/$;_==="horizontal"?(U.x=ct*(B.width-U.width),U.y=(B.height-U.height)/2):(U.x=(B.width-U.width)/2,U.y=ct*(B.height-U.height))};(()=>{B.width=d,B.height=f;let xt=_==="horizontal"?f-C*2:d-C*2,ct=m?I.from(m):I.EMPTY,vt=ct.width,Ot=ct.height,ee=xt/vt,re=xt/Ot,He=Math.min(ee,re);U.width=vt*He,U.height=Ot*He,N(O)})();let z=k,st=M,Q=!1,bt=xt=>{let ct;if(_==="horizontal"){let Ot=xt.x-U.width/2;ct=Math.max(0,Math.min(1,Ot/(B.width-U.width)))}else{let Ot=xt.y-U.height/2;ct=Math.max(0,Math.min(1,Ot/(B.height-U.height)))}let vt=b+ct*$;return w>0&&(vt=Math.round((vt-b)/w)*w+b,vt=Math.max(b,Math.min(y,vt))),vt},Bt=xt=>{let ct=A.toLocal(xt.global),vt=bt(ct);vt!==O&&(O=vt,N(O),R?.payload&&n&&n("change",{_event:{id:h,value:O},...R.payload}))},Mt=xt=>{Q=!0,Bt(xt)},jt=xt=>{Q&&Bt(xt)},Zt=()=>{Q&&(Q=!1)};if(A.on("pointerdown",Mt),A.on("globalpointermove",jt),A.on("pointerup",Zt),A.on("pointerupoutside",Zt),P){let{cursor:xt,soundSrc:ct,thumbSrc:vt,barSrc:Ot}=P,ee=()=>{xt&&(B.cursor=xt,U.cursor=xt),ct&&r.audioStage.add({id:`hover-${Date.now()}`,url:ct,loop:!1}),vt&&(U.texture=I.from(vt)),Ot&&(B.texture=I.from(Ot))},re=()=>{Q||(B.cursor="auto",U.cursor="auto",U.texture=z,B.texture=st)};A.on("pointerover",ee),A.on("pointerout",re),A.on("pointerupoutside",re)}A.addChild(B),A.addChild(U),t.addChild(A),at({animations:i,targetId:h,animationBus:s,completionTracker:o,element:A,targetState:{x:c,y:u,alpha:p},renderContext:a})};var nC=({app:r,parent:t,prevElement:e,nextElement:i,animations:s,animationBus:o,completionTracker:n,eventHandler:a,zIndex:l})=>{let h=t.children.find(m=>m.label===e.id);if(!h)return;h.zIndex=l;let c=()=>{if(!Et(e,i)){h.x=i.x,h.y=i.y,h.alpha=i.alpha,h.label=i.id,h.pivot.set(i.originX,i.originY);let m=h.getChildByLabel(`${i.id}-bar`),g=h.getChildByLabel(`${i.id}-thumb`),_=!Et(e.hover,i.hover)||!Et(e.change,i.change)||e.min!==i.min||e.max!==i.max||e.step!==i.step||e.direction!==i.direction;if(m&&g){m.width=i.width,m.height=i.height;let b=0,y=i.direction==="horizontal"?i.height-b*2:i.width-b*2,w=i.thumbSrc?I.from(i.thumbSrc):I.EMPTY,E=w.width||16,v=w.height||16,S=y/E,P=y/v,R=Math.min(S,P);if(g.width=E*R,g.height=v*R,e.barSrc!==i.barSrc){let M=i.barSrc?I.from(i.barSrc):I.EMPTY;m.texture=M}if(e.thumbSrc!==i.thumbSrc){let M=i.thumbSrc?I.from(i.thumbSrc):I.EMPTY;g.texture=M}let A=i.max-i.min,C=(i.initialValue-i.min)/A;i.direction==="horizontal"?(g.x=C*(m.width-g.width),g.y=(m.height-g.height)/2):(g.x=(m.width-g.width)/2,g.y=C*(m.height-g.height))}if(_&&(h.removeAllListeners("pointerover"),h.removeAllListeners("pointerout"),h.removeAllListeners("pointerup"),h.removeAllListeners("pointerupoutside"),h.removeAllListeners("pointerdown"),h.removeAllListeners("globalpointermove")),_){let{hover:b,change:y,min:w,max:E,step:v,direction:S,initialValue:P}=i,R=P??w,A=E-w;h.eventMode="static";let C=z=>{let st=(z-w)/A;S==="horizontal"?(g.x=st*(m.width-g.width),g.y=(m.height-g.height)/2):(g.x=(m.width-g.width)/2,g.y=st*(m.height-g.height))},M=z=>{let st;if(S==="horizontal"){let bt=z.x-g.width/2;st=Math.max(0,Math.min(1,bt/(m.width-g.width)))}else{let bt=z.y-g.height/2;st=Math.max(0,Math.min(1,bt/(m.height-g.height)))}let Q=w+st*A;return v>0&&(Q=Math.round((Q-w)/v)*v+w,Q=Math.max(w,Math.min(E,Q))),Q},B=g.texture,k=m.texture,U=!1,O=z=>{let st=h.toLocal(z.global),Q=M(st);Q!==R&&(R=Q,C(R),y?.payload&&a&&a("change",{_event:{id:i.id,value:R},...y.payload}))},$=z=>{U=!0,O(z)},N=z=>{U&&O(z)},L=()=>{U&&(U=!1)};if(h.on("pointerdown",$),h.on("globalpointermove",N),h.on("pointerup",L),h.on("pointerupoutside",L),b){let{cursor:z,soundSrc:st,thumbSrc:Q,barSrc:bt}=b,Bt=()=>{z&&(h.cursor=z,g.cursor=z),st&&r.audioStage.add({id:`hover-${Date.now()}`,url:st,loop:!1}),Q&&(g.texture=I.from(Q)),bt&&(m.texture=I.from(bt))},Mt=()=>{U||(h.cursor="auto",g.cursor="auto",g.texture=B,m.texture=k)};h.on("pointerover",Bt),h.on("pointerout",Mt),h.on("pointerupoutside",Mt)}}}},{x:u,y:d,alpha:f}=i;at({animations:s,targetId:e.id,animationBus:o,completionTracker:n,element:h,targetState:{x:u,y:d,alpha:f},onComplete:c})||c()};var aC=({app:r,parent:t,element:e,animations:i,animationBus:s,completionTracker:o})=>{let n=t.getChildByLabel(e.id);if(!n)return;let a=()=>{n&&!n.destroyed&&n.destroy({children:!0})};at({animations:i,targetId:e.id,animationBus:s,completionTracker:o,element:n,targetState:null,onComplete:a})||a()};var lC=({state:r})=>{let t=Ce(r),e=r.min??0,i=r.max??100;if(i<=e)throw new Error("Input error: the max value of a slider must be larger than the min value");if(r.initialValue===void 0)throw new Error("Input error: slider initialValue is required");if(typeof r.initialValue!="number"||Number.isNaN(r.initialValue))throw new Error("Input error: slider initialValue must be a valid number");if(r.initialValue<e||r.initialValue>i)throw new Error("Input error: slider initialValue must be between min and max");return{...t,direction:r.direction??"horizontal",thumbSrc:r.thumbSrc??"",barSrc:r.barSrc??"",alpha:r.alpha??1,min:e,max:i,step:r.step??1,initialValue:r.initialValue,...r.hover&&{hover:r.hover},...r.change&&{change:r.change}}};var gU=fe({type:"slider",add:oC,update:nC,delete:aC,parse:lC});var Rl=({container:r,element:t,interactive:e=!0,allowViewportWithoutScroll:i=!1})=>{let s=0,o=0;t.children.forEach(h=>{s=Math.max(h.width+h.x,s),o=Math.max(h.height+h.y,o)});let n=!!(t.height&&o>t.height),a=!!(t.width&&s>t.width);if((t.scroll||i)&&(n||a)){let h=new nt({label:`${r.label}-content`});[...r.children].forEach(g=>{h.addChild(g)}),r.addChild(h);let u=new de({label:`${r.label}-clip`}).rect(0,0,t.width||s,t.height||o).fill({color:16711680,alpha:0});r.addChild(u),h.mask=u;let d=-(o-(t.height||o)),f=-(s-(t.width||s)),p=t.anchorToBottom&&n?d:0,m=t.anchorToBottom&&a?f:0;t.anchorToBottom&&(h.y=p,h.x=m),e&&(r.eventMode="static",r.hitArea=new tt(0,0,t.width||s,t.height||o),r.on("wheel",g=>{if(g.preventDefault(),n&&g.deltaY!==0){let _=p-g.deltaY;_>0?p=0:_<d?p=d:p=_,h.y=p}if(a&&(g.deltaX!==0||g.shiftKey&&g.deltaY!==0)){let _=g.deltaX!==0?g.deltaX:g.deltaY,b=m-_;b>0?m=0:b<f?m=f:m=b,h.x=m}}))}},vx=({container:r})=>{let t=r.children.find(i=>i.label&&i.label.endsWith("-content")),e=r.children.find(i=>i.label&&i.label.endsWith("-clip"));t&&([...t.children].forEach(s=>{s.mask=null,r.addChild(s)}),r.removeChild(t)),e&&r.removeChild(e),r.eventMode="auto",r.hitArea=null,r.removeAllListeners("wheel")};var Ml=r=>{let t=new Set;if(r.id&&t.add(r.id),r.children&&Array.isArray(r.children))for(let e of r.children)for(let i of Ml(e))t.add(i);return t};var hC=(r,t,e=[])=>{let i=new Set,s=new Map,o=new Map,n=[],a=[],l=[];for(let h of r)i.add(h.id),s.set(h.id,h);for(let h of t)i.add(h.id),o.set(h.id,h);for(let h of i){let c=s.get(h),u=o.get(h);if(!c&&u)n.push(u);else if(c&&!u)a.push(c);else{let d=Ml(u),f=e instanceof Map?Array.from(e.keys()).some(p=>d.has(p)):e.find(p=>d.has(p.targetId));(!Et(c,u)||f)&&l.push({prev:c,next:u})}}return{toAddElement:n,toDeleteElement:a,toUpdateElement:l}};var ed=r=>r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375,xU=r=>r,yU=r=>r*r,_U=r=>1-(1-r)*(1-r),bU=r=>r<.5?2*r*r:1-Math.pow(-2*r+2,2)/2,cC=Object.freeze({linear:xU,easeInQuad:yU,easeOutQuad:_U,easeInOutQuad:bU,easeInCubic:r=>r*r*r,easeOutCubic:r=>1-Math.pow(1-r,3),easeInOutCubic:r=>r<.5?4*r*r*r:1-Math.pow(-2*r+2,3)/2,easeInQuart:r=>r*r*r*r,easeOutQuart:r=>1-Math.pow(1-r,4),easeInOutQuart:r=>r<.5?8*r*r*r*r:1-Math.pow(-2*r+2,4)/2,easeInQuint:r=>r*r*r*r*r,easeOutQuint:r=>1-Math.pow(1-r,5),easeInOutQuint:r=>r<.5?16*r*r*r*r*r:1-Math.pow(-2*r+2,5)/2,easeInSine:r=>1-Math.cos(r*Math.PI/2),easeOutSine:r=>Math.sin(r*Math.PI/2),easeInOutSine:r=>-(Math.cos(Math.PI*r)-1)/2,easeInExpo:r=>r===0?0:Math.pow(2,10*r-10),easeOutExpo:r=>r===1?1:1-Math.pow(2,-10*r),easeInOutExpo:r=>r===0?0:r===1?1:r<.5?Math.pow(2,20*r-10)/2:(2-Math.pow(2,-20*r+10))/2,easeInCirc:r=>1-Math.sqrt(1-Math.pow(r,2)),easeOutCirc:r=>Math.sqrt(1-Math.pow(r-1,2)),easeInOutCirc:r=>r<.5?(1-Math.sqrt(1-Math.pow(2*r,2)))/2:(Math.sqrt(1-Math.pow(-2*r+2,2))+1)/2,easeInBack:r=>2.70158*r*r*r-1.70158*r*r,easeOutBack:r=>1+2.70158*Math.pow(r-1,3)+1.70158*Math.pow(r-1,2),easeInOutBack:r=>{let e=2.5949095;return r<.5?Math.pow(2*r,2)*((e+1)*2*r-e)/2:(Math.pow(2*r-2,2)*((e+1)*(r*2-2)+e)+2)/2},easeInBounce:r=>1-ed(1-r),easeOutBounce:ed,easeInOutBounce:r=>r<.5?(1-ed(1-2*r))/2:(1+ed(2*r-1))/2,easeInElastic:r=>{let t=2*Math.PI/3;return r===0?0:r===1?1:-Math.pow(2,10*r-10)*Math.sin((r*10-10.75)*t)},easeOutElastic:r=>{let t=2*Math.PI/3;return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r*10-.75)*t)+1},easeInOutElastic:r=>{let t=2*Math.PI/4.5;return r===0?0:r===1?1:r<.5?-(Math.pow(2,20*r-10)*Math.sin((20*r-11.125)*t))/2:Math.pow(2,-20*r+10)*Math.sin((20*r-11.125)*t)/2+1}}),Tx=Object.freeze(Object.keys(cC)),vU=(r="linear")=>{let t=cC[r];if(!t)throw new Error(`Unsupported easing: ${r}`);return t},Il=r=>{let t=[],e=0,i;return r.forEach(({value:s,duration:o,easing:n="linear",relative:a},l)=>{if(l===0){i=s,t.push({time:e,value:s,easing:"linear"});return}o!==void 0&&(e+=o,i=a?i+s:s,t.push({time:e,value:i,easing:n}))}),t},Bl=r=>{let t=0;for(let{timeline:e}of r){let i=e[e.length-1];i&&i.time>t&&(t=i.time)}return t},Fl=(r,t)=>{if(r.length===0)return 0;if(t<=r[0].time)return r[0].value;if(t>=r[r.length-1].time)return r[r.length-1].value;for(let e=0;e<r.length-1;e++){let{time:i,value:s,easing:o}=r[e],{time:n,value:a}=r[e+1];if(t>=i&&t<=n){let l=(t-i)/(n-i);return s+(a-s)*vU(o)(l)}}return r[r.length-1].value};var TU={translateX:0,translateY:0,alpha:1,scaleX:1,scaleY:1,rotation:0},wx=r=>Math.min(1,Math.max(0,r)),rd=(r,t,e)=>{if(r===t)return e<r?0:1;let i=wx((e-r)/(t-r));return i*i*(3-2*i)},fC=r=>r.getLocalBounds().rectangle.clone(),pC=r=>(r.width=Math.max(1,Math.ceil(r.width)),r.height=Math.max(1,Math.ceil(r.height)),r),uC=(r,t)=>{let e=pC(fC(t)),i=r.renderer.generateTexture({target:t,frame:e}),s=new kt(i);s.x=e.x,s.y=e.y;let o=new nt;return o.x=t.x??0,o.y=t.y??0,o.scale.set(t.scale?.x??1,t.scale?.y??1),o.rotation=t.rotation??0,o.alpha=t.alpha??1,o.addChild(s),{wrapper:o,texture:i}},SU=(r={})=>Object.entries(r).map(([t,e])=>({property:t,timeline:Il([{value:e.initialValue??TU[t]??0},...e.keyframes])})),id=(r,t,e)=>{if(!r||!t)return{duration:0,apply:()=>{}};let i=SU(t),s={x:r.x,y:r.y,alpha:r.alpha,scaleX:r.scale.x,scaleY:r.scale.y,rotation:r.rotation};return{duration:Bl(i),apply:o=>{r.x=s.x,r.y=s.y,r.alpha=s.alpha,r.scale.x=s.scaleX,r.scale.y=s.scaleY,r.rotation=s.rotation;for(let{property:n,timeline:a}of i){let l=Fl(a,o);switch(n){case"translateX":r.x=s.x+l*e.renderer.width;break;case"translateY":r.y=s.y+l*e.renderer.height;break;case"alpha":r.alpha=s.alpha*l;break;case"scaleX":r.scale.x=s.scaleX*l;break;case"scaleY":r.scale.y=s.scaleY*l;break;case"rotation":r.rotation=s.rotation+l;break}}}}},wU=r=>Il([{value:r?.progress?.initialValue??0},...r?.progress?.keyframes??[]]),EU=(r,t)=>{let e=document.createElement("canvas");e.width=r,e.height=t;let i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("Replace mask composition could not create a 2D canvas.");return{canvas:e,context:i}},AU=(r,t,e="red")=>{switch(e){case"green":return r[t+1];case"blue":return r[t+2];case"alpha":return r[t+3];default:return r[t]}},Sx=({app:r,texture:t,width:e,height:i,channel:s="red",invert:o=!1})=>{let n=new Uint8ClampedArray(e*i),a=new kt(I.from(t));a.width=e,a.height=i;let l=new nt;l.addChild(a);let h=hi.create({width:e,height:i});r.renderer.render({container:l,target:h,clear:!0});let c=r.renderer.extract.pixels(h).pixels;for(let u=0,d=0;u<n.length;u++,d+=4){let f=AU(c,d,s);o&&(f=255-f),n[u]=f}return l.destroy({children:!0}),h.destroy(!0),n},PU=(r,t,e,i)=>{let s=null;for(let o of t.items){let n=Sx({app:r,texture:o.texture,width:e,height:i,channel:o.channel??"red",invert:o.invert??!1});if(!s){s=n;continue}for(let a=0;a<s.length;a++)switch(t.combine??"max"){case"min":s[a]=Math.min(s[a],n[a]);break;case"multiply":s[a]=Math.round(s[a]/255*(n[a]/255)*255);break;case"add":s[a]=Math.min(255,s[a]+n[a]);break;default:s[a]=Math.max(s[a],n[a]);break}}return s??new Uint8ClampedArray(e*i)},CU=(r,t,e,i)=>{let s=wU(t),o=Bl([{timeline:s}]),n=Math.max(t?.softness??.001,1e-4);if(!t)return{duration:o,progressTimeline:s,sample:()=>0,destroy:()=>{}};if(t.kind==="single"){let l=Sx({app:r,texture:t.texture,width:e,height:i,channel:t.channel??"red",invert:t.invert??!1});return{duration:o,progressTimeline:s,sample:(h,c)=>rd(h-n,h+n,l[c]/255),destroy:()=>{}}}if(t.kind==="sequence"){let l=t.textures.map(h=>Sx({app:r,texture:h,width:e,height:i,channel:t.channel??"red",invert:t.invert??!1}));return{duration:o,progressTimeline:s,sample:(h,c)=>{let u=wx(h)*Math.max(0,l.length-1);if(t.sample==="linear"&&l.length>1){let f=Math.floor(u),p=Math.min(l.length-1,f+1),m=u-f,g=(l[f][c]*(1-m)+l[p][c]*m)/255;return rd(h-n,h+n,g)}let d=Math.min(l.length-1,Math.max(0,Math.round(u)));return rd(h-n,h+n,l[d][c]/255)},destroy:()=>{}}}let a=PU(r,t,e,i);return{duration:o,progressTimeline:s,sample:(l,h)=>rd(l-n,l+n,a[h]/255),destroy:()=>{}}},RU=r=>{let t=new nt;for(let e of r)e?.wrapper&&t.addChild(e.wrapper);return pC(fC(t))},dC=({app:r,container:t,target:e,frame:i})=>{r.renderer.render({container:t,target:e,clear:!0,transform:new G(1,0,0,1,-i.x,-i.y)})},kl=r=>{r?.texture?.destroy(!0)},MU=({app:r,animation:t,prevSubject:e,nextSubject:i,zIndex:s})=>{let o=new nt;o.zIndex=s,e?.wrapper&&o.addChild(e.wrapper),i?.wrapper&&o.addChild(i.wrapper);let n=id(e?.wrapper??null,t.prev?.tween,r),a=id(i?.wrapper??null,t.next?.tween,r);return{overlay:o,duration:Math.max(n.duration,a.duration),apply:l=>{n.apply(l),a.apply(l)},destroy:()=>{o.removeFromParent(),o.destroy({children:!0}),kl(e),kl(i)}}},IU=({app:r,animation:t,prevSubject:e,nextSubject:i,zIndex:s})=>{let o=RU([e,i]),n=new nt,a=new nt;e?.wrapper&&n.addChild(e.wrapper),i?.wrapper&&a.addChild(i.wrapper);let l=hi.create({width:o.width,height:o.height}),h=hi.create({width:o.width,height:o.height}),{canvas:c,context:u}=EU(o.width,o.height),d=u.createImageData(o.width,o.height),f=I.from(c),p=new nt;p.zIndex=s;let m=new kt(f);m.x=o.x,m.y=o.y,p.addChild(m);let g=CU(r,t.mask,o.width,o.height),_=id(e?.wrapper??null,t.prev?.tween,r),b=id(i?.wrapper??null,t.next?.tween,r),y=new Uint8ClampedArray(o.width*o.height*4);return{overlay:p,duration:Math.max(_.duration,b.duration,g.duration),apply:w=>{_.apply(w),b.apply(w);let E=y,v=y;e?.wrapper&&(dC({app:r,container:n,target:l,frame:o}),E=r.renderer.extract.pixels(l).pixels),i?.wrapper&&(dC({app:r,container:a,target:h,frame:o}),v=r.renderer.extract.pixels(h).pixels);let S=wx(Fl(g.progressTimeline,w)),P=d.data;for(let R=0,A=0;R<P.length;R+=4,A+=1){let C=g.sample(S,A),M=1-C;P[R]=Math.round(E[R]*M+v[R]*C),P[R+1]=Math.round(E[R+1]*M+v[R+1]*C),P[R+2]=Math.round(E[R+2]*M+v[R+2]*C),P[R+3]=Math.round(E[R+3]*M+v[R+3]*C)}u.putImageData(d,0,0),f.source.update()},destroy:()=>{p.removeFromParent(),p.destroy({children:!0}),n.destroy({children:!0}),a.destroy({children:!0}),l.destroy(!0),h.destroy(!0),f.destroy(!0),kl(e),kl(i),g.destroy()}}},BU=({app:r,animation:t,prevSubject:e,nextSubject:i,zIndex:s})=>t.mask?IU({app:r,animation:t,prevSubject:e,nextSubject:i,zIndex:s}):MU({app:r,animation:t,prevSubject:e,nextSubject:i,zIndex:s}),FU=({app:r,parent:t,nextElement:e,plugin:i,animations:s,eventHandler:o,animationBus:n,completionTracker:a,elementPlugins:l,renderContext:h,zIndex:c,signal:u})=>{if(!e)return null;let d=i.add({app:r,parent:t,element:e,animations:s,eventHandler:o,animationBus:n,completionTracker:a,elementPlugins:l,renderContext:h,zIndex:c,signal:u});return d&&typeof d.then=="function"?d.then(()=>u?.aborted||t.destroyed?null:t.children.find(f=>f.label===e.id)??null):u?.aborted||t.destroyed?null:t.children.find(f=>f.label===e.id)??null},kU=async r=>r&&typeof r.then=="function"?r:r??null,sd=({app:r,parent:t,prevElement:e,nextElement:i,animation:s,animations:o,animationBus:n,completionTracker:a,eventHandler:l,elementPlugins:h,renderContext:c,plugin:u,zIndex:d,signal:f})=>{if(!e&&!i)throw new Error(`Replace animation "${s.id}" must receive prevElement and/or nextElement.`);if(f?.aborted||t.destroyed)return;let p=e?t.children.find(M=>M.label===e.id)??null:null;if(e&&!p)throw new Error(`Transition animation "${s.id}" could not find the previous element "${e.id}".`);let m=p?uC(r,p):null,g=new nt,_=Xu({suppressAnimations:!0}),b=a.getVersion(),y=!1,w=()=>{y||(a.track(b),y=!0)},E=()=>{y&&(a.complete(b),y=!1)},v=({flushDeferredEffects:M})=>{if(!R){if(R=!0,S.value&&!S.value.destroyed&&(S.value.visible=!0),P.value?.destroy(),M){UP(_);return}ju(_)}},S={value:null},P={value:null},R=!1;w();let A=M=>{if(f?.aborted||t.destroyed){ju(_),g.destroy({children:!0}),kl(m),E();return}if(i&&!M)throw ju(_),E(),new Error(`Transition animation "${s.id}" could not create the next element "${i.id}".`);S.value=M;let B=M?uC(r,M):null;g.destroy({children:!1}),p&&u.delete({app:r,parent:t,element:e,animations:[],animationBus:n,completionTracker:a,eventHandler:l,elementPlugins:h,renderContext:c,signal:f}),M&&(M.zIndex=d,t.addChild(M),M.visible=!1);let k=BU({app:r,animation:s,prevSubject:m,nextSubject:B,zIndex:d});P.value=k,t.addChild(k.overlay),n.dispatch({type:"START",payload:{id:s.id,driver:"custom",duration:k.duration,applyFrame:k.apply,applyTargetState:()=>{v({flushDeferredEffects:!1})},onComplete:()=>{v({flushDeferredEffects:!0}),E()},onCancel:()=>{E()},isValid:()=>!!k.overlay&&!k.overlay.destroyed&&(!M||!M.destroyed)}})},C=i?FU({app:r,parent:g,nextElement:i,plugin:u,animations:o,eventHandler:l,animationBus:n,completionTracker:a,elementPlugins:h,renderContext:_,zIndex:d,signal:f}):null;if(C&&typeof C.then=="function"){kU(C).then(A);return}A(C??null)};var Ts=({app:r,parent:t,prevComputedTree:e,nextComputedTree:i,animations:s,animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h=Xu(),signal:c})=>{t.sortableChildren=!0;let u=new Map(l.map(y=>[y.type,y])),d=GP(s),f=new Map;for(let y=0;y<i.length;y++)f.set(i[y].id,y);let{toAddElement:p,toDeleteElement:m,toUpdateElement:g}=hC(e,i,s),_=y=>{let w=u.get(y);if(!w)throw new Error(`No plugin found for element type: ${y}`);return w},b=y=>t.children.find(w=>w.label===y)?.zIndex??-1;for(let y of t.children){let w=f.get(y.label);w!==void 0&&(y.zIndex=w)}for(let y of m){let w=h.suppressAnimations?null:Ku(d,y.id),E=_(y.type);if(w){sd({app:r,parent:t,prevElement:y,nextElement:null,animation:w,animations:d,animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h,plugin:E,zIndex:b(y.id),signal:c});continue}E.delete({app:r,parent:t,element:y,animations:[],animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h,signal:c})}for(let y of p){let w=h.suppressAnimations?null:Ku(d,y.id),E=_(y.type),v=f.get(y.id)??-1;if(w){sd({app:r,parent:t,prevElement:null,nextElement:y,animation:w,animations:d,animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h,plugin:E,zIndex:v,signal:c});continue}E.add({app:r,parent:t,element:y,animations:h.suppressAnimations||y.type==="container"?d:[],eventHandler:a,animationBus:o,completionTracker:n,elementPlugins:l,renderContext:h,zIndex:v,signal:c})}for(let{prev:y,next:w}of g){let E=_(w.type),v=f.get(w.id)??-1,S=h.suppressAnimations?null:Ku(d,w.id);if(S){sd({app:r,parent:t,prevElement:y,nextElement:w,animation:S,animations:d,animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h,plugin:E,zIndex:v,signal:c});continue}E.update({app:r,parent:t,prevElement:y,nextElement:w,animations:d,animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h,zIndex:v,signal:c})}};var UU=(r=[])=>{let t=new Set;for(let e of r)if(e?.id){if(t.has(e.id))return!0;t.add(e.id)}return!1},GU=({app:r,container:t,children:e,eventHandler:i,animationBus:s,elementPlugins:o,renderContext:n,completionTracker:a,signal:l})=>{for(let h of e){let c=o.find(u=>u.type===h.type);if(!c)throw new Error(`No plugin found for child element type: ${h.type}`);c.add({app:r,parent:t,element:h,animations:[],eventHandler:i,animationBus:s,elementPlugins:o,renderContext:n,completionTracker:a,signal:l})}},mC=({app:r,parent:t,element:e,animations:i,eventHandler:s,animationBus:o,elementPlugins:n,renderContext:a,zIndex:l,completionTracker:h,signal:c})=>{let{id:u,x:d,y:f,children:p,scroll:m,alpha:g}=e,_=new nt;_.label=u,_.zIndex=l,_.x=Math.round(d),_.y=Math.round(f),_.alpha=g,t.addChild(_),p&&p.length>0&&(UU(p)?GU({app:r,container:_,children:p,eventHandler:s,animationBus:o,elementPlugins:n,renderContext:a,completionTracker:h,signal:c}):Ts({app:r,parent:_,prevComputedTree:[],nextComputedTree:p,animations:i,animationBus:o,completionTracker:h,eventHandler:s,elementPlugins:n,renderContext:a,signal:c})),(m||e.anchorToBottom)&&Rl({container:_,element:e,interactive:!!m,allowViewportWithoutScroll:!!e.anchorToBottom});let y=e?.hover,w=e?.click,E=e?.rightClick;if(y){let{cursor:v,soundSrc:S,payload:P}=y;_.eventMode="static";let R=()=>{P&&s&&s("hover",{_event:{id:_.label},...P}),v&&(_.cursor=v),S&&r.audioStage.add({id:`hover-${Date.now()}`,url:S,loop:!1})},A=()=>{_.cursor="auto"};_.on("pointerover",R),_.on("pointerout",A)}if(w){let{soundSrc:v,soundVolume:S,payload:P}=w;_.eventMode="static";let R=A=>{oe(A)&&(P&&s&&s("click",{_event:{id:_.label},...P}),v&&r.audioStage.add({id:`click-${Date.now()}`,url:v,loop:!1,volume:(S??1e3)/1e3}))};_.on("pointerup",R)}if(E){let{soundSrc:v,payload:S}=E;_.eventMode="static";let P=()=>{S&&s&&s("rightClick",{_event:{id:_.label},...S}),v&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:v,loop:!1})};_.on("rightclick",P)}};var gC=({app:r,parent:t,prevElement:e,nextElement:i,eventHandler:s,animations:o,animationBus:n,elementPlugins:a,renderContext:l,zIndex:h,completionTracker:c,signal:u})=>{let d=t.children.find(b=>b.label===e.id);if(!d)return;d.zIndex=h;let{x:f,y:p,alpha:m}=i,g=()=>{if(!Et(e,i)){d.x=Math.round(f),d.y=Math.round(p),d.label=i.id,d.alpha=m,d.scale.x=1,d.scale.y=1,d.removeAllListeners("pointerover"),d.removeAllListeners("pointerout"),d.removeAllListeners("pointerup"),d.removeAllListeners("rightclick"),d.eventMode="auto",d.cursor="auto";let E=i?.hover,v=i?.click,S=i?.rightClick,P=!!(E||v||S);if(E){let{cursor:C,soundSrc:M,payload:B}=E;d.eventMode="static";let k=()=>{B&&s&&s("hover",{_event:{id:d.label},...B}),C&&(d.cursor=C),M&&r.audioStage.add({id:`hover-${Date.now()}`,url:M,loop:!1})},U=()=>{d.cursor="auto"};d.on("pointerover",k),d.on("pointerout",U)}if(v){let{soundSrc:C,soundVolume:M,payload:B}=v;d.eventMode="static";let k=U=>{oe(U)&&(B&&s&&s("click",{_event:{id:d.label},...B}),C&&r.audioStage.add({id:`click-${Date.now()}`,url:C,loop:!1,volume:(M??1e3)/1e3}))};d.on("pointerup",k)}if(S){let{soundSrc:C,payload:M}=S;d.eventMode="static";let B=()=>{M&&s&&s("rightClick",{_event:{id:d.label},...M}),C&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:C,loop:!1})};d.on("rightclick",B)}let R=e.scroll||e.anchorToBottom,A=i.scroll||i.anchorToBottom;R!==A?A?Rl({container:d,element:i,interactive:!!i.scroll,allowViewportWithoutScroll:!!i.anchorToBottom}):vx({container:d}):A&&(vx({container:d}),Rl({container:d,element:i,interactive:!!i.scroll,allowViewportWithoutScroll:!!i.anchorToBottom})),!i.scroll&&P&&(d.eventMode="static")}let b=!Et(e.children,i.children),y=Ml({children:i.children}),w=Array.from(y).some(E=>qu(o,E).length>0);if(b||w){let v=d.children.find(S=>S.label===`${i.id}-content`)||d;Ts({app:r,parent:v,nextComputedTree:i.children,prevComputedTree:e.children,eventHandler:s,elementPlugins:a,animations:o,animationBus:n,completionTracker:c,renderContext:l,signal:u})}};at({animations:o,targetId:e.id,animationBus:n,completionTracker:c,element:d,targetState:{x:f,y:p,alpha:m},onComplete:()=>{g()}})||g()};var xC=({app:r,parent:t,element:e,animationBus:i,animations:s,eventHandler:o,completionTracker:n})=>{let a=t.getChildByLabel(e.id);if(!a)return;let l=()=>{a&&!a.destroyed&&(t.removeChild(a),a.destroy({children:!0,texture:!0,baseTexture:!0}))};at({animations:s,targetId:e.id,animationBus:i,completionTracker:n,element:a,targetState:null,onComplete:l})||l()};var yC=({state:r,parserPlugins:t=[]})=>{let e=r.direction??"",i=!!r.scroll,s=r.gap||0,o=structuredClone(r.children||[]),n=[],a=0,l=0,h=0,c=0,u=0,d=0,f=0,p=0,m=0,g=0;for(let y=0;y<o.length;y++){let w=y<o.length-1?s:0,E=o[y];y>0?e==="horizontal"?(E.x=h,E.y=f):e==="vertical"&&(E.x=p,E.y=c):(e==="horizontal"||e==="vertical")&&(E.x=0,E.y=0);let v=t.find(S=>S.type===E.type);if(v){let S=(E.scaleX??1)*(r.scaleX??1),P=(E.scaleY??1)*(r.scaleY??1);E=v.parse({state:{...E,scaleX:S,scaleY:P},parserPlugins:t})}e==="horizontal"?(r.width&&E.width+m>r.width&&!i&&!r.anchorToBottom?(h=0,m=0,f+=u+s,u=E.height,E.x=0,E.y=f):u=Math.max(u,E.height),h+=E.width+w,m=E.x+E.width,a=Math.max(h,a),l=Math.max(E.height+E.y,l)):e==="vertical"?(r.height&&E.height+g>r.height&&!i&&!r.anchorToBottom?(c=0,g=0,p+=d+s,d=E.width,E.x=p,E.y=0):d=Math.max(d,E.width),c+=E.height+w,g=E.y+E.height,a=Math.max(E.width+E.x,a),l=Math.max(c,l)):(a=Math.max(E.width+E.x,a),l=Math.max(E.height+E.y,l)),n.push(E)}let b={...Ce({...r,width:r.width?r.width:a,height:r.height?r.height:l}),children:n,direction:e,gap:s,scroll:i,...r.anchorToBottom&&{anchorToBottom:!0},rotation:r.rotation??0};return r.rightClick&&(b.rightClick=r.rightClick),b};var OU=fe({type:"container",add:mC,update:gC,delete:xC,parse:yC});var _C=async({parent:r,element:t,animationBus:e,renderContext:i,completionTracker:s,zIndex:o,signal:n})=>{if(n?.aborted)return;let a=new nt;if(a.label=t.id,a.zIndex=o,t.x!==void 0&&(a.x=Math.round(t.x)),t.y!==void 0&&(a.y=Math.round(t.y)),t.alpha!==void 0&&(a.alpha=t.alpha),r.addChild(a),i?.suppressAnimations&&t.revealEffect!=="none"){await Hi({container:a,element:t,completionTracker:s,animationBus:e,zIndex:o,signal:n,playback:"paused-initial"}),Yu(i,{container:a,element:t,completionTracker:s,animationBus:e,zIndex:o,signal:n});return}await Hi({container:a,element:t,completionTracker:s,animationBus:e,zIndex:o,signal:n,playback:"autoplay"})};var bC=(r={})=>JSON.stringify({content:r.content??null,revealEffect:r.revealEffect??"typewriter",speed:r.speed??50,width:r.width??null,indicator:r.indicator??null,x:r.x??null,y:r.y??null,alpha:r.alpha??1}),LU=(r,t)=>bC(r)!==bC(t),vC=async({parent:r,prevElement:t,nextElement:e,animations:i,animationBus:s,renderContext:o,completionTracker:n,zIndex:a,signal:l})=>{if(l?.aborted)return;let h=r.children.find(d=>d.label===t.id);if(!h)return;let c=async()=>{if(e.x!==void 0&&(h.x=e.x),e.y!==void 0&&(h.y=e.y),e.alpha!==void 0&&(h.alpha=e.alpha),!!LU(t,e)){if(o?.suppressAnimations===!0&&e.revealEffect!=="none"){await Hi({container:h,element:e,completionTracker:n,animationBus:s,zIndex:a,signal:l,playback:"paused-initial"}),Yu(o,{container:h,element:e,completionTracker:n,animationBus:s,zIndex:a,signal:l});return}await Hi({container:h,element:e,completionTracker:n,animationBus:s,zIndex:a,signal:l,playback:"autoplay"})}};at({animations:i,targetId:t.id,animationBus:s,completionTracker:n,element:h,targetState:{x:e.x??h.x,y:e.y??h.y,alpha:e.alpha??h.alpha},onComplete:()=>{c()}})||await c()};var TC=({parent:r,element:t,animations:e,animationBus:i,completionTracker:s})=>{let o=r.getChildByLabel(t.id);if(!o||o.destroyed)return;let n=()=>{o&&!o.destroyed&&(xx(o),o.destroy({children:!0}))};at({animations:e,targetId:t.id,animationBus:i,completionTracker:s,element:o,targetState:null,onComplete:n})||n()};var DU=(r,t)=>{let e=[],i=[],s=0,o=0,n=0,a=0,l=0,h=[...r],c=new WeakSet,u=Math.max(10,r.reduce((f,p)=>f+(p?.text?.length??0),0)*4);for(;h.length>0;){if(l+=1,l>u)throw new Error("[parseTextRevealing] Failed to make progress while wrapping text.");let f=h[0];if(!f.text||f.text.length===0){h.shift();continue}let p=f.text,m=Math.max(1,Math.round(t-s)),g={...f.textStyle,wordWrapWidth:m},_=Jt.measureText(f.text,new Ht(g));if(_.lineWidths[0]>m&&i.length>0){e.push({lineParts:[...i],y:o,lineMaxHeight:n}),s=0,o+=n,n=0,i=[];continue}let b=_.lines[0]??"",y=_.lines.slice(1).join(" ");if(_.lines.length===1&&f.text.endsWith(" ")&&!b.endsWith(" ")&&(b+=" "),b.length===0&&p.length>0){let S=p.match(/^\s+/)?.[0]??"";b=S.length>0?S:p[0],y=p.slice(b.length)}if(y===p){let S=p.match(/^\s+/)?.[0]??p[0]??"";if(S.length===0)throw new Error("[parseTextRevealing] Failed to consume text while wrapping.");b=S,y=p.slice(S.length)}let w=Jt.measureText(b,new Ht({...f.textStyle,wordWrap:!1,breakWords:!1})),E=Math.max(0,Math.round(w.width??_.lineWidths[0]??0)),v={text:b,textStyle:g,height:w.height,x:s,y:o};if(f.furigana&&!c.has(f)){c.add(f);let S=Jt.measureText(f.furigana.text,new Ht(f.furigana.textStyle)),P=-S.height+o+2,R={text:f.furigana.text,textStyle:f.furigana.textStyle,x:Math.round(s+(E-S.width)/2),y:P};v.furigana=R}i.push(v),n=Math.max(n,w.height),s+=E,a=Math.max(a,s),y&&y.length>0?f.text=y:h.shift()}i.length>0&&e.push({lineParts:i,y:o,lineMaxHeight:n});for(let f=0;f<e.length;f++){let p=e[f].lineMaxHeight;e[f].lineParts=e[f].lineParts.map(m=>{let g=m.height;m.height&&delete m.height;let _=m.y+(p-g),b=m.furigana;return b&&(b.y=b.y-m.y+_),{...m,...b&&{furigana:b},y:_}})}let d=e.length>0?e[e.length-1].y+e[e.length-1].lineMaxHeight:0;return{chunks:e,width:Math.max(a,t),height:d}},SC=({state:r})=>{let t={..._e,wordWrap:!0,...r.textStyle||{}},e=(r.content||[]).map(c=>{let u={...t,...c.textStyle||{}};u.lineHeight=Math.round(u.lineHeight*u.fontSize),r.width&&(u.wordWrapWidth=r.width,u.wordWrap=!0);let d=null;if(c.furigana){let p={...t,...c.furigana.textStyle||{}};p.lineHeight=Math.round(p.lineHeight*p.fontSize),r.width&&(p.wordWrapWidth=r.width,p.wordWrap=!0),d={text:String(c.furigana.text),textStyle:p}}return{text:String(c.text).replace(/ +$/,p=>"\xA0".repeat(p.length)),textStyle:u,...d&&{furigana:d}}}),i=r.width||500,{chunks:s,width:o,height:n}=DU(e,i),a=r.width||o,h=Ce({...r,width:a,height:n});if(h.alpha=r.alpha??1,r.indicator){let c=r.indicator;h.indicator={revealing:{src:c.revealing?.src??"",width:c.revealing?.width??12,height:c.revealing?.height??12},complete:{src:c.complete?.src??"",width:c.complete?.width??12,height:c.complete?.height??12},offset:c.offset??12}}return{...h,content:s,textStyle:{...t,...r.textStyle||{}},speed:r.speed??50,revealEffect:r.revealEffect??"typewriter",...r.width!==void 0&&{width:r.width},...r.complete&&{complete:r.complete}}};var NU=fe({type:"text-revealing",add:_C,update:vC,delete:TC,parse:SC});var od=(r,t,e)=>{if(!e)return;let i=s=>{s?.detail?.elementId===t&&typeof s?.detail?.frameIndex=="number"&&r.gotoAndStop(s?.detail?.frameIndex)};window.addEventListener("snapShotAnimatedSpriteFrame",i),r._snapShotKeyFrameHandler=i},nd=r=>{r._snapShotKeyFrameHandler&&(window.removeEventListener("snapShotAnimatedSpriteFrame",r._snapShotKeyFrameHandler),delete r._snapShotKeyFrameHandler)};var wC=async({app:r,parent:t,element:e,renderContext:i,zIndex:s,signal:o})=>{if(o?.aborted)return;let{id:n,x:a,y:l,width:h,height:c,spritesheetSrc:u,spritesheetData:d,animation:f,alpha:p}=e,m=d,g=Object.keys(m.frames),_=new Ci(I.from(u),m);if(await _.parse(),o?.aborted||t.destroyed)return;let b=f.frames.map(w=>_.textures[g[w]]),y=new wl(b);y.label=n,y.zIndex=s,y.animationSpeed=f.animationSpeed??.5,y.loop=f.loop??!0,r.debug?od(y,n,r.debug):IP(i,y),y.x=Math.round(a),y.y=Math.round(l),y.width=Math.round(h),y.height=Math.round(c),y.alpha=p,t.addChild(y)};var EC=async({app:r,parent:t,prevElement:e,nextElement:i,animations:s,animationBus:o,completionTracker:n,zIndex:a,signal:l})=>{if(l?.aborted)return;let h=t.children.find(_=>_.label===e.id);if(!h)return;h.zIndex=a;let c=async()=>{if(!(l?.aborted||h.destroyed)&&!Et(e,i)&&(h.x=Math.round(i.x),h.y=Math.round(i.y),h.width=Math.round(i.width),h.height=Math.round(i.height),h.alpha=i.alpha,!Et(e.animation,i.animation))){h.animationSpeed=i.animation.animationSpeed??.5,h.loop=i.animation.loop??!0;let _=i.spritesheetData,b=Object.keys(_.frames),y=new Ci(I.from(i.spritesheetSrc),_);if(await y.parse(),l?.aborted||h.destroyed)return;let w=i.animation.frames.map(E=>y.textures[b[E]]);h.textures=w,r.debug?e.id!==i.id&&(nd(h),od(h,i.id,r.debug)):h.play()}},{x:u,y:d,width:f,height:p,alpha:m}=i;at({animations:s,targetId:e.id,animationBus:o,completionTracker:n,element:h,targetState:{x:u,y:d,width:f,height:p,alpha:m},onComplete:()=>{c()}})||await c()};var AC=({app:r,parent:t,element:e,animations:i,animationBus:s,completionTracker:o})=>{let n=t.children.find(h=>h.label===e.id);if(!n)return;let a=()=>{r.debug&&nd(n),n&&!n.destroyed&&(n.stop(),n.destroy())};at({animations:i,targetId:e.id,animationBus:s,completionTracker:o,element:n,targetState:null,onComplete:a})||a()};var PC=({state:r})=>({...Ce(r),spritesheetSrc:r.spritesheetSrc??"",spritesheetData:{frames:{},meta:{},...r.spritesheetData??{}},animation:{frames:[],animationSpeed:.5,loop:!0,...r.animation??{}},alpha:r.alpha??1});var HU=fe({type:"animated-sprite",add:wC,update:EC,delete:AC,parse:PC});var VU=fx({type:"tween"});var Ss=new Map,WU=r=>({id:r.id,url:r.src,loop:r.loop??!1,volume:(r.volume??800)/1e3}),CC=r=>Ss.has(r),Ul=r=>{let t=Ss.get(r);t!==void 0&&(clearTimeout(t),Ss.delete(r))},Ex=({app:r,element:t})=>{let e=WU(t);if(Ul(e.id),t.delay&&t.delay>0){let i=setTimeout(()=>{Ss.delete(e.id),r.audioStage.add(e)},t.delay);Ss.set(e.id,i);return}r.audioStage.add(e)},Ax=()=>{for(let r of Ss.values())clearTimeout(r);Ss.clear()},RC=({app:r,element:t})=>{Ex({app:r,element:t})};var MC=({app:r,prevElement:t,nextElement:e})=>{let i=t.id;if((e.delay??0)>0){r.audioStage.remove(i),Ex({app:r,element:e});return}if(CC(i)){Ul(i),r.audioStage.add({id:i,url:e.src,loop:e.loop??!1,volume:(e.volume??800)/1e3});return}let o=r.audioStage.getById(i);if(!o){r.audioStage.add({id:i,url:e.src,loop:e.loop??!1,volume:(e.volume??800)/1e3});return}o.url=e.src,o.loop=e.loop??!1,o.volume=(e.volume??800)/1e3};var IC=({app:r,element:t})=>{Ul(t.id),r.audioStage.remove(t.id)};var zU=px({type:"sound",add:RC,update:MC,delete:IC});var Gl=class extends kt{emitter=null;maxLife=0;age=0;oneOverLife=0;get agePercent(){return this.age*this.oneOverLife}velocity={x:0,y:0};rotationSpeed=0;config={};next=null;prev=null;constructor(t){super(),this.emitter=t,this.anchor.set(.5,.5)}init(t){this.maxLife=t,this.age=0,this.oneOverLife=1/t,this.rotation=0,this.position.set(0,0),this.scale.set(1,1),this.tint=16777215,this.alpha=1,this.visible=!0,this.velocity.x=0,this.velocity.y=0,this.rotationSpeed=0,this.config={}}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=null,this.next=null,this.prev=null,super.destroy()}};function Px(r){let t=new de;return t.circle(0,0,3),t.fill({color:16777215}),r.renderer.generateTexture(t)}function Cx(r){let t=new de;return t.rect(0,0,1,8),t.fill({color:8965375}),r.renderer.generateTexture(t)}function Rx(r){let t=new de;return t.circle(0,0,4),t.fill({color:16777215}),r.renderer.generateTexture(t)}function Ol(r,t,e){return r+(t-r)*e}function ld(r){if(typeof r=="number")return r;let t=r.replace(/^(#|0x)/,"");return parseInt(t,16)}function BC(r,t,e){let i=r>>16&255,s=r>>8&255,o=r&255,n=t>>16&255,a=t>>8&255,l=t&255,h=Math.round(Ol(i,n,e)),c=Math.round(Ol(s,a,e)),u=Math.round(Ol(o,l,e));return h<<16|c<<8|u}var ad=class r{constructor(t,e,i=!1){this.value=i?ld(t):t,this.time=e,this.next=null}static createList(t,e=!1){let i=[...t].sort((n,a)=>n.time-a.time),s=new r(i[0].value,i[0].time,e),o=s;for(let n=1;n<i.length;n++)o.next=new r(i[n].value,i[n].time,e),o=o.next;return s}},Er=class{constructor(t=!1){this.first=null,this.isColor=t,this.ease=null}reset(t){Array.isArray(t)?this.first=ad.createList(t,this.isColor):this.first=t}getValue(t){if(this.ease&&(t=this.ease(t)),!this.first.next||t<=this.first.time)return this.first.value;let e=this.first;for(;e.next&&e.next.time<t;)e=e.next;if(!e.next||t>=e.next.time)return e.next?e.next.value:e.value;let i=(t-e.time)/(e.next.time-e.time);return this.isColor?BC(e.value,e.next.value,i):Ol(e.value,e.next.value,i)}};var hd=class{static type="alpha";constructor(t){this.list=new Er(!1),this.list.reset(t.list)}initParticles(t){let e=t,i=this.list.getValue(0);for(;e;)e.alpha=i,e=e.next}updateParticle(t,e){t.alpha=this.list.getValue(t.agePercent)}},cd=class{static type="alphaStatic";constructor(t){this.alpha=t.alpha}initParticles(t){let e=t;for(;e;)e.alpha=this.alpha,e=e.next}updateParticle(t,e){}};var ud=class{static type="scale";constructor(t){this.list=new Er(!1),this.list.reset(t.list),this.minMult=t.minMult??1}initParticles(t){let e=t;for(;e;){let i=this.minMult<1?e.emitter.random()*(1-this.minMult)+this.minMult:1;e.config.scaleMult=i;let s=this.list.getValue(0)*i;e.scale.set(s,s),e=e.next}}updateParticle(t,e){let i=this.list.getValue(t.agePercent)*t.config.scaleMult;t.scale.set(i,i)}},dd=class{static type="scaleStatic";constructor(t){this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){let i=e.emitter.random()*(this.max-this.min)+this.min;e.scale.set(i,i),e=e.next}}updateParticle(t,e){}};var $U=Math.PI/180,fd=class{static type="speed";constructor(t){this.list=new Er(!1),this.list.reset(t.list),this.minMult=t.minMult??1}initParticles(t){let e=t;for(;e;){let i=this.minMult<1?e.emitter.random()*(1-this.minMult)+this.minMult:1;e.config.speedMult=i;let s=this.list.getValue(0)*i;e.velocity.x=Math.cos(e.rotation)*s,e.velocity.y=Math.sin(e.rotation)*s,e=e.next}}updateParticle(t,e){let i=this.list.getValue(t.agePercent)*t.config.speedMult,s=Math.sqrt(t.velocity.x*t.velocity.x+t.velocity.y*t.velocity.y);s>0&&(t.velocity.x=t.velocity.x/s*i,t.velocity.y=t.velocity.y/s*i),t.x+=t.velocity.x*e,t.y+=t.velocity.y*e}},pd=class{static type="speedStatic";constructor(t){this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){let i=e.emitter.random()*(this.max-this.min)+this.min;e.velocity.x=Math.cos(e.rotation)*i,e.velocity.y=Math.sin(e.rotation)*i,e=e.next}}updateParticle(t,e){t.x+=t.velocity.x*e,t.y+=t.velocity.y*e}},md=class{static type="movePoint";constructor(t){this.minSpeed=t.speed.min,this.maxSpeed=t.speed.max,this.direction=t.direction*$U}initParticles(t){let e=t;for(;e;){let i=e.emitter.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed;e.velocity.x=Math.cos(this.direction)*i,e.velocity.y=Math.sin(this.direction)*i,e=e.next}}updateParticle(t,e){t.x+=t.velocity.x*e,t.y+=t.velocity.y*e}};var Odt=Math.PI/180,gd=class{static type="acceleration";constructor(t){this.accelX=t.accel.x,this.accelY=t.accel.y,this.minStart=t.minStart,this.maxStart=t.maxStart,this.rotate=t.rotate??!1,this.maxSpeed=t.maxSpeed??0}initParticles(t){let e=t;for(;e;){let i=e.emitter.random()*(this.maxStart-this.minStart)+this.minStart;e.velocity.x=Math.cos(e.rotation)*i,e.velocity.y=Math.sin(e.rotation)*i,e=e.next}}updateParticle(t,e){let i=t.velocity,s=i.x,o=i.y;if(i.x+=this.accelX*e,i.y+=this.accelY*e,this.maxSpeed>0){let n=Math.sqrt(i.x*i.x+i.y*i.y);if(n>this.maxSpeed){let a=this.maxSpeed/n;i.x*=a,i.y*=a}}t.x+=(s+i.x)/2*e,t.y+=(o+i.y)/2*e,this.rotate&&(t.rotation=Math.atan2(i.y,i.x))}},xd=class{static type="gravity";constructor(t){this.gravity=t.gravity}initParticles(t){}updateParticle(t,e){t.velocity.y+=this.gravity*e,t.x+=t.velocity.x*e,t.y+=t.velocity.y*e}};var Vi=Math.PI/180,yd=class{static type="rotation";constructor(t){this.minStart=t.minStart*Vi,this.maxStart=t.maxStart*Vi,this.minSpeed=t.minSpeed*Vi,this.maxSpeed=t.maxSpeed*Vi,this.accel=(t.accel??0)*Vi}initParticles(t){let e=t;for(;e;)e.rotation=e.emitter.random()*(this.maxStart-this.minStart)+this.minStart,e.rotationSpeed=e.emitter.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}updateParticle(t,e){if(this.accel!==0){let i=t.rotationSpeed;t.rotationSpeed+=this.accel*e,t.rotation+=(i+t.rotationSpeed)/2*e}else t.rotation+=t.rotationSpeed*e}},_d=class{static type="rotationStatic";constructor(t){this.min=t.min*Vi,this.max=t.max*Vi}initParticles(t){let e=t;for(;e;)e.rotation=e.emitter.random()*(this.max-this.min)+this.min,e=e.next}updateParticle(t,e){}},bd=class{static type="noRotation";constructor(t){this.rotation=(t.rotation??0)*Vi}initParticles(t){let e=t;for(;e;)e.rotation=this.rotation,e=e.next}updateParticle(t,e){t.rotation=this.rotation}};var vd=class{static type="color";constructor(t){this.list=new Er(!0),this.list.reset(t.list)}initParticles(t){let e=t,i=this.list.getValue(0);for(;e;)e.tint=i,e=e.next}updateParticle(t,e){t.tint=this.list.getValue(t.agePercent)}},Td=class{static type="colorStatic";constructor(t){this.color=ld(t.color)}initParticles(t){let e=t;for(;e;)e.tint=this.color,e=e.next}updateParticle(t,e){}};var Sd=class{constructor(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}getRandPos(t,e){t.x=this.x+e.random()*this.w,t.y=this.y+e.random()*this.h}},wd=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius,this.innerRadius=t.innerRadius??0,this.affectRotation=t.affectRotation??!1}getRandPos(t,e){let i=e.random()*Math.PI*2,s=this.radius-this.innerRadius,o=e.random()*s+this.innerRadius;t.x=this.x+Math.cos(i)*o,t.y=this.y+Math.sin(i)*o,this.affectRotation&&(t.rotation=i)}},Mx=class{constructor(t){this.x=t.x,this.y=t.y}getRandPos(t,e){t.x=this.x,t.y=this.y}},Ix=class{constructor(t){this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2}getRandPos(t,e){let i=e.random();t.x=this.x1+(this.x2-this.x1)*i,t.y=this.y1+(this.y2-this.y1)*i}},XU={rect:Sd,rectangle:Sd,torus:wd,circle:wd,point:Mx,line:Ix};var Ed=class{static type="spawnShape";constructor(t){let e=XU[t.type];if(!e)throw new Error(`Unknown spawn shape type: ${t.type}`);this.shape=new e(t.data)}initParticles(t){let e=t,i={x:0,y:0,rotation:void 0};for(;e;)this.shape.getRandPos(i,e.emitter),e.x=i.x,e.y=i.y,i.rotation!==void 0&&(e.rotation=i.rotation),e=e.next}updateParticle(t,e){}},Ad=class{static type="spawnBurst";constructor(t){this.x=t.x,this.y=t.y,this.spacing=(t.spacing??0)*Math.PI/180,this.startAngle=(t.startAngle??0)*Math.PI/180}initParticles(t){let e=t,i=this.startAngle;for(;e;)e.x=this.x,e.y=this.y,e.rotation=i,i+=this.spacing,e=e.next}updateParticle(t,e){}};var FC=new Map,kC=new Map;function Bx(r,t){FC.set(r,t)}function Re(r){kC.set(r.type,r)}function UC(r,t){let e=FC.get(r);return e?e(t):null}function GC(r){return kC.get(r)}Bx("circle",Rx);Bx("snowflake",Px);Bx("raindrop",Cx);Re(hd);Re(cd);Re(ud);Re(dd);Re(fd);Re(pd);Re(md);Re(gd);Re(xd);Re(yd);Re(_d);Re(bd);Re(vd);Re(Td);Re(Ed);Re(Ad);var Pd=class{constructor(t){this.seed=t,this.state=t}next(){let t=this.state+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}reset(){this.state=this.seed}};var Ll=class{container=null;texture=null;_activeFirst=null;_activeLast=null;_poolFirst=null;particleCount=0;maxParticles=1e3;lifetime={min:1,max:2};frequency=.1;particlesPerWave=1;_spawnTimer=0;emitterLifetime=-1;_emitterAge=0;emit=!0;destroyed=!1;initBehaviors=[];updateBehaviors=[];recycleBehaviors=[];spawnBounds=null;recycleOnBounds=!1;rng=null;constructor(t,e){this.container=t,this.init(e)}init(t){if(t.seed!==void 0&&t.seed!==null&&(this.rng=new Pd(t.seed)),t.texture&&(this.texture=t.texture),t.lifetime&&(this.lifetime.min=t.lifetime.min??1,this.lifetime.max=t.lifetime.max??t.lifetime.min??2),this.frequency=t.frequency??.1,this.particlesPerWave=t.particlesPerWave??1,this.maxParticles=t.maxParticles??1e3,this.emitterLifetime=t.emitterLifetime??-1,t.spawnBounds&&(this.spawnBounds=t.spawnBounds,this.recycleOnBounds=t.recycleOnBounds??!1),this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],t.behaviors)for(let e of t.behaviors){let i=GC(e.type);if(!i){console.warn(`Unknown behavior type: ${e.type}`);continue}let s=new i(e.config);s.initParticles&&this.initBehaviors.push(s),s.updateParticle&&this.updateBehaviors.push(s),s.recycleParticle&&this.recycleBehaviors.push(s)}this._spawnTimer=0,this._emitterAge=0,this.emit=t.emit??!0}_createParticle(){let t;return this._poolFirst?(t=this._poolFirst,this._poolFirst=t.next,t.next=null):t=new Gl(this),t.texture=this.texture,t}spawn(t){if(this.destroyed||t<=0)return null;let e=this.maxParticles-this.particleCount;if(t=Math.min(t,e),t<=0)return null;let i=null,s=null;for(let o=0;o<t;o++){let n=this._createParticle(),a=this.lifetime.min+this.random()*(this.lifetime.max-this.lifetime.min);n.init(a),i||(i=n),s&&(s.next=n,n.prev=s),s=n,this.container.addChild(n)}for(let o of this.initBehaviors)o.initParticles(i);return this._activeLast?(this._activeLast.next=i,i.prev=this._activeLast):this._activeFirst=i,this._activeLast=s,this.particleCount+=t,i}emitNow(){this.spawn(this.particlesPerWave)}recycle(t){for(let e of this.recycleBehaviors)e.recycleParticle(t);t.prev?t.prev.next=t.next:this._activeFirst=t.next,t.next?t.next.prev=t.prev:this._activeLast=t.prev,t.prev=null,t.next=null,t.parent&&t.parent.removeChild(t),t.next=this._poolFirst,this._poolFirst=t,this.particleCount--}update(t){if(this.destroyed)return;if(this.emitterLifetime>0&&(this._emitterAge+=t,this._emitterAge>=this.emitterLifetime&&(this.emit=!1)),this.emit)if(this.frequency<=0)this.spawn(this.particlesPerWave),this.emit=!1;else for(this._spawnTimer+=t;this._spawnTimer>=this.frequency;)this._spawnTimer-=this.frequency,this.spawn(this.particlesPerWave);let e=this._activeFirst;for(;e;){let i=e.next;if(e.age+=t,e.age>=e.maxLife){this.recycle(e),e=i;continue}if(this.recycleOnBounds&&this.spawnBounds){let s=this.spawnBounds;if(e.x<s.x||e.x>s.x+s.width||e.y<s.y||e.y>s.y+s.height){this.recycle(e),e=i;continue}}for(let s of this.updateBehaviors)s.updateParticle(e,t);e=i}}stop(t=!1){if(this.emit=!1,t)for(;this._activeFirst;)this.recycle(this._activeFirst)}restart(){this._emitterAge=0,this._spawnTimer=0,this.emit=!0}random(){return this.rng?this.rng.next():Math.random()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.emit=!1;let t=this._activeFirst;for(;t;){let e=t.next;t.destroy(),t=e}for(t=this._poolFirst;t;){let e=t.next;t.destroy(),t=e}this._activeFirst=null,this._activeLast=null,this._poolFirst=null,this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[]}};function jU(r,t){let e=new de,i=t.color??"#ffffff";switch(t.shape){case"circle":{let s=t.radius??3;e.circle(0,0,s),e.fill({color:i});break}case"ellipse":{let s=t.width??2,o=t.height??6;e.ellipse(0,0,s/2,o/2),e.fill({color:i});break}case"rect":{let s=t.width??4,o=t.height??4;e.rect(-s/2,-o/2,s,o),e.fill({color:i});break}default:e.circle(0,0,3),e.fill({color:i})}return r.renderer.generateTexture(e)}var Dl=({app:r,parent:t,element:e,renderContext:i,zIndex:s})=>{let o=new nt;o.label=e.id,o.zIndex=s,t.addChild(o);let n=e.width,a=e.height;o.x=e.x??0,o.y=e.y??0;let l={lifetime:e.emitter?.lifetime??{min:1,max:2},frequency:e.emitter?.frequency??.1,particlesPerWave:e.emitter?.particlesPerWave??1,maxParticles:e.emitter?.maxParticles??e.count??100,emitterLifetime:e.emitter?.emitterLifetime??-1,spawnBounds:e.emitter?.spawnBounds,recycleOnBounds:e.emitter?.recycleOnBounds??!1,seed:e.emitter?.seed,behaviors:e.behaviors},h;if(typeof e.texture=="object"&&e.texture.shape)h=jU(r,e.texture);else{let d=e.texture??"circle";if(h=UC(d,r),!h)try{h=I.from(d)}catch{console.warn(`Failed to load particle texture: ${d}`);return}}l.texture=h;let c=new Ll(o,l);if(o.emitter=c,l.recycleOnBounds){let d=Math.min(e.count??100,l.maxParticles);c.spawn(d);let f=c._activeFirst;for(;f;)f.y=c.random()*a,f.age=c.random()*f.maxLife*.8,f=f.next}let u=d=>{if(c.destroyed){r.ticker.remove(u);return}c.update(d.deltaTime/60)};o.tickerCallback=u,FP(i,{app:r,emitter:c,container:o,tickerCallback:u}),e.alpha!==void 0&&(o.alpha=e.alpha)};var Cd=({app:r,parent:t,element:e,animationBus:i,animations:s,completionTracker:o})=>{let n=t.getChildByLabel(e.id);if(!n)return;let a=()=>{n&&!n.destroyed&&(n.emitter&&n.emitter.destroy(),n.tickerCallback&&r.ticker.remove(n.tickerCallback),n.customTickerHandler&&window.removeEventListener("snapShotKeyFrame",n.customTickerHandler),n.destroy({children:!0}))};at({animations:s,targetId:e.id,animationBus:i,completionTracker:o,element:n,targetState:null,onComplete:a})||a()};var OC=({app:r,parent:t,prevElement:e,nextElement:i,animations:s,animationBus:o,completionTracker:n,zIndex:a})=>{let l=t.children.find(c=>c.label===e.id);if(!l){Dl({app:r,parent:t,element:i,animations:s,animationBus:o,completionTracker:n,zIndex:a});return}if(l.zIndex=a,YU(e,i))Cd({app:r,parent:t,element:e,animations:s,animationBus:o,completionTracker:n}),Dl({app:r,parent:t,element:i,animations:s,animationBus:o,completionTracker:n,zIndex:a});else{let c=()=>{i.alpha!==void 0&&(l.alpha=i.alpha),i.x!==void 0&&(l.x=i.x),i.y!==void 0&&(l.y=i.y)};at({animations:s,targetId:e.id,animationBus:o,completionTracker:n,element:l,targetState:{x:i.x??l.x,y:i.y??l.y,alpha:i.alpha??l.alpha},onComplete:c})||c()}};function YU(r,t){return r.count!==t.count||!Et(r.texture,t.texture)||!Et(r.behaviors,t.behaviors)||!Et(r.emitter,t.emitter)||r.width!==t.width||r.height!==t.height}function LC(r){if(!r.id)throw new Error("Input Error: Id is missing");if(!Object.values(bs).includes(r.type))throw new Error("Input Error: Type must be one of "+Object.values(bs).join(", "));if(typeof r.width!="number"||typeof r.height!="number")throw new Error("Input Error: Width and height must be numbers");if(r.width<=0||r.height<=0)throw new Error("Input Error: Width and height must be positive")}function DC(r){if(!r.texture)throw new Error("Input Error: Particles require 'texture'");let t=typeof r.texture=="string",e=typeof r.texture=="object"&&r.texture!==null&&!Array.isArray(r.texture);if(!t&&!e)throw new Error("Input Error: texture must be a string or shape object");if(e){if(!r.texture.shape)throw new Error("Input Error: texture object must have 'shape' property");if(!["circle","ellipse","rect"].includes(r.texture.shape))throw new Error(`Input Error: texture.shape must be 'circle', 'ellipse', or 'rect', got '${r.texture.shape}'`)}}function NC(r){if(!r.behaviors)throw new Error("Input Error: Particles require 'behaviors'");if(!Array.isArray(r.behaviors))throw new Error("Input Error: 'behaviors' must be an array");if(r.behaviors.length===0)throw new Error("Input Error: 'behaviors' array cannot be empty");for(let t=0;t<r.behaviors.length;t++){let e=r.behaviors[t];if(typeof e!="object"||e===null||Array.isArray(e))throw new Error(`Input Error: behaviors[${t}] must be an object`);if(!e.type||typeof e.type!="string")throw new Error(`Input Error: behaviors[${t}] must have a 'type' string property`)}}function HC(r){if(!r.emitter)throw new Error("Input Error: Particles require 'emitter'");if(typeof r.emitter!="object"||Array.isArray(r.emitter))throw new Error("Input Error: 'emitter' must be an object");if(!r.emitter.lifetime)throw new Error("Input Error: emitter.lifetime is required");if(typeof r.emitter.lifetime!="object"||Array.isArray(r.emitter.lifetime))throw new Error("Input Error: emitter.lifetime must be an object");if(typeof r.emitter.lifetime.min!="number"||typeof r.emitter.lifetime.max!="number")throw new Error("Input Error: emitter.lifetime.min and max must be numbers");if(r.emitter.lifetime.min<0||r.emitter.lifetime.max<0)throw new Error("Input Error: emitter.lifetime.min and max must be non-negative");if(r.emitter.lifetime.min>r.emitter.lifetime.max)throw new Error("Input Error: emitter.lifetime.min cannot be greater than max")}function VC(r){if(r.emitter.frequency!==void 0){if(typeof r.emitter.frequency!="number")throw new Error("Input Error: emitter.frequency must be a number");if(r.emitter.frequency<0)throw new Error("Input Error: emitter.frequency must be non-negative")}if(r.emitter.particlesPerWave!==void 0){if(typeof r.emitter.particlesPerWave!="number")throw new Error("Input Error: emitter.particlesPerWave must be a number");if(r.emitter.particlesPerWave<=0)throw new Error("Input Error: emitter.particlesPerWave must be positive");if(!Number.isInteger(r.emitter.particlesPerWave))throw new Error("Input Error: emitter.particlesPerWave must be an integer")}if(r.emitter.maxParticles!==void 0){if(typeof r.emitter.maxParticles!="number")throw new Error("Input Error: emitter.maxParticles must be a number");if(r.emitter.maxParticles<=0)throw new Error("Input Error: emitter.maxParticles must be positive");if(!Number.isInteger(r.emitter.maxParticles))throw new Error("Input Error: emitter.maxParticles must be an integer")}}function WC(r){if(r.count!==void 0){if(typeof r.count!="number")throw new Error("Input Error: count must be a number");if(r.count<=0)throw new Error("Input Error: count must be positive");if(!Number.isInteger(r.count))throw new Error("Input Error: count must be an integer")}if(r.alpha!==void 0){if(typeof r.alpha!="number")throw new Error("Input Error: alpha must be a number");if(r.alpha<0||r.alpha>1)throw new Error("Input Error: alpha must be between 0 and 1")}if(r.x!==void 0&&typeof r.x!="number")throw new Error("Input Error: x must be a number");if(r.y!==void 0&&typeof r.y!="number")throw new Error("Input Error: y must be a number")}var zC=({state:r})=>{LC(r),DC(r),NC(r),HC(r),VC(r),WC(r);let t=r.emitter?.maxParticles??r.count??100,e=r.emitter;return e&&e.maxParticles===void 0&&r.count!==void 0&&(e={...e,maxParticles:t}),{id:r.id,type:r.type,count:t,texture:r.texture,behaviors:r.behaviors,emitter:e,x:r.x??0,y:r.y??0,width:r.width,height:r.height,alpha:r.alpha??1}};var qU=fe({type:"particles",add:Dl,update:OC,delete:Cd,parse:zC});var $C=(r=[],t=[])=>{let e=new Set,i=new Map,s=new Map,o=[],n=[],a=[];for(let l of r)e.add(l.id),i.set(l.id,l);for(let l of t)e.add(l.id),s.set(l.id,l);for(let l of e){let h=i.get(l),c=s.get(l);!h&&c?o.push(c):h&&!c?n.push(h):(h.src!==c.src||h.volume!==c.volume||h.loop!==c.loop||h.delay!==c.delay)&&a.push({prev:h,next:c})}return{toAddElement:o,toDeleteElement:n,toUpdateElement:a}};var Fx=({app:r,prevAudioTree:t,nextAudioTree:e,audioPlugins:i})=>{let{toAddElement:s,toDeleteElement:o,toUpdateElement:n}=$C(t,e);for(let a of o){let l=i.find(h=>h.type===a.type);if(!l)throw new Error(`No audio plugin found for type: ${a.type}`);l.delete({app:r,element:a})}for(let a of s){let l=i.find(h=>h.type===a.type);if(!l)throw new Error(`No audio plugin found for type: ${a.type}`);l.add({app:r,element:a})}for(let{prev:a,next:l}of n){let h=i.find(c=>c.type===l.type);if(!h)throw new Error(`No audio plugin found for type: ${l.type}`);h.update({app:r,prevElement:a,nextElement:l})}};var Je=(r=>(r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2",r))(Je||{}),kx=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS",r))(kx||{}),Rd=(r=>(r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL",r))(Rd||{}),et=(r=>(r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR",r))(et||{}),Ko=(r=>(r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN",r))(Ko||{}),D=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(D||{}),di=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(di||{}),lt=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(lt||{}),W=(r=>(r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT",r))(W||{}),mr=(r=>(r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR",r))(mr||{}),Nl=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(Nl||{}),Ar=(r=>(r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL",r))(Ar||{}),tr=(r=>(r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",r))(tr||{}),Wi=(r=>(r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT",r))(Wi||{}),Md=(r=>(r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL",r))(Md||{}),De=(r=>(r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp",r))(De||{}),ne=(r=>(r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR",r))(ne||{});var Rt=(r=>(r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH",r))(Rt||{}),Ye=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(Ye||{});var Ux={createCanvas:(r,t)=>{let e=document.createElement("canvas");return e.width=r,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")};var K={ADAPTER:Ux,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};hp();var KU=Ei.default??Ei,Pr=KU(globalThis.navigator);K.RETINA_PREFIX=/@([0-9\.]+)x/;K.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Ms=Zi(jC(),1),HL=Zi(Rc(),1);var my=Zi(hI(),1);var cI={};function ft(r,t,e=3){if(cI[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
1144
+ `,Yo=null,Sl=class{constructor(){Yo||(Yo=URL.createObjectURL(new Blob([kk],{type:"application/javascript"}))),this.worker=new Worker(Yo)}};Sl.revokeObjectURL=function(){Yo&&(URL.revokeObjectURL(Yo),Yo=null)};var _P=0,hx,cx=class{constructor(){this._initialized=!1,this._createdWorkers=0,this._workerPool=[],this._queue=[],this._resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(t=>{let{worker:e}=new jo;e.addEventListener("message",i=>{e.terminate(),jo.revokeObjectURL(),t(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t,e){return this._run("loadImageBitmap",[t,e?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=!0)}_getWorker(){hx===void 0&&(hx=navigator.hardwareConcurrency||4);let t=this._workerPool.pop();return!t&&this._createdWorkers<hx&&(this._createdWorkers++,t=new Sl().worker,t.addEventListener("message",e=>{this._complete(e.data),this._returnWorker(e.target),this._next()})),t}_returnWorker(t){this._workerPool.push(t)}_complete(t){t.error!==void 0?this._resolveHash[t.uuid].reject(t.error):this._resolveHash[t.uuid].resolve(t.data),this._resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();let i=new Promise((s,o)=>{this._queue.push({id:t,arguments:e,resolve:s,reject:o})});return this._next(),i}_next(){if(!this._queue.length)return;let t=this._getWorker();if(!t)return;let e=this._queue.pop(),i=e.id;this._resolveHash[_P]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:_P++,id:i})}},ux=new cx;Pi();var Uk=[".jpeg",".jpg",".png",".webp",".avif"],Gk=["image/jpeg","image/png","image/webp","image/avif"];async function Ok(r,t){let e=await Y.get().fetch(r);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${e.status} ${e.statusText}`);let i=await e.blob();return t?.data?.alphaMode==="premultiplied-alpha"?createImageBitmap(i,{premultiplyAlpha:"none"}):createImageBitmap(i)}var Lu={name:"loadTextures",extension:{type:T.LoadParser,priority:ke.High,name:"loadTextures"},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(r){return dr(r,Gk)||fr(r,Uk)},async load(r,t,e){let i=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await ux.isImageBitmapSupported()?i=await ux.loadImageBitmap(r,t):i=await Ok(r,t):i=await new Promise((o,n)=>{i=new Image,i.crossOrigin=this.config.crossOrigin,i.src=r,i.complete?o(i):(i.onload=()=>{o(i)},i.onerror=n)});let s=new ze({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:t.data?.resolution||zo(r),...t.data});return $o(s,e,r)},unload(r){r.destroy(!0)}};F();Ap();Ep();var bP=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],Lk=bP.map(r=>`video/${r.substring(1)}`);function Dk(r,t,e){e===void 0&&!t.startsWith("data:")?r.crossOrigin=Hk(t):e!==!1&&(r.crossOrigin=typeof e=="string"?e:"anonymous")}function Nk(r){return new Promise((t,e)=>{r.addEventListener("canplaythrough",i),r.addEventListener("error",s),r.load();function i(){o(),t()}function s(n){o(),e(n)}function o(){r.removeEventListener("canplaythrough",i),r.removeEventListener("error",s)}})}function Hk(r,t=globalThis.location){if(r.startsWith("data:"))return"";t||(t=globalThis.location);let e=new URL(r,document.baseURI);return e.hostname!==t.hostname||e.port!==t.port||e.protocol!==t.protocol?"anonymous":""}var vP={name:"loadVideo",extension:{type:T.LoadParser,name:"loadVideo"},test(r){let t=dr(r,Lk),e=fr(r,bP);return t||e},async load(r,t,e){let i={...oo.defaultOptions,resolution:t.data?.resolution||zo(r),alphaMode:t.data?.alphaMode||await dc(),...t.data},s=document.createElement("video"),o={preload:i.autoLoad!==!1?"auto":void 0,"webkit-playsinline":i.playsinline!==!1?"":void 0,playsinline:i.playsinline!==!1?"":void 0,muted:i.muted===!0?"":void 0,loop:i.loop===!0?"":void 0,autoplay:i.autoPlay!==!1?"":void 0};Object.keys(o).forEach(l=>{let h=o[l];h!==void 0&&s.setAttribute(l,h)}),i.muted===!0&&(s.muted=!0),Dk(s,r,i.crossorigin);let n=document.createElement("source"),a;if(r.startsWith("data:"))a=r.slice(5,r.indexOf(";"));else if(!r.startsWith("blob:")){let l=r.split("?")[0].slice(r.lastIndexOf(".")+1).toLowerCase();a=oo.MIME_TYPES[l]||`video/${l}`}return n.src=r,a&&(n.type=a),new Promise(l=>{let h=async()=>{let c=new oo({...i,resource:s});s.removeEventListener("canplay",h),t.data.preload&&await Nk(s),l($o(c,e,r))};s.addEventListener("canplay",h),s.appendChild(n)})},unload(r){r.destroy(!0)}};F();ro();F();ro();var Du={extension:{type:T.ResolveParser,name:"resolveTexture"},test:Lu.test,parse:r=>({resolution:parseFloat(Qe.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})};var TP={extension:{type:T.ResolveParser,priority:-2,name:"resolveJson"},test:r=>Qe.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:Du.parse};ro();zn();ac();var Nu=class{constructor(){this._detections=[],this._initialized=!1,this.resolver=new Qe,this.loader=new Ou,this.cache=St,this._backgroundLoader=new Uu(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized){V("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let o=t.manifest;typeof o=="string"&&(o=await this.load(o)),this.resolver.addManifest(o)}let e=t.texturePreference?.resolution??1,i=typeof e=="number"?[e]:e,s=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:i}}),t.preferences&&this.setPreferences(t.preferences)}add(t){this.resolver.add(t)}async load(t,e){this._initialized||await this.init();let i=as(t),s=Ue(t).map(a=>{if(typeof a!="string"){let l=this.resolver.getAlias(a);return l.some(h=>!this.resolver.hasKey(h))&&this.add(a),Array.isArray(l)?l[0]:l}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),o=this.resolver.resolve(s),n=await this._mapLoadToResolve(o,e);return i?n[s[0]]:n}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let i=!1;typeof t=="string"&&(i=!0,t=[t]);let s=this.resolver.resolveBundle(t),o={},n=Object.keys(s),a=0,l=0,h=()=>{e?.(++a/l)},c=n.map(u=>{let d=s[u];return l+=Object.keys(d).length,this._mapLoadToResolve(d,h).then(f=>{o[u]=f})});return await Promise.all(c),i?o[t[0]]:o}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);let e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);let e=this.resolver.resolveBundle(t);Object.values(e).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return St.get(t);let e={};for(let i=0;i<t.length;i++)e[i]=St.get(t[i]);return e}async _mapLoadToResolve(t,e){let i=[...new Set(Object.values(t))];this._backgroundLoader.active=!1;let s=await this.loader.load(i,e);this._backgroundLoader.active=!0;let o={};return i.forEach(n=>{let a=s[n.src],l=[n.src];n.alias&&l.push(...n.alias),l.forEach(h=>{o[h]=a}),St.set(l,a)}),o}async unload(t){this._initialized||await this.init();let e=Ue(t).map(s=>typeof s!="string"?s.src:s),i=this.resolver.resolve(e);await this._unloadFromResolved(i)}async unloadBundle(t){this._initialized||await this.init(),t=Ue(t);let e=this.resolver.resolveBundle(t),i=Object.keys(e).map(s=>this._unloadFromResolved(e[s]));await Promise.all(i)}async _unloadFromResolved(t){let e=Object.values(t);e.forEach(i=>{St.remove(i.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(let i of t.detections)t.skipDetections||await i.test()?e=await i.add(e):t.skipDetections||(e=await i.remove(e));return e=e.filter((i,s)=>e.indexOf(i)===s),e}get detections(){return this._detections}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(i=>i in t).forEach(i=>{e.config[i]=t[i]})})}},pr=new Nu;H.handleByList(T.LoadParser,pr.loader.parsers).handleByList(T.ResolveParser,pr.resolver.parsers).handleByList(T.CacheParser,pr.cache.parsers).handleByList(T.DetectionParser,pr.detections);H.add(aP,cP,lP,pP,uP,dP,fP,mP,gP,xP,yP,Lu,vP,nP,oP,Du,TP);var SP={loader:T.LoadParser,resolver:T.ResolveParser,cache:T.CacheParser,detection:T.DetectionParser};H.handle(T.Asset,r=>{let t=r.ref;Object.entries(SP).filter(([e])=>!!t[e]).forEach(([e,i])=>H.add(Object.assign(t[e],{extension:t[e].extension??i})))},r=>{let t=r.ref;Object.keys(SP).filter(e=>!!t[e]).forEach(e=>H.remove(t[e]))});Tt();Dn();eo();jn();var wl=class r extends kt{constructor(...t){let e=t[0];Array.isArray(t[0])&&(e={textures:t[0],autoUpdate:t[1]});let{animationSpeed:i=1,autoPlay:s=!1,autoUpdate:o=!0,loop:n=!0,onComplete:a=null,onFrameChange:l=null,onLoop:h=null,textures:c,updateAnchor:u=!1,...d}=e,[f]=c;super({...d,texture:f instanceof I?f:f.texture}),this._textures=null,this._durations=null,this._autoUpdate=o,this._isConnectedToTicker=!1,this.animationSpeed=i,this.loop=n,this.updateAnchor=u,this.onComplete=a,this.onFrameChange=l,this.onLoop=h,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=c,s&&this.play()}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(ce.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(ce.shared.add(this.update,this,Ir.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(t){this.stop(),this.currentFrame=t}gotoAndPlay(t){this.currentFrame=t,this.play()}update(t){if(!this._playing)return;let e=t.deltaTime,i=this.animationSpeed*e,s=this.currentFrame;if(this._durations!==null){let o=this._currentTime%1*this._durations[this.currentFrame];for(o+=i/60*1e3;o<0;)this._currentTime--,o+=this._durations[this.currentFrame];let n=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);o>=this._durations[this.currentFrame];)o-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=o/this._durations[this.currentFrame]}else this._currentTime+=i;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<s||this.animationSpeed<0&&this.currentFrame>s)&&this.onLoop(),this._updateTexture())}_updateTexture(){let t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this.texture=this._textures[t],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(){this.stop(),super.destroy(),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){let e=[];for(let i=0;i<t.length;++i)e.push(I.from(t[i]));return new r(e)}static fromImages(t){let e=[];for(let i=0;i<t.length;++i)e.push(I.from(t[i]));return new r(e)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(t){if(t[0]instanceof I)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(let e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this._updateTexture()}get currentFrame(){let t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}set currentFrame(t){if(t<0||t>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);let e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this._updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(ce.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(ce.shared.add(this.update,this),this._isConnectedToTicker=!0))}};Vh();Wt();nc();var Hu=class extends Ai{constructor(t,e){let{text:i,resolution:s,style:o,anchor:n,width:a,height:l,roundPixels:h,...c}=t;super({...c}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=e,this.text=i??"",this.style=o,this.resolution=s??null,this.allowChildren=!1,this._anchor=new Te({_onUpdate:()=>{this.onViewUpdate()}}),n&&(this.anchor=n),this.roundPixels=h??!1,a!==void 0&&(this.width=a),l!==void 0&&(this.height=l)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}set text(t){t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())}get text(){return this._text}set resolution(t){this._autoResolution=t===null,this._resolution=t,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(t){t||(t={}),this._style?.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(t){this._setWidth(t,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(t){this._setHeight(t,this.bounds.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this.bounds.width),e!==void 0&&this._setHeight(e,this.bounds.height)}containsPoint(t){let e=this.bounds.width,i=this.bounds.height,s=-e*this.anchor.x,o=0;return t.x>=s&&t.x<=s+e&&(o=-i*this.anchor.y,t.y>=o&&t.y<=o+i)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}_getKey(){return`${this.text}:${this._style.styleKey}:${this._resolution}`}destroy(t=!1){super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,(typeof t=="boolean"?t:t?.style)&&this._style.destroy(t),this._style=null,this._text=null}};function wP(r,t){let e=r[0]??{};return(typeof e=="string"||r[1])&&(j(rt,`use new ${t}({ text: "hi!", style }) instead`),e={text:e,style:r[1]}),e}ga();gs();var Ni=class extends Hu{constructor(...t){let e=wP(t,"Text");super(e,Ht),this.renderPipeId="text"}updateBounds(){let t=this._bounds,e=this._anchor,i=Jt.measureText(this._text,this._style),{width:s,height:o}=i;t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*o,t.maxY=t.minY+o}};mt();he();Ag();Tt();du();Rp();br();$m();jn();ga();gs();bp();Ae();var Vk=Zi(Rc(),1);H.add(Fw,Uw);var Wk=new(window.AudioContext||window.webkitAudioContext),dx={},zk=async(r,t)=>{if(!dx[r]&&t.byteLength!==0)try{let e=await Wk.decodeAudioData(t);dx[r]=e}catch(e){console.error(`AudioAsset.load: Failed to decode ${r}:`,e)}},$k=r=>dx[r],qo={load:zk,getAsset:$k};var fe=({type:r,add:t,update:e,delete:i,parse:s})=>({type:r,add:t,update:e,delete:i,parse:s});var fx=({type:r})=>({type:r});var px=({type:r,add:t,update:e,delete:i})=>({type:r,add:t,update:e,delete:i});var Vu={alpha:"alpha",x:"x",y:"y",scaleX:"scaleX",scaleY:"scaleY",rotation:"rotation"};var Wu={scaleX:["scale","x"],scaleY:["scale","y"],x:["x"],y:["y"],alpha:["alpha"],rotation:["rotation"]};var bs={RECT:"rect",TEXT:"text",CONTAINER:"container",SPRITE:"sprite",TEXT_REVEALING:"text-revealing",SLIDER:"slider",PARTICLES:"particles",ANIMATED_SPRITE:"animated-sprite",VIDEO:"video"};var _e={fill:"black",fontFamily:"Arial",fontSize:16,align:"left",lineHeight:1.2,wordWrap:!1,breakWords:!1,strokeColor:"transparent",strokeWidth:0,wordWrapWidth:0};var vs=(r,t)=>{let e={fill:t?.fill??_e.fill,fontFamily:t?.fontFamily??_e.fontFamily,fontSize:t?.fontSize??_e.fontSize,align:t?.align??_e.align,lineHeight:t?.lineHeight??_e.lineHeight,wordWrap:t?.wordWrap??_e.wordWrap,breakWords:t?.breakWords??_e.breakWords,strokeColor:t?.strokeColor??_e.strokeColor,strokeWidth:t?.strokeWidth??_e.strokeWidth,wordWrapWidth:t?.wordWrapWidth??_e.wordWrapWidth};r.style=e};var Xk=(r,t)=>typeof t!="string"?t:r[t]??t,jk=(r,t,e,i)=>{let s=Xk(e,t);if(typeof s=="string")return r[s]=i,r;let o=r;for(let n=0;n<s.length-1;n++){let a=s[n];a in o||(o[a]={}),o=o[a]}return o[s[s.length-1]]=i,r},EP=(r,t,e=Wu)=>{for(let i of t)for(let[s,o]of Object.entries(i.tween)){if(!Vu[s])throw new Error(`${s} is not a supported property for animation.`);o.initialValue!==void 0&&jk(r,s,e,o.initialValue)}},zu=({animations:r,animationBus:t,completionTracker:e,element:i,targetState:s,onComplete:o})=>{for(let n of r){let a=e.getVersion();e.track(a),t.dispatch({type:"START",payload:{id:n.id,element:i,properties:n.tween,targetState:s,onComplete:()=>{e.complete(a),o?.(n)}}})}};function mx(r,t){let e=r.text.substring(0,t),s=Jt.measureText(e,r.style).width;return r.x+s}var Yk=async(r,t)=>new Promise((e,i)=>{if(t?.aborted)return i(new DOMException("The operation was aborted.","AbortError"));let s,o=()=>{s&&t?.removeEventListener("abort",s)},n=setTimeout(()=>{o(),e()},r);s=()=>{clearTimeout(n),o(),i(t.reason)},t?.addEventListener("abort",s,{once:!0})}),gx=Yk;var ui=Symbol("textRevealRuntime"),qk=18,Kk=64,Zk=1.25,PP=r=>typeof r=="number"&&r>0?r:1,Qk=r=>{let t=new kt(I.EMPTY);if(r?.indicator?.revealing?.src){let e=I.from(r.indicator.revealing.src);t=new kt(e),t.width=r.indicator.revealing.width??e.width,t.height=r.indicator.revealing.height??e.height}return t},El=(r,t)=>{if(!t?.indicator?.complete?.src)return;let e=I.from(t.indicator.complete.src);r.texture=e,r.width=t.indicator.complete.width??e.width,r.height=t.indicator.complete.height??e.height},Al=(r,t,e)=>{r.x=e,r.y=t?t.y+(t.lineMaxHeight-r.height):0},$u=(r,t,e)=>{if(!t||t.text.length===0){r.x=e;return}r.x=mx(t,t.text.length-1)+e},Jk=(r,t)=>{if(r[ui]){let e=r[ui];delete r[ui],e()}r[ui]=t},xx=r=>{if(r[ui]){let e=r[ui];delete r[ui],e()}r.onRender=void 0,r.removeChildren().forEach(e=>{e.destroy({children:!0})})},CP=(r,t="",e="")=>{let i=new Ht(r.textStyle),s=new Ni({text:t,style:i,x:Math.round(r.x),y:Math.round(r.y)}),o=null;if(r.furigana){let n=new Ht(r.furigana.textStyle);o=new Ni({text:e,style:n,x:Math.round(r.furigana.x),y:Math.round(r.furigana.y)})}return{text:s,furiganaText:o}},RP=(r,t)=>{let e=null,i=null,s=0,o=0,n=[];for(let a=0;a<t.content.length;a++){let l=t.content[a],h=new nt({label:`${t.id}-line-${a}`}),c=[],u=null,d=0;r.addChild(h),i=l,o=Math.max(o,l.lineMaxHeight??0);for(let f=0;f<l.lineParts.length;f++){let p=l.lineParts[f],{text:m,furiganaText:g}=CP(p,p.text,p.furigana?.text||"");g&&(h.addChild(g),c.push(g)),h.addChild(m),c.push(m),e=m,u=m,s+=p.text.length,d+=p.text.length}if(c.length>0){let f=h.getLocalBounds();n.push({chunk:l,container:h,lastTextObject:u,totalCharacters:d,bounds:{x:f.x,y:f.y,width:f.width,height:f.height}})}else h.destroy()}return{lines:n,lastTextObject:e,lastChunk:i,totalCharacters:s,maxLineHeight:o,bounds:r.getLocalBounds()}},AP=({contentContainer:r,indicatorSprite:t,element:e})=>{let i=e?.indicator?.offset??12,{lastTextObject:s,lastChunk:o}=RP(r,e);Al(t,o,i),$u(t,s,i),El(t,e)},tU=({indicatorSprite:r,element:t})=>{let e=t?.indicator?.offset??12,i=t.content[0]??null;Al(r,i,e)},eU=async({contentContainer:r,indicatorSprite:t,element:e,signal:i})=>{let s=PP(e.speed??50),o=e?.indicator?.offset??12,n=Math.max(1,Math.floor(1e3/s)),a=Math.max(1,Math.floor(4e3/s));for(let l=0;l<e.content.length;l++){if(i?.aborted||r.destroyed)return!1;let h=e.content[l];Al(t,h,o);for(let c=0;c<h.lineParts.length;c++){if(i?.aborted||r.destroyed)return!1;let u=h.lineParts[c],{text:d,furiganaText:f}=CP(u);f&&r.addChild(f),r.addChild(d);let p=u.text,m=u.furigana?.text||"",g=m.length;for(let _=0;_<p.length;_++){if(i?.aborted||r.destroyed)return!1;if(d.text=p.substring(0,_+1),t.x=mx(d,_)+o,f){let b=Math.round((_+1)/p.length*g);f.text=m.substring(0,b)}_<p.length-1&&await gx(n,i)}}l<e.content.length-1&&await gx(a,i)}return El(t,e),!0},rU=({container:r,contentContainer:t,indicatorSprite:e,element:i,animationBus:s,completionTracker:o})=>{let n=i?.indicator?.offset??12,a=PP(i.speed??50),{lines:l,lastTextObject:h,lastChunk:c,totalCharacters:u,maxLineHeight:d,bounds:f}=RP(t,i);if(Al(e,c,n),l.length===0||u===0||!l.some(A=>A.bounds.width>0&&A.bounds.height>0)||!globalThis.document||!s)return $u(e,h,n),El(e,i),!1;let p=Math.max(qk,Math.min(Kk,Math.round(d*Zk))),m=Math.max(1,Math.round(u/a*1e3)),g=l.map(A=>{let C=Math.max(1,A.totalCharacters),M=1+p/Math.max(1,A.bounds.width);return C*M}),_=g.reduce((A,C)=>A+C,0),b=[],y=0;for(let A=0;A<l.length;A++){let C=g[A],M=_>0?y/_:0;y+=C,b.push({...l[A],startProgress:M,endProgress:_>0?y/_:1})}let w=o.getVersion(),E=`${i.id}-soft-wipe`,v=b.map(A=>{let C=document.createElement("canvas");C.width=Math.max(1,Math.ceil(A.bounds.width+p)),C.height=Math.max(1,Math.ceil(A.bounds.height));let M=C.getContext("2d");if(!M)return null;let B=_s(C),k=new kt(B);return k.x=Math.floor(A.bounds.x-p),k.y=Math.floor(A.bounds.y),A.container.mask=k,t.addChild(k),{canvas:C,context:M,texture:B,sprite:k,line:A}});if(v.some(A=>A===null))return v.forEach(A=>{A&&(A.line.container.mask===A.sprite&&(A.line.container.mask=null),A.sprite.parent&&A.sprite.parent.removeChild(A.sprite),A.sprite.destroy(),A.texture.destroy(!0))}),$u(e,h,n),El(e,i),!1;let S=!1,P=A=>{S||(S=!0,r[ui]===R&&delete r[ui],v.forEach(C=>{C.line.container.mask===C.sprite&&(C.line.container.mask=null),C.sprite.parent&&C.sprite.parent.removeChild(C.sprite),C.sprite.destroy(),C.texture.destroy(!0)}),A&&($u(e,h,n),El(e,i)))},R=()=>{s.dispatch({type:"CANCEL",id:E}),P(!1)};return Jk(r,R),o.track(w),s.dispatch({type:"START",payload:{id:E,driver:"custom",duration:m,applyFrame:A=>{let C=m>0?Math.min(A/m,1):1,M=b[0],B=0;for(let k=0;k<b.length;k++){let U=b[k],O=v[k],$=Math.max(1e-6,U.endProgress-U.startProgress),N=Math.max(0,Math.min((C-U.startProgress)/$,1)),{context:L,canvas:z,texture:st}=O;if(L.clearRect(0,0,z.width,z.height),N<=0){st.source.update();continue}let Q=p,bt=0,Bt=U.bounds.width+p,Mt=Q+N*Bt,jt=Math.max(Q,Mt-p);jt>Q&&(L.fillStyle="#ffffff",L.fillRect(Q,bt,Math.min(jt-Q,U.bounds.width),U.bounds.height));let Zt=Math.max(Q,Mt-p),xt=Math.min(Q+U.bounds.width,Mt);if(xt>Zt){let ct=L.createLinearGradient(Zt,0,xt,0);ct.addColorStop(0,"rgba(255, 255, 255, 1)"),ct.addColorStop(1,"rgba(255, 255, 255, 0)"),L.fillStyle=ct,L.fillRect(Zt,bt,xt-Zt,U.bounds.height)}st.source.update(),(N<1||k===b.length-1)&&(M=U,B=Math.min(1,(Mt-Q)/Math.max(1,U.bounds.width)))}Al(e,M.chunk,n),e.x=M.bounds.x+Math.min(M.bounds.width,M.bounds.width*B)+n},applyTargetState:()=>{P(!1)},onComplete:()=>{o.complete(w),P(!0)},onCancel:()=>{o.complete(w),P(!1)},isValid:()=>!!r&&!r.destroyed&&!t.destroyed&&!e.destroyed}}),!0},Hi=async({container:r,element:t,completionTracker:e,animationBus:i,zIndex:s,signal:o,playback:n="autoplay"})=>{if(o?.aborted||r.destroyed)return;xx(r),r.zIndex=s;let a=new nt({label:`${t.id}-content`}),l=Qk(t);r.addChild(a),r.addChild(l);try{if(n==="paused-initial"){t.revealEffect==="none"?AP({contentContainer:a,indicatorSprite:l,element:t}):tU({indicatorSprite:l,element:t});return}if(t.revealEffect==="softWipe"){if(!rU({container:r,contentContainer:a,indicatorSprite:l,element:t,animationBus:i,completionTracker:e})&&!o?.aborted&&!r.destroyed){let d=e.getVersion();e.track(d),e.complete(d)}return}let h=e.getVersion(),c=!1;e.track(h),t.revealEffect==="none"?(AP({contentContainer:a,indicatorSprite:l,element:t}),c=!0):c=await eU({contentContainer:a,indicatorSprite:l,element:t,signal:o}),c&&!o?.aborted&&!r.destroyed&&e.complete(h)}catch(h){if(h?.name!=="AbortError"&&!o?.aborted)throw h}};var Xu=({suppressAnimations:r=!1,deferredMountOperations:t=[]}={})=>({suppressAnimations:r,deferredMountOperations:t}),MP=r=>{switch(r?.type){case"play-animated-sprite":r.animatedSprite?.destroyed||r.animatedSprite?.play();return;case"play-video":r.video?.play();return;case"start-particles":if(r.app?.debug){let t=e=>{if(r.emitter.destroyed){window.removeEventListener("snapShotKeyFrame",t);return}e?.detail?.deltaMS&&r.emitter.update(Number(e.detail.deltaMS)/1e3)};window.addEventListener("snapShotKeyFrame",t),r.container.customTickerHandler=t;return}r.app.ticker.add(r.tickerCallback);return;case"autoplay-text-reveal":Hi({container:r.container,element:r.element,completionTracker:r.completionTracker,animationBus:r.animationBus,zIndex:r.zIndex,signal:r.signal,playback:"autoplay"});return;case"start-update-animations":if(!r.element||r.element.destroyed)return;zu({animations:r.animations,animationBus:r.animationBus,completionTracker:r.completionTracker,element:r.element,targetState:r.targetState});return}},Pl=(r,t)=>{if(t?.type){if(!r?.suppressAnimations){MP(t);return}r.deferredMountOperations.push(t)}},ju=r=>{r?.deferredMountOperations&&(r.deferredMountOperations.length=0)},IP=(r,t)=>Pl(r,{type:"play-animated-sprite",animatedSprite:t}),BP=(r,t)=>Pl(r,{type:"play-video",video:t}),FP=(r,{app:t,emitter:e,container:i,tickerCallback:s})=>Pl(r,{type:"start-particles",app:t,emitter:e,container:i,tickerCallback:s}),Yu=(r,{container:t,element:e,completionTracker:i,animationBus:s,zIndex:o,signal:n})=>Pl(r,{type:"autoplay-text-reveal",container:t,element:e,completionTracker:i,animationBus:s,zIndex:o,signal:n}),kP=(r,{animations:t,animationBus:e,completionTracker:i,element:s,targetState:o})=>Pl(r,{type:"start-update-animations",animations:t,animationBus:e,completionTracker:i,element:s,targetState:o}),UP=r=>{if(!r?.deferredMountOperations?.length)return;let t=r.deferredMountOperations.splice(0);for(let e of t)MP(e)};var GP=(r=[])=>{if(r instanceof Map)return r;let t=new Map;for(let e of r)t.has(e.targetId)||t.set(e.targetId,[]),t.get(e.targetId).push(e);return t},qu=(r,t)=>r instanceof Map?r.get(t)??[]:r.filter(e=>e.targetId===t),iU=(r,t)=>qu(r,t).filter(e=>e.type==="update"),Ku=(r,t)=>qu(r,t).find(e=>e.type==="transition")??null,sU=({animations:r,targetId:t,animationBus:e,completionTracker:i,element:s,targetState:o,onComplete:n,renderContext:a})=>{let l=iU(r,t);if(l.length===0)return!1;if(a?.suppressAnimations){if(n)throw new Error("Deferred update animations do not support onComplete hooks.");return EP(s,l),kP(a,{animations:l,animationBus:e,completionTracker:i,element:s,targetState:o}),!0}return zu({animations:l,animationBus:e,completionTracker:i,element:s,targetState:o,onComplete:n}),!0};var at=sU;var DP=Symbol("routeGraphicsTextAnchorRatios"),NP=Symbol("routeGraphicsTextLayoutState"),OP=(r,t)=>typeof r!="number"||r===0?0:t/r,yx=r=>r?.align??_e.align,LP=r=>{let t=r[NP];return t?.fixedWidth&&typeof t.layoutWidth=="number"?t.layoutWidth:r.width},_x=(r,t,e)=>{let i=Math.max(0,r-t);return e==="center"?i/2:e==="right"?i:0},Cl=r=>{let t=r.measuredWidth??r.width,e=_x(r.width,t,yx(r.textStyle));return{x:r.x+e,y:r.y}},Zu=(r,t)=>{let e=t.__fixedWidth&&typeof t.width=="number"?t.width:r.width||t.width,i=r.height||t.height,s=typeof t.__anchorXRatio=="number"?t.__anchorXRatio:OP(e,t.originX),o=typeof t.__anchorYRatio=="number"?t.__anchorYRatio:OP(i,t.originY);r[DP]={x:s,y:o},r[NP]={fixedWidth:!!t.__fixedWidth,layoutWidth:t.width}},oU=r=>typeof r?.fontSize!="number"||r.fontSize===0||typeof r?.lineHeight!="number"?_e.lineHeight:r.lineHeight/r.fontSize,nU=(r,t)=>{if(!t)return r;let e={...r,...t};if(t.fontSize!==void 0||t.lineHeight!==void 0){let i=t.lineHeight??oU(r);e.lineHeight=Math.round(e.fontSize*i)}return e},zr=(r,t,e)=>{let i=r[DP],s=LP(r),o=nU(t,e);if(!i){vs(r,o);return}let n=_x(s,r.width,yx(r.style)),l=r.x-n+s*i.x,h=r.y+r.height*i.y;vs(r,o);let c=LP(r),u=_x(c,r.width,yx(r.style));r.x=l-c*i.x+u,r.y=h-r.height*i.y},Qu=(r,t)=>{let e=Cl({...t,measuredWidth:r.width,width:t.__fixedWidth&&typeof t.width=="number"?t.width:r.width});r.x=e.x,r.y=e.y};var aU=r=>{if(!(!r||typeof r!="object")){if(typeof r.button=="number")return r.button;if(typeof r.data?.button=="number")return r.data.button;if(typeof r.nativeEvent?.button=="number")return r.nativeEvent.button}},oe=r=>{let t=aU(r);return t===void 0||t===0};var HP=({app:r,parent:t,element:e,animations:i,eventHandler:s,animationBus:o,completionTracker:n,renderContext:a,zIndex:l})=>{let h=new Ni({label:e.id});h.zIndex=l,h.text=e.content,vs(h,e.textStyle),Zu(h,e),h.alpha=e.alpha,Qu(h,e);let c=e?.hover,u=e?.click,d=e?.rightClick,f={isHovering:!1,isPressed:!1,isRightPressed:!1},p=({isHovering:m,isPressed:g,isRightPressed:_})=>{_&&d?.textStyle?zr(h,e.textStyle,d.textStyle):g&&u?.textStyle?zr(h,e.textStyle,u.textStyle):m&&c?.textStyle?zr(h,e.textStyle,c.textStyle):zr(h,e.textStyle)};if(c){let{cursor:m,soundSrc:g,payload:_}=c;h.eventMode="static";let b=()=>{f.isHovering=!0,_&&s&&s("hover",{_event:{id:h.label},..._}),m&&(h.cursor=m),g&&r.audioStage.add({id:`hover-${Date.now()}`,url:g,loop:!1}),p(f)},y=()=>{f.isHovering=!1,h.cursor="auto",p(f)};h.on("pointerover",b),h.on("pointerout",y)}if(u){let{soundSrc:m,soundVolume:g,payload:_}=u;h.eventMode="static";let b=E=>{oe(E)&&(f.isPressed=!0,p(f))},y=E=>{oe(E)&&(f.isPressed=!1,p(f),_&&s&&s("click",{_event:{id:h.label},..._}),m&&r.audioStage.add({id:`click-${Date.now()}`,url:m,loop:!1,volume:(g??1e3)/1e3}))},w=()=>{f.isPressed=!1,p(f)};h.on("pointerdown",b),h.on("pointerup",y),h.on("pointerupoutside",w)}if(d){let{soundSrc:m,payload:g}=d;h.eventMode="static";let _=()=>{f.isRightPressed=!0,p(f)},b=()=>{f.isRightPressed=!1,p(f)},y=()=>{f.isRightPressed=!1,p(f),g&&s&&s("rightClick",{_event:{id:h.label},...g}),m&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:m,loop:!1})},w=()=>{f.isRightPressed=!1,p(f)};h.on("rightdown",_),h.on("rightup",b),h.on("rightclick",y),h.on("rightupoutside",w)}t.addChild(h),at({animations:i,targetId:e.id,animationBus:o,completionTracker:n,element:h,targetState:{...Cl(e),alpha:e.alpha},renderContext:a})};var lU=Object.prototype.hasOwnProperty,Et=(r,t)=>{if(Object.is(r,t))return!0;if(r===null||t===null||typeof r!="object"||typeof t!="object")return!1;let e=Array.isArray(r),i=Array.isArray(t);if(e!==i)return!1;if(e&&i){if(r.length!==t.length)return!1;for(let n=0;n<r.length;n++)if(!Et(r[n],t[n]))return!1;return!0}let s=Object.keys(r),o=Object.keys(t);if(s.length!==o.length)return!1;for(let n of s)if(!lU.call(t,n)||!Et(r[n],t[n]))return!1;return!0};var VP=({app:r,parent:t,prevElement:e,nextElement:i,eventHandler:s,animations:o,animationBus:n,completionTracker:a,zIndex:l})=>{let h=t.children.find(f=>f.label===e.id);if(!h)return;h.zIndex=l;let{alpha:c}=i,u=()=>{if(!Et(e,i)){h.text=i.content,vs(h,i.textStyle),Zu(h,i),Qu(h,i),h.alpha=c,h.removeAllListeners("pointerover"),h.removeAllListeners("pointerout"),h.removeAllListeners("pointerdown"),h.removeAllListeners("pointerupoutside"),h.removeAllListeners("pointerup"),h.removeAllListeners("rightdown"),h.removeAllListeners("rightclick"),h.removeAllListeners("rightup"),h.removeAllListeners("rightupoutside");let f=i?.hover,p=i?.click,m=i?.rightClick,g={isHovering:!1,isPressed:!1,isRightPressed:!1},_=({isHovering:b,isPressed:y,isRightPressed:w})=>{w&&m?.textStyle?zr(h,i.textStyle,m.textStyle):y&&p?.textStyle?zr(h,i.textStyle,p.textStyle):b&&f?.textStyle?zr(h,i.textStyle,f.textStyle):zr(h,i.textStyle)};if(f){let{cursor:b,soundSrc:y,payload:w}=f;h.eventMode="static";let E=()=>{g.isHovering=!0,w&&s&&s("hover",{_event:{id:h.label},...w}),b&&(h.cursor=b),y&&r.audioStage.add({id:`hover-${Date.now()}`,url:y,loop:!1}),_(g)},v=()=>{g.isHovering=!1,h.cursor="auto",_(g)};h.on("pointerover",E),h.on("pointerout",v)}if(p){let{soundSrc:b,soundVolume:y,payload:w}=p;h.eventMode="static";let E=P=>{oe(P)&&(g.isPressed=!0,_(g))},v=P=>{oe(P)&&(g.isPressed=!1,_(g),w&&s&&s("click",{_event:{id:h.label},...w}),b&&r.audioStage.add({id:`click-${Date.now()}`,url:b,loop:!1,volume:(y??1e3)/1e3}))},S=()=>{g.isPressed=!1,_(g)};h.on("pointerdown",E),h.on("pointerup",v),h.on("pointerupoutside",S)}if(m){let{soundSrc:b,payload:y}=m;h.eventMode="static";let w=()=>{g.isRightPressed=!0,_(g)},E=()=>{g.isRightPressed=!1,_(g)},v=()=>{g.isRightPressed=!1,_(g),y&&s&&s("rightClick",{_event:{id:h.label},...y}),b&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:b,loop:!1})},S=()=>{g.isRightPressed=!1,_(g)};h.on("rightdown",w),h.on("rightup",E),h.on("rightclick",v),h.on("rightupoutside",S)}}};at({animations:o,targetId:e.id,animationBus:n,completionTracker:a,element:h,targetState:{...Cl(i),alpha:c},onComplete:()=>{u()}})||u()};var WP=({parent:r,element:t,animations:e,animationBus:i,completionTracker:s})=>{let o=r.getChildByLabel(t.id);if(!o)return;at({animations:e,targetId:t.id,animationBus:i,completionTracker:s,element:o,targetState:null,onComplete:()=>{o&&!o.destroyed&&o.destroy()}})||o.destroy()};var zP=({positionX:r=0,positionY:t=0,width:e,height:i,anchorX:s=0,anchorY:o=0})=>{if(typeof e!="number"||typeof i!="number")throw new Error("Input Error: Width or height is missing");let n={x:e*s,y:i*o},a=r-n.x,l=t-n.y;return{x:a,y:l,originX:n.x,originY:n.y}};var Ce=r=>{if(typeof r.width!="number"||typeof r.height!="number")throw new Error("Input Error: Width or height is missing");if(!Object.values(bs).includes(r.type))throw new Error("Input Error: Type must be one of "+Object.values(bs).join(", "));if(!r.id)throw new Error("Input Error: Id is missing");let t=r.scaleX?r.scaleX*r.width:r.width,e=r.scaleY?r.scaleY*r.height:r.height;r.type===bs.CONTAINER&&(t=r.width,e=r.height);let{x:i,y:s,originX:o,originY:n}=zP({positionX:r.x,positionY:r.y,width:t,height:e,anchorX:r.anchorX,anchorY:r.anchorY}),a={id:r.id,type:r.type,width:Math.round(t),height:Math.round(e),x:Math.round(i),y:Math.round(s),originX:Math.round(o),originY:Math.round(n),alpha:r.alpha??1};return r.hover&&(a.hover=r.hover),r.click&&(a.click=r.click),a};var $P=({state:r})=>{let t={..._e,...r.textStyle};t.lineHeight=Math.round(t.fontSize*t.lineHeight),typeof r.width=="number"&&(t.wordWrapWidth=r.width,t.wordWrap=!0);let e=String(r.content??""),{width:i,height:s}=Jt.measureText(e,new Ht(t)),o=Math.round(i),n=Math.round(s),a=typeof r.width=="number"?Math.round(r.width):o,h={...Ce({...r,width:a,height:n}),content:e,measuredWidth:o,textStyle:{...t},...r.hover&&{hover:r.hover},...r.click&&{click:r.click},...r.rightClick&&{rightClick:r.rightClick}};return Object.defineProperties(h,{__anchorXRatio:{value:r.anchorX??0,enumerable:!1},__anchorYRatio:{value:r.anchorY??0,enumerable:!1},__fixedWidth:{value:typeof r.width=="number",enumerable:!1}}),h};var hU=fe({type:"text",add:HP,update:VP,delete:WP,parse:$P});var XP="__rtglRectScrollHandled",Ju=({canvas:r,rect:t,width:e,height:i,scrollUpEvent:s,scrollDownEvent:o,eventHandler:n})=>{if(!s&&!o)return;let a=!1;t.eventMode="static",t.hitArea=new tt(0,0,Math.round(e),Math.round(i));let l=(f,p)=>{p?.[XP]||(p&&(p[XP]=!0),f<0&&s?.payload&&n?n("scrollUp",{_event:{id:t.label},...s.payload}):f>0&&o?.payload&&n&&n("scrollDown",{_event:{id:t.label},...o.payload}))},h=()=>{a=!0},c=()=>{a=!1},u=f=>{f.preventDefault?.(),l(f.deltaY,f.nativeEvent)},d=f=>{a&&(f.preventDefault(),l(f.deltaY,f))};t.on("pointerover",h),t.on("pointerout",c),t.on("wheel",u),r?.addEventListener("wheel",d,{passive:!1}),t._cleanupScrollInteraction=()=>{a=!1,t.off("pointerover",h),t.off("pointerout",c),t.off("wheel",u),r?.removeEventListener("wheel",d),t.hitArea=null,delete t._cleanupScrollInteraction}};var cU=r=>r==null||r===""||r==="transparent"?{color:0,alpha:0}:r,jP=({app:r,parent:t,element:e,animations:i,animationBus:s,eventHandler:o,zIndex:n,completionTracker:a,renderContext:l})=>{let{id:h,x:c,y:u,width:d,height:f,fill:p,border:m,alpha:g,scaleX:_,scaleY:b}=e,y=new de;y.label=h,y.zIndex=n;let w={x:c,y:u,alpha:g};_!==void 0&&(w.scaleX=_),b!==void 0&&(w.scaleY=b),(()=>{y.clear(),y.rect(0,0,Math.round(d),Math.round(f)).fill(cU(p)),y.x=Math.round(c),y.y=Math.round(u),y.alpha=g,y.scale.x=_??1,y.scale.y=b??1,m&&y.stroke({color:m.color,alpha:m.alpha,width:Math.round(m.width)})})();let v=e?.hover,S=e?.click,P=e?.rightClick,R=e?.scrollUp,A=e?.scrollDown,C=e?.drag;if(v){let{cursor:M,soundSrc:B,payload:k}=v;y.eventMode="static";let U=()=>{k&&o&&o("hover",{_event:{id:y.label},...k}),M&&(y.cursor=M),B&&r.audioStage.add({id:`hover-${Date.now()}`,url:B,loop:!1})},O=()=>{y.cursor="auto"};y.on("pointerover",U),y.on("pointerout",O)}if(S){let{soundSrc:M,soundVolume:B,payload:k}=S;y.eventMode="static";let U=O=>{oe(O)&&(k&&o&&o("click",{_event:{id:y.label},...k}),M&&r.audioStage.add({id:`click-${Date.now()}`,url:M,loop:!1,volume:(B??1e3)/1e3}))};y.on("pointerup",U)}if(P){let{soundSrc:M,payload:B}=P;y.eventMode="static";let k=()=>{B&&o&&o("rightClick",{_event:{id:y.label},...B}),M&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:M,loop:!1})};y.on("rightclick",k)}if((R||A)&&Ju({canvas:r.canvas,rect:y,width:d,height:f,scrollUpEvent:R,scrollDownEvent:A,eventHandler:o}),C){let{start:M,end:B,move:k}=C;y.eventMode="static";let U=()=>{y._isDragging=!0,M&&o&&o("dragStart",{_event:{id:y.label},...typeof M?.payload=="object"?M.payload:{}})},O=()=>{y._isDragging=!1,B&&o&&o("dragEnd",{_event:{id:y.label},...typeof B?.payload=="object"?B.payload:{}})},$=N=>{k&&o&&y._isDragging&&o("dragMove",{_event:{id:y.label,x:N.global.x,y:N.global.y},...typeof k?.payload=="object"?k.payload:{}})};y.on("pointerdown",U),y.on("pointerup",O),y.on("globalpointermove",$),y.on("pointerupoutside",O)}t.addChild(y),at({animations:i,targetId:h,animationBus:s,completionTracker:a,element:y,targetState:w,renderContext:l})};var uU=r=>r==null||r===""||r==="transparent"?{color:0,alpha:0}:r,YP=({app:r,parent:t,prevElement:e,nextElement:i,animations:s,animationBus:o,eventHandler:n,zIndex:a,completionTracker:l})=>{let h=t.children.find(v=>v.label===e.id);if(!h)return;h.zIndex=a;let{x:c,y:u,width:d,height:f,fill:p,border:m,alpha:g,scaleX:_,scaleY:b}=i,y={x:c,y:u,alpha:g};_!==void 0&&(y.scaleX=_),b!==void 0&&(y.scaleY=b);let w=()=>{if(!Et(e,i)){h._cleanupScrollInteraction?.(),h.clear(),h.rect(0,0,Math.round(d),Math.round(f)).fill(uU(p)),h.x=Math.round(c),h.y=Math.round(u),h.alpha=g,h.scale.x=_??1,h.scale.y=b??1,m&&h.stroke({color:m.color,alpha:m.alpha,width:Math.round(m.width)}),h.removeAllListeners("pointerover"),h.removeAllListeners("pointerout"),h.removeAllListeners("pointerup"),h.removeAllListeners("rightclick"),h.removeAllListeners("wheel"),h.removeAllListeners("pointerdown"),h.removeAllListeners("globalpointermove"),h.removeAllListeners("pointerupoutside");let v=i?.hover,S=i?.click,P=i?.rightClick,R=i?.scrollUp,A=i?.scrollDown,C=i?.drag;if(v){let{cursor:M,soundSrc:B,payload:k}=v;h.eventMode="static";let U=()=>{k&&n&&n("hover",{_event:{id:h.label},...k}),M&&(h.cursor=M),B&&r.audioStage.add({id:`hover-${Date.now()}`,url:B,loop:!1})},O=()=>{h.cursor="auto"};h.on("pointerover",U),h.on("pointerout",O)}if(S){let{soundSrc:M,soundVolume:B,payload:k}=S;h.eventMode="static";let U=O=>{oe(O)&&(k&&n&&n("click",{_event:{id:h.label},...k}),M&&r.audioStage.add({id:`click-${Date.now()}`,url:M,loop:!1,volume:(B??1e3)/1e3}))};h.on("pointerup",U)}if(P){let{soundSrc:M,payload:B}=P;h.eventMode="static";let k=()=>{B&&n&&n("rightClick",{_event:{id:h.label},...B}),M&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:M,loop:!1})};h.on("rightclick",k)}if((R||A)&&Ju({canvas:r.canvas,rect:h,width:d,height:f,scrollUpEvent:R,scrollDownEvent:A,eventHandler:n}),C){let{start:M,end:B,move:k}=C;h.eventMode="static";let U=()=>{h._isDragging=!0,M&&n&&n("dragStart",{_event:{id:h.label},...typeof M?.payload=="object"?M.payload:{}})},O=()=>{h._isDragging=!1,B&&n&&n("dragEnd",{_event:{id:h.label},...typeof B?.payload=="object"?B.payload:{}})},$=N=>{k&&n&&h._isDragging&&n("dragMove",{_event:{id:h.label,x:N.global.x,y:N.global.y},...typeof k?.payload=="object"?k.payload:{}})};h.on("pointerdown",U),h.on("pointerup",O),h.on("globalpointermove",$),h.on("pointerupoutside",O)}}};at({animations:s,targetId:e.id,animationBus:o,completionTracker:l,element:h,targetState:y,onComplete:()=>{w()}})||w()};var qP=({parent:r,element:t,animations:e,animationBus:i,completionTracker:s})=>{let o=r.getChildByLabel(t.id);if(!o)return;at({animations:e,targetId:t.id,animationBus:i,completionTracker:s,element:o,targetState:null,onComplete:()=>{o&&!o.destroyed&&(o._cleanupScrollInteraction?.(),o.destroy())}})||(o._cleanupScrollInteraction?.(),o.destroy())};var KP=({state:r})=>{let t=Ce(r),e=r.border?.width,i=t;return typeof e=="number"&&e>0&&(i={...t,border:{alpha:r.border?.alpha??1,color:r.border?.color??"black",width:e}}),{...i,...r.fill!==void 0?{fill:r.fill}:{},rotation:r.rotation??0,...r.drag&&{drag:r.drag},...r.rightClick&&{rightClick:r.rightClick},...r.scrollUp&&{scrollUp:r.scrollUp},...r.scrollDown&&{scrollDown:r.scrollDown}}};var dU=fe({type:"rect",add:jP,update:YP,delete:qP,parse:KP});var ZP=({app:r,parent:t,element:e,animations:i,eventHandler:s,animationBus:o,completionTracker:n,renderContext:a,zIndex:l})=>{let{id:h,x:c,y:u,width:d,height:f,src:p,alpha:m}=e,g=p?I.from(p):I.EMPTY,_=new kt(g);_.label=h,_.zIndex=l,_.x=Math.round(c),_.y=Math.round(u),_.width=Math.round(d),_.height=Math.round(f),_.alpha=m;let b=e?.hover,y=e?.click,w=e?.rightClick,E={isHovering:!1,isPressed:!1,isRightPressed:!1},v=({isHovering:S,isPressed:P,isRightPressed:R})=>{if(R&&w?.src){let A=I.from(w.src);_.texture=A}else if(P&&y?.src){let A=I.from(y.src);_.texture=A}else if(S&&b?.src){let A=I.from(b.src);_.texture=A}else _.texture=g};if(b){let{cursor:S,soundSrc:P,payload:R}=b;_.eventMode="static";let A=()=>{E.isHovering=!0,R&&s&&s("hover",{_event:{id:_.label},...R}),S&&(_.cursor=S),P&&r.audioStage.add({id:`hover-${Date.now()}`,url:P,loop:!1}),v(E)},C=()=>{E.isHovering=!1,_.cursor="auto",v(E)};_.on("pointerover",A),_.on("pointerout",C)}if(y){let{soundSrc:S,soundVolume:P,payload:R}=y;_.eventMode="static";let A=B=>{oe(B)&&(E.isPressed=!0,v(E))},C=B=>{oe(B)&&(E.isPressed=!1,v(E),R&&s&&s("click",{_event:{id:_.label},...R}),S&&r.audioStage.add({id:`click-${Date.now()}`,url:S,loop:!1,volume:(P??1e3)/1e3}))},M=()=>{E.isPressed=!1,v(E)};_.on("pointerdown",A),_.on("pointerup",C),_.on("pointerupoutside",M)}if(w){let{soundSrc:S,payload:P}=w;_.eventMode="static";let R=()=>{E.isRightPressed=!0,v(E)},A=()=>{E.isRightPressed=!1,v(E)},C=()=>{E.isRightPressed=!1,v(E),P&&s&&s("rightClick",{_event:{id:_.label},...P}),S&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:S,loop:!1})},M=()=>{E.isRightPressed=!1,v(E)};_.on("rightdown",R),_.on("rightup",A),_.on("rightclick",C),_.on("rightupoutside",M)}t.addChild(_),at({animations:i,targetId:h,animationBus:o,completionTracker:n,element:_,targetState:{x:c,y:u,width:d,height:f,alpha:m},renderContext:a})};var QP=({app:r,parent:t,prevElement:e,nextElement:i,animations:s,animationBus:o,completionTracker:n,eventHandler:a,zIndex:l})=>{let h=t.children.find(y=>y.label===e.id);if(!h)return;h.zIndex=l;let{id:c,x:u,y:d,width:f,height:p,src:m,alpha:g}=i,_=()=>{if(!Et(e,i)){let y=m?I.from(m):I.EMPTY;h.texture=y,h.x=Math.round(u),h.y=Math.round(d),h.width=Math.round(f),h.height=Math.round(p),h.alpha=g,h.removeAllListeners("pointerover"),h.removeAllListeners("pointerout"),h.removeAllListeners("pointerdown"),h.removeAllListeners("pointerupoutside"),h.removeAllListeners("pointerup"),h.removeAllListeners("rightdown"),h.removeAllListeners("rightclick"),h.removeAllListeners("rightup"),h.removeAllListeners("rightupoutside");let w=i?.hover,E=i?.click,v=i?.rightClick,S={isHovering:!1,isPressed:!1,isRightPressed:!1},P=({isHovering:R,isPressed:A,isRightPressed:C})=>{if(C&&v?.src){let M=I.from(v.src);h.texture=M}else if(A&&E?.src){let M=I.from(E.src);h.texture=M}else if(R&&w?.src){let M=I.from(w.src);h.texture=M}else h.texture=y};if(w){let{cursor:R,soundSrc:A,payload:C}=w;h.eventMode="static";let M=()=>{S.isHovering=!0,C&&a&&a("hover",{_event:{id:h.label},...C}),R&&(h.cursor=R),A&&r.audioStage.add({id:`hover-${Date.now()}`,url:A,loop:!1}),P(S)},B=()=>{S.isHovering=!1,h.cursor="auto",P(S)};h.on("pointerover",M),h.on("pointerout",B)}if(E){let{soundSrc:R,soundVolume:A,payload:C}=E;h.eventMode="static";let M=U=>{oe(U)&&(S.isPressed=!0,P(S))},B=U=>{oe(U)&&(S.isPressed=!1,P(S),C&&a&&a("click",{_event:{id:h.label},...C}),R&&r.audioStage.add({id:`click-${Date.now()}`,url:R,loop:!1,volume:(A??1e3)/1e3}))},k=()=>{S.isPressed=!1,P(S)};h.on("pointerdown",M),h.on("pointerup",B),h.on("pointerupoutside",k)}if(v){let{soundSrc:R,payload:A}=v;h.eventMode="static";let C=()=>{S.isRightPressed=!0,P(S)},M=()=>{S.isRightPressed=!1,P(S)},B=()=>{S.isRightPressed=!1,P(S),A&&a&&a("rightClick",{_event:{id:h.label},...A}),R&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:R,loop:!1})},k=()=>{S.isRightPressed=!1,P(S)};h.on("rightdown",C),h.on("rightup",M),h.on("rightclick",B),h.on("rightupoutside",k)}}};at({animations:s,targetId:e.id,animationBus:o,completionTracker:n,element:h,targetState:{x:u,y:d,width:f,height:p,alpha:g},onComplete:()=>{_()}})||_()};var JP=({parent:r,element:t,animations:e,animationBus:i,completionTracker:s})=>{let o=r.children.find(a=>a.label===t.id);if(!o)return;at({animations:e,targetId:t.id,animationBus:i,completionTracker:s,element:o,targetState:null,onComplete:()=>{o&&!o.destroyed&&o.destroy()}})||o.destroy()};var tC=({state:r})=>({...Ce(r),src:r.src??"",alpha:r.alpha??1,...r.hover&&{hover:r.hover},...r.click&&{click:r.click},...r.rightClick&&{rightClick:r.rightClick}});var fU=fe({type:"sprite",add:ZP,update:QP,delete:JP,parse:tC});var pU=r=>!r||r.ended?!0:Number.isFinite(r.duration)&&r.duration>0&&r.currentTime>=r.duration,bx=({videoElement:r,video:t})=>{t&&r?._videoEndedListener&&t.removeEventListener("ended",r._videoEndedListener),r&&(r._videoEndedListener=void 0,r._playbackStateVersion=null)},td=({videoElement:r,video:t,loop:e,completionTracker:i})=>{if(bx({videoElement:r,video:t}),(e??!1)||pU(t))return;let s=i.getVersion();i.track(s);let o=()=>{i.complete(s)};t.addEventListener("ended",o),r._videoEndedListener=o,r._playbackStateVersion=s};var eC=({parent:r,element:t,renderContext:e,completionTracker:i,zIndex:s})=>{let{id:o,x:n,y:a,width:l,height:h,src:c,volume:u,loop:d,alpha:f}=t,p=I.from(c),m=p.source.resource;m.pause(),m.currentTime=0,m.loop=d??!1,m.volume=u/1e3,m.muted=!1;let g=new kt(p);g.label=o,g.zIndex=s,g._videoEndedListener=void 0,g._playbackStateVersion=null,g.x=Math.round(n),g.y=Math.round(a),g.width=Math.round(l),g.height=Math.round(h),g.alpha=f??1,td({videoElement:g,video:m,loop:d,completionTracker:i}),BP(e,m),r.addChild(g)};var rC=({parent:r,prevElement:t,nextElement:e,animations:i,animationBus:s,eventHandler:o,completionTracker:n,zIndex:a})=>{let l=r.children.find(g=>g.label===t.id);if(!l)return;l.zIndex=a;let{x:h,y:c,width:u,height:d,alpha:f}=e,p=()=>{if(!Et(t,e)){l.x=Math.round(h),l.y=Math.round(c),l.width=Math.round(u),l.height=Math.round(d),l.alpha=f??1;let g=l.texture.source.resource;if(t.src!==e.src){let _=g;bx({videoElement:l,video:_}),_&&_.pause();let b=I.from(e.src);l.texture=b,g=b.source.resource,g.muted=!1,g.pause(),g.currentTime=0}td({videoElement:l,video:g,loop:e.loop,completionTracker:n}),g.volume=e.volume/1e3,g.loop=e.loop??!1,t.src!==e.src&&g.play()}};at({animations:i,targetId:t.id,animationBus:s,completionTracker:n,element:l,targetState:{x:h,y:c,width:u,height:d,alpha:f??1},onComplete:p})||p()};var iC=({parent:r,element:t,animations:e,animationBus:i,completionTracker:s})=>{let o=r.children.find(l=>l.label===t.id);if(!o)return;let n=()=>{if(o&&!o.destroyed){o._playbackStateVersion!==null&&s.complete(o._playbackStateVersion);let l=o.texture.source.resource;l&&(o._videoEndedListener&&l.removeEventListener("ended",o._videoEndedListener),l.pause()),r.removeChild(o),o.destroy()}};at({animations:e,targetId:t.id,animationBus:i,completionTracker:s,element:o,targetState:null,onComplete:n})||n()};var sC=({state:r})=>({...Ce(r),src:r.src,volume:r.volume??1e3,loop:r.loop??!1});var mU=fe({type:"video",add:eC,update:rC,delete:iC,parse:sC});var oC=({app:r,parent:t,element:e,animations:i,animationBus:s,completionTracker:o,eventHandler:n,renderContext:a,zIndex:l})=>{let{id:h,x:c,y:u,width:d,height:f,alpha:p,thumbSrc:m,barSrc:g,direction:_,min:b,max:y,step:w,initialValue:E,originX:v,originY:S,hover:P,change:R}=e,A=new nt;A.label=h,A.zIndex=l,A.x=c,A.y=u,A.alpha=p,A.sortableChildren=!0,A.eventMode="static";let C=0,M=g?I.from(g):I.EMPTY,B=new kt(M);B.label=`${h}-bar`,B.eventMode="static";let k=m?I.from(m):I.EMPTY,U=new kt(k);U.label=`${h}-thumb`,U.eventMode="static";let O=E??b,$=y-b,N=xt=>{let ct=(xt-b)/$;_==="horizontal"?(U.x=ct*(B.width-U.width),U.y=(B.height-U.height)/2):(U.x=(B.width-U.width)/2,U.y=ct*(B.height-U.height))};(()=>{B.width=d,B.height=f;let xt=_==="horizontal"?f-C*2:d-C*2,ct=m?I.from(m):I.EMPTY,vt=ct.width,Ot=ct.height,ee=xt/vt,re=xt/Ot,He=Math.min(ee,re);U.width=vt*He,U.height=Ot*He,N(O)})();let z=k,st=M,Q=!1,bt=xt=>{let ct;if(_==="horizontal"){let Ot=xt.x-U.width/2;ct=Math.max(0,Math.min(1,Ot/(B.width-U.width)))}else{let Ot=xt.y-U.height/2;ct=Math.max(0,Math.min(1,Ot/(B.height-U.height)))}let vt=b+ct*$;return w>0&&(vt=Math.round((vt-b)/w)*w+b,vt=Math.max(b,Math.min(y,vt))),vt},Bt=xt=>{let ct=A.toLocal(xt.global),vt=bt(ct);vt!==O&&(O=vt,N(O),R?.payload&&n&&n("change",{_event:{id:h,value:O},...R.payload}))},Mt=xt=>{Q=!0,Bt(xt)},jt=xt=>{Q&&Bt(xt)},Zt=()=>{Q&&(Q=!1)};if(A.on("pointerdown",Mt),A.on("globalpointermove",jt),A.on("pointerup",Zt),A.on("pointerupoutside",Zt),P){let{cursor:xt,soundSrc:ct,thumbSrc:vt,barSrc:Ot}=P,ee=()=>{xt&&(B.cursor=xt,U.cursor=xt),ct&&r.audioStage.add({id:`hover-${Date.now()}`,url:ct,loop:!1}),vt&&(U.texture=I.from(vt)),Ot&&(B.texture=I.from(Ot))},re=()=>{Q||(B.cursor="auto",U.cursor="auto",U.texture=z,B.texture=st)};A.on("pointerover",ee),A.on("pointerout",re),A.on("pointerupoutside",re)}A.addChild(B),A.addChild(U),t.addChild(A),at({animations:i,targetId:h,animationBus:s,completionTracker:o,element:A,targetState:{x:c,y:u,alpha:p},renderContext:a})};var nC=({app:r,parent:t,prevElement:e,nextElement:i,animations:s,animationBus:o,completionTracker:n,eventHandler:a,zIndex:l})=>{let h=t.children.find(m=>m.label===e.id);if(!h)return;h.zIndex=l;let c=()=>{if(!Et(e,i)){h.x=i.x,h.y=i.y,h.alpha=i.alpha,h.label=i.id,h.pivot.set(i.originX,i.originY);let m=h.getChildByLabel(`${i.id}-bar`),g=h.getChildByLabel(`${i.id}-thumb`),_=!Et(e.hover,i.hover)||!Et(e.change,i.change)||e.min!==i.min||e.max!==i.max||e.step!==i.step||e.direction!==i.direction;if(m&&g){m.width=i.width,m.height=i.height;let b=0,y=i.direction==="horizontal"?i.height-b*2:i.width-b*2,w=i.thumbSrc?I.from(i.thumbSrc):I.EMPTY,E=w.width||16,v=w.height||16,S=y/E,P=y/v,R=Math.min(S,P);if(g.width=E*R,g.height=v*R,e.barSrc!==i.barSrc){let M=i.barSrc?I.from(i.barSrc):I.EMPTY;m.texture=M}if(e.thumbSrc!==i.thumbSrc){let M=i.thumbSrc?I.from(i.thumbSrc):I.EMPTY;g.texture=M}let A=i.max-i.min,C=(i.initialValue-i.min)/A;i.direction==="horizontal"?(g.x=C*(m.width-g.width),g.y=(m.height-g.height)/2):(g.x=(m.width-g.width)/2,g.y=C*(m.height-g.height))}if(_&&(h.removeAllListeners("pointerover"),h.removeAllListeners("pointerout"),h.removeAllListeners("pointerup"),h.removeAllListeners("pointerupoutside"),h.removeAllListeners("pointerdown"),h.removeAllListeners("globalpointermove")),_){let{hover:b,change:y,min:w,max:E,step:v,direction:S,initialValue:P}=i,R=P??w,A=E-w;h.eventMode="static";let C=z=>{let st=(z-w)/A;S==="horizontal"?(g.x=st*(m.width-g.width),g.y=(m.height-g.height)/2):(g.x=(m.width-g.width)/2,g.y=st*(m.height-g.height))},M=z=>{let st;if(S==="horizontal"){let bt=z.x-g.width/2;st=Math.max(0,Math.min(1,bt/(m.width-g.width)))}else{let bt=z.y-g.height/2;st=Math.max(0,Math.min(1,bt/(m.height-g.height)))}let Q=w+st*A;return v>0&&(Q=Math.round((Q-w)/v)*v+w,Q=Math.max(w,Math.min(E,Q))),Q},B=g.texture,k=m.texture,U=!1,O=z=>{let st=h.toLocal(z.global),Q=M(st);Q!==R&&(R=Q,C(R),y?.payload&&a&&a("change",{_event:{id:i.id,value:R},...y.payload}))},$=z=>{U=!0,O(z)},N=z=>{U&&O(z)},L=()=>{U&&(U=!1)};if(h.on("pointerdown",$),h.on("globalpointermove",N),h.on("pointerup",L),h.on("pointerupoutside",L),b){let{cursor:z,soundSrc:st,thumbSrc:Q,barSrc:bt}=b,Bt=()=>{z&&(h.cursor=z,g.cursor=z),st&&r.audioStage.add({id:`hover-${Date.now()}`,url:st,loop:!1}),Q&&(g.texture=I.from(Q)),bt&&(m.texture=I.from(bt))},Mt=()=>{U||(h.cursor="auto",g.cursor="auto",g.texture=B,m.texture=k)};h.on("pointerover",Bt),h.on("pointerout",Mt),h.on("pointerupoutside",Mt)}}}},{x:u,y:d,alpha:f}=i;at({animations:s,targetId:e.id,animationBus:o,completionTracker:n,element:h,targetState:{x:u,y:d,alpha:f},onComplete:c})||c()};var aC=({app:r,parent:t,element:e,animations:i,animationBus:s,completionTracker:o})=>{let n=t.getChildByLabel(e.id);if(!n)return;let a=()=>{n&&!n.destroyed&&n.destroy({children:!0})};at({animations:i,targetId:e.id,animationBus:s,completionTracker:o,element:n,targetState:null,onComplete:a})||a()};var lC=({state:r})=>{let t=Ce(r),e=r.min??0,i=r.max??100;if(i<=e)throw new Error("Input error: the max value of a slider must be larger than the min value");if(r.initialValue===void 0)throw new Error("Input error: slider initialValue is required");if(typeof r.initialValue!="number"||Number.isNaN(r.initialValue))throw new Error("Input error: slider initialValue must be a valid number");if(r.initialValue<e||r.initialValue>i)throw new Error("Input error: slider initialValue must be between min and max");return{...t,direction:r.direction??"horizontal",thumbSrc:r.thumbSrc??"",barSrc:r.barSrc??"",alpha:r.alpha??1,min:e,max:i,step:r.step??1,initialValue:r.initialValue,...r.hover&&{hover:r.hover},...r.change&&{change:r.change}}};var gU=fe({type:"slider",add:oC,update:nC,delete:aC,parse:lC});var Rl=({container:r,element:t,interactive:e=!0,allowViewportWithoutScroll:i=!1})=>{let s=0,o=0;t.children.forEach(h=>{s=Math.max(h.width+h.x,s),o=Math.max(h.height+h.y,o)});let n=!!(t.height&&o>t.height),a=!!(t.width&&s>t.width);if((t.scroll||i)&&(n||a)){let h=new nt({label:`${r.label}-content`});[...r.children].forEach(g=>{h.addChild(g)}),r.addChild(h);let u=new de({label:`${r.label}-clip`}).rect(0,0,t.width||s,t.height||o).fill({color:16711680,alpha:0});r.addChild(u),h.mask=u;let d=-(o-(t.height||o)),f=-(s-(t.width||s)),p=t.anchorToBottom&&n?d:0,m=t.anchorToBottom&&a?f:0;t.anchorToBottom&&(h.y=p,h.x=m),e&&(r.eventMode="static",r.hitArea=new tt(0,0,t.width||s,t.height||o),r.on("wheel",g=>{if(g.preventDefault(),n&&g.deltaY!==0){let _=p-g.deltaY;_>0?p=0:_<d?p=d:p=_,h.y=p}if(a&&(g.deltaX!==0||g.shiftKey&&g.deltaY!==0)){let _=g.deltaX!==0?g.deltaX:g.deltaY,b=m-_;b>0?m=0:b<f?m=f:m=b,h.x=m}}))}},vx=({container:r})=>{let t=r.children.find(i=>i.label&&i.label.endsWith("-content")),e=r.children.find(i=>i.label&&i.label.endsWith("-clip"));t&&([...t.children].forEach(s=>{s.mask=null,r.addChild(s)}),r.removeChild(t)),e&&r.removeChild(e),r.eventMode="auto",r.hitArea=null,r.removeAllListeners("wheel")};var Ml=r=>{let t=new Set;if(r.id&&t.add(r.id),r.children&&Array.isArray(r.children))for(let e of r.children)for(let i of Ml(e))t.add(i);return t};var hC=(r,t,e=[])=>{let i=new Set,s=new Map,o=new Map,n=[],a=[],l=[];for(let h of r)i.add(h.id),s.set(h.id,h);for(let h of t)i.add(h.id),o.set(h.id,h);for(let h of i){let c=s.get(h),u=o.get(h);if(!c&&u)n.push(u);else if(c&&!u)a.push(c);else{let d=Ml(u),f=e instanceof Map?Array.from(e.keys()).some(p=>d.has(p)):e.find(p=>d.has(p.targetId));(!Et(c,u)||f)&&l.push({prev:c,next:u})}}return{toAddElement:n,toDeleteElement:a,toUpdateElement:l}};var ed=r=>r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375,xU=r=>r,yU=r=>r*r,_U=r=>1-(1-r)*(1-r),bU=r=>r<.5?2*r*r:1-Math.pow(-2*r+2,2)/2,cC=Object.freeze({linear:xU,easeInQuad:yU,easeOutQuad:_U,easeInOutQuad:bU,easeInCubic:r=>r*r*r,easeOutCubic:r=>1-Math.pow(1-r,3),easeInOutCubic:r=>r<.5?4*r*r*r:1-Math.pow(-2*r+2,3)/2,easeInQuart:r=>r*r*r*r,easeOutQuart:r=>1-Math.pow(1-r,4),easeInOutQuart:r=>r<.5?8*r*r*r*r:1-Math.pow(-2*r+2,4)/2,easeInQuint:r=>r*r*r*r*r,easeOutQuint:r=>1-Math.pow(1-r,5),easeInOutQuint:r=>r<.5?16*r*r*r*r*r:1-Math.pow(-2*r+2,5)/2,easeInSine:r=>1-Math.cos(r*Math.PI/2),easeOutSine:r=>Math.sin(r*Math.PI/2),easeInOutSine:r=>-(Math.cos(Math.PI*r)-1)/2,easeInExpo:r=>r===0?0:Math.pow(2,10*r-10),easeOutExpo:r=>r===1?1:1-Math.pow(2,-10*r),easeInOutExpo:r=>r===0?0:r===1?1:r<.5?Math.pow(2,20*r-10)/2:(2-Math.pow(2,-20*r+10))/2,easeInCirc:r=>1-Math.sqrt(1-Math.pow(r,2)),easeOutCirc:r=>Math.sqrt(1-Math.pow(r-1,2)),easeInOutCirc:r=>r<.5?(1-Math.sqrt(1-Math.pow(2*r,2)))/2:(Math.sqrt(1-Math.pow(-2*r+2,2))+1)/2,easeInBack:r=>2.70158*r*r*r-1.70158*r*r,easeOutBack:r=>1+2.70158*Math.pow(r-1,3)+1.70158*Math.pow(r-1,2),easeInOutBack:r=>{let e=2.5949095;return r<.5?Math.pow(2*r,2)*((e+1)*2*r-e)/2:(Math.pow(2*r-2,2)*((e+1)*(r*2-2)+e)+2)/2},easeInBounce:r=>1-ed(1-r),easeOutBounce:ed,easeInOutBounce:r=>r<.5?(1-ed(1-2*r))/2:(1+ed(2*r-1))/2,easeInElastic:r=>{let t=2*Math.PI/3;return r===0?0:r===1?1:-Math.pow(2,10*r-10)*Math.sin((r*10-10.75)*t)},easeOutElastic:r=>{let t=2*Math.PI/3;return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r*10-.75)*t)+1},easeInOutElastic:r=>{let t=2*Math.PI/4.5;return r===0?0:r===1?1:r<.5?-(Math.pow(2,20*r-10)*Math.sin((20*r-11.125)*t))/2:Math.pow(2,-20*r+10)*Math.sin((20*r-11.125)*t)/2+1}}),Tx=Object.freeze(Object.keys(cC)),vU=(r="linear")=>{let t=cC[r];if(!t)throw new Error(`Unsupported easing: ${r}`);return t},Il=r=>{let t=[],e=0,i;return r.forEach(({value:s,duration:o,easing:n="linear",relative:a},l)=>{if(l===0){i=s,t.push({time:e,value:s,easing:"linear"});return}o!==void 0&&(e+=o,i=a?i+s:s,t.push({time:e,value:i,easing:n}))}),t},Bl=r=>{let t=0;for(let{timeline:e}of r){let i=e[e.length-1];i&&i.time>t&&(t=i.time)}return t},Fl=(r,t)=>{if(r.length===0)return 0;if(t<=r[0].time)return r[0].value;if(t>=r[r.length-1].time)return r[r.length-1].value;for(let e=0;e<r.length-1;e++){let{time:i,value:s,easing:o}=r[e],{time:n,value:a}=r[e+1];if(t>=i&&t<=n){let l=(t-i)/(n-i);return s+(a-s)*vU(o)(l)}}return r[r.length-1].value};var TU={translateX:0,translateY:0,alpha:1,scaleX:1,scaleY:1,rotation:0},wx=r=>Math.min(1,Math.max(0,r)),rd=(r,t,e)=>{if(r===t)return e<r?0:1;let i=wx((e-r)/(t-r));return i*i*(3-2*i)},fC=r=>r.getLocalBounds().rectangle.clone(),pC=r=>(r.width=Math.max(1,Math.ceil(r.width)),r.height=Math.max(1,Math.ceil(r.height)),r),uC=(r,t)=>{let e=pC(fC(t)),i=r.renderer.generateTexture({target:t,frame:e}),s=new kt(i);s.x=e.x,s.y=e.y;let o=new nt;return o.x=t.x??0,o.y=t.y??0,o.scale.set(t.scale?.x??1,t.scale?.y??1),o.rotation=t.rotation??0,o.alpha=t.alpha??1,o.addChild(s),{wrapper:o,texture:i}},SU=(r={})=>Object.entries(r).map(([t,e])=>({property:t,timeline:Il([{value:e.initialValue??TU[t]??0},...e.keyframes])})),id=(r,t,e)=>{if(!r||!t)return{duration:0,apply:()=>{}};let i=SU(t),s={x:r.x,y:r.y,alpha:r.alpha,scaleX:r.scale.x,scaleY:r.scale.y,rotation:r.rotation};return{duration:Bl(i),apply:o=>{r.x=s.x,r.y=s.y,r.alpha=s.alpha,r.scale.x=s.scaleX,r.scale.y=s.scaleY,r.rotation=s.rotation;for(let{property:n,timeline:a}of i){let l=Fl(a,o);switch(n){case"translateX":r.x=s.x+l*e.renderer.width;break;case"translateY":r.y=s.y+l*e.renderer.height;break;case"alpha":r.alpha=s.alpha*l;break;case"scaleX":r.scale.x=s.scaleX*l;break;case"scaleY":r.scale.y=s.scaleY*l;break;case"rotation":r.rotation=s.rotation+l;break}}}}},wU=r=>Il([{value:r?.progress?.initialValue??0},...r?.progress?.keyframes??[]]),EU=(r,t)=>{let e=document.createElement("canvas");e.width=r,e.height=t;let i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("Replace mask composition could not create a 2D canvas.");return{canvas:e,context:i}},AU=(r,t,e="red")=>{switch(e){case"green":return r[t+1];case"blue":return r[t+2];case"alpha":return r[t+3];default:return r[t]}},Sx=({app:r,texture:t,width:e,height:i,channel:s="red",invert:o=!1})=>{let n=new Uint8ClampedArray(e*i),a=new kt(I.from(t));a.width=e,a.height=i;let l=new nt;l.addChild(a);let h=hi.create({width:e,height:i});r.renderer.render({container:l,target:h,clear:!0});let c=r.renderer.extract.pixels(h).pixels;for(let u=0,d=0;u<n.length;u++,d+=4){let f=AU(c,d,s);o&&(f=255-f),n[u]=f}return l.destroy({children:!0}),h.destroy(!0),n},PU=(r,t,e,i)=>{let s=null;for(let o of t.items){let n=Sx({app:r,texture:o.texture,width:e,height:i,channel:o.channel??"red",invert:o.invert??!1});if(!s){s=n;continue}for(let a=0;a<s.length;a++)switch(t.combine??"max"){case"min":s[a]=Math.min(s[a],n[a]);break;case"multiply":s[a]=Math.round(s[a]/255*(n[a]/255)*255);break;case"add":s[a]=Math.min(255,s[a]+n[a]);break;default:s[a]=Math.max(s[a],n[a]);break}}return s??new Uint8ClampedArray(e*i)},CU=(r,t,e,i)=>{let s=wU(t),o=Bl([{timeline:s}]),n=Math.max(t?.softness??.001,1e-4);if(!t)return{duration:o,progressTimeline:s,sample:()=>0,destroy:()=>{}};if(t.kind==="single"){let l=Sx({app:r,texture:t.texture,width:e,height:i,channel:t.channel??"red",invert:t.invert??!1});return{duration:o,progressTimeline:s,sample:(h,c)=>rd(h-n,h+n,l[c]/255),destroy:()=>{}}}if(t.kind==="sequence"){let l=t.textures.map(h=>Sx({app:r,texture:h,width:e,height:i,channel:t.channel??"red",invert:t.invert??!1}));return{duration:o,progressTimeline:s,sample:(h,c)=>{let u=wx(h)*Math.max(0,l.length-1);if(t.sample==="linear"&&l.length>1){let f=Math.floor(u),p=Math.min(l.length-1,f+1),m=u-f,g=(l[f][c]*(1-m)+l[p][c]*m)/255;return rd(h-n,h+n,g)}let d=Math.min(l.length-1,Math.max(0,Math.round(u)));return rd(h-n,h+n,l[d][c]/255)},destroy:()=>{}}}let a=PU(r,t,e,i);return{duration:o,progressTimeline:s,sample:(l,h)=>rd(l-n,l+n,a[h]/255),destroy:()=>{}}},RU=r=>{let t=new nt;for(let e of r)e?.wrapper&&t.addChild(e.wrapper);return pC(fC(t))},dC=({app:r,container:t,target:e,frame:i})=>{r.renderer.render({container:t,target:e,clear:!0,transform:new G(1,0,0,1,-i.x,-i.y)})},kl=r=>{r?.texture?.destroy(!0)},MU=({app:r,animation:t,prevSubject:e,nextSubject:i,zIndex:s})=>{let o=new nt;o.zIndex=s,e?.wrapper&&o.addChild(e.wrapper),i?.wrapper&&o.addChild(i.wrapper);let n=id(e?.wrapper??null,t.prev?.tween,r),a=id(i?.wrapper??null,t.next?.tween,r);return{overlay:o,duration:Math.max(n.duration,a.duration),apply:l=>{n.apply(l),a.apply(l)},destroy:()=>{o.removeFromParent(),o.destroy({children:!0}),kl(e),kl(i)}}},IU=({app:r,animation:t,prevSubject:e,nextSubject:i,zIndex:s})=>{let o=RU([e,i]),n=new nt,a=new nt;e?.wrapper&&n.addChild(e.wrapper),i?.wrapper&&a.addChild(i.wrapper);let l=hi.create({width:o.width,height:o.height}),h=hi.create({width:o.width,height:o.height}),{canvas:c,context:u}=EU(o.width,o.height),d=u.createImageData(o.width,o.height),f=I.from(c),p=new nt;p.zIndex=s;let m=new kt(f);m.x=o.x,m.y=o.y,p.addChild(m);let g=CU(r,t.mask,o.width,o.height),_=id(e?.wrapper??null,t.prev?.tween,r),b=id(i?.wrapper??null,t.next?.tween,r),y=new Uint8ClampedArray(o.width*o.height*4);return{overlay:p,duration:Math.max(_.duration,b.duration,g.duration),apply:w=>{_.apply(w),b.apply(w);let E=y,v=y;e?.wrapper&&(dC({app:r,container:n,target:l,frame:o}),E=r.renderer.extract.pixels(l).pixels),i?.wrapper&&(dC({app:r,container:a,target:h,frame:o}),v=r.renderer.extract.pixels(h).pixels);let S=wx(Fl(g.progressTimeline,w)),P=d.data;for(let R=0,A=0;R<P.length;R+=4,A+=1){let C=g.sample(S,A),M=1-C;P[R]=Math.round(E[R]*M+v[R]*C),P[R+1]=Math.round(E[R+1]*M+v[R+1]*C),P[R+2]=Math.round(E[R+2]*M+v[R+2]*C),P[R+3]=Math.round(E[R+3]*M+v[R+3]*C)}u.putImageData(d,0,0),f.source.update()},destroy:()=>{p.removeFromParent(),p.destroy({children:!0}),n.destroy({children:!0}),a.destroy({children:!0}),l.destroy(!0),h.destroy(!0),f.destroy(!0),kl(e),kl(i),g.destroy()}}},BU=({app:r,animation:t,prevSubject:e,nextSubject:i,zIndex:s})=>t.mask?IU({app:r,animation:t,prevSubject:e,nextSubject:i,zIndex:s}):MU({app:r,animation:t,prevSubject:e,nextSubject:i,zIndex:s}),FU=({app:r,parent:t,nextElement:e,plugin:i,animations:s,eventHandler:o,animationBus:n,completionTracker:a,elementPlugins:l,renderContext:h,zIndex:c,signal:u})=>{if(!e)return null;let d=i.add({app:r,parent:t,element:e,animations:s,eventHandler:o,animationBus:n,completionTracker:a,elementPlugins:l,renderContext:h,zIndex:c,signal:u});return d&&typeof d.then=="function"?d.then(()=>u?.aborted||t.destroyed?null:t.children.find(f=>f.label===e.id)??null):u?.aborted||t.destroyed?null:t.children.find(f=>f.label===e.id)??null},kU=async r=>r&&typeof r.then=="function"?r:r??null,sd=({app:r,parent:t,prevElement:e,nextElement:i,animation:s,animations:o,animationBus:n,completionTracker:a,eventHandler:l,elementPlugins:h,renderContext:c,plugin:u,zIndex:d,signal:f})=>{if(!e&&!i)throw new Error(`Replace animation "${s.id}" must receive prevElement and/or nextElement.`);if(f?.aborted||t.destroyed)return;let p=e?t.children.find(M=>M.label===e.id)??null:null;if(e&&!p)throw new Error(`Transition animation "${s.id}" could not find the previous element "${e.id}".`);let m=p?uC(r,p):null,g=new nt,_=Xu({suppressAnimations:!0}),b=a.getVersion(),y=!1,w=()=>{y||(a.track(b),y=!0)},E=()=>{y&&(a.complete(b),y=!1)},v=({flushDeferredEffects:M})=>{if(!R){if(R=!0,S.value&&!S.value.destroyed&&(S.value.visible=!0),P.value?.destroy(),M){UP(_);return}ju(_)}},S={value:null},P={value:null},R=!1;w();let A=M=>{if(f?.aborted||t.destroyed){ju(_),g.destroy({children:!0}),kl(m),E();return}if(i&&!M)throw ju(_),E(),new Error(`Transition animation "${s.id}" could not create the next element "${i.id}".`);S.value=M;let B=M?uC(r,M):null;g.destroy({children:!1}),p&&u.delete({app:r,parent:t,element:e,animations:[],animationBus:n,completionTracker:a,eventHandler:l,elementPlugins:h,renderContext:c,signal:f}),M&&(M.zIndex=d,t.addChild(M),M.visible=!1);let k=BU({app:r,animation:s,prevSubject:m,nextSubject:B,zIndex:d});P.value=k,t.addChild(k.overlay),n.dispatch({type:"START",payload:{id:s.id,driver:"custom",duration:k.duration,applyFrame:k.apply,applyTargetState:()=>{v({flushDeferredEffects:!1})},onComplete:()=>{v({flushDeferredEffects:!0}),E()},onCancel:()=>{E()},isValid:()=>!!k.overlay&&!k.overlay.destroyed&&(!M||!M.destroyed)}})},C=i?FU({app:r,parent:g,nextElement:i,plugin:u,animations:o,eventHandler:l,animationBus:n,completionTracker:a,elementPlugins:h,renderContext:_,zIndex:d,signal:f}):null;if(C&&typeof C.then=="function"){kU(C).then(A);return}A(C??null)};var Ts=({app:r,parent:t,prevComputedTree:e,nextComputedTree:i,animations:s,animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h=Xu(),signal:c})=>{t.sortableChildren=!0;let u=new Map(l.map(y=>[y.type,y])),d=GP(s),f=new Map;for(let y=0;y<i.length;y++)f.set(i[y].id,y);let{toAddElement:p,toDeleteElement:m,toUpdateElement:g}=hC(e,i,s),_=y=>{let w=u.get(y);if(!w)throw new Error(`No plugin found for element type: ${y}`);return w},b=y=>t.children.find(w=>w.label===y)?.zIndex??-1;for(let y of t.children){let w=f.get(y.label);w!==void 0&&(y.zIndex=w)}for(let y of m){let w=h.suppressAnimations?null:Ku(d,y.id),E=_(y.type);if(w){sd({app:r,parent:t,prevElement:y,nextElement:null,animation:w,animations:d,animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h,plugin:E,zIndex:b(y.id),signal:c});continue}E.delete({app:r,parent:t,element:y,animations:[],animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h,signal:c})}for(let y of p){let w=h.suppressAnimations?null:Ku(d,y.id),E=_(y.type),v=f.get(y.id)??-1;if(w){sd({app:r,parent:t,prevElement:null,nextElement:y,animation:w,animations:d,animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h,plugin:E,zIndex:v,signal:c});continue}E.add({app:r,parent:t,element:y,animations:h.suppressAnimations||y.type==="container"?d:[],eventHandler:a,animationBus:o,completionTracker:n,elementPlugins:l,renderContext:h,zIndex:v,signal:c})}for(let{prev:y,next:w}of g){let E=_(w.type),v=f.get(w.id)??-1,S=h.suppressAnimations?null:Ku(d,w.id);if(S){sd({app:r,parent:t,prevElement:y,nextElement:w,animation:S,animations:d,animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h,plugin:E,zIndex:v,signal:c});continue}E.update({app:r,parent:t,prevElement:y,nextElement:w,animations:d,animationBus:o,completionTracker:n,eventHandler:a,elementPlugins:l,renderContext:h,zIndex:v,signal:c})}};var UU=(r=[])=>{let t=new Set;for(let e of r)if(e?.id){if(t.has(e.id))return!0;t.add(e.id)}return!1},GU=({app:r,container:t,children:e,eventHandler:i,animationBus:s,elementPlugins:o,renderContext:n,completionTracker:a,signal:l})=>{for(let h of e){let c=o.find(u=>u.type===h.type);if(!c)throw new Error(`No plugin found for child element type: ${h.type}`);c.add({app:r,parent:t,element:h,animations:[],eventHandler:i,animationBus:s,elementPlugins:o,renderContext:n,completionTracker:a,signal:l})}},mC=({app:r,parent:t,element:e,animations:i,eventHandler:s,animationBus:o,elementPlugins:n,renderContext:a,zIndex:l,completionTracker:h,signal:c})=>{let{id:u,x:d,y:f,children:p,scroll:m,alpha:g}=e,_=new nt;_.label=u,_.zIndex=l,_.x=Math.round(d),_.y=Math.round(f),_.alpha=g,t.addChild(_),p&&p.length>0&&(UU(p)?GU({app:r,container:_,children:p,eventHandler:s,animationBus:o,elementPlugins:n,renderContext:a,completionTracker:h,signal:c}):Ts({app:r,parent:_,prevComputedTree:[],nextComputedTree:p,animations:i,animationBus:o,completionTracker:h,eventHandler:s,elementPlugins:n,renderContext:a,signal:c})),(m||e.anchorToBottom)&&Rl({container:_,element:e,interactive:!!m,allowViewportWithoutScroll:!!e.anchorToBottom});let y=e?.hover,w=e?.click,E=e?.rightClick;if(y){let{cursor:v,soundSrc:S,payload:P}=y;_.eventMode="static";let R=()=>{P&&s&&s("hover",{_event:{id:_.label},...P}),v&&(_.cursor=v),S&&r.audioStage.add({id:`hover-${Date.now()}`,url:S,loop:!1})},A=()=>{_.cursor="auto"};_.on("pointerover",R),_.on("pointerout",A)}if(w){let{soundSrc:v,soundVolume:S,payload:P}=w;_.eventMode="static";let R=A=>{oe(A)&&(P&&s&&s("click",{_event:{id:_.label},...P}),v&&r.audioStage.add({id:`click-${Date.now()}`,url:v,loop:!1,volume:(S??1e3)/1e3}))};_.on("pointerup",R)}if(E){let{soundSrc:v,payload:S}=E;_.eventMode="static";let P=()=>{S&&s&&s("rightClick",{_event:{id:_.label},...S}),v&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:v,loop:!1})};_.on("rightclick",P)}};var gC=({app:r,parent:t,prevElement:e,nextElement:i,eventHandler:s,animations:o,animationBus:n,elementPlugins:a,renderContext:l,zIndex:h,completionTracker:c,signal:u})=>{let d=t.children.find(b=>b.label===e.id);if(!d)return;d.zIndex=h;let{x:f,y:p,alpha:m}=i,g=()=>{if(!Et(e,i)){d.x=Math.round(f),d.y=Math.round(p),d.label=i.id,d.alpha=m,d.scale.x=1,d.scale.y=1,d.removeAllListeners("pointerover"),d.removeAllListeners("pointerout"),d.removeAllListeners("pointerup"),d.removeAllListeners("rightclick"),d.eventMode="auto",d.cursor="auto";let E=i?.hover,v=i?.click,S=i?.rightClick,P=!!(E||v||S);if(E){let{cursor:C,soundSrc:M,payload:B}=E;d.eventMode="static";let k=()=>{B&&s&&s("hover",{_event:{id:d.label},...B}),C&&(d.cursor=C),M&&r.audioStage.add({id:`hover-${Date.now()}`,url:M,loop:!1})},U=()=>{d.cursor="auto"};d.on("pointerover",k),d.on("pointerout",U)}if(v){let{soundSrc:C,soundVolume:M,payload:B}=v;d.eventMode="static";let k=U=>{oe(U)&&(B&&s&&s("click",{_event:{id:d.label},...B}),C&&r.audioStage.add({id:`click-${Date.now()}`,url:C,loop:!1,volume:(M??1e3)/1e3}))};d.on("pointerup",k)}if(S){let{soundSrc:C,payload:M}=S;d.eventMode="static";let B=()=>{M&&s&&s("rightClick",{_event:{id:d.label},...M}),C&&r.audioStage.add({id:`rightClick-${Date.now()}`,url:C,loop:!1})};d.on("rightclick",B)}let R=e.scroll||e.anchorToBottom,A=i.scroll||i.anchorToBottom;R!==A?A?Rl({container:d,element:i,interactive:!!i.scroll,allowViewportWithoutScroll:!!i.anchorToBottom}):vx({container:d}):A&&(vx({container:d}),Rl({container:d,element:i,interactive:!!i.scroll,allowViewportWithoutScroll:!!i.anchorToBottom})),!i.scroll&&P&&(d.eventMode="static")}let b=!Et(e.children,i.children),y=Ml({children:i.children}),w=Array.from(y).some(E=>qu(o,E).length>0);if(b||w){let v=d.children.find(S=>S.label===`${i.id}-content`)||d;Ts({app:r,parent:v,nextComputedTree:i.children,prevComputedTree:e.children,eventHandler:s,elementPlugins:a,animations:o,animationBus:n,completionTracker:c,renderContext:l,signal:u})}};at({animations:o,targetId:e.id,animationBus:n,completionTracker:c,element:d,targetState:{x:f,y:p,alpha:m},onComplete:()=>{g()}})||g()};var xC=({app:r,parent:t,element:e,animationBus:i,animations:s,eventHandler:o,completionTracker:n})=>{let a=t.getChildByLabel(e.id);if(!a)return;let l=()=>{a&&!a.destroyed&&(t.removeChild(a),a.destroy({children:!0}))};at({animations:s,targetId:e.id,animationBus:i,completionTracker:n,element:a,targetState:null,onComplete:l})||l()};var yC=({state:r,parserPlugins:t=[]})=>{let e=r.direction??"",i=!!r.scroll,s=r.gap||0,o=structuredClone(r.children||[]),n=[],a=0,l=0,h=0,c=0,u=0,d=0,f=0,p=0,m=0,g=0;for(let y=0;y<o.length;y++){let w=y<o.length-1?s:0,E=o[y];y>0?e==="horizontal"?(E.x=h,E.y=f):e==="vertical"&&(E.x=p,E.y=c):(e==="horizontal"||e==="vertical")&&(E.x=0,E.y=0);let v=t.find(S=>S.type===E.type);if(v){let S=(E.scaleX??1)*(r.scaleX??1),P=(E.scaleY??1)*(r.scaleY??1);E=v.parse({state:{...E,scaleX:S,scaleY:P},parserPlugins:t})}e==="horizontal"?(r.width&&E.width+m>r.width&&!i&&!r.anchorToBottom?(h=0,m=0,f+=u+s,u=E.height,E.x=0,E.y=f):u=Math.max(u,E.height),h+=E.width+w,m=E.x+E.width,a=Math.max(h,a),l=Math.max(E.height+E.y,l)):e==="vertical"?(r.height&&E.height+g>r.height&&!i&&!r.anchorToBottom?(c=0,g=0,p+=d+s,d=E.width,E.x=p,E.y=0):d=Math.max(d,E.width),c+=E.height+w,g=E.y+E.height,a=Math.max(E.width+E.x,a),l=Math.max(c,l)):(a=Math.max(E.width+E.x,a),l=Math.max(E.height+E.y,l)),n.push(E)}let b={...Ce({...r,width:r.width?r.width:a,height:r.height?r.height:l}),children:n,direction:e,gap:s,scroll:i,...r.anchorToBottom&&{anchorToBottom:!0},rotation:r.rotation??0};return r.rightClick&&(b.rightClick=r.rightClick),b};var OU=fe({type:"container",add:mC,update:gC,delete:xC,parse:yC});var _C=async({parent:r,element:t,animationBus:e,renderContext:i,completionTracker:s,zIndex:o,signal:n})=>{if(n?.aborted)return;let a=new nt;if(a.label=t.id,a.zIndex=o,t.x!==void 0&&(a.x=Math.round(t.x)),t.y!==void 0&&(a.y=Math.round(t.y)),t.alpha!==void 0&&(a.alpha=t.alpha),r.addChild(a),i?.suppressAnimations&&t.revealEffect!=="none"){await Hi({container:a,element:t,completionTracker:s,animationBus:e,zIndex:o,signal:n,playback:"paused-initial"}),Yu(i,{container:a,element:t,completionTracker:s,animationBus:e,zIndex:o,signal:n});return}await Hi({container:a,element:t,completionTracker:s,animationBus:e,zIndex:o,signal:n,playback:"autoplay"})};var bC=(r={})=>JSON.stringify({content:r.content??null,revealEffect:r.revealEffect??"typewriter",speed:r.speed??50,width:r.width??null,indicator:r.indicator??null,x:r.x??null,y:r.y??null,alpha:r.alpha??1}),LU=(r,t)=>bC(r)!==bC(t),vC=async({parent:r,prevElement:t,nextElement:e,animations:i,animationBus:s,renderContext:o,completionTracker:n,zIndex:a,signal:l})=>{if(l?.aborted)return;let h=r.children.find(d=>d.label===t.id);if(!h)return;let c=async()=>{if(e.x!==void 0&&(h.x=e.x),e.y!==void 0&&(h.y=e.y),e.alpha!==void 0&&(h.alpha=e.alpha),!!LU(t,e)){if(o?.suppressAnimations===!0&&e.revealEffect!=="none"){await Hi({container:h,element:e,completionTracker:n,animationBus:s,zIndex:a,signal:l,playback:"paused-initial"}),Yu(o,{container:h,element:e,completionTracker:n,animationBus:s,zIndex:a,signal:l});return}await Hi({container:h,element:e,completionTracker:n,animationBus:s,zIndex:a,signal:l,playback:"autoplay"})}};at({animations:i,targetId:t.id,animationBus:s,completionTracker:n,element:h,targetState:{x:e.x??h.x,y:e.y??h.y,alpha:e.alpha??h.alpha},onComplete:()=>{c()}})||await c()};var TC=({parent:r,element:t,animations:e,animationBus:i,completionTracker:s})=>{let o=r.getChildByLabel(t.id);if(!o||o.destroyed)return;let n=()=>{o&&!o.destroyed&&(xx(o),o.destroy({children:!0}))};at({animations:e,targetId:t.id,animationBus:i,completionTracker:s,element:o,targetState:null,onComplete:n})||n()};var DU=(r,t)=>{let e=[],i=[],s=0,o=0,n=0,a=0,l=0,h=[...r],c=new WeakSet,u=Math.max(10,r.reduce((f,p)=>f+(p?.text?.length??0),0)*4);for(;h.length>0;){if(l+=1,l>u)throw new Error("[parseTextRevealing] Failed to make progress while wrapping text.");let f=h[0];if(!f.text||f.text.length===0){h.shift();continue}let p=f.text,m=Math.max(1,Math.round(t-s)),g={...f.textStyle,wordWrapWidth:m},_=Jt.measureText(f.text,new Ht(g));if(_.lineWidths[0]>m&&i.length>0){e.push({lineParts:[...i],y:o,lineMaxHeight:n}),s=0,o+=n,n=0,i=[];continue}let b=_.lines[0]??"",y=_.lines.slice(1).join(" ");if(_.lines.length===1&&f.text.endsWith(" ")&&!b.endsWith(" ")&&(b+=" "),b.length===0&&p.length>0){let S=p.match(/^\s+/)?.[0]??"";b=S.length>0?S:p[0],y=p.slice(b.length)}if(y===p){let S=p.match(/^\s+/)?.[0]??p[0]??"";if(S.length===0)throw new Error("[parseTextRevealing] Failed to consume text while wrapping.");b=S,y=p.slice(S.length)}let w=Jt.measureText(b,new Ht({...f.textStyle,wordWrap:!1,breakWords:!1})),E=Math.max(0,Math.round(w.width??_.lineWidths[0]??0)),v={text:b,textStyle:g,height:w.height,x:s,y:o};if(f.furigana&&!c.has(f)){c.add(f);let S=Jt.measureText(f.furigana.text,new Ht(f.furigana.textStyle)),P=-S.height+o+2,R={text:f.furigana.text,textStyle:f.furigana.textStyle,x:Math.round(s+(E-S.width)/2),y:P};v.furigana=R}i.push(v),n=Math.max(n,w.height),s+=E,a=Math.max(a,s),y&&y.length>0?f.text=y:h.shift()}i.length>0&&e.push({lineParts:i,y:o,lineMaxHeight:n});for(let f=0;f<e.length;f++){let p=e[f].lineMaxHeight;e[f].lineParts=e[f].lineParts.map(m=>{let g=m.height;m.height&&delete m.height;let _=m.y+(p-g),b=m.furigana;return b&&(b.y=b.y-m.y+_),{...m,...b&&{furigana:b},y:_}})}let d=e.length>0?e[e.length-1].y+e[e.length-1].lineMaxHeight:0;return{chunks:e,width:Math.max(a,t),height:d}},SC=({state:r})=>{let t={..._e,wordWrap:!0,...r.textStyle||{}},e=(r.content||[]).map(c=>{let u={...t,...c.textStyle||{}};u.lineHeight=Math.round(u.lineHeight*u.fontSize),r.width&&(u.wordWrapWidth=r.width,u.wordWrap=!0);let d=null;if(c.furigana){let p={...t,...c.furigana.textStyle||{}};p.lineHeight=Math.round(p.lineHeight*p.fontSize),r.width&&(p.wordWrapWidth=r.width,p.wordWrap=!0),d={text:String(c.furigana.text),textStyle:p}}return{text:String(c.text).replace(/ +$/,p=>"\xA0".repeat(p.length)),textStyle:u,...d&&{furigana:d}}}),i=r.width||500,{chunks:s,width:o,height:n}=DU(e,i),a=r.width||o,h=Ce({...r,width:a,height:n});if(h.alpha=r.alpha??1,r.indicator){let c=r.indicator;h.indicator={revealing:{src:c.revealing?.src??"",width:c.revealing?.width??12,height:c.revealing?.height??12},complete:{src:c.complete?.src??"",width:c.complete?.width??12,height:c.complete?.height??12},offset:c.offset??12}}return{...h,content:s,textStyle:{...t,...r.textStyle||{}},speed:r.speed??50,revealEffect:r.revealEffect??"typewriter",...r.width!==void 0&&{width:r.width},...r.complete&&{complete:r.complete}}};var NU=fe({type:"text-revealing",add:_C,update:vC,delete:TC,parse:SC});var od=(r,t,e)=>{if(!e)return;let i=s=>{s?.detail?.elementId===t&&typeof s?.detail?.frameIndex=="number"&&r.gotoAndStop(s?.detail?.frameIndex)};window.addEventListener("snapShotAnimatedSpriteFrame",i),r._snapShotKeyFrameHandler=i},nd=r=>{r._snapShotKeyFrameHandler&&(window.removeEventListener("snapShotAnimatedSpriteFrame",r._snapShotKeyFrameHandler),delete r._snapShotKeyFrameHandler)};var wC=async({app:r,parent:t,element:e,renderContext:i,zIndex:s,signal:o})=>{if(o?.aborted)return;let{id:n,x:a,y:l,width:h,height:c,spritesheetSrc:u,spritesheetData:d,animation:f,alpha:p}=e,m=d,g=Object.keys(m.frames),_=new Ci(I.from(u),m);if(await _.parse(),o?.aborted||t.destroyed)return;let b=f.frames.map(w=>_.textures[g[w]]),y=new wl(b);y.label=n,y.zIndex=s,y.animationSpeed=f.animationSpeed??.5,y.loop=f.loop??!0,r.debug?od(y,n,r.debug):IP(i,y),y.x=Math.round(a),y.y=Math.round(l),y.width=Math.round(h),y.height=Math.round(c),y.alpha=p,t.addChild(y)};var EC=async({app:r,parent:t,prevElement:e,nextElement:i,animations:s,animationBus:o,completionTracker:n,zIndex:a,signal:l})=>{if(l?.aborted)return;let h=t.children.find(_=>_.label===e.id);if(!h)return;h.zIndex=a;let c=async()=>{if(!(l?.aborted||h.destroyed)&&!Et(e,i)&&(h.x=Math.round(i.x),h.y=Math.round(i.y),h.width=Math.round(i.width),h.height=Math.round(i.height),h.alpha=i.alpha,!Et(e.animation,i.animation))){h.animationSpeed=i.animation.animationSpeed??.5,h.loop=i.animation.loop??!0;let _=i.spritesheetData,b=Object.keys(_.frames),y=new Ci(I.from(i.spritesheetSrc),_);if(await y.parse(),l?.aborted||h.destroyed)return;let w=i.animation.frames.map(E=>y.textures[b[E]]);h.textures=w,r.debug?e.id!==i.id&&(nd(h),od(h,i.id,r.debug)):h.play()}},{x:u,y:d,width:f,height:p,alpha:m}=i;at({animations:s,targetId:e.id,animationBus:o,completionTracker:n,element:h,targetState:{x:u,y:d,width:f,height:p,alpha:m},onComplete:()=>{c()}})||await c()};var AC=({app:r,parent:t,element:e,animations:i,animationBus:s,completionTracker:o})=>{let n=t.children.find(h=>h.label===e.id);if(!n)return;let a=()=>{r.debug&&nd(n),n&&!n.destroyed&&(n.stop(),n.destroy())};at({animations:i,targetId:e.id,animationBus:s,completionTracker:o,element:n,targetState:null,onComplete:a})||a()};var PC=({state:r})=>({...Ce(r),spritesheetSrc:r.spritesheetSrc??"",spritesheetData:{frames:{},meta:{},...r.spritesheetData??{}},animation:{frames:[],animationSpeed:.5,loop:!0,...r.animation??{}},alpha:r.alpha??1});var HU=fe({type:"animated-sprite",add:wC,update:EC,delete:AC,parse:PC});var VU=fx({type:"tween"});var Ss=new Map,WU=r=>({id:r.id,url:r.src,loop:r.loop??!1,volume:(r.volume??800)/1e3}),CC=r=>Ss.has(r),Ul=r=>{let t=Ss.get(r);t!==void 0&&(clearTimeout(t),Ss.delete(r))},Ex=({app:r,element:t})=>{let e=WU(t);if(Ul(e.id),t.delay&&t.delay>0){let i=setTimeout(()=>{Ss.delete(e.id),r.audioStage.add(e)},t.delay);Ss.set(e.id,i);return}r.audioStage.add(e)},Ax=()=>{for(let r of Ss.values())clearTimeout(r);Ss.clear()},RC=({app:r,element:t})=>{Ex({app:r,element:t})};var MC=({app:r,prevElement:t,nextElement:e})=>{let i=t.id;if((e.delay??0)>0){r.audioStage.remove(i),Ex({app:r,element:e});return}if(CC(i)){Ul(i),r.audioStage.add({id:i,url:e.src,loop:e.loop??!1,volume:(e.volume??800)/1e3});return}let o=r.audioStage.getById(i);if(!o){r.audioStage.add({id:i,url:e.src,loop:e.loop??!1,volume:(e.volume??800)/1e3});return}o.url=e.src,o.loop=e.loop??!1,o.volume=(e.volume??800)/1e3};var IC=({app:r,element:t})=>{Ul(t.id),r.audioStage.remove(t.id)};var zU=px({type:"sound",add:RC,update:MC,delete:IC});var Gl=class extends kt{emitter=null;maxLife=0;age=0;oneOverLife=0;get agePercent(){return this.age*this.oneOverLife}velocity={x:0,y:0};rotationSpeed=0;config={};next=null;prev=null;constructor(t){super(),this.emitter=t,this.anchor.set(.5,.5)}init(t){this.maxLife=t,this.age=0,this.oneOverLife=1/t,this.rotation=0,this.position.set(0,0),this.scale.set(1,1),this.tint=16777215,this.alpha=1,this.visible=!0,this.velocity.x=0,this.velocity.y=0,this.rotationSpeed=0,this.config={}}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=null,this.next=null,this.prev=null,super.destroy()}};function Px(r){let t=new de;return t.circle(0,0,3),t.fill({color:16777215}),r.renderer.generateTexture(t)}function Cx(r){let t=new de;return t.rect(0,0,1,8),t.fill({color:8965375}),r.renderer.generateTexture(t)}function Rx(r){let t=new de;return t.circle(0,0,4),t.fill({color:16777215}),r.renderer.generateTexture(t)}function Ol(r,t,e){return r+(t-r)*e}function ld(r){if(typeof r=="number")return r;let t=r.replace(/^(#|0x)/,"");return parseInt(t,16)}function BC(r,t,e){let i=r>>16&255,s=r>>8&255,o=r&255,n=t>>16&255,a=t>>8&255,l=t&255,h=Math.round(Ol(i,n,e)),c=Math.round(Ol(s,a,e)),u=Math.round(Ol(o,l,e));return h<<16|c<<8|u}var ad=class r{constructor(t,e,i=!1){this.value=i?ld(t):t,this.time=e,this.next=null}static createList(t,e=!1){let i=[...t].sort((n,a)=>n.time-a.time),s=new r(i[0].value,i[0].time,e),o=s;for(let n=1;n<i.length;n++)o.next=new r(i[n].value,i[n].time,e),o=o.next;return s}},Er=class{constructor(t=!1){this.first=null,this.isColor=t,this.ease=null}reset(t){Array.isArray(t)?this.first=ad.createList(t,this.isColor):this.first=t}getValue(t){if(this.ease&&(t=this.ease(t)),!this.first.next||t<=this.first.time)return this.first.value;let e=this.first;for(;e.next&&e.next.time<t;)e=e.next;if(!e.next||t>=e.next.time)return e.next?e.next.value:e.value;let i=(t-e.time)/(e.next.time-e.time);return this.isColor?BC(e.value,e.next.value,i):Ol(e.value,e.next.value,i)}};var hd=class{static type="alpha";constructor(t){this.list=new Er(!1),this.list.reset(t.list)}initParticles(t){let e=t,i=this.list.getValue(0);for(;e;)e.alpha=i,e=e.next}updateParticle(t,e){t.alpha=this.list.getValue(t.agePercent)}},cd=class{static type="alphaStatic";constructor(t){this.alpha=t.alpha}initParticles(t){let e=t;for(;e;)e.alpha=this.alpha,e=e.next}updateParticle(t,e){}};var ud=class{static type="scale";constructor(t){this.list=new Er(!1),this.list.reset(t.list),this.minMult=t.minMult??1}initParticles(t){let e=t;for(;e;){let i=this.minMult<1?e.emitter.random()*(1-this.minMult)+this.minMult:1;e.config.scaleMult=i;let s=this.list.getValue(0)*i;e.scale.set(s,s),e=e.next}}updateParticle(t,e){let i=this.list.getValue(t.agePercent)*t.config.scaleMult;t.scale.set(i,i)}},dd=class{static type="scaleStatic";constructor(t){this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){let i=e.emitter.random()*(this.max-this.min)+this.min;e.scale.set(i,i),e=e.next}}updateParticle(t,e){}};var $U=Math.PI/180,fd=class{static type="speed";constructor(t){this.list=new Er(!1),this.list.reset(t.list),this.minMult=t.minMult??1}initParticles(t){let e=t;for(;e;){let i=this.minMult<1?e.emitter.random()*(1-this.minMult)+this.minMult:1;e.config.speedMult=i;let s=this.list.getValue(0)*i;e.velocity.x=Math.cos(e.rotation)*s,e.velocity.y=Math.sin(e.rotation)*s,e=e.next}}updateParticle(t,e){let i=this.list.getValue(t.agePercent)*t.config.speedMult,s=Math.sqrt(t.velocity.x*t.velocity.x+t.velocity.y*t.velocity.y);s>0&&(t.velocity.x=t.velocity.x/s*i,t.velocity.y=t.velocity.y/s*i),t.x+=t.velocity.x*e,t.y+=t.velocity.y*e}},pd=class{static type="speedStatic";constructor(t){this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){let i=e.emitter.random()*(this.max-this.min)+this.min;e.velocity.x=Math.cos(e.rotation)*i,e.velocity.y=Math.sin(e.rotation)*i,e=e.next}}updateParticle(t,e){t.x+=t.velocity.x*e,t.y+=t.velocity.y*e}},md=class{static type="movePoint";constructor(t){this.minSpeed=t.speed.min,this.maxSpeed=t.speed.max,this.direction=t.direction*$U}initParticles(t){let e=t;for(;e;){let i=e.emitter.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed;e.velocity.x=Math.cos(this.direction)*i,e.velocity.y=Math.sin(this.direction)*i,e=e.next}}updateParticle(t,e){t.x+=t.velocity.x*e,t.y+=t.velocity.y*e}};var Odt=Math.PI/180,gd=class{static type="acceleration";constructor(t){this.accelX=t.accel.x,this.accelY=t.accel.y,this.minStart=t.minStart,this.maxStart=t.maxStart,this.rotate=t.rotate??!1,this.maxSpeed=t.maxSpeed??0}initParticles(t){let e=t;for(;e;){let i=e.emitter.random()*(this.maxStart-this.minStart)+this.minStart;e.velocity.x=Math.cos(e.rotation)*i,e.velocity.y=Math.sin(e.rotation)*i,e=e.next}}updateParticle(t,e){let i=t.velocity,s=i.x,o=i.y;if(i.x+=this.accelX*e,i.y+=this.accelY*e,this.maxSpeed>0){let n=Math.sqrt(i.x*i.x+i.y*i.y);if(n>this.maxSpeed){let a=this.maxSpeed/n;i.x*=a,i.y*=a}}t.x+=(s+i.x)/2*e,t.y+=(o+i.y)/2*e,this.rotate&&(t.rotation=Math.atan2(i.y,i.x))}},xd=class{static type="gravity";constructor(t){this.gravity=t.gravity}initParticles(t){}updateParticle(t,e){t.velocity.y+=this.gravity*e,t.x+=t.velocity.x*e,t.y+=t.velocity.y*e}};var Vi=Math.PI/180,yd=class{static type="rotation";constructor(t){this.minStart=t.minStart*Vi,this.maxStart=t.maxStart*Vi,this.minSpeed=t.minSpeed*Vi,this.maxSpeed=t.maxSpeed*Vi,this.accel=(t.accel??0)*Vi}initParticles(t){let e=t;for(;e;)e.rotation=e.emitter.random()*(this.maxStart-this.minStart)+this.minStart,e.rotationSpeed=e.emitter.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}updateParticle(t,e){if(this.accel!==0){let i=t.rotationSpeed;t.rotationSpeed+=this.accel*e,t.rotation+=(i+t.rotationSpeed)/2*e}else t.rotation+=t.rotationSpeed*e}},_d=class{static type="rotationStatic";constructor(t){this.min=t.min*Vi,this.max=t.max*Vi}initParticles(t){let e=t;for(;e;)e.rotation=e.emitter.random()*(this.max-this.min)+this.min,e=e.next}updateParticle(t,e){}},bd=class{static type="noRotation";constructor(t){this.rotation=(t.rotation??0)*Vi}initParticles(t){let e=t;for(;e;)e.rotation=this.rotation,e=e.next}updateParticle(t,e){t.rotation=this.rotation}};var vd=class{static type="color";constructor(t){this.list=new Er(!0),this.list.reset(t.list)}initParticles(t){let e=t,i=this.list.getValue(0);for(;e;)e.tint=i,e=e.next}updateParticle(t,e){t.tint=this.list.getValue(t.agePercent)}},Td=class{static type="colorStatic";constructor(t){this.color=ld(t.color)}initParticles(t){let e=t;for(;e;)e.tint=this.color,e=e.next}updateParticle(t,e){}};var Sd=class{constructor(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}getRandPos(t,e){t.x=this.x+e.random()*this.w,t.y=this.y+e.random()*this.h}},wd=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius,this.innerRadius=t.innerRadius??0,this.affectRotation=t.affectRotation??!1}getRandPos(t,e){let i=e.random()*Math.PI*2,s=this.radius-this.innerRadius,o=e.random()*s+this.innerRadius;t.x=this.x+Math.cos(i)*o,t.y=this.y+Math.sin(i)*o,this.affectRotation&&(t.rotation=i)}},Mx=class{constructor(t){this.x=t.x,this.y=t.y}getRandPos(t,e){t.x=this.x,t.y=this.y}},Ix=class{constructor(t){this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2}getRandPos(t,e){let i=e.random();t.x=this.x1+(this.x2-this.x1)*i,t.y=this.y1+(this.y2-this.y1)*i}},XU={rect:Sd,rectangle:Sd,torus:wd,circle:wd,point:Mx,line:Ix};var Ed=class{static type="spawnShape";constructor(t){let e=XU[t.type];if(!e)throw new Error(`Unknown spawn shape type: ${t.type}`);this.shape=new e(t.data)}initParticles(t){let e=t,i={x:0,y:0,rotation:void 0};for(;e;)this.shape.getRandPos(i,e.emitter),e.x=i.x,e.y=i.y,i.rotation!==void 0&&(e.rotation=i.rotation),e=e.next}updateParticle(t,e){}},Ad=class{static type="spawnBurst";constructor(t){this.x=t.x,this.y=t.y,this.spacing=(t.spacing??0)*Math.PI/180,this.startAngle=(t.startAngle??0)*Math.PI/180}initParticles(t){let e=t,i=this.startAngle;for(;e;)e.x=this.x,e.y=this.y,e.rotation=i,i+=this.spacing,e=e.next}updateParticle(t,e){}};var FC=new Map,kC=new Map;function Bx(r,t){FC.set(r,t)}function Re(r){kC.set(r.type,r)}function UC(r,t){let e=FC.get(r);return e?e(t):null}function GC(r){return kC.get(r)}Bx("circle",Rx);Bx("snowflake",Px);Bx("raindrop",Cx);Re(hd);Re(cd);Re(ud);Re(dd);Re(fd);Re(pd);Re(md);Re(gd);Re(xd);Re(yd);Re(_d);Re(bd);Re(vd);Re(Td);Re(Ed);Re(Ad);var Pd=class{constructor(t){this.seed=t,this.state=t}next(){let t=this.state+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}reset(){this.state=this.seed}};var Ll=class{container=null;texture=null;_activeFirst=null;_activeLast=null;_poolFirst=null;particleCount=0;maxParticles=1e3;lifetime={min:1,max:2};frequency=.1;particlesPerWave=1;_spawnTimer=0;emitterLifetime=-1;_emitterAge=0;emit=!0;destroyed=!1;initBehaviors=[];updateBehaviors=[];recycleBehaviors=[];spawnBounds=null;recycleOnBounds=!1;rng=null;constructor(t,e){this.container=t,this.init(e)}init(t){if(t.seed!==void 0&&t.seed!==null&&(this.rng=new Pd(t.seed)),t.texture&&(this.texture=t.texture),t.lifetime&&(this.lifetime.min=t.lifetime.min??1,this.lifetime.max=t.lifetime.max??t.lifetime.min??2),this.frequency=t.frequency??.1,this.particlesPerWave=t.particlesPerWave??1,this.maxParticles=t.maxParticles??1e3,this.emitterLifetime=t.emitterLifetime??-1,t.spawnBounds&&(this.spawnBounds=t.spawnBounds,this.recycleOnBounds=t.recycleOnBounds??!1),this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],t.behaviors)for(let e of t.behaviors){let i=GC(e.type);if(!i){console.warn(`Unknown behavior type: ${e.type}`);continue}let s=new i(e.config);s.initParticles&&this.initBehaviors.push(s),s.updateParticle&&this.updateBehaviors.push(s),s.recycleParticle&&this.recycleBehaviors.push(s)}this._spawnTimer=0,this._emitterAge=0,this.emit=t.emit??!0}_createParticle(){let t;return this._poolFirst?(t=this._poolFirst,this._poolFirst=t.next,t.next=null):t=new Gl(this),t.texture=this.texture,t}spawn(t){if(this.destroyed||t<=0)return null;let e=this.maxParticles-this.particleCount;if(t=Math.min(t,e),t<=0)return null;let i=null,s=null;for(let o=0;o<t;o++){let n=this._createParticle(),a=this.lifetime.min+this.random()*(this.lifetime.max-this.lifetime.min);n.init(a),i||(i=n),s&&(s.next=n,n.prev=s),s=n,this.container.addChild(n)}for(let o of this.initBehaviors)o.initParticles(i);return this._activeLast?(this._activeLast.next=i,i.prev=this._activeLast):this._activeFirst=i,this._activeLast=s,this.particleCount+=t,i}emitNow(){this.spawn(this.particlesPerWave)}recycle(t){for(let e of this.recycleBehaviors)e.recycleParticle(t);t.prev?t.prev.next=t.next:this._activeFirst=t.next,t.next?t.next.prev=t.prev:this._activeLast=t.prev,t.prev=null,t.next=null,t.parent&&t.parent.removeChild(t),t.next=this._poolFirst,this._poolFirst=t,this.particleCount--}update(t){if(this.destroyed)return;if(this.emitterLifetime>0&&(this._emitterAge+=t,this._emitterAge>=this.emitterLifetime&&(this.emit=!1)),this.emit)if(this.frequency<=0)this.spawn(this.particlesPerWave),this.emit=!1;else for(this._spawnTimer+=t;this._spawnTimer>=this.frequency;)this._spawnTimer-=this.frequency,this.spawn(this.particlesPerWave);let e=this._activeFirst;for(;e;){let i=e.next;if(e.age+=t,e.age>=e.maxLife){this.recycle(e),e=i;continue}if(this.recycleOnBounds&&this.spawnBounds){let s=this.spawnBounds;if(e.x<s.x||e.x>s.x+s.width||e.y<s.y||e.y>s.y+s.height){this.recycle(e),e=i;continue}}for(let s of this.updateBehaviors)s.updateParticle(e,t);e=i}}stop(t=!1){if(this.emit=!1,t)for(;this._activeFirst;)this.recycle(this._activeFirst)}restart(){this._emitterAge=0,this._spawnTimer=0,this.emit=!0}random(){return this.rng?this.rng.next():Math.random()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.emit=!1;let t=this._activeFirst;for(;t;){let e=t.next;t.destroy(),t=e}for(t=this._poolFirst;t;){let e=t.next;t.destroy(),t=e}this._activeFirst=null,this._activeLast=null,this._poolFirst=null,this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[]}};function jU(r,t){let e=new de,i=t.color??"#ffffff";switch(t.shape){case"circle":{let s=t.radius??3;e.circle(0,0,s),e.fill({color:i});break}case"ellipse":{let s=t.width??2,o=t.height??6;e.ellipse(0,0,s/2,o/2),e.fill({color:i});break}case"rect":{let s=t.width??4,o=t.height??4;e.rect(-s/2,-o/2,s,o),e.fill({color:i});break}default:e.circle(0,0,3),e.fill({color:i})}return r.renderer.generateTexture(e)}var Dl=({app:r,parent:t,element:e,renderContext:i,zIndex:s})=>{let o=new nt;o.label=e.id,o.zIndex=s,t.addChild(o);let n=e.width,a=e.height;o.x=e.x??0,o.y=e.y??0;let l={lifetime:e.emitter?.lifetime??{min:1,max:2},frequency:e.emitter?.frequency??.1,particlesPerWave:e.emitter?.particlesPerWave??1,maxParticles:e.emitter?.maxParticles??e.count??100,emitterLifetime:e.emitter?.emitterLifetime??-1,spawnBounds:e.emitter?.spawnBounds,recycleOnBounds:e.emitter?.recycleOnBounds??!1,seed:e.emitter?.seed,behaviors:e.behaviors},h;if(typeof e.texture=="object"&&e.texture.shape)h=jU(r,e.texture);else{let d=e.texture??"circle";if(h=UC(d,r),!h)try{h=I.from(d)}catch{console.warn(`Failed to load particle texture: ${d}`);return}}l.texture=h;let c=new Ll(o,l);if(o.emitter=c,l.recycleOnBounds){let d=Math.min(e.count??100,l.maxParticles);c.spawn(d);let f=c._activeFirst;for(;f;)f.y=c.random()*a,f.age=c.random()*f.maxLife*.8,f=f.next}let u=d=>{if(c.destroyed){r.ticker.remove(u);return}c.update(d.deltaTime/60)};o.tickerCallback=u,FP(i,{app:r,emitter:c,container:o,tickerCallback:u}),e.alpha!==void 0&&(o.alpha=e.alpha)};var Cd=({app:r,parent:t,element:e,animationBus:i,animations:s,completionTracker:o})=>{let n=t.getChildByLabel(e.id);if(!n)return;let a=()=>{n&&!n.destroyed&&(n.emitter&&n.emitter.destroy(),n.tickerCallback&&r.ticker.remove(n.tickerCallback),n.customTickerHandler&&window.removeEventListener("snapShotKeyFrame",n.customTickerHandler),n.destroy({children:!0}))};at({animations:s,targetId:e.id,animationBus:i,completionTracker:o,element:n,targetState:null,onComplete:a})||a()};var OC=({app:r,parent:t,prevElement:e,nextElement:i,animations:s,animationBus:o,completionTracker:n,zIndex:a})=>{let l=t.children.find(c=>c.label===e.id);if(!l){Dl({app:r,parent:t,element:i,animations:s,animationBus:o,completionTracker:n,zIndex:a});return}if(l.zIndex=a,YU(e,i))Cd({app:r,parent:t,element:e,animations:s,animationBus:o,completionTracker:n}),Dl({app:r,parent:t,element:i,animations:s,animationBus:o,completionTracker:n,zIndex:a});else{let c=()=>{i.alpha!==void 0&&(l.alpha=i.alpha),i.x!==void 0&&(l.x=i.x),i.y!==void 0&&(l.y=i.y)};at({animations:s,targetId:e.id,animationBus:o,completionTracker:n,element:l,targetState:{x:i.x??l.x,y:i.y??l.y,alpha:i.alpha??l.alpha},onComplete:c})||c()}};function YU(r,t){return r.count!==t.count||!Et(r.texture,t.texture)||!Et(r.behaviors,t.behaviors)||!Et(r.emitter,t.emitter)||r.width!==t.width||r.height!==t.height}function LC(r){if(!r.id)throw new Error("Input Error: Id is missing");if(!Object.values(bs).includes(r.type))throw new Error("Input Error: Type must be one of "+Object.values(bs).join(", "));if(typeof r.width!="number"||typeof r.height!="number")throw new Error("Input Error: Width and height must be numbers");if(r.width<=0||r.height<=0)throw new Error("Input Error: Width and height must be positive")}function DC(r){if(!r.texture)throw new Error("Input Error: Particles require 'texture'");let t=typeof r.texture=="string",e=typeof r.texture=="object"&&r.texture!==null&&!Array.isArray(r.texture);if(!t&&!e)throw new Error("Input Error: texture must be a string or shape object");if(e){if(!r.texture.shape)throw new Error("Input Error: texture object must have 'shape' property");if(!["circle","ellipse","rect"].includes(r.texture.shape))throw new Error(`Input Error: texture.shape must be 'circle', 'ellipse', or 'rect', got '${r.texture.shape}'`)}}function NC(r){if(!r.behaviors)throw new Error("Input Error: Particles require 'behaviors'");if(!Array.isArray(r.behaviors))throw new Error("Input Error: 'behaviors' must be an array");if(r.behaviors.length===0)throw new Error("Input Error: 'behaviors' array cannot be empty");for(let t=0;t<r.behaviors.length;t++){let e=r.behaviors[t];if(typeof e!="object"||e===null||Array.isArray(e))throw new Error(`Input Error: behaviors[${t}] must be an object`);if(!e.type||typeof e.type!="string")throw new Error(`Input Error: behaviors[${t}] must have a 'type' string property`)}}function HC(r){if(!r.emitter)throw new Error("Input Error: Particles require 'emitter'");if(typeof r.emitter!="object"||Array.isArray(r.emitter))throw new Error("Input Error: 'emitter' must be an object");if(!r.emitter.lifetime)throw new Error("Input Error: emitter.lifetime is required");if(typeof r.emitter.lifetime!="object"||Array.isArray(r.emitter.lifetime))throw new Error("Input Error: emitter.lifetime must be an object");if(typeof r.emitter.lifetime.min!="number"||typeof r.emitter.lifetime.max!="number")throw new Error("Input Error: emitter.lifetime.min and max must be numbers");if(r.emitter.lifetime.min<0||r.emitter.lifetime.max<0)throw new Error("Input Error: emitter.lifetime.min and max must be non-negative");if(r.emitter.lifetime.min>r.emitter.lifetime.max)throw new Error("Input Error: emitter.lifetime.min cannot be greater than max")}function VC(r){if(r.emitter.frequency!==void 0){if(typeof r.emitter.frequency!="number")throw new Error("Input Error: emitter.frequency must be a number");if(r.emitter.frequency<0)throw new Error("Input Error: emitter.frequency must be non-negative")}if(r.emitter.particlesPerWave!==void 0){if(typeof r.emitter.particlesPerWave!="number")throw new Error("Input Error: emitter.particlesPerWave must be a number");if(r.emitter.particlesPerWave<=0)throw new Error("Input Error: emitter.particlesPerWave must be positive");if(!Number.isInteger(r.emitter.particlesPerWave))throw new Error("Input Error: emitter.particlesPerWave must be an integer")}if(r.emitter.maxParticles!==void 0){if(typeof r.emitter.maxParticles!="number")throw new Error("Input Error: emitter.maxParticles must be a number");if(r.emitter.maxParticles<=0)throw new Error("Input Error: emitter.maxParticles must be positive");if(!Number.isInteger(r.emitter.maxParticles))throw new Error("Input Error: emitter.maxParticles must be an integer")}}function WC(r){if(r.count!==void 0){if(typeof r.count!="number")throw new Error("Input Error: count must be a number");if(r.count<=0)throw new Error("Input Error: count must be positive");if(!Number.isInteger(r.count))throw new Error("Input Error: count must be an integer")}if(r.alpha!==void 0){if(typeof r.alpha!="number")throw new Error("Input Error: alpha must be a number");if(r.alpha<0||r.alpha>1)throw new Error("Input Error: alpha must be between 0 and 1")}if(r.x!==void 0&&typeof r.x!="number")throw new Error("Input Error: x must be a number");if(r.y!==void 0&&typeof r.y!="number")throw new Error("Input Error: y must be a number")}var zC=({state:r})=>{LC(r),DC(r),NC(r),HC(r),VC(r),WC(r);let t=r.emitter?.maxParticles??r.count??100,e=r.emitter;return e&&e.maxParticles===void 0&&r.count!==void 0&&(e={...e,maxParticles:t}),{id:r.id,type:r.type,count:t,texture:r.texture,behaviors:r.behaviors,emitter:e,x:r.x??0,y:r.y??0,width:r.width,height:r.height,alpha:r.alpha??1}};var qU=fe({type:"particles",add:Dl,update:OC,delete:Cd,parse:zC});var $C=(r=[],t=[])=>{let e=new Set,i=new Map,s=new Map,o=[],n=[],a=[];for(let l of r)e.add(l.id),i.set(l.id,l);for(let l of t)e.add(l.id),s.set(l.id,l);for(let l of e){let h=i.get(l),c=s.get(l);!h&&c?o.push(c):h&&!c?n.push(h):(h.src!==c.src||h.volume!==c.volume||h.loop!==c.loop||h.delay!==c.delay)&&a.push({prev:h,next:c})}return{toAddElement:o,toDeleteElement:n,toUpdateElement:a}};var Fx=({app:r,prevAudioTree:t,nextAudioTree:e,audioPlugins:i})=>{let{toAddElement:s,toDeleteElement:o,toUpdateElement:n}=$C(t,e);for(let a of o){let l=i.find(h=>h.type===a.type);if(!l)throw new Error(`No audio plugin found for type: ${a.type}`);l.delete({app:r,element:a})}for(let a of s){let l=i.find(h=>h.type===a.type);if(!l)throw new Error(`No audio plugin found for type: ${a.type}`);l.add({app:r,element:a})}for(let{prev:a,next:l}of n){let h=i.find(c=>c.type===l.type);if(!h)throw new Error(`No audio plugin found for type: ${l.type}`);h.update({app:r,prevElement:a,nextElement:l})}};var Je=(r=>(r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2",r))(Je||{}),kx=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS",r))(kx||{}),Rd=(r=>(r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL",r))(Rd||{}),et=(r=>(r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR",r))(et||{}),Ko=(r=>(r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN",r))(Ko||{}),D=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(D||{}),di=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(di||{}),lt=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(lt||{}),W=(r=>(r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT",r))(W||{}),mr=(r=>(r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR",r))(mr||{}),Nl=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(Nl||{}),Ar=(r=>(r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL",r))(Ar||{}),tr=(r=>(r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",r))(tr||{}),Wi=(r=>(r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT",r))(Wi||{}),Md=(r=>(r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL",r))(Md||{}),De=(r=>(r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp",r))(De||{}),ne=(r=>(r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR",r))(ne||{});var Rt=(r=>(r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH",r))(Rt||{}),Ye=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(Ye||{});var Ux={createCanvas:(r,t)=>{let e=document.createElement("canvas");return e.width=r,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")};var K={ADAPTER:Ux,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};hp();var KU=Ei.default??Ei,Pr=KU(globalThis.navigator);K.RETINA_PREFIX=/@([0-9\.]+)x/;K.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Ms=Zi(jC(),1),HL=Zi(Rc(),1);var my=Zi(hI(),1);var cI={};function ft(r,t,e=3){if(cI[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
1145
1145
  Deprecated since v${r}`):(i=i.split(`
1146
1146
  `).splice(e).join(`
1147
1147
  `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "route-graphics",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "A 2D graphics rendering interface that takes JSON input and renders pixels using PixiJS",
5
5
  "main": "dist/RouteGraphics.js",
6
6
  "type": "module",