@drincs/pixi-vn 1.9.2 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{ContainerMemory-BpDgacyr.d.cts → ContainerMemory-DNqSVzLY.d.cts} +12 -116
- package/dist/{ContainerMemory-BpDgacyr.d.ts → ContainerMemory-DNqSVzLY.d.ts} +12 -116
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +1279 -551
- package/dist/canvas.d.ts +1279 -551
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.mjs +1 -1
- package/dist/{chunk-6GLWL3NH.mjs → chunk-5MVDNAT4.mjs} +1 -1
- package/dist/chunk-6OABTG5R.mjs +1 -0
- package/dist/chunk-AW5XWF24.mjs +1 -0
- package/dist/chunk-LXIKP2K5.mjs +1 -0
- package/dist/chunk-S7HZUIEI.mjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +61 -5
- package/dist/core.d.ts +61 -5
- package/dist/core.mjs +1 -1
- package/dist/filters.cjs +1 -0
- package/dist/filters.d.cts +182 -0
- package/dist/filters.d.ts +182 -0
- package/dist/filters.mjs +1 -0
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +2 -2
- package/dist/history.d.ts +2 -2
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +43 -3
- package/dist/index.d.ts +43 -3
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.d.cts +30 -8
- package/dist/motion.d.ts +30 -8
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +1 -1
- package/dist/narration.d.cts +2 -1
- package/dist/narration.d.ts +2 -1
- package/dist/narration.mjs +1 -1
- package/dist/pixi/browser.js +170 -169
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/storage.mjs +1 -1
- package/dist/tickers.cjs +1 -0
- package/dist/tickers.d.cts +555 -0
- package/dist/tickers.d.ts +555 -0
- package/dist/tickers.mjs +1 -0
- package/dist/vite.cjs +6 -4
- package/dist/vite.d.cts +64 -0
- package/dist/vite.d.ts +64 -0
- package/dist/vite.mjs +6 -4
- package/dist/worker.cjs +1 -0
- package/dist/worker.d.cts +153 -0
- package/dist/worker.d.ts +153 -0
- package/dist/worker.mjs +1 -0
- package/package.json +28 -1
- package/dist/chunk-HQQ5WH6C.mjs +0 -1
- package/dist/chunk-I7DOUH5V.mjs +0 -1
package/dist/canvas.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a}from'./chunk-6GLWL3NH.mjs';import'./chunk-JMOSOAGB.mjs';import {e,d as d$1,g as g$1,b,c as c$1,f as f$1,a as a$1}from'./chunk-HD353M4B.mjs';import {c,d,e as e$1,f as f$2}from'./chunk-HQQ5WH6C.mjs';import {GameUnifier,PixiError}from'@drincs/pixi-vn/core';import B,{Container}from'@drincs/pixi-vn/pixi.js';import {initDevtools}from'@pixi/devtools';var Fe={extension:{type:"sceneProperties",name:"additional-positions"},testNode(t){return "xAlign"in t||"yAlign"in t||"percentageX"in t||"percentageY"in t||"positionType"in t},testProp(t){switch(t){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(t,e,i){switch(e){case "xAlign":"xAlign"in t&&(t.xAlign=i/100);break;case "yAlign":"yAlign"in t&&(t.yAlign=i/100);break;case "percentageX":"percentageX"in t&&(t.percentageX=i/100);break;case "percentageY":"percentageY"in t&&(t.percentageY=i/100);break}},getProperties(t){return [{value:t.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:t.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:t.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:t.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:t.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},be=Fe;function Ae(t,e){let i=0;return async(...n)=>{let r=Date.now();if(r-i>=e)return i=r,await t(...n)}}var _e=c(a(),1),g=class t{constructor(){}static _app=void 0;static get app(){if(!t._app)throw e$1.error("The canvas is not initialized"),new PixiError("invalid_usage","CanvasManagerStatic.app is undefined");return t._app}static get gameLayer(){let e=t.app.stage.getChildByLabel(a$1);return e||(e=new B.Container,e.label=a$1,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,i,n){let{id:r="pixi-vn-canvas",width:a=800,height:o=600,resolution:p=1,autoDensity:d=true,resizeMode:s="contain",...c}=i||{};return t.canvasWidth=a,t.canvasHeight=o,t._app=new B.Application,t.app.init({width:a,height:o,resolution:p,autoDensity:d,...c}).then(()=>{let{app:l=t.app,extensions:u=[],...y}=n||{};if(initDevtools({app:l,extensions:[be,...u],...y}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,r),s==="contain"){let x=Ae(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(x).observe(e),t.resize(),setTimeout(()=>t.resize(),750);}t.gameLayer;})}static addCanvasIntoHTMLElement(e,i){t._isInitialized?(e.appendChild(t.app.canvas),t.app.canvas.id=i):e$1.error("GameWindowManager is not initialized");}static addHtmlLayer(e,i,n={}){let{position:r="absolute",pointerEvents:a="none",userSelect:o="none"}=n,p=document.createElement("div");p.setAttribute("id",e),p.style.position=r,p.style.pointerEvents=a,p.style.userSelect=o;let d=i.appendChild(p);return t.htmlLayers.push(p),t.resize(),d}static removeHtmlLayer(e){let i=t.htmlLayers.find(n=>n.id===e);i&&(i.remove(),t.htmlLayers=t.htmlLayers.filter(n=>n.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(i=>i.id===e)}static async resize(){let e=t.canvasWidth,i=t.canvasHeight,n=t.app.resizeTo,r=t.app.canvas.style;n instanceof HTMLElement||(n=document.documentElement);let a,o;if(n===document.body||n===document.documentElement)a=document.documentElement.clientWidth||window.innerWidth,o=document.documentElement.clientHeight||window.innerHeight;else {let u=n.getBoundingClientRect();a=u.width||n.clientWidth,o=u.height||n.clientHeight;}let p=Math.min(a/e,o/i),d=Math.floor(p*e),s=Math.floor(p*i);r.width=`${d}px`,r.height=`${s}px`;let c=(a-d)/2,l=(o-s)/2;r.marginLeft=`${c}px`,r.marginRight=`${c}px`,r.marginTop=`${l}px`,r.marginBottom=`${l}px`,t.htmlLayers.forEach(u=>{u.style.width=`${d}px`,u.style.height=`${s}px`,u.style.marginLeft=`${c}px`,u.style.marginRight=`${c}px`,u.style.marginTop=`${l}px`,u.style.marginBottom=`${l}px`;});}static get childrenAliasesOrder(){return t.gameLayer.children.filter(e=>e.label).sort((e,i)=>t.gameLayer.getChildIndex(e)-t.gameLayer.getChildIndex(i)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Array.from(t._currentTickers.entries()).filter(([e,i])=>!i.createdByTicketSteps).map(([e,i])=>[e,{id:i.ticker.alias,args:i.ticker.args,canvasElementAliases:i.ticker.canvasElementAliases,priority:i.ticker.priority,duration:i.ticker.duration,paused:i.ticker.paused}]))}static _currentTickers=new Map;static _currentTickersSequence=new Map;static get currentTickersSequence(){return Object.fromEntries(Array.from(t._currentTickersSequence.entries()).map(([e,i])=>[e,Object.fromEntries(i)]))}static _currentTickersTimeouts=new Map;static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static generateTickerId(...e){try{return `${(0,_e.default)(JSON.stringify(e)).toString()}_${Math.random().toString(36).substring(7)}`}catch(i){throw new PixiError("not_json_serializable",`Error to generate ticker id: ${i}`)}}static addTickerTimeoutInfo(e,i,n,r){typeof e=="string"&&(e=[e]),t._currentTickersTimeouts.set(n,{aliases:e,ticker:i,canBeDeletedBeforeEnd:r});}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),t._currentTickersTimeouts.delete(e);}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),t.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,i){t._currentTickersTimeouts.forEach((n,r)=>{let a=n.aliases.filter(o=>o!==e);if(a.length===0){let o=n.canBeDeletedBeforeEnd;(!i||o)&&t.removeTickerTimeout(r);}else n.aliases=a;});}};var ue=Symbol("SerializableEvent"),X=new d({cacheSize:5});function Ze(t){return (e,i,n)=>{let r=n.value;fe.add(r,t||`${i}`);}}var fe;(a=>{function t(o,p){o[ue]=p,X.get(p)&&e$1.info(`Event "${p}" already exists, it will be overwritten`),X.set(p,o);}a.add=t;function e(o){try{let p=X.get(o);if(!p){e$1.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return p}catch(p){e$1.error(`Error while getting Event "${o}"`,p);return}}a.get=e;function i(){return Array.from(X.values())}a.values=i;function n(o){return X.has(o)}a.has=n;function r(){return Array.from(X.keys())}a.keys=r;})(fe||={});var ge=fe;async function we(t,e){if("onEvents"in e)for(let i in e.onEvents){let n=e.onEvents[i],r=ge.get(n);r&&t.on(i,r);}}function Oe(t){let{onEventsHandlers:e={}}=t;return e}function O(t,e,i){let n=i[ue];return n&&typeof n=="string"?(e.onEventsHandlers[t]=n,true):(e$1.warn(`The event handler for event "${t}" is not registered with the eventDecorator, it will not be saved in the memory and it will not work after loading the game. Please register the event handler with the eventDecorator to avoid this warning. Read more about it here: https://pixi-vn.com/start/canvas-functions#add-a-listener-to-an-event`),false)}var q=new d({cacheSize:5}),Be=new d({cacheSize:2}),Le=new d({cacheSize:2});function Je(t={}){return e=>{he.add(e,t);}}async function S(t,e,i){let n=i?.ignoreScale||false,r=i?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(t.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(t.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(t.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(t.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(t.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(t.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(t.rotation=e.rotation),!n&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?t.scale.set(e.scale,e.scale):t.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?t.pivot.set(e.pivot,e.pivot):t.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&t.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&t.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(t.visible=e.visible),"x"in e&&e.x!==void 0&&(t.x=e.x),"y"in e&&e.y!==void 0&&(t.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(t.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(t.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(t.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(t.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(t.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(t.hitArea=e.hitArea),we(t,e),"align"in e&&e.align!==void 0&&"align"in t&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&"percentagePosition"in t&&(t.percentagePosition=e.percentagePosition),r&&await r(),n||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var he;(p=>{function t(d,s={}){let{name:c=d.name,getInstance:l=async(y,x)=>{let T=new y;return await T.setMemory(x),T},copyProperty:u=async(y,x)=>{await y.setMemory(x);}}=s;q.get(c)&&e$1.warn(`CanvasElement "${c}" already registered`),d.prototype.pixivnId=c,q.set(c,d),Be.set(c,l),Le.set(c,u);}p.add=t;function e(d){let s=q.get(d);if(!s){e$1.error(`CanvasElement "${d}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return s}p.get=e;async function i(d,s){let c=e(d),l=Be.get(d);if(!c||!l){e$1.error(`CanvasElement "${d}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await l(c,s)}catch(u){e$1.error(`Error while getting CanvasElement instance "${d}"`,u);}}p.getInstance=i;async function n(d,s,c){let l=Le.get(d);if(!l){e$1.error(`CanvasElement "${d}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await l(s,c);}catch(u){e$1.error(`Error while copying properties of CanvasElement "${d}"`,u);}}p.copyProperty=n;function r(){return Array.from(q.values())}p.values=r;function a(d){return q.has(d)}p.has=a;function o(){return Array.from(q.keys())}p.keys=o;})(he||={});var k=he;async function J(t){let e=await k.getInstance(t.pixivnId,t);if(!e)throw new PixiError("unregistered_element",`The element ${t.pixivnId} could not be created`,"canvas",t);return e}function ye(t){return "memory"in t?t.memory:t instanceof B.Text?Te(t):t instanceof B.Sprite?xe(t):L(t)}function et(t){let e=t.parent;return {width:t.width,height:t.height,isRenderGroup:t.isRenderGroup,blendMode:t.blendMode,tint:t.tint,alpha:t.alpha,angle:t.angle,renderable:t.renderable,rotation:t.rotation,scale:{x:t.scale.x,y:t.scale.y},pivot:{x:t.pivot.x,y:t.pivot.y},position:{x:t.position.x,y:t.position.y},skew:{x:t.skew.x,y:t.skew.y},visible:t.visible,x:t.x,y:t.y,boundsArea:t.boundsArea,cursor:t.cursor,eventMode:t.eventMode,interactive:t.interactive,interactiveChildren:t.interactiveChildren,hitArea:t.hitArea,index:e?.getChildIndex(t),parentLabel:e?.label,label:t.label}}function me(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function L(t,e){let i=tt(t,b),r=e?.childrenExport||false?t.children.sort((a,o)=>t.getChildIndex(a)-t.getChildIndex(o)).map(a=>ye(a)):[];return {pixivnId:i,elements:r,onEvents:Oe(t),...et(t)}}function xe(t){let e$1=L(t),i=e$1.pixivnId??e,n="assetsAliases"in t&&Array.isArray(t.assetsAliases)?me(t.texture,t.assetsAliases[0]):"textureAlias"in t?me(t.texture,t.textureAlias):me(t.texture);return {...e$1,pixivnId:i,textureData:n,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function Te(t){let e=L(t),i=e.pixivnId??f$1;return {...e,pixivnId:i,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:st(t.style),roundPixels:t.roundPixels}}function tt(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function Q(t){switch(t.type){case "linear":return {type:"linear",colorStops:t.colorStops,end:{x:t.end.x,y:t.end.y},start:{x:t.start.x,y:t.start.y},textureSpace:t.textureSpace,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height};case "radial":return {type:"radial",colorStops:t.colorStops,textureSpace:t.textureSpace,center:{x:t.center.x,y:t.center.y},innerRadius:t.innerRadius,outerCenter:{x:t.outerCenter.x,y:t.outerCenter.y},outerRadius:t.outerRadius,rotation:t.rotation,scale:t.scale,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height}}}function it(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof B.FillGradient)return Q(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof B.FillPattern))return Q(t.fill)}}e$1.warn("Unsupported property type for Text.style.fill.",t);}}function rt(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof B.Color)return t.toNumber();e$1.warn("Unsupported color type.",t);}function nt(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof B.FillGradient)return Q(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:rt(t.color),join:t.join,miterLimit:t.miterLimit,width:t.width,cap:t.cap,pixelLine:t.pixelLine,textureSpace:t.textureSpace};if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof B.FillPattern))return Q(t.fill)}}e$1.warn("Unsupported property type for Text.style.stroke.",t);}}function st(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:it(t.fill),fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontVariant:t.fontVariant,fontWeight:t.fontWeight,leading:t.leading,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,padding:t.padding,stroke:nt(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}var Re=c(a(),1);var ee=class{constructor(e,i){this.alias=this.constructor.prototype.id;let{duration:n,priority:r,id:a=this.generateTickerId(this.alias,i),canvasElementAliases:o=[]}=i||{};this.args=e,this.duration=n,this.priority=r,this.id=a,this.canvasElementAliases=o;}alias;id;args;duration;priority;ticker=new B.Ticker;canvasElementAliases=[];generateTickerId(...e){try{return (0,Re.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(i){throw new PixiError("not_json_serializable",`Error to generate ticker id: ${i}`)}}fnValue;complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){e$1.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(){let e=this.id,i=()=>this.fn(this.ticker,this.args,this.canvasElementAliases,e);this.fnValue=i,this.ticker.add(i,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};var R=new d({cacheSize:5});function ct(t){return function(e){ve.add(e,t);}}var ve;(o=>{function t(p,d){d||(d=p.name),R.get(d)&&e$1.info(`Ticker "${d}" already exists, it will be overwritten`),p.prototype.id=d,R.set(d,p);}o.add=t;function e(p){try{let d=R.get(p);if(!d){e$1.error(`Event "${p}" not found, did you forget to register it with the tickerDecorator?`);return}return d}catch(d){e$1.error(`Error while getting Event "${p}"`,d);return}}o.get=e;function i(p,d,s){try{let c=R.get(p);if(!c){e$1.error(`Ticker "${p}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(d,s)}catch(c){e$1.error(`Error while getting Ticker "${p}"`,c);return}}o.getInstance=i;function n(){return Array.from(R.values())}o.values=n;function r(p){return R.has(p)}o.has=r;function a(){return Array.from(R.keys())}o.keys=a;})(ve||={});var D=ve;var De="aliasToRemoveAfter";var G=class{tickersPausedByGameLayerRender=[];get app(){return g.app}get gameLayer(){return g.gameLayer}get isInitialized(){return g._isInitialized}get width(){return g.canvasWidth}get height(){return g.canvasHeight}get screen(){return this.app.screen}async init(e,i,n){return await g.init(e,i,n)}get children(){return g.gameLayer.children}async copyCanvasElementProperty(e,i,n={}){let r=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:a=d=>d}=n;if(typeof i=="string"){let d=this.find(i);if(d)i=d;else {e$1.error(`Canvas element ${i} not found`);return}}if(typeof e=="string"){let d=this.find(e);if(d)e=d;else {e$1.error(`Canvas element ${e} not found`);return}}e instanceof B.Container&&(e=e.memory);let o=a(r),p={...e};o.forEach(d=>{d in p&&delete p[d];}),await k.copyProperty(i.pixivnId,i,p);}add(e,i,n={}){if(e===a$1){e$1.error(`The alias ${a$1} is reserved`);return}let r=this.find(e),a=n?.ignoreOldStyle;r&&!a&&this.copyCanvasElementProperty(r,i);let{zIndex:o=r?.parent?.getChildIndex(r)}=n;r&&!this.canvasElementIsOnCanvas(r)?e$1.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):r&&this.remove(e,{ignoreTickers:true}),o!==void 0?(i.label=e,this.gameLayer.addChildAt(i,o)):(i.label=e,this.gameLayer.addChild(i));}remove(e,i={}){if(e===a$1){e$1.error(`The alias ${a$1} is reserved`);return}let n=i.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(r=>{this.gameLayer.getChildrenByLabel(r).forEach(a=>{this.gameLayer.removeChild(a),!n&&this.unlinkComponentFromTickerInternal(r);});});}find(e){if(e===a$1)return this.gameLayer;let i=this.gameLayer.getChildByLabel(e);if(i)return i}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,i,n={}){let r=this.find(e);r&&(r.label=i),!n.ignoreTickers&&this.transferTickersInternal(e,i,"move");}get currentTickers(){return this.tickers.currentTickers}get currentTickersSteps(){return this.tickers.currentTickersSteps}findTicker(e){return this.findTickerInternal(e)}findTickerInternal(e){let i=g._currentTickers.get(e);if(i)return i.ticker}addTicker(e,i){return this.addTickerInternal(e,i)}addTickerInternal(e,i){let n=i.id,r=i.alias;if(typeof e=="string"&&(e=[e]),i.canvasElementAliases=e,!D.has(r)){e$1.error(`Ticker ${r} not found`);return}let a={ticker:i};if(g._currentTickers.set(n,a),a.ticker.start(),i.duration){let o=setTimeout(()=>{g.removeTickerTimeoutInfo(o),g._currentTickersTimeouts.get(o.toString())&&a.ticker.complete({ignoreTickerSteps:true});},i.duration*1e3);g.addTickerTimeoutInfo(e,r,o.toString(),true);}return n}addTickersSequence(e,i,n=0){if(i.length===0){e$1.warn("The steps of the tickers is empty");return}g._currentTickersSequence.has(e)||g._currentTickersSequence.set(e,new Map);let r={currentStepNumber:n,steps:i.map(o=>({ticker:o.alias,args:f$2(o.args),duration:o.duration}))},a=g.generateTickerId(r);return g._currentTickersSequence.get(e)?.set(a,r),this.runTickersSequence(e,a),a}runTickersSequence(e,i){let n=g._currentTickersSequence.get(e);if(!n?.has(i))return;let r=n.get(i).steps[n.get(i).currentStepNumber],a=D.getInstance(r.ticker,r.args,{canvasElementAliases:[e],duration:r.duration,priority:r.priority});if(!a){e$1.error(`Ticker ${r.ticker} not found`);return}let o=a.alias,p=a.id;a.canvasElementAliases=[e];let d={createdByTicketSteps:{canvasElementAlias:e,id:i},ticker:a};if(g._currentTickers.set(p,d),d.ticker.start(),a.duration){let s=setTimeout(()=>{let c=g._currentTickersTimeouts.get(s.toString());c&&(d.ticker.complete({ignoreTickerSteps:true}),c.aliases.forEach(l=>{this.nextTickerStep(l,i);})),g.removeTickerTimeoutInfo(s);},a.duration*1e3);g.addTickerTimeoutInfo(e,o,s.toString(),false);}}nextTickerStep(e,i){let n=g._currentTickersSequence.get(e);if(n?.has(i)){let r=n.get(i);r.currentStepNumber+1<r.steps.length?(r.currentStepNumber++,n.set(i,r),this.runTickersSequence(e,i)):i&&n.has(i)&&(n.delete(i),g._currentTickers.forEach((a,o)=>{a.createdByTicketSteps?.canvasElementAlias===e&&a.createdByTicketSteps.id===i&&this.removeTickerInternal(o);}));}}onTickerComplete(e,i){return this.onTickerCompleteInternal(e,i)}onTickerCompleteInternal(e,i){let{stopTicker:n=true,aliasToRemoveAfter:r,tickerAliasToResume:a,tickerIdToResume:o}=i,p=g._currentTickers.get(e),d=i.ignoreTickerSteps||false;this.remove(r),a.forEach(s=>{this.resumeTickerInternal({canvasAlias:s});}),this.resumeTickerInternal({id:o}),p&&(this.removeTickerInternal(e,{stopTicker:n}),!d&&p.ticker.duration===void 0&&p.createdByTicketSteps&&this.nextTickerStep(p.createdByTicketSteps.canvasElementAlias,p.createdByTicketSteps.id));}unlinkComponentFromTicker(e,i){return this.unlinkComponentFromTickerInternal(e,i)}unlinkComponentFromTickerInternal(e,i){if(typeof e=="string"&&(e=[e]),!i){e.forEach(r=>{g._currentTickers.forEach((a,o)=>{a.ticker.canvasElementAliases.includes(r)&&(a.ticker.canvasElementAliases.length===1?this.removeTickerInternal(o):a.ticker.canvasElementAliases=a.ticker.canvasElementAliases.filter(p=>p!==r));}),g._currentTickersSequence.has(r)&&g._currentTickersSequence.delete(r),g.removeTickerTimeoutsByAlias(r,false);});return}let n;typeof i=="string"?n=i:n=i.prototype.id,e.forEach(r=>{let a=g._currentTickersSequence.get(r);a&&a.forEach((o,p)=>{o.steps.find(d=>typeof d=="object"&&"ticker"in d&&d.ticker===n)&&a.delete(p);});}),g._currentTickers.forEach(r=>{r.ticker.alias===n&&(r.ticker.canvasElementAliases=r.ticker.canvasElementAliases.filter(a=>!e.includes(a)));}),g._currentTickersTimeouts.forEach(r=>{r.ticker===n&&r.canBeDeletedBeforeEnd&&(r.aliases=r.aliases.filter(a=>!e.includes(a)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){g._currentTickers.forEach(e=>{e.ticker.canvasElementAliases=e.ticker.canvasElementAliases.filter(i=>this.find(i)),e.ticker.canvasElementAliases.length===0&&e.ticker.complete({ignoreTickerSteps:true});}),g._currentTickersSequence.forEach((e,i)=>{e===void 0&&g._currentTickersSequence.delete(i);}),Array.from(g._currentTickersTimeouts.keys()).forEach(e=>{let i=g._currentTickersTimeouts.get(e);i&&i.aliases.length===0&&g.removeTickerTimeout(e);});}removeAllTickers(){return this.removeAllTickersInternal()}removeAllTickersInternal(){this.tickersPausedByGameLayerRender=[],g._currentTickersSequence.clear(),Array.from(g._currentTickers.keys()).forEach(e=>{this.removeTickerInternal(e);}),g._currentTickers.clear(),Array.from(g._currentTickersTimeouts.keys()).forEach(e=>{g.removeTickerTimeout(e);}),g._tickersToCompleteOnStepEnd.tikersIds.length=0,g._tickersToCompleteOnStepEnd.stepAlias.length=0;}removeTicker(e,i={stopTicker:true}){return this.removeTickerInternal(e,i)}removeTickerInternal(e,i={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let r=g._currentTickers.get(n);r&&(i.stopTicker&&r.ticker.stop(),g._currentTickers.delete(n));});}pauseTicker(e){return this.pauseTickerInternal(e)}pauseTickerInternal(e){let i=[];if("canvasAlias"in e){let{canvasAlias:n,tickerIdsExcluded:r=[]}=e;g._currentTickers.forEach((a,o)=>{a.ticker.canvasElementAliases.includes(n)&&!r.includes(a.ticker.alias)&&a.ticker.paused===false&&(a.ticker.pause(),i.push(o));});}else if("id"in e){let{id:n}=e;typeof n=="string"&&(n=[n]),[...new Set(n)].forEach(r=>{let a=g._currentTickers.get(r);a?a.ticker.paused===false&&(a.ticker.pause(),i.push(r)):e$1.error(`Ticker with id ${r} not found`);});}return i}resumeTicker(e){return this.resumeTickerInternal(e)}resumeTickerInternal(e){if("canvasAlias"in e){let{canvasAlias:i}=e;g._currentTickers.forEach(n=>{n.ticker.canvasElementAliases.includes(i)&&n.ticker.play();});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),[...new Set(i)].forEach(n=>{let r=g._currentTickers.get(n);r?r.ticker.play():e$1.error(`Ticker with id ${n} not found`);});}}isTickerPaused(e,i){return this.isTickerPausedInternal(e,i)}isTickerPausedInternal(e,i){return false}pause(){this.gameLayer.renderable!==false&&(this.gameLayer.renderable=false,this.tickersPausedByGameLayerRender=this.pauseTickerInternal({id:Array.from(g._currentTickers.keys())}));}resume(){if(this.gameLayer.renderable===true)return;this.gameLayer.renderable=true;let e=this.tickersPausedByGameLayerRender.filter(i=>g._currentTickers.has(i));e.length>0&&this.resumeTickerInternal({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,i,n="move"){return this.transferTickersInternal(e,i,n)}transferTickersInternal(e,i,n="move"){let r=g._currentTickersSequence.get(e);if(r){let o=new Map(Array.from(r.entries()).map(([p,d])=>[p,f$2(d)]));g._currentTickersSequence.set(i,o);}g._currentTickers.forEach((o,p)=>{if(o.createdByTicketSteps?.canvasElementAlias===e&&this.removeTickerInternal(p),o.ticker.canvasElementAliases.includes(e)){let d=D.getInstance(o.ticker.alias,f$2(o.ticker.args),{duration:o.ticker.duration,priority:o.ticker.priority,canvasElementAliases:[i]});if(d?(this.addTickerInternal(i,d),o.ticker.paused&&d.pause()):e$1.error(`Ticker ${o.ticker.alias} not found`),n==="move"&&(o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(s=>s!==e)),Object.hasOwn(o.ticker.args,De)){let s=o.ticker.args.aliasToRemoveAfter;typeof s=="string"&&(s=[s]),Array.isArray(s)&&(n==="move"?o.ticker.args.aliasToRemoveAfter=s.map(c=>c===e?i:c):n==="duplicate"&&s.find(c=>c===e)&&(o.ticker.args.aliasToRemoveAfter=[...s,i]));}}}),g._currentTickersTimeouts.forEach(o=>{o.aliases.includes(e)&&(n==="move"?o.aliases=o.aliases.map(p=>p===e?i:p):n==="duplicate"&&o.aliases.find(p=>p===e)&&o.aliases.push(i));});let a=g._currentTickersSequence.get(i);if(a&&a.forEach((o,p)=>{this.runTickersSequence(i,p);}),n==="duplicate"){let o=g._currentTickersSequence.get(e);o&&o.forEach((p,d)=>{this.runTickersSequence(e,d);});}}completeTickerOnStepEnd(e){return this.completeTickerOnStepEndInternal(e)}completeTickerOnStepEndInternal(e){e.alias?g._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):g._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,i){return this.forceCompletionOfTickerInternal(e,i)}async forceCompletionOfTickerInternal(e,i){if(i){let n=g._currentTickersSequence.get(i),r=n?.get(e);if(n&&r){let a=r.steps.map(o=>{if(typeof o=="object"&&"ticker"in o){let p=D.getInstance(o.ticker,o.args,{duration:o.duration,canvasElementAliases:[i],priority:o.priority});if(p)return p.complete()}return Promise.resolve()});await Promise.all(a);}}else {let n=g._currentTickers.get(e);n&&await n.ticker.complete();}}tickers={transfer:(e,i,n)=>this.transferTickersInternal(e,i,n),get currentTickers(){return g._currentTickers},get currentTickersSteps(){return g._currentTickersSequence},find:e=>this.findTickerInternal(e),add:(e,i)=>this.addTickerInternal(e,i),addSequence:(e,i,n)=>this.addTickersSequence(e,i,n),unlinkComponent:(e,i)=>this.unlinkComponentFromTickerInternal(e,i),removeAll:()=>this.removeAllTickersInternal(),remove:e=>this.removeTickerInternal(e),pause:e=>this.pauseTickerInternal(e),resume:e=>this.resumeTickerInternal(e),isPaused:(e,i)=>this.isTickerPausedInternal(e,i),completeOnStepEnd:e=>this.completeTickerOnStepEndInternal(e),forceCompletion:(e,i)=>this.forceCompletionOfTickerInternal(e,i),onComplete:(e,i)=>this.onTickerCompleteInternal(e,i)};animate(e,i,n,r){return GameUnifier.animate(e,i,n,r)}addLayerInternal(e,i){if(e===a$1){e$1.error(`The alias ${a$1} is reserved`);return}return i.label=e,g.app.stage.addChild(i)}getLayerInternal(e){return g.app.stage.getChildByLabel(e)}removeLayerInternal(e){let i=g.app.stage.getChildByLabel(e);i&&g.app.stage.removeChild(i);}addHtmlLayerInternal(e,i,n){return g.addHtmlLayer(e,i,n)}removeHtmlLayerInternal(e){return g.removeHtmlLayer(e)}getHtmlLayerInternal(e){return g.getHtmlLayer(e)}addLayer(e,i){return this.addLayerInternal(e,i)}getLayer(e){return this.getLayerInternal(e)}removeLayer(e){return this.removeLayerInternal(e)}addHtmlLayer(e,i,n){return this.addHtmlLayerInternal(e,i,n)}removeHtmlLayer(e){return this.removeHtmlLayerInternal(e)}getHtmlLayer(e){return this.getHtmlLayerInternal(e)}layers={get gameLayer(){return g.gameLayer},add:(e,i)=>this.addLayerInternal(e,i),get:e=>this.getLayerInternal(e),remove:e=>this.removeLayerInternal(e)};htmlLayers={add:(e,i,n)=>this.addHtmlLayerInternal(e,i,n),get:e=>this.getHtmlLayerInternal(e),remove:e=>this.removeHtmlLayerInternal(e)};async extractImage(){let e=this.gameLayer.renderable===false;e&&this.resume();let i;try{i=this.app.renderer.extract.image(this.app.stage);}finally{e&&this.pause();}return (await i).src}clear(){this.removeAllTickersInternal(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let i={};return this.children.forEach(n=>{n.label&&(i[n.label]=ye(n));}),{tickers:f$2(g.currentTickersWithoutCreatedBySteps),tickersSteps:f$2(g.currentTickersSequence),elements:f$2(i),stage:f$2(L(this.gameLayer)),elementAliasesOrder:f$2(g.childrenAliasesOrder),tickersToCompleteOnStepEnd:f$2(g._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let i=e.elementAliasesOrder,n={},r=Object.entries(e.elements).map(async([a,o])=>{n[a]=await J(o);});await Promise.all(r),i.forEach(a=>{let o=n[a];o&&this.add(a,o);});}else {e$1.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?S(this.gameLayer,e.stage,{ignoreScale:!0}):e$1.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let i=e.tickers;Object.entries(i).forEach(([n,r])=>{let a=r.canvasElementAliases;if(a.length!==0){let o=D.getInstance(r.id,r.args,{duration:r.duration,priority:r.priority,id:n,canvasElementAliases:a});o?(o.canvasElementAliases=a,this.addTickerInternal(a,o),r.paused&&o.pause()):e$1.error(`Ticker ${r.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([n,r])=>{g._currentTickersSequence.set(n,new Map(Object.entries(r))),Object.keys(r).forEach(a=>{this.runTickersSequence(n,a);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,n=i.tikersIds,r=i.stepAlias.map(a=>({id:a.id,alias:a.alias}));g._tickersToCompleteOnStepEnd.tikersIds.length=0,g._tickersToCompleteOnStepEnd.tikersIds.push(...n),g._tickersToCompleteOnStepEnd.stepAlias.length=0,g._tickersToCompleteOnStepEnd.stepAlias.push(...r);}}catch(i){e$1.error("Error importing data",i);}}};var I=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};var h;(d=>{function t(s,c,l,u,y,x=0){return y?s==="width"?c*(I.screen.width-l)+l-u-x*l:c*(I.screen.height-l)+l-u-x*l:s==="width"?c*(I.screen.width-l)+u+x*l:c*(I.screen.height-l)+u+x*l}d.calculatePositionByAlign=t;function e(s,c,l,u,y,x=0){return y?s==="width"?(c-l+u+x*l)/(I.screen.width-l):(c-l+u+x*l)/(I.screen.height-l):s==="width"?(c-u-x*l)/(I.screen.width-l):(c-u-x*l)/(I.screen.height-l)}d.calculateAlignByPosition=e;function i(s,c){return s==="width"?c*I.screen.width:c*I.screen.height}d.calculatePositionByPercentagePosition=i;function n(s,c){return s==="width"?c/I.screen.width:c/I.screen.height}d.calculatePercentagePositionByPosition=n;function r(s,c){if(c=c%360,c<0&&(c+=360),c===0)return {x:s.x,y:s.y};if(c===90)return {x:-s.y,y:s.x};if(c===180)return {x:-s.x,y:-s.y};if(c===270)return {x:s.y,y:-s.x};if(c>0&&c<90){let l=c*Math.PI/180,u=Math.cos(l),y=Math.sin(l),x=s.x*u-s.y*y,T=s.x*y+s.y*u;return s.x!==0&&Math.sign(x)!==Math.sign(s.x)&&(x=-x),s.y!==0&&Math.sign(T)!==Math.sign(s.y)&&(T=-T),{x,y:T}}else if(c>90&&c<180){let l=(c-90)*Math.PI/180,u=Math.cos(l),y=Math.sin(l),x=-s.y*y-s.x*u,T=s.y*u-s.x*y;return s.x!==0&&Math.sign(x)!==Math.sign(s.x)&&(x=-x),s.y!==0&&Math.sign(T)!==Math.sign(s.y)&&(T=-T),{x,y:T}}else if(c>180&&c<270){let l=(c-180)*Math.PI/180,u=Math.cos(l),y=Math.sin(l),x=-s.x*u+s.y*y,T=-s.x*y-s.y*u;return s.x!==0&&Math.sign(x)!==Math.sign(s.x)&&(x=-x),s.y!==0&&Math.sign(T)!==Math.sign(s.y)&&(T=-T),{x,y:T}}else if(c>270&&c<360){let l=(c-270)*Math.PI/180,u=Math.cos(l),y=Math.sin(l),x=s.y*y-s.x*u,T=-s.y*u-s.x*y;return s.x!==0&&Math.sign(x)!==Math.sign(s.x)&&(x=-x),s.y!==0&&Math.sign(T)!==Math.sign(s.y)&&(T=-T),{x,y:T}}return {x:0,y:0}}d.getSuperPoint=r;function a(s,c){if(c=c%360,c<0&&(c+=360),c===0)return {x:s.x,y:s.y};if(c===90)return {x:s.y,y:-s.x};if(c===180)return {x:-s.x,y:-s.y};if(c===270)return {x:-s.y,y:s.x};if(c>0&&c<90){let l=c*Math.PI/180,u=Math.cos(l),y=Math.sin(l);return {x:s.x*u+s.y*y,y:-s.x*y+s.y*u}}else if(c>90&&c<180){let l=(c-90)*Math.PI/180,u=Math.cos(l),y=Math.sin(l);return {x:s.y*u-s.x*y,y:-s.y*y-s.x*u}}else if(c>180&&c<270){let l=(c-180)*Math.PI/180,u=Math.cos(l),y=Math.sin(l);return {x:-s.x*u-s.y*y,y:s.x*y-s.y*u}}else if(c>270&&c<360){let l=(c-270)*Math.PI/180,u=Math.cos(l),y=Math.sin(l);return {x:-s.y*u+s.x*y,y:s.y*y+s.x*u}}return {x:0,y:0}}d.getPointBySuperPoint=a;function o(s){let c=s.width,l=s.height,u=s.angle%360;return u<0&&(u+=360),u===0||u===180?c:u===90||u===270?l:Math.abs(c*Math.cos(u*Math.PI/180))+Math.abs(l*Math.sin(u*Math.PI/180))}d.getSuperWidth=o;function p(s){let c=s.width,l=s.height,u=s.angle%360;return u<0&&(u+=360),u===0||u===180?l:u===90||u===270?c:Math.abs(l*Math.cos(u*Math.PI/180))+Math.abs(c*Math.sin(u*Math.PI/180))}d.getSuperHeight=p;})(h||={});async function N(t){if(t!=="EMPTY"){if(!t)throw e$1.error("Texture not found",t),new PixiError("unregistered_asset","Texture not found");if(B.Assets.cache.has(t)){let e=B.Assets.get(t);if(e)return e}return B.Assets.load(t).then(e=>{if(!e)throw e$1.error("Texture not found",t),new PixiError("unregistered_asset","Texture not found");if(!(e instanceof B.Texture))throw e$1.error("File is not a Texture",t),new PixiError("unregistered_asset","File is not a Texture");return e}).catch(e=>{throw e$1.error("Error loading file",e),new PixiError("unknown_element","Error loading file")})}}function A(t){return t&&(typeof t.align!="number"&&(t.xAlign!==void 0&&(t.align===void 0?(t.align={x:t.xAlign},delete t.xAlign):(t.align.x=t.xAlign,delete t.xAlign)),t.yAlign!==void 0&&(t.align===void 0?(t.align={y:t.yAlign},delete t.yAlign):(t.align.y=t.yAlign,delete t.yAlign))),typeof t.percentagePosition!="number"&&(t.percentageX!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={x:t.percentageX},delete t.percentageX):(t.percentagePosition.x=t.percentageX,delete t.percentageX)),t.percentageY!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={y:t.percentageY},delete t.percentageY):(t.percentagePosition.y=t.percentageY,delete t.percentageY))),t)}var H=class t extends B.Sprite{constructor(e$1){if(e$1 instanceof B.Texture)super(e$1);else {let{align:i,percentagePosition:n,...r}=A(e$1)||{};super(r),i&&(this.align=i),n&&(this.percentagePosition=n);}this.pixivnId=this.constructor.prototype.pixivnId||e;}pixivnId=e;get memory(){return {...xe(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await ne(this,e)}static from(e,i){let n=B.Sprite.from(e,i),r=new t;return r.texture=n.texture,r}onEventsHandlers={};on(e,i,n){return O(e,this,i),super.on(e,(...r)=>i(...r,this),n)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return {x:h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:h.calculatePercentagePositionByPosition("width",this.x),y:h.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return h.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return h.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=h.calculatePositionByAlign("width",this._align.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=h.calculatePositionByAlign("height",this._align.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=h.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=h.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};k.add(H,{name:e,copyProperty:async(t,e)=>{await ne(t,e,{ignoreTexture:true});}});async function ne(t,e,i){e=A(e);let n=i?.ignoreTexture||false;if(await S(t,e),!n){let a;if("textureData"in e&&e.textureData&&(a=e.textureData),a&&a.url!=="EMPTY"){let o=a.url;a.alias&&B.Assets.resolver.hasKey(a.alias)&&(o=a.alias);try{let p=await N(o);p&&(t.texture=p);}catch(p){e$1.error("Error in Sprite.setMemorySprite() while loading texture"),p=new PixiError("unregistered_asset",`Error loading image ${o}`,"canvas",e),GameUnifier.runOnError(p,{});}}}let r=i?.half;r&&await r(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}var v=class t extends H{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=d$1;constructor(e,i){super(e),i&&(this._textureAlias=i);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loadIsStarted:this._loadIsStarted}}async setMemory(e){let i;"textureData"in e&&e.textureData&&(i=e.textureData),"assetsData"in e&&Array.isArray(e.assetsData)&&e.assetsData.length>0&&(i=e.assetsData[0]),i&&i.alias&&(this._textureAlias=i.alias),await se(this,e),this.reloadPosition();}static from(e,i){let n=B.Sprite.from(e,i),r=new t;return r.texture=n.texture,r}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,N(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,e$1.error("Error into ImageSprite.load()"),e=new PixiError("unregistered_asset",`Error loading image ${this.textureAlias}`,"canvas",{...this.memory,label:this.textureAlias},this),GameUnifier.runOnError(e,{});})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}};k.add(v,{name:d$1,copyProperty:async(t,e)=>{await se(t,e,{ignoreTexture:true});}});async function se(t,e,i){return await ne(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:i?.ignoreTexture})}var M=class t extends v{constructor(e,i){if(e instanceof B.Texture){super(e,i);return}let{loop:n,paused:r,currentTime:a,...o}=e||{};super(o,i),n&&(this.loop=n),r&&(this.paused=r),a&&(this.currentTime=a);}pixivnId=g$1;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await ze(this,e),this.reloadPosition();}static from(e,i){let n=B.Sprite.from(e,i),r=new t;return r.texture=n.texture,r}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource?.play&&typeof this.texture.source.resource.play=="function"&&this.texture.source.resource.play();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let i=this.duration;i&&e>=i&&(e=0),this._currentTime=e,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=e);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};k.add(M,{name:g$1,getInstance:async(t,e)=>{let i;"textureData"in e&&e.textureData&&(i=e.textureData);let n=new t(void 0,i?.alias);return await n.setMemory(e),n},copyProperty:async(t,e)=>{await ze(t,e,{ignoreTexture:true});}});async function ze(t,e,i){await se(t,e,{ignoreTexture:i?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(t.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(t.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(t.paused=e.paused);}var _=class extends Container{constructor(e){let{anchor:i,align:n,percentagePosition:r,...a}=A(e)||{};super(a),this.pixivnId=this.constructor.prototype.pixivnId||b,i&&(this.anchor=i),n&&(this.align=n),r&&(this.percentagePosition=r);}pixivnId=b;get memory(){return {...L(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await S(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let i=0;i<e.elements.length;i++){let n=e.elements[i],r=await J(n);this.addChild(r);}}onEventsHandlers={};on(e,i,n){return O(e,this,i),super.on(e,(...r)=>i(...r,this),n)}_anchor;get anchor(){let e=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:e,y:i}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(e){this._anchor=void 0,super.pivot=e;}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return {x:h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0),y:h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:h.calculatePercentagePositionByPosition("width",this.x),y:h.calculatePercentagePositionByPosition("height",this.y)}}set percentageX(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageX(){return h.calculatePercentagePositionByPosition("width",this.x)}set percentageY(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get percentageY(){return h.calculatePercentagePositionByPosition("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=h.calculatePositionByAlign("width",this._align.x,h.getSuperWidth(this),e.x,i.x<0)),this._align.y!==void 0&&(super.y=h.calculatePositionByAlign("height",this._align.y,h.getSuperHeight(this),e.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=h.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=h.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};k.add(_,{name:b,copyProperty:async(t,e)=>await S(t,e)});var yt=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function U(t){let e=B.Assets.cache.has(t)?B.Assets.get(t):null;return e instanceof B.Texture&&(t=e.source?.label||t),xt(t)}function xt(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&yt.has(e)}var P=class extends _{constructor(e,i){let{anchor:n,align:r,percentagePosition:a,...o}=A(e)||{};super(o),i&&i.forEach(p=>{U(p)?this.addChild(new M(void 0,p)):this.addChild(new v(void 0,p));}),n&&(this.anchor=n),r&&(this.align=r),a&&(this.percentagePosition=a);}get memory(){return {...super.memory,pixivnId:c$1,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await Ve(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=c$1;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=this.children.map(i=>i.load());return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,e$1.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new B.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};k.add(P,{name:c$1,copyProperty:async(t,e)=>await Ve(t,e)});async function Ve(t,e){e=A(e)||{},S(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var ae=class{constructor(...e){}get memory(){throw new PixiError("not_implemented","The method CanvasBaseItem.memory must be overridden")}setMemory(e){throw new PixiError("not_implemented","The method CanvasBaseItem.setMemory must be overridden")}pixivnId="canvas_element_id_not_set"};var z=class extends B.Text{constructor(e){let{align:i,percentagePosition:n,...r}=A(e)||{};super(r),this.pixivnId=this.constructor.prototype.pixivnId||f$1,i&&(this.align=i),n&&(this.percentagePosition=n);}pixivnId=f$1;get memory(){return {...Te(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await Pt(this,e),this.reloadPosition();}onEventsHandlers={};on(e,i,n){return O(e,this,i),super.on(e,(...r)=>i(...r,this),n)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return {x:h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:h.calculatePercentagePositionByPosition("width",this.x),y:h.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return h.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return h.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=h.calculatePositionByAlign("width",this._align.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=h.calculatePositionByAlign("height",this._align.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=h.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=h.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};k.add(z,{name:f$1});async function Pt(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await S(t,e,{end:()=>{"style"in e&&e.style!==void 0&&(t.style=e.style);}}),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"resolution"in e&&e.resolution!==void 0&&(t.resolution=e.resolution),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}async function It(t,e={},i){let n=f.find(t);if(!n){e$1.error(`The element with the alias ${t} does not exist. So the shake effect can't be applied.`);return}let r={x:n.position.x,y:n.position.y},{shakeType:a="horizontal",maxShockSize:o=10,shocksNumber:p=10,...d}=e,s=p-1;if(s<2){e$1.error("The number of shocks must be at least 3.");return}let c=Math.floor(s/2),l=Math.ceil(s/2),u=[];for(let T=0;T<c;T++){let C=o*(T+1)/c;a==="horizontal"?T%2!==0?u.push(r.x+C):u.push(r.x-C):T%2!==0?u.push(r.y+C):u.push(r.y-C);}let y=c%2===0;for(let T=l;T>0;T--){let C=o*(T+1)/(l-1);a==="horizontal"?T%2===0&&!y||T%2!==0&&y?u.push(r.x-C):u.push(r.x+C):T%2===0&&!y||T%2!==0&&y?u.push(r.y-C):u.push(r.y+C);}let x;if(a==="horizontal"?(u.push(r.x),x=f.animate(t,{x:u},d,i)):(u.push(r.y),x=f.animate(t,{y:u},d,i)),x)return [x]}function oe(t,e,i){let n={...f.find(t)?.memory,...i},r=new P(i,e);return n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}async function kt(t,e,i){let n={...f.find(t)?.memory,...i},r=new P(i,e);return r.label=t,await r.load(),n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}function ce(t,e,i){if(!e)if(B.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:d$1,...i,label:t});let n={...f.find(t)?.memory,...i},r=new v(i,e);return n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}async function Ct(t,e,i){if(!e)if(B.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:d$1,...i,label:t});let n={...f.find(t)?.memory,...i},r=new v(i,e);return r.label=t,await r.load(),n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}function de(t,e,i){if(!e)if(B.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:g$1,...i,label:t});let n={...f.find(t)?.memory,...i},r=new M(i,e);return n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}async function St(t,e,i){if(!e)if(B.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:g$1,...i,label:t});let n={...f.find(t)?.memory,...i},r=new M(i,e);return r.label=t,await r.load(),n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}function Ie(t){switch(t.type){case "align":return {xAlign:t.x,yAlign:t.y};case "percentage":return {percentageX:t.x,percentageY:t.y};default:return {x:t.x,y:t.y}}}function F(t,e,i){if(typeof e=="string")return U(e)?de(t,e,i):ce(t,e,i);if(Array.isArray(e))return oe(t,e,i);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return U(e.value)?de(t,e.value,{...e.options,zIndex:i.zIndex}):ce(t,e.value,{...e.options,zIndex:i.zIndex});if(Array.isArray(e.value))return oe(t,e.value,{...e.options,zIndex:i.zIndex})}return f.add(t,e,i),e}async function qe(t,e,i={},n){let{completeOnContinue:r=true,tickerIdToResume:a=[],...o}=i,p=[];e||(e=t),typeof a=="string"&&(a=[a]);let d,s=f.find(t);if(s&&(d=`${t}_temp_disolve`,f.editAlias(t,d)),e=F(t,e,{zIndex:s?s.parent?.getChildIndex(s):void 0}),s?.parent?.setChildIndex(s,s.parent.getChildIndex(s)-.1),d&&f.copyCanvasElementProperty(d,t),d&&f.tickers.transfer(d,t,"duplicate"),e.alpha=0,d){let l=pe(d,{...i,autoplay:false,completeOnContinue:r},n);l&&(p.push(...l),a.push(...l));}let c=f.animate(t,{alpha:1},{...o,tickerIdToResume:a,completeOnContinue:r},n);if(c&&p.push(c),(e instanceof v||e instanceof P)&&e.haveEmptyTexture&&await e.load(),p.length>0)return p}function pe(t,e={},i){let{completeOnContinue:n=true,aliasToRemoveAfter:r=[],...a}=e;typeof r=="string"&&(r=[r]),r.push(t);let o=f.animate(t,{alpha:0},{...a,aliasToRemoveAfter:r,completeOnContinue:n},i);if(o)return [o]}async function bt(t,e,i={},n){let{completeOnContinue:r=true,aliasToRemoveAfter:a=[],...o}=i,p=[];e||(e=t),typeof a=="string"&&(a=[a]);let d=f.find(t);if(!d)return qe(t,e,i,n);let s=`${t}_temp_fade`;f.editAlias(t,s),a.push(s),e=F(t,e,{zIndex:d?d.parent?.getChildIndex(d):void 0}),d?.parent?.setChildIndex(d,d.parent.getChildIndex(d)-.1),s&&f.copyCanvasElementProperty(s,t),s&&f.tickers.transfer(s,t,"duplicate"),e.alpha=0;let c=f.animate(t,{alpha:1},{...o,aliasToRemoveAfter:a,completeOnContinue:r},n);if(c){let l=pe(s,{...i,tickerIdToResume:c,completeOnContinue:r},n);l&&p.push(...l),p.push(c),f.tickers.pause({id:c});}if((e instanceof v||e instanceof P)&&e.haveEmptyTexture&&await e.load(),p.length>0)return p}function At(t,e={},i){return pe(t,e,i)}async function Et(t,e,i={},n){let{direction:r="right",completeOnContinue:a=true,tickerIdToResume:o=[],aliasToRemoveAfter:p=[],removeOldComponentWithMoveOut:d,...s}=i,c=[],l;e||(e=t),typeof o=="string"&&(o=[o]),typeof p=="string"&&(p=[p]);let u,y=f.find(t);if(y&&(u=`${t}_temp_movein`,f.editAlias(t,u),y instanceof v||y instanceof P?l=y.positionInfo:l={x:y.x,y:y.y,type:"pixel"}),e=F(t,e,{zIndex:y?y.parent?.getChildIndex(y):void 0}),y?.parent?.setChildIndex(y,y.parent.getChildIndex(y)-.1),u&&f.copyCanvasElementProperty(u,t),u&&f.tickers.transfer(u,t,"move"),l||(e instanceof v||e instanceof P?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"}),u)if(d){let C=ke(u,{...i,autoplay:false,completeOnContinue:a},n);C&&(c.push(...C),o.push(...C));}else p.push(u);switch((e instanceof v||e instanceof P)&&e.haveEmptyTexture&&await e.load(),r){case "up":e.y=f.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=f.width+e.width;break;case "right":e.x=-e.width;break}let x=f.tickers.pause({canvasAlias:t});o.push(...x);let T=f.animate(t,Ie(l),{...s,tickerIdToResume:o,aliasToRemoveAfter:p,completeOnContinue:a},n);if(T&&c.push(T),c.length>0)return c}function ke(t,e={},i){let{direction:n="right",completeOnContinue:r=true,aliasToRemoveAfter:a=[],...o}=e;typeof a=="string"&&(a=[a]),a.push(t);let p=f.find(t);if(!p){e$1.warn(`The canvas component "${t}" is not found.`);return}let d={x:p.x,y:p.y};switch(n){case "up":d.y=-p.height;break;case "down":d.y=f.height+p.height;break;case "left":d.x=-p.width;break;case "right":d.x=f.width+p.width;break}f.tickers.pause({canvasAlias:t});let s=f.animate(t,d,{...o,aliasToRemoveAfter:a,completeOnContinue:r},i);if(s)return [s]}async function Mt(t,e,i={},n){let{direction:r="right",completeOnContinue:a=true,tickerIdToResume:o=[],aliasToRemoveAfter:p=[],...d}=i,s=[],c;e||(e=t),typeof o=="string"&&(o=[o]),typeof p=="string"&&(p=[p]);let l,u=f.find(t);u&&(l=`${t}_temp_zoom`,f.editAlias(t,l),u instanceof v||u instanceof P?c=u.positionInfo:c={x:u.x,y:u.y,type:"pixel"}),e=F(t,e,{zIndex:u?u.parent?.getChildIndex(u):void 0}),u?.parent?.setChildIndex(u,u.parent.getChildIndex(u)-.1),l&&f.copyCanvasElementProperty(l,t),l&&f.tickers.transfer(l,t,"move"),c||(e instanceof v||e instanceof P?c=e.positionInfo:c={x:e.x,y:e.y,type:"pixel"});let y={x:e.pivot.x,y:e.pivot.y},x={x:e.scale.x,y:e.scale.y};if(l)if(i.removeOldComponentWithZoomOut){let le=Ge(l,{...i,autoplay:false,completeOnContinue:a},n);le&&(s.push(...le),o.push(...le));}else p.push(l);(e instanceof v||e instanceof P)&&e.haveEmptyTexture&&await e.load(),r==="up"?(e.pivot.y=f.height-e.y,e.pivot.x=f.width/2-e.x,e.y=f.height,e.x=f.width/2):r==="down"?(e.pivot.y=0-e.y,e.pivot.x=f.width/2-e.x,e.y=0,e.x=f.width/2):r==="left"?(e.pivot.x=f.width-e.x,e.pivot.y=f.height/2-e.y,e.x=f.width,e.y=f.height/2):r==="right"&&(e.pivot.x=0-e.x,e.pivot.y=f.height/2-e.y,e.x=0,e.y=f.height/2),e.pivot=h.getPointBySuperPoint(e.pivot,e.angle),e.scale.set(0);let T=f.tickers.pause({canvasAlias:t});o.push(...T);let C=f.animate(t,{...Ie(c),pivotX:y.x,pivotY:y.y,scaleX:x.x,scaleY:x.y},{...d,tickerIdToResume:o,aliasToRemoveAfter:p,completeOnContinue:a},n);if(C&&s.push(C),s.length>0)return s}function Ge(t,e={},i){let{direction:n="right",completeOnContinue:r=true,aliasToRemoveAfter:a=[],...o}=e;typeof a=="string"&&(a=[a]),a.push(t);let p=f.find(t);if(!p){e$1.warn(`The canvas component "${t}" is not found.`);return}let d={x:p.x,y:p.y},s={x:p.pivot.x,y:p.pivot.y};n==="down"?(d.y=f.height,d.x=f.width/2,s.y=f.height-d.y,s.x=f.width/2-d.x):n==="up"?(d.y=0,d.x=f.width/2,s.y=0-d.y,s.x=f.width/2-d.x):n==="right"?(d.x=f.width,d.y=f.height/2,s.x=f.width-d.x,s.y=f.height/2-d.y):n==="left"&&(d.x=0,d.y=f.height/2,s.x=0-d.x,s.y=f.height/2-d.y),s=h.getPointBySuperPoint(s,p.angle),f.tickers.pause({canvasAlias:t});let c=f.animate(t,{...d,pivotX:s.x,pivotY:s.y,scaleX:0,scaleY:0},{...o,aliasToRemoveAfter:a,completeOnContinue:r},i);if(c)return [c]}async function _t(t,e,i={},n){let{direction:r="right",completeOnContinue:a=true,tickerIdToResume:o=[],...p}=i,d=[],s;e||(e=t),typeof o=="string"&&(o=[o]);let c,l=f.find(t);switch(l&&(c=`${t}_temp_push`,f.editAlias(t,c),l instanceof v||l instanceof P?s=l.positionInfo:s={x:l.x,y:l.y,type:"pixel"}),e=F(t,e,{zIndex:l?l.parent?.getChildIndex(l):void 0}),l?.parent?.setChildIndex(l,l.parent.getChildIndex(l)-.1),c&&f.copyCanvasElementProperty(c,t),c&&f.tickers.transfer(c,t,"move"),s||((e instanceof v||e instanceof P)&&e.haveEmptyTexture?s=e.positionInfo:s={x:e.x,y:e.y,type:"pixel"}),(e instanceof v||e instanceof P)&&e.haveEmptyTexture&&await e.load(),r){case "up":e.y=f.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=f.width+e.width;break;case "right":e.x=-e.width;break}let u=f.tickers.pause({canvasAlias:t});if(o.push(...u),c){let x=Ne(c,{...i,direction:r,completeOnContinue:a});x&&d.push(...x);}let y=f.animate(t,Ie(s),{...p,tickerIdToResume:o,completeOnContinue:a},n);if(y&&d.push(y),d.length>0)return d}function Ne(t,e={direction:"right"},i){return ke(t,e,i)}var K=class extends _{constructor(i){super(i);this._memory=i;this.pixivnId=i.pixivnId;}_memory;pixivnId;get memory(){return {...this._memory,...super.memory,elements:[],pixivnId:this.pixivnId}}};function wt(){return async(e,i)=>{try{let n=e.canvasElementInfo;if(n){let r=new K(n),a=n.zIndex;r.groupColor=16711680;let o=new B.Graphics;o.rect(0,0,300,100).fill({color:16711680,alpha:.5}),r.addChild(o);let p=new B.Text({text:`Error: ${n.label}`,x:10,y:10});r.addChild(p);let d=e.parent;if(d&&"addChild"in d)a!==void 0?d.addChildAt(r,a):d.addChild(r);else {let s=n.parentLabel?f.find(n.parentLabel):void 0;if(s)a!==void 0?s.addChildAt(r,a):s.addChild(r);else {let c=n.label??n.pixivnId;f.add(c,r,{zIndex:a});}}}}catch{}}}function Ot(t,e,i){let n={...f.find(t)?.memory,...i},r=new z({text:e,...i});return n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}var {Assets:Mn,Color:_n,Rectangle:wn,TextStyle:On,Texture:Bn,UPDATE_PRIORITY:Ln}=B,f=new G;I.init({getScreen:()=>f.screen});GameUnifier.addOnPreContinue(async()=>{try{let t=g._tickersToCompleteOnStepEnd.tikersIds,e=g._tickersToCompleteOnStepEnd.stepAlias,i=(async()=>{for(;t.length;){let{id:r}=t.pop()||{};r&&await f.tickers.forceCompletion(r);}})(),n=(async()=>{for(;e.length;){let{alias:r,id:a}=e.pop()||{};r&&a&&await f.tickers.forceCompletion(a,r);}})();await Promise.all([i,n]),g._tickersToCompleteOnStepEnd.tikersIds.length=0,g._tickersToCompleteOnStepEnd.stepAlias.length=0;}catch{}});
|
|
2
|
-
export{
|
|
1
|
+
import'./chunk-JMOSOAGB.mjs';import {e,d as d$1,g,b as b$1,c,f,a}from'./chunk-HD353M4B.mjs';import {a as a$1}from'./chunk-S7HZUIEI.mjs';import {d,e as e$1}from'./chunk-AW5XWF24.mjs';import {GameUnifier,PixiError}from'@drincs/pixi-vn/core';import be,{Container,Graphics}from'@drincs/pixi-vn/pixi.js';import {drainCompleteOnStepEndQueue,tickers as tickers$1,removeTicker,TickersManagerStatic,RegisteredTickers,runTickersSequence}from'@drincs/pixi-vn/tickers';export*from'@drincs/pixi-vn/tickers';import {initDevtools}from'@pixi/devtools';import {RegisteredFilters,filters}from'@drincs/pixi-vn/filters';var Jt={extension:{type:"sceneProperties",name:"additional-positions"},testNode(t){return "xAlign"in t||"yAlign"in t||"percentageX"in t||"percentageY"in t||"positionType"in t},testProp(t){switch(t){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(t,e,n){switch(e){case "xAlign":"xAlign"in t&&(t.xAlign=n/100);break;case "yAlign":"yAlign"in t&&(t.yAlign=n/100);break;case "percentageX":"percentageX"in t&&(t.percentageX=n/100);break;case "percentageY":"percentageY"in t&&(t.percentageY=n/100);break}},getProperties(t){return [{value:t.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:t.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:t.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:t.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:t.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},Rt=Jt;function kt(t,e){let n=0;return async(...s)=>{let o=Date.now();if(o-n>=e)return n=o,await t(...s)}}var ie=class t{constructor(){}static _app=void 0;static get app(){if(!t._app)throw e$1.error("The canvas is not initialized"),new PixiError("invalid_usage","CanvasManagerStatic.app is undefined");return t._app}static get gameLayer(){let e=t.app.stage.getChildByLabel(a);return e||(e=new be.Container,e.label=a,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,n,s){let{id:o="pixi-vn-canvas",width:g=800,height:I=600,resolution:R=1,autoDensity:_=true,resizeMode:f="contain",...v}=n||{};return t.canvasWidth=g,t.canvasHeight=I,t._app=new be.Application,t.app.init({width:g,height:I,resolution:R,autoDensity:_,...v}).then(()=>{let{app:A=t.app,extensions:w=[],...H}=s||{};if(initDevtools({app:A,extensions:[Rt,...w],...H}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,o),f==="contain"){let X=kt(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(X).observe(e),t.resize(),setTimeout(()=>t.resize(),750);}t.gameLayer;})}static addCanvasIntoHTMLElement(e,n){t._isInitialized?(e.appendChild(t.app.canvas),t.app.canvas.id=n):e$1.error("GameWindowManager is not initialized");}static addHtmlLayer(e,n,s={}){let{position:o="absolute",pointerEvents:g="none",userSelect:I="none"}=s,R=document.createElement("div");R.setAttribute("id",e),R.style.position=o,R.style.pointerEvents=g,R.style.userSelect=I;let _=n.appendChild(R);return t.htmlLayers.push(R),t.resize(),_}static removeHtmlLayer(e){let n=t.htmlLayers.find(s=>s.id===e);n&&(n.remove(),t.htmlLayers=t.htmlLayers.filter(s=>s.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(n=>n.id===e)}static async resize(){let e=t.canvasWidth,n=t.canvasHeight,s=t.app.resizeTo,o=t.app.canvas.style;s instanceof HTMLElement||(s=document.documentElement);let g,I;if(s===document.body||s===document.documentElement)g=document.documentElement.clientWidth||window.innerWidth,I=document.documentElement.clientHeight||window.innerHeight;else {let w=s.getBoundingClientRect();g=w.width||s.clientWidth,I=w.height||s.clientHeight;}let R=Math.min(g/e,I/n),_=Math.floor(R*e),f=Math.floor(R*n);o.width=`${_}px`,o.height=`${f}px`;let v=(g-_)/2,A=(I-f)/2;o.marginLeft=`${v}px`,o.marginRight=`${v}px`,o.marginTop=`${A}px`,o.marginBottom=`${A}px`,t.htmlLayers.forEach(w=>{w.style.width=`${_}px`,w.style.height=`${f}px`,w.style.marginLeft=`${v}px`,w.style.marginRight=`${v}px`,w.style.marginTop=`${A}px`,w.style.marginBottom=`${A}px`;});}static get childrenAliasesOrder(){return t.gameLayer.children.filter(e=>e.label).sort((e,n)=>t.gameLayer.getChildIndex(e)-t.gameLayer.getChildIndex(n)).map(e=>e.label)}};var ot=Symbol("SerializableEvent"),De=new d({cacheSize:5});function tn(t){return (e,n,s)=>{let o=s.value;at.add(o,t||`${n}`);}}var at;(g=>{function t(I,R){I[ot]=R,De.get(R)&&e$1.info(`Event "${R}" already exists, it will be overwritten`),De.set(R,I);}g.add=t;function e(I){try{let R=De.get(I);if(!R){e$1.error(`Event "${I}" not found, did you forget to register it with the eventDecorator?`);return}return R}catch(R){e$1.error(`Error while getting Event "${I}"`,R);return}}g.get=e;function n(){return Array.from(De.values())}g.values=n;function s(I){return De.has(I)}g.has=s;function o(){return Array.from(De.keys())}g.keys=o;})(at||={});var ct=at;async function Dt(t,e){if("onEvents"in e)for(let n in e.onEvents){let s=e.onEvents[n],o=ct.get(s);o&&t.on(n,o);}}function Ft(t){let{onEventsHandlers:e={}}=t;return e}function Ce(t,e,n){let s=n[ot];return s&&typeof s=="string"?(e.onEventsHandlers[t]=s,true):(e$1.warn(`The event handler for event "${t}" is not registered with the eventDecorator, it will not be saved in the memory and it will not work after loading the game. Please register the event handler with the eventDecorator to avoid this warning. Read more about it here: https://pixi-vn.com/start/canvas-functions#add-a-listener-to-an-event`),false)}var Fe=new d({cacheSize:5}),Lt=new d({cacheSize:2}),Yt=new d({cacheSize:2});function rn(t={}){return e=>{dt.add(e,t);}}async function fe(t,e,n){let s=n?.ignoreScale||false,o=n?.end;if("isRenderGroup"in e&&e.isRenderGroup!==void 0&&(t.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(t.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(t.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(t.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(t.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(t.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(t.rotation=e.rotation),!s&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?t.scale.set(e.scale,e.scale):t.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?t.pivot.set(e.pivot,e.pivot):t.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&t.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&t.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(t.visible=e.visible),"x"in e&&e.x!==void 0&&(t.x=e.x),"y"in e&&e.y!==void 0&&(t.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(t.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(t.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(t.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(t.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(t.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(t.hitArea=e.hitArea),Dt(t,e),"pixivnFilters"in e&&e.pixivnFilters!==void 0){let g=e.pixivnFilters.map(I=>RegisteredFilters.getInstance(I.filterId,I.args)).filter(I=>!!I);t.filters=g.length>0?g:null;}"align"in e&&e.align!==void 0&&"align"in t&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&"percentagePosition"in t&&(t.percentagePosition=e.percentagePosition),o&&await o(),s||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var dt;(R=>{function t(_,f={}){let{name:v=_.name,getInstance:A=async(H,X)=>{let Z=new H;return await Z.setMemory(X),Z},copyProperty:w=async(H,X)=>{await H.setMemory(X);}}=f;Fe.get(v)&&e$1.warn(`CanvasElement "${v}" already registered`),_.prototype.pixivnId=v,Fe.set(v,_),Lt.set(v,A),Yt.set(v,w);}R.add=t;function e(_){let f=Fe.get(_);if(!f){e$1.error(`CanvasElement "${_}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return f}R.get=e;async function n(_,f){let v=e(_),A=Lt.get(_);if(!v||!A){e$1.error(`CanvasElement "${_}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await A(v,f)}catch(w){e$1.error(`Error while getting CanvasElement instance "${_}"`,w);}}R.getInstance=n;async function s(_,f,v){let A=Yt.get(_);if(!A){e$1.error(`CanvasElement "${_}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await A(f,v);}catch(w){e$1.error(`Error while copying properties of CanvasElement "${_}"`,w);}}R.copyProperty=s;function o(){return Array.from(Fe.values())}R.values=o;function g(_){return Fe.has(_)}R.has=g;function I(){return Array.from(Fe.keys())}R.keys=I;})(dt||={});var ae=dt;async function Ve(t){let e=await ae.getInstance(t.pixivnId,t);if(!e)throw new PixiError("unregistered_element",`The element ${t.pixivnId} could not be created`,"canvas",t);return e}function pt(t){return "memory"in t?t.memory:t instanceof be.Text?lt(t):t instanceof be.Sprite?ft(t):we(t)}function an(t){let e=t.parent;return {width:t.width,height:t.height,isRenderGroup:t.isRenderGroup,blendMode:t.blendMode,tint:t.tint,alpha:t.alpha,angle:t.angle,renderable:t.renderable,rotation:t.rotation,scale:{x:t.scale.x,y:t.scale.y},pivot:{x:t.pivot.x,y:t.pivot.y},position:{x:t.position.x,y:t.position.y},skew:{x:t.skew.x,y:t.skew.y},visible:t.visible,x:t.x,y:t.y,boundsArea:t.boundsArea,cursor:t.cursor,eventMode:t.eventMode,interactive:t.interactive,interactiveChildren:t.interactiveChildren,hitArea:t.hitArea,index:e?.getChildIndex(t),parentLabel:e?.label,label:t.label,pixivnFilters:cn(t.filters)}}function cn(t){if(!t)return;let e=Array.isArray(t)?t:[t],n=[];for(let s of e){let o=s.pixivnFilterId;if(!o){e$1.warn("A Filter instance without a registered pixivnFilterId can't be saved and will be skipped. Register it with filterDecorator/RegisteredFilters to make it save-compatible.",s);continue}let g=RegisteredFilters.toMemory(o,s);g&&n.push(g);}return n}function ut(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function we(t,e){let n=dn(t,b$1),o=e?.childrenExport||false?t.children.sort((g,I)=>t.getChildIndex(g)-t.getChildIndex(I)).map(g=>pt(g)):[];return {pixivnId:n,elements:o,onEvents:Ft(t),...an(t)}}function ft(t){let e$1=we(t),n=e$1.pixivnId??e,s="assetsAliases"in t&&Array.isArray(t.assetsAliases)?ut(t.texture,t.assetsAliases[0]):"textureAlias"in t?ut(t.texture,t.textureAlias):ut(t.texture);return {...e$1,pixivnId:n,textureData:s,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function lt(t){let e=we(t),n=e.pixivnId??f;return {...e,pixivnId:n,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:ln(t.style),roundPixels:t.roundPixels}}function dn(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function je(t){switch(t.type){case "linear":return {type:"linear",colorStops:t.colorStops,end:{x:t.end.x,y:t.end.y},start:{x:t.start.x,y:t.start.y},textureSpace:t.textureSpace,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height};case "radial":return {type:"radial",colorStops:t.colorStops,textureSpace:t.textureSpace,center:{x:t.center.x,y:t.center.y},innerRadius:t.innerRadius,outerCenter:{x:t.outerCenter.x,y:t.outerCenter.y},outerRadius:t.outerRadius,rotation:t.rotation,scale:t.scale,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height}}}function un(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof be.FillGradient)return je(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof be.FillPattern))return je(t.fill)}}e$1.warn("Unsupported property type for Text.style.fill.",t);}}function pn(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof be.Color)return t.toNumber();e$1.warn("Unsupported color type.",t);}function fn(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof be.FillGradient)return je(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:pn(t.color),join:t.join,miterLimit:t.miterLimit,width:t.width,cap:t.cap,pixelLine:t.pixelLine,textureSpace:t.textureSpace};if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof be.FillPattern))return je(t.fill)}}e$1.warn("Unsupported property type for Text.style.stroke.",t);}}function ln(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:un(t.fill),fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontVariant:t.fontVariant,fontWeight:t.fontWeight,leading:t.leading,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,padding:t.padding,stroke:fn(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}var Ye=class{tickersPausedByGameLayerRender=[];get app(){return ie.app}get gameLayer(){return ie.gameLayer}get isInitialized(){return ie._isInitialized}get width(){return ie.canvasWidth}get height(){return ie.canvasHeight}get screen(){return this.app.screen}async init(e,n,s){return await ie.init(e,n,s)}get children(){return ie.gameLayer.children}async copyCanvasElementProperty(e,n,s={}){let o=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:g=_=>_}=s;if(typeof n=="string"){let _=this.find(n);if(_)n=_;else {e$1.error(`Canvas element ${n} not found`);return}}if(typeof e=="string"){let _=this.find(e);if(_)e=_;else {e$1.error(`Canvas element ${e} not found`);return}}e instanceof be.Container&&(e=e.memory);let I=g(o),R={...e};I.forEach(_=>{_ in R&&delete R[_];}),await ae.copyProperty(n.pixivnId,n,R);}add(e,n,s={}){if(e===a){e$1.error(`The alias ${a} is reserved`);return}let o=this.find(e),g=s?.ignoreOldStyle;o&&!g&&this.copyCanvasElementProperty(o,n);let{zIndex:I=o?.parent?.getChildIndex(o)}=s;o&&!this.canvasElementIsOnCanvas(o)?e$1.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):o&&this.remove(e,{ignoreTickers:true}),I!==void 0?(n.label=e,this.gameLayer.addChildAt(n,I)):(n.label=e,this.gameLayer.addChild(n));}remove(e,n={}){if(e===a){e$1.error(`The alias ${a} is reserved`);return}let s=n.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(o=>{this.gameLayer.getChildrenByLabel(o).forEach(g=>{this.gameLayer.removeChild(g),!s&&tickers$1.unlinkComponent(o);});});}find(e){if(e===a)return this.gameLayer;let n=this.gameLayer.getChildByLabel(e);if(n)return n}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,n,s={}){let o=this.find(e);o&&(o.label=n),!s.ignoreTickers&&tickers$1.transfer(e,n,"move");}get currentTickers(){return this.tickers.currentTickers}get currentTickersSteps(){return this.tickers.currentTickersSteps}findTicker(e){return tickers$1.find(e)}addTicker(e,n){return tickers$1.add(e,n)}addTickersSequence(e,n,s=0){return tickers$1.addSequence(e,n,s)}onTickerComplete(e,n){return tickers$1.onComplete(e,n)}unlinkComponentFromTicker(e,n){return tickers$1.unlinkComponent(e,n)}removeAllTickers(){return tickers$1.removeAll()}removeTicker(e,n={stopTicker:true}){return removeTicker(e,n)}pauseTicker(e){return tickers$1.pause(e)}resumeTicker(e){return tickers$1.resume(e)}isTickerPaused(e,n){return tickers$1.isPaused(e,n)}pause(){this.gameLayer.renderable!==false&&(this.gameLayer.renderable=false,this.tickersPausedByGameLayerRender=tickers$1.pause({id:Array.from(TickersManagerStatic._currentTickers.keys())}));}resume(){if(this.gameLayer.renderable===true)return;this.gameLayer.renderable=true;let e=this.tickersPausedByGameLayerRender.filter(n=>TickersManagerStatic._currentTickers.has(n));e.length>0&&tickers$1.resume({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,n,s="move"){return tickers$1.transfer(e,n,s)}completeTickerOnStepEnd(e){return tickers$1.completeOnStepEnd(e)}async forceCompletionOfTicker(e,n){return tickers$1.forceCompletion(e,n)}tickers=tickers$1;animate(e,n,s,o){return GameUnifier.animate(e,n,s,o)}addLayerInternal(e,n){if(e===a){e$1.error(`The alias ${a} is reserved`);return}return n.label=e,ie.app.stage.addChild(n)}getLayerInternal(e){return ie.app.stage.getChildByLabel(e)}removeLayerInternal(e){let n=ie.app.stage.getChildByLabel(e);n&&ie.app.stage.removeChild(n);}addHtmlLayerInternal(e,n,s){return ie.addHtmlLayer(e,n,s)}removeHtmlLayerInternal(e){return ie.removeHtmlLayer(e)}getHtmlLayerInternal(e){return ie.getHtmlLayer(e)}addLayer(e,n){return this.addLayerInternal(e,n)}getLayer(e){return this.getLayerInternal(e)}removeLayer(e){return this.removeLayerInternal(e)}addHtmlLayer(e,n,s){return this.addHtmlLayerInternal(e,n,s)}removeHtmlLayer(e){return this.removeHtmlLayerInternal(e)}getHtmlLayer(e){return this.getHtmlLayerInternal(e)}layers={get gameLayer(){return ie.gameLayer},add:(e,n)=>this.addLayerInternal(e,n),get:e=>this.getLayerInternal(e),remove:e=>this.removeLayerInternal(e)};htmlLayers={add:(e,n,s)=>this.addHtmlLayerInternal(e,n,s),get:e=>this.getHtmlLayerInternal(e),remove:e=>this.removeHtmlLayerInternal(e)};async extractImage(){let e=this.gameLayer.renderable===false;e&&this.resume();let n;try{n=this.app.renderer.extract.image(this.app.stage);}finally{e&&this.pause();}return (await n).src}clear(){this.tickersPausedByGameLayerRender=[],tickers$1.removeAll(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let n={};return this.children.forEach(s=>{s.label&&(n[s.label]=pt(s));}),{tickers:a$1(TickersManagerStatic.currentTickersWithoutCreatedBySteps()),tickersSteps:a$1(TickersManagerStatic.currentTickersSequence()),elements:a$1(n),stage:a$1(we(this.gameLayer)),elementAliasesOrder:a$1(ie.childrenAliasesOrder),tickersToCompleteOnStepEnd:a$1(TickersManagerStatic._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let n=e.elementAliasesOrder,s={},o=Object.entries(e.elements).map(async([g,I])=>{s[g]=await Ve(I);});await Promise.all(o),n.forEach(g=>{let I=s[g];I&&this.add(g,I);});}else {e$1.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?fe(this.gameLayer,e.stage,{ignoreScale:!0}):e$1.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let n=e.tickers;Object.entries(n).forEach(([s,o])=>{let g=o.canvasElementAliases;if(g.length!==0){let I=RegisteredTickers.getInstance(o.id,o.args,{duration:o.duration,priority:o.priority,id:s,canvasElementAliases:g});I?(I.canvasElementAliases=g,tickers$1.add(g,I),o.paused&&I.pause()):e$1.error(`Ticker ${o.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let n=e.tickersSteps;Object.entries(n).forEach(([s,o])=>{TickersManagerStatic._currentTickersSequence.set(s,new Map(Object.entries(o))),Object.keys(o).forEach(g=>{runTickersSequence(s,g);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let n=e.tickersToCompleteOnStepEnd,s=n.tikersIds,o=n.stepAlias.map(g=>({id:g.id,alias:g.alias}));TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.length=0,TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.push(...s),TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.length=0,TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.push(...o);}}catch(n){e$1.error("Error importing data",n);}}};var oe=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};var b;(_=>{function t(f,v,A,w,H,X=0){return H?f==="width"?v*(oe.screen.width-A)+A-w-X*A:v*(oe.screen.height-A)+A-w-X*A:f==="width"?v*(oe.screen.width-A)+w+X*A:v*(oe.screen.height-A)+w+X*A}_.calculatePositionByAlign=t;function e(f,v,A,w,H,X=0){return H?f==="width"?(v-A+w+X*A)/(oe.screen.width-A):(v-A+w+X*A)/(oe.screen.height-A):f==="width"?(v-w-X*A)/(oe.screen.width-A):(v-w-X*A)/(oe.screen.height-A)}_.calculateAlignByPosition=e;function n(f,v){return f==="width"?v*oe.screen.width:v*oe.screen.height}_.calculatePositionByPercentagePosition=n;function s(f,v){return f==="width"?v/oe.screen.width:v/oe.screen.height}_.calculatePercentagePositionByPosition=s;function o(f,v){if(v=v%360,v<0&&(v+=360),v===0)return {x:f.x,y:f.y};if(v===90)return {x:-f.y,y:f.x};if(v===180)return {x:-f.x,y:-f.y};if(v===270)return {x:f.y,y:-f.x};if(v>0&&v<90){let A=v*Math.PI/180,w=Math.cos(A),H=Math.sin(A),X=f.x*w-f.y*H,Z=f.x*H+f.y*w;return f.x!==0&&Math.sign(X)!==Math.sign(f.x)&&(X=-X),f.y!==0&&Math.sign(Z)!==Math.sign(f.y)&&(Z=-Z),{x:X,y:Z}}else if(v>90&&v<180){let A=(v-90)*Math.PI/180,w=Math.cos(A),H=Math.sin(A),X=-f.y*H-f.x*w,Z=f.y*w-f.x*H;return f.x!==0&&Math.sign(X)!==Math.sign(f.x)&&(X=-X),f.y!==0&&Math.sign(Z)!==Math.sign(f.y)&&(Z=-Z),{x:X,y:Z}}else if(v>180&&v<270){let A=(v-180)*Math.PI/180,w=Math.cos(A),H=Math.sin(A),X=-f.x*w+f.y*H,Z=-f.x*H-f.y*w;return f.x!==0&&Math.sign(X)!==Math.sign(f.x)&&(X=-X),f.y!==0&&Math.sign(Z)!==Math.sign(f.y)&&(Z=-Z),{x:X,y:Z}}else if(v>270&&v<360){let A=(v-270)*Math.PI/180,w=Math.cos(A),H=Math.sin(A),X=f.y*H-f.x*w,Z=-f.y*w-f.x*H;return f.x!==0&&Math.sign(X)!==Math.sign(f.x)&&(X=-X),f.y!==0&&Math.sign(Z)!==Math.sign(f.y)&&(Z=-Z),{x:X,y:Z}}return {x:0,y:0}}_.getSuperPoint=o;function g(f,v){if(v=v%360,v<0&&(v+=360),v===0)return {x:f.x,y:f.y};if(v===90)return {x:f.y,y:-f.x};if(v===180)return {x:-f.x,y:-f.y};if(v===270)return {x:-f.y,y:f.x};if(v>0&&v<90){let A=v*Math.PI/180,w=Math.cos(A),H=Math.sin(A);return {x:f.x*w+f.y*H,y:-f.x*H+f.y*w}}else if(v>90&&v<180){let A=(v-90)*Math.PI/180,w=Math.cos(A),H=Math.sin(A);return {x:f.y*w-f.x*H,y:-f.y*H-f.x*w}}else if(v>180&&v<270){let A=(v-180)*Math.PI/180,w=Math.cos(A),H=Math.sin(A);return {x:-f.x*w-f.y*H,y:f.x*H-f.y*w}}else if(v>270&&v<360){let A=(v-270)*Math.PI/180,w=Math.cos(A),H=Math.sin(A);return {x:-f.y*w+f.x*H,y:f.y*H+f.x*w}}return {x:0,y:0}}_.getPointBySuperPoint=g;function I(f){let v=f.width,A=f.height,w=f.angle%360;return w<0&&(w+=360),w===0||w===180?v:w===90||w===270?A:Math.abs(v*Math.cos(w*Math.PI/180))+Math.abs(A*Math.sin(w*Math.PI/180))}_.getSuperWidth=I;function R(f){let v=f.width,A=f.height,w=f.angle%360;return w<0&&(w+=360),w===0||w===180?A:w===90||w===270?v:Math.abs(A*Math.cos(w*Math.PI/180))+Math.abs(v*Math.sin(w*Math.PI/180))}_.getSuperHeight=R;})(b||={});async function ze(t){if(t!=="EMPTY"){if(!t)throw e$1.error("Texture not found",t),new PixiError("unregistered_asset","Texture not found");if(be.Assets.cache.has(t)){let e=be.Assets.get(t);if(e)return e}return be.Assets.load(t).then(e=>{if(!e)throw e$1.error("Texture not found",t),new PixiError("unregistered_asset","Texture not found");if(!(e instanceof be.Texture))throw e$1.error("File is not a Texture",t),new PixiError("unregistered_asset","File is not a Texture");return e}).catch(e=>{throw e$1.error("Error loading file",e),new PixiError("unknown_element","Error loading file")})}}function ge(t){return t&&(typeof t.align!="number"&&(t.xAlign!==void 0&&(t.align===void 0?(t.align={x:t.xAlign},delete t.xAlign):(t.align.x=t.xAlign,delete t.xAlign)),t.yAlign!==void 0&&(t.align===void 0?(t.align={y:t.yAlign},delete t.yAlign):(t.align.y=t.yAlign,delete t.yAlign))),typeof t.percentagePosition!="number"&&(t.percentageX!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={x:t.percentageX},delete t.percentageX):(t.percentagePosition.x=t.percentageX,delete t.percentageX)),t.percentageY!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={y:t.percentageY},delete t.percentageY):(t.percentagePosition.y=t.percentageY,delete t.percentageY))),t)}var Ae=class t extends be.Sprite{constructor(e$1){if(e$1 instanceof be.Texture)super(e$1);else {let{align:n,percentagePosition:s,...o}=ge(e$1)||{};super(o),n&&(this.align=n),s&&(this.percentagePosition=s);}this.pixivnId=this.constructor.prototype.pixivnId||e;}pixivnId=e;get memory(){return {...ft(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await Ze(this,e)}static from(e,n){let s=be.Sprite.from(e,n),o=new t;return o.texture=s.texture,o}onEventsHandlers={};on(e,n,s){return Ce(e,this,n),super.on(e,(...o)=>n(...o,this),s)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return {x:b.calculateAlignByPosition("width",this.x,b.getSuperWidth(this),e.x,n.x<0,this.anchor.x),y:b.calculateAlignByPosition("height",this.y,b.getSuperHeight(this),e.y,n.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("width",this.x,b.getSuperWidth(this),e.x,n.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("height",this.y,b.getSuperHeight(this),e.y,n.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:b.calculatePercentagePositionByPosition("width",this.x),y:b.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return b.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return b.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=b.calculatePositionByAlign("width",this._align.x,b.getSuperWidth(this),e.x,n.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=b.calculatePositionByAlign("height",this._align.y,b.getSuperHeight(this),e.y,n.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=b.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=b.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};ae.add(Ae,{name:e,copyProperty:async(t,e)=>{await Ze(t,e,{ignoreTexture:true});}});async function Ze(t,e,n){e=ge(e);let s=n?.ignoreTexture||false;if(await fe(t,e),!s){let g;if("textureData"in e&&e.textureData&&(g=e.textureData),g&&g.url!=="EMPTY"){let I=g.url;g.alias&&be.Assets.resolver.hasKey(g.alias)&&(I=g.alias);try{let R=await ze(I);R&&(t.texture=R);}catch(R){e$1.error("Error in Sprite.setMemorySprite() while loading texture"),R=new PixiError("unregistered_asset",`Error loading image ${I}`,"canvas",e),GameUnifier.runOnError(R,{});}}}let o=n?.half;o&&await o(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}var q=class t extends Ae{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=d$1;constructor(e,n){super(e),n&&(this._textureAlias=n);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loadIsStarted:this._loadIsStarted}}async setMemory(e){let n;"textureData"in e&&e.textureData&&(n=e.textureData),"assetsData"in e&&Array.isArray(e.assetsData)&&e.assetsData.length>0&&(n=e.assetsData[0]),n&&n.alias&&(this._textureAlias=n.alias),await Je(this,e),this.reloadPosition();}static from(e,n){let s=be.Sprite.from(e,n),o=new t;return o.texture=s.texture,o}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,ze(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,e$1.error("Error into ImageSprite.load()"),e=new PixiError("unregistered_asset",`Error loading image ${this.textureAlias}`,"canvas",{...this.memory,label:this.textureAlias},this),GameUnifier.runOnError(e,{});})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}};ae.add(q,{name:d$1,copyProperty:async(t,e)=>{await Je(t,e,{ignoreTexture:true});}});async function Je(t,e,n){return await Ze(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:n?.ignoreTexture})}var xe=class t extends q{constructor(e,n){if(e instanceof be.Texture){super(e,n);return}let{loop:s,paused:o,currentTime:g,...I}=e||{};super(I,n),s&&(this.loop=s),o&&(this.paused=o),g&&(this.currentTime=g);}pixivnId=g;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await Ht(this,e),this.reloadPosition();}static from(e,n){let s=be.Sprite.from(e,n),o=new t;return o.texture=s.texture,o}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource?.play&&typeof this.texture.source.resource.play=="function"&&this.texture.source.resource.play();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let n=this.duration;n&&e>=n&&(e=0),this._currentTime=e,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=e);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};ae.add(xe,{name:g,getInstance:async(t,e)=>{let n;"textureData"in e&&e.textureData&&(n=e.textureData);let s=new t(void 0,n?.alias);return await s.setMemory(e),s},copyProperty:async(t,e)=>{await Ht(t,e,{ignoreTexture:true});}});async function Ht(t,e,n){await Je(t,e,{ignoreTexture:n?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(t.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(t.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(t.paused=e.paused);}var me=class extends Container{constructor(e){let{anchor:n,align:s,percentagePosition:o,...g}=ge(e)||{};super(g),this.pixivnId=this.constructor.prototype.pixivnId||b$1,n&&(this.anchor=n),s&&(this.align=s),o&&(this.percentagePosition=o);}pixivnId=b$1;get memory(){return {...we(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await fe(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let n=0;n<e.elements.length;n++){let s=e.elements[n],o=await Ve(s);this.addChild(o);}}onEventsHandlers={};on(e,n,s){return Ce(e,this,n),super.on(e,(...o)=>n(...o,this),s)}_anchor;get anchor(){let e=super.pivot.x/this.width,n=super.pivot.y/this.height;return {x:e,y:n}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(e){this._anchor=void 0,super.pivot=e;}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return {x:b.calculateAlignByPosition("width",this.x,b.getSuperWidth(this),e.x,n.x<0),y:b.calculateAlignByPosition("height",this.y,b.getSuperHeight(this),e.y,n.y<0)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("width",this.x,b.getSuperWidth(this),e.x,n.x<0)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("height",this.y,b.getSuperHeight(this),e.y,n.y<0)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:b.calculatePercentagePositionByPosition("width",this.x),y:b.calculatePercentagePositionByPosition("height",this.y)}}set percentageX(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageX(){return b.calculatePercentagePositionByPosition("width",this.x)}set percentageY(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get percentageY(){return b.calculatePercentagePositionByPosition("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=b.calculatePositionByAlign("width",this._align.x,b.getSuperWidth(this),e.x,n.x<0)),this._align.y!==void 0&&(super.y=b.calculatePositionByAlign("height",this._align.y,b.getSuperHeight(this),e.y,n.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=b.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=b.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};ae.add(me,{name:b$1,copyProperty:async(t,e)=>await fe(t,e)});var wn=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function He(t){let e=be.Assets.cache.has(t)?be.Assets.get(t):null;return e instanceof be.Texture&&(t=e.source?.label||t),An(t)}function An(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&wn.has(e)}var J=class extends me{constructor(e,n){let{anchor:s,align:o,percentagePosition:g,...I}=ge(e)||{};super(I),n&&n.forEach(R=>{He(R)?this.addChild(new xe(void 0,R)):this.addChild(new q(void 0,R));}),s&&(this.anchor=s),o&&(this.align=o),g&&(this.percentagePosition=g);}get memory(){return {...super.memory,pixivnId:c,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await Ut(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=c;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=this.children.map(n=>n.load());return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(n=>{this._loadIsStarted=false,e$1.error("Error into ImageContainer.load()",n);})}get texture(){return this.children.length>0?this.children[0].texture:new be.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};ae.add(J,{name:c,copyProperty:async(t,e)=>await Ut(t,e)});async function Ut(t,e){e=ge(e)||{},fe(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var Qe=class{constructor(...e){}get memory(){throw new PixiError("not_implemented","The method CanvasBaseItem.memory must be overridden")}setMemory(e){throw new PixiError("not_implemented","The method CanvasBaseItem.setMemory must be overridden")}pixivnId="canvas_element_id_not_set"};var Se=class extends be.Text{constructor(e){let{align:n,percentagePosition:s,...o}=ge(e)||{};super(o),this.pixivnId=this.constructor.prototype.pixivnId||f,n&&(this.align=n),s&&(this.percentagePosition=s);}pixivnId=f;get memory(){return {...lt(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await En(this,e),this.reloadPosition();}onEventsHandlers={};on(e,n,s){return Ce(e,this,n),super.on(e,(...o)=>n(...o,this),s)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return {x:b.calculateAlignByPosition("width",this.x,b.getSuperWidth(this),e.x,n.x<0,this.anchor.x),y:b.calculateAlignByPosition("height",this.y,b.getSuperHeight(this),e.y,n.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("width",this.x,b.getSuperWidth(this),e.x,n.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("height",this.y,b.getSuperHeight(this),e.y,n.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:b.calculatePercentagePositionByPosition("width",this.x),y:b.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return b.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return b.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=b.calculatePositionByAlign("width",this._align.x,b.getSuperWidth(this),e.x,n.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=b.calculatePositionByAlign("height",this._align.y,b.getSuperHeight(this),e.y,n.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=b.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=b.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};ae.add(Se,{name:f});async function En(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await fe(t,e,{end:()=>{"style"in e&&e.style!==void 0&&(t.style=e.style);}}),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"resolution"in e&&e.resolution!==void 0&&(t.resolution=e.resolution),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}function Ue(t,e,n){let s=[0],o=t;for(let g=0;g<n;g++)s.push(o,-o*.6,o*.3,0),o*=e;return s}function Xt(t,e,n,s){let o=n.reduce((v,A)=>A.enabled?v+A.padding:v,0),g=t.x,I=t.y,R=t.x+t.width,_=t.y+t.height;s&&(g=Math.max(g,0),I=Math.max(I,0),R=Math.min(R,s.width),_=Math.min(_,s.height));let f={x:g-o,y:I-o,width:R-g+o*2,height:_-I+o*2};return {x:t.x+e.x*t.width-f.x,y:t.y+e.y*t.height-f.y,area:f}}function gt(t,e,n,s){return Math.max(0,Math.ceil(e-Math.min(t.x,t.y,n-t.x,s-t.y)))}function et(t,e,n,s){let o=Math.min(Math.max(e,0),.5),g=Math.hypot(Math.max(t.x,n-t.x),Math.max(t.y,s-t.y));return Math.ceil(g*o/(1-o))}function tt(t,e,n,s){return s>0?s:Math.hypot(Math.max(t.x,e.width-t.x),Math.max(t.y,e.height-t.y))+n/2}function mt(t){let e=t.filters;return e?Array.isArray(e)?[...e]:[e]:[]}function Rn(t,e){t.filters=[...mt(t),...e];}function kn(t,e){let n=mt(t).filter(s=>!e.includes(s));t.filters=n.length>0?n:null;}function ee(t,e,n,s,o,g){Rn(e,[n]);let I=filters.animate(t,n,s,{duration:o.duration??1,delay:o.delay,ease:o.ease,times:o.times,aliasToRemoveAfter:o.aliasToRemoveAfter,autoplay:o.autoplay},g,void 0,()=>{kn(e,[n]),n.destroy();});return I&&(o.completeOnContinue??true)&&tickers$1.completeOnStepEnd({id:I}),I}function ve(t,e){let n;try{n=u.screen;}catch{n=void 0;}return Xt(t.getBounds(),e,mt(t),n)}async function Bn(t,e={},n){return yt.shakeEffect(t,e,n)}function $t(t){switch(t){case "up":return {axis:"y",sign:-1};case "down":return {axis:"y",sign:1};case "left":return {axis:"x",sign:-1};default:return {axis:"x",sign:1}}}function nt(t,e,n){let s=[0],o=t;for(let g=0;g<n;g++)s.push(g%2===0?o:-o,0),o*=e;return s}function Le(t,e,n,s){let o=[t],g=e;for(let I=0;I<s;I++)o.push(t+g,t),g*=n;return o}var yt;(Xe=>{async function t(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the shake effect can't be applied.`);return}let k={x:M.position.x,y:M.position.y},{shakeType:U="horizontal",maxShockSize:$=10,shocksNumber:j=10,...L}=K,D=j-1;if(D<2){e$1.error("The number of shocks must be at least 3.");return}let W=Math.floor(D/2),Y=Math.ceil(D/2),F=[];for(let N=0;N<W;N++){let te=$*(N+1)/W;U==="horizontal"?N%2!==0?F.push(k.x+te):F.push(k.x-te):N%2!==0?F.push(k.y+te):F.push(k.y-te);}let G=W%2===0;for(let N=Y;N>0;N--){let te=$*(N+1)/(Y-1);U==="horizontal"?N%2===0&&!G||N%2!==0&&G?F.push(k.x-te):F.push(k.x+te):N%2===0&&!G||N%2!==0&&G?F.push(k.y-te):F.push(k.y+te);}let Q;if(U==="horizontal"?(F.push(k.x),Q=u.animate(O,{x:F},L,V)):(F.push(k.y),Q=u.animate(O,{y:F},L,V)),Q)return [Q]}Xe.shakeEffect=t;async function e(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the bounce effect can't be applied.`);return}let{direction:k="up",distance:U=30,bounces:$=4,decay:j=.5,...L}=K,{axis:D,sign:W}=$t(k),Y=D==="x"?M.position.x:M.position.y,F=[Y],G=U;for(let N=0;N<$;N++)F.push(Y+W*G,Y),G*=j;let Q=u.animate(O,{[D]:F},L,V);if(Q)return [Q]}Xe.bounceEffect=e;async function n(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the pulse effect can't be applied.`);return}let{scale:k=1.2,pulses:U=3,decay:$=.6,...j}=K,L=M.scale.x,D=M.scale.y,W=[L],Y=[D],F=k-1;for(let Q=0;Q<U;Q++)W.push(L*(1+F),L),Y.push(D*(1+F),D),F*=$;let G=u.animate(O,{scaleX:W,scaleY:Y},j,V);if(G)return [G]}Xe.pulseEffect=n;async function s(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the hop effect can't be applied.`);return}let{direction:k="up",distance:U=40,secondaryHops:$=0,decay:j=.5,...L}=K,{axis:D,sign:W}=$t(k),Y=D==="x"?M.position.x:M.position.y,F=[Y],G=U;for(let N=0;N<1+$;N++)F.push(Y+W*G,Y),G*=j;let Q=u.animate(O,{[D]:F},L,V);if(Q)return [Q]}Xe.hopEffect=s;async function o(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the wiggle effect can't be applied.`);return}let{angle:k=15,repetitions:U=3,decay:$=.5,...j}=K,L=M.rotation,D=k*Math.PI/180,W=nt(D,$,U).map(F=>L+F),Y=u.animate(O,{rotation:W},j,V);if(Y)return [Y]}Xe.wiggleEffect=o;async function g(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the nod effect can't be applied.`);return}let{axis:k="horizontal",distance:U=15,repetitions:$=3,decay:j=.5,...L}=K,D=k==="horizontal"?"x":"y",W=k==="horizontal"?M.position.x:M.position.y,Y=nt(U,j,$).map(G=>W+G),F=u.animate(O,{[D]:Y},L,V);if(F)return [F]}Xe.nodEffect=g;async function I(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the sway effect can't be applied.`);return}let{axis:k="horizontal",distance:U=10,angle:$=5,repetitions:j=3,decay:L=0,ease:D="easeInOut",...W}=K,Y=k==="horizontal"?"x":"y",F=k==="horizontal"?M.position.x:M.position.y,G=M.rotation,Q=$*Math.PI/180,N=nt(U,L||1,j).map(ce=>F+ce),te=nt(Q,L||1,j).map(ce=>G+ce),ue=u.animate(O,{[Y]:N,rotation:te},{ease:D,...W},V);if(ue)return [ue]}Xe.swayEffect=I;async function R(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the punch effect can't be applied.`);return}let{mode:k="scale",strength:U=.3,overshoot:$=.3,...j}=K,L;if(k==="scale"){let D=W=>[W,W*(1+U),W*(1-U*$),W];L=u.animate(O,{scaleX:D(M.scale.x),scaleY:D(M.scale.y)},j,V);}else {let D=k==="rotation"?M.rotation:k==="x"?M.position.x:M.position.y,W=k==="rotation"?U*Math.PI/180:U,Y=[D,D+W,D-W*$,D];L=u.animate(O,{[k]:Y},j,V);}if(L)return [L]}Xe.punchEffect=R;async function _(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the glitch effect can't be applied.`);return}let{strength:k=40,bursts:U=3,slices:$=8,direction:j=0,rgbSplit:L=6,decay:D=.5,ease:W="linear",...Y}=K,F=new filters.GlitchFilter({slices:$,direction:j,offset:0});F.refresh(),F.padding=Math.ceil(Math.abs(k));let G=[],Q=ee(O,M,F,{offset:Ue(k,D,U)},{ease:W,...Y},V);if(Q&&G.push(Q),L!==0){let N=Ue(L,D,U),te=new filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});te.padding=Math.ceil(Math.abs(L));let ue=ee(O,M,te,{redX:N,blueX:N.map(ce=>-ce)},{ease:W,...Y},V);ue&&G.push(ue);}if(G.length>0)return G}Xe.glitchEffect=_;async function f(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the chromatic aberration effect can't be applied.`);return}let{strength:k=8,axis:U="horizontal",bursts:$=1,decay:j=.5,...L}=K,D=new filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});D.padding=Math.ceil(Math.abs(k));let W=U==="horizontal"?"redX":"redY",Y=U==="horizontal"?"blueX":"blueY",F={[W]:Le(0,k,j,$),[Y]:Le(0,-k,j,$)},G=ee(O,M,D,F,L,V);if(G)return [G]}Xe.chromaticAberrationEffect=f;async function v(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the shockwave effect can't be applied.`);return}let{origin:k={x:.5,y:.5},amplitude:U=30,wavelength:$=160,brightness:j=1,radius:L=-1,speed:D=500,strength:W,...Y}=K,{width:F,height:G}=M.getBounds(),Q=W??tt({x:k.x*F,y:k.y*G},{width:F,height:G},$,L)/D,N=new filters.ShockwaveFilter({center:{x:0,y:0},amplitude:U,wavelength:$,brightness:j,radius:L,speed:D,time:0});N.padding=Math.ceil(Math.abs(U)*1.25);let te=ee(O,M,N,{time:[0,Q]},Y,V),{x:ue,y:ce}=ve(M,k);if(N.center={x:ue,y:ce},te)return [te]}Xe.shockwaveEffect=v;async function A(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the radial blur effect can't be applied.`);return}let{strength:k=.5,bursts:U=1,origin:$={x:.5,y:.5},innerRadius:j=0,radius:L=-1,decay:D=.5,...W}=K,Y=new filters.ZoomBlurFilter({center:{x:0,y:0},innerRadius:j,radius:L,strength:0}),{width:F,height:G}=M.getBounds();Y.padding=et({x:$.x*F,y:$.y*G},k,F,G);let Q=Le(0,k,D,U),N=ee(O,M,Y,{strength:Q},W,V),{x:te,y:ue}=ve(M,$);if(Y.center={x:te,y:ue},N)return [N]}Xe.radialBlurEffect=A;async function w(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the blur pulse effect can't be applied.`);return}let{strength:k=8,pulses:U=3,quality:$,decay:j=.5,...L}=K,D=new filters.BlurFilter({strength:0,quality:$}),W=Le(0,k,j,U),Y=ee(O,M,D,{strength:W},L,V);if(Y)return [Y]}Xe.blurPulseEffect=w;async function H(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the vignette pulse effect can't be applied.`);return}let{strength:k=1,pulses:U=1,radius:$=.5,blur:j=.5,decay:L=.5,...D}=K,W=new filters.CRTFilter({curvature:0,lineWidth:0,lineContrast:0,noise:0,vignetting:$,vignettingBlur:j,vignettingAlpha:0}),Y=Le(0,k,L,U),F=ee(O,M,W,{vignettingAlpha:Y},D,V);if(F)return [F]}Xe.vignettePulseEffect=H;async function X(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the desaturate effect can't be applied.`);return}let{amount:k=0,duration:U=1,holdDuration:$=0,...j}=K,L=U*2+$,D=[0,U/L,(U+$)/L,1],W=new filters.AdjustmentFilter({saturation:1}),Y=ee(O,M,W,{saturation:[1,k,k,1]},{...j,duration:L,times:D},V);if(Y)return [Y]}Xe.desaturateEffect=X;async function Z(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the glow pulse effect can't be applied.`);return}let{strength:k=4,pulses:U=3,color:$=16777215,distance:j=10,innerStrength:L=0,decay:D=.5,...W}=K,Y=new filters.GlowFilter({outerStrength:0,innerStrength:L,distance:j,color:$}),F=Le(0,k,D,U),G=ee(O,M,Y,{outerStrength:F},W,V);if(G)return [G]}Xe.glowPulseEffect=Z;})(yt||={});function Oe(t){let e=t.getLocalBounds();return {x:e.x,y:e.y,width:e.width,height:e.height}}function xt(t,e){return e.graphics||(e.graphics=new Graphics,t.parent?.addChild(e.graphics),t.mask=e.graphics),Fn(t,e.graphics),e.graphics}function Fn(t,e){e.position.copyFrom(t.position),e.scale.copyFrom(t.scale),e.pivot.copyFrom(t.pivot),e.skew.copyFrom(t.skew),e.rotation=t.rotation;}function Ln(t,e){e.graphics&&(t.mask=null,e.graphics.parent?.removeChild(e.graphics),e.graphics.destroy({children:true}),e.graphics=void 0);}function Pt(t,e,n,s){let o=e.invert?1-n:n,{bounds:g}=e,I=xt(t,s),R=g.x+g.width/2,_=g.y+g.height/2,f=Math.sqrt(g.width**2+g.height**2)||1,v=Math.max(o,0)*f*2,A=e.angle*Math.PI/180;if(I.clear(),v>0){let w=Math.cos(-A),H=Math.sin(-A),X=[[-f,-f],[-f+v,-f],[-f+v,f],[-f,f]].flatMap(([Z,Xe])=>[R+Z*w-Xe*H,_+Z*H+Xe*w]);I.poly(X).fill(16777215);}}function vt(t,e,n,s){let o=e.invert?1-n:n,{bounds:g}=e,I=xt(t,s),R=g.x+g.width*e.originX,_=g.y+g.height*e.originY,f=Math.max(R-g.x,g.x+g.width-R),v=Math.max(_-g.y,g.y+g.height-_),A=Math.sqrt(f**2+v**2)||1,w=Math.max(o,0)*A,H=e.aspect>0?e.aspect:1;I.clear(),w>0&&I.ellipse(R,_,w*H,w).fill(16777215);}function It(t,e,n,s){let g=1-(e.invert?1-n:n),{bounds:I}=e,R=xt(t,s);if(R.clear(),e.orientation==="horizontal"){let _=I.x+I.width*e.origin,f=_-I.x,v=I.x+I.width-_,A=I.x-g*f,w=_+g*v;f>0&&R.rect(A,I.y,f,I.height).fill(16777215),v>0&&R.rect(w,I.y,v,I.height).fill(16777215);}else {let _=I.y+I.height*e.origin,f=_-I.y,v=I.y+I.height-_,A=I.y-g*f,w=_+g*v;f>0&&R.rect(I.x,A,I.width,f).fill(16777215),v>0&&R.rect(I.x,w,I.width,v).fill(16777215);}}function Gt(t,e,n){switch(e.kind){case "wipe":case "iris":case "split":Ln(t,n);break}}function it(t,e,n){let s={...u.find(t)?.memory,...n},o=new J(n,e);return s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}async function Yn(t,e,n){let s={...u.find(t)?.memory,...n},o=new J(n,e);return o.label=t,await o.load(),s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}function rt(t,e,n){if(!e)if(be.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:d$1,...n,label:t});let s={...u.find(t)?.memory,...n},o=new q(n,e);return s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}async function zn(t,e,n){if(!e)if(be.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:d$1,...n,label:t});let s={...u.find(t)?.memory,...n},o=new q(n,e);return o.label=t,await o.load(),s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}function st(t,e,n){if(!e)if(be.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:g,...n,label:t});let s={...u.find(t)?.memory,...n},o=new xe(n,e);return s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}async function Hn(t,e,n){if(!e)if(be.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:g,...n,label:t});let s={...u.find(t)?.memory,...n},o=new xe(n,e);return o.label=t,await o.load(),s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}async function Wn(t,e,n={},s){return le.showWithDissolve(t,e,n,s)}function Xn(t,e={},n){return le.removeWithDissolve(t,e,n)}async function $n(t,e,n={},s){return le.showWithFade(t,e,n,s)}function Gn(t,e={},n){return le.removeWithFade(t,e,n)}async function Vn(t,e,n={},s){return le.moveIn(t,e,n,s)}function jn(t,e={},n){return le.moveOut(t,e,n)}async function Nn(t,e,n={},s){return le.zoomIn(t,e,n,s)}function Kn(t,e={},n){return le.zoomOut(t,e,n)}async function qn(t,e,n={},s){return le.pushIn(t,e,n,s)}function Zn(t,e={direction:"right"},n){return le.pushOut(t,e,n)}var le;(yi=>{function t(r){switch(r.type){case "align":return {xAlign:r.x,yAlign:r.y};case "percentage":return {percentageX:r.x,percentageY:r.y};default:return {x:r.x,y:r.y}}}function e(r,i,a){if(typeof i=="string")return He(i)?st(r,i,{...a.properties,zIndex:a.zIndex}):rt(r,i,{...a.properties,zIndex:a.zIndex});if(Array.isArray(i))return it(r,i,{...a.properties,zIndex:a.zIndex});if(typeof i=="object"&&"value"in i&&"options"in i){if(typeof i.value=="string")return He(i.value)?st(r,i.value,{...i.options,...a.properties,zIndex:a.zIndex}):rt(r,i.value,{...i.options,...a.properties,zIndex:a.zIndex});if(Array.isArray(i.value))return it(r,i.value,{...i.options,...a.properties,zIndex:a.zIndex})}return u.add(r,i,a),i}function n(r){let i=r;return {x:i.x,y:i.y,anchor:i.anchor,scale:i.scale,pivot:i.pivot,skew:i.skew,rotation:i.rotation,angle:i.angle}}function s(r,i,a){let c,d=u.find(r);d&&(c=`${r}_temp_${a}`,u.editAlias(r,c));let p=e(r,i,{zIndex:d?d.parent?.getChildIndex(d):void 0,properties:d?n(d):void 0});return d?.parent?.setChildIndex(d,d.parent.getChildIndex(d)-.1),c&&u.copyCanvasElementProperty(c,r),c&&tickers$1.transfer(c,r,"duplicate"),{component:p,oldComponentAlias:c}}function o(r){switch(r){case "up":return 90;case "down":return 270;case "left":return 180;default:return 0}}function g(r,i,a){let c={},d=P=>{let T=u.find(r);T&&i.apply(T,P,c);},p=filters.animate(r,void 0,{value:[i.from,i.to]},{duration:i.duration??1,delay:i.delay,ease:i.ease,aliasToRemoveAfter:i.aliasToRemoveAfter,tickerIdToResume:i.tickerIdToResume},a,d,()=>{let P=u.find(r);P&&Gt(P,i.config,c);});return p&&d(i.from),p&&(i.completeOnContinue??true)&&tickers$1.completeOnStepEnd({id:p}),p}function I(r,i,a,c,d){let p=Math.max(c,0)/4;a==="in"?(i&&(i.alpha=0),u.animate(r,{alpha:[0,1]},{duration:p,completeOnContinue:false},d)):u.animate(r,{alpha:[1,0]},{duration:p,delay:Math.max(c-p,0),completeOnContinue:false},d);}function R(r,i,a,c,d=false){let p=Math.max(c,1),P=i*2+a,T=d?i+a:P,x=Math.max(P*(p-1)+T,.001),y=[0],m=[0],l=0;for(let h=0;h<p;h++){let C=h===p-1;l+=i,y.push(r),m.push(l/x),l+=a,y.push(r),m.push(l/x),(!C||!d)&&(l+=i,y.push(0),m.push(Math.min(l/x,1)));}return {values:y,times:m,total:x}}async function _(r,i,a={},c){let{completeOnContinue:d=true,tickerIdToResume:p=[],...P}=a,T=[];i||(i=r),typeof p=="string"&&(p=[p]);let x,y=u.find(r);if(y&&(x=`${r}_temp_disolve`,u.editAlias(r,x)),i=e(r,i,{zIndex:y?y.parent?.getChildIndex(y):void 0,properties:y?n(y):void 0}),y?.parent?.setChildIndex(y,y.parent.getChildIndex(y)-.1),x&&u.copyCanvasElementProperty(x,r),x&&tickers$1.transfer(x,r,"duplicate"),i.alpha=0,x){let l=f(x,{...a,autoplay:false,completeOnContinue:d},c);l&&(T.push(...l),p.push(...l));}let m=u.animate(r,{alpha:1},{...P,tickerIdToResume:p,completeOnContinue:d},c);if(m&&T.push(m),(i instanceof q||i instanceof J)&&i.haveEmptyTexture&&await i.load(),T.length>0)return T}yi.showWithDissolve=_;function f(r,i={},a){let{completeOnContinue:c=true,aliasToRemoveAfter:d=[],...p}=i;typeof d=="string"&&(d=[d]),d.push(r);let P=u.animate(r,{alpha:0},{...p,aliasToRemoveAfter:d,completeOnContinue:c},a);if(P)return [P]}yi.removeWithDissolve=f;async function v(r,i,a={},c){let{completeOnContinue:d=true,aliasToRemoveAfter:p=[],...P}=a,T=[];i||(i=r),typeof p=="string"&&(p=[p]);let x=u.find(r);if(!x)return _(r,i,a,c);let y=`${r}_temp_fade`;u.editAlias(r,y),p.push(y),i=e(r,i,{zIndex:x?x.parent?.getChildIndex(x):void 0,properties:n(x)}),x?.parent?.setChildIndex(x,x.parent.getChildIndex(x)-.1),y&&u.copyCanvasElementProperty(y,r),y&&tickers$1.transfer(y,r,"duplicate"),i.alpha=0;let m=u.animate(r,{alpha:1},{...P,aliasToRemoveAfter:p,completeOnContinue:d},c);if(m){let l=f(y,{...a,tickerIdToResume:m,completeOnContinue:d},c);l&&T.push(...l),T.push(m),tickers$1.pause({id:m});}if((i instanceof q||i instanceof J)&&i.haveEmptyTexture&&await i.load(),T.length>0)return T}yi.showWithFade=v;function A(r,i={},a){return f(r,i,a)}yi.removeWithFade=A;async function w(r,i,a={},c){let{direction:d="right",completeOnContinue:p=true,tickerIdToResume:P=[],aliasToRemoveAfter:T=[],removeOldComponentWithMoveOut:x,motionBlur:y,...m}=a,l=[],h;i||(i=r),typeof P=="string"&&(P=[P]),typeof T=="string"&&(T=[T]);let C,E=u.find(r);if(E&&(C=`${r}_temp_movein`,u.editAlias(r,C),E instanceof q||E instanceof J?h=E.positionInfo:h={x:E.x,y:E.y,type:"pixel"}),i=e(r,i,{zIndex:E?E.parent?.getChildIndex(E):void 0}),E?.parent?.setChildIndex(E,E.parent.getChildIndex(E)-.1),C&&u.copyCanvasElementProperty(C,r),C&&tickers$1.transfer(C,r,"move"),(i instanceof q||i instanceof J)&&i.haveEmptyTexture&&await i.load(),h||(i instanceof q||i instanceof J?h=i.positionInfo:h={x:i.x,y:i.y,type:"pixel"}),C)if(x){let re=H(C,{...a,autoplay:false,completeOnContinue:p},c);re&&(l.push(...re),P.push(...re));}else T.push(C);switch(d){case "up":i.y=u.height+i.height;break;case "down":i.y=-i.height;break;case "left":i.x=u.width+i.width;break;case "right":i.x=-i.width;break}let B=tickers$1.pause({canvasAlias:r});P.push(...B);let z=u.animate(r,t(h),{...m,tickerIdToResume:P,aliasToRemoveAfter:T,completeOnContinue:p},c);z&&l.push(z);let ne=te(r,i,d,y,{...m,completeOnContinue:p},c);if(ne&&l.push(ne),l.length>0)return l}yi.moveIn=w;function H(r,i={},a){let{direction:c="right",completeOnContinue:d=true,aliasToRemoveAfter:p=[],motionBlur:P,...T}=i;typeof p=="string"&&(p=[p]),p.push(r);let x=u.find(r);if(!x){e$1.warn(`The canvas component "${r}" is not found.`);return}let y={x:x.x,y:x.y};switch(c){case "up":y.y=-x.height;break;case "down":y.y=u.height+x.height;break;case "left":y.x=-x.width;break;case "right":y.x=u.width+x.width;break}tickers$1.pause({canvasAlias:r});let m=u.animate(r,y,{...T,aliasToRemoveAfter:p,completeOnContinue:d},a),l=te(r,x,c,P,{...T,completeOnContinue:d},a);return ue([m,l])}yi.moveOut=H;async function X(r,i,a={},c){let{direction:d="right",completeOnContinue:p=true,tickerIdToResume:P=[],aliasToRemoveAfter:T=[],...x}=a,y=[],m;i||(i=r),typeof P=="string"&&(P=[P]),typeof T=="string"&&(T=[T]);let l,h=u.find(r);h&&(l=`${r}_temp_zoom`,u.editAlias(r,l),h instanceof q||h instanceof J?m=h.positionInfo:m={x:h.x,y:h.y,type:"pixel"}),i=e(r,i,{zIndex:h?h.parent?.getChildIndex(h):void 0}),h?.parent?.setChildIndex(h,h.parent.getChildIndex(h)-.1),l&&u.copyCanvasElementProperty(l,r),l&&tickers$1.transfer(l,r,"move"),m||(i instanceof q||i instanceof J?m=i.positionInfo:m={x:i.x,y:i.y,type:"pixel"});let C={x:i.pivot.x,y:i.pivot.y},E={x:i.scale.x,y:i.scale.y};if(l)if(a.removeOldComponentWithZoomOut){let ne=Z(l,{...a,autoplay:false,completeOnContinue:p},c);ne&&(y.push(...ne),P.push(...ne));}else T.push(l);(i instanceof q||i instanceof J)&&i.haveEmptyTexture&&await i.load(),d==="up"?(i.pivot.y=u.height-i.y,i.pivot.x=u.width/2-i.x,i.y=u.height,i.x=u.width/2):d==="down"?(i.pivot.y=0-i.y,i.pivot.x=u.width/2-i.x,i.y=0,i.x=u.width/2):d==="left"?(i.pivot.x=u.width-i.x,i.pivot.y=u.height/2-i.y,i.x=u.width,i.y=u.height/2):d==="right"&&(i.pivot.x=0-i.x,i.pivot.y=u.height/2-i.y,i.x=0,i.y=u.height/2),i.pivot=b.getPointBySuperPoint(i.pivot,i.angle),i.scale.set(0);let B=tickers$1.pause({canvasAlias:r});P.push(...B);let z=u.animate(r,{pivotX:C.x,pivotY:C.y,scaleX:E.x,scaleY:E.y,...t(m)},{...x,tickerIdToResume:P,aliasToRemoveAfter:T,completeOnContinue:p},c);if(z&&y.push(z),y.length>0)return y}yi.zoomIn=X;function Z(r,i={},a){let{direction:c="right",completeOnContinue:d=true,aliasToRemoveAfter:p=[],...P}=i;typeof p=="string"&&(p=[p]),p.push(r);let T=u.find(r);if(!T){e$1.warn(`The canvas component "${r}" is not found.`);return}let x={x:T.x,y:T.y},y={x:T.pivot.x,y:T.pivot.y};c==="down"?(x.y=u.height,x.x=u.width/2,y.y=u.height-x.y,y.x=u.width/2-x.x):c==="up"?(x.y=0,x.x=u.width/2,y.y=0-x.y,y.x=u.width/2-x.x):c==="right"?(x.x=u.width,x.y=u.height/2,y.x=u.width-x.x,y.y=u.height/2-x.y):c==="left"&&(x.x=0,x.y=u.height/2,y.x=0-x.x,y.y=u.height/2-x.y),y=b.getPointBySuperPoint(y,T.angle),tickers$1.pause({canvasAlias:r});let m=u.animate(r,{...x,pivotX:y.x,pivotY:y.y,scaleX:0,scaleY:0},{...P,aliasToRemoveAfter:p,completeOnContinue:d},a);if(m)return [m]}yi.zoomOut=Z;async function Xe(r,i,a={},c){let{direction:d="right",completeOnContinue:p=true,tickerIdToResume:P=[],motionBlur:T,...x}=a,y=[],m;i||(i=r),typeof P=="string"&&(P=[P]);let l,h=u.find(r);switch(h&&(l=`${r}_temp_push`,u.editAlias(r,l),h instanceof q||h instanceof J?m=h.positionInfo:m={x:h.x,y:h.y,type:"pixel"}),i=e(r,i,{zIndex:h?h.parent?.getChildIndex(h):void 0}),h?.parent?.setChildIndex(h,h.parent.getChildIndex(h)-.1),l&&u.copyCanvasElementProperty(l,r),l&&tickers$1.transfer(l,r,"move"),m||((i instanceof q||i instanceof J)&&i.haveEmptyTexture?m=i.positionInfo:m={x:i.x,y:i.y,type:"pixel"}),(i instanceof q||i instanceof J)&&i.haveEmptyTexture&&await i.load(),d){case "up":i.y=u.height+i.height;break;case "down":i.y=-i.height;break;case "left":i.x=u.width+i.width;break;case "right":i.x=-i.width;break}let C=tickers$1.pause({canvasAlias:r});if(P.push(...C),l){let z=O(l,{...a,direction:d,completeOnContinue:p});z&&y.push(...z);}let E=u.animate(r,t(m),{...x,tickerIdToResume:P,completeOnContinue:p},c);E&&y.push(E);let B=te(r,i,d,T,{...x,completeOnContinue:p},c);if(B&&y.push(B),y.length>0)return y}yi.pushIn=Xe;function O(r,i={direction:"right"},a){return H(r,i,a)}yi.pushOut=O;async function K(r,i,a={},c){let{angle:d,direction:p="right",invert:P=false,duration:T,delay:x,ease:y,completeOnContinue:m=true}=a,{aliasToRemoveAfter:l=[]}=a;i||(i=r),typeof l=="string"&&(l=[l]);let{component:h,oldComponentAlias:C}=s(r,i,"wipe");C&&l.push(C),(h instanceof q||h instanceof J)&&h.haveEmptyTexture&&await h.load();let E={kind:"wipe",angle:d??o(p),invert:P,bounds:Oe(h)},B=g(r,{config:E,apply:(z,ne,re)=>Pt(z,E,ne,re),from:0,to:1,duration:T,delay:x,ease:y,completeOnContinue:m,aliasToRemoveAfter:l},c);if(B)return [B]}yi.wipeIn=K;function V(r,i={},a){let{angle:c,direction:d="right",invert:p=false,duration:P,delay:T,ease:x,completeOnContinue:y=true}=i,{aliasToRemoveAfter:m=[]}=i;typeof m=="string"&&(m=[m]),m.push(r);let l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}let h={kind:"wipe",angle:c??o(d),invert:p,bounds:Oe(l)},C=g(r,{config:h,apply:(E,B,z)=>Pt(E,h,B,z),from:1,to:0,duration:P,delay:T,ease:x,completeOnContinue:y,aliasToRemoveAfter:m},a);if(C)return [C]}yi.wipeOut=V;async function M(r,i,a={},c){let{origin:d={},aspect:p=1,invert:P=false,duration:T,delay:x,ease:y,completeOnContinue:m=true}=a,{aliasToRemoveAfter:l=[]}=a;i||(i=r),typeof l=="string"&&(l=[l]);let{component:h,oldComponentAlias:C}=s(r,i,"iris");C&&l.push(C),(h instanceof q||h instanceof J)&&h.haveEmptyTexture&&await h.load();let E={kind:"iris",originX:d.x??.5,originY:d.y??.5,aspect:p,invert:P,bounds:Oe(h)},B=g(r,{config:E,apply:(z,ne,re)=>vt(z,E,ne,re),from:0,to:1,duration:T,delay:x,ease:y,completeOnContinue:m,aliasToRemoveAfter:l},c);if(B)return [B]}yi.irisIn=M;function k(r,i={},a){let{origin:c={},aspect:d=1,invert:p=false,duration:P,delay:T,ease:x,completeOnContinue:y=true}=i,{aliasToRemoveAfter:m=[]}=i;typeof m=="string"&&(m=[m]),m.push(r);let l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}let h={kind:"iris",originX:c.x??.5,originY:c.y??.5,aspect:d,invert:p,bounds:Oe(l)},C=g(r,{config:h,apply:(E,B,z)=>vt(E,h,B,z),from:1,to:0,duration:P,delay:T,ease:x,completeOnContinue:y,aliasToRemoveAfter:m},a);if(C)return [C]}yi.irisOut=k;async function U(r,i,a={},c){let{orientation:d="vertical",origin:p=.5,invert:P=false,duration:T,delay:x,ease:y,completeOnContinue:m=true}=a,{aliasToRemoveAfter:l=[]}=a;i||(i=r),typeof l=="string"&&(l=[l]);let{component:h,oldComponentAlias:C}=s(r,i,"split");C&&l.push(C),(h instanceof q||h instanceof J)&&h.haveEmptyTexture&&await h.load();let E={kind:"split",orientation:d,origin:p,invert:P,bounds:Oe(h)},B=g(r,{config:E,apply:(z,ne,re)=>It(z,E,ne,re),from:0,to:1,duration:T,delay:x,ease:y,completeOnContinue:m,aliasToRemoveAfter:l},c);if(B)return [B]}yi.splitIn=U;function $(r,i={},a){let{orientation:c="vertical",origin:d=.5,invert:p=false,duration:P,delay:T,ease:x,completeOnContinue:y=true}=i,{aliasToRemoveAfter:m=[]}=i;typeof m=="string"&&(m=[m]),m.push(r);let l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}let h={kind:"split",orientation:c,origin:d,invert:p,bounds:Oe(l)},C=g(r,{config:h,apply:(E,B,z)=>It(E,h,B,z),from:1,to:0,duration:P,delay:T,ease:x,completeOnContinue:y,aliasToRemoveAfter:m},a);if(C)return [C]}yi.splitOut=$;async function j(r,i,a={},c){let{strength:d=32,quality:p=4,duration:P,delay:T,ease:x,completeOnContinue:y=true,fadeComponent:m=true}=a,{aliasToRemoveAfter:l=[]}=a;i||(i=r),typeof l=="string"&&(l=[l]);let{component:h,oldComponentAlias:C}=s(r,i,"blur");C&&l.push(C),(h instanceof q||h instanceof J)&&h.haveEmptyTexture&&await h.load();let E=P??1;m&&I(r,h,"in",E,c);let B=new filters.BlurFilter({strength:d,quality:p}),z=ee(r,h,B,{strength:[d,0]},{duration:E,delay:T,ease:x,completeOnContinue:y,aliasToRemoveAfter:l},c);if(z)return [z]}yi.blurIn=j;function L(r,i={},a){let{strength:c=32,quality:d=4,duration:p,delay:P,ease:T,completeOnContinue:x=true,fadeComponent:y=true}=i,{aliasToRemoveAfter:m=[]}=i;typeof m=="string"&&(m=[m]),m.push(r);let l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}let h=p??1;y&&I(r,l,"out",h,a);let C=new filters.BlurFilter({strength:0,quality:d}),E=ee(r,l,C,{strength:[0,c]},{duration:h,delay:P,ease:T,completeOnContinue:x,aliasToRemoveAfter:m},a);if(E)return [E]}yi.blurOut=L;async function D(r,i,a={},c){let{pixelSize:d=32,duration:p,delay:P,ease:T,completeOnContinue:x=true,fadeComponent:y=false}=a,{aliasToRemoveAfter:m=[]}=a;i||(i=r),typeof m=="string"&&(m=[m]);let{component:l,oldComponentAlias:h}=s(r,i,"pixelate");h&&m.push(h),(l instanceof q||l instanceof J)&&l.haveEmptyTexture&&await l.load();let C=p??1;y&&I(r,l,"in",C,c);let E=new filters.PixelateFilter(d),B=ee(r,l,E,{sizeX:[d,1],sizeY:[d,1]},{duration:C,delay:P,ease:T,completeOnContinue:x,aliasToRemoveAfter:m},c);if(B)return [B]}yi.pixelateIn=D;function W(r,i={},a){let{pixelSize:c=32,duration:d,delay:p,ease:P,completeOnContinue:T=true,fadeComponent:x=false}=i,{aliasToRemoveAfter:y=[]}=i;typeof y=="string"&&(y=[y]),y.push(r);let m=u.find(r);if(!m){e$1.warn(`The canvas component "${r}" is not found.`);return}let l=d??1;x&&I(r,m,"out",l,a);let h=new filters.PixelateFilter(1),C=ee(r,m,h,{sizeX:[1,c],sizeY:[1,c]},{duration:l,delay:p,ease:P,completeOnContinue:T,aliasToRemoveAfter:y},a);if(C)return [C]}yi.pixelateOut=W;async function Y(r,i,a={},c){let{color:d=16777215,maxAlpha:p=1,duration:P=.3,holdDuration:T=0,pulses:x=1,completeOnContinue:y=true,fadeComponent:m=true,...l}=a;i||(i=r);let h=u.find(r);if(h){let z=N(r,h,i,{color:d,maxAlpha:p,fadeDuration:P,holdDuration:T,pulses:x,completeOnContinue:y,rest:l,priority:c});return z||void 0}let{component:C}=s(r,i,"flash");(C instanceof q||C instanceof J)&&C.haveEmptyTexture&&await C.load(),m&&I(r,C,"in",P,c);let E=[],B=Q(C,{color:d,maxAlpha:p,fadeDuration:P,holdDuration:T,pulses:x,completeOnContinue:y,aliasToRemoveAfter:[],rest:l,priority:c});if(B&&E.push(B),E.length>0)return E}yi.flashIn=Y;function F(r,i={},a){let{color:c=16777215,maxAlpha:d=1,duration:p=.3,holdDuration:P=0,pulses:T=1,completeOnContinue:x=true,fadeComponent:y=true,...m}=i,l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}if(y){let{total:C}=R(d,p,P,T);I(r,l,"out",C,a);}let h=Q(l,{color:c,maxAlpha:d,fadeDuration:p,holdDuration:P,pulses:T,completeOnContinue:x,aliasToRemoveAfter:[r],rest:m,priority:a});if(h)return [h]}yi.flashOut=F;function G(r,i,a=0){let c=r.getBounds(),d=new me,p=new be.Graphics;p.rect(0,0,c.width,c.height).fill(i),d.addChild(p),d.position.set(c.x,c.y),d.alpha=a;let P=`${r.label}_flash_${Math.random().toString(36).slice(2)}`;return u.add(P,d,{zIndex:(r.zIndex??0)+1}),P}function Q(r,i){let a=G(r,i.color),{values:c,times:d,total:p}=R(i.maxAlpha,i.fadeDuration,i.holdDuration,i.pulses,i.endAtPeak??false),P=[...i.aliasToRemoveAfter,a];return u.animate(a,{alpha:c},{...i.rest,duration:p,times:d,aliasToRemoveAfter:P,completeOnContinue:i.completeOnContinue},i.priority)}function N(r,i,a,c){let d=G(i,c.color),{values:p,times:P,total:T}=R(c.maxAlpha,c.fadeDuration,c.holdDuration,c.pulses,true),x=u.animate(d,{alpha:p},{...c.rest,duration:T,times:P,completeOnContinue:false},c.priority);if(setTimeout(()=>{(async()=>{let{component:y,oldComponentAlias:m}=s(r,a,"flash");u.remove(m?[d,m]:[d]),(y instanceof q||y instanceof J)&&y.haveEmptyTexture&&await y.load();let l=G(y,c.color,c.maxAlpha);u.animate(l,{alpha:[c.maxAlpha,0]},{...c.rest,duration:c.fadeDuration,aliasToRemoveAfter:[l],completeOnContinue:c.completeOnContinue},c.priority);})();},T*1e3),x)return [x]}function te(r,i,a,c,d,p){if(!c)return;let P=c===true?40:c,T=a==="up"||a==="down"?"velocityY":"velocityX",x=a==="up"||a==="left"?-1:1,y=new filters.MotionBlurFilter({velocity:{x:0,y:0},kernelSize:15});return ee(r,i,y,{[T]:[0,x*P,0]},{duration:d.duration??.3,delay:d.delay,ease:d.ease,completeOnContinue:d.completeOnContinue,autoplay:d.autoplay},p)}function ue(r){let i=r.filter(a=>!!a);return i.length>0?i:void 0}async function ce(r,i,a,c,d,p,P){let{duration:T,delay:x,ease:y,completeOnContinue:m=true,fadeComponent:l=d}=c,{aliasToRemoveAfter:h=[]}=c;typeof h=="string"&&(h=[h]);let{component:C,oldComponentAlias:E}=s(r,i??r,a);E&&h.push(E),(C instanceof q||C instanceof J)&&C.haveEmptyTexture&&await C.load();let B=T??1;return l&&I(r,C,"in",B,p),ue(P(C,{duration:B,delay:x,ease:y,completeOnContinue:m},h))}function Ie(r,i,a,c,d){let{duration:p,delay:P,ease:T,completeOnContinue:x=true,fadeComponent:y=a}=i,{aliasToRemoveAfter:m=[]}=i;typeof m=="string"&&(m=[m]),m.push(r);let l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}let h=p??1;return y&&I(r,l,"out",h,c),ue(d(l,{duration:h,delay:P,ease:T,completeOnContinue:x},m))}function Tt(r){let{width:i,height:a}=r.getBounds();return Math.hypot(i,a)/2}function $e(r){return {x:r?.x??.5,y:r?.y??.5}}function Ct(r,i,a,c,d,p,P){let{strength:T=40,bursts:x=3,slices:y=8,rgbSplit:m=6}=c,l=B=>{let z=Ue(B,.5,x);return a==="in"?z:z.reverse()},h={...d,ease:d.ease??"linear"},C=new filters.GlitchFilter({slices:y,offset:0});C.refresh(),C.padding=Math.ceil(Math.abs(T));let E=[ee(r,i,C,{offset:l(T)},{...h,aliasToRemoveAfter:p},P)];if(m!==0){let B=l(m),z=new filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});z.padding=Math.ceil(Math.abs(m)),E.push(ee(r,i,z,{redX:B,blueX:B.map(ne=>-ne)},h,P));}return E}async function ii(r,i,a={},c){return ce(r,i,"glitch",a,true,c,(d,p,P)=>Ct(r,d,"in",a,p,P,c))}yi.glitchIn=ii;function ri(r,i={},a){return Ie(r,i,true,a,(c,d,p)=>Ct(r,c,"out",i,d,p,a))}yi.glitchOut=ri;function bt(r,i,a,c,d,p,P){let{angle:T=540,radius:x=Tt(i),origin:y}=c,m=$e(y),l=T*Math.PI/180,h=a==="in"?[l,0]:[0,l],C=new filters.TwistFilter({radius:x,angle:h[0]}),{width:E,height:B}=i.getBounds();C.padding=Math.max(C.padding,gt({x:m.x*E,y:m.y*B},x,E,B));let z=ee(r,i,C,{angle:h},{...d,aliasToRemoveAfter:p},P),{x:ne,y:re}=ve(i,m);return C.offsetX=ne,C.offsetY=re,[z]}async function si(r,i,a={},c){return ce(r,i,"twist",a,true,c,(d,p,P)=>bt(r,d,"in",a,p,P,c))}yi.twistIn=si;function oi(r,i={},a){return Ie(r,i,true,a,(c,d,p)=>bt(r,c,"out",i,d,p,a))}yi.twistOut=oi;function wt(r,i,a,c,d,p,P){let{strength:T=.6,origin:x}=c,y=$e(x),m=a==="in"?[T,0]:[0,T],l=new filters.ZoomBlurFilter({center:{x:0,y:0},strength:m[0]}),{width:h,height:C}=i.getBounds();l.padding=et({x:y.x*h,y:y.y*C},T,h,C);let E=ee(r,i,l,{strength:m},{...d,aliasToRemoveAfter:p},P),{x:B,y:z}=ve(i,y);return l.center={x:B,y:z},[E]}async function ai(r,i,a={},c){return ce(r,i,"warp",a,true,c,(d,p,P)=>wt(r,d,"in",a,p,P,c))}yi.warpIn=ai;function ci(r,i={},a){return Ie(r,i,true,a,(c,d,p)=>wt(r,c,"out",i,d,p,a))}yi.warpOut=ci;function At(r,i,a,c,d,p){let{origin:P,amplitude:T=30,wavelength:x=160,speed:y=500}=a,m=$e(P),{width:l,height:h}=i.getBounds(),C=new filters.ShockwaveFilter({center:{x:0,y:0},amplitude:T,wavelength:x,speed:y,time:0});C.padding=Math.ceil(Math.abs(T)*1.25);let E=tt({x:m.x*l,y:m.y*h},{width:l,height:h},x,-1)/y,B=ee(r,i,C,{time:[0,E]},{...c,aliasToRemoveAfter:d},p),{x:z,y:ne}=ve(i,m);return C.center={x:z,y:ne},[B]}async function di(r,i,a={},c){return ce(r,i,"ripple",a,true,c,(d,p,P)=>At(r,d,a,p,P,c))}yi.rippleIn=di;function ui(r,i={},a){return Ie(r,i,true,a,(c,d,p)=>At(r,c,i,d,p,a))}yi.rippleOut=ui;function St(r,i,a,c,d,p,P){let{edge:T="hard",noiseScale:x=8,seed:y=Math.random()*1e3}=c,[m,l]=T==="hard"?[.25,.75]:[0,1],h=a==="in"?[m,l]:[l,m],C=new filters.SimplexNoiseFilter({strength:h[0],noiseScale:x,offsetZ:y,step:T==="hard"?.5:0});return [ee(r,i,C,{strength:h},{...d,aliasToRemoveAfter:p},P)]}async function pi(r,i,a={},c){return ce(r,i,"noise",a,false,c,(d,p,P)=>St(r,d,"in",a,p,P,c))}yi.noiseDissolveIn=pi;function fi(r,i={},a){return Ie(r,i,false,a,(c,d,p)=>St(r,c,"out",i,d,p,a))}yi.noiseDissolveOut=fi;function Ot(r,i,a,c,d,p,P){let{lineThickness:T=.02,brightness:x=3,scanlines:y=true}=c,m=i.scale.x,l=i.scale.y,h=l*T,C=a==="in"?[0,.45,1]:[0,.55,1],E=a==="in"?[0,m,m]:[m,m,0],B=a==="in"?[h,h,l]:[l,h,h],z=a==="in"?[x,x,1]:[1,x,x];a==="in"&&i.scale.set(0,h);let ne=[u.animate(r,{scaleX:E,scaleY:B},{duration:d.duration,delay:d.delay,ease:d.ease,times:C,completeOnContinue:d.completeOnContinue,aliasToRemoveAfter:p},P),ee(r,i,new filters.AdjustmentFilter({brightness:z[0]}),{brightness:z},{...d,times:C},P)];if(y){let re=a==="in"?[.5,.5,0]:[0,.5,.5];ne.push(ee(r,i,new filters.CRTFilter({curvature:0,vignettingAlpha:0,lineWidth:3,lineContrast:re[0],noise:re[0]}),{lineContrast:re,noise:re},{...d,times:C},P));}return ne}async function li(r,i,a={},c){return ce(r,i,"tv",a,false,c,(d,p,P)=>Ot(r,d,"in",a,p,P,c))}yi.tvIn=li;function hi(r,i={},a){return Ie(r,i,false,a,(c,d,p)=>Ot(r,c,"out",i,d,p,a))}yi.tvOut=hi;function Et(r,i,a,c,d,p,P){let{strength:T=1,mode:x="pinch",radius:y=Tt(i),origin:m}=c,l=(x==="bulge"?1:-1)*T,h=$e(m),C=a==="in"?[l,0]:[0,l],E=new filters.BulgePinchFilter({center:h,radius:y,strength:C[0]});if(x==="bulge"){let{width:Mt,height:_t}=i.getBounds();E.padding=gt({x:h.x*Mt,y:h.y*_t},y,Mt,_t);}let B=ee(r,i,E,{strength:C},{...d,aliasToRemoveAfter:p},P),{x:z,y:ne,area:re}=ve(i,h);return E.center={x:z/re.width,y:ne/re.height},[B]}async function gi(r,i,a={},c){return ce(r,i,"pinch",a,true,c,(d,p,P)=>Et(r,d,"in",a,p,P,c))}yi.pinchIn=gi;function mi(r,i={},a){return Ie(r,i,true,a,(c,d,p)=>Et(r,c,"out",i,d,p,a))}yi.pinchOut=mi;})(le||={});var We=class extends me{constructor(n){super(n);this._memory=n;this.pixivnId=n.pixivnId;}_memory;pixivnId;get memory(){return {...this._memory,...super.memory,elements:[],pixivnId:this.pixivnId}}};function Jn(){return async(e,n)=>{try{let s=e.canvasElementInfo;if(s){let o=new We(s),g=s.zIndex;o.groupColor=16711680;let I=new be.Graphics;I.rect(0,0,300,100).fill({color:16711680,alpha:.5}),o.addChild(I);let R=new be.Text({text:`Error: ${s.label}`,x:10,y:10});o.addChild(R);let _=e.parent;if(_&&"addChild"in _)g!==void 0?_.addChildAt(o,g):_.addChild(o);else {let f=s.parentLabel?u.find(s.parentLabel):void 0;if(f)g!==void 0?f.addChildAt(o,g):f.addChild(o);else {let v=s.label??s.pixivnId;u.add(v,o,{zIndex:g});}}}}catch{}}}function Qn(t,e,n){let s={...u.find(t)?.memory,...n},o=new Se({text:e,...n});return s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}var {Assets:vo,Color:Io,Rectangle:To,TextStyle:Co,Texture:bo,UPDATE_PRIORITY:wo}=be,u=new Ye;oe.init({getScreen:()=>u.screen});GameUnifier.addOnPreContinue(async()=>{try{let{tikersIds:t,stepAlias:e}=drainCompleteOnStepEndQueue(),n=(async()=>{for(;t.length;){let{id:o}=t.pop()||{};o&&await tickers$1.forceCompletion(o);}})(),s=(async()=>{for(;e.length;){let{alias:o,id:g}=e.pop()||{};o&&g&&await tickers$1.forceCompletion(g,o);}})();await Promise.all([n,s]);}catch{}});
|
|
2
|
+
export{vo as Assets,Qe as CanvasBaseItem,ie as CanvasManagerStatic,b as CanvasPropertyUtility,Io as Color,me as Container,J as ImageContainer,q as ImageSprite,To as Rectangle,ae as RegisteredCanvasComponents,ct as RegisteredEvents,Ae as Sprite,Se as Text,Co as TextStyle,bo as Texture,wo as UPDATE_PRIORITY,xe as VideoSprite,rt as addImage,it as addImageCointainer,Ce as addListenerHandler,st as addVideo,ge as analizePositionsExtensionProps,u as canvas,rn as canvasComponentDecorator,Jn as drawCanvasErrorHandler,yt as effects,tn as eventDecorator,ze as getTexture,Vn as moveIn,jn as moveOut,qn as pushIn,Zn as pushOut,Xn as removeWithDissolve,Gn as removeWithFade,fe as setMemoryContainer,Bn as shakeEffect,zn as showImage,Yn as showImageContainer,Qn as showText,Hn as showVideo,Wn as showWithDissolve,$n as showWithFade,le as transitions,Nn as zoomIn,Kn as zoomOut};
|
package/dist/characters.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var core=require('@drincs/pixi-vn/core');var se=Object.defineProperty;var kt=f=>{throw TypeError(f)};var ae=(f,t,r)=>t in f?se(f,t,{enumerable:true,configurable:true,writable:true,value:r}):f[t]=r;var F=(f,t,r)=>ae(f,typeof t!="symbol"?t+"":t,r),Yt=(f,t,r)=>t.has(f)||kt("Cannot "+r);var e=(f,t,r)=>(Yt(f,t,"read from private field"),r?r.call(f):t.get(f)),_=(f,t,r)=>t.has(f)?kt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(f):t.set(f,r),u=(f,t,r,i)=>(Yt(f,t,"write to private field"),t.set(f,r),r),c=(f,t,r)=>(Yt(f,t,"access private method"),r);var Mt=(f,t,r,i)=>({set _(s){u(f,t,s);},get _(){return e(f,t,i)}});var st="storage",ft="temp",Dt="flags",z={CHARACTER_CATEGORY_KEY:"character"};var oe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,qt=new Set,Kt=typeof process=="object"&&process?process:{},Qt=(f,t,r,i)=>{typeof Kt.emitWarning=="function"?Kt.emitWarning(f,t,r,i):console.error(`[${r}] ${t}: ${f}`);},Ut=globalThis.AbortController,Bt=globalThis.AbortSignal;if(typeof Ut>"u"){Bt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(r,i){this._onabort.push(i);}},Ut=class{constructor(){t();}signal=new Bt;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=true;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r);}}};let f=Kt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{f&&(f=false,Qt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t));};}var ne=f=>!qt.has(f);var at=f=>f&&f===Math.floor(f)&&f>0&&isFinite(f),Zt=f=>at(f)?f<=Math.pow(2,8)?Uint8Array:f<=Math.pow(2,16)?Uint16Array:f<=Math.pow(2,32)?Uint32Array:f<=Number.MAX_SAFE_INTEGER?Gt:null:null,Gt=class extends Array{constructor(f){super(f),this.fill(0);}},et,Et,he=(et=class{heap;length;static create(t){let r=Zt(t);if(!r)return [];u(et,Et,true);let i=new et(t,r);return u(et,Et,false),i}constructor(t,r){if(!e(et,Et))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0;}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}},Et=new WeakMap,_(et,Et,false),et),Xt,Jt,j,P,k,ut,B,Tt,yt,X,I,J,x,O,g,L,Y,M,C,q,N,Q,Z,K,W,tt,lt,V,bt,n,Wt,gt,it,Rt,H,ee,dt,At,Ct,ot,nt,Ht,Lt,Vt,v,$t,It,ht,jt,vt,te=(vt=class{constructor(t){_(this,n);_(this,j);_(this,P);_(this,k);_(this,ut);_(this,B);_(this,Tt);_(this,yt);_(this,X);F(this,"ttl");F(this,"ttlResolution");F(this,"ttlAutopurge");F(this,"updateAgeOnGet");F(this,"updateAgeOnHas");F(this,"allowStale");F(this,"noDisposeOnSet");F(this,"noUpdateTTL");F(this,"maxEntrySize");F(this,"sizeCalculation");F(this,"noDeleteOnFetchRejection");F(this,"noDeleteOnStaleGet");F(this,"allowStaleOnFetchAbort");F(this,"allowStaleOnFetchRejection");F(this,"ignoreFetchAbort");_(this,I);_(this,J);_(this,x);_(this,O);_(this,g);_(this,L);_(this,Y);_(this,M);_(this,C);_(this,q);_(this,N);_(this,Q);_(this,Z);_(this,K);_(this,W);_(this,tt);_(this,lt);_(this,V);_(this,bt);_(this,gt,()=>{});_(this,it,()=>{});_(this,Rt,()=>{});_(this,H,()=>false);_(this,dt,t=>{});_(this,At,(t,r,i)=>{});_(this,Ct,(t,r,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});F(this,Xt,"LRUCache");let{max:r=0,ttl:i,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:h,allowStale:l,dispose:S,onInsert:R,disposeAfter:d,noDisposeOnSet:y,noUpdateTTL:T,maxSize:E=0,maxEntrySize:b=0,sizeCalculation:A,fetchMethod:p,memoMethod:D,noDeleteOnFetchRejection:U,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:xt,ignoreFetchAbort:_t,perf:mt}=t;if(mt!==void 0&&typeof mt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,X,mt??oe),r!==0&&!at(r))throw new TypeError("max option must be a nonnegative integer");let St=r?Zt(r):Array;if(!St)throw new Error("invalid max value: "+r);if(u(this,j,r),u(this,P,E),this.maxEntrySize=b||e(this,P),this.sizeCalculation=A,this.sizeCalculation){if(!e(this,P)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(D!==void 0&&typeof D!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,yt,D),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,Tt,p),u(this,lt,!!p),u(this,x,new Map),u(this,O,new Array(r).fill(void 0)),u(this,g,new Array(r).fill(void 0)),u(this,L,new St(r)),u(this,Y,new St(r)),u(this,M,0),u(this,C,0),u(this,q,he.create(r)),u(this,I,0),u(this,J,0),typeof S=="function"&&u(this,k,S),typeof R=="function"&&u(this,ut,R),typeof d=="function"?(u(this,B,d),u(this,N,[])):(u(this,B,void 0),u(this,N,void 0)),u(this,tt,!!e(this,k)),u(this,bt,!!e(this,ut)),u(this,V,!!e(this,B)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!T,this.noDeleteOnFetchRejection=!!U,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!xt,this.ignoreFetchAbort=!!_t,this.maxEntrySize!==0){if(e(this,P)!==0&&!at(e(this,P)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");c(this,n,ee).call(this);}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!h,this.ttlResolution=at(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");c(this,n,Wt).call(this);}if(e(this,j)===0&&this.ttl===0&&e(this,P)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,j)&&!e(this,P)){let Pt="LRU_CACHE_UNBOUNDED";ne(Pt)&&(qt.add(Pt),Qt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,vt));}}get perf(){return e(this,X)}static unsafeExposeInternals(t){return {starts:e(t,Z),ttls:e(t,K),autopurgeTimers:e(t,W),sizes:e(t,Q),keyMap:e(t,x),keyList:e(t,O),valList:e(t,g),next:e(t,L),prev:e(t,Y),get head(){return e(t,M)},get tail(){return e(t,C)},free:e(t,q),isBackgroundFetch:r=>{var i;return c(i=t,n,v).call(i,r)},backgroundFetch:(r,i,s,o)=>{var a;return c(a=t,n,Vt).call(a,r,i,s,o)},moveToTail:r=>{var i;return c(i=t,n,It).call(i,r)},indexes:r=>{var i;return c(i=t,n,ot).call(i,r)},rindexes:r=>{var i;return c(i=t,n,nt).call(i,r)},isStale:r=>{var i;return e(i=t,H).call(i,r)}}}get max(){return e(this,j)}get maxSize(){return e(this,P)}get calculatedSize(){return e(this,J)}get size(){return e(this,I)}get fetchMethod(){return e(this,Tt)}get memoMethod(){return e(this,yt)}get dispose(){return e(this,k)}get onInsert(){return e(this,ut)}get disposeAfter(){return e(this,B)}getRemainingTTL(t){return e(this,x).has(t)?1/0:0}*entries(){for(let t of c(this,n,ot).call(this))e(this,g)[t]!==void 0&&e(this,O)[t]!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield [e(this,O)[t],e(this,g)[t]]);}*rentries(){for(let t of c(this,n,nt).call(this))e(this,g)[t]!==void 0&&e(this,O)[t]!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield [e(this,O)[t],e(this,g)[t]]);}*keys(){for(let t of c(this,n,ot).call(this)){let r=e(this,O)[t];r!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield r);}}*rkeys(){for(let t of c(this,n,nt).call(this)){let r=e(this,O)[t];r!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield r);}}*values(){for(let t of c(this,n,ot).call(this))e(this,g)[t]!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield e(this,g)[t]);}*rvalues(){for(let t of c(this,n,nt).call(this))e(this,g)[t]!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield e(this,g)[t]);}[(Jt=Symbol.iterator,Xt=Symbol.toStringTag,Jt)](){return this.entries()}find(t,r={}){for(let i of c(this,n,ot).call(this)){let s=e(this,g)[i],o=c(this,n,v).call(this,s)?s.__staleWhileFetching:s;if(o!==void 0&&t(o,e(this,O)[i],this))return this.get(e(this,O)[i],r)}}forEach(t,r=this){for(let i of c(this,n,ot).call(this)){let s=e(this,g)[i],o=c(this,n,v).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&t.call(r,o,e(this,O)[i],this);}}rforEach(t,r=this){for(let i of c(this,n,nt).call(this)){let s=e(this,g)[i],o=c(this,n,v).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&t.call(r,o,e(this,O)[i],this);}}purgeStale(){let t=false;for(let r of c(this,n,nt).call(this,{allowStale:true}))e(this,H).call(this,r)&&(c(this,n,ht).call(this,e(this,O)[r],"expire"),t=true);return t}info(t){let r=e(this,x).get(t);if(r===void 0)return;let i=e(this,g)[r],s=c(this,n,v).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let o={value:s};if(e(this,K)&&e(this,Z)){let a=e(this,K)[r],h=e(this,Z)[r];if(a&&h){let l=a-(e(this,X).now()-h);o.ttl=l,o.start=Date.now();}}return e(this,Q)&&(o.size=e(this,Q)[r]),o}dump(){let t=[];for(let r of c(this,n,ot).call(this,{allowStale:true})){let i=e(this,O)[r],s=e(this,g)[r],o=c(this,n,v).call(this,s)?s.__staleWhileFetching:s;if(o===void 0||i===void 0)continue;let a={value:o};if(e(this,K)&&e(this,Z)){a.ttl=e(this,K)[r];let h=e(this,X).now()-e(this,Z)[r];a.start=Math.floor(Date.now()-h);}e(this,Q)&&(a.size=e(this,Q)[r]),t.unshift([i,a]);}return t}load(t){this.clear();for(let[r,i]of t){if(i.start){let s=Date.now()-i.start;i.start=e(this,X).now()-s;}this.set(r,i.value,i);}}set(t,r,i={}){var y,T,E,b;if(r===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:l}=i,{noUpdateTTL:S=this.noUpdateTTL}=i,R=e(this,Ct).call(this,t,r,i.size||0,h);if(this.maxEntrySize&&R>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),c(this,n,ht).call(this,t,"set"),this;let d=e(this,I)===0?void 0:e(this,x).get(t);if(d===void 0)d=e(this,I)===0?e(this,C):e(this,q).length!==0?e(this,q).pop():e(this,I)===e(this,j)?c(this,n,Lt).call(this,false):e(this,I),e(this,O)[d]=t,e(this,g)[d]=r,e(this,x).set(t,d),e(this,L)[e(this,C)]=d,e(this,Y)[d]=e(this,C),u(this,C,d),Mt(this,I)._++,e(this,At).call(this,d,R,l),l&&(l.set="add"),S=false,e(this,bt)&&((y=e(this,ut))==null||y.call(this,r,t,"add"));else {c(this,n,It).call(this,d);let A=e(this,g)[d];if(r!==A){if(e(this,lt)&&c(this,n,v).call(this,A)){A.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=A;p!==void 0&&!a&&(e(this,tt)&&((T=e(this,k))==null||T.call(this,p,t,"set")),e(this,V)&&e(this,N)?.push([p,t,"set"]));}else a||(e(this,tt)&&((E=e(this,k))==null||E.call(this,A,t,"set")),e(this,V)&&e(this,N)?.push([A,t,"set"]));if(e(this,dt).call(this,d),e(this,At).call(this,d,R,l),e(this,g)[d]=r,l){l.set="replace";let p=A&&c(this,n,v).call(this,A)?A.__staleWhileFetching:A;p!==void 0&&(l.oldValue=p);}}else l&&(l.set="update");e(this,bt)&&this.onInsert?.(r,t,r===A?"update":"replace");}if(s!==0&&!e(this,K)&&c(this,n,Wt).call(this),e(this,K)&&(S||e(this,Rt).call(this,d,s,o),l&&e(this,it).call(this,l,d)),!a&&e(this,V)&&e(this,N)){let A=e(this,N),p;for(;p=A?.shift();)(b=e(this,B))==null||b.call(this,...p);}return this}pop(){var t;try{for(;e(this,I);){let r=e(this,g)[e(this,M)];if(c(this,n,Lt).call(this,!0),c(this,n,v).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(e(this,V)&&e(this,N)){let r=e(this,N),i;for(;i=r?.shift();)(t=e(this,B))==null||t.call(this,...i);}}}has(t,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=r,o=e(this,x).get(t);if(o!==void 0){let a=e(this,g)[o];if(c(this,n,v).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(e(this,H).call(this,o))s&&(s.has="stale",e(this,it).call(this,s,o));else return i&&e(this,gt).call(this,o),s&&(s.has="hit",e(this,it).call(this,s,o)),true}else s&&(s.has="miss");return false}peek(t,r={}){let{allowStale:i=this.allowStale}=r,s=e(this,x).get(t);if(s===void 0||!i&&e(this,H).call(this,s))return;let o=e(this,g)[s];return c(this,n,v).call(this,o)?o.__staleWhileFetching:o}async fetch(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:l=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:T=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:b,forceRefresh:A=false,status:p,signal:D}=r;if(!e(this,lt))return p&&(p.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:p});let U={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:h,size:l,sizeCalculation:S,noUpdateTTL:R,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:E,ignoreFetchAbort:T,status:p,signal:D},G=e(this,x).get(t);if(G===void 0){p&&(p.fetch="miss");let w=c(this,n,Vt).call(this,t,G,U,b);return w.__returned=w}else {let w=e(this,g)[G];if(c(this,n,v).call(this,w)){let St=i&&w.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",St&&(p.returnedStale=true)),St?w.__staleWhileFetching:w.__returned=w}let xt=e(this,H).call(this,G);if(!A&&!xt)return p&&(p.fetch="hit"),c(this,n,It).call(this,G),s&&e(this,gt).call(this,G),p&&e(this,it).call(this,p,G),w;let _t=c(this,n,Vt).call(this,t,G,U,b),mt=_t.__staleWhileFetching!==void 0&&i;return p&&(p.fetch=xt?"stale":"refresh",mt&&xt&&(p.returnedStale=true)),mt?_t.__staleWhileFetching:_t.__returned=_t}}async forceFetch(t,r={}){let i=await this.fetch(t,r);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,r={}){let i=e(this,yt);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:o,...a}=r,h=this.get(t,a);if(!o&&h!==void 0)return h;let l=i(t,h,{options:a,context:s});return this.set(t,l,a),l}get(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=r,h=e(this,x).get(t);if(h!==void 0){let l=e(this,g)[h],S=c(this,n,v).call(this,l);return a&&e(this,it).call(this,a,h),e(this,H).call(this,h)?(a&&(a.get="stale"),S?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=true),i?l.__staleWhileFetching:void 0):(o||c(this,n,ht).call(this,t,"expire"),a&&i&&(a.returnedStale=true),i?l:void 0)):(a&&(a.get="hit"),S?l.__staleWhileFetching:(c(this,n,It).call(this,h),s&&e(this,gt).call(this,h),l))}else a&&(a.get="miss");}delete(t){return c(this,n,ht).call(this,t,"delete")}clear(){return c(this,n,jt).call(this,"delete")}},j=new WeakMap,P=new WeakMap,k=new WeakMap,ut=new WeakMap,B=new WeakMap,Tt=new WeakMap,yt=new WeakMap,X=new WeakMap,I=new WeakMap,J=new WeakMap,x=new WeakMap,O=new WeakMap,g=new WeakMap,L=new WeakMap,Y=new WeakMap,M=new WeakMap,C=new WeakMap,q=new WeakMap,N=new WeakMap,Q=new WeakMap,Z=new WeakMap,K=new WeakMap,W=new WeakMap,tt=new WeakMap,lt=new WeakMap,V=new WeakMap,bt=new WeakMap,n=new WeakSet,Wt=function(){let t=new Gt(e(this,j)),r=new Gt(e(this,j));u(this,K,t),u(this,Z,r);let i=this.ttlAutopurge?new Array(e(this,j)):void 0;u(this,W,i),u(this,Rt,(h,l,S=e(this,X).now())=>{r[h]=l!==0?S:0,t[h]=l,s(h,l);}),u(this,gt,h=>{r[h]=t[h]!==0?e(this,X).now():0,s(h,t[h]);});let s=this.ttlAutopurge?(h,l)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),l&&l!==0&&i){let S=setTimeout(()=>{e(this,H).call(this,h)&&c(this,n,ht).call(this,e(this,O)[h],"expire");},l+1);S.unref&&S.unref(),i[h]=S;}}:()=>{};u(this,it,(h,l)=>{if(t[l]){let S=t[l],R=r[l];if(!S||!R)return;h.ttl=S,h.start=R,h.now=o||a();let d=h.now-R;h.remainingTTL=S-d;}});let o=0,a=()=>{let h=e(this,X).now();if(this.ttlResolution>0){o=h;let l=setTimeout(()=>o=0,this.ttlResolution);l.unref&&l.unref();}return h};this.getRemainingTTL=h=>{let l=e(this,x).get(h);if(l===void 0)return 0;let S=t[l],R=r[l];if(!S||!R)return 1/0;let d=(o||a())-R;return S-d},u(this,H,h=>{let l=r[h],S=t[h];return !!S&&!!l&&(o||a())-l>S});},gt=new WeakMap,it=new WeakMap,Rt=new WeakMap,H=new WeakMap,ee=function(){let t=new Gt(e(this,j));u(this,J,0),u(this,Q,t),u(this,dt,r=>{u(this,J,e(this,J)-t[r]),t[r]=0;}),u(this,Ct,(r,i,s,o)=>{if(c(this,n,v).call(this,i))return 0;if(!at(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(i,r),!at(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),u(this,At,(r,i,s)=>{if(t[r]=i,e(this,P)){let o=e(this,P)-t[r];for(;e(this,J)>o;)c(this,n,Lt).call(this,true);}u(this,J,e(this,J)+t[r]),s&&(s.entrySize=i,s.totalCalculatedSize=e(this,J));});},dt=new WeakMap,At=new WeakMap,Ct=new WeakMap,ot=function*({allowStale:t=this.allowStale}={}){if(e(this,I))for(let r=e(this,C);!(!c(this,n,Ht).call(this,r)||((t||!e(this,H).call(this,r))&&(yield r),r===e(this,M)));)r=e(this,Y)[r];},nt=function*({allowStale:t=this.allowStale}={}){if(e(this,I))for(let r=e(this,M);!(!c(this,n,Ht).call(this,r)||((t||!e(this,H).call(this,r))&&(yield r),r===e(this,C)));)r=e(this,L)[r];},Ht=function(t){return t!==void 0&&e(this,x).get(e(this,O)[t])===t},Lt=function(t){var o;let r=e(this,M),i=e(this,O)[r],s=e(this,g)[r];return e(this,lt)&&c(this,n,v).call(this,s)?s.__abortController.abort(new Error("evicted")):(e(this,tt)||e(this,V))&&(e(this,tt)&&((o=e(this,k))==null||o.call(this,s,i,"evict")),e(this,V)&&e(this,N)?.push([s,i,"evict"])),e(this,dt).call(this,r),e(this,W)?.[r]&&(clearTimeout(e(this,W)[r]),e(this,W)[r]=void 0),t&&(e(this,O)[r]=void 0,e(this,g)[r]=void 0,e(this,q).push(r)),e(this,I)===1?(u(this,M,u(this,C,0)),e(this,q).length=0):u(this,M,e(this,L)[r]),e(this,x).delete(i),Mt(this,I)._--,r},Vt=function(t,r,i,s){let o=r===void 0?void 0:e(this,g)[r];if(c(this,n,v).call(this,o))return o;let a=new Ut,{signal:h}=i;h?.addEventListener("abort",()=>a.abort(h.reason),{signal:a.signal});let l={signal:a.signal,options:i,context:s},S=(b,A=false)=>{let{aborted:p}=a.signal,D=i.ignoreFetchAbort&&b!==void 0,U=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&b!==void 0);if(i.status&&(p&&!A?(i.status.fetchAborted=true,i.status.fetchError=a.signal.reason,D&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),p&&!D&&!A)return d(a.signal.reason,U);let G=T,w=e(this,g)[r];return (w===T||D&&A&&w===void 0)&&(b===void 0?G.__staleWhileFetching!==void 0?e(this,g)[r]=G.__staleWhileFetching:c(this,n,ht).call(this,t,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(t,b,l.options))),b},R=b=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=b),d(b,false)),d=(b,A)=>{let{aborted:p}=a.signal,D=p&&i.allowStaleOnFetchAbort,U=D||i.allowStaleOnFetchRejection,G=U||i.noDeleteOnFetchRejection,w=T;if(e(this,g)[r]===T&&(!G||!A&&w.__staleWhileFetching===void 0?c(this,n,ht).call(this,t,"fetch"):D||(e(this,g)[r]=w.__staleWhileFetching)),U)return i.status&&w.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),w.__staleWhileFetching;if(w.__returned===w)throw b},y=(b,A)=>{var D;let p=(D=e(this,Tt))==null?void 0:D.call(this,t,o,l);p&&p instanceof Promise&&p.then(U=>b(U===void 0?void 0:U),A),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=U=>S(U,true)));});};i.status&&(i.status.fetchDispatched=true);let T=new Promise(y).then(S,R),E=Object.assign(T,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(t,E,{...l.options,status:void 0}),r=e(this,x).get(t)):e(this,g)[r]=E,E},v=function(t){if(!e(this,lt))return false;let r=t;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Ut},$t=function(t,r){e(this,Y)[r]=t,e(this,L)[t]=r;},It=function(t){t!==e(this,C)&&(t===e(this,M)?u(this,M,e(this,L)[t]):c(this,n,$t).call(this,e(this,Y)[t],e(this,L)[t]),c(this,n,$t).call(this,e(this,C),t),u(this,C,t));},ht=function(t,r){var s,o;let i=false;if(e(this,I)!==0){let a=e(this,x).get(t);if(a!==void 0)if(e(this,W)?.[a]&&(clearTimeout(e(this,W)?.[a]),e(this,W)[a]=void 0),i=true,e(this,I)===1)c(this,n,jt).call(this,r);else {e(this,dt).call(this,a);let h=e(this,g)[a];if(c(this,n,v).call(this,h)?h.__abortController.abort(new Error("deleted")):(e(this,tt)||e(this,V))&&(e(this,tt)&&((s=e(this,k))==null||s.call(this,h,t,r)),e(this,V)&&e(this,N)?.push([h,t,r])),e(this,x).delete(t),e(this,O)[a]=void 0,e(this,g)[a]=void 0,a===e(this,C))u(this,C,e(this,Y)[a]);else if(a===e(this,M))u(this,M,e(this,L)[a]);else {let l=e(this,Y)[a];e(this,L)[l]=e(this,L)[a];let S=e(this,L)[a];e(this,Y)[S]=e(this,Y)[a];}Mt(this,I)._--,e(this,q).push(a);}}if(e(this,V)&&e(this,N)?.length){let a=e(this,N),h;for(;h=a?.shift();)(o=e(this,B))==null||o.call(this,...h);}return i},jt=function(t){var r,i;for(let s of c(this,n,nt).call(this,{allowStale:true})){let o=e(this,g)[s];if(c(this,n,v).call(this,o))o.__abortController.abort(new Error("deleted"));else {let a=e(this,O)[s];e(this,tt)&&((r=e(this,k))==null||r.call(this,o,a,t)),e(this,V)&&e(this,N)?.push([o,a,t]);}}if(e(this,x).clear(),e(this,g).fill(void 0),e(this,O).fill(void 0),e(this,K)&&e(this,Z)){e(this,K).fill(0),e(this,Z).fill(0);for(let s of e(this,W)??[])s!==void 0&&clearTimeout(s);e(this,W)?.fill(void 0);}if(e(this,Q)&&e(this,Q).fill(0),u(this,M,0),u(this,C,0),e(this,q).length=0,u(this,J,0),u(this,I,0),e(this,V)&&e(this,N)){let s=e(this,N),o;for(;o=s?.shift();)(i=e(this,B))==null||i.call(this,...o);}},vt);var ct=class{cache;map=new Map;constructor(t){this.cache=new te({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(t){let r=this.map.delete(t);return r&&this.cache.delete(t),r}get forEach(){return this.map.forEach}get(t){let r=this.cache.get(t);return r||this.map.get(t)}has(t){return this.map.has(t)}set(t,r){return this.map.set(t,r),this.cache.set(t,r),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var rt;(s=>(s.log=(o,...a)=>console.log(`[Pixi\u2019VN] ${o}`,...a),s.warn=(o,...a)=>console.warn(`[Pixi\u2019VN] ${o}`,...a),s.error=(o,...a)=>console.error(`[Pixi\u2019VN] ${o}`,...a),s.info=(o,...a)=>console.info(`[Pixi\u2019VN] ${o}`,...a)))(rt||={});function Nt(f){try{if(typeof f>"u")return f;let t=JSON.stringify(f);return JSON.parse(t)}catch(t){throw rt.error("Error creating exportable element",f,t),new core.PixiError("not_json_serializable","Error creating exportable element")}}var re;(d=>{d.storage=new ct({cacheSize:50}),d.defaultStorage=new ct({cacheSize:10}),d.tempStorageDeadlines=new Map;let i;function s(y){d.tempStorageDeadlines.forEach((T,E)=>{T>y&&(d.storage.delete(`${ft}:${E}`),i?.onClearOldTempVariable?.(E),d.tempStorageDeadlines.delete(E));});}d.clearOldTempVariables=s;function o(y){i=y;}d.setExternalStoreHandler=o;function a(y,T,E){E==null?d.storage.delete(`${y}:${T}`):d.storage.set(`${y}:${T}`,E),i?.onSetVariable?.(T,E);}d.setVariable=a;function h(y,T){let E=d.storage.get(`${y}:${T}`);return Nt(E)}d.getVariable=h;function l(y,T){d.storage.delete(`${y}:${T}`),i?.onRemoveVariable?.(T);}d.removeVariable=l;function S(y,T){let E=d.storage.get(Dt)||[];if(T)E.includes(y)||E.push(y);else {let b=E.indexOf(y);b>-1&&E.splice(b,1);}d.storage.set(Dt,E);}d.setFlag=S;function R(y){return (d.storage.get(Dt)||[]).includes(y)}d.getFlag=R;})(re||={});var m=re;var Ot=class{constructor(t,r){this.categoryId=t,this.id=r,this.migrateOldStorage();}migrateOldStorage(t=this.categoryId){let r=m.getVariable(st,t);r&&(Object.entries(r).forEach(([i,s])=>{typeof s=="object"&&s!==null&&Object.entries(s).forEach(([o,a])=>{m.setVariable(this.categoryId,`${i}:${o}`,a);});}),m.removeVariable(st,t));}id;categoryId;setStorageProperty(t,r){m.setVariable(this.categoryId,`${this.id}:${t}`,r);}getStorageProperty(t,r=this.id){return m.getVariable(this.categoryId,`${r}:${t}`)}};var fe="@",wt=class extends Ot{sourceId;constructor(t,r=""){super(z.CHARACTER_CATEGORY_KEY,t+(r?fe+r:"")),this.sourceId=t,this.migrateOldStorage("___character___");}getStorageProperty(t){let r=super.getStorageProperty(t);return r===void 0&&(r=super.getStorageProperty(t,this.sourceId)),r}};var zt=class extends wt{constructor(t,r){super(typeof t=="string"?t:t.id,typeof t=="string"?"":t.emotion),this.defaultName=r.name,this.defaultSurname=r.surname,this.defaultAge=r.age,this.icon=r.icon,this.color=r.color;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(t){this.setStorageProperty("name",t);}defaultSurname;get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(t){this.setStorageProperty("surname",t);}defaultAge;get age(){return this.getStorageProperty("age")||this.defaultAge}set age(t){this.setStorageProperty("age",t);}icon;color};var pt=new ct({cacheSize:10}),ie;(a=>{function f(h){try{let l=pt.get(h);if(!l){rt.warn(`Character "${h}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return l}catch(l){rt.error(`Error while getting Character "${h}"`,l);return}}a.get=f;function t(...h){for(let l of h){if(Array.isArray(l)){t(...l);continue}pt.get(l.id)&&rt.info(`Character id "${l.id}" already exists, it will be overwritten`),pt.set(l.id,l);}}a.add=t;function r(){return Array.from(pt.values())}a.values=r;function i(h){return pt.has(h)}a.has=i;function s(){return Array.from(pt.keys())}a.keys=s;function o(){pt.clear();}a.clear=o;})(ie||={});var ue=ie;exports.CharacterBaseModel=zt;exports.CharacterStoredClass=wt;exports.RegisteredCharacters=ue;
|
|
1
|
+
'use strict';var core=require('@drincs/pixi-vn/core');require('@drincs/pixi-vn/worker');var se=Object.defineProperty;var kt=f=>{throw TypeError(f)};var ae=(f,t,r)=>t in f?se(f,t,{enumerable:true,configurable:true,writable:true,value:r}):f[t]=r;var M=(f,t,r)=>ae(f,typeof t!="symbol"?t+"":t,r),Yt=(f,t,r)=>t.has(f)||kt("Cannot "+r);var e=(f,t,r)=>(Yt(f,t,"read from private field"),r?r.call(f):t.get(f)),_=(f,t,r)=>t.has(f)?kt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(f):t.set(f,r),u=(f,t,r,i)=>(Yt(f,t,"write to private field"),t.set(f,r),r),c=(f,t,r)=>(Yt(f,t,"access private method"),r);var Mt=(f,t,r,i)=>({set _(s){u(f,t,s);},get _(){return e(f,t,i)}});var st="storage",ft="temp",Ft="flags",z={CHARACTER_CATEGORY_KEY:"character"};var oe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,qt=new Set,Kt=typeof process=="object"&&process?process:{},Qt=(f,t,r,i)=>{typeof Kt.emitWarning=="function"?Kt.emitWarning(f,t,r,i):console.error(`[${r}] ${t}: ${f}`);},Vt=globalThis.AbortController,Bt=globalThis.AbortSignal;if(typeof Vt>"u"){Bt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(r,i){this._onabort.push(i);}},Vt=class{constructor(){t();}signal=new Bt;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=true;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r);}}};let f=Kt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{f&&(f=false,Qt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t));};}var ne=f=>!qt.has(f);var at=f=>f&&f===Math.floor(f)&&f>0&&isFinite(f),Zt=f=>at(f)?f<=Math.pow(2,8)?Uint8Array:f<=Math.pow(2,16)?Uint16Array:f<=Math.pow(2,32)?Uint32Array:f<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(f){super(f),this.fill(0);}},et,Et,he=(et=class{heap;length;static create(t){let r=Zt(t);if(!r)return [];u(et,Et,true);let i=new et(t,r);return u(et,Et,false),i}constructor(t,r){if(!e(et,Et))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0;}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}},Et=new WeakMap,_(et,Et,false),et),Xt,Jt,j,P,k,ut,B,Tt,yt,X,I,J,x,O,g,L,Y,F,C,q,N,Q,Z,K,W,tt,lt,V,bt,n,Wt,gt,it,Rt,H,ee,dt,At,Ct,ot,nt,Ht,Gt,Lt,v,$t,It,ht,jt,vt,te=(vt=class{constructor(t){_(this,n);_(this,j);_(this,P);_(this,k);_(this,ut);_(this,B);_(this,Tt);_(this,yt);_(this,X);M(this,"ttl");M(this,"ttlResolution");M(this,"ttlAutopurge");M(this,"updateAgeOnGet");M(this,"updateAgeOnHas");M(this,"allowStale");M(this,"noDisposeOnSet");M(this,"noUpdateTTL");M(this,"maxEntrySize");M(this,"sizeCalculation");M(this,"noDeleteOnFetchRejection");M(this,"noDeleteOnStaleGet");M(this,"allowStaleOnFetchAbort");M(this,"allowStaleOnFetchRejection");M(this,"ignoreFetchAbort");_(this,I);_(this,J);_(this,x);_(this,O);_(this,g);_(this,L);_(this,Y);_(this,F);_(this,C);_(this,q);_(this,N);_(this,Q);_(this,Z);_(this,K);_(this,W);_(this,tt);_(this,lt);_(this,V);_(this,bt);_(this,gt,()=>{});_(this,it,()=>{});_(this,Rt,()=>{});_(this,H,()=>false);_(this,dt,t=>{});_(this,At,(t,r,i)=>{});_(this,Ct,(t,r,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});M(this,Xt,"LRUCache");let{max:r=0,ttl:i,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:h,allowStale:l,dispose:S,onInsert:R,disposeAfter:d,noDisposeOnSet:y,noUpdateTTL:T,maxSize:E=0,maxEntrySize:b=0,sizeCalculation:A,fetchMethod:p,memoMethod:D,noDeleteOnFetchRejection:U,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:xt,ignoreFetchAbort:_t,perf:mt}=t;if(mt!==void 0&&typeof mt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,X,mt??oe),r!==0&&!at(r))throw new TypeError("max option must be a nonnegative integer");let St=r?Zt(r):Array;if(!St)throw new Error("invalid max value: "+r);if(u(this,j,r),u(this,P,E),this.maxEntrySize=b||e(this,P),this.sizeCalculation=A,this.sizeCalculation){if(!e(this,P)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(D!==void 0&&typeof D!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,yt,D),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,Tt,p),u(this,lt,!!p),u(this,x,new Map),u(this,O,new Array(r).fill(void 0)),u(this,g,new Array(r).fill(void 0)),u(this,L,new St(r)),u(this,Y,new St(r)),u(this,F,0),u(this,C,0),u(this,q,he.create(r)),u(this,I,0),u(this,J,0),typeof S=="function"&&u(this,k,S),typeof R=="function"&&u(this,ut,R),typeof d=="function"?(u(this,B,d),u(this,N,[])):(u(this,B,void 0),u(this,N,void 0)),u(this,tt,!!e(this,k)),u(this,bt,!!e(this,ut)),u(this,V,!!e(this,B)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!T,this.noDeleteOnFetchRejection=!!U,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!xt,this.ignoreFetchAbort=!!_t,this.maxEntrySize!==0){if(e(this,P)!==0&&!at(e(this,P)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");c(this,n,ee).call(this);}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!h,this.ttlResolution=at(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");c(this,n,Wt).call(this);}if(e(this,j)===0&&this.ttl===0&&e(this,P)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,j)&&!e(this,P)){let Pt="LRU_CACHE_UNBOUNDED";ne(Pt)&&(qt.add(Pt),Qt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,vt));}}get perf(){return e(this,X)}static unsafeExposeInternals(t){return {starts:e(t,Z),ttls:e(t,K),autopurgeTimers:e(t,W),sizes:e(t,Q),keyMap:e(t,x),keyList:e(t,O),valList:e(t,g),next:e(t,L),prev:e(t,Y),get head(){return e(t,F)},get tail(){return e(t,C)},free:e(t,q),isBackgroundFetch:r=>{var i;return c(i=t,n,v).call(i,r)},backgroundFetch:(r,i,s,o)=>{var a;return c(a=t,n,Lt).call(a,r,i,s,o)},moveToTail:r=>{var i;return c(i=t,n,It).call(i,r)},indexes:r=>{var i;return c(i=t,n,ot).call(i,r)},rindexes:r=>{var i;return c(i=t,n,nt).call(i,r)},isStale:r=>{var i;return e(i=t,H).call(i,r)}}}get max(){return e(this,j)}get maxSize(){return e(this,P)}get calculatedSize(){return e(this,J)}get size(){return e(this,I)}get fetchMethod(){return e(this,Tt)}get memoMethod(){return e(this,yt)}get dispose(){return e(this,k)}get onInsert(){return e(this,ut)}get disposeAfter(){return e(this,B)}getRemainingTTL(t){return e(this,x).has(t)?1/0:0}*entries(){for(let t of c(this,n,ot).call(this))e(this,g)[t]!==void 0&&e(this,O)[t]!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield [e(this,O)[t],e(this,g)[t]]);}*rentries(){for(let t of c(this,n,nt).call(this))e(this,g)[t]!==void 0&&e(this,O)[t]!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield [e(this,O)[t],e(this,g)[t]]);}*keys(){for(let t of c(this,n,ot).call(this)){let r=e(this,O)[t];r!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield r);}}*rkeys(){for(let t of c(this,n,nt).call(this)){let r=e(this,O)[t];r!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield r);}}*values(){for(let t of c(this,n,ot).call(this))e(this,g)[t]!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield e(this,g)[t]);}*rvalues(){for(let t of c(this,n,nt).call(this))e(this,g)[t]!==void 0&&!c(this,n,v).call(this,e(this,g)[t])&&(yield e(this,g)[t]);}[(Jt=Symbol.iterator,Xt=Symbol.toStringTag,Jt)](){return this.entries()}find(t,r={}){for(let i of c(this,n,ot).call(this)){let s=e(this,g)[i],o=c(this,n,v).call(this,s)?s.__staleWhileFetching:s;if(o!==void 0&&t(o,e(this,O)[i],this))return this.get(e(this,O)[i],r)}}forEach(t,r=this){for(let i of c(this,n,ot).call(this)){let s=e(this,g)[i],o=c(this,n,v).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&t.call(r,o,e(this,O)[i],this);}}rforEach(t,r=this){for(let i of c(this,n,nt).call(this)){let s=e(this,g)[i],o=c(this,n,v).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&t.call(r,o,e(this,O)[i],this);}}purgeStale(){let t=false;for(let r of c(this,n,nt).call(this,{allowStale:true}))e(this,H).call(this,r)&&(c(this,n,ht).call(this,e(this,O)[r],"expire"),t=true);return t}info(t){let r=e(this,x).get(t);if(r===void 0)return;let i=e(this,g)[r],s=c(this,n,v).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let o={value:s};if(e(this,K)&&e(this,Z)){let a=e(this,K)[r],h=e(this,Z)[r];if(a&&h){let l=a-(e(this,X).now()-h);o.ttl=l,o.start=Date.now();}}return e(this,Q)&&(o.size=e(this,Q)[r]),o}dump(){let t=[];for(let r of c(this,n,ot).call(this,{allowStale:true})){let i=e(this,O)[r],s=e(this,g)[r],o=c(this,n,v).call(this,s)?s.__staleWhileFetching:s;if(o===void 0||i===void 0)continue;let a={value:o};if(e(this,K)&&e(this,Z)){a.ttl=e(this,K)[r];let h=e(this,X).now()-e(this,Z)[r];a.start=Math.floor(Date.now()-h);}e(this,Q)&&(a.size=e(this,Q)[r]),t.unshift([i,a]);}return t}load(t){this.clear();for(let[r,i]of t){if(i.start){let s=Date.now()-i.start;i.start=e(this,X).now()-s;}this.set(r,i.value,i);}}set(t,r,i={}){var y,T,E,b;if(r===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:l}=i,{noUpdateTTL:S=this.noUpdateTTL}=i,R=e(this,Ct).call(this,t,r,i.size||0,h);if(this.maxEntrySize&&R>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),c(this,n,ht).call(this,t,"set"),this;let d=e(this,I)===0?void 0:e(this,x).get(t);if(d===void 0)d=e(this,I)===0?e(this,C):e(this,q).length!==0?e(this,q).pop():e(this,I)===e(this,j)?c(this,n,Gt).call(this,false):e(this,I),e(this,O)[d]=t,e(this,g)[d]=r,e(this,x).set(t,d),e(this,L)[e(this,C)]=d,e(this,Y)[d]=e(this,C),u(this,C,d),Mt(this,I)._++,e(this,At).call(this,d,R,l),l&&(l.set="add"),S=false,e(this,bt)&&((y=e(this,ut))==null||y.call(this,r,t,"add"));else {c(this,n,It).call(this,d);let A=e(this,g)[d];if(r!==A){if(e(this,lt)&&c(this,n,v).call(this,A)){A.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=A;p!==void 0&&!a&&(e(this,tt)&&((T=e(this,k))==null||T.call(this,p,t,"set")),e(this,V)&&e(this,N)?.push([p,t,"set"]));}else a||(e(this,tt)&&((E=e(this,k))==null||E.call(this,A,t,"set")),e(this,V)&&e(this,N)?.push([A,t,"set"]));if(e(this,dt).call(this,d),e(this,At).call(this,d,R,l),e(this,g)[d]=r,l){l.set="replace";let p=A&&c(this,n,v).call(this,A)?A.__staleWhileFetching:A;p!==void 0&&(l.oldValue=p);}}else l&&(l.set="update");e(this,bt)&&this.onInsert?.(r,t,r===A?"update":"replace");}if(s!==0&&!e(this,K)&&c(this,n,Wt).call(this),e(this,K)&&(S||e(this,Rt).call(this,d,s,o),l&&e(this,it).call(this,l,d)),!a&&e(this,V)&&e(this,N)){let A=e(this,N),p;for(;p=A?.shift();)(b=e(this,B))==null||b.call(this,...p);}return this}pop(){var t;try{for(;e(this,I);){let r=e(this,g)[e(this,F)];if(c(this,n,Gt).call(this,!0),c(this,n,v).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(e(this,V)&&e(this,N)){let r=e(this,N),i;for(;i=r?.shift();)(t=e(this,B))==null||t.call(this,...i);}}}has(t,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=r,o=e(this,x).get(t);if(o!==void 0){let a=e(this,g)[o];if(c(this,n,v).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(e(this,H).call(this,o))s&&(s.has="stale",e(this,it).call(this,s,o));else return i&&e(this,gt).call(this,o),s&&(s.has="hit",e(this,it).call(this,s,o)),true}else s&&(s.has="miss");return false}peek(t,r={}){let{allowStale:i=this.allowStale}=r,s=e(this,x).get(t);if(s===void 0||!i&&e(this,H).call(this,s))return;let o=e(this,g)[s];return c(this,n,v).call(this,o)?o.__staleWhileFetching:o}async fetch(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:l=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:T=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:b,forceRefresh:A=false,status:p,signal:D}=r;if(!e(this,lt))return p&&(p.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:p});let U={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:h,size:l,sizeCalculation:S,noUpdateTTL:R,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:E,ignoreFetchAbort:T,status:p,signal:D},G=e(this,x).get(t);if(G===void 0){p&&(p.fetch="miss");let w=c(this,n,Lt).call(this,t,G,U,b);return w.__returned=w}else {let w=e(this,g)[G];if(c(this,n,v).call(this,w)){let St=i&&w.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",St&&(p.returnedStale=true)),St?w.__staleWhileFetching:w.__returned=w}let xt=e(this,H).call(this,G);if(!A&&!xt)return p&&(p.fetch="hit"),c(this,n,It).call(this,G),s&&e(this,gt).call(this,G),p&&e(this,it).call(this,p,G),w;let _t=c(this,n,Lt).call(this,t,G,U,b),mt=_t.__staleWhileFetching!==void 0&&i;return p&&(p.fetch=xt?"stale":"refresh",mt&&xt&&(p.returnedStale=true)),mt?_t.__staleWhileFetching:_t.__returned=_t}}async forceFetch(t,r={}){let i=await this.fetch(t,r);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,r={}){let i=e(this,yt);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:o,...a}=r,h=this.get(t,a);if(!o&&h!==void 0)return h;let l=i(t,h,{options:a,context:s});return this.set(t,l,a),l}get(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=r,h=e(this,x).get(t);if(h!==void 0){let l=e(this,g)[h],S=c(this,n,v).call(this,l);return a&&e(this,it).call(this,a,h),e(this,H).call(this,h)?(a&&(a.get="stale"),S?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=true),i?l.__staleWhileFetching:void 0):(o||c(this,n,ht).call(this,t,"expire"),a&&i&&(a.returnedStale=true),i?l:void 0)):(a&&(a.get="hit"),S?l.__staleWhileFetching:(c(this,n,It).call(this,h),s&&e(this,gt).call(this,h),l))}else a&&(a.get="miss");}delete(t){return c(this,n,ht).call(this,t,"delete")}clear(){return c(this,n,jt).call(this,"delete")}},j=new WeakMap,P=new WeakMap,k=new WeakMap,ut=new WeakMap,B=new WeakMap,Tt=new WeakMap,yt=new WeakMap,X=new WeakMap,I=new WeakMap,J=new WeakMap,x=new WeakMap,O=new WeakMap,g=new WeakMap,L=new WeakMap,Y=new WeakMap,F=new WeakMap,C=new WeakMap,q=new WeakMap,N=new WeakMap,Q=new WeakMap,Z=new WeakMap,K=new WeakMap,W=new WeakMap,tt=new WeakMap,lt=new WeakMap,V=new WeakMap,bt=new WeakMap,n=new WeakSet,Wt=function(){let t=new Dt(e(this,j)),r=new Dt(e(this,j));u(this,K,t),u(this,Z,r);let i=this.ttlAutopurge?new Array(e(this,j)):void 0;u(this,W,i),u(this,Rt,(h,l,S=e(this,X).now())=>{r[h]=l!==0?S:0,t[h]=l,s(h,l);}),u(this,gt,h=>{r[h]=t[h]!==0?e(this,X).now():0,s(h,t[h]);});let s=this.ttlAutopurge?(h,l)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),l&&l!==0&&i){let S=setTimeout(()=>{e(this,H).call(this,h)&&c(this,n,ht).call(this,e(this,O)[h],"expire");},l+1);S.unref&&S.unref(),i[h]=S;}}:()=>{};u(this,it,(h,l)=>{if(t[l]){let S=t[l],R=r[l];if(!S||!R)return;h.ttl=S,h.start=R,h.now=o||a();let d=h.now-R;h.remainingTTL=S-d;}});let o=0,a=()=>{let h=e(this,X).now();if(this.ttlResolution>0){o=h;let l=setTimeout(()=>o=0,this.ttlResolution);l.unref&&l.unref();}return h};this.getRemainingTTL=h=>{let l=e(this,x).get(h);if(l===void 0)return 0;let S=t[l],R=r[l];if(!S||!R)return 1/0;let d=(o||a())-R;return S-d},u(this,H,h=>{let l=r[h],S=t[h];return !!S&&!!l&&(o||a())-l>S});},gt=new WeakMap,it=new WeakMap,Rt=new WeakMap,H=new WeakMap,ee=function(){let t=new Dt(e(this,j));u(this,J,0),u(this,Q,t),u(this,dt,r=>{u(this,J,e(this,J)-t[r]),t[r]=0;}),u(this,Ct,(r,i,s,o)=>{if(c(this,n,v).call(this,i))return 0;if(!at(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(i,r),!at(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),u(this,At,(r,i,s)=>{if(t[r]=i,e(this,P)){let o=e(this,P)-t[r];for(;e(this,J)>o;)c(this,n,Gt).call(this,true);}u(this,J,e(this,J)+t[r]),s&&(s.entrySize=i,s.totalCalculatedSize=e(this,J));});},dt=new WeakMap,At=new WeakMap,Ct=new WeakMap,ot=function*({allowStale:t=this.allowStale}={}){if(e(this,I))for(let r=e(this,C);!(!c(this,n,Ht).call(this,r)||((t||!e(this,H).call(this,r))&&(yield r),r===e(this,F)));)r=e(this,Y)[r];},nt=function*({allowStale:t=this.allowStale}={}){if(e(this,I))for(let r=e(this,F);!(!c(this,n,Ht).call(this,r)||((t||!e(this,H).call(this,r))&&(yield r),r===e(this,C)));)r=e(this,L)[r];},Ht=function(t){return t!==void 0&&e(this,x).get(e(this,O)[t])===t},Gt=function(t){var o;let r=e(this,F),i=e(this,O)[r],s=e(this,g)[r];return e(this,lt)&&c(this,n,v).call(this,s)?s.__abortController.abort(new Error("evicted")):(e(this,tt)||e(this,V))&&(e(this,tt)&&((o=e(this,k))==null||o.call(this,s,i,"evict")),e(this,V)&&e(this,N)?.push([s,i,"evict"])),e(this,dt).call(this,r),e(this,W)?.[r]&&(clearTimeout(e(this,W)[r]),e(this,W)[r]=void 0),t&&(e(this,O)[r]=void 0,e(this,g)[r]=void 0,e(this,q).push(r)),e(this,I)===1?(u(this,F,u(this,C,0)),e(this,q).length=0):u(this,F,e(this,L)[r]),e(this,x).delete(i),Mt(this,I)._--,r},Lt=function(t,r,i,s){let o=r===void 0?void 0:e(this,g)[r];if(c(this,n,v).call(this,o))return o;let a=new Vt,{signal:h}=i;h?.addEventListener("abort",()=>a.abort(h.reason),{signal:a.signal});let l={signal:a.signal,options:i,context:s},S=(b,A=false)=>{let{aborted:p}=a.signal,D=i.ignoreFetchAbort&&b!==void 0,U=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&b!==void 0);if(i.status&&(p&&!A?(i.status.fetchAborted=true,i.status.fetchError=a.signal.reason,D&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),p&&!D&&!A)return d(a.signal.reason,U);let G=T,w=e(this,g)[r];return (w===T||D&&A&&w===void 0)&&(b===void 0?G.__staleWhileFetching!==void 0?e(this,g)[r]=G.__staleWhileFetching:c(this,n,ht).call(this,t,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(t,b,l.options))),b},R=b=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=b),d(b,false)),d=(b,A)=>{let{aborted:p}=a.signal,D=p&&i.allowStaleOnFetchAbort,U=D||i.allowStaleOnFetchRejection,G=U||i.noDeleteOnFetchRejection,w=T;if(e(this,g)[r]===T&&(!G||!A&&w.__staleWhileFetching===void 0?c(this,n,ht).call(this,t,"fetch"):D||(e(this,g)[r]=w.__staleWhileFetching)),U)return i.status&&w.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),w.__staleWhileFetching;if(w.__returned===w)throw b},y=(b,A)=>{var D;let p=(D=e(this,Tt))==null?void 0:D.call(this,t,o,l);p&&p instanceof Promise&&p.then(U=>b(U===void 0?void 0:U),A),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=U=>S(U,true)));});};i.status&&(i.status.fetchDispatched=true);let T=new Promise(y).then(S,R),E=Object.assign(T,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(t,E,{...l.options,status:void 0}),r=e(this,x).get(t)):e(this,g)[r]=E,E},v=function(t){if(!e(this,lt))return false;let r=t;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Vt},$t=function(t,r){e(this,Y)[r]=t,e(this,L)[t]=r;},It=function(t){t!==e(this,C)&&(t===e(this,F)?u(this,F,e(this,L)[t]):c(this,n,$t).call(this,e(this,Y)[t],e(this,L)[t]),c(this,n,$t).call(this,e(this,C),t),u(this,C,t));},ht=function(t,r){var s,o;let i=false;if(e(this,I)!==0){let a=e(this,x).get(t);if(a!==void 0)if(e(this,W)?.[a]&&(clearTimeout(e(this,W)?.[a]),e(this,W)[a]=void 0),i=true,e(this,I)===1)c(this,n,jt).call(this,r);else {e(this,dt).call(this,a);let h=e(this,g)[a];if(c(this,n,v).call(this,h)?h.__abortController.abort(new Error("deleted")):(e(this,tt)||e(this,V))&&(e(this,tt)&&((s=e(this,k))==null||s.call(this,h,t,r)),e(this,V)&&e(this,N)?.push([h,t,r])),e(this,x).delete(t),e(this,O)[a]=void 0,e(this,g)[a]=void 0,a===e(this,C))u(this,C,e(this,Y)[a]);else if(a===e(this,F))u(this,F,e(this,L)[a]);else {let l=e(this,Y)[a];e(this,L)[l]=e(this,L)[a];let S=e(this,L)[a];e(this,Y)[S]=e(this,Y)[a];}Mt(this,I)._--,e(this,q).push(a);}}if(e(this,V)&&e(this,N)?.length){let a=e(this,N),h;for(;h=a?.shift();)(o=e(this,B))==null||o.call(this,...h);}return i},jt=function(t){var r,i;for(let s of c(this,n,nt).call(this,{allowStale:true})){let o=e(this,g)[s];if(c(this,n,v).call(this,o))o.__abortController.abort(new Error("deleted"));else {let a=e(this,O)[s];e(this,tt)&&((r=e(this,k))==null||r.call(this,o,a,t)),e(this,V)&&e(this,N)?.push([o,a,t]);}}if(e(this,x).clear(),e(this,g).fill(void 0),e(this,O).fill(void 0),e(this,K)&&e(this,Z)){e(this,K).fill(0),e(this,Z).fill(0);for(let s of e(this,W)??[])s!==void 0&&clearTimeout(s);e(this,W)?.fill(void 0);}if(e(this,Q)&&e(this,Q).fill(0),u(this,F,0),u(this,C,0),e(this,q).length=0,u(this,J,0),u(this,I,0),e(this,V)&&e(this,N)){let s=e(this,N),o;for(;o=s?.shift();)(i=e(this,B))==null||i.call(this,...o);}},vt);var ct=class{cache;map=new Map;constructor(t){this.cache=new te({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(t){let r=this.map.delete(t);return r&&this.cache.delete(t),r}get forEach(){return this.map.forEach}get(t){let r=this.cache.get(t);return r||this.map.get(t)}has(t){return this.map.has(t)}set(t,r){return this.map.set(t,r),this.cache.set(t,r),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var rt;(s=>(s.log=(o,...a)=>console.log(`[Pixi\u2019VN] ${o}`,...a),s.warn=(o,...a)=>console.warn(`[Pixi\u2019VN] ${o}`,...a),s.error=(o,...a)=>console.error(`[Pixi\u2019VN] ${o}`,...a),s.info=(o,...a)=>console.info(`[Pixi\u2019VN] ${o}`,...a)))(rt||={});function Ut(f){try{if(typeof f>"u")return f;let t=JSON.stringify(f);return JSON.parse(t)}catch(t){throw rt.error("Error creating exportable element",f,t),new core.PixiError("not_json_serializable","Error creating exportable element")}}var re;(d=>{d.storage=new ct({cacheSize:50}),d.defaultStorage=new ct({cacheSize:10}),d.tempStorageDeadlines=new Map;let i;function s(y){d.tempStorageDeadlines.forEach((T,E)=>{T>y&&(d.storage.delete(`${ft}:${E}`),i?.onClearOldTempVariable?.(E),d.tempStorageDeadlines.delete(E));});}d.clearOldTempVariables=s;function o(y){i=y;}d.setExternalStoreHandler=o;function a(y,T,E){E==null?d.storage.delete(`${y}:${T}`):d.storage.set(`${y}:${T}`,E),i?.onSetVariable?.(T,E);}d.setVariable=a;function h(y,T){let E=d.storage.get(`${y}:${T}`);return Ut(E)}d.getVariable=h;function l(y,T){d.storage.delete(`${y}:${T}`),i?.onRemoveVariable?.(T);}d.removeVariable=l;function S(y,T){let E=d.storage.get(Ft)||[];if(T)E.includes(y)||E.push(y);else {let b=E.indexOf(y);b>-1&&E.splice(b,1);}d.storage.set(Ft,E);}d.setFlag=S;function R(y){return (d.storage.get(Ft)||[]).includes(y)}d.getFlag=R;})(re||={});var m=re;var Ot=class{constructor(t,r){this.categoryId=t,this.id=r,this.migrateOldStorage();}migrateOldStorage(t=this.categoryId){let r=m.getVariable(st,t);r&&(Object.entries(r).forEach(([i,s])=>{typeof s=="object"&&s!==null&&Object.entries(s).forEach(([o,a])=>{m.setVariable(this.categoryId,`${i}:${o}`,a);});}),m.removeVariable(st,t));}id;categoryId;setStorageProperty(t,r){m.setVariable(this.categoryId,`${this.id}:${t}`,r);}getStorageProperty(t,r=this.id){return m.getVariable(this.categoryId,`${r}:${t}`)}};var ue="@",wt=class extends Ot{sourceId;constructor(t,r=""){super(z.CHARACTER_CATEGORY_KEY,t+(r?ue+r:"")),this.sourceId=t,this.migrateOldStorage("___character___");}getStorageProperty(t){let r=super.getStorageProperty(t);return r===void 0&&(r=super.getStorageProperty(t,this.sourceId)),r}};var zt=class extends wt{constructor(t,r){super(typeof t=="string"?t:t.id,typeof t=="string"?"":t.emotion),this.defaultName=r.name,this.defaultSurname=r.surname,this.defaultAge=r.age,this.icon=r.icon,this.color=r.color;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(t){this.setStorageProperty("name",t);}defaultSurname;get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(t){this.setStorageProperty("surname",t);}defaultAge;get age(){return this.getStorageProperty("age")||this.defaultAge}set age(t){this.setStorageProperty("age",t);}icon;color};var pt=new ct({cacheSize:10}),ie;(a=>{function f(h){try{let l=pt.get(h);if(!l){rt.warn(`Character "${h}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return l}catch(l){rt.error(`Error while getting Character "${h}"`,l);return}}a.get=f;function t(...h){for(let l of h){if(Array.isArray(l)){t(...l);continue}pt.get(l.id)&&rt.info(`Character id "${l.id}" already exists, it will be overwritten`),pt.set(l.id,l);}}a.add=t;function r(){return Array.from(pt.values())}a.values=r;function i(h){return pt.has(h)}a.has=i;function s(){return Array.from(pt.keys())}a.keys=s;function o(){pt.clear();}a.clear=o;})(ie||={});var ge=ie;exports.CharacterBaseModel=zt;exports.CharacterStoredClass=wt;exports.RegisteredCharacters=ge;
|
package/dist/characters.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-6OABTG5R.mjs';import {m}from'./chunk-HD353M4B.mjs';import'./chunk-S7HZUIEI.mjs';import {d,e}from'./chunk-AW5XWF24.mjs';var g="@",n=class extends b{sourceId;constructor(e,r=""){super(m.CHARACTER_CATEGORY_KEY,e+(r?g+r:"")),this.sourceId=e,this.migrateOldStorage("___character___");}getStorageProperty(e){let r=super.getStorageProperty(e);return r===void 0&&(r=super.getStorageProperty(e,this.sourceId)),r}};var i=class extends n{constructor(e,r){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion),this.defaultName=r.name,this.defaultSurname=r.surname,this.defaultAge=r.age,this.icon=r.icon,this.color=r.color;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}defaultSurname;get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}defaultAge;get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}icon;color};var o=new d({cacheSize:10}),h;(C=>{function c(a){try{let t=o.get(a);if(!t){e.warn(`Character "${a}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return t}catch(t){e.error(`Error while getting Character "${a}"`,t);return}}C.get=c;function e$1(...a){for(let t of a){if(Array.isArray(t)){e$1(...t);continue}o.get(t.id)&&e.info(`Character id "${t.id}" already exists, it will be overwritten`),o.set(t.id,t);}}C.add=e$1;function r(){return Array.from(o.values())}C.values=r;function m(a){return o.has(a)}C.has=m;function l(){return Array.from(o.keys())}C.keys=l;function y(){o.clear();}C.clear=y;})(h||={});var p=h;export{i as CharacterBaseModel,n as CharacterStoredClass,p as RegisteredCharacters};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,a}from'./chunk-
|
|
1
|
+
import {b,a}from'./chunk-AW5XWF24.mjs';var L=b((S,I)=>{(function(w,o){typeof S=="object"?I.exports=S=o():typeof define=="function"&&define.amd?define([],o):w.CryptoJS=o();})(S,function(){var w=w||(function(o,x){var a$1;if(typeof window<"u"&&window.crypto&&(a$1=window.crypto),typeof self<"u"&&self.crypto&&(a$1=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a$1=globalThis.crypto),!a$1&&typeof window<"u"&&window.msCrypto&&(a$1=window.msCrypto),!a$1&&typeof global<"u"&&global.crypto&&(a$1=global.crypto),!a$1&&typeof a=="function")try{a$1=a("crypto");}catch{}var _=function(){if(a$1){if(typeof a$1.getRandomValues=="function")try{return a$1.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a$1.randomBytes=="function")try{return a$1.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||(function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}})(),d={},B=d.lib={},u=B.Base=(function(){return {extend:function(t){var e=C(this);return t&&e.mixIn(t),(!e.hasOwnProperty("init")||this.init===e.init)&&(e.init=function(){e.$super.init.apply(this,arguments);}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),l=B.WordArray=u.extend({init:function(t,e){t=this.words=t||[],e!=x?this.sigBytes=e:this.sigBytes=t.length*4;},toString:function(t){return (t||v).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,f=t.sigBytes;if(this.clamp(),r%4)for(var c=0;c<f;c++){var z=n[c>>>2]>>>24-c%4*8&255;e[r+c>>>2]|=z<<24-(r+c)%4*8;}else for(var g=0;g<f;g+=4)e[r+g>>>2]=n[g>>>2];return this.sigBytes+=f,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=o.ceil(e/4);},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(_());return new l.init(e,t)}}),i=d.enc={},v=i.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],f=0;f<n;f++){var c=e[f>>>2]>>>24-f%4*8&255;r.push((c>>>4).toString(16)),r.push((c&15).toString(16));}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new l.init(n,e/2)}},h=i.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],f=0;f<n;f++){var c=e[f>>>2]>>>24-f%4*8&255;r.push(String.fromCharCode(c));}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(t.charCodeAt(r)&255)<<24-r%4*8;return new l.init(n,e)}},p=i.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},y=B.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(t){typeof t=="string"&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes;},_process:function(t){var e,n=this._data,r=n.words,f=n.sigBytes,c=this.blockSize,z=c*4,g=f/z;t?g=o.ceil(g):g=o.max((g|0)-this._minBufferSize,0);var b=g*c,R=o.min(b*4,f);if(b){for(var A=0;A<b;A+=c)this._doProcessBlock(r,A);e=r.splice(0,b),n.sigBytes-=R;}return new l.init(e,R)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});B.Hasher=y.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset();},reset:function(){y.reset.call(this),this._doReset();},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:512/32,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new s.HMAC.init(t,n).finalize(e)}}});var s=d.algo={};return d})(Math);return w});});var T=b((H,P)=>{(function(w,o){typeof H=="object"?P.exports=H=o(L()):typeof define=="function"&&define.amd?define(["./core"],o):o(w.CryptoJS);})(H,function(w){return (function(){var o=w,x=o.lib,a=x.WordArray,_=x.Hasher,C=o.algo,d=[],B=C.SHA1=_.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var i=this._hash.words,v=i[0],h=i[1],p=i[2],y=i[3],m=i[4],s=0;s<80;s++){if(s<16)d[s]=u[l+s]|0;else {var t=d[s-3]^d[s-8]^d[s-14]^d[s-16];d[s]=t<<1|t>>>31;}var e=(v<<5|v>>>27)+m+d[s];s<20?e+=(h&p|~h&y)+1518500249:s<40?e+=(h^p^y)+1859775393:s<60?e+=(h&p|h&y|p&y)-1894007588:e+=(h^p^y)-899497514,m=y,y=p,p=h<<30|h>>>2,h=v,v=e;}i[0]=i[0]+v|0,i[1]=i[1]+h|0,i[2]=i[2]+p|0,i[3]=i[3]+y|0,i[4]=i[4]+m|0;},_doFinalize:function(){var u=this._data,l=u.words,i=this._nDataBytes*8,v=u.sigBytes*8;return l[v>>>5]|=128<<24-v%32,l[(v+64>>>9<<4)+14]=Math.floor(i/4294967296),l[(v+64>>>9<<4)+15]=i,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=_.clone.call(this);return u._hash=this._hash.clone(),u}});o.SHA1=_._createHelper(B),o.HmacSHA1=_._createHmacHelper(B);})(),w.SHA1});});export{T as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {j,l,i,k as k$1,m}from'./chunk-HD353M4B.mjs';import {a as a$1}from'./chunk-S7HZUIEI.mjs';import {d as d$1,e}from'./chunk-AW5XWF24.mjs';import {GameUnifier}from'@drincs/pixi-vn/core';import {cloneMaybeOffloaded}from'@drincs/pixi-vn/worker';var I;(n=>{n.storage=new d$1({cacheSize:50}),n.defaultStorage=new d$1({cacheSize:10}),n.tempStorageDeadlines=new Map;let s;function c(r){n.tempStorageDeadlines.forEach((i,o)=>{i>r&&(n.storage.delete(`${j}:${o}`),s?.onClearOldTempVariable?.(o),n.tempStorageDeadlines.delete(o));});}n.clearOldTempVariables=c;function T(r){s=r;}n.setExternalStoreHandler=T;function y(r,i,o){o==null?n.storage.delete(`${r}:${i}`):n.storage.set(`${r}:${i}`,o),s?.onSetVariable?.(i,o);}n.setVariable=y;function V(r,i){let o=n.storage.get(`${r}:${i}`);return a$1(o)}n.getVariable=V;function M(r,i){n.storage.delete(`${r}:${i}`),s?.onRemoveVariable?.(i);}n.removeVariable=M;function R(r,i){let o=n.storage.get(l)||[];if(i)o.includes(r)||o.push(r);else {let h=o.indexOf(r);h>-1&&o.splice(h,1);}n.storage.set(l,o);}n.setFlag=R;function v(r){return (n.storage.get(l)||[]).includes(r)}n.getFlag=v;})(I||={});var a=I;var _=class{get base(){return a.storage.map}get cache(){return a.storage.cache}get tempStorageDeadlines(){return a.tempStorageDeadlines}set default(t){Object.entries(t).forEach(([e,s])=>{a.defaultStorage.map.set(e,s);});}temp={set:(t,e)=>this.setTemp(t,e),remove:t=>this.removeTemp(t),get deadlines(){return a.tempStorageDeadlines}};flags={set:(t,e)=>a.setFlag(t,e),get:t=>a.getFlag(t)};set(t,e){return a.setVariable(i,t,e)}get(t){let e=a.getVariable(j,t);return e===void 0&&(e=a.getVariable(i,t)),e===void 0&&(e=a$1(a.defaultStorage.get(t))),e}remove(t){return this.temp.remove(t),a.removeVariable(i,t)}setTemp(t,e){if(e==null){this.temp.remove(t);return}else a.setVariable(j,t,e),this.temp.deadlines.has(t)||this.temp.deadlines.set(t,GameUnifier.openedLabels);}removeTemp(t){a.removeVariable(j,t),this.temp.deadlines.has(t)&&this.temp.deadlines.delete(t);}setTempVariable(t,e){this.temp.set(t,e);}removeTempVariable(t){this.temp.remove(t);}setFlag(t,e){this.flags.set(t,e);}getFlag(t){return this.flags.get(t)}setStorageHandler(t){a.setExternalStoreHandler(t);}clear(){this.base.clear(),this.cache.clear(),this.temp.deadlines.clear();}async export(){let t=[];[...this.base.keys()].forEach(s=>{t.push({key:s,value:this.base.get(s)});});let e=[];return [...this.temp.deadlines.keys()].forEach(s=>{e.push({key:s,value:this.temp.deadlines.get(s)});}),cloneMaybeOffloaded({main:t,tempDeadlines:e})}restore(t){this.clear();try{t?(t.base?.forEach(e=>{switch(e.key){case "___current_dialogue_memory___":a.setVariable(k$1,m.CURRENT_DIALOGUE_MEMORY_KEY,e.value);break;case "___last_dialogue_added_in_step_memory___":a.setVariable(k$1,m.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_menu_options_memory___":a.setVariable(k$1,m.CURRENT_MENU_OPTIONS_MEMORY_KEY,e.value);break;case "___last_menu_options_added_in_step_memory___":a.setVariable(k$1,m.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "_input_value_":a.setVariable(k$1,m.CURRENT_INPUT_VALUE_MEMORY_KEY,e.value);break;case "___last_input_added_in_step_memory___":a.setVariable(k$1,m.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_input_info_memory___":a.setVariable(k$1,m.CURRENT_INPUT_INFO_MEMORY_KEY,e.value);break;case "___opened_labels_counter___":a.setVariable(k$1,m.OPENED_LABELS_COUNTER_KEY,e.value);break;case "___all_choices_made___":a.setVariable(k$1,m.ALL_CHOICES_MADE_KEY,e.value);break;case "___current_step_times_counter___":a.setVariable(k$1,m.CURRENT_STEP_TIMES_COUNTER_KEY,e.value);break;case "___last_step_glued___":a.setVariable(k$1,m.LAST_STEP_GLUED,e.value);break;default:a.setVariable(i,e.key,e.value);}}),t.temp?.forEach(e=>{a.setVariable(j,e.key,e.value);}),t.flags?.forEach(e=>{a.setFlag(e,!0);}),t.main?.forEach(e=>{this.base.set(e.key,e.value);}),t.tempDeadlines?.forEach(e=>{this.temp.deadlines.set(e.key,e.value);})):e.warn("No storage data found");}catch(e$1){e.error("Error importing data",e$1);}}};var d=class{constructor(t,e){this.categoryId=t,this.id=e,this.migrateOldStorage();}migrateOldStorage(t=this.categoryId){let e=a.getVariable(i,t);e&&(Object.entries(e).forEach(([s,c])=>{typeof c=="object"&&c!==null&&Object.entries(c).forEach(([T,y])=>{a.setVariable(this.categoryId,`${s}:${T}`,y);});}),a.removeVariable(i,t));}id;categoryId;setStorageProperty(t,e){a.setVariable(this.categoryId,`${this.id}:${t}`,e);}getStorageProperty(t,e=this.id){return a.getVariable(this.categoryId,`${e}:${t}`)}};var k=new _;export{a,d as b,k as c};
|