@drincs/pixi-vn 1.7.2 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HistoryChoiceMenuOption-DM4wqiGt.d.ts → HistoryChoiceMenuOption-BP9Tsbyd.d.ts} +1 -2
- package/dist/{HistoryChoiceMenuOption-iazqoVVm.d.cts → HistoryChoiceMenuOption-DSSNUXEq.d.cts} +1 -2
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.mjs +1 -1
- package/dist/characters.mjs +1 -1
- package/dist/{chunk-X4NBVTSJ.mjs → chunk-3SLELYPF.mjs} +1 -1
- package/dist/chunk-6HI66YQL.mjs +1 -0
- package/dist/chunk-XYO5SLSM.mjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.mjs +1 -1
- package/dist/history.d.cts +1 -1
- package/dist/history.d.ts +1 -1
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +272 -166
- package/dist/index.d.ts +272 -166
- package/dist/index.mjs +2 -2
- package/dist/narration.cjs +2 -2
- package/dist/narration.d.cts +3 -3
- package/dist/narration.d.ts +3 -3
- package/dist/narration.mjs +2 -2
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +326 -181
- package/dist/sound.d.ts +326 -181
- package/dist/sound.mjs +1 -1
- package/dist/storage.mjs +1 -1
- package/package.json +11 -8
- package/dist/chunk-4KCAZKAJ.mjs +0 -1
- package/dist/chunk-HNGW4ITF.mjs +0 -1
- package/dist/chunk-YDNEIPJP.mjs +0 -1
package/dist/characters.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-XYO5SLSM.mjs';import {n}from'./chunk-IWAXXFXE.mjs';import {e,f,d as d$1}from'./chunk-6HI66YQL.mjs';var l="@",i=class extends b{constructor(e,r=""){super(n.CHARACTER_CATEGORY_KEY,e+(r?l+r:""));d$1(this,"sourceId");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 u=class extends i{constructor(e,r){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion);d$1(this,"defaultName");d$1(this,"defaultSurname");d$1(this,"defaultAge");d$1(this,"_icon");d$1(this,"_color");this.defaultName=r.name,this.defaultSurname=r.surname,this.defaultAge=r.age,this._icon=r.icon,this._color=r.color;}get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}get icon(){return this._icon}get color(){return this._color}};var s=new e({cacheSize:10}),d;(y=>{function f$1(t){try{let n=s.get(t);if(!n){f.warn(`Character "${t}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return n}catch(n){f.error(`Error while getting Character "${t}"`,n);return}}y.get=f$1;function g(t){if(Array.isArray(t)){t.forEach(n=>{g(n);});return}s.get(t.id)&&f.info(`Character id "${t.id}" already exists, it will be overwritten`),s.set(t.id,t);}y.add=g;function e(){return Array.from(s.values())}y.values=e;function r(t){return s.has(t)}y.has=r;function C(){return Array.from(s.keys())}y.keys=C;})(d||(d={}));var p=d;export{u as CharacterBaseModel,i as CharacterStoredClass,p as RegisteredCharacters};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,a}from'./chunk-
|
|
1
|
+
import {b,a}from'./chunk-6HI66YQL.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 {PixiError}from'@drincs/pixi-vn/core';var Kt=Object.create;var Tt=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var Bt=Object.getOwnPropertyNames;var Jt=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty;var Gt=l=>{throw TypeError(l)};var Xt=(l,e,i)=>e in l?Tt(l,e,{enumerable:true,configurable:true,writable:true,value:i}):l[e]=i;var ie=(l=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(l,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):l)(function(l){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+l+'" is not supported')});var se=(l,e)=>()=>(e||l((e={exports:{}}).exports,e),e.exports);var Yt=(l,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let h of Bt(e))!qt.call(l,h)&&h!==i&&Tt(l,h,{get:()=>e[h],enumerable:!(s=$t(e,h))||s.enumerable});return l};var he=(l,e,i)=>(i=l!=null?Kt(Jt(l)):{},Yt(e||!l||!l.__esModule?Tt(i,"default",{value:l,enumerable:true}):i,l));var S=(l,e,i)=>Xt(l,typeof e!="symbol"?e+"":e,i),zt=(l,e,i)=>e.has(l)||Gt("Cannot "+i);var t=(l,e,i)=>(zt(l,e,"read from private field"),i?i.call(l):e.get(l)),g=(l,e,i)=>e.has(l)?Gt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,i),f=(l,e,i,s)=>(zt(l,e,"write to private field"),e.set(l,i),i),a=(l,e,i)=>(zt(l,e,"access private method"),i);var yt=(l,e,i,s)=>({set _(h){f(l,e,h);},get _(){return t(l,e,s)}});var Qt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,It=new Set,Rt=typeof process=="object"&&process?process:{},Vt=(l,e,i,s)=>{typeof Rt.emitWarning=="function"?Rt.emitWarning(l,e,i,s):console.error(`[${i}] ${e}: ${l}`);},Ft=globalThis.AbortController,jt=globalThis.AbortSignal;if(typeof Ft>"u"){jt=class{constructor(){S(this,"onabort");S(this,"_onabort",[]);S(this,"reason");S(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Ft=class{constructor(){S(this,"signal",new jt);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let l=Rt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{l&&(l=false,Vt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var Zt=l=>!It.has(l);var tt=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Pt=l=>tt(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?_t:null:null,_t=class extends Array{constructor(l){super(l),this.fill(0);}},Y,ct,te=(Y=class{constructor(e,i){S(this,"heap");S(this,"length");if(!t(Y,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=Pt(e);if(!i)return [];f(Y,ct,true);let s=new Y(e,i);return f(Y,ct,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},ct=new WeakMap,g(Y,ct,false),Y),Mt,Nt,V,U,P,ot,k,ft,dt,H,F,K,O,y,d,W,G,z,E,$,x,B,J,j,M,q,ht,D,pt,n,Ct,rt,Q,vt,N,Ht,nt,gt,bt,et,it,Wt,At,Ot,b,Dt,St,st,Lt,wt,kt=(wt=class{constructor(e){g(this,n);g(this,V);g(this,U);g(this,P);g(this,ot);g(this,k);g(this,ft);g(this,dt);g(this,H);S(this,"ttl");S(this,"ttlResolution");S(this,"ttlAutopurge");S(this,"updateAgeOnGet");S(this,"updateAgeOnHas");S(this,"allowStale");S(this,"noDisposeOnSet");S(this,"noUpdateTTL");S(this,"maxEntrySize");S(this,"sizeCalculation");S(this,"noDeleteOnFetchRejection");S(this,"noDeleteOnStaleGet");S(this,"allowStaleOnFetchAbort");S(this,"allowStaleOnFetchRejection");S(this,"ignoreFetchAbort");g(this,F);g(this,K);g(this,O);g(this,y);g(this,d);g(this,W);g(this,G);g(this,z);g(this,E);g(this,$);g(this,x);g(this,B);g(this,J);g(this,j);g(this,M);g(this,q);g(this,ht);g(this,D);g(this,pt);g(this,rt,()=>{});g(this,Q,()=>{});g(this,vt,()=>{});g(this,N,()=>false);g(this,nt,e=>{});g(this,gt,(e,i,s)=>{});g(this,bt,(e,i,s,h)=>{if(s||h)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});S(this,Mt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:h=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:w,onInsert:T,disposeAfter:m,noDisposeOnSet:Z,noUpdateTTL:I,maxSize:X=0,maxEntrySize:_=0,sizeCalculation:v,fetchMethod:p,memoMethod:R,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:mt,ignoreFetchAbort:lt,perf:at}=e;if(at!==void 0&&typeof at?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,H,at??Qt),i!==0&&!tt(i))throw new TypeError("max option must be a nonnegative integer");let ut=i?Pt(i):Array;if(!ut)throw new Error("invalid max value: "+i);if(f(this,V,i),f(this,U,X),this.maxEntrySize=_||t(this,U),this.sizeCalculation=v,this.sizeCalculation){if(!t(this,U)&&!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(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,dt,R),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ft,p),f(this,ht,!!p),f(this,O,new Map),f(this,y,new Array(i).fill(void 0)),f(this,d,new Array(i).fill(void 0)),f(this,W,new ut(i)),f(this,G,new ut(i)),f(this,z,0),f(this,E,0),f(this,$,te.create(i)),f(this,F,0),f(this,K,0),typeof w=="function"&&f(this,P,w),typeof T=="function"&&f(this,ot,T),typeof m=="function"?(f(this,k,m),f(this,x,[])):(f(this,k,void 0),f(this,x,void 0)),f(this,q,!!t(this,P)),f(this,pt,!!t(this,ot)),f(this,D,!!t(this,k)),this.noDisposeOnSet=!!Z,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!mt,this.ignoreFetchAbort=!!lt,this.maxEntrySize!==0){if(t(this,U)!==0&&!tt(t(this,U)))throw new TypeError("maxSize must be a positive integer if specified");if(!tt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");a(this,n,Ht).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=tt(h)||h===0?h:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");a(this,n,Ct).call(this);}if(t(this,V)===0&&this.ttl===0&&t(this,U)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,V)&&!t(this,U)){let xt="LRU_CACHE_UNBOUNDED";Zt(xt)&&(It.add(xt),Vt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",xt,wt));}}get perf(){return t(this,H)}static unsafeExposeInternals(e){return {starts:t(e,J),ttls:t(e,j),autopurgeTimers:t(e,M),sizes:t(e,B),keyMap:t(e,O),keyList:t(e,y),valList:t(e,d),next:t(e,W),prev:t(e,G),get head(){return t(e,z)},get tail(){return t(e,E)},free:t(e,$),isBackgroundFetch:i=>{var s;return a(s=e,n,b).call(s,i)},backgroundFetch:(i,s,h,r)=>{var o;return a(o=e,n,Ot).call(o,i,s,h,r)},moveToTail:i=>{var s;return a(s=e,n,St).call(s,i)},indexes:i=>{var s;return a(s=e,n,et).call(s,i)},rindexes:i=>{var s;return a(s=e,n,it).call(s,i)},isStale:i=>{var s;return t(s=e,N).call(s,i)}}}get max(){return t(this,V)}get maxSize(){return t(this,U)}get calculatedSize(){return t(this,K)}get size(){return t(this,F)}get fetchMethod(){return t(this,ft)}get memoMethod(){return t(this,dt)}get dispose(){return t(this,P)}get onInsert(){return t(this,ot)}get disposeAfter(){return t(this,k)}getRemainingTTL(e){return t(this,O).has(e)?1/0:0}*entries(){for(let e of a(this,n,et).call(this))t(this,d)[e]!==void 0&&t(this,y)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield [t(this,y)[e],t(this,d)[e]]);}*rentries(){for(let e of a(this,n,it).call(this))t(this,d)[e]!==void 0&&t(this,y)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield [t(this,y)[e],t(this,d)[e]]);}*keys(){for(let e of a(this,n,et).call(this)){let i=t(this,y)[e];i!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield i);}}*rkeys(){for(let e of a(this,n,it).call(this)){let i=t(this,y)[e];i!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield i);}}*values(){for(let e of a(this,n,et).call(this))t(this,d)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}*rvalues(){for(let e of a(this,n,it).call(this))t(this,d)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}[(Nt=Symbol.iterator,Mt=Symbol.toStringTag,Nt)](){return this.entries()}find(e,i={}){for(let s of a(this,n,et).call(this)){let h=t(this,d)[s],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;if(r!==void 0&&e(r,t(this,y)[s],this))return this.get(t(this,y)[s],i)}}forEach(e,i=this){for(let s of a(this,n,et).call(this)){let h=t(this,d)[s],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;r!==void 0&&e.call(i,r,t(this,y)[s],this);}}rforEach(e,i=this){for(let s of a(this,n,it).call(this)){let h=t(this,d)[s],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;r!==void 0&&e.call(i,r,t(this,y)[s],this);}}purgeStale(){let e=false;for(let i of a(this,n,it).call(this,{allowStale:true}))t(this,N).call(this,i)&&(a(this,n,st).call(this,t(this,y)[i],"expire"),e=true);return e}info(e){let i=t(this,O).get(e);if(i===void 0)return;let s=t(this,d)[i],h=a(this,n,b).call(this,s)?s.__staleWhileFetching:s;if(h===void 0)return;let r={value:h};if(t(this,j)&&t(this,J)){let o=t(this,j)[i],u=t(this,J)[i];if(o&&u){let c=o-(t(this,H).now()-u);r.ttl=c,r.start=Date.now();}}return t(this,B)&&(r.size=t(this,B)[i]),r}dump(){let e=[];for(let i of a(this,n,et).call(this,{allowStale:true})){let s=t(this,y)[i],h=t(this,d)[i],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;if(r===void 0||s===void 0)continue;let o={value:r};if(t(this,j)&&t(this,J)){o.ttl=t(this,j)[i];let u=t(this,H).now()-t(this,J)[i];o.start=Math.floor(Date.now()-u);}t(this,B)&&(o.size=t(this,B)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let h=Date.now()-s.start;s.start=t(this,H).now()-h;}this.set(i,s.value,s);}}set(e,i,s={}){var Z,I,X,_;if(i===void 0)return this.delete(e),this;let{ttl:h=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=s,{noUpdateTTL:w=this.noUpdateTTL}=s,T=t(this,bt).call(this,e,i,s.size||0,u);if(this.maxEntrySize&&T>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),a(this,n,st).call(this,e,"set"),this;let m=t(this,F)===0?void 0:t(this,O).get(e);if(m===void 0)m=t(this,F)===0?t(this,E):t(this,$).length!==0?t(this,$).pop():t(this,F)===t(this,V)?a(this,n,At).call(this,false):t(this,F),t(this,y)[m]=e,t(this,d)[m]=i,t(this,O).set(e,m),t(this,W)[t(this,E)]=m,t(this,G)[m]=t(this,E),f(this,E,m),yt(this,F)._++,t(this,gt).call(this,m,T,c),c&&(c.set="add"),w=false,t(this,pt)&&((Z=t(this,ot))==null||Z.call(this,i,e,"add"));else {a(this,n,St).call(this,m);let v=t(this,d)[m];if(i!==v){if(t(this,ht)&&a(this,n,b).call(this,v)){v.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=v;p!==void 0&&!o&&(t(this,q)&&((I=t(this,P))==null||I.call(this,p,e,"set")),t(this,D)&&t(this,x)?.push([p,e,"set"]));}else o||(t(this,q)&&((X=t(this,P))==null||X.call(this,v,e,"set")),t(this,D)&&t(this,x)?.push([v,e,"set"]));if(t(this,nt).call(this,m),t(this,gt).call(this,m,T,c),t(this,d)[m]=i,c){c.set="replace";let p=v&&a(this,n,b).call(this,v)?v.__staleWhileFetching:v;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");t(this,pt)&&this.onInsert?.(i,e,i===v?"update":"replace");}if(h!==0&&!t(this,j)&&a(this,n,Ct).call(this),t(this,j)&&(w||t(this,vt).call(this,m,h,r),c&&t(this,Q).call(this,c,m)),!o&&t(this,D)&&t(this,x)){let v=t(this,x),p;for(;p=v?.shift();)(_=t(this,k))==null||_.call(this,...p);}return this}pop(){var e;try{for(;t(this,F);){let i=t(this,d)[t(this,z)];if(a(this,n,At).call(this,!0),a(this,n,b).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,D)&&t(this,x)){let i=t(this,x),s;for(;s=i?.shift();)(e=t(this,k))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:h}=i,r=t(this,O).get(e);if(r!==void 0){let o=t(this,d)[r];if(a(this,n,b).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,N).call(this,r))h&&(h.has="stale",t(this,Q).call(this,h,r));else return s&&t(this,rt).call(this,r),h&&(h.has="hit",t(this,Q).call(this,h,r)),true}else h&&(h.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,h=t(this,O).get(e);if(h===void 0||!s&&t(this,N).call(this,h))return;let r=t(this,d)[h];return a(this,n,b).call(this,r)?r.__staleWhileFetching:r}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:T=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Z=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:X=this.allowStaleOnFetchAbort,context:_,forceRefresh:v=false,status:p,signal:R}=i;if(!t(this,ht))return p&&(p.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:r,status:p});let L={allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:u,size:c,sizeCalculation:w,noUpdateTTL:T,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:X,ignoreFetchAbort:I,status:p,signal:R},C=t(this,O).get(e);if(C===void 0){p&&(p.fetch="miss");let A=a(this,n,Ot).call(this,e,C,L,_);return A.__returned=A}else {let A=t(this,d)[C];if(a(this,n,b).call(this,A)){let ut=s&&A.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",ut&&(p.returnedStale=true)),ut?A.__staleWhileFetching:A.__returned=A}let mt=t(this,N).call(this,C);if(!v&&!mt)return p&&(p.fetch="hit"),a(this,n,St).call(this,C),h&&t(this,rt).call(this,C),p&&t(this,Q).call(this,p,C),A;let lt=a(this,n,Ot).call(this,e,C,L,_),at=lt.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=mt?"stale":"refresh",at&&mt&&(p.returnedStale=true)),at?lt.__staleWhileFetching:lt.__returned=lt}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,dt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:h,forceRefresh:r,...o}=i,u=this.get(e,o);if(!r&&u!==void 0)return u;let c=s(e,u,{options:o,context:h});return this.set(e,c,o),c}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=i,u=t(this,O).get(e);if(u!==void 0){let c=t(this,d)[u],w=a(this,n,b).call(this,c);return o&&t(this,Q).call(this,o,u),t(this,N).call(this,u)?(o&&(o.get="stale"),w?(o&&s&&c.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?c.__staleWhileFetching:void 0):(r||a(this,n,st).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?c:void 0)):(o&&(o.get="hit"),w?c.__staleWhileFetching:(a(this,n,St).call(this,u),h&&t(this,rt).call(this,u),c))}else o&&(o.get="miss");}delete(e){return a(this,n,st).call(this,e,"delete")}clear(){return a(this,n,Lt).call(this,"delete")}},V=new WeakMap,U=new WeakMap,P=new WeakMap,ot=new WeakMap,k=new WeakMap,ft=new WeakMap,dt=new WeakMap,H=new WeakMap,F=new WeakMap,K=new WeakMap,O=new WeakMap,y=new WeakMap,d=new WeakMap,W=new WeakMap,G=new WeakMap,z=new WeakMap,E=new WeakMap,$=new WeakMap,x=new WeakMap,B=new WeakMap,J=new WeakMap,j=new WeakMap,M=new WeakMap,q=new WeakMap,ht=new WeakMap,D=new WeakMap,pt=new WeakMap,n=new WeakSet,Ct=function(){let e=new _t(t(this,V)),i=new _t(t(this,V));f(this,j,e),f(this,J,i);let s=this.ttlAutopurge?new Array(t(this,V)):void 0;f(this,M,s),f(this,vt,(u,c,w=t(this,H).now())=>{i[u]=c!==0?w:0,e[u]=c,h(u,c);}),f(this,rt,u=>{i[u]=e[u]!==0?t(this,H).now():0,h(u,e[u]);});let h=this.ttlAutopurge?(u,c)=>{if(s?.[u]&&(clearTimeout(s[u]),s[u]=void 0),c&&c!==0&&s){let w=setTimeout(()=>{t(this,N).call(this,u)&&a(this,n,st).call(this,t(this,y)[u],"expire");},c+1);w.unref&&w.unref(),s[u]=w;}}:()=>{};f(this,Q,(u,c)=>{if(e[c]){let w=e[c],T=i[c];if(!w||!T)return;u.ttl=w,u.start=T,u.now=r||o();let m=u.now-T;u.remainingTTL=w-m;}});let r=0,o=()=>{let u=t(this,H).now();if(this.ttlResolution>0){r=u;let c=setTimeout(()=>r=0,this.ttlResolution);c.unref&&c.unref();}return u};this.getRemainingTTL=u=>{let c=t(this,O).get(u);if(c===void 0)return 0;let w=e[c],T=i[c];if(!w||!T)return 1/0;let m=(r||o())-T;return w-m},f(this,N,u=>{let c=i[u],w=e[u];return !!w&&!!c&&(r||o())-c>w});},rt=new WeakMap,Q=new WeakMap,vt=new WeakMap,N=new WeakMap,Ht=function(){let e=new _t(t(this,V));f(this,K,0),f(this,B,e),f(this,nt,i=>{f(this,K,t(this,K)-e[i]),e[i]=0;}),f(this,bt,(i,s,h,r)=>{if(a(this,n,b).call(this,s))return 0;if(!tt(h))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(h=r(s,i),!tt(h))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 h}),f(this,gt,(i,s,h)=>{if(e[i]=s,t(this,U)){let r=t(this,U)-e[i];for(;t(this,K)>r;)a(this,n,At).call(this,true);}f(this,K,t(this,K)+e[i]),h&&(h.entrySize=s,h.totalCalculatedSize=t(this,K));});},nt=new WeakMap,gt=new WeakMap,bt=new WeakMap,et=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,E);!(!a(this,n,Wt).call(this,i)||((e||!t(this,N).call(this,i))&&(yield i),i===t(this,z)));)i=t(this,G)[i];},it=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,z);!(!a(this,n,Wt).call(this,i)||((e||!t(this,N).call(this,i))&&(yield i),i===t(this,E)));)i=t(this,W)[i];},Wt=function(e){return e!==void 0&&t(this,O).get(t(this,y)[e])===e},At=function(e){var r;let i=t(this,z),s=t(this,y)[i],h=t(this,d)[i];return t(this,ht)&&a(this,n,b).call(this,h)?h.__abortController.abort(new Error("evicted")):(t(this,q)||t(this,D))&&(t(this,q)&&((r=t(this,P))==null||r.call(this,h,s,"evict")),t(this,D)&&t(this,x)?.push([h,s,"evict"])),t(this,nt).call(this,i),t(this,M)?.[i]&&(clearTimeout(t(this,M)[i]),t(this,M)[i]=void 0),e&&(t(this,y)[i]=void 0,t(this,d)[i]=void 0,t(this,$).push(i)),t(this,F)===1?(f(this,z,f(this,E,0)),t(this,$).length=0):f(this,z,t(this,W)[i]),t(this,O).delete(s),yt(this,F)._--,i},Ot=function(e,i,s,h){let r=i===void 0?void 0:t(this,d)[i];if(a(this,n,b).call(this,r))return r;let o=new Ft,{signal:u}=s;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:s,context:h},w=(_,v=false)=>{let{aborted:p}=o.signal,R=s.ignoreFetchAbort&&_!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&_!==void 0);if(s.status&&(p&&!v?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,R&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!R&&!v)return m(o.signal.reason,L);let C=I,A=t(this,d)[i];return (A===I||R&&v&&A===void 0)&&(_===void 0?C.__staleWhileFetching!==void 0?t(this,d)[i]=C.__staleWhileFetching:a(this,n,st).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,_,c.options))),_},T=_=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=_),m(_,false)),m=(_,v)=>{let{aborted:p}=o.signal,R=p&&s.allowStaleOnFetchAbort,L=R||s.allowStaleOnFetchRejection,C=L||s.noDeleteOnFetchRejection,A=I;if(t(this,d)[i]===I&&(!C||!v&&A.__staleWhileFetching===void 0?a(this,n,st).call(this,e,"fetch"):R||(t(this,d)[i]=A.__staleWhileFetching)),L)return s.status&&A.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),A.__staleWhileFetching;if(A.__returned===A)throw _},Z=(_,v)=>{var R;let p=(R=t(this,ft))==null?void 0:R.call(this,e,r,c);p&&p instanceof Promise&&p.then(L=>_(L===void 0?void 0:L),v),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(_(void 0),s.allowStaleOnFetchAbort&&(_=L=>w(L,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(Z).then(w,T),X=Object.assign(I,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(e,X,{...c.options,status:void 0}),i=t(this,O).get(e)):t(this,d)[i]=X,X},b=function(e){if(!t(this,ht))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ft},Dt=function(e,i){t(this,G)[i]=e,t(this,W)[e]=i;},St=function(e){e!==t(this,E)&&(e===t(this,z)?f(this,z,t(this,W)[e]):a(this,n,Dt).call(this,t(this,G)[e],t(this,W)[e]),a(this,n,Dt).call(this,t(this,E),e),f(this,E,e));},st=function(e,i){var h,r;let s=false;if(t(this,F)!==0){let o=t(this,O).get(e);if(o!==void 0)if(t(this,M)?.[o]&&(clearTimeout(t(this,M)?.[o]),t(this,M)[o]=void 0),s=true,t(this,F)===1)a(this,n,Lt).call(this,i);else {t(this,nt).call(this,o);let u=t(this,d)[o];if(a(this,n,b).call(this,u)?u.__abortController.abort(new Error("deleted")):(t(this,q)||t(this,D))&&(t(this,q)&&((h=t(this,P))==null||h.call(this,u,e,i)),t(this,D)&&t(this,x)?.push([u,e,i])),t(this,O).delete(e),t(this,y)[o]=void 0,t(this,d)[o]=void 0,o===t(this,E))f(this,E,t(this,G)[o]);else if(o===t(this,z))f(this,z,t(this,W)[o]);else {let c=t(this,G)[o];t(this,W)[c]=t(this,W)[o];let w=t(this,W)[o];t(this,G)[w]=t(this,G)[o];}yt(this,F)._--,t(this,$).push(o);}}if(t(this,D)&&t(this,x)?.length){let o=t(this,x),u;for(;u=o?.shift();)(r=t(this,k))==null||r.call(this,...u);}return s},Lt=function(e){var i,s;for(let h of a(this,n,it).call(this,{allowStale:true})){let r=t(this,d)[h];if(a(this,n,b).call(this,r))r.__abortController.abort(new Error("deleted"));else {let o=t(this,y)[h];t(this,q)&&((i=t(this,P))==null||i.call(this,r,o,e)),t(this,D)&&t(this,x)?.push([r,o,e]);}}if(t(this,O).clear(),t(this,d).fill(void 0),t(this,y).fill(void 0),t(this,j)&&t(this,J)){t(this,j).fill(0),t(this,J).fill(0);for(let h of t(this,M)??[])h!==void 0&&clearTimeout(h);t(this,M)?.fill(void 0);}if(t(this,B)&&t(this,B).fill(0),f(this,z,0),f(this,E,0),t(this,$).length=0,f(this,K,0),f(this,F,0),t(this,D)&&t(this,x)){let h=t(this,x),r;for(;r=h?.shift();)(s=t(this,k))==null||s.call(this,...r);}},wt);var Ut=class{constructor(e){S(this,"cache");S(this,"map",new Map);this.cache=new kt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Et;(h=>(h.log=(r,...o)=>console.log(`[Pixi\u2019VN] ${r}`,...o),h.warn=(r,...o)=>console.warn(`[Pixi\u2019VN] ${r}`,...o),h.error=(r,...o)=>console.error(`[Pixi\u2019VN] ${r}`,...o),h.info=(r,...o)=>console.info(`[Pixi\u2019VN] ${r}`,...o)))(Et||(Et={}));function me(l){try{if(typeof l>"u")return l;let e=JSON.stringify(l);return JSON.parse(e)}catch(e){throw Et.error("Error creating exportable element",l,e),new PixiError("not_json_serializable","Error creating exportable element")}}export{ie as a,se as b,he as c,S as d,Ut as e,Et as f,me as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {k as k$1,m,j,l,n}from'./chunk-IWAXXFXE.mjs';import {e,g,f as f$1,d}from'./chunk-6HI66YQL.mjs';import {GameUnifier}from'@drincs/pixi-vn/core';var T;(s=>{s.storage=new e({cacheSize:50}),s.defaultStorage=new e({cacheSize:10}),s.tempStorageDeadlines=new Map;let n;function c(a){s.tempStorageDeadlines.forEach((l,o)=>{l>a&&(s.storage.delete(`${k$1}:${o}`),n?.onClearOldTempVariable?.(o),s.tempStorageDeadlines.delete(o));});}s.clearOldTempVariables=c;function h(a){n=a;}s.setExternalStoreHandler=h;function V(a,l,o){o==null?s.storage.delete(`${a}:${l}`):s.storage.set(`${a}:${l}`,o),n?.onSetVariable?.(l,o);}s.setVariable=V;function O(a,l){let o=s.storage.get(`${a}:${l}`);return g(o)}s.getVariable=O;function M(a,l){s.storage.delete(`${a}:${l}`),n?.onRemoveVariable?.(l);}s.removeVariable=M;function D(a,l){let o=s.storage.get(m)||[];if(l)o.includes(a)||o.push(a);else {let x=o.indexOf(a);x>-1&&o.splice(x,1);}s.storage.set(m,o);}s.setFlag=D;function R(a){return (s.storage.get(m)||[]).includes(a)}s.getFlag=R;})(T||(T={}));var r=T;var S=class{get base(){return r.storage.map}get cache(){return r.storage.cache}get tempStorageDeadlines(){return r.tempStorageDeadlines}set default(t){Object.entries(t).forEach(([e,n])=>{r.defaultStorage.map.set(e,n);});}set(t,e){return r.setVariable(j,t,e)}get(t){let e=r.getVariable(k$1,t);return e===void 0&&(e=r.getVariable(j,t)),e===void 0&&(e=g(r.defaultStorage.get(t))),e}remove(t){return this.removeTempVariable(t),r.removeVariable(j,t)}setTempVariable(t,e){if(e==null){this.removeTempVariable(t);return}else r.setVariable(k$1,t,e),this.tempStorageDeadlines.has(t)||this.tempStorageDeadlines.set(t,GameUnifier.openedLabels);}removeTempVariable(t){r.removeVariable(k$1,t),this.tempStorageDeadlines.has(t)&&this.tempStorageDeadlines.delete(t);}setFlag(t,e){return r.setFlag(t,e)}getFlag(t){return r.getFlag(t)}setStorageHandler(t){r.setExternalStoreHandler(t);}clear(){this.base.clear(),this.cache.clear(),this.tempStorageDeadlines.clear();}export(){let t=[];[...this.base.keys()].forEach(n=>{t.push({key:n,value:this.base.get(n)});});let e=[];return [...r.tempStorageDeadlines.keys()].forEach(n=>{e.push({key:n,value:this.tempStorageDeadlines.get(n)});}),g({main:t,tempDeadlines:e})}restore(t){this.clear();try{t?(t.base?.forEach(e=>{switch(e.key){case "___current_dialogue_memory___":r.setVariable(l,n.CURRENT_DIALOGUE_MEMORY_KEY,e.value);break;case "___last_dialogue_added_in_step_memory___":r.setVariable(l,n.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_menu_options_memory___":r.setVariable(l,n.CURRENT_MENU_OPTIONS_MEMORY_KEY,e.value);break;case "___last_menu_options_added_in_step_memory___":r.setVariable(l,n.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "_input_value_":r.setVariable(l,n.CURRENT_INPUT_VALUE_MEMORY_KEY,e.value);break;case "___last_input_added_in_step_memory___":r.setVariable(l,n.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_input_info_memory___":r.setVariable(l,n.CURRENT_INPUT_INFO_MEMORY_KEY,e.value);break;case "___opened_labels_counter___":r.setVariable(l,n.OPENED_LABELS_COUNTER_KEY,e.value);break;case "___all_choices_made___":r.setVariable(l,n.ALL_CHOICES_MADE_KEY,e.value);break;case "___current_step_times_counter___":r.setVariable(l,n.CURRENT_STEP_TIMES_COUNTER_KEY,e.value);break;case "___last_step_glued___":r.setVariable(l,n.LAST_STEP_GLUED,e.value);break;default:r.setVariable(j,e.key,e.value);}}),t.temp?.forEach(e=>{r.setVariable(k$1,e.key,e.value);}),t.flags?.forEach(e=>{r.setFlag(e,!0);}),t.main?.forEach(e=>{this.base.set(e.key,e.value);}),t.tempDeadlines?.forEach(e=>{this.tempStorageDeadlines.set(e.key,e.value);})):f$1.warn("No storage data found");}catch(e){f$1.error("Error importing data",e);}}};var f=class{constructor(t,e){d(this,"id");d(this,"categoryId");this.categoryId=t,this.id=e,this.migrateOldStorage();}migrateOldStorage(t=this.categoryId){let e=r.getVariable(j,t);e&&(Object.entries(e).forEach(([n,c])=>{typeof c=="object"&&c!==null&&Object.entries(c).forEach(([h,V])=>{r.setVariable(this.categoryId,`${n}:${h}`,V);});}),r.removeVariable(j,t));}setStorageProperty(t,e){r.setVariable(this.categoryId,`${this.id}:${t}`,e);}getStorageProperty(t,e=this.id){return r.getVariable(this.categoryId,`${e}:${t}`)}};var k=new S;export{r as a,f as b,k as c};
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var u=Object.defineProperty;var
|
|
1
|
+
'use strict';var u=Object.defineProperty;var c=(l,t,i)=>t in l?u(l,t,{enumerable:true,configurable:true,writable:true,value:i}):l[t]=i;var n=(l,t,i)=>c(l,typeof t!="symbol"?t+"":t,i);var a;(m=>(m.log=(o,...s)=>console.log(`[Pixi\u2019VN] ${o}`,...s),m.warn=(o,...s)=>console.warn(`[Pixi\u2019VN] ${o}`,...s),m.error=(o,...s)=>console.error(`[Pixi\u2019VN] ${o}`,...s),m.info=(o,...s)=>console.info(`[Pixi\u2019VN] ${o}`,...s)))(a||(a={}));var r=class extends Error{constructor(i,d,m,o,s){super(`[Pixi\u2019VN] ${d}`);n(this,"code");n(this,"canvasElementInfo");n(this,"parent");this.code=i,m==="canvas"&&(this.canvasElementInfo=o,this.parent=s);}};var e=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate;}static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static get currentGameStepState(){return e._getCurrentGameStepState()}static get restoreGameStepState(){return e._restoreGameStepState}static get openedLabels(){return e._getOpenedLabels()}static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(i=>i!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(i=>i()));}static get onPreContinue(){return e.runOnPreContinue}static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static async processNavigationRequests(t){let i=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=i.newValue,await i.result}static get getVariable(){return e._getVariable}static get setVariable(){return e._setVariable}static get removeVariable(){return e._removeVariable}static get getFlag(){return e._getFlag}static get setFlag(){return e._setFlag}static get onLabelClosing(){return e._onLabelClosing}static get addHistoryItem(){return e._addHistoryItem}static get getCharacter(){return e._getCharacter}static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(i=>i!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,i){for(let d of e._onErrorHandlers.slice())try{await d(t,i);}catch(m){a.error("Error in onError handler",m);}}static get animate(){return e._animate}};n(e,"_navigate",()=>{a.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");}),n(e,"_getStepCounter",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_setStepCounter",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getCurrentGameStepState",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_restoreGameStepState",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getOpenedLabels",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_onPreContinueHandlers",[]),n(e,"navigationRequestsCount",0),n(e,"processNavigationLock",Promise.resolve()),n(e,"_processNavigationRequests",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getVariable",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_setVariable",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_removeVariable",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getFlag",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_setFlag",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_onLabelClosing",()=>{}),n(e,"_addHistoryItem",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"runningStepsCount",0),n(e,"_getCharacter",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented.")}),n(e,"onEnd"),n(e,"_onErrorHandlers",[]),n(e,"_animate",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")});var p=e;exports.GameUnifier=p;exports.PixiError=r;
|
package/dist/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var
|
|
1
|
+
var u=Object.defineProperty;var c=(l,t,i)=>t in l?u(l,t,{enumerable:true,configurable:true,writable:true,value:i}):l[t]=i;var n=(l,t,i)=>c(l,typeof t!="symbol"?t+"":t,i);var a;(m=>(m.log=(o,...s)=>console.log(`[Pixi\u2019VN] ${o}`,...s),m.warn=(o,...s)=>console.warn(`[Pixi\u2019VN] ${o}`,...s),m.error=(o,...s)=>console.error(`[Pixi\u2019VN] ${o}`,...s),m.info=(o,...s)=>console.info(`[Pixi\u2019VN] ${o}`,...s)))(a||(a={}));var r=class extends Error{constructor(i,d,m,o,s){super(`[Pixi\u2019VN] ${d}`);n(this,"code");n(this,"canvasElementInfo");n(this,"parent");this.code=i,m==="canvas"&&(this.canvasElementInfo=o,this.parent=s);}};var e=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate;}static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static get currentGameStepState(){return e._getCurrentGameStepState()}static get restoreGameStepState(){return e._restoreGameStepState}static get openedLabels(){return e._getOpenedLabels()}static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(i=>i!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(i=>i()));}static get onPreContinue(){return e.runOnPreContinue}static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static async processNavigationRequests(t){let i=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=i.newValue,await i.result}static get getVariable(){return e._getVariable}static get setVariable(){return e._setVariable}static get removeVariable(){return e._removeVariable}static get getFlag(){return e._getFlag}static get setFlag(){return e._setFlag}static get onLabelClosing(){return e._onLabelClosing}static get addHistoryItem(){return e._addHistoryItem}static get getCharacter(){return e._getCharacter}static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(i=>i!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,i){for(let d of e._onErrorHandlers.slice())try{await d(t,i);}catch(m){a.error("Error in onError handler",m);}}static get animate(){return e._animate}};n(e,"_navigate",()=>{a.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");}),n(e,"_getStepCounter",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_setStepCounter",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getCurrentGameStepState",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_restoreGameStepState",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getOpenedLabels",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_onPreContinueHandlers",[]),n(e,"navigationRequestsCount",0),n(e,"processNavigationLock",Promise.resolve()),n(e,"_processNavigationRequests",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getVariable",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_setVariable",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_removeVariable",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getFlag",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_setFlag",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_onLabelClosing",()=>{}),n(e,"_addHistoryItem",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"runningStepsCount",0),n(e,"_getCharacter",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented.")}),n(e,"onEnd"),n(e,"_onErrorHandlers",[]),n(e,"_animate",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new r("not_implemented","Method not implemented, you should initialize the Game: Game.init()")});var p=e;export{p as GameUnifier,r as PixiError};
|
package/dist/history.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GameStepState, HistoryInfo } from '@drincs/pixi-vn';
|
|
2
2
|
import { Difference } from 'microdiff';
|
|
3
3
|
import { C as CachedMap } from './CachedMap-DZLvJAnA.cjs';
|
|
4
|
-
import { H as HistoryStep, N as NarrationHistory, d as StepLabelPropsType, e as StepLabelResultType } from './HistoryChoiceMenuOption-
|
|
4
|
+
import { H as HistoryStep, N as NarrationHistory, d as StepLabelPropsType, e as StepLabelResultType } from './HistoryChoiceMenuOption-DSSNUXEq.cjs';
|
|
5
5
|
import 'lru-cache';
|
|
6
6
|
import './StorageElementType-DkJ394kq.cjs';
|
|
7
7
|
|
package/dist/history.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GameStepState, HistoryInfo } from '@drincs/pixi-vn';
|
|
2
2
|
import { Difference } from 'microdiff';
|
|
3
3
|
import { C as CachedMap } from './CachedMap-DZLvJAnA.js';
|
|
4
|
-
import { H as HistoryStep, N as NarrationHistory, d as StepLabelPropsType, e as StepLabelResultType } from './HistoryChoiceMenuOption-
|
|
4
|
+
import { H as HistoryStep, N as NarrationHistory, d as StepLabelPropsType, e as StepLabelResultType } from './HistoryChoiceMenuOption-BP9Tsbyd.js';
|
|
5
5
|
import 'lru-cache';
|
|
6
6
|
import './StorageElementType-DkJ394kq.js';
|
|
7
7
|
|
package/dist/history.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'./chunk-JMOSOAGB.mjs';import {
|
|
1
|
+
import'./chunk-JMOSOAGB.mjs';import {d,e,g,f}from'./chunk-6HI66YQL.mjs';import {GameUnifier}from'@drincs/pixi-vn/core';var h=class h{static get originalStepData(){return h._originalStepData?g(h._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:void 0},labelIndex:-1,openedLabels:[]}}static set originalStepData(e){h._originalStepData=g(e);}};d(h,"_diffHistory",new e({cacheSize:5})),d(h,"_stepsInfoHistory",new e({cacheSize:5})),d(h,"_narrationHistory",new e({cacheSize:50})),d(h,"stepLimitSaved",20),d(h,"_originalStepData");var i=h;function I(m,e){let r=g(m);return e.length>1&&"type"in e[0]&&(e=e.slice().reverse()),e.forEach(t=>{v(r,t);}),r}function v(m,e){let r=m;e.path&&e.path.length>0?e.path.forEach((t,a)=>{if(e.path&&a===e.path.length-1)switch(e.type){case "CHANGE":case "REMOVE":r[t]=e.oldValue;break;case "CREATE":Array.isArray(r)&&typeof t=="number"?r.splice(t,1):delete r[t];break}else r=r[t];}):f.warn("No path found, skipping diff",e);}var _={Date:true,RegExp:true,String:true,Number:true};function x(m,e,r={cyclesFix:true},t=[]){let a=[],s=Array.isArray(m);for(let o in m){let n=m[o],u=s?+o:o;if(!(o in e)){a.push({type:"REMOVE",path:[u],oldValue:m[o]});continue}let p=e[o],d=typeof n=="object"&&typeof p=="object"&&Array.isArray(n)===Array.isArray(p);n&&p&&d&&!_[Object.getPrototypeOf(n)?.constructor?.name]&&(!r.cyclesFix||!t.includes(n))?a.push.apply(a,x(n,p,r,r.cyclesFix?t.concat([n]):[]).map(f=>(f.path.unshift(u),f))):n!==p&&!(Number.isNaN(n)&&Number.isNaN(p))&&!(d&&(isNaN(n)?n+""==p+"":+n==+p))&&a.push({path:[u],type:"CHANGE",value:p,oldValue:n});}let c=Array.isArray(e);for(let o in e)o in m||a.push({type:"CREATE",path:[c?+o:o],value:e[o]});return a}var b=class{get stepsInfoMap(){return i._stepsInfoHistory}get diffMap(){return i._diffHistory}get narrationMap(){return i._narrationHistory}get size(){return i._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return i._stepsInfoHistory.keys()}get(e){let r=i._narrationHistory.get(e);if(!(r&&Object.keys(r).length===1&&r.stepIndex!==void 0))return r}delete(e){i._stepsInfoHistory.delete(e),i._diffHistory.delete(e),i._narrationHistory.delete(e);}getOldGameState(e,r){if(e<=0||this.size===0)return r;let t=this.lastKey;if(typeof t!="number")return f.warn("You can't go back, there is no step to go back"),r;let a=i._diffHistory.get(t);if(a)try{let s=I(r,a);return GameUnifier.stepCounter=t,this.delete(t),this.getOldGameState(e-1,s)}catch(s){return f.error("Error applying diff",s),r}else return f.warn("No diff found for the last step, cannot go back"),r}async back(e,r={}){let{steps:t=1}=r;if(!Number.isFinite(t)){f.warn(`[back] The parameter steps must be a valid finite number, received: ${t}`);return}if(t<=0){f.warn(`[back] The parameter steps must be greater than 0, received: ${t}`);return}if(GameUnifier.runningStepsCount>0){GameUnifier.increaseBackRequest(t);return}if(i._diffHistory.size<1){f.warn("You can't go back, there is no step to go back");return}GameUnifier.runningStepsCount++;try{let a=g(this.getOldGameState(t,i.originalStepData));if(a){await GameUnifier.restoreGameStepState(a,GameUnifier.navigate);let s=GameUnifier.stepCounter-1,c=i._narrationHistory.get(s);if(c&&Object.keys(c).length===1&&c.stepIndex!==void 0){let o=i._stepsInfoHistory.get(s);if(o){let n=this.itemMapper({step:o});i._narrationHistory.set(o.index,n);}}}else f.error("Error going back");i.originalStepData=a;}catch(a){f.error("Error going back",a);}if(GameUnifier.runningStepsCount--,GameUnifier.runningStepsCount===0&&GameUnifier.backRequestsCount!==0)return await GameUnifier.processNavigationRequests(e)}add(e,r={}){let t=i.originalStepData,{ignoreSameStep:a}=r,s=GameUnifier.currentGameStepState;if(!a&&this.isSameStep(t,s))return;let c=this.lastKey;(async()=>{try{let n,u;if(typeof c=="number"&&(n=i._stepsInfoHistory.get(c),u=i._narrationHistory.get(c)),i._stepsInfoHistory.set(e.index,e),e.index!==0){let f$1=x(t,s);f$1?i._diffHistory.set(e.index,f$1):f.warn("It was not possible to create the difference between the two steps");}let p={},d=this.itemMapper({step:e},p);if(i._narrationHistory.set(e.index,d),n&&u&&typeof c=="number"){let f=this.itemMapper({...p,step:n},{});i._narrationHistory.set(c,f);}}catch(n){f.error("Error adding history step",n);}})(),i.originalStepData=s;}itemMapper(e,r){let{step:t,choiceIndexMade:a,inputValue:s,removeDialogue:c}=e,o=t.dialogue;r&&t.isGlued&&(r.removeDialogue=true),c&&(o=void 0);let n=t.choices;if(r&&t.currentLabel&&t.choiceIndexMade!==void 0&&(r.choiceIndexMade=t.choiceIndexMade),t.inputValue&&r&&(r.inputValue=t.inputValue),o||n||s){let u=n?.map((p,d)=>{let f=false;return p.oneTime&&t.alreadyMadeChoices?.includes(d)&&(f=true),{text:p.text,type:p.type,isResponse:false,hidden:f}});if(u){if(u.every(p=>p.hidden)){let p=u.find(d=>d.hidden===false);p&&(p.hidden=false);}a!==void 0&&(u[a].isResponse=true);}return {dialogue:o?{...o,character:o.character?GameUnifier.getCharacter(o.character)||o.character:void 0}:void 0,playerMadeChoice:typeof a=="number",choices:u,stepIndex:t.index,inputValue:s}}return {stepIndex:t.index}}get narrativeHistory(){let e=[];return Array.from(this.keys()).sort((t,a)=>t-a).forEach(t=>{let a=this.get(t);a&&e.push(a);}),e}get currentLabelHistory(){let e=[],r=Array.from(this.keys()).sort((n,u)=>u-n);if(r.length===0)return e;let t=r[0];if(typeof t!="number")return e;let a=i._stepsInfoHistory.get(t);if(!a)return e;let s=a.openedLabels;if(!s||!Array.isArray(s)||s.length===0)return e;let c=s[0].currentStepIndex,o=s[0].label;return r.every((n,u)=>{let p=this.get(n);if(p){if(u===0)return e.push(p),true;let d=i._stepsInfoHistory.get(n);if(!d)return true;let f=d.openedLabels;if(!f||!Array.isArray(f)||f.length===0||f[0].label!==o||f[0].currentStepIndex>=c)return false;c=f[0].currentStepIndex,e.push(p);}return true}),e.reverse()}removeNarrativeHistory(e){if(e){let r=Array.from(this.keys()).sort((t,a)=>t-a);r=r.slice(0,e),r.forEach(t=>{i._narrationHistory.delete(t),i._stepsInfoHistory.delete(t),i._diffHistory.delete(t);});}else i._stepsInfoHistory.clear(),i._diffHistory.clear(),i._narrationHistory.clear();}get canGoBack(){let e=this.lastKey;return typeof e!="number"?false:i._diffHistory.has(e)}blockGoBack(){GameUnifier.runningStepsCount===0&&i._diffHistory.clear();}isSameStep(e,r){if(e.openedLabels.length===r.openedLabels.length)try{let t=JSON.stringify(e.openedLabels),a=JSON.stringify(r.openedLabels);if(t===a&&e.path===r.path&&e.labelIndex===r.labelIndex)return !0}catch(t){return f.error("Error comparing opened labels",t),true}return false}clear(){i._stepsInfoHistory.clear(),i._diffHistory.clear(),i._narrationHistory.clear(),i._originalStepData=void 0;}get stepLimitSaved(){return i.stepLimitSaved}set stepLimitSaved(e){i.stepLimitSaved=e;}export(){let e=Array.from(this.keys()).sort((t,a)=>t-a);e.length>this.stepLimitSaved&&(e=e.slice(e.length-this.stepLimitSaved));let r=[];return e.forEach(t=>{let a=i._stepsInfoHistory.get(t);if(a){let s=i._diffHistory.get(t);r.push({...a,diff:s});}}),{stepsHistory:g(r),originalStepData:g(i._originalStepData)}}restoreNarrativeHistory(){let e=Array.from(this.keys()).sort((t,a)=>t-a),r={};e.forEach(t=>{let a=i._stepsInfoHistory.get(t);if(a){let s={...r};r={};let c=this.itemMapper({step:a,choiceIndexMade:s.choiceIndexMade,inputValue:s.inputValue,removeDialogue:s.removeDialogue},r);c&&i._narrationHistory.set(t,c);}});}async restore(e){this.clear();try{Object.hasOwn(e,"stepsHistory")?(e.stepsHistory.forEach(t=>{t.diff&&i._diffHistory.set(t.index,t.diff);let a={...t,diff:void 0};i._stepsInfoHistory.set(t.index,a);}),this.restoreNarrativeHistory()):f.warn("Could not import stepsHistory data, so will be ignored"),Object.hasOwn(e,"originalStepData")?i._originalStepData=e.originalStepData:f.warn("Could not import originalStepData data, so will be ignored");}catch(r){f.error("Error importing data",r);}}};var P=new b;export{i as HistoryManagerStatic,P as stepHistory};
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var nt=require('@drincs/pixi-vn/canvas'),Bt=require('@drincs/pixi-vn/characters'),core=require('@drincs/pixi-vn/core'),et=require('@drincs/pixi-vn/history'),C=require('@drincs/pixi-vn/narration'),ut=require('@drincs/pixi-vn/sound'),G=require('@drincs/pixi-vn/storage'),motion=require('@drincs/pixi-vn/motion');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var nt__namespace=/*#__PURE__*/_interopNamespace(nt);var Bt__namespace=/*#__PURE__*/_interopNamespace(Bt);var et__namespace=/*#__PURE__*/_interopNamespace(et);var C__namespace=/*#__PURE__*/_interopNamespace(C);var ut__namespace=/*#__PURE__*/_interopNamespace(ut);var G__namespace=/*#__PURE__*/_interopNamespace(G);var Jt=Object.defineProperty;var Qt=h=>{throw TypeError(h)};var ue=(h,e,i)=>e in h?Jt(h,e,{enumerable:true,configurable:true,writable:true,value:i}):h[e]=i;var fe=(h,e)=>{for(var i in e)Jt(h,i,{get:e[i],enumerable:true});};var x=(h,e,i)=>ue(h,typeof e!="symbol"?e+"":e,i),jt=(h,e,i)=>e.has(h)||Qt("Cannot "+i);var t=(h,e,i)=>(jt(h,e,"read from private field"),i?i.call(h):e.get(h)),v=(h,e,i)=>e.has(h)?Qt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,i),u=(h,e,i,s)=>(jt(h,e,"write to private field"),e.set(h,i),i),d=(h,e,i)=>(jt(h,e,"access private method"),i);var Rt=(h,e,i,s)=>({set _(r){u(h,e,r);},get _(){return t(h,e,s)}});var me=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ie=new Set,Gt=typeof process=="object"&&process?process:{},se=(h,e,i,s)=>{typeof Gt.emitWarning=="function"?Gt.emitWarning(h,e,i,s):console.error(`[${i}] ${e}: ${h}`);},Nt=globalThis.AbortController,Zt=globalThis.AbortSignal;if(typeof Nt>"u"){Zt=class{constructor(){x(this,"onabort");x(this,"_onabort",[]);x(this,"reason");x(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){x(this,"signal",new Zt);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let h=Gt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{h&&(h=false,se("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var ge=h=>!ie.has(h);var at=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),re=h=>at(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(h){super(h),this.fill(0);}},it,St,ve=(it=class{constructor(e,i){x(this,"heap");x(this,"length");if(!t(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=re(e);if(!i)return [];u(it,St,true);let s=new it(e,i);return u(it,St,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,v(it,St,false),it),te,ee,K,M,q,ft,$,yt,Et,X,U,B,T,A,m,P,z,N,D,J,L,Q,Z,V,W,tt,dt,j,xt,l,It,mt,ot,Ot,Y,ne,gt,bt,Tt,lt,ht,Mt,Lt,Ct,b,zt,wt,ct,Vt,At,oe=(At=class{constructor(e){v(this,l);v(this,K);v(this,M);v(this,q);v(this,ft);v(this,$);v(this,yt);v(this,Et);v(this,X);x(this,"ttl");x(this,"ttlResolution");x(this,"ttlAutopurge");x(this,"updateAgeOnGet");x(this,"updateAgeOnHas");x(this,"allowStale");x(this,"noDisposeOnSet");x(this,"noUpdateTTL");x(this,"maxEntrySize");x(this,"sizeCalculation");x(this,"noDeleteOnFetchRejection");x(this,"noDeleteOnStaleGet");x(this,"allowStaleOnFetchAbort");x(this,"allowStaleOnFetchRejection");x(this,"ignoreFetchAbort");v(this,U);v(this,B);v(this,T);v(this,A);v(this,m);v(this,P);v(this,z);v(this,N);v(this,D);v(this,J);v(this,L);v(this,Q);v(this,Z);v(this,V);v(this,W);v(this,tt);v(this,dt);v(this,j);v(this,xt);v(this,mt,()=>{});v(this,ot,()=>{});v(this,Ot,()=>{});v(this,Y,()=>false);v(this,gt,e=>{});v(this,bt,(e,i,s)=>{});v(this,Tt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});x(this,te,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:p,dispose:_,onInsert:R,disposeAfter:S,noDisposeOnSet:rt,noUpdateTTL:I,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:E,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:f,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:F,ignoreFetchAbort:H,perf:vt}=e;if(vt!==void 0&&typeof vt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,X,vt??me),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let _t=i?re(i):Array;if(!_t)throw new Error("invalid max value: "+i);if(u(this,K,i),u(this,M,k),this.maxEntrySize=w||t(this,M),this.sizeCalculation=y,this.sizeCalculation){if(!t(this,M)&&!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(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,Et,E),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,yt,a),u(this,dt,!!a),u(this,T,new Map),u(this,A,new Array(i).fill(void 0)),u(this,m,new Array(i).fill(void 0)),u(this,P,new _t(i)),u(this,z,new _t(i)),u(this,N,0),u(this,D,0),u(this,J,ve.create(i)),u(this,U,0),u(this,B,0),typeof _=="function"&&u(this,q,_),typeof R=="function"&&u(this,ft,R),typeof S=="function"?(u(this,$,S),u(this,L,[])):(u(this,$,void 0),u(this,L,void 0)),u(this,tt,!!t(this,q)),u(this,xt,!!t(this,ft)),u(this,j,!!t(this,$)),this.noDisposeOnSet=!!rt,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!g,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,M)!==0&&!at(t(this,M)))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");d(this,l,ne).call(this);}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!f,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,It).call(this);}if(t(this,K)===0&&this.ttl===0&&t(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,K)&&!t(this,M)){let Pt="LRU_CACHE_UNBOUNDED";ge(Pt)&&(ie.add(Pt),se("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,At));}}get perf(){return t(this,X)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,V),autopurgeTimers:t(e,W),sizes:t(e,Q),keyMap:t(e,T),keyList:t(e,A),valList:t(e,m),next:t(e,P),prev:t(e,z),get head(){return t(e,N)},get tail(){return t(e,D)},free:t(e,J),isBackgroundFetch:i=>{var s;return d(s=e,l,b).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return d(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return d(s=e,l,wt).call(s,i)},indexes:i=>{var s;return d(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return d(s=e,l,ht).call(s,i)},isStale:i=>{var s;return t(s=e,Y).call(s,i)}}}get max(){return t(this,K)}get maxSize(){return t(this,M)}get calculatedSize(){return t(this,B)}get size(){return t(this,U)}get fetchMethod(){return t(this,yt)}get memoMethod(){return t(this,Et)}get dispose(){return t(this,q)}get onInsert(){return t(this,ft)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,T).has(e)?1/0:0}*entries(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&t(this,A)[e]!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield [t(this,A)[e],t(this,m)[e]]);}*rentries(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&t(this,A)[e]!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield [t(this,A)[e],t(this,m)[e]]);}*keys(){for(let e of d(this,l,lt).call(this)){let i=t(this,A)[e];i!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield i);}}*rkeys(){for(let e of d(this,l,ht).call(this)){let i=t(this,A)[e];i!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield i);}}*values(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}*rvalues(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}[(ee=Symbol.iterator,te=Symbol.toStringTag,ee)](){return this.entries()}find(e,i={}){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,b).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,t(this,A)[s],this))return this.get(t(this,A)[s],i)}}forEach(e,i=this){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,b).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,A)[s],this);}}rforEach(e,i=this){for(let s of d(this,l,ht).call(this)){let r=t(this,m)[s],n=d(this,l,b).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,A)[s],this);}}purgeStale(){let e=false;for(let i of d(this,l,ht).call(this,{allowStale:true}))t(this,Y).call(this,i)&&(d(this,l,ct).call(this,t(this,A)[i],"expire"),e=true);return e}info(e){let i=t(this,T).get(e);if(i===void 0)return;let s=t(this,m)[i],r=d(this,l,b).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(t(this,V)&&t(this,Z)){let o=t(this,V)[i],c=t(this,Z)[i];if(o&&c){let p=o-(t(this,X).now()-c);n.ttl=p,n.start=Date.now();}}return t(this,Q)&&(n.size=t(this,Q)[i]),n}dump(){let e=[];for(let i of d(this,l,lt).call(this,{allowStale:true})){let s=t(this,A)[i],r=t(this,m)[i],n=d(this,l,b).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,V)&&t(this,Z)){o.ttl=t(this,V)[i];let c=t(this,X).now()-t(this,Z)[i];o.start=Math.floor(Date.now()-c);}t(this,Q)&&(o.size=t(this,Q)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=t(this,X).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var rt,I,k,w;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:p}=s,{noUpdateTTL:_=this.noUpdateTTL}=s,R=t(this,Tt).call(this,e,i,s.size||0,c);if(this.maxEntrySize&&R>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=true),d(this,l,ct).call(this,e,"set"),this;let S=t(this,U)===0?void 0:t(this,T).get(e);if(S===void 0)S=t(this,U)===0?t(this,D):t(this,J).length!==0?t(this,J).pop():t(this,U)===t(this,K)?d(this,l,Lt).call(this,false):t(this,U),t(this,A)[S]=e,t(this,m)[S]=i,t(this,T).set(e,S),t(this,P)[t(this,D)]=S,t(this,z)[S]=t(this,D),u(this,D,S),Rt(this,U)._++,t(this,bt).call(this,S,R,p),p&&(p.set="add"),_=false,t(this,xt)&&((rt=t(this,ft))==null||rt.call(this,i,e,"add"));else {d(this,l,wt).call(this,S);let y=t(this,m)[S];if(i!==y){if(t(this,dt)&&d(this,l,b).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(t(this,tt)&&((I=t(this,q))==null||I.call(this,a,e,"set")),t(this,j)&&t(this,L)?.push([a,e,"set"]));}else o||(t(this,tt)&&((k=t(this,q))==null||k.call(this,y,e,"set")),t(this,j)&&t(this,L)?.push([y,e,"set"]));if(t(this,gt).call(this,S),t(this,bt).call(this,S,R,p),t(this,m)[S]=i,p){p.set="replace";let a=y&&d(this,l,b).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(p.oldValue=a);}}else p&&(p.set="update");t(this,xt)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(r!==0&&!t(this,V)&&d(this,l,It).call(this),t(this,V)&&(_||t(this,Ot).call(this,S,r,n),p&&t(this,ot).call(this,p,S)),!o&&t(this,j)&&t(this,L)){let y=t(this,L),a;for(;a=y?.shift();)(w=t(this,$))==null||w.call(this,...a);}return this}pop(){var e;try{for(;t(this,U);){let i=t(this,m)[t(this,N)];if(d(this,l,Lt).call(this,!0),d(this,l,b).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,L)){let i=t(this,L),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=t(this,T).get(e);if(n!==void 0){let o=t(this,m)[n];if(d(this,l,b).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,Y).call(this,n))r&&(r.has="stale",t(this,ot).call(this,r,n));else return s&&t(this,mt).call(this,n),r&&(r.has="hit",t(this,ot).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,T).get(e);if(r===void 0||!s&&t(this,Y).call(this,r))return;let n=t(this,m)[r];return d(this,l,b).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:p=0,sizeCalculation:_=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:rt=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:E}=i;if(!t(this,dt))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let O={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:c,size:p,sizeCalculation:_,noUpdateTTL:R,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:rt,allowStaleOnFetchAbort:k,ignoreFetchAbort:I,status:a,signal:E},f=t(this,T).get(e);if(f===void 0){a&&(a.fetch="miss");let g=d(this,l,Ct).call(this,e,f,O,w);return g.__returned=g}else {let g=t(this,m)[f];if(d(this,l,b).call(this,g)){let _t=s&&g.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",_t&&(a.returnedStale=true)),_t?g.__staleWhileFetching:g.__returned=g}let F=t(this,Y).call(this,f);if(!y&&!F)return a&&(a.fetch="hit"),d(this,l,wt).call(this,f),r&&t(this,mt).call(this,f),a&&t(this,ot).call(this,a,f),g;let H=d(this,l,Ct).call(this,e,f,O,w),vt=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=F?"stale":"refresh",vt&&F&&(a.returnedStale=true)),vt?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,Et);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,c=this.get(e,o);if(!n&&c!==void 0)return c;let p=s(e,c,{options:o,context:r});return this.set(e,p,o),p}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,c=t(this,T).get(e);if(c!==void 0){let p=t(this,m)[c],_=d(this,l,b).call(this,p);return o&&t(this,ot).call(this,o,c),t(this,Y).call(this,c)?(o&&(o.get="stale"),_?(o&&s&&p.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?p.__staleWhileFetching:void 0):(n||d(this,l,ct).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?p:void 0)):(o&&(o.get="hit"),_?p.__staleWhileFetching:(d(this,l,wt).call(this,c),r&&t(this,mt).call(this,c),p))}else o&&(o.get="miss");}delete(e){return d(this,l,ct).call(this,e,"delete")}clear(){return d(this,l,Vt).call(this,"delete")}},K=new WeakMap,M=new WeakMap,q=new WeakMap,ft=new WeakMap,$=new WeakMap,yt=new WeakMap,Et=new WeakMap,X=new WeakMap,U=new WeakMap,B=new WeakMap,T=new WeakMap,A=new WeakMap,m=new WeakMap,P=new WeakMap,z=new WeakMap,N=new WeakMap,D=new WeakMap,J=new WeakMap,L=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,dt=new WeakMap,j=new WeakMap,xt=new WeakMap,l=new WeakSet,It=function(){let e=new Dt(t(this,K)),i=new Dt(t(this,K));u(this,V,e),u(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,K)):void 0;u(this,W,s),u(this,Ot,(c,p,_=t(this,X).now())=>{i[c]=p!==0?_:0,e[c]=p,r(c,p);}),u(this,mt,c=>{i[c]=e[c]!==0?t(this,X).now():0,r(c,e[c]);});let r=this.ttlAutopurge?(c,p)=>{if(s?.[c]&&(clearTimeout(s[c]),s[c]=void 0),p&&p!==0&&s){let _=setTimeout(()=>{t(this,Y).call(this,c)&&d(this,l,ct).call(this,t(this,A)[c],"expire");},p+1);_.unref&&_.unref(),s[c]=_;}}:()=>{};u(this,ot,(c,p)=>{if(e[p]){let _=e[p],R=i[p];if(!_||!R)return;c.ttl=_,c.start=R,c.now=n||o();let S=c.now-R;c.remainingTTL=_-S;}});let n=0,o=()=>{let c=t(this,X).now();if(this.ttlResolution>0){n=c;let p=setTimeout(()=>n=0,this.ttlResolution);p.unref&&p.unref();}return c};this.getRemainingTTL=c=>{let p=t(this,T).get(c);if(p===void 0)return 0;let _=e[p],R=i[p];if(!_||!R)return 1/0;let S=(n||o())-R;return _-S},u(this,Y,c=>{let p=i[c],_=e[c];return !!_&&!!p&&(n||o())-p>_});},mt=new WeakMap,ot=new WeakMap,Ot=new WeakMap,Y=new WeakMap,ne=function(){let e=new Dt(t(this,K));u(this,B,0),u(this,Q,e),u(this,gt,i=>{u(this,B,t(this,B)-e[i]),e[i]=0;}),u(this,Tt,(i,s,r,n)=>{if(d(this,l,b).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(r))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 r}),u(this,bt,(i,s,r)=>{if(e[i]=s,t(this,M)){let n=t(this,M)-e[i];for(;t(this,B)>n;)d(this,l,Lt).call(this,true);}u(this,B,t(this,B)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,B));});},gt=new WeakMap,bt=new WeakMap,Tt=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(t(this,U))for(let i=t(this,D);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(t(this,U))for(let i=t(this,N);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,D)));)i=t(this,P)[i];},Mt=function(e){return e!==void 0&&t(this,T).get(t(this,A)[e])===e},Lt=function(e){var n;let i=t(this,N),s=t(this,A)[i],r=t(this,m)[i];return t(this,dt)&&d(this,l,b).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((n=t(this,q))==null||n.call(this,r,s,"evict")),t(this,j)&&t(this,L)?.push([r,s,"evict"])),t(this,gt).call(this,i),t(this,W)?.[i]&&(clearTimeout(t(this,W)[i]),t(this,W)[i]=void 0),e&&(t(this,A)[i]=void 0,t(this,m)[i]=void 0,t(this,J).push(i)),t(this,U)===1?(u(this,N,u(this,D,0)),t(this,J).length=0):u(this,N,t(this,P)[i]),t(this,T).delete(s),Rt(this,U)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:t(this,m)[i];if(d(this,l,b).call(this,n))return n;let o=new Nt,{signal:c}=s;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let p={signal:o.signal,options:s,context:r},_=(w,y=false)=>{let{aborted:a}=o.signal,E=s.ignoreFetchAbort&&w!==void 0,O=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,E&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!E&&!y)return S(o.signal.reason,O);let f=I,g=t(this,m)[i];return (g===I||E&&y&&g===void 0)&&(w===void 0?f.__staleWhileFetching!==void 0?t(this,m)[i]=f.__staleWhileFetching:d(this,l,ct).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,w,p.options))),w},R=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,E=a&&s.allowStaleOnFetchAbort,O=E||s.allowStaleOnFetchRejection,f=O||s.noDeleteOnFetchRejection,g=I;if(t(this,m)[i]===I&&(!f||!y&&g.__staleWhileFetching===void 0?d(this,l,ct).call(this,e,"fetch"):E||(t(this,m)[i]=g.__staleWhileFetching)),O)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),g.__staleWhileFetching;if(g.__returned===g)throw w},rt=(w,y)=>{var E;let a=(E=t(this,yt))==null?void 0:E.call(this,e,n,p);a&&a instanceof Promise&&a.then(O=>w(O===void 0?void 0:O),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=O=>_(O,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(rt).then(_,R),k=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...p.options,status:void 0}),i=t(this,T).get(e)):t(this,m)[i]=k,k},b=function(e){if(!t(this,dt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},zt=function(e,i){t(this,z)[i]=e,t(this,P)[e]=i;},wt=function(e){e!==t(this,D)&&(e===t(this,N)?u(this,N,t(this,P)[e]):d(this,l,zt).call(this,t(this,z)[e],t(this,P)[e]),d(this,l,zt).call(this,t(this,D),e),u(this,D,e));},ct=function(e,i){var r,n;let s=false;if(t(this,U)!==0){let o=t(this,T).get(e);if(o!==void 0)if(t(this,W)?.[o]&&(clearTimeout(t(this,W)?.[o]),t(this,W)[o]=void 0),s=true,t(this,U)===1)d(this,l,Vt).call(this,i);else {t(this,gt).call(this,o);let c=t(this,m)[o];if(d(this,l,b).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((r=t(this,q))==null||r.call(this,c,e,i)),t(this,j)&&t(this,L)?.push([c,e,i])),t(this,T).delete(e),t(this,A)[o]=void 0,t(this,m)[o]=void 0,o===t(this,D))u(this,D,t(this,z)[o]);else if(o===t(this,N))u(this,N,t(this,P)[o]);else {let p=t(this,z)[o];t(this,P)[p]=t(this,P)[o];let _=t(this,P)[o];t(this,z)[_]=t(this,z)[o];}Rt(this,U)._--,t(this,J).push(o);}}if(t(this,j)&&t(this,L)?.length){let o=t(this,L),c;for(;c=o?.shift();)(n=t(this,$))==null||n.call(this,...c);}return s},Vt=function(e){var i,s;for(let r of d(this,l,ht).call(this,{allowStale:true})){let n=t(this,m)[r];if(d(this,l,b).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,A)[r];t(this,tt)&&((i=t(this,q))==null||i.call(this,n,o,e)),t(this,j)&&t(this,L)?.push([n,o,e]);}}if(t(this,T).clear(),t(this,m).fill(void 0),t(this,A).fill(void 0),t(this,V)&&t(this,Z)){t(this,V).fill(0),t(this,Z).fill(0);for(let r of t(this,W)??[])r!==void 0&&clearTimeout(r);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),u(this,N,0),u(this,D,0),t(this,J).length=0,u(this,B,0),u(this,U,0),t(this,j)&&t(this,L)){let r=t(this,L),n;for(;n=r?.shift();)(s=t(this,$))==null||s.call(this,...n);}},At);var Ft=class{constructor(e){x(this,"cache");x(this,"map",new Map);this.cache=new oe({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ut="1.7.2";var Wt={version:Ut};var Yt="repeat";function Ht(h){return {type:"pause",duration:h}}var Kt="__game_layer__";var _e="general";var Se={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var le={};var kt={};fe(kt,{createExportableElement:()=>he});var pt;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(pt||(pt={}));function he(h){try{if(typeof h>"u")return h;let e=JSON.stringify(h);return JSON.parse(e)}catch(e){throw pt.error("Error creating exportable element",h,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var ce=[" ____ _ _ ___ ___ _ "," | _ \\(_)_ _(_| ) \\ / / \\ | |"," | |_) | \\ \\/ / |/ \\ \\ / /| \\| |"," | __/| |> <| | \\ V / | |\\ |",` |_| |_/_/\\_\\_| \\_/ |_| \\_| v${Wt.version}`],de=17,Ee="background:#2f90da;color:#fff;font-weight:bold;",xe="background:#c832bb;color:#fff;font-weight:bold;",be="background:transparent;font-weight:bold;",qt=` v${Wt.version}`;function pe(){let h=[],e=[];for(let i=0;i<ce.length;i++){let s=ce[i],r=s.endsWith(qt),n=r?s.slice(0,-qt.length):s,o=n.slice(0,de),c=n.slice(de),p=r?"%c%s%c%s%c%s":"%c%s%c%s";h.push(p),e.push(Ee,o,xe,c),r&&e.push(be,qt);}console.info(h.join(`
|
|
2
|
-
`),...e);}function $t(){let h=window.location.pathname+window.location.hash;return h.includes("#")&&(h=h.split("#")[1]),h}exports.Game=void 0;(y=>{async function h(a,
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var nt=require('@drincs/pixi-vn/canvas'),Xt=require('@drincs/pixi-vn/characters'),core=require('@drincs/pixi-vn/core'),et=require('@drincs/pixi-vn/history'),C=require('@drincs/pixi-vn/narration'),ut=require('@drincs/pixi-vn/sound'),G=require('@drincs/pixi-vn/storage'),motion=require('@drincs/pixi-vn/motion');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var nt__namespace=/*#__PURE__*/_interopNamespace(nt);var Xt__namespace=/*#__PURE__*/_interopNamespace(Xt);var et__namespace=/*#__PURE__*/_interopNamespace(et);var C__namespace=/*#__PURE__*/_interopNamespace(C);var ut__namespace=/*#__PURE__*/_interopNamespace(ut);var G__namespace=/*#__PURE__*/_interopNamespace(G);var Jt=Object.defineProperty;var Qt=h=>{throw TypeError(h)};var ue=(h,e,i)=>e in h?Jt(h,e,{enumerable:true,configurable:true,writable:true,value:i}):h[e]=i;var fe=(h,e)=>{for(var i in e)Jt(h,i,{get:e[i],enumerable:true});};var E=(h,e,i)=>ue(h,typeof e!="symbol"?e+"":e,i),jt=(h,e,i)=>e.has(h)||Qt("Cannot "+i);var t=(h,e,i)=>(jt(h,e,"read from private field"),i?i.call(h):e.get(h)),_=(h,e,i)=>e.has(h)?Qt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,i),u=(h,e,i,s)=>(jt(h,e,"write to private field"),e.set(h,i),i),d=(h,e,i)=>(jt(h,e,"access private method"),i);var Rt=(h,e,i,s)=>({set _(r){u(h,e,r);},get _(){return t(h,e,s)}});var me=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ie=new Set,Gt=typeof process=="object"&&process?process:{},se=(h,e,i,s)=>{typeof Gt.emitWarning=="function"?Gt.emitWarning(h,e,i,s):console.error(`[${i}] ${e}: ${h}`);},Nt=globalThis.AbortController,Zt=globalThis.AbortSignal;if(typeof Nt>"u"){Zt=class{constructor(){E(this,"onabort");E(this,"_onabort",[]);E(this,"reason");E(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){E(this,"signal",new Zt);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let h=Gt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{h&&(h=false,se("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var ge=h=>!ie.has(h);var at=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),re=h=>at(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(h){super(h),this.fill(0);}},it,St,_e=(it=class{constructor(e,i){E(this,"heap");E(this,"length");if(!t(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=re(e);if(!i)return [];u(it,St,true);let s=new it(e,i);return u(it,St,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,_(it,St,false),it),te,ee,K,M,q,ft,$,yt,xt,B,U,X,T,b,m,P,z,N,D,J,L,Q,Z,V,W,tt,dt,j,Et,l,It,mt,ot,Ot,Y,ne,gt,wt,Tt,lt,ht,Mt,Lt,Ct,w,zt,At,ct,Vt,bt,oe=(bt=class{constructor(e){_(this,l);_(this,K);_(this,M);_(this,q);_(this,ft);_(this,$);_(this,yt);_(this,xt);_(this,B);E(this,"ttl");E(this,"ttlResolution");E(this,"ttlAutopurge");E(this,"updateAgeOnGet");E(this,"updateAgeOnHas");E(this,"allowStale");E(this,"noDisposeOnSet");E(this,"noUpdateTTL");E(this,"maxEntrySize");E(this,"sizeCalculation");E(this,"noDeleteOnFetchRejection");E(this,"noDeleteOnStaleGet");E(this,"allowStaleOnFetchAbort");E(this,"allowStaleOnFetchRejection");E(this,"ignoreFetchAbort");_(this,U);_(this,X);_(this,T);_(this,b);_(this,m);_(this,P);_(this,z);_(this,N);_(this,D);_(this,J);_(this,L);_(this,Q);_(this,Z);_(this,V);_(this,W);_(this,tt);_(this,dt);_(this,j);_(this,Et);_(this,mt,()=>{});_(this,ot,()=>{});_(this,Ot,()=>{});_(this,Y,()=>false);_(this,gt,e=>{});_(this,wt,(e,i,s)=>{});_(this,Tt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});E(this,te,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:p,dispose:v,onInsert:R,disposeAfter:S,noDisposeOnSet:rt,noUpdateTTL:I,maxSize:k=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:f,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:F,ignoreFetchAbort:H,perf:_t}=e;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,B,_t??me),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?re(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(u(this,K,i),u(this,M,k),this.maxEntrySize=A||t(this,M),this.sizeCalculation=y,this.sizeCalculation){if(!t(this,M)&&!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(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,xt,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,yt,a),u(this,dt,!!a),u(this,T,new Map),u(this,b,new Array(i).fill(void 0)),u(this,m,new Array(i).fill(void 0)),u(this,P,new vt(i)),u(this,z,new vt(i)),u(this,N,0),u(this,D,0),u(this,J,_e.create(i)),u(this,U,0),u(this,X,0),typeof v=="function"&&u(this,q,v),typeof R=="function"&&u(this,ft,R),typeof S=="function"?(u(this,$,S),u(this,L,[])):(u(this,$,void 0),u(this,L,void 0)),u(this,tt,!!t(this,q)),u(this,Et,!!t(this,ft)),u(this,j,!!t(this,$)),this.noDisposeOnSet=!!rt,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!g,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,M)!==0&&!at(t(this,M)))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");d(this,l,ne).call(this);}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!f,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,It).call(this);}if(t(this,K)===0&&this.ttl===0&&t(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,K)&&!t(this,M)){let Pt="LRU_CACHE_UNBOUNDED";ge(Pt)&&(ie.add(Pt),se("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,bt));}}get perf(){return t(this,B)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,V),autopurgeTimers:t(e,W),sizes:t(e,Q),keyMap:t(e,T),keyList:t(e,b),valList:t(e,m),next:t(e,P),prev:t(e,z),get head(){return t(e,N)},get tail(){return t(e,D)},free:t(e,J),isBackgroundFetch:i=>{var s;return d(s=e,l,w).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return d(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return d(s=e,l,At).call(s,i)},indexes:i=>{var s;return d(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return d(s=e,l,ht).call(s,i)},isStale:i=>{var s;return t(s=e,Y).call(s,i)}}}get max(){return t(this,K)}get maxSize(){return t(this,M)}get calculatedSize(){return t(this,X)}get size(){return t(this,U)}get fetchMethod(){return t(this,yt)}get memoMethod(){return t(this,xt)}get dispose(){return t(this,q)}get onInsert(){return t(this,ft)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,T).has(e)?1/0:0}*entries(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,w).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*rentries(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,w).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*keys(){for(let e of d(this,l,lt).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,w).call(this,t(this,m)[e])&&(yield i);}}*rkeys(){for(let e of d(this,l,ht).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,w).call(this,t(this,m)[e])&&(yield i);}}*values(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&!d(this,l,w).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}*rvalues(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&!d(this,l,w).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}[(ee=Symbol.iterator,te=Symbol.toStringTag,ee)](){return this.entries()}find(e,i={}){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,w).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,t(this,b)[s],this))return this.get(t(this,b)[s],i)}}forEach(e,i=this){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,w).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}rforEach(e,i=this){for(let s of d(this,l,ht).call(this)){let r=t(this,m)[s],n=d(this,l,w).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}purgeStale(){let e=false;for(let i of d(this,l,ht).call(this,{allowStale:true}))t(this,Y).call(this,i)&&(d(this,l,ct).call(this,t(this,b)[i],"expire"),e=true);return e}info(e){let i=t(this,T).get(e);if(i===void 0)return;let s=t(this,m)[i],r=d(this,l,w).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(t(this,V)&&t(this,Z)){let o=t(this,V)[i],c=t(this,Z)[i];if(o&&c){let p=o-(t(this,B).now()-c);n.ttl=p,n.start=Date.now();}}return t(this,Q)&&(n.size=t(this,Q)[i]),n}dump(){let e=[];for(let i of d(this,l,lt).call(this,{allowStale:true})){let s=t(this,b)[i],r=t(this,m)[i],n=d(this,l,w).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,V)&&t(this,Z)){o.ttl=t(this,V)[i];let c=t(this,B).now()-t(this,Z)[i];o.start=Math.floor(Date.now()-c);}t(this,Q)&&(o.size=t(this,Q)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=t(this,B).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var rt,I,k,A;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:p}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,R=t(this,Tt).call(this,e,i,s.size||0,c);if(this.maxEntrySize&&R>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=true),d(this,l,ct).call(this,e,"set"),this;let S=t(this,U)===0?void 0:t(this,T).get(e);if(S===void 0)S=t(this,U)===0?t(this,D):t(this,J).length!==0?t(this,J).pop():t(this,U)===t(this,K)?d(this,l,Lt).call(this,false):t(this,U),t(this,b)[S]=e,t(this,m)[S]=i,t(this,T).set(e,S),t(this,P)[t(this,D)]=S,t(this,z)[S]=t(this,D),u(this,D,S),Rt(this,U)._++,t(this,wt).call(this,S,R,p),p&&(p.set="add"),v=false,t(this,Et)&&((rt=t(this,ft))==null||rt.call(this,i,e,"add"));else {d(this,l,At).call(this,S);let y=t(this,m)[S];if(i!==y){if(t(this,dt)&&d(this,l,w).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(t(this,tt)&&((I=t(this,q))==null||I.call(this,a,e,"set")),t(this,j)&&t(this,L)?.push([a,e,"set"]));}else o||(t(this,tt)&&((k=t(this,q))==null||k.call(this,y,e,"set")),t(this,j)&&t(this,L)?.push([y,e,"set"]));if(t(this,gt).call(this,S),t(this,wt).call(this,S,R,p),t(this,m)[S]=i,p){p.set="replace";let a=y&&d(this,l,w).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(p.oldValue=a);}}else p&&(p.set="update");t(this,Et)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(r!==0&&!t(this,V)&&d(this,l,It).call(this),t(this,V)&&(v||t(this,Ot).call(this,S,r,n),p&&t(this,ot).call(this,p,S)),!o&&t(this,j)&&t(this,L)){let y=t(this,L),a;for(;a=y?.shift();)(A=t(this,$))==null||A.call(this,...a);}return this}pop(){var e;try{for(;t(this,U);){let i=t(this,m)[t(this,N)];if(d(this,l,Lt).call(this,!0),d(this,l,w).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,L)){let i=t(this,L),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=t(this,T).get(e);if(n!==void 0){let o=t(this,m)[n];if(d(this,l,w).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,Y).call(this,n))r&&(r.has="stale",t(this,ot).call(this,r,n));else return s&&t(this,mt).call(this,n),r&&(r.has="hit",t(this,ot).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,T).get(e);if(r===void 0||!s&&t(this,Y).call(this,r))return;let n=t(this,m)[r];return d(this,l,w).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:p=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:rt=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:A,forceRefresh:y=false,status:a,signal:x}=i;if(!t(this,dt))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let O={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:c,size:p,sizeCalculation:v,noUpdateTTL:R,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:rt,allowStaleOnFetchAbort:k,ignoreFetchAbort:I,status:a,signal:x},f=t(this,T).get(e);if(f===void 0){a&&(a.fetch="miss");let g=d(this,l,Ct).call(this,e,f,O,A);return g.__returned=g}else {let g=t(this,m)[f];if(d(this,l,w).call(this,g)){let vt=s&&g.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?g.__staleWhileFetching:g.__returned=g}let F=t(this,Y).call(this,f);if(!y&&!F)return a&&(a.fetch="hit"),d(this,l,At).call(this,f),r&&t(this,mt).call(this,f),a&&t(this,ot).call(this,a,f),g;let H=d(this,l,Ct).call(this,e,f,O,A),_t=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=F?"stale":"refresh",_t&&F&&(a.returnedStale=true)),_t?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,xt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,c=this.get(e,o);if(!n&&c!==void 0)return c;let p=s(e,c,{options:o,context:r});return this.set(e,p,o),p}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,c=t(this,T).get(e);if(c!==void 0){let p=t(this,m)[c],v=d(this,l,w).call(this,p);return o&&t(this,ot).call(this,o,c),t(this,Y).call(this,c)?(o&&(o.get="stale"),v?(o&&s&&p.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?p.__staleWhileFetching:void 0):(n||d(this,l,ct).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?p:void 0)):(o&&(o.get="hit"),v?p.__staleWhileFetching:(d(this,l,At).call(this,c),r&&t(this,mt).call(this,c),p))}else o&&(o.get="miss");}delete(e){return d(this,l,ct).call(this,e,"delete")}clear(){return d(this,l,Vt).call(this,"delete")}},K=new WeakMap,M=new WeakMap,q=new WeakMap,ft=new WeakMap,$=new WeakMap,yt=new WeakMap,xt=new WeakMap,B=new WeakMap,U=new WeakMap,X=new WeakMap,T=new WeakMap,b=new WeakMap,m=new WeakMap,P=new WeakMap,z=new WeakMap,N=new WeakMap,D=new WeakMap,J=new WeakMap,L=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,dt=new WeakMap,j=new WeakMap,Et=new WeakMap,l=new WeakSet,It=function(){let e=new Dt(t(this,K)),i=new Dt(t(this,K));u(this,V,e),u(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,K)):void 0;u(this,W,s),u(this,Ot,(c,p,v=t(this,B).now())=>{i[c]=p!==0?v:0,e[c]=p,r(c,p);}),u(this,mt,c=>{i[c]=e[c]!==0?t(this,B).now():0,r(c,e[c]);});let r=this.ttlAutopurge?(c,p)=>{if(s?.[c]&&(clearTimeout(s[c]),s[c]=void 0),p&&p!==0&&s){let v=setTimeout(()=>{t(this,Y).call(this,c)&&d(this,l,ct).call(this,t(this,b)[c],"expire");},p+1);v.unref&&v.unref(),s[c]=v;}}:()=>{};u(this,ot,(c,p)=>{if(e[p]){let v=e[p],R=i[p];if(!v||!R)return;c.ttl=v,c.start=R,c.now=n||o();let S=c.now-R;c.remainingTTL=v-S;}});let n=0,o=()=>{let c=t(this,B).now();if(this.ttlResolution>0){n=c;let p=setTimeout(()=>n=0,this.ttlResolution);p.unref&&p.unref();}return c};this.getRemainingTTL=c=>{let p=t(this,T).get(c);if(p===void 0)return 0;let v=e[p],R=i[p];if(!v||!R)return 1/0;let S=(n||o())-R;return v-S},u(this,Y,c=>{let p=i[c],v=e[c];return !!v&&!!p&&(n||o())-p>v});},mt=new WeakMap,ot=new WeakMap,Ot=new WeakMap,Y=new WeakMap,ne=function(){let e=new Dt(t(this,K));u(this,X,0),u(this,Q,e),u(this,gt,i=>{u(this,X,t(this,X)-e[i]),e[i]=0;}),u(this,Tt,(i,s,r,n)=>{if(d(this,l,w).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(r))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 r}),u(this,wt,(i,s,r)=>{if(e[i]=s,t(this,M)){let n=t(this,M)-e[i];for(;t(this,X)>n;)d(this,l,Lt).call(this,true);}u(this,X,t(this,X)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,X));});},gt=new WeakMap,wt=new WeakMap,Tt=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(t(this,U))for(let i=t(this,D);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(t(this,U))for(let i=t(this,N);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,D)));)i=t(this,P)[i];},Mt=function(e){return e!==void 0&&t(this,T).get(t(this,b)[e])===e},Lt=function(e){var n;let i=t(this,N),s=t(this,b)[i],r=t(this,m)[i];return t(this,dt)&&d(this,l,w).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((n=t(this,q))==null||n.call(this,r,s,"evict")),t(this,j)&&t(this,L)?.push([r,s,"evict"])),t(this,gt).call(this,i),t(this,W)?.[i]&&(clearTimeout(t(this,W)[i]),t(this,W)[i]=void 0),e&&(t(this,b)[i]=void 0,t(this,m)[i]=void 0,t(this,J).push(i)),t(this,U)===1?(u(this,N,u(this,D,0)),t(this,J).length=0):u(this,N,t(this,P)[i]),t(this,T).delete(s),Rt(this,U)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:t(this,m)[i];if(d(this,l,w).call(this,n))return n;let o=new Nt,{signal:c}=s;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let p={signal:o.signal,options:s,context:r},v=(A,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&A!==void 0,O=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&A!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,O);let f=I,g=t(this,m)[i];return (g===I||x&&y&&g===void 0)&&(A===void 0?f.__staleWhileFetching!==void 0?t(this,m)[i]=f.__staleWhileFetching:d(this,l,ct).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,A,p.options))),A},R=A=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=A),S(A,false)),S=(A,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,O=x||s.allowStaleOnFetchRejection,f=O||s.noDeleteOnFetchRejection,g=I;if(t(this,m)[i]===I&&(!f||!y&&g.__staleWhileFetching===void 0?d(this,l,ct).call(this,e,"fetch"):x||(t(this,m)[i]=g.__staleWhileFetching)),O)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),g.__staleWhileFetching;if(g.__returned===g)throw A},rt=(A,y)=>{var x;let a=(x=t(this,yt))==null?void 0:x.call(this,e,n,p);a&&a instanceof Promise&&a.then(O=>A(O===void 0?void 0:O),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(A(void 0),s.allowStaleOnFetchAbort&&(A=O=>v(O,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(rt).then(v,R),k=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...p.options,status:void 0}),i=t(this,T).get(e)):t(this,m)[i]=k,k},w=function(e){if(!t(this,dt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},zt=function(e,i){t(this,z)[i]=e,t(this,P)[e]=i;},At=function(e){e!==t(this,D)&&(e===t(this,N)?u(this,N,t(this,P)[e]):d(this,l,zt).call(this,t(this,z)[e],t(this,P)[e]),d(this,l,zt).call(this,t(this,D),e),u(this,D,e));},ct=function(e,i){var r,n;let s=false;if(t(this,U)!==0){let o=t(this,T).get(e);if(o!==void 0)if(t(this,W)?.[o]&&(clearTimeout(t(this,W)?.[o]),t(this,W)[o]=void 0),s=true,t(this,U)===1)d(this,l,Vt).call(this,i);else {t(this,gt).call(this,o);let c=t(this,m)[o];if(d(this,l,w).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((r=t(this,q))==null||r.call(this,c,e,i)),t(this,j)&&t(this,L)?.push([c,e,i])),t(this,T).delete(e),t(this,b)[o]=void 0,t(this,m)[o]=void 0,o===t(this,D))u(this,D,t(this,z)[o]);else if(o===t(this,N))u(this,N,t(this,P)[o]);else {let p=t(this,z)[o];t(this,P)[p]=t(this,P)[o];let v=t(this,P)[o];t(this,z)[v]=t(this,z)[o];}Rt(this,U)._--,t(this,J).push(o);}}if(t(this,j)&&t(this,L)?.length){let o=t(this,L),c;for(;c=o?.shift();)(n=t(this,$))==null||n.call(this,...c);}return s},Vt=function(e){var i,s;for(let r of d(this,l,ht).call(this,{allowStale:true})){let n=t(this,m)[r];if(d(this,l,w).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,b)[r];t(this,tt)&&((i=t(this,q))==null||i.call(this,n,o,e)),t(this,j)&&t(this,L)?.push([n,o,e]);}}if(t(this,T).clear(),t(this,m).fill(void 0),t(this,b).fill(void 0),t(this,V)&&t(this,Z)){t(this,V).fill(0),t(this,Z).fill(0);for(let r of t(this,W)??[])r!==void 0&&clearTimeout(r);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),u(this,N,0),u(this,D,0),t(this,J).length=0,u(this,X,0),u(this,U,0),t(this,j)&&t(this,L)){let r=t(this,L),n;for(;n=r?.shift();)(s=t(this,$))==null||s.call(this,...n);}},bt);var Ft=class{constructor(e){E(this,"cache");E(this,"map",new Map);this.cache=new oe({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ut="1.8.0";var Wt={version:Ut};var Yt="repeat";function Ht(h){return {type:"pause",duration:h}}var Kt="__game_layer__";var ve={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var le={};var kt={};fe(kt,{createExportableElement:()=>he});var pt;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(pt||(pt={}));function he(h){try{if(typeof h>"u")return h;let e=JSON.stringify(h);return JSON.parse(e)}catch(e){throw pt.error("Error creating exportable element",h,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var ye=typeof window<"u"&&typeof document<"u",ce=[" _______ _ _ _ ____ ____ ____ _____ ","|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|"," | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | | "," | ___/[ | [ \\ [ ][ | \\ \\ / / | |\\ \\| | "," _| |_ | | > ' < | | \\ ' / _| |_\\ |_ ",`|_____| [___][__]\`\\_][___] \\_/ |_____|\\____| v${Wt.version}`],de=31,xe="background:#2f90da;color:#fff;font-weight:bold;",Ee="background:#c832bb;color:#fff;font-weight:bold;",we="background:transparent;font-weight:bold;",qt=` v${Wt.version}`;function pe(){if(!ye)return;let h=[],e=[];for(let i=0;i<ce.length;i++){let s=ce[i],r=s.endsWith(qt),n=r?s.slice(0,-qt.length):s,o=n.slice(0,de),c=n.slice(de),p=r?"%c%s%c%s%c%s":"%c%s%c%s";h.push(p),e.push(xe,o,Ee,c),r&&e.push(we,qt);}console.info(h.join(`
|
|
2
|
+
`),...e);}function $t(){let h=window.location.pathname+window.location.hash;return h.includes("#")&&(h=h.split("#")[1]),h}pe();exports.Game=void 0;(y=>{async function h(a,x,O){if(core.GameUnifier.init({navigate:x?.navigate,getCurrentGameStepState:()=>{let f={};try{f=nt__namespace.canvas.export();}catch{}return {path:$t(),storage:G__namespace.storage.export(),canvas:f,sound:ut__namespace.sound.export(),labelIndex:C__namespace.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:C__namespace.narration.openedLabels}},restoreGameStepState:async(f,g)=>{et__namespace.HistoryManagerStatic._originalStepData=f,C__namespace.NarrationManagerStatic.openedLabels=f.openedLabels,G__namespace.storage.restore(f.storage);try{await nt__namespace.canvas.restore(f.canvas),await ut__namespace.sound.restore(f.sound);}catch(F){pt.error("Error restoring game step state:",F);}await g(f.path);},getStepCounter:()=>C__namespace.narration.stepCounter,setStepCounter:f=>{C__namespace.NarrationManagerStatic._stepCounter=f;},getOpenedLabels:()=>C__namespace.narration.openedLabels.length,addHistoryItem:(f,g)=>et__namespace.stepHistory.add(f,g),getCharacter:f=>Xt__namespace.RegisteredCharacters.get(f),processNavigationRequests:(f,g)=>{let F=f,H=Promise.resolve();return f>0?(F--,H=C__namespace.narration.continue(g)):f<0&&(F=0,H=et__namespace.stepHistory.back(g,{steps:f*-1})),{newValue:F,result:H}},animate:(f,g,F,H)=>motion.motion.animate(f,g,F,H),getVariable:(f,g)=>G__namespace.StorageManagerStatic.getVariable(f,g),setVariable:(f,g,F)=>G__namespace.StorageManagerStatic.setVariable(f,g,F),removeVariable:(f,g)=>G__namespace.StorageManagerStatic.removeVariable(f,g),getFlag:f=>G__namespace.storage.getFlag(f),setFlag:(f,g)=>G__namespace.storage.setFlag(f,g),onLabelClosing:f=>G__namespace.StorageManagerStatic.clearOldTempVariables(f)}),!a||!x){pt.warn("The canvas element or options are not defined. The canvas will not be initialized.");return}return await nt__namespace.canvas.init(a,x,O)}y.init=h;function e(){G__namespace.storage.clear();try{nt__namespace.canvas.clear();}catch{}ut__namespace.sound.clear(),C__namespace.narration.clear(),et__namespace.stepHistory.clear();}y.clear=e;function i(){let a={};try{a=nt__namespace.canvas.export();}catch{}return {pixivn_version:Ut,stepData:C__namespace.narration.export(),storageData:G__namespace.storage.export(),canvasData:a,soundData:ut__namespace.sound.export(),historyData:et__namespace.stepHistory.export(),path:$t()}}y.exportGameState=i;async function s(a,x){et__namespace.stepHistory.restore(a.historyData);let O=et__namespace.stepHistory.lastKey;if(typeof O=="number"){let f=et__namespace.stepHistory.stepsInfoMap.get(O)||null;await C__namespace.narration.restore(a.stepData,f);}G__namespace.storage.restore(a.storageData);try{await nt__namespace.canvas.restore(a.canvasData),await ut__namespace.sound.restore(a.soundData);}catch{}x?await x(a.path):await core.GameUnifier.navigate(a.path);}y.restoreGameState=s;async function r(a,x){return y.clear(),await C__namespace.narration.call(a,x)}y.start=r;function n(a){return JSON.parse(a)}y.jsonToGameState=n;function o(a){core.GameUnifier.onEnd=a;}y.onEnd=o;function c(a){return pt.warn("Game.onError is deprecated. Use Game.addOnError / Game.removeOnError to register multiple handlers."),core.GameUnifier.addOnError((x,O)=>a("step",x,O))}y.onError=c;function p(a){return core.GameUnifier.addOnError(a)}y.addOnError=p;function v(a){return core.GameUnifier.removeOnError(a)}y.removeOnError=v;function R(a){C__namespace.NarrationManagerStatic.onStepStart=a;}y.onStepStart=R;function S(a){C__namespace.NarrationManagerStatic.onLoadingLabel=a;}y.onLoadingLabel=S;function rt(a){C__namespace.NarrationManagerStatic.onStepEnd=a;}y.onStepEnd=rt;function I(a){core.GameUnifier.navigate=a;}y.onNavigate=I;function k(a){return core.GameUnifier.addOnPreContinue(a)}y.addOnPreContinue=k;function A(a){return core.GameUnifier.removeOnPreContinue(a)}y.removeOnPreContinue=A;})(exports.Game||(exports.Game={}));var Ze={characterUtils:Xt__namespace,canvasUtils:nt__namespace,narrationUtils:C__namespace,soundUtils:ut__namespace,CANVAS_APP_GAME_LAYER_ALIAS:Kt,Pause:Ht,Repeat:Yt,PIXIVN_VERSION:Ut,...kt,...le,canvas:nt__namespace.canvas,narration:C__namespace.narration,sound:ut__namespace.sound,storage:G__namespace.storage,history:et__namespace.stepHistory,Game:exports.Game,GameUnifier:core.GameUnifier};exports.CANVAS_APP_GAME_LAYER_ALIAS=Kt;exports.CachedMap=Ft;exports.PIXIVN_VERSION=Ut;exports.Pause=Ht;exports.Repeat=Yt;exports.SYSTEM_RESERVED_STORAGE_KEYS=ve;exports.createExportableElement=he;exports.default=Ze;Object.keys(nt).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return nt[k]}})});Object.keys(Xt).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return Xt[k]}})});Object.keys(core).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return core[k]}})});Object.keys(et).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return et[k]}})});Object.keys(C).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return C[k]}})});Object.keys(ut).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return ut[k]}})});Object.keys(G).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return G[k]}})});
|