@drincs/pixi-vn 1.9.4 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +186 -170
- package/dist/{ContainerMemory-DNqSVzLY.d.cts → ContainerMemory-De04YSUc.d.cts} +2 -1
- package/dist/{ContainerMemory-DNqSVzLY.d.ts → ContainerMemory-De04YSUc.d.ts} +2 -1
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +1008 -918
- package/dist/canvas.d.ts +1008 -918
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.d.cts +3 -2
- package/dist/characters.d.ts +3 -2
- package/dist/characters.mjs +1 -1
- package/dist/{chunk-S7HZUIEI.mjs → chunk-A5FN4SNI.mjs} +1 -1
- package/dist/chunk-B46NFIFC.mjs +1 -0
- package/dist/chunk-FPMP2OWB.mjs +1 -0
- package/dist/{chunk-6OABTG5R.mjs → chunk-OJKUK6GL.mjs} +1 -1
- package/dist/{chunk-5MVDNAT4.mjs → chunk-WYGKBGMH.mjs} +1 -1
- package/dist/chunk-XLRCR56W.mjs +1 -0
- package/dist/core.d.cts +12 -5
- package/dist/core.d.ts +12 -5
- package/dist/filters.cjs +1 -1
- package/dist/filters.d.cts +18 -3
- package/dist/filters.d.ts +18 -3
- package/dist/filters.mjs +1 -1
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +10 -5
- package/dist/history.d.ts +10 -5
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +16 -7
- package/dist/index.d.ts +16 -7
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.d.cts +8 -2
- package/dist/motion.d.ts +8 -2
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +2 -2
- package/dist/narration.d.cts +7 -2
- package/dist/narration.d.ts +7 -2
- package/dist/narration.mjs +1 -1
- package/dist/pixi/browser.js +182 -148
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +3 -2
- package/dist/sound.d.ts +3 -2
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +7 -2
- package/dist/storage.d.ts +7 -2
- package/dist/storage.mjs +1 -1
- package/dist/tickers.cjs +1 -1
- package/dist/tickers.d.cts +72 -1
- package/dist/tickers.d.ts +72 -1
- package/dist/tickers.mjs +1 -1
- package/dist/vite-listener.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.cts +2 -1
- package/dist/vite.d.ts +2 -1
- package/dist/vite.mjs +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +2 -1
- package/dist/worker.d.ts +2 -1
- package/package.json +11 -10
- package/dist/chunk-AW5XWF24.mjs +0 -1
- package/dist/chunk-K7JIC2F2.mjs +0 -1
package/dist/characters.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-OJKUK6GL.mjs';import {m}from'./chunk-HD353M4B.mjs';import'./chunk-A5FN4SNI.mjs';import {d,e}from'./chunk-B46NFIFC.mjs';var g="@",n=class extends b{sourceId;constructor(e,r=""){super(m.CHARACTER_CATEGORY_KEY,e+(r?g+r:"")),this.sourceId=e,this.migrateOldStorage("___character___");}getStorageProperty(e){let r=super.getStorageProperty(e);return r===void 0&&(r=super.getStorageProperty(e,this.sourceId)),r}};var i=class extends n{constructor(e,r){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion),this.defaultName=r.name,this.defaultSurname=r.surname,this.defaultAge=r.age,this.icon=r.icon,this.color=r.color;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}defaultSurname;get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}defaultAge;get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}icon;color};var o=new d({cacheSize:10}),h;(C=>{function c(a){try{let t=o.get(a);if(!t){e.warn(`Character "${a}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return t}catch(t){e.error(`Error while getting Character "${a}"`,t);return}}C.get=c;function e$1(...a){for(let t of a){if(Array.isArray(t)){e$1(...t);continue}o.get(t.id)&&e.info(`Character id "${t.id}" already exists, it will be overwritten`),o.set(t.id,t);}}C.add=e$1;function r(){return Array.from(o.values())}C.values=r;function m(a){return o.has(a)}C.has=m;function l(){return Array.from(o.keys())}C.keys=l;function y(){o.clear();}C.clear=y;})(h||={});var p=h;export{i as CharacterBaseModel,n as CharacterStoredClass,p as RegisteredCharacters};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e}from'./chunk-
|
|
1
|
+
import {e}from'./chunk-B46NFIFC.mjs';import {PixiError}from'@drincs/pixi-vn/core';function a(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e$1){throw e.error("Error creating exportable element",r,e$1),new PixiError("not_json_serializable","Error creating exportable element")}}export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Pt=Object.create;var Ft=Object.defineProperty;var Ht=Object.getOwnPropertyDescriptor;var Kt=Object.getOwnPropertyNames;var $t=Object.getPrototypeOf,kt=Object.prototype.hasOwnProperty;var Lt=a=>{throw TypeError(a)};var Bt=(a,e,i)=>e in a?Ft(a,e,{enumerable:true,configurable:true,writable:true,value:i}):a[e]=i;var Jt=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var Qt=(a,e)=>()=>{try{return e||a((e={exports:{}}).exports,e),e.exports}catch(i){throw e=0,i}};var qt=(a,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Kt(e))!kt.call(a,n)&&n!==i&&Ft(a,n,{get:()=>e[n],enumerable:!(s=Ht(e,n))||s.enumerable});return a};var Zt=(a,e,i)=>(i=a!=null?Pt($t(a)):{},qt(e||!a||!a.__esModule?Ft(i,"default",{value:a,enumerable:true}):i,a));var O=(a,e,i)=>Bt(a,typeof e!="symbol"?e+"":e,i),Tt=(a,e,i)=>e.has(a)||Lt("Cannot "+i);var t=(a,e,i)=>(Tt(a,e,"read from private field"),i?i.call(a):e.get(a)),g=(a,e,i)=>e.has(a)?Lt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,i),f=(a,e,i,s)=>(Tt(a,e,"write to private field"),e.set(a,i),i),l=(a,e,i)=>(Tt(a,e,"access private method"),i);var mt=(a,e,i,s)=>({set _(n){f(a,e,n);},get _(){return t(a,e,s)}});var Yt;(n=>(n.log=(h,...r)=>console.log(`[Pixi\u2019VN] ${h}`,...r),n.warn=(h,...r)=>console.warn(`[Pixi\u2019VN] ${h}`,...r),n.error=(h,...r)=>console.error(`[Pixi\u2019VN] ${h}`,...r),n.info=(h,...r)=>console.info(`[Pixi\u2019VN] ${h}`,...r)))(Yt||={});var rt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Nt=new Set,zt=typeof process=="object"&&process?process:{},It=(a,e,i,s)=>{typeof zt.emitWarning=="function"?zt.emitWarning(a,e,i,s):console.error(`[${i}] ${e}: ${a}`);},yt=globalThis.AbortController,Mt=globalThis.AbortSignal;if(typeof yt>"u"){Mt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(s,n){this._onabort.push(n);}},yt=class{constructor(){e();}signal=new Mt;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let n of this.signal._onabort)n(s);this.signal.onabort?.(s);}}};let a=zt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{a&&(a=false,It("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 Xt=a=>!Nt.has(a);var Q=a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),Vt=a=>Q(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?ot:null:null,ot=class extends Array{constructor(e){super(e),this.fill(0);}},at,st=class st{heap;length;static create(e){let i=Vt(e);if(!i)return [];f(st,at,true);let s=new st(e,i);return f(st,at,false),s}constructor(e,i){if(!t(st,at))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};at=new WeakMap,g(st,at,false);var Et=st,Ut,Gt,I,W,V,j,lt,ft,F,P,_,S,d,C,D,v,T,H,z,K,$,L,k,it,x,o,Ot,nt,Y,gt,M,jt,ht,ct,pt,Z,tt,vt,St,bt,m,Ct,dt,et,xt,Rt=class Rt{constructor(e){g(this,o);g(this,I);g(this,W);g(this,V);g(this,j);g(this,lt);g(this,ft);O(this,"ttl");O(this,"ttlResolution");O(this,"ttlAutopurge");O(this,"updateAgeOnGet");O(this,"updateAgeOnHas");O(this,"allowStale");O(this,"noDisposeOnSet");O(this,"noUpdateTTL");O(this,"maxEntrySize");O(this,"sizeCalculation");O(this,"noDeleteOnFetchRejection");O(this,"noDeleteOnStaleGet");O(this,"allowStaleOnFetchAbort");O(this,"allowStaleOnFetchRejection");O(this,"ignoreFetchAbort");g(this,F);g(this,P);g(this,_);g(this,S);g(this,d);g(this,C);g(this,D);g(this,v);g(this,T);g(this,H);g(this,z);g(this,K);g(this,$);g(this,L);g(this,k);g(this,it);g(this,x);g(this,nt,()=>{});g(this,Y,()=>{});g(this,gt,()=>{});g(this,M,()=>false);g(this,ht,e=>{});g(this,ct,(e,i,s)=>{});g(this,pt,(e,i,s,n)=>{if(s||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});O(this,Ut,"LRUCache");let{max:i=0,ttl:s,ttlResolution:n=1,ttlAutopurge:h,updateAgeOnGet:r,updateAgeOnHas:u,allowStale:c,dispose:A,disposeAfter:B,noDisposeOnSet:b,noUpdateTTL:X,maxSize:U=0,maxEntrySize:q=0,sizeCalculation:p,fetchMethod:y,memoMethod:w,noDeleteOnFetchRejection:G,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:N,ignoreFetchAbort:ut}=e;if(i!==0&&!Q(i))throw new TypeError("max option must be a nonnegative integer");let J=i?Vt(i):Array;if(!J)throw new Error("invalid max value: "+i);if(f(this,I,i),f(this,W,U),this.maxEntrySize=q||t(this,W),this.sizeCalculation=p,this.sizeCalculation){if(!t(this,W)&&!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(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,ft,w),y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,lt,y),f(this,it,!!y),f(this,_,new Map),f(this,S,new Array(i).fill(void 0)),f(this,d,new Array(i).fill(void 0)),f(this,C,new J(i)),f(this,D,new J(i)),f(this,v,0),f(this,T,0),f(this,H,Et.create(i)),f(this,F,0),f(this,P,0),typeof A=="function"&&f(this,V,A),typeof B=="function"?(f(this,j,B),f(this,z,[])):(f(this,j,void 0),f(this,z,void 0)),f(this,k,!!t(this,V)),f(this,x,!!t(this,j)),this.noDisposeOnSet=!!b,this.noUpdateTTL=!!X,this.noDeleteOnFetchRejection=!!G,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!ut,this.maxEntrySize!==0){if(t(this,W)!==0&&!Q(t(this,W)))throw new TypeError("maxSize must be a positive integer if specified");if(!Q(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");l(this,o,jt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!u,this.ttlResolution=Q(n)||n===0?n:1,this.ttlAutopurge=!!h,this.ttl=s||0,this.ttl){if(!Q(this.ttl))throw new TypeError("ttl must be a positive integer if specified");l(this,o,Ot).call(this);}if(t(this,I)===0&&this.ttl===0&&t(this,W)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,I)&&!t(this,W)){let wt="LRU_CACHE_UNBOUNDED";Xt(wt)&&(Nt.add(wt),It("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",wt,Rt));}}static unsafeExposeInternals(e){return {starts:t(e,$),ttls:t(e,L),sizes:t(e,K),keyMap:t(e,_),keyList:t(e,S),valList:t(e,d),next:t(e,C),prev:t(e,D),get head(){return t(e,v)},get tail(){return t(e,T)},free:t(e,H),isBackgroundFetch:i=>{var s;return l(s=e,o,m).call(s,i)},backgroundFetch:(i,s,n,h)=>{var r;return l(r=e,o,bt).call(r,i,s,n,h)},moveToTail:i=>{var s;return l(s=e,o,dt).call(s,i)},indexes:i=>{var s;return l(s=e,o,Z).call(s,i)},rindexes:i=>{var s;return l(s=e,o,tt).call(s,i)},isStale:i=>{var s;return t(s=e,M).call(s,i)}}}get max(){return t(this,I)}get maxSize(){return t(this,W)}get calculatedSize(){return t(this,P)}get size(){return t(this,F)}get fetchMethod(){return t(this,lt)}get memoMethod(){return t(this,ft)}get dispose(){return t(this,V)}get disposeAfter(){return t(this,j)}getRemainingTTL(e){return t(this,_).has(e)?1/0:0}*entries(){for(let e of l(this,o,Z).call(this))t(this,d)[e]!==void 0&&t(this,S)[e]!==void 0&&!l(this,o,m).call(this,t(this,d)[e])&&(yield [t(this,S)[e],t(this,d)[e]]);}*rentries(){for(let e of l(this,o,tt).call(this))t(this,d)[e]!==void 0&&t(this,S)[e]!==void 0&&!l(this,o,m).call(this,t(this,d)[e])&&(yield [t(this,S)[e],t(this,d)[e]]);}*keys(){for(let e of l(this,o,Z).call(this)){let i=t(this,S)[e];i!==void 0&&!l(this,o,m).call(this,t(this,d)[e])&&(yield i);}}*rkeys(){for(let e of l(this,o,tt).call(this)){let i=t(this,S)[e];i!==void 0&&!l(this,o,m).call(this,t(this,d)[e])&&(yield i);}}*values(){for(let e of l(this,o,Z).call(this))t(this,d)[e]!==void 0&&!l(this,o,m).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}*rvalues(){for(let e of l(this,o,tt).call(this))t(this,d)[e]!==void 0&&!l(this,o,m).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}[(Gt=Symbol.iterator,Ut=Symbol.toStringTag,Gt)](){return this.entries()}find(e,i={}){for(let s of l(this,o,Z).call(this)){let n=t(this,d)[s],h=l(this,o,m).call(this,n)?n.__staleWhileFetching:n;if(h!==void 0&&e(h,t(this,S)[s],this))return this.get(t(this,S)[s],i)}}forEach(e,i=this){for(let s of l(this,o,Z).call(this)){let n=t(this,d)[s],h=l(this,o,m).call(this,n)?n.__staleWhileFetching:n;h!==void 0&&e.call(i,h,t(this,S)[s],this);}}rforEach(e,i=this){for(let s of l(this,o,tt).call(this)){let n=t(this,d)[s],h=l(this,o,m).call(this,n)?n.__staleWhileFetching:n;h!==void 0&&e.call(i,h,t(this,S)[s],this);}}purgeStale(){let e=false;for(let i of l(this,o,tt).call(this,{allowStale:true}))t(this,M).call(this,i)&&(l(this,o,et).call(this,t(this,S)[i],"expire"),e=true);return e}info(e){let i=t(this,_).get(e);if(i===void 0)return;let s=t(this,d)[i],n=l(this,o,m).call(this,s)?s.__staleWhileFetching:s;if(n===void 0)return;let h={value:n};if(t(this,L)&&t(this,$)){let r=t(this,L)[i],u=t(this,$)[i];if(r&&u){let c=r-(rt.now()-u);h.ttl=c,h.start=Date.now();}}return t(this,K)&&(h.size=t(this,K)[i]),h}dump(){let e=[];for(let i of l(this,o,Z).call(this,{allowStale:true})){let s=t(this,S)[i],n=t(this,d)[i],h=l(this,o,m).call(this,n)?n.__staleWhileFetching:n;if(h===void 0||s===void 0)continue;let r={value:h};if(t(this,L)&&t(this,$)){r.ttl=t(this,L)[i];let u=rt.now()-t(this,$)[i];r.start=Math.floor(Date.now()-u);}t(this,K)&&(r.size=t(this,K)[i]),e.unshift([s,r]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let n=Date.now()-s.start;s.start=rt.now()-n;}this.set(i,s.value,s);}}set(e,i,s={}){var X,U,q;if(i===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:h,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=s,{noUpdateTTL:A=this.noUpdateTTL}=s,B=t(this,pt).call(this,e,i,s.size||0,u);if(this.maxEntrySize&&B>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),l(this,o,et).call(this,e,"set"),this;let b=t(this,F)===0?void 0:t(this,_).get(e);if(b===void 0)b=t(this,F)===0?t(this,T):t(this,H).length!==0?t(this,H).pop():t(this,F)===t(this,I)?l(this,o,St).call(this,false):t(this,F),t(this,S)[b]=e,t(this,d)[b]=i,t(this,_).set(e,b),t(this,C)[t(this,T)]=b,t(this,D)[b]=t(this,T),f(this,T,b),mt(this,F)._++,t(this,ct).call(this,b,B,c),c&&(c.set="add"),A=false;else {l(this,o,dt).call(this,b);let p=t(this,d)[b];if(i!==p){if(t(this,it)&&l(this,o,m).call(this,p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:y}=p;y!==void 0&&!r&&(t(this,k)&&((X=t(this,V))==null||X.call(this,y,e,"set")),t(this,x)&&t(this,z)?.push([y,e,"set"]));}else r||(t(this,k)&&((U=t(this,V))==null||U.call(this,p,e,"set")),t(this,x)&&t(this,z)?.push([p,e,"set"]));if(t(this,ht).call(this,b),t(this,ct).call(this,b,B,c),t(this,d)[b]=i,c){c.set="replace";let y=p&&l(this,o,m).call(this,p)?p.__staleWhileFetching:p;y!==void 0&&(c.oldValue=y);}}else c&&(c.set="update");}if(n!==0&&!t(this,L)&&l(this,o,Ot).call(this),t(this,L)&&(A||t(this,gt).call(this,b,n,h),c&&t(this,Y).call(this,c,b)),!r&&t(this,x)&&t(this,z)){let p=t(this,z),y;for(;y=p?.shift();)(q=t(this,j))==null||q.call(this,...y);}return this}pop(){var e;try{for(;t(this,F);){let i=t(this,d)[t(this,v)];if(l(this,o,St).call(this,!0),l(this,o,m).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,x)&&t(this,z)){let i=t(this,z),s;for(;s=i?.shift();)(e=t(this,j))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:n}=i,h=t(this,_).get(e);if(h!==void 0){let r=t(this,d)[h];if(l(this,o,m).call(this,r)&&r.__staleWhileFetching===void 0)return false;if(t(this,M).call(this,h))n&&(n.has="stale",t(this,Y).call(this,n,h));else return s&&t(this,nt).call(this,h),n&&(n.has="hit",t(this,Y).call(this,n,h)),true}else n&&(n.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,n=t(this,_).get(e);if(n===void 0||!s&&t(this,M).call(this,n))return;let h=t(this,d)[n];return l(this,o,m).call(this,h)?h.__staleWhileFetching:h}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:A=this.sizeCalculation,noUpdateTTL:B=this.noUpdateTTL,noDeleteOnFetchRejection:b=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:X=this.allowStaleOnFetchRejection,ignoreFetchAbort:U=this.ignoreFetchAbort,allowStaleOnFetchAbort:q=this.allowStaleOnFetchAbort,context:p,forceRefresh:y=false,status:w,signal:G}=i;if(!t(this,it))return w&&(w.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:h,status:w});let R={allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:h,ttl:r,noDisposeOnSet:u,size:c,sizeCalculation:A,noUpdateTTL:B,noDeleteOnFetchRejection:b,allowStaleOnFetchRejection:X,allowStaleOnFetchAbort:q,ignoreFetchAbort:U,status:w,signal:G},E=t(this,_).get(e);if(E===void 0){w&&(w.fetch="miss");let N=l(this,o,bt).call(this,e,E,R,p);return N.__returned=N}else {let N=t(this,d)[E];if(l(this,o,m).call(this,N)){let Dt=s&&N.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",Dt&&(w.returnedStale=true)),Dt?N.__staleWhileFetching:N.__returned=N}let ut=t(this,M).call(this,E);if(!y&&!ut)return w&&(w.fetch="hit"),l(this,o,dt).call(this,E),n&&t(this,nt).call(this,E),w&&t(this,Y).call(this,w,E),N;let J=l(this,o,bt).call(this,e,E,R,p),At=J.__staleWhileFetching!==void 0&&s;return w&&(w.fetch=ut?"stale":"refresh",At&&ut&&(w.returnedStale=true)),At?J.__staleWhileFetching:J.__returned=J}}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,ft);if(!s)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:h,...r}=i,u=this.get(e,r);if(!h&&u!==void 0)return u;let c=s(e,u,{options:r,context:n});return this.set(e,c,r),c}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,status:r}=i,u=t(this,_).get(e);if(u!==void 0){let c=t(this,d)[u],A=l(this,o,m).call(this,c);return r&&t(this,Y).call(this,r,u),t(this,M).call(this,u)?(r&&(r.get="stale"),A?(r&&s&&c.__staleWhileFetching!==void 0&&(r.returnedStale=true),s?c.__staleWhileFetching:void 0):(h||l(this,o,et).call(this,e,"expire"),r&&s&&(r.returnedStale=true),s?c:void 0)):(r&&(r.get="hit"),A?c.__staleWhileFetching:(l(this,o,dt).call(this,u),n&&t(this,nt).call(this,u),c))}else r&&(r.get="miss");}delete(e){return l(this,o,et).call(this,e,"delete")}clear(){return l(this,o,xt).call(this,"delete")}};I=new WeakMap,W=new WeakMap,V=new WeakMap,j=new WeakMap,lt=new WeakMap,ft=new WeakMap,F=new WeakMap,P=new WeakMap,_=new WeakMap,S=new WeakMap,d=new WeakMap,C=new WeakMap,D=new WeakMap,v=new WeakMap,T=new WeakMap,H=new WeakMap,z=new WeakMap,K=new WeakMap,$=new WeakMap,L=new WeakMap,k=new WeakMap,it=new WeakMap,x=new WeakMap,o=new WeakSet,Ot=function(){let e=new ot(t(this,I)),i=new ot(t(this,I));f(this,L,e),f(this,$,i),f(this,gt,(h,r,u=rt.now())=>{if(i[h]=r!==0?u:0,e[h]=r,r!==0&&this.ttlAutopurge){let c=setTimeout(()=>{t(this,M).call(this,h)&&l(this,o,et).call(this,t(this,S)[h],"expire");},r+1);c.unref&&c.unref();}}),f(this,nt,h=>{i[h]=e[h]!==0?rt.now():0;}),f(this,Y,(h,r)=>{if(e[r]){let u=e[r],c=i[r];if(!u||!c)return;h.ttl=u,h.start=c,h.now=s||n();let A=h.now-c;h.remainingTTL=u-A;}});let s=0,n=()=>{let h=rt.now();if(this.ttlResolution>0){s=h;let r=setTimeout(()=>s=0,this.ttlResolution);r.unref&&r.unref();}return h};this.getRemainingTTL=h=>{let r=t(this,_).get(h);if(r===void 0)return 0;let u=e[r],c=i[r];if(!u||!c)return 1/0;let A=(s||n())-c;return u-A},f(this,M,h=>{let r=i[h],u=e[h];return !!u&&!!r&&(s||n())-r>u});},nt=new WeakMap,Y=new WeakMap,gt=new WeakMap,M=new WeakMap,jt=function(){let e=new ot(t(this,I));f(this,P,0),f(this,K,e),f(this,ht,i=>{f(this,P,t(this,P)-e[i]),e[i]=0;}),f(this,pt,(i,s,n,h)=>{if(l(this,o,m).call(this,s))return 0;if(!Q(n))if(h){if(typeof h!="function")throw new TypeError("sizeCalculation must be a function");if(n=h(s,i),!Q(n))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 n}),f(this,ct,(i,s,n)=>{if(e[i]=s,t(this,W)){let h=t(this,W)-e[i];for(;t(this,P)>h;)l(this,o,St).call(this,true);}f(this,P,t(this,P)+e[i]),n&&(n.entrySize=s,n.totalCalculatedSize=t(this,P));});},ht=new WeakMap,ct=new WeakMap,pt=new WeakMap,Z=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,T);!(!l(this,o,vt).call(this,i)||((e||!t(this,M).call(this,i))&&(yield i),i===t(this,v)));)i=t(this,D)[i];},tt=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,v);!(!l(this,o,vt).call(this,i)||((e||!t(this,M).call(this,i))&&(yield i),i===t(this,T)));)i=t(this,C)[i];},vt=function(e){return e!==void 0&&t(this,_).get(t(this,S)[e])===e},St=function(e){var h;let i=t(this,v),s=t(this,S)[i],n=t(this,d)[i];return t(this,it)&&l(this,o,m).call(this,n)?n.__abortController.abort(new Error("evicted")):(t(this,k)||t(this,x))&&(t(this,k)&&((h=t(this,V))==null||h.call(this,n,s,"evict")),t(this,x)&&t(this,z)?.push([n,s,"evict"])),t(this,ht).call(this,i),e&&(t(this,S)[i]=void 0,t(this,d)[i]=void 0,t(this,H).push(i)),t(this,F)===1?(f(this,v,f(this,T,0)),t(this,H).length=0):f(this,v,t(this,C)[i]),t(this,_).delete(s),mt(this,F)._--,i},bt=function(e,i,s,n){let h=i===void 0?void 0:t(this,d)[i];if(l(this,o,m).call(this,h))return h;let r=new yt,{signal:u}=s;u?.addEventListener("abort",()=>r.abort(u.reason),{signal:r.signal});let c={signal:r.signal,options:s,context:n},A=(p,y=false)=>{let{aborted:w}=r.signal,G=s.ignoreFetchAbort&&p!==void 0;if(s.status&&(w&&!y?(s.status.fetchAborted=true,s.status.fetchError=r.signal.reason,G&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),w&&!G&&!y)return b(r.signal.reason);let R=U;return t(this,d)[i]===U&&(p===void 0?R.__staleWhileFetching?t(this,d)[i]=R.__staleWhileFetching:l(this,o,et).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,p,c.options))),p},B=p=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=p),b(p)),b=p=>{let{aborted:y}=r.signal,w=y&&s.allowStaleOnFetchAbort,G=w||s.allowStaleOnFetchRejection,R=G||s.noDeleteOnFetchRejection,E=U;if(t(this,d)[i]===U&&(!R||E.__staleWhileFetching===void 0?l(this,o,et).call(this,e,"fetch"):w||(t(this,d)[i]=E.__staleWhileFetching)),G)return s.status&&E.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),E.__staleWhileFetching;if(E.__returned===E)throw p},X=(p,y)=>{var G;let w=(G=t(this,lt))==null?void 0:G.call(this,e,h,c);w&&w instanceof Promise&&w.then(R=>p(R===void 0?void 0:R),y),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(void 0),s.allowStaleOnFetchAbort&&(p=R=>A(R,true)));});};s.status&&(s.status.fetchDispatched=true);let U=new Promise(X).then(A,B),q=Object.assign(U,{__abortController:r,__staleWhileFetching:h,__returned:void 0});return i===void 0?(this.set(e,q,{...c.options,status:void 0}),i=t(this,_).get(e)):t(this,d)[i]=q,q},m=function(e){if(!t(this,it))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof yt},Ct=function(e,i){t(this,D)[i]=e,t(this,C)[e]=i;},dt=function(e){e!==t(this,T)&&(e===t(this,v)?f(this,v,t(this,C)[e]):l(this,o,Ct).call(this,t(this,D)[e],t(this,C)[e]),l(this,o,Ct).call(this,t(this,T),e),f(this,T,e));},et=function(e,i){var n,h;let s=false;if(t(this,F)!==0){let r=t(this,_).get(e);if(r!==void 0)if(s=true,t(this,F)===1)l(this,o,xt).call(this,i);else {t(this,ht).call(this,r);let u=t(this,d)[r];if(l(this,o,m).call(this,u)?u.__abortController.abort(new Error("deleted")):(t(this,k)||t(this,x))&&(t(this,k)&&((n=t(this,V))==null||n.call(this,u,e,i)),t(this,x)&&t(this,z)?.push([u,e,i])),t(this,_).delete(e),t(this,S)[r]=void 0,t(this,d)[r]=void 0,r===t(this,T))f(this,T,t(this,D)[r]);else if(r===t(this,v))f(this,v,t(this,C)[r]);else {let c=t(this,D)[r];t(this,C)[c]=t(this,C)[r];let A=t(this,C)[r];t(this,D)[A]=t(this,D)[r];}mt(this,F)._--,t(this,H).push(r);}}if(t(this,x)&&t(this,z)?.length){let r=t(this,z),u;for(;u=r?.shift();)(h=t(this,j))==null||h.call(this,...u);}return s},xt=function(e){var i,s;for(let n of l(this,o,tt).call(this,{allowStale:true})){let h=t(this,d)[n];if(l(this,o,m).call(this,h))h.__abortController.abort(new Error("deleted"));else {let r=t(this,S)[n];t(this,k)&&((i=t(this,V))==null||i.call(this,h,r,e)),t(this,x)&&t(this,z)?.push([h,r,e]);}}if(t(this,_).clear(),t(this,d).fill(void 0),t(this,S).fill(void 0),t(this,L)&&t(this,$)&&(t(this,L).fill(0),t(this,$).fill(0)),t(this,K)&&t(this,K).fill(0),f(this,v,0),f(this,T,0),t(this,H).length=0,f(this,P,0),f(this,F,0),t(this,x)&&t(this,z)){let n=t(this,z),h;for(;h=n?.shift();)(s=t(this,j))==null||s.call(this,...h);}};var _t=Rt;var Wt=class{cache;map=new Map;constructor(e){this.cache=new _t({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(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()}};export{Jt as a,Qt as b,Zt as c,Wt as d,Yt as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.create;var f=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var h=b=>{throw TypeError(b)};var n=(b,a,c)=>a in b?f(b,a,{enumerable:true,configurable:true,writable:true,value:c}):b[a]=c;var r=(b,a)=>()=>{try{return a||b((a={exports:{}}).exports,a),a.exports}catch(c){throw a=0,c}},s=(b,a)=>{for(var c in a)f(b,c,{get:a[c],enumerable:true});},o=(b,a,c,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of k(a))!m.call(b,e)&&e!==c&&f(b,e,{get:()=>a[e],enumerable:!(d=j(a,e))||d.enumerable});return b};var t=(b,a,c)=>(c=b!=null?i(l(b)):{},o(a||!b||!b.__esModule?f(c,"default",{value:b,enumerable:true}):c,b));var u=(b,a,c)=>n(b,typeof a!="symbol"?a+"":a,c),g=(b,a,c)=>a.has(b)||h("Cannot "+c);var p=(b,a,c)=>(g(b,a,"read from private field"),c?c.call(b):a.get(b)),v=(b,a,c)=>a.has(b)?h("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(b):a.set(b,c),q=(b,a,c,d)=>(g(b,a,"write to private field"),d?d.call(b,c):a.set(b,c),c),w=(b,a,c)=>(g(b,a,"access private method"),c);var x=(b,a,c,d)=>({set _(e){q(b,a,e,c);},get _(){return p(b,a,d)}});export{r as a,s as b,t as c,u as d,p as e,v as f,q as g,w as h,x as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j,l,i,k as k$1,m}from'./chunk-HD353M4B.mjs';import {a as a$1}from'./chunk-
|
|
1
|
+
import {j,l,i,k as k$1,m}from'./chunk-HD353M4B.mjs';import {a as a$1}from'./chunk-A5FN4SNI.mjs';import {d as d$1,e}from'./chunk-B46NFIFC.mjs';import {GameUnifier}from'@drincs/pixi-vn/core';import {cloneMaybeOffloaded}from'@drincs/pixi-vn/worker';var I;(n=>{n.storage=new d$1({cacheSize:50}),n.defaultStorage=new d$1({cacheSize:10}),n.tempStorageDeadlines=new Map;let s;function c(r){n.tempStorageDeadlines.forEach((i,o)=>{i>r&&(n.storage.delete(`${j}:${o}`),s?.onClearOldTempVariable?.(o),n.tempStorageDeadlines.delete(o));});}n.clearOldTempVariables=c;function T(r){s=r;}n.setExternalStoreHandler=T;function y(r,i,o){o==null?n.storage.delete(`${r}:${i}`):n.storage.set(`${r}:${i}`,o),s?.onSetVariable?.(i,o);}n.setVariable=y;function V(r,i){let o=n.storage.get(`${r}:${i}`);return a$1(o)}n.getVariable=V;function M(r,i){n.storage.delete(`${r}:${i}`),s?.onRemoveVariable?.(i);}n.removeVariable=M;function R(r,i){let o=n.storage.get(l)||[];if(i)o.includes(r)||o.push(r);else {let h=o.indexOf(r);h>-1&&o.splice(h,1);}n.storage.set(l,o);}n.setFlag=R;function v(r){return (n.storage.get(l)||[]).includes(r)}n.getFlag=v;})(I||={});var a=I;var _=class{get base(){return a.storage.map}get cache(){return a.storage.cache}get tempStorageDeadlines(){return a.tempStorageDeadlines}set default(t){Object.entries(t).forEach(([e,s])=>{a.defaultStorage.map.set(e,s);});}temp={set:(t,e)=>this.setTemp(t,e),remove:t=>this.removeTemp(t),get deadlines(){return a.tempStorageDeadlines}};flags={set:(t,e)=>a.setFlag(t,e),get:t=>a.getFlag(t)};set(t,e){return a.setVariable(i,t,e)}get(t){let e=a.getVariable(j,t);return e===void 0&&(e=a.getVariable(i,t)),e===void 0&&(e=a$1(a.defaultStorage.get(t))),e}remove(t){return this.temp.remove(t),a.removeVariable(i,t)}setTemp(t,e){if(e==null){this.temp.remove(t);return}else a.setVariable(j,t,e),this.temp.deadlines.has(t)||this.temp.deadlines.set(t,GameUnifier.openedLabels);}removeTemp(t){a.removeVariable(j,t),this.temp.deadlines.has(t)&&this.temp.deadlines.delete(t);}setTempVariable(t,e){this.temp.set(t,e);}removeTempVariable(t){this.temp.remove(t);}setFlag(t,e){this.flags.set(t,e);}getFlag(t){return this.flags.get(t)}setStorageHandler(t){a.setExternalStoreHandler(t);}clear(){this.base.clear(),this.cache.clear(),this.temp.deadlines.clear();}async export(){let t=[];[...this.base.keys()].forEach(s=>{t.push({key:s,value:this.base.get(s)});});let e=[];return [...this.temp.deadlines.keys()].forEach(s=>{e.push({key:s,value:this.temp.deadlines.get(s)});}),cloneMaybeOffloaded({main:t,tempDeadlines:e})}restore(t){this.clear();try{t?(t.base?.forEach(e=>{switch(e.key){case "___current_dialogue_memory___":a.setVariable(k$1,m.CURRENT_DIALOGUE_MEMORY_KEY,e.value);break;case "___last_dialogue_added_in_step_memory___":a.setVariable(k$1,m.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_menu_options_memory___":a.setVariable(k$1,m.CURRENT_MENU_OPTIONS_MEMORY_KEY,e.value);break;case "___last_menu_options_added_in_step_memory___":a.setVariable(k$1,m.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "_input_value_":a.setVariable(k$1,m.CURRENT_INPUT_VALUE_MEMORY_KEY,e.value);break;case "___last_input_added_in_step_memory___":a.setVariable(k$1,m.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_input_info_memory___":a.setVariable(k$1,m.CURRENT_INPUT_INFO_MEMORY_KEY,e.value);break;case "___opened_labels_counter___":a.setVariable(k$1,m.OPENED_LABELS_COUNTER_KEY,e.value);break;case "___all_choices_made___":a.setVariable(k$1,m.ALL_CHOICES_MADE_KEY,e.value);break;case "___current_step_times_counter___":a.setVariable(k$1,m.CURRENT_STEP_TIMES_COUNTER_KEY,e.value);break;case "___last_step_glued___":a.setVariable(k$1,m.LAST_STEP_GLUED,e.value);break;default:a.setVariable(i,e.key,e.value);}}),t.temp?.forEach(e=>{a.setVariable(j,e.key,e.value);}),t.flags?.forEach(e=>{a.setFlag(e,!0);}),t.main?.forEach(e=>{this.base.set(e.key,e.value);}),t.tempDeadlines?.forEach(e=>{this.temp.deadlines.set(e.key,e.value);})):e.warn("No storage data found");}catch(e$1){e.error("Error importing data",e$1);}}};var d=class{constructor(t,e){this.categoryId=t,this.id=e,this.migrateOldStorage();}migrateOldStorage(t=this.categoryId){let e=a.getVariable(i,t);e&&(Object.entries(e).forEach(([s,c])=>{typeof c=="object"&&c!==null&&Object.entries(c).forEach(([T,y])=>{a.setVariable(this.categoryId,`${s}:${T}`,y);});}),a.removeVariable(i,t));}id;categoryId;setStorageProperty(t,e){a.setVariable(this.categoryId,`${this.id}:${t}`,e);}getStorageProperty(t,e=this.id){return a.getVariable(this.categoryId,`${e}:${t}`)}};var k=new _;export{a,d as b,k as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,a}from'./chunk-
|
|
1
|
+
import {b,a}from'./chunk-B46NFIFC.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
|
+
function l(e,n,m){let t=[0],r=e;for(let h=0;h<m;h++)t.push(r,-r*.6,r*.3,0),r*=n;return t}function M(e,n,m,t){let r=m.reduce((b,y)=>y.enabled?b+y.padding:b,0),h=e.x,a=e.y,u=e.x+e.width,i=e.y+e.height;t&&(h=Math.max(h,0),a=Math.max(a,0),u=Math.min(u,t.width),i=Math.min(i,t.height));let x={x:h-r,y:a-r,width:u-h+r*2,height:i-a+r*2};return {x:e.x+n.x*e.width-x.x,y:e.y+n.y*e.height-x.y,area:x}}function c(e,n,m,t){return Math.max(0,Math.ceil(n-Math.min(e.x,e.y,m-e.x,t-e.y)))}function g(e,n,m,t){let r=Math.min(Math.max(n,0),.5),h=Math.hypot(Math.max(e.x,m-e.x),Math.max(e.y,t-e.y));return Math.ceil(h*r/(1-r))}function d(e,n,m,t){return t>0?t:Math.hypot(Math.max(e.x,n.width-e.x),Math.max(e.y,n.height-e.y))+m/2}export{l as a,M as b,c,g as d,d as e};
|
package/dist/core.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StepLabelProps, GameStepState, HistoryInfo, CharacterInterface } from '@drincs/pixi-vn';
|
|
2
2
|
import { CanvasBaseInterface, CanvasBaseItemMemory, CanvasBaseItem } from '@drincs/pixi-vn/canvas';
|
|
3
3
|
import { UPDATE_PRIORITY, Filter, ContainerOptions } from '@drincs/pixi-vn/pixi.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { StepLabelPropsType, StepLabelResultType, StepLabelType } from './narration.cjs';
|
|
5
|
+
import { StorageElementType } from './storage.cjs';
|
|
6
6
|
|
|
7
7
|
type ErrorCodeType = "obsolete_save" | "unknown_element" | "unregistered_element" | "unregistered_asset" | "not_json_serializable" | "not_implemented" | "invalid_usage" | "unhandled_error";
|
|
8
8
|
|
|
@@ -147,7 +147,10 @@ declare class GameUnifier {
|
|
|
147
147
|
* tear down whatever `apply` was driving.
|
|
148
148
|
* @returns The id of the ticker.
|
|
149
149
|
*/
|
|
150
|
-
animateFilter: (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void
|
|
150
|
+
animateFilter: (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void, valueRef?: {
|
|
151
|
+
alias: string;
|
|
152
|
+
config: unknown;
|
|
153
|
+
}) => string | undefined;
|
|
151
154
|
/**
|
|
152
155
|
* This function removes one or more canvas components by alias. Used by the `tickers` module's
|
|
153
156
|
* `onComplete` to honor `aliasToRemoveAfter` without importing `@drincs/pixi-vn/canvas` directly
|
|
@@ -352,7 +355,10 @@ declare class GameUnifier {
|
|
|
352
355
|
* instead.
|
|
353
356
|
* @returns The id of the ticker.
|
|
354
357
|
*/
|
|
355
|
-
static get animateFilter(): (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void
|
|
358
|
+
static get animateFilter(): (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void, valueRef?: {
|
|
359
|
+
alias: string;
|
|
360
|
+
config: unknown;
|
|
361
|
+
}) => string | undefined;
|
|
356
362
|
private static _removeCanvasComponent;
|
|
357
363
|
/**
|
|
358
364
|
* Removes one or more canvas components by alias. See the `removeCanvasComponent` option of
|
|
@@ -375,4 +381,5 @@ declare class PixiError extends Error {
|
|
|
375
381
|
parent?: CanvasBaseItem<any>;
|
|
376
382
|
}
|
|
377
383
|
|
|
378
|
-
export {
|
|
384
|
+
export { GameUnifier, PixiError };
|
|
385
|
+
export type { ErrorCodeType, OnErrorHandler };
|
package/dist/core.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StepLabelProps, GameStepState, HistoryInfo, CharacterInterface } from '@drincs/pixi-vn';
|
|
2
2
|
import { CanvasBaseInterface, CanvasBaseItemMemory, CanvasBaseItem } from '@drincs/pixi-vn/canvas';
|
|
3
3
|
import { UPDATE_PRIORITY, Filter, ContainerOptions } from '@drincs/pixi-vn/pixi.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { StepLabelPropsType, StepLabelResultType, StepLabelType } from './narration.js';
|
|
5
|
+
import { StorageElementType } from './storage.js';
|
|
6
6
|
|
|
7
7
|
type ErrorCodeType = "obsolete_save" | "unknown_element" | "unregistered_element" | "unregistered_asset" | "not_json_serializable" | "not_implemented" | "invalid_usage" | "unhandled_error";
|
|
8
8
|
|
|
@@ -147,7 +147,10 @@ declare class GameUnifier {
|
|
|
147
147
|
* tear down whatever `apply` was driving.
|
|
148
148
|
* @returns The id of the ticker.
|
|
149
149
|
*/
|
|
150
|
-
animateFilter: (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void
|
|
150
|
+
animateFilter: (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void, valueRef?: {
|
|
151
|
+
alias: string;
|
|
152
|
+
config: unknown;
|
|
153
|
+
}) => string | undefined;
|
|
151
154
|
/**
|
|
152
155
|
* This function removes one or more canvas components by alias. Used by the `tickers` module's
|
|
153
156
|
* `onComplete` to honor `aliasToRemoveAfter` without importing `@drincs/pixi-vn/canvas` directly
|
|
@@ -352,7 +355,10 @@ declare class GameUnifier {
|
|
|
352
355
|
* instead.
|
|
353
356
|
* @returns The id of the ticker.
|
|
354
357
|
*/
|
|
355
|
-
static get animateFilter(): (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void
|
|
358
|
+
static get animateFilter(): (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void, valueRef?: {
|
|
359
|
+
alias: string;
|
|
360
|
+
config: unknown;
|
|
361
|
+
}) => string | undefined;
|
|
356
362
|
private static _removeCanvasComponent;
|
|
357
363
|
/**
|
|
358
364
|
* Removes one or more canvas components by alias. See the `removeCanvasComponent` option of
|
|
@@ -375,4 +381,5 @@ declare class PixiError extends Error {
|
|
|
375
381
|
parent?: CanvasBaseItem<any>;
|
|
376
382
|
}
|
|
377
383
|
|
|
378
|
-
export {
|
|
384
|
+
export { GameUnifier, PixiError };
|
|
385
|
+
export type { ErrorCodeType, OnErrorHandler };
|
package/dist/filters.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var core=require('@drincs/pixi-vn/core'),pixi_js=require('@drincs/pixi-vn/pixi.js'),pixiFilters=require('pixi-filters');var Kt=Object.defineProperty;var Ut=t=>{throw TypeError(t)};var $t=(t,i,s)=>i in t?Kt(t,i,{enumerable:true,configurable:true,writable:true,value:s}):t[i]=s;var C=(t,i,s)=>$t(t,typeof i!="symbol"?i+"":i,s),Et=(t,i,s)=>i.has(t)||Ut("Cannot "+s);var e=(t,i,s)=>(Et(t,i,"read from private field"),s?s.call(t):i.get(t)),f=(t,i,s)=>i.has(t)?Ut("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,s),u=(t,i,s,o)=>(Et(t,i,"write to private field"),i.set(t,s),s),d=(t,i,s)=>(Et(t,i,"access private method"),s);var Tt=(t,i,s,o)=>({set _(r){u(t,i,r);},get _(){return e(t,i,o)}});var Zt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Pt=new Set,Dt=typeof process=="object"&&process?process:{},Xt=(t,i,s,o)=>{typeof Dt.emitWarning=="function"?Dt.emitWarning(t,i,s,o):console.error(`[${s}] ${i}: ${t}`);},Mt=globalThis.AbortController,jt=globalThis.AbortSignal;if(typeof Mt>"u"){jt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(s,o){this._onabort.push(o);}},Mt=class{constructor(){i();}signal=new jt;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let o of this.signal._onabort)o(s);this.signal.onabort?.(s);}}};let t=Dt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",i=()=>{t&&(t=false,Xt("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",i));};}var Jt=t=>!Pt.has(t);var it=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),It=t=>it(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?zt:null:null,zt=class extends Array{constructor(t){super(t),this.fill(0);}},Q,pt,Qt=(Q=class{heap;length;static create(i){let s=It(i);if(!s)return [];u(Q,pt,true);let o=new Q(i,s);return u(Q,pt,false),o}constructor(i,s){if(!e(Q,pt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new s(i),this.length=0;}push(i){this.heap[this.length++]=i;}pop(){return this.heap[--this.length]}},pt=new WeakMap,f(Q,pt,false),Q),Yt,Nt,P,W,X,at,I,mt,Ft,H,T,q,_,b,g,B,L,R,z,V,O,K,$,U,j,Z,nt,G,yt,l,Bt,lt,tt,xt,Y,qt,ht,ft,_t,st,ot,Gt,Ot,Ct,S,kt,At,rt,Wt,wt,Ht=(wt=class{constructor(i){f(this,l);f(this,P);f(this,W);f(this,X);f(this,at);f(this,I);f(this,mt);f(this,Ft);f(this,H);C(this,"ttl");C(this,"ttlResolution");C(this,"ttlAutopurge");C(this,"updateAgeOnGet");C(this,"updateAgeOnHas");C(this,"allowStale");C(this,"noDisposeOnSet");C(this,"noUpdateTTL");C(this,"maxEntrySize");C(this,"sizeCalculation");C(this,"noDeleteOnFetchRejection");C(this,"noDeleteOnStaleGet");C(this,"allowStaleOnFetchAbort");C(this,"allowStaleOnFetchRejection");C(this,"ignoreFetchAbort");f(this,T);f(this,q);f(this,_);f(this,b);f(this,g);f(this,B);f(this,L);f(this,R);f(this,z);f(this,V);f(this,O);f(this,K);f(this,$);f(this,U);f(this,j);f(this,Z);f(this,nt);f(this,G);f(this,yt);f(this,lt,()=>{});f(this,tt,()=>{});f(this,xt,()=>{});f(this,Y,()=>false);f(this,ht,i=>{});f(this,ft,(i,s,o)=>{});f(this,_t,(i,s,o,r)=>{if(o||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});C(this,Yt,"LRUCache");let{max:s=0,ttl:o,ttlResolution:r=1,ttlAutopurge:a,updateAgeOnGet:n,updateAgeOnHas:c,allowStale:h,dispose:p,onInsert:w,disposeAfter:y,noDisposeOnSet:et,noUpdateTTL:N,maxSize:J=0,maxEntrySize:A=0,sizeCalculation:v,fetchMethod:m,memoMethod:E,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:bt,ignoreFetchAbort:ct,perf:ut}=i;if(ut!==void 0&&typeof ut?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,H,ut??Zt),s!==0&&!it(s))throw new TypeError("max option must be a nonnegative integer");let gt=s?It(s):Array;if(!gt)throw new Error("invalid max value: "+s);if(u(this,P,s),u(this,W,J),this.maxEntrySize=A||e(this,W),this.sizeCalculation=v,this.sizeCalculation){if(!e(this,W)&&!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,Ft,E),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,mt,m),u(this,nt,!!m),u(this,_,new Map),u(this,b,new Array(s).fill(void 0)),u(this,g,new Array(s).fill(void 0)),u(this,B,new gt(s)),u(this,L,new gt(s)),u(this,R,0),u(this,z,0),u(this,V,Qt.create(s)),u(this,T,0),u(this,q,0),typeof p=="function"&&u(this,X,p),typeof w=="function"&&u(this,at,w),typeof y=="function"?(u(this,I,y),u(this,O,[])):(u(this,I,void 0),u(this,O,void 0)),u(this,Z,!!e(this,X)),u(this,yt,!!e(this,at)),u(this,G,!!e(this,I)),this.noDisposeOnSet=!!et,this.noUpdateTTL=!!N,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!bt,this.ignoreFetchAbort=!!ct,this.maxEntrySize!==0){if(e(this,W)!==0&&!it(e(this,W)))throw new TypeError("maxSize must be a positive integer if specified");if(!it(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");d(this,l,qt).call(this);}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!c,this.ttlResolution=it(r)||r===0?r:1,this.ttlAutopurge=!!a,this.ttl=o||0,this.ttl){if(!it(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,Bt).call(this);}if(e(this,P)===0&&this.ttl===0&&e(this,W)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,P)&&!e(this,W)){let Rt="LRU_CACHE_UNBOUNDED";Jt(Rt)&&(Pt.add(Rt),Xt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Rt,wt));}}get perf(){return e(this,H)}static unsafeExposeInternals(i){return {starts:e(i,$),ttls:e(i,U),autopurgeTimers:e(i,j),sizes:e(i,K),keyMap:e(i,_),keyList:e(i,b),valList:e(i,g),next:e(i,B),prev:e(i,L),get head(){return e(i,R)},get tail(){return e(i,z)},free:e(i,V),isBackgroundFetch:s=>{var o;return d(o=i,l,S).call(o,s)},backgroundFetch:(s,o,r,a)=>{var n;return d(n=i,l,Ct).call(n,s,o,r,a)},moveToTail:s=>{var o;return d(o=i,l,At).call(o,s)},indexes:s=>{var o;return d(o=i,l,st).call(o,s)},rindexes:s=>{var o;return d(o=i,l,ot).call(o,s)},isStale:s=>{var o;return e(o=i,Y).call(o,s)}}}get max(){return e(this,P)}get maxSize(){return e(this,W)}get calculatedSize(){return e(this,q)}get size(){return e(this,T)}get fetchMethod(){return e(this,mt)}get memoMethod(){return e(this,Ft)}get dispose(){return e(this,X)}get onInsert(){return e(this,at)}get disposeAfter(){return e(this,I)}getRemainingTTL(i){return e(this,_).has(i)?1/0:0}*entries(){for(let i of d(this,l,st).call(this))e(this,g)[i]!==void 0&&e(this,b)[i]!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield [e(this,b)[i],e(this,g)[i]]);}*rentries(){for(let i of d(this,l,ot).call(this))e(this,g)[i]!==void 0&&e(this,b)[i]!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield [e(this,b)[i],e(this,g)[i]]);}*keys(){for(let i of d(this,l,st).call(this)){let s=e(this,b)[i];s!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield s);}}*rkeys(){for(let i of d(this,l,ot).call(this)){let s=e(this,b)[i];s!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield s);}}*values(){for(let i of d(this,l,st).call(this))e(this,g)[i]!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield e(this,g)[i]);}*rvalues(){for(let i of d(this,l,ot).call(this))e(this,g)[i]!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield e(this,g)[i]);}[(Nt=Symbol.iterator,Yt=Symbol.toStringTag,Nt)](){return this.entries()}find(i,s={}){for(let o of d(this,l,st).call(this)){let r=e(this,g)[o],a=d(this,l,S).call(this,r)?r.__staleWhileFetching:r;if(a!==void 0&&i(a,e(this,b)[o],this))return this.get(e(this,b)[o],s)}}forEach(i,s=this){for(let o of d(this,l,st).call(this)){let r=e(this,g)[o],a=d(this,l,S).call(this,r)?r.__staleWhileFetching:r;a!==void 0&&i.call(s,a,e(this,b)[o],this);}}rforEach(i,s=this){for(let o of d(this,l,ot).call(this)){let r=e(this,g)[o],a=d(this,l,S).call(this,r)?r.__staleWhileFetching:r;a!==void 0&&i.call(s,a,e(this,b)[o],this);}}purgeStale(){let i=false;for(let s of d(this,l,ot).call(this,{allowStale:true}))e(this,Y).call(this,s)&&(d(this,l,rt).call(this,e(this,b)[s],"expire"),i=true);return i}info(i){let s=e(this,_).get(i);if(s===void 0)return;let o=e(this,g)[s],r=d(this,l,S).call(this,o)?o.__staleWhileFetching:o;if(r===void 0)return;let a={value:r};if(e(this,U)&&e(this,$)){let n=e(this,U)[s],c=e(this,$)[s];if(n&&c){let h=n-(e(this,H).now()-c);a.ttl=h,a.start=Date.now();}}return e(this,K)&&(a.size=e(this,K)[s]),a}dump(){let i=[];for(let s of d(this,l,st).call(this,{allowStale:true})){let o=e(this,b)[s],r=e(this,g)[s],a=d(this,l,S).call(this,r)?r.__staleWhileFetching:r;if(a===void 0||o===void 0)continue;let n={value:a};if(e(this,U)&&e(this,$)){n.ttl=e(this,U)[s];let c=e(this,H).now()-e(this,$)[s];n.start=Math.floor(Date.now()-c);}e(this,K)&&(n.size=e(this,K)[s]),i.unshift([o,n]);}return i}load(i){this.clear();for(let[s,o]of i){if(o.start){let r=Date.now()-o.start;o.start=e(this,H).now()-r;}this.set(s,o.value,o);}}set(i,s,o={}){var et,N,J,A;if(s===void 0)return this.delete(i),this;let{ttl:r=this.ttl,start:a,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:h}=o,{noUpdateTTL:p=this.noUpdateTTL}=o,w=e(this,_t).call(this,i,s,o.size||0,c);if(this.maxEntrySize&&w>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=true),d(this,l,rt).call(this,i,"set"),this;let y=e(this,T)===0?void 0:e(this,_).get(i);if(y===void 0)y=e(this,T)===0?e(this,z):e(this,V).length!==0?e(this,V).pop():e(this,T)===e(this,P)?d(this,l,Ot).call(this,false):e(this,T),e(this,b)[y]=i,e(this,g)[y]=s,e(this,_).set(i,y),e(this,B)[e(this,z)]=y,e(this,L)[y]=e(this,z),u(this,z,y),Tt(this,T)._++,e(this,ft).call(this,y,w,h),h&&(h.set="add"),p=false,e(this,yt)&&((et=e(this,at))==null||et.call(this,s,i,"add"));else {d(this,l,At).call(this,y);let v=e(this,g)[y];if(s!==v){if(e(this,nt)&&d(this,l,S).call(this,v)){v.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=v;m!==void 0&&!n&&(e(this,Z)&&((N=e(this,X))==null||N.call(this,m,i,"set")),e(this,G)&&e(this,O)?.push([m,i,"set"]));}else n||(e(this,Z)&&((J=e(this,X))==null||J.call(this,v,i,"set")),e(this,G)&&e(this,O)?.push([v,i,"set"]));if(e(this,ht).call(this,y),e(this,ft).call(this,y,w,h),e(this,g)[y]=s,h){h.set="replace";let m=v&&d(this,l,S).call(this,v)?v.__staleWhileFetching:v;m!==void 0&&(h.oldValue=m);}}else h&&(h.set="update");e(this,yt)&&this.onInsert?.(s,i,s===v?"update":"replace");}if(r!==0&&!e(this,U)&&d(this,l,Bt).call(this),e(this,U)&&(p||e(this,xt).call(this,y,r,a),h&&e(this,tt).call(this,h,y)),!n&&e(this,G)&&e(this,O)){let v=e(this,O),m;for(;m=v?.shift();)(A=e(this,I))==null||A.call(this,...m);}return this}pop(){var i;try{for(;e(this,T);){let s=e(this,g)[e(this,R)];if(d(this,l,Ot).call(this,!0),d(this,l,S).call(this,s)){if(s.__staleWhileFetching)return s.__staleWhileFetching}else if(s!==void 0)return s}}finally{if(e(this,G)&&e(this,O)){let s=e(this,O),o;for(;o=s?.shift();)(i=e(this,I))==null||i.call(this,...o);}}}has(i,s={}){let{updateAgeOnHas:o=this.updateAgeOnHas,status:r}=s,a=e(this,_).get(i);if(a!==void 0){let n=e(this,g)[a];if(d(this,l,S).call(this,n)&&n.__staleWhileFetching===void 0)return false;if(e(this,Y).call(this,a))r&&(r.has="stale",e(this,tt).call(this,r,a));else return o&&e(this,lt).call(this,a),r&&(r.has="hit",e(this,tt).call(this,r,a)),true}else r&&(r.has="miss");return false}peek(i,s={}){let{allowStale:o=this.allowStale}=s,r=e(this,_).get(i);if(r===void 0||!o&&e(this,Y).call(this,r))return;let a=e(this,g)[r];return d(this,l,S).call(this,a)?a.__staleWhileFetching:a}async fetch(i,s={}){let{allowStale:o=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:h=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:et=this.allowStaleOnFetchRejection,ignoreFetchAbort:N=this.ignoreFetchAbort,allowStaleOnFetchAbort:J=this.allowStaleOnFetchAbort,context:A,forceRefresh:v=false,status:m,signal:E}=s;if(!e(this,nt))return m&&(m.fetch="get"),this.get(i,{allowStale:o,updateAgeOnGet:r,noDeleteOnStaleGet:a,status:m});let k={allowStale:o,updateAgeOnGet:r,noDeleteOnStaleGet:a,ttl:n,noDisposeOnSet:c,size:h,sizeCalculation:p,noUpdateTTL:w,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:et,allowStaleOnFetchAbort:J,ignoreFetchAbort:N,status:m,signal:E},D=e(this,_).get(i);if(D===void 0){m&&(m.fetch="miss");let x=d(this,l,Ct).call(this,i,D,k,A);return x.__returned=x}else {let x=e(this,g)[D];if(d(this,l,S).call(this,x)){let gt=o&&x.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",gt&&(m.returnedStale=true)),gt?x.__staleWhileFetching:x.__returned=x}let bt=e(this,Y).call(this,D);if(!v&&!bt)return m&&(m.fetch="hit"),d(this,l,At).call(this,D),r&&e(this,lt).call(this,D),m&&e(this,tt).call(this,m,D),x;let ct=d(this,l,Ct).call(this,i,D,k,A),ut=ct.__staleWhileFetching!==void 0&&o;return m&&(m.fetch=bt?"stale":"refresh",ut&&bt&&(m.returnedStale=true)),ut?ct.__staleWhileFetching:ct.__returned=ct}}async forceFetch(i,s={}){let o=await this.fetch(i,s);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(i,s={}){let o=e(this,Ft);if(!o)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:a,...n}=s,c=this.get(i,n);if(!a&&c!==void 0)return c;let h=o(i,c,{options:n,context:r});return this.set(i,h,n),h}get(i,s={}){let{allowStale:o=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:n}=s,c=e(this,_).get(i);if(c!==void 0){let h=e(this,g)[c],p=d(this,l,S).call(this,h);return n&&e(this,tt).call(this,n,c),e(this,Y).call(this,c)?(n&&(n.get="stale"),p?(n&&o&&h.__staleWhileFetching!==void 0&&(n.returnedStale=true),o?h.__staleWhileFetching:void 0):(a||d(this,l,rt).call(this,i,"expire"),n&&o&&(n.returnedStale=true),o?h:void 0)):(n&&(n.get="hit"),p?h.__staleWhileFetching:(d(this,l,At).call(this,c),r&&e(this,lt).call(this,c),h))}else n&&(n.get="miss");}delete(i){return d(this,l,rt).call(this,i,"delete")}clear(){return d(this,l,Wt).call(this,"delete")}},P=new WeakMap,W=new WeakMap,X=new WeakMap,at=new WeakMap,I=new WeakMap,mt=new WeakMap,Ft=new WeakMap,H=new WeakMap,T=new WeakMap,q=new WeakMap,_=new WeakMap,b=new WeakMap,g=new WeakMap,B=new WeakMap,L=new WeakMap,R=new WeakMap,z=new WeakMap,V=new WeakMap,O=new WeakMap,K=new WeakMap,$=new WeakMap,U=new WeakMap,j=new WeakMap,Z=new WeakMap,nt=new WeakMap,G=new WeakMap,yt=new WeakMap,l=new WeakSet,Bt=function(){let i=new zt(e(this,P)),s=new zt(e(this,P));u(this,U,i),u(this,$,s);let o=this.ttlAutopurge?new Array(e(this,P)):void 0;u(this,j,o),u(this,xt,(c,h,p=e(this,H).now())=>{s[c]=h!==0?p:0,i[c]=h,r(c,h);}),u(this,lt,c=>{s[c]=i[c]!==0?e(this,H).now():0,r(c,i[c]);});let r=this.ttlAutopurge?(c,h)=>{if(o?.[c]&&(clearTimeout(o[c]),o[c]=void 0),h&&h!==0&&o){let p=setTimeout(()=>{e(this,Y).call(this,c)&&d(this,l,rt).call(this,e(this,b)[c],"expire");},h+1);p.unref&&p.unref(),o[c]=p;}}:()=>{};u(this,tt,(c,h)=>{if(i[h]){let p=i[h],w=s[h];if(!p||!w)return;c.ttl=p,c.start=w,c.now=a||n();let y=c.now-w;c.remainingTTL=p-y;}});let a=0,n=()=>{let c=e(this,H).now();if(this.ttlResolution>0){a=c;let h=setTimeout(()=>a=0,this.ttlResolution);h.unref&&h.unref();}return c};this.getRemainingTTL=c=>{let h=e(this,_).get(c);if(h===void 0)return 0;let p=i[h],w=s[h];if(!p||!w)return 1/0;let y=(a||n())-w;return p-y},u(this,Y,c=>{let h=s[c],p=i[c];return !!p&&!!h&&(a||n())-h>p});},lt=new WeakMap,tt=new WeakMap,xt=new WeakMap,Y=new WeakMap,qt=function(){let i=new zt(e(this,P));u(this,q,0),u(this,K,i),u(this,ht,s=>{u(this,q,e(this,q)-i[s]),i[s]=0;}),u(this,_t,(s,o,r,a)=>{if(d(this,l,S).call(this,o))return 0;if(!it(r))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(r=a(o,s),!it(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,ft,(s,o,r)=>{if(i[s]=o,e(this,W)){let a=e(this,W)-i[s];for(;e(this,q)>a;)d(this,l,Ot).call(this,true);}u(this,q,e(this,q)+i[s]),r&&(r.entrySize=o,r.totalCalculatedSize=e(this,q));});},ht=new WeakMap,ft=new WeakMap,_t=new WeakMap,st=function*({allowStale:i=this.allowStale}={}){if(e(this,T))for(let s=e(this,z);!(!d(this,l,Gt).call(this,s)||((i||!e(this,Y).call(this,s))&&(yield s),s===e(this,R)));)s=e(this,L)[s];},ot=function*({allowStale:i=this.allowStale}={}){if(e(this,T))for(let s=e(this,R);!(!d(this,l,Gt).call(this,s)||((i||!e(this,Y).call(this,s))&&(yield s),s===e(this,z)));)s=e(this,B)[s];},Gt=function(i){return i!==void 0&&e(this,_).get(e(this,b)[i])===i},Ot=function(i){var a;let s=e(this,R),o=e(this,b)[s],r=e(this,g)[s];return e(this,nt)&&d(this,l,S).call(this,r)?r.__abortController.abort(new Error("evicted")):(e(this,Z)||e(this,G))&&(e(this,Z)&&((a=e(this,X))==null||a.call(this,r,o,"evict")),e(this,G)&&e(this,O)?.push([r,o,"evict"])),e(this,ht).call(this,s),e(this,j)?.[s]&&(clearTimeout(e(this,j)[s]),e(this,j)[s]=void 0),i&&(e(this,b)[s]=void 0,e(this,g)[s]=void 0,e(this,V).push(s)),e(this,T)===1?(u(this,R,u(this,z,0)),e(this,V).length=0):u(this,R,e(this,B)[s]),e(this,_).delete(o),Tt(this,T)._--,s},Ct=function(i,s,o,r){let a=s===void 0?void 0:e(this,g)[s];if(d(this,l,S).call(this,a))return a;let n=new Mt,{signal:c}=o;c?.addEventListener("abort",()=>n.abort(c.reason),{signal:n.signal});let h={signal:n.signal,options:o,context:r},p=(A,v=false)=>{let{aborted:m}=n.signal,E=o.ignoreFetchAbort&&A!==void 0,k=o.ignoreFetchAbort||!!(o.allowStaleOnFetchAbort&&A!==void 0);if(o.status&&(m&&!v?(o.status.fetchAborted=true,o.status.fetchError=n.signal.reason,E&&(o.status.fetchAbortIgnored=true)):o.status.fetchResolved=true),m&&!E&&!v)return y(n.signal.reason,k);let D=N,x=e(this,g)[s];return (x===N||E&&v&&x===void 0)&&(A===void 0?D.__staleWhileFetching!==void 0?e(this,g)[s]=D.__staleWhileFetching:d(this,l,rt).call(this,i,"fetch"):(o.status&&(o.status.fetchUpdated=true),this.set(i,A,h.options))),A},w=A=>(o.status&&(o.status.fetchRejected=true,o.status.fetchError=A),y(A,false)),y=(A,v)=>{let{aborted:m}=n.signal,E=m&&o.allowStaleOnFetchAbort,k=E||o.allowStaleOnFetchRejection,D=k||o.noDeleteOnFetchRejection,x=N;if(e(this,g)[s]===N&&(!D||!v&&x.__staleWhileFetching===void 0?d(this,l,rt).call(this,i,"fetch"):E||(e(this,g)[s]=x.__staleWhileFetching)),k)return o.status&&x.__staleWhileFetching!==void 0&&(o.status.returnedStale=true),x.__staleWhileFetching;if(x.__returned===x)throw A},et=(A,v)=>{var E;let m=(E=e(this,mt))==null?void 0:E.call(this,i,a,h);m&&m instanceof Promise&&m.then(k=>A(k===void 0?void 0:k),v),n.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(A(void 0),o.allowStaleOnFetchAbort&&(A=k=>p(k,true)));});};o.status&&(o.status.fetchDispatched=true);let N=new Promise(et).then(p,w),J=Object.assign(N,{__abortController:n,__staleWhileFetching:a,__returned:void 0});return s===void 0?(this.set(i,J,{...h.options,status:void 0}),s=e(this,_).get(i)):e(this,g)[s]=J,J},S=function(i){if(!e(this,nt))return false;let s=i;return !!s&&s instanceof Promise&&s.hasOwnProperty("__staleWhileFetching")&&s.__abortController instanceof Mt},kt=function(i,s){e(this,L)[s]=i,e(this,B)[i]=s;},At=function(i){i!==e(this,z)&&(i===e(this,R)?u(this,R,e(this,B)[i]):d(this,l,kt).call(this,e(this,L)[i],e(this,B)[i]),d(this,l,kt).call(this,e(this,z),i),u(this,z,i));},rt=function(i,s){var r,a;let o=false;if(e(this,T)!==0){let n=e(this,_).get(i);if(n!==void 0)if(e(this,j)?.[n]&&(clearTimeout(e(this,j)?.[n]),e(this,j)[n]=void 0),o=true,e(this,T)===1)d(this,l,Wt).call(this,s);else {e(this,ht).call(this,n);let c=e(this,g)[n];if(d(this,l,S).call(this,c)?c.__abortController.abort(new Error("deleted")):(e(this,Z)||e(this,G))&&(e(this,Z)&&((r=e(this,X))==null||r.call(this,c,i,s)),e(this,G)&&e(this,O)?.push([c,i,s])),e(this,_).delete(i),e(this,b)[n]=void 0,e(this,g)[n]=void 0,n===e(this,z))u(this,z,e(this,L)[n]);else if(n===e(this,R))u(this,R,e(this,B)[n]);else {let h=e(this,L)[n];e(this,B)[h]=e(this,B)[n];let p=e(this,B)[n];e(this,L)[p]=e(this,L)[n];}Tt(this,T)._--,e(this,V).push(n);}}if(e(this,G)&&e(this,O)?.length){let n=e(this,O),c;for(;c=n?.shift();)(a=e(this,I))==null||a.call(this,...c);}return o},Wt=function(i){var s,o;for(let r of d(this,l,ot).call(this,{allowStale:true})){let a=e(this,g)[r];if(d(this,l,S).call(this,a))a.__abortController.abort(new Error("deleted"));else {let n=e(this,b)[r];e(this,Z)&&((s=e(this,X))==null||s.call(this,a,n,i)),e(this,G)&&e(this,O)?.push([a,n,i]);}}if(e(this,_).clear(),e(this,g).fill(void 0),e(this,b).fill(void 0),e(this,U)&&e(this,$)){e(this,U).fill(0),e(this,$).fill(0);for(let r of e(this,j)??[])r!==void 0&&clearTimeout(r);e(this,j)?.fill(void 0);}if(e(this,K)&&e(this,K).fill(0),u(this,R,0),u(this,z,0),e(this,V).length=0,u(this,q,0),u(this,T,0),e(this,G)&&e(this,O)){let r=e(this,O),a;for(;a=r?.shift();)(o=e(this,I))==null||o.call(this,...a);}},wt);var vt=class{cache;map=new Map;constructor(i){this.cache=new Ht({max:i.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(i){let s=this.map.delete(i);return s&&this.cache.delete(i),s}get forEach(){return this.map.forEach}get(i){let s=this.cache.get(i);return s||this.map.get(i)}has(i){return this.map.has(i)}set(i,s){return this.map.set(i,s),this.cache.set(i,s),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var dt;(r=>(r.log=(a,...n)=>console.log(`[Pixi\u2019VN] ${a}`,...n),r.warn=(a,...n)=>console.warn(`[Pixi\u2019VN] ${a}`,...n),r.error=(a,...n)=>console.error(`[Pixi\u2019VN] ${a}`,...n),r.info=(a,...n)=>console.info(`[Pixi\u2019VN] ${a}`,...n)))(dt||={});var St=new vt({cacheSize:5}),Vt=new vt({cacheSize:5});function te(t){return i=>{Lt.add(i,t);}}var Lt;(c=>{function t(h,p){let{toMemory:w}=p,y=p.name??h.name;St.get(y)&&dt.info(`Filter "${y}" already exists, it will be overwritten`),h.prototype.pixivnFilterId=y,St.set(y,h),Vt.set(y,w);}c.add=t;function i(h){let p=St.get(h);if(!p){dt.error(`Filter "${h}" not found, did you forget to register it with the filterDecorator?`);return}return p}c.get=i;function s(h,p){let w=i(h);if(w)try{return new w(p)}catch(y){dt.error(`Error while getting Filter instance "${h}"`,y);return}}c.getInstance=s;function o(h,p){let w=Vt.get(h);if(!w){dt.error(`Filter "${h}" not found, did you forget to register it with the filterDecorator?`);return}try{return {filterId:h,args:w(p)}}catch(y){dt.error(`Error while converting Filter "${h}" to memory`,y);return}}c.toMemory=o;function r(){return Array.from(St.values())}c.values=r;function a(h){return St.has(h)}c.has=a;function n(){return Array.from(St.keys())}c.keys=n;})(Lt||={});var F=Lt;function M(t,i){return {x:t,y:i}}F.add(pixi_js.BlurFilter,{name:"BlurFilter",toMemory:t=>({strengthX:t.strengthX,strengthY:t.strengthY,quality:t.quality,repeatEdgePixels:t.repeatEdgePixels})});F.add(pixi_js.AlphaFilter,{name:"AlphaFilter",toMemory:t=>({alpha:t.alpha})});F.add(pixi_js.NoiseFilter,{name:"NoiseFilter",toMemory:t=>({noise:t.noise,seed:t.seed})});F.add(pixiFilters.PixelateFilter,{name:"PixelateFilter",toMemory:t=>[t.sizeX,t.sizeY]});F.add(pixiFilters.AdjustmentFilter,{name:"AdjustmentFilter",toMemory:t=>({gamma:t.gamma,contrast:t.contrast,saturation:t.saturation,brightness:t.brightness,red:t.red,green:t.green,blue:t.blue,alpha:t.alpha})});F.add(pixiFilters.AdvancedBloomFilter,{name:"AdvancedBloomFilter",toMemory:t=>({threshold:t.threshold,bloomScale:t.bloomScale,brightness:t.brightness,blur:t.blur,kernels:t.kernels,quality:t.quality,pixelSize:M(t.pixelSizeX,t.pixelSizeY)})});F.add(pixiFilters.AsciiFilter,{name:"AsciiFilter",toMemory:t=>({size:t.size,color:t.color,replaceColor:t.replaceColor})});F.add(pixiFilters.BackdropBlurFilter,{name:"BackdropBlurFilter",toMemory:t=>({strength:t.strength,quality:t.quality})});F.add(pixiFilters.BevelFilter,{name:"BevelFilter",toMemory:t=>({rotation:t.rotation,thickness:t.thickness,lightColor:t.lightColor,lightAlpha:t.lightAlpha,shadowColor:t.shadowColor,shadowAlpha:t.shadowAlpha})});F.add(pixiFilters.BloomFilter,{name:"BloomFilter",toMemory:t=>({strength:M(t.strengthX,t.strengthY)})});F.add(pixiFilters.BulgePinchFilter,{name:"BulgePinchFilter",toMemory:t=>({center:M(t.centerX,t.centerY),radius:t.radius,strength:t.strength})});F.add(pixiFilters.ColorGradientFilter,{name:"ColorGradientFilter",toMemory:t=>({type:t.type,stops:t.stops,angle:t.angle,alpha:t.alpha,maxColors:t.maxColors,replace:t.replace})});F.add(pixiFilters.ColorOverlayFilter,{name:"ColorOverlayFilter",toMemory:t=>({color:t.color,alpha:t.alpha})});F.add(pixiFilters.ColorReplaceFilter,{name:"ColorReplaceFilter",toMemory:t=>({originalColor:t.originalColor,targetColor:t.targetColor,tolerance:t.tolerance})});F.add(pixiFilters.ConvolutionFilter,{name:"ConvolutionFilter",toMemory:t=>({matrix:t.matrix,width:t.width,height:t.height})});F.add(pixiFilters.CrossHatchFilter,{name:"CrossHatchFilter",toMemory:()=>({})});F.add(pixiFilters.CRTFilter,{name:"CRTFilter",toMemory:t=>({curvature:t.curvature,lineWidth:t.lineWidth,lineContrast:t.lineContrast,verticalLine:t.verticalLine,noise:t.noise,noiseSize:t.noiseSize,vignetting:t.vignetting,vignettingAlpha:t.vignettingAlpha,vignettingBlur:t.vignettingBlur,seed:t.seed,time:t.time})});F.add(pixiFilters.DotFilter,{name:"DotFilter",toMemory:t=>({scale:t.scale,angle:t.angle,grayscale:t.grayscale})});F.add(pixiFilters.DropShadowFilter,{name:"DropShadowFilter",toMemory:t=>({offset:M(t.offsetX,t.offsetY),color:t.color,alpha:t.alpha,shadowOnly:t.shadowOnly,blur:t.blur,quality:t.quality,kernels:t.kernels,pixelSize:M(t.pixelSizeX,t.pixelSizeY)})});F.add(pixiFilters.EmbossFilter,{name:"EmbossFilter",toMemory:t=>t.strength});F.add(pixiFilters.GlitchFilter,{name:"GlitchFilter",toMemory:t=>({slices:t.slices,offset:t.offset,direction:t.direction,fillMode:t.fillMode,seed:t.seed,average:t.average,minSize:t.minSize,sampleSize:t.sampleSize,red:t.red,green:t.green,blue:t.blue})});F.add(pixiFilters.GlowFilter,{name:"GlowFilter",toMemory:t=>({distance:t.distance,outerStrength:t.outerStrength,innerStrength:t.innerStrength,color:t.color,alpha:t.alpha,quality:t.quality,knockout:t.knockout})});F.add(pixiFilters.GodrayFilter,{name:"GodrayFilter",toMemory:t=>({angle:t.angle,parallel:t.parallel,center:M(t.centerX,t.centerY),gain:t.gain,lacunarity:t.lacunarity,time:t.time,alpha:t.alpha})});F.add(pixiFilters.GrayscaleFilter,{name:"GrayscaleFilter",toMemory:()=>({})});F.add(pixiFilters.HslAdjustmentFilter,{name:"HslAdjustmentFilter",toMemory:t=>({hue:t.hue,saturation:t.saturation,lightness:t.lightness,colorize:t.colorize,alpha:t.alpha})});F.add(pixiFilters.KawaseBlurFilter,{name:"KawaseBlurFilter",toMemory:t=>({strength:t.strength,quality:t.quality,pixelSize:M(t.pixelSizeX,t.pixelSizeY)})});F.add(pixiFilters.MotionBlurFilter,{name:"MotionBlurFilter",toMemory:t=>({velocity:M(t.velocityX,t.velocityY),kernelSize:t.kernelSize,offset:t.offset})});F.add(pixiFilters.MultiColorReplaceFilter,{name:"MultiColorReplaceFilter",toMemory:t=>({replacements:t.replacements,tolerance:t.tolerance})});F.add(pixiFilters.OldFilmFilter,{name:"OldFilmFilter",toMemory:t=>({sepia:t.sepia,noise:t.noise,noiseSize:t.noiseSize,scratch:t.scratch,scratchDensity:t.scratchDensity,scratchWidth:t.scratchWidth,vignetting:t.vignetting,vignettingAlpha:t.vignettingAlpha,vignettingBlur:t.vignettingBlur,seed:t.seed})});F.add(pixiFilters.OutlineFilter,{name:"OutlineFilter",toMemory:t=>({thickness:t.thickness,color:t.color,alpha:t.alpha,quality:t.quality,knockout:t.knockout})});F.add(pixiFilters.RadialBlurFilter,{name:"RadialBlurFilter",toMemory:t=>({angle:t.angle,center:M(t.centerX,t.centerY),kernelSize:t.kernelSize,radius:t.radius})});F.add(pixiFilters.ReflectionFilter,{name:"ReflectionFilter",toMemory:t=>({mirror:t.mirror,boundary:t.boundary,amplitude:t.amplitude,waveLength:t.waveLength,alpha:t.alpha,time:t.time})});F.add(pixiFilters.RGBSplitFilter,{name:"RGBSplitFilter",toMemory:t=>({red:M(t.redX,t.redY),green:M(t.greenX,t.greenY),blue:M(t.blueX,t.blueY)})});F.add(pixiFilters.ShockwaveFilter,{name:"ShockwaveFilter",toMemory:t=>({center:M(t.centerX,t.centerY),speed:t.speed,amplitude:t.amplitude,wavelength:t.wavelength,brightness:t.brightness,radius:t.radius,time:t.time})});F.add(pixiFilters.SimplexNoiseFilter,{name:"SimplexNoiseFilter",toMemory:t=>({strength:t.strength,noiseScale:t.noiseScale,offsetX:t.offsetX,offsetY:t.offsetY,offsetZ:t.offsetZ,step:t.step})});F.add(pixiFilters.TiltShiftFilter,{name:"TiltShiftFilter",toMemory:t=>({blur:t.blur,gradientBlur:t.gradientBlur,start:M(t.startX,t.startY),end:M(t.endX,t.endY)})});F.add(pixiFilters.TwistFilter,{name:"TwistFilter",toMemory:t=>({radius:t.radius,angle:t.angle,offset:M(t.offsetX,t.offsetY)})});F.add(pixiFilters.ZoomBlurFilter,{name:"ZoomBlurFilter",toMemory:t=>({strength:t.strength,center:M(t.centerX,t.centerY),innerRadius:t.innerRadius,radius:t.radius})});function xi(t,i,s,o,r,a,n){return core.GameUnifier.animateFilter(t,i,s,o,r,a,n)}var Xi={AlphaFilter:pixi_js.AlphaFilter,BlurFilter:pixi_js.BlurFilter,NoiseFilter:pixi_js.NoiseFilter,AdjustmentFilter:pixiFilters.AdjustmentFilter,AdvancedBloomFilter:pixiFilters.AdvancedBloomFilter,AsciiFilter:pixiFilters.AsciiFilter,BackdropBlurFilter:pixiFilters.BackdropBlurFilter,BevelFilter:pixiFilters.BevelFilter,BloomFilter:pixiFilters.BloomFilter,BulgePinchFilter:pixiFilters.BulgePinchFilter,ColorGradientFilter:pixiFilters.ColorGradientFilter,ColorOverlayFilter:pixiFilters.ColorOverlayFilter,ColorReplaceFilter:pixiFilters.ColorReplaceFilter,ConvolutionFilter:pixiFilters.ConvolutionFilter,CRTFilter:pixiFilters.CRTFilter,CrossHatchFilter:pixiFilters.CrossHatchFilter,DotFilter:pixiFilters.DotFilter,DropShadowFilter:pixiFilters.DropShadowFilter,EmbossFilter:pixiFilters.EmbossFilter,GlitchFilter:pixiFilters.GlitchFilter,GlowFilter:pixiFilters.GlowFilter,GodrayFilter:pixiFilters.GodrayFilter,GrayscaleFilter:pixiFilters.GrayscaleFilter,HslAdjustmentFilter:pixiFilters.HslAdjustmentFilter,KawaseBlurFilter:pixiFilters.KawaseBlurFilter,MotionBlurFilter:pixiFilters.MotionBlurFilter,MultiColorReplaceFilter:pixiFilters.MultiColorReplaceFilter,OldFilmFilter:pixiFilters.OldFilmFilter,OutlineFilter:pixiFilters.OutlineFilter,PixelateFilter:pixiFilters.PixelateFilter,RadialBlurFilter:pixiFilters.RadialBlurFilter,ReflectionFilter:pixiFilters.ReflectionFilter,RGBSplitFilter:pixiFilters.RGBSplitFilter,ShockwaveFilter:pixiFilters.ShockwaveFilter,SimplexNoiseFilter:pixiFilters.SimplexNoiseFilter,TiltShiftFilter:pixiFilters.TiltShiftFilter,TwistFilter:pixiFilters.TwistFilter,ZoomBlurFilter:pixiFilters.ZoomBlurFilter,animate:xi};exports.RegisteredFilters=F;exports.filterDecorator=te;exports.filters=Xi;
|
|
1
|
+
'use strict';var core=require('@drincs/pixi-vn/core'),pixi_js=require('@drincs/pixi-vn/pixi.js'),pixiFilters=require('pixi-filters');var qt=Object.defineProperty;var Lt=t=>{throw TypeError(t)};var Ht=(t,i,s)=>i in t?qt(t,i,{enumerable:true,configurable:true,writable:true,value:s}):t[i]=s;var C=(t,i,s)=>Ht(t,typeof i!="symbol"?i+"":i,s),Mt=(t,i,s)=>i.has(t)||Lt("Cannot "+s);var e=(t,i,s)=>(Mt(t,i,"read from private field"),s?s.call(t):i.get(t)),p=(t,i,s)=>i.has(t)?Lt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,s),d=(t,i,s,n)=>(Mt(t,i,"write to private field"),i.set(t,s),s),l=(t,i,s)=>(Mt(t,i,"access private method"),s);var vt=(t,i,s,n)=>({set _(a){d(t,i,a);},get _(){return e(t,i,n)}});var lt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Nt=new Set,Ct=typeof process=="object"&&process?process:{},jt=(t,i,s,n)=>{typeof Ct.emitWarning=="function"?Ct.emitWarning(t,i,s,n):console.error(`[${s}] ${i}: ${t}`);},zt=globalThis.AbortController,Pt=globalThis.AbortSignal;if(typeof zt>"u"){Pt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(n,a){this._onabort.push(a);}},zt=class{constructor(){i();}signal=new Pt;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=true;for(let a of this.signal._onabort)a(n);this.signal.onabort?.(n);}}};let t=Ct.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",i=()=>{t&&(t=false,jt("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",i));};}var Kt=t=>!Nt.has(t);var tt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Xt=t=>tt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ct:null:null,ct=class extends Array{constructor(i){super(i),this.fill(0);}},dt,rt=class rt{heap;length;static create(i){let s=Xt(i);if(!s)return [];d(rt,dt,true);let n=new rt(i,s);return d(rt,dt,false),n}constructor(i,s){if(!e(rt,dt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new s(i),this.length=0;}push(i){this.heap[this.length++]=i;}pop(){return this.heap[--this.length]}};dt=new WeakMap,p(rt,dt,false);var Ot=rt,Ut,Yt,j,G,X,I,ut,ft,_,V,A,b,f,R,k,E,T,q,x,H,K,L,$,nt,B,h,Et,ot,J,wt,P,It,at,gt,St,et,it,Rt,At,_t,S,Bt,Ft,st,Dt,Wt=class Wt{constructor(i){p(this,h);p(this,j);p(this,G);p(this,X);p(this,I);p(this,ut);p(this,ft);C(this,"ttl");C(this,"ttlResolution");C(this,"ttlAutopurge");C(this,"updateAgeOnGet");C(this,"updateAgeOnHas");C(this,"allowStale");C(this,"noDisposeOnSet");C(this,"noUpdateTTL");C(this,"maxEntrySize");C(this,"sizeCalculation");C(this,"noDeleteOnFetchRejection");C(this,"noDeleteOnStaleGet");C(this,"allowStaleOnFetchAbort");C(this,"allowStaleOnFetchRejection");C(this,"ignoreFetchAbort");p(this,_);p(this,V);p(this,A);p(this,b);p(this,f);p(this,R);p(this,k);p(this,E);p(this,T);p(this,q);p(this,x);p(this,H);p(this,K);p(this,L);p(this,$);p(this,nt);p(this,B);p(this,ot,()=>{});p(this,J,()=>{});p(this,wt,()=>{});p(this,P,()=>false);p(this,at,i=>{});p(this,gt,(i,s,n)=>{});p(this,St,(i,s,n,a)=>{if(n||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});C(this,Ut,"LRUCache");let{max:s=0,ttl:n,ttlResolution:a=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:y,disposeAfter:z,noDisposeOnSet:m,noUpdateTTL:W,maxSize:U=0,maxEntrySize:Z=0,sizeCalculation:F,fetchMethod:v,memoMethod:w,noDeleteOnFetchRejection:Y,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:N,ignoreFetchAbort:yt}=i;if(s!==0&&!tt(s))throw new TypeError("max option must be a nonnegative integer");let Q=s?Xt(s):Array;if(!Q)throw new Error("invalid max value: "+s);if(d(this,j,s),d(this,G,U),this.maxEntrySize=Z||e(this,G),this.sizeCalculation=F,this.sizeCalculation){if(!e(this,G)&&!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(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(d(this,ft,w),v!==void 0&&typeof v!="function")throw new TypeError("fetchMethod must be a function if specified");if(d(this,ut,v),d(this,nt,!!v),d(this,A,new Map),d(this,b,new Array(s).fill(void 0)),d(this,f,new Array(s).fill(void 0)),d(this,R,new Q(s)),d(this,k,new Q(s)),d(this,E,0),d(this,T,0),d(this,q,Ot.create(s)),d(this,_,0),d(this,V,0),typeof y=="function"&&d(this,X,y),typeof z=="function"?(d(this,I,z),d(this,x,[])):(d(this,I,void 0),d(this,x,void 0)),d(this,$,!!e(this,X)),d(this,B,!!e(this,I)),this.noDisposeOnSet=!!m,this.noUpdateTTL=!!W,this.noDeleteOnFetchRejection=!!Y,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!yt,this.maxEntrySize!==0){if(e(this,G)!==0&&!tt(e(this,G)))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");l(this,h,It).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=tt(a)||a===0?a:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");l(this,h,Et).call(this);}if(e(this,j)===0&&this.ttl===0&&e(this,G)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,j)&&!e(this,G)){let bt="LRU_CACHE_UNBOUNDED";Kt(bt)&&(Nt.add(bt),jt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",bt,Wt));}}static unsafeExposeInternals(i){return {starts:e(i,K),ttls:e(i,L),sizes:e(i,H),keyMap:e(i,A),keyList:e(i,b),valList:e(i,f),next:e(i,R),prev:e(i,k),get head(){return e(i,E)},get tail(){return e(i,T)},free:e(i,q),isBackgroundFetch:s=>{var n;return l(n=i,h,S).call(n,s)},backgroundFetch:(s,n,a,r)=>{var o;return l(o=i,h,_t).call(o,s,n,a,r)},moveToTail:s=>{var n;return l(n=i,h,Ft).call(n,s)},indexes:s=>{var n;return l(n=i,h,et).call(n,s)},rindexes:s=>{var n;return l(n=i,h,it).call(n,s)},isStale:s=>{var n;return e(n=i,P).call(n,s)}}}get max(){return e(this,j)}get maxSize(){return e(this,G)}get calculatedSize(){return e(this,V)}get size(){return e(this,_)}get fetchMethod(){return e(this,ut)}get memoMethod(){return e(this,ft)}get dispose(){return e(this,X)}get disposeAfter(){return e(this,I)}getRemainingTTL(i){return e(this,A).has(i)?1/0:0}*entries(){for(let i of l(this,h,et).call(this))e(this,f)[i]!==void 0&&e(this,b)[i]!==void 0&&!l(this,h,S).call(this,e(this,f)[i])&&(yield [e(this,b)[i],e(this,f)[i]]);}*rentries(){for(let i of l(this,h,it).call(this))e(this,f)[i]!==void 0&&e(this,b)[i]!==void 0&&!l(this,h,S).call(this,e(this,f)[i])&&(yield [e(this,b)[i],e(this,f)[i]]);}*keys(){for(let i of l(this,h,et).call(this)){let s=e(this,b)[i];s!==void 0&&!l(this,h,S).call(this,e(this,f)[i])&&(yield s);}}*rkeys(){for(let i of l(this,h,it).call(this)){let s=e(this,b)[i];s!==void 0&&!l(this,h,S).call(this,e(this,f)[i])&&(yield s);}}*values(){for(let i of l(this,h,et).call(this))e(this,f)[i]!==void 0&&!l(this,h,S).call(this,e(this,f)[i])&&(yield e(this,f)[i]);}*rvalues(){for(let i of l(this,h,it).call(this))e(this,f)[i]!==void 0&&!l(this,h,S).call(this,e(this,f)[i])&&(yield e(this,f)[i]);}[(Yt=Symbol.iterator,Ut=Symbol.toStringTag,Yt)](){return this.entries()}find(i,s={}){for(let n of l(this,h,et).call(this)){let a=e(this,f)[n],r=l(this,h,S).call(this,a)?a.__staleWhileFetching:a;if(r!==void 0&&i(r,e(this,b)[n],this))return this.get(e(this,b)[n],s)}}forEach(i,s=this){for(let n of l(this,h,et).call(this)){let a=e(this,f)[n],r=l(this,h,S).call(this,a)?a.__staleWhileFetching:a;r!==void 0&&i.call(s,r,e(this,b)[n],this);}}rforEach(i,s=this){for(let n of l(this,h,it).call(this)){let a=e(this,f)[n],r=l(this,h,S).call(this,a)?a.__staleWhileFetching:a;r!==void 0&&i.call(s,r,e(this,b)[n],this);}}purgeStale(){let i=false;for(let s of l(this,h,it).call(this,{allowStale:true}))e(this,P).call(this,s)&&(l(this,h,st).call(this,e(this,b)[s],"expire"),i=true);return i}info(i){let s=e(this,A).get(i);if(s===void 0)return;let n=e(this,f)[s],a=l(this,h,S).call(this,n)?n.__staleWhileFetching:n;if(a===void 0)return;let r={value:a};if(e(this,L)&&e(this,K)){let o=e(this,L)[s],u=e(this,K)[s];if(o&&u){let c=o-(lt.now()-u);r.ttl=c,r.start=Date.now();}}return e(this,H)&&(r.size=e(this,H)[s]),r}dump(){let i=[];for(let s of l(this,h,et).call(this,{allowStale:true})){let n=e(this,b)[s],a=e(this,f)[s],r=l(this,h,S).call(this,a)?a.__staleWhileFetching:a;if(r===void 0||n===void 0)continue;let o={value:r};if(e(this,L)&&e(this,K)){o.ttl=e(this,L)[s];let u=lt.now()-e(this,K)[s];o.start=Math.floor(Date.now()-u);}e(this,H)&&(o.size=e(this,H)[s]),i.unshift([n,o]);}return i}load(i){this.clear();for(let[s,n]of i){if(n.start){let a=Date.now()-n.start;n.start=lt.now()-a;}this.set(s,n.value,n);}}set(i,s,n={}){var W,U,Z;if(s===void 0)return this.delete(i),this;let{ttl:a=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=n,{noUpdateTTL:y=this.noUpdateTTL}=n,z=e(this,St).call(this,i,s,n.size||0,u);if(this.maxEntrySize&&z>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),l(this,h,st).call(this,i,"set"),this;let m=e(this,_)===0?void 0:e(this,A).get(i);if(m===void 0)m=e(this,_)===0?e(this,T):e(this,q).length!==0?e(this,q).pop():e(this,_)===e(this,j)?l(this,h,At).call(this,false):e(this,_),e(this,b)[m]=i,e(this,f)[m]=s,e(this,A).set(i,m),e(this,R)[e(this,T)]=m,e(this,k)[m]=e(this,T),d(this,T,m),vt(this,_)._++,e(this,gt).call(this,m,z,c),c&&(c.set="add"),y=false;else {l(this,h,Ft).call(this,m);let F=e(this,f)[m];if(s!==F){if(e(this,nt)&&l(this,h,S).call(this,F)){F.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:v}=F;v!==void 0&&!o&&(e(this,$)&&((W=e(this,X))==null||W.call(this,v,i,"set")),e(this,B)&&e(this,x)?.push([v,i,"set"]));}else o||(e(this,$)&&((U=e(this,X))==null||U.call(this,F,i,"set")),e(this,B)&&e(this,x)?.push([F,i,"set"]));if(e(this,at).call(this,m),e(this,gt).call(this,m,z,c),e(this,f)[m]=s,c){c.set="replace";let v=F&&l(this,h,S).call(this,F)?F.__staleWhileFetching:F;v!==void 0&&(c.oldValue=v);}}else c&&(c.set="update");}if(a!==0&&!e(this,L)&&l(this,h,Et).call(this),e(this,L)&&(y||e(this,wt).call(this,m,a,r),c&&e(this,J).call(this,c,m)),!o&&e(this,B)&&e(this,x)){let F=e(this,x),v;for(;v=F?.shift();)(Z=e(this,I))==null||Z.call(this,...v);}return this}pop(){var i;try{for(;e(this,_);){let s=e(this,f)[e(this,E)];if(l(this,h,At).call(this,!0),l(this,h,S).call(this,s)){if(s.__staleWhileFetching)return s.__staleWhileFetching}else if(s!==void 0)return s}}finally{if(e(this,B)&&e(this,x)){let s=e(this,x),n;for(;n=s?.shift();)(i=e(this,I))==null||i.call(this,...n);}}}has(i,s={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:a}=s,r=e(this,A).get(i);if(r!==void 0){let o=e(this,f)[r];if(l(this,h,S).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(e(this,P).call(this,r))a&&(a.has="stale",e(this,J).call(this,a,r));else return n&&e(this,ot).call(this,r),a&&(a.has="hit",e(this,J).call(this,a,r)),true}else a&&(a.has="miss");return false}peek(i,s={}){let{allowStale:n=this.allowStale}=s,a=e(this,A).get(i);if(a===void 0||!n&&e(this,P).call(this,a))return;let r=e(this,f)[a];return l(this,h,S).call(this,r)?r.__staleWhileFetching:r}async fetch(i,s={}){let{allowStale:n=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:y=this.sizeCalculation,noUpdateTTL:z=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:W=this.allowStaleOnFetchRejection,ignoreFetchAbort:U=this.ignoreFetchAbort,allowStaleOnFetchAbort:Z=this.allowStaleOnFetchAbort,context:F,forceRefresh:v=false,status:w,signal:Y}=s;if(!e(this,nt))return w&&(w.fetch="get"),this.get(i,{allowStale:n,updateAgeOnGet:a,noDeleteOnStaleGet:r,status:w});let D={allowStale:n,updateAgeOnGet:a,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:u,size:c,sizeCalculation:y,noUpdateTTL:z,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:Z,ignoreFetchAbort:U,status:w,signal:Y},M=e(this,A).get(i);if(M===void 0){w&&(w.fetch="miss");let N=l(this,h,_t).call(this,i,M,D,F);return N.__returned=N}else {let N=e(this,f)[M];if(l(this,h,S).call(this,N)){let kt=n&&N.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",kt&&(w.returnedStale=true)),kt?N.__staleWhileFetching:N.__returned=N}let yt=e(this,P).call(this,M);if(!v&&!yt)return w&&(w.fetch="hit"),l(this,h,Ft).call(this,M),a&&e(this,ot).call(this,M),w&&e(this,J).call(this,w,M),N;let Q=l(this,h,_t).call(this,i,M,D,F),xt=Q.__staleWhileFetching!==void 0&&n;return w&&(w.fetch=yt?"stale":"refresh",xt&&yt&&(w.returnedStale=true)),xt?Q.__staleWhileFetching:Q.__returned=Q}}async forceFetch(i,s={}){let n=await this.fetch(i,s);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(i,s={}){let n=e(this,ft);if(!n)throw new Error("no memoMethod provided to constructor");let{context:a,forceRefresh:r,...o}=s,u=this.get(i,o);if(!r&&u!==void 0)return u;let c=n(i,u,{options:o,context:a});return this.set(i,c,o),c}get(i,s={}){let{allowStale:n=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=s,u=e(this,A).get(i);if(u!==void 0){let c=e(this,f)[u],y=l(this,h,S).call(this,c);return o&&e(this,J).call(this,o,u),e(this,P).call(this,u)?(o&&(o.get="stale"),y?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=true),n?c.__staleWhileFetching:void 0):(r||l(this,h,st).call(this,i,"expire"),o&&n&&(o.returnedStale=true),n?c:void 0)):(o&&(o.get="hit"),y?c.__staleWhileFetching:(l(this,h,Ft).call(this,u),a&&e(this,ot).call(this,u),c))}else o&&(o.get="miss");}delete(i){return l(this,h,st).call(this,i,"delete")}clear(){return l(this,h,Dt).call(this,"delete")}};j=new WeakMap,G=new WeakMap,X=new WeakMap,I=new WeakMap,ut=new WeakMap,ft=new WeakMap,_=new WeakMap,V=new WeakMap,A=new WeakMap,b=new WeakMap,f=new WeakMap,R=new WeakMap,k=new WeakMap,E=new WeakMap,T=new WeakMap,q=new WeakMap,x=new WeakMap,H=new WeakMap,K=new WeakMap,L=new WeakMap,$=new WeakMap,nt=new WeakMap,B=new WeakMap,h=new WeakSet,Et=function(){let i=new ct(e(this,j)),s=new ct(e(this,j));d(this,L,i),d(this,K,s),d(this,wt,(r,o,u=lt.now())=>{if(s[r]=o!==0?u:0,i[r]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{e(this,P).call(this,r)&&l(this,h,st).call(this,e(this,b)[r],"expire");},o+1);c.unref&&c.unref();}}),d(this,ot,r=>{s[r]=i[r]!==0?lt.now():0;}),d(this,J,(r,o)=>{if(i[o]){let u=i[o],c=s[o];if(!u||!c)return;r.ttl=u,r.start=c,r.now=n||a();let y=r.now-c;r.remainingTTL=u-y;}});let n=0,a=()=>{let r=lt.now();if(this.ttlResolution>0){n=r;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return r};this.getRemainingTTL=r=>{let o=e(this,A).get(r);if(o===void 0)return 0;let u=i[o],c=s[o];if(!u||!c)return 1/0;let y=(n||a())-c;return u-y},d(this,P,r=>{let o=s[r],u=i[r];return !!u&&!!o&&(n||a())-o>u});},ot=new WeakMap,J=new WeakMap,wt=new WeakMap,P=new WeakMap,It=function(){let i=new ct(e(this,j));d(this,V,0),d(this,H,i),d(this,at,s=>{d(this,V,e(this,V)-i[s]),i[s]=0;}),d(this,St,(s,n,a,r)=>{if(l(this,h,S).call(this,n))return 0;if(!tt(a))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(a=r(n,s),!tt(a))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 a}),d(this,gt,(s,n,a)=>{if(i[s]=n,e(this,G)){let r=e(this,G)-i[s];for(;e(this,V)>r;)l(this,h,At).call(this,true);}d(this,V,e(this,V)+i[s]),a&&(a.entrySize=n,a.totalCalculatedSize=e(this,V));});},at=new WeakMap,gt=new WeakMap,St=new WeakMap,et=function*({allowStale:i=this.allowStale}={}){if(e(this,_))for(let s=e(this,T);!(!l(this,h,Rt).call(this,s)||((i||!e(this,P).call(this,s))&&(yield s),s===e(this,E)));)s=e(this,k)[s];},it=function*({allowStale:i=this.allowStale}={}){if(e(this,_))for(let s=e(this,E);!(!l(this,h,Rt).call(this,s)||((i||!e(this,P).call(this,s))&&(yield s),s===e(this,T)));)s=e(this,R)[s];},Rt=function(i){return i!==void 0&&e(this,A).get(e(this,b)[i])===i},At=function(i){var r;let s=e(this,E),n=e(this,b)[s],a=e(this,f)[s];return e(this,nt)&&l(this,h,S).call(this,a)?a.__abortController.abort(new Error("evicted")):(e(this,$)||e(this,B))&&(e(this,$)&&((r=e(this,X))==null||r.call(this,a,n,"evict")),e(this,B)&&e(this,x)?.push([a,n,"evict"])),e(this,at).call(this,s),i&&(e(this,b)[s]=void 0,e(this,f)[s]=void 0,e(this,q).push(s)),e(this,_)===1?(d(this,E,d(this,T,0)),e(this,q).length=0):d(this,E,e(this,R)[s]),e(this,A).delete(n),vt(this,_)._--,s},_t=function(i,s,n,a){let r=s===void 0?void 0:e(this,f)[s];if(l(this,h,S).call(this,r))return r;let o=new zt,{signal:u}=n;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:a},y=(F,v=false)=>{let{aborted:w}=o.signal,Y=n.ignoreFetchAbort&&F!==void 0;if(n.status&&(w&&!v?(n.status.fetchAborted=true,n.status.fetchError=o.signal.reason,Y&&(n.status.fetchAbortIgnored=true)):n.status.fetchResolved=true),w&&!Y&&!v)return m(o.signal.reason);let D=U;return e(this,f)[s]===U&&(F===void 0?D.__staleWhileFetching?e(this,f)[s]=D.__staleWhileFetching:l(this,h,st).call(this,i,"fetch"):(n.status&&(n.status.fetchUpdated=true),this.set(i,F,c.options))),F},z=F=>(n.status&&(n.status.fetchRejected=true,n.status.fetchError=F),m(F)),m=F=>{let{aborted:v}=o.signal,w=v&&n.allowStaleOnFetchAbort,Y=w||n.allowStaleOnFetchRejection,D=Y||n.noDeleteOnFetchRejection,M=U;if(e(this,f)[s]===U&&(!D||M.__staleWhileFetching===void 0?l(this,h,st).call(this,i,"fetch"):w||(e(this,f)[s]=M.__staleWhileFetching)),Y)return n.status&&M.__staleWhileFetching!==void 0&&(n.status.returnedStale=true),M.__staleWhileFetching;if(M.__returned===M)throw F},W=(F,v)=>{var Y;let w=(Y=e(this,ut))==null?void 0:Y.call(this,i,r,c);w&&w instanceof Promise&&w.then(D=>F(D===void 0?void 0:D),v),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(F(void 0),n.allowStaleOnFetchAbort&&(F=D=>y(D,true)));});};n.status&&(n.status.fetchDispatched=true);let U=new Promise(W).then(y,z),Z=Object.assign(U,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return s===void 0?(this.set(i,Z,{...c.options,status:void 0}),s=e(this,A).get(i)):e(this,f)[s]=Z,Z},S=function(i){if(!e(this,nt))return false;let s=i;return !!s&&s instanceof Promise&&s.hasOwnProperty("__staleWhileFetching")&&s.__abortController instanceof zt},Bt=function(i,s){e(this,k)[s]=i,e(this,R)[i]=s;},Ft=function(i){i!==e(this,T)&&(i===e(this,E)?d(this,E,e(this,R)[i]):l(this,h,Bt).call(this,e(this,k)[i],e(this,R)[i]),l(this,h,Bt).call(this,e(this,T),i),d(this,T,i));},st=function(i,s){var a,r;let n=false;if(e(this,_)!==0){let o=e(this,A).get(i);if(o!==void 0)if(n=true,e(this,_)===1)l(this,h,Dt).call(this,s);else {e(this,at).call(this,o);let u=e(this,f)[o];if(l(this,h,S).call(this,u)?u.__abortController.abort(new Error("deleted")):(e(this,$)||e(this,B))&&(e(this,$)&&((a=e(this,X))==null||a.call(this,u,i,s)),e(this,B)&&e(this,x)?.push([u,i,s])),e(this,A).delete(i),e(this,b)[o]=void 0,e(this,f)[o]=void 0,o===e(this,T))d(this,T,e(this,k)[o]);else if(o===e(this,E))d(this,E,e(this,R)[o]);else {let c=e(this,k)[o];e(this,R)[c]=e(this,R)[o];let y=e(this,R)[o];e(this,k)[y]=e(this,k)[o];}vt(this,_)._--,e(this,q).push(o);}}if(e(this,B)&&e(this,x)?.length){let o=e(this,x),u;for(;u=o?.shift();)(r=e(this,I))==null||r.call(this,...u);}return n},Dt=function(i){var s,n;for(let a of l(this,h,it).call(this,{allowStale:true})){let r=e(this,f)[a];if(l(this,h,S).call(this,r))r.__abortController.abort(new Error("deleted"));else {let o=e(this,b)[a];e(this,$)&&((s=e(this,X))==null||s.call(this,r,o,i)),e(this,B)&&e(this,x)?.push([r,o,i]);}}if(e(this,A).clear(),e(this,f).fill(void 0),e(this,b).fill(void 0),e(this,L)&&e(this,K)&&(e(this,L).fill(0),e(this,K).fill(0)),e(this,H)&&e(this,H).fill(0),d(this,E,0),d(this,T,0),e(this,q).length=0,d(this,V,0),d(this,_,0),e(this,B)&&e(this,x)){let a=e(this,x),r;for(;r=a?.shift();)(n=e(this,I))==null||n.call(this,...r);}};var Tt=Wt;var mt=class{cache;map=new Map;constructor(i){this.cache=new Tt({max:i.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(i){let s=this.map.delete(i);return s&&this.cache.delete(i),s}get forEach(){return this.map.forEach}get(i){let s=this.cache.get(i);return s||this.map.get(i)}has(i){return this.map.has(i)}set(i,s){return this.map.set(i,s),this.cache.set(i,s),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var ht;(a=>(a.log=(r,...o)=>console.log(`[Pixi\u2019VN] ${r}`,...o),a.warn=(r,...o)=>console.warn(`[Pixi\u2019VN] ${r}`,...o),a.error=(r,...o)=>console.error(`[Pixi\u2019VN] ${r}`,...o),a.info=(r,...o)=>console.info(`[Pixi\u2019VN] ${r}`,...o)))(ht||={});var pt=new mt({cacheSize:5}),Vt=new mt({cacheSize:5});function $t(t){return i=>{Gt.add(i,t);}}var Gt;(u=>{function t(c,y){let{toMemory:z}=y,m=y.name??c.name;pt.get(m)&&ht.info(`Filter "${m}" already exists, it will be overwritten`),c.prototype.pixivnFilterId=m,pt.set(m,c),Vt.set(m,z);}u.add=t;function i(c){let y=pt.get(c);if(!y){ht.error(`Filter "${c}" not found, did you forget to register it with the filterDecorator?`);return}return y}u.get=i;function s(c,y,z){let m=i(c);if(m)try{let W=new m(structuredClone(y));return typeof z=="number"&&(W.padding=z),W}catch(W){ht.error(`Error while getting Filter instance "${c}"`,W);return}}u.getInstance=s;function n(c,y){let z=Vt.get(c);if(!z){ht.error(`Filter "${c}" not found, did you forget to register it with the filterDecorator?`);return}try{let m={filterId:c,args:z(y)};return typeof y.padding=="number"&&y.padding!==0&&(m.padding=y.padding),m}catch(m){ht.error(`Error while converting Filter "${c}" to memory`,m);return}}u.toMemory=n;function a(){return Array.from(pt.values())}u.values=a;function r(c){return pt.has(c)}u.has=r;function o(){return Array.from(pt.keys())}u.keys=o;})(Gt||={});var g=Gt;function O(t,i){return {x:t,y:i}}g.add(pixi_js.BlurFilter,{name:"BlurFilter",toMemory:t=>({strengthX:t.strengthX,strengthY:t.strengthY,quality:t.quality,repeatEdgePixels:t.repeatEdgePixels})});g.add(pixi_js.AlphaFilter,{name:"AlphaFilter",toMemory:t=>({alpha:t.alpha})});g.add(pixi_js.NoiseFilter,{name:"NoiseFilter",toMemory:t=>({noise:t.noise,seed:t.seed})});g.add(pixiFilters.PixelateFilter,{name:"PixelateFilter",toMemory:t=>[t.sizeX,t.sizeY]});g.add(pixiFilters.AdjustmentFilter,{name:"AdjustmentFilter",toMemory:t=>({gamma:t.gamma,contrast:t.contrast,saturation:t.saturation,brightness:t.brightness,red:t.red,green:t.green,blue:t.blue,alpha:t.alpha})});g.add(pixiFilters.AdvancedBloomFilter,{name:"AdvancedBloomFilter",toMemory:t=>({threshold:t.threshold,bloomScale:t.bloomScale,brightness:t.brightness,blur:t.blur,kernels:t.kernels,quality:t.quality,pixelSize:O(t.pixelSizeX,t.pixelSizeY)})});g.add(pixiFilters.AsciiFilter,{name:"AsciiFilter",toMemory:t=>({size:t.size,color:t.color,replaceColor:t.replaceColor})});g.add(pixiFilters.BackdropBlurFilter,{name:"BackdropBlurFilter",toMemory:t=>({strength:t.strength,quality:t.quality})});g.add(pixiFilters.BevelFilter,{name:"BevelFilter",toMemory:t=>({rotation:t.rotation,thickness:t.thickness,lightColor:t.lightColor,lightAlpha:t.lightAlpha,shadowColor:t.shadowColor,shadowAlpha:t.shadowAlpha})});g.add(pixiFilters.BloomFilter,{name:"BloomFilter",toMemory:t=>({strength:O(t.strengthX,t.strengthY)})});g.add(pixiFilters.BulgePinchFilter,{name:"BulgePinchFilter",toMemory:t=>({center:O(t.centerX,t.centerY),radius:t.radius,strength:t.strength})});g.add(pixiFilters.ColorGradientFilter,{name:"ColorGradientFilter",toMemory:t=>({type:t.type,stops:t.stops,angle:t.angle,alpha:t.alpha,maxColors:t.maxColors,replace:t.replace})});g.add(pixiFilters.ColorOverlayFilter,{name:"ColorOverlayFilter",toMemory:t=>({color:t.color,alpha:t.alpha})});g.add(pixiFilters.ColorReplaceFilter,{name:"ColorReplaceFilter",toMemory:t=>({originalColor:t.originalColor,targetColor:t.targetColor,tolerance:t.tolerance})});g.add(pixiFilters.ConvolutionFilter,{name:"ConvolutionFilter",toMemory:t=>({matrix:t.matrix,width:t.width,height:t.height})});g.add(pixiFilters.CrossHatchFilter,{name:"CrossHatchFilter",toMemory:()=>({})});g.add(pixiFilters.CRTFilter,{name:"CRTFilter",toMemory:t=>({curvature:t.curvature,lineWidth:t.lineWidth,lineContrast:t.lineContrast,verticalLine:t.verticalLine,noise:t.noise,noiseSize:t.noiseSize,vignetting:t.vignetting,vignettingAlpha:t.vignettingAlpha,vignettingBlur:t.vignettingBlur,seed:t.seed,time:t.time})});g.add(pixiFilters.DotFilter,{name:"DotFilter",toMemory:t=>({scale:t.scale,angle:t.angle,grayscale:t.grayscale})});g.add(pixiFilters.DropShadowFilter,{name:"DropShadowFilter",toMemory:t=>({offset:O(t.offsetX,t.offsetY),color:t.color,alpha:t.alpha,shadowOnly:t.shadowOnly,blur:t.blur,quality:t.quality,kernels:t.kernels,pixelSize:O(t.pixelSizeX,t.pixelSizeY)})});g.add(pixiFilters.EmbossFilter,{name:"EmbossFilter",toMemory:t=>t.strength});g.add(pixiFilters.GlitchFilter,{name:"GlitchFilter",toMemory:t=>({slices:t.slices,offset:t.offset,direction:t.direction,fillMode:t.fillMode,seed:t.seed,average:t.average,minSize:t.minSize,sampleSize:t.sampleSize,red:t.red,green:t.green,blue:t.blue})});g.add(pixiFilters.GlowFilter,{name:"GlowFilter",toMemory:t=>({distance:t.distance,outerStrength:t.outerStrength,innerStrength:t.innerStrength,color:t.color,alpha:t.alpha,quality:t.quality,knockout:t.knockout})});g.add(pixiFilters.GodrayFilter,{name:"GodrayFilter",toMemory:t=>({angle:t.angle,parallel:t.parallel,center:O(t.centerX,t.centerY),gain:t.gain,lacunarity:t.lacunarity,time:t.time,alpha:t.alpha})});g.add(pixiFilters.GrayscaleFilter,{name:"GrayscaleFilter",toMemory:()=>({})});g.add(pixiFilters.HslAdjustmentFilter,{name:"HslAdjustmentFilter",toMemory:t=>({hue:t.hue,saturation:t.saturation,lightness:t.lightness,colorize:t.colorize,alpha:t.alpha})});g.add(pixiFilters.KawaseBlurFilter,{name:"KawaseBlurFilter",toMemory:t=>({strength:t.strength,quality:t.quality,pixelSize:O(t.pixelSizeX,t.pixelSizeY)})});g.add(pixiFilters.MotionBlurFilter,{name:"MotionBlurFilter",toMemory:t=>({velocity:O(t.velocityX,t.velocityY),kernelSize:t.kernelSize,offset:t.offset})});g.add(pixiFilters.MultiColorReplaceFilter,{name:"MultiColorReplaceFilter",toMemory:t=>({replacements:t.replacements,tolerance:t.tolerance})});g.add(pixiFilters.OldFilmFilter,{name:"OldFilmFilter",toMemory:t=>({sepia:t.sepia,noise:t.noise,noiseSize:t.noiseSize,scratch:t.scratch,scratchDensity:t.scratchDensity,scratchWidth:t.scratchWidth,vignetting:t.vignetting,vignettingAlpha:t.vignettingAlpha,vignettingBlur:t.vignettingBlur,seed:t.seed})});g.add(pixiFilters.OutlineFilter,{name:"OutlineFilter",toMemory:t=>({thickness:t.thickness,color:t.color,alpha:t.alpha,quality:t.quality,knockout:t.knockout})});g.add(pixiFilters.RadialBlurFilter,{name:"RadialBlurFilter",toMemory:t=>({angle:t.angle,center:O(t.centerX,t.centerY),kernelSize:t.kernelSize,radius:t.radius})});g.add(pixiFilters.ReflectionFilter,{name:"ReflectionFilter",toMemory:t=>({mirror:t.mirror,boundary:t.boundary,amplitude:t.amplitude,waveLength:t.waveLength,alpha:t.alpha,time:t.time})});g.add(pixiFilters.RGBSplitFilter,{name:"RGBSplitFilter",toMemory:t=>({red:O(t.redX,t.redY),green:O(t.greenX,t.greenY),blue:O(t.blueX,t.blueY)})});g.add(pixiFilters.ShockwaveFilter,{name:"ShockwaveFilter",toMemory:t=>({center:O(t.centerX,t.centerY),speed:t.speed,amplitude:t.amplitude,wavelength:t.wavelength,brightness:t.brightness,radius:t.radius,time:t.time})});g.add(pixiFilters.SimplexNoiseFilter,{name:"SimplexNoiseFilter",toMemory:t=>({strength:t.strength,noiseScale:t.noiseScale,offsetX:t.offsetX,offsetY:t.offsetY,offsetZ:t.offsetZ,step:t.step})});g.add(pixiFilters.TiltShiftFilter,{name:"TiltShiftFilter",toMemory:t=>({blur:t.blur,gradientBlur:t.gradientBlur,start:O(t.startX,t.startY),end:O(t.endX,t.endY)})});g.add(pixiFilters.TwistFilter,{name:"TwistFilter",toMemory:t=>({radius:t.radius,angle:t.angle,offset:O(t.offsetX,t.offsetY)})});g.add(pixiFilters.ZoomBlurFilter,{name:"ZoomBlurFilter",toMemory:t=>({strength:t.strength,center:O(t.centerX,t.centerY),innerRadius:t.innerRadius,radius:t.radius})});function Si(t,i,s,n,a,r,o,u){return core.GameUnifier.animateFilter(t,i,s,n,a,r,o,u)}var Pi={AlphaFilter:pixi_js.AlphaFilter,BlurFilter:pixi_js.BlurFilter,NoiseFilter:pixi_js.NoiseFilter,AdjustmentFilter:pixiFilters.AdjustmentFilter,AdvancedBloomFilter:pixiFilters.AdvancedBloomFilter,AsciiFilter:pixiFilters.AsciiFilter,BackdropBlurFilter:pixiFilters.BackdropBlurFilter,BevelFilter:pixiFilters.BevelFilter,BloomFilter:pixiFilters.BloomFilter,BulgePinchFilter:pixiFilters.BulgePinchFilter,ColorGradientFilter:pixiFilters.ColorGradientFilter,ColorOverlayFilter:pixiFilters.ColorOverlayFilter,ColorReplaceFilter:pixiFilters.ColorReplaceFilter,ConvolutionFilter:pixiFilters.ConvolutionFilter,CRTFilter:pixiFilters.CRTFilter,CrossHatchFilter:pixiFilters.CrossHatchFilter,DotFilter:pixiFilters.DotFilter,DropShadowFilter:pixiFilters.DropShadowFilter,EmbossFilter:pixiFilters.EmbossFilter,GlitchFilter:pixiFilters.GlitchFilter,GlowFilter:pixiFilters.GlowFilter,GodrayFilter:pixiFilters.GodrayFilter,GrayscaleFilter:pixiFilters.GrayscaleFilter,HslAdjustmentFilter:pixiFilters.HslAdjustmentFilter,KawaseBlurFilter:pixiFilters.KawaseBlurFilter,MotionBlurFilter:pixiFilters.MotionBlurFilter,MultiColorReplaceFilter:pixiFilters.MultiColorReplaceFilter,OldFilmFilter:pixiFilters.OldFilmFilter,OutlineFilter:pixiFilters.OutlineFilter,PixelateFilter:pixiFilters.PixelateFilter,RadialBlurFilter:pixiFilters.RadialBlurFilter,ReflectionFilter:pixiFilters.ReflectionFilter,RGBSplitFilter:pixiFilters.RGBSplitFilter,ShockwaveFilter:pixiFilters.ShockwaveFilter,SimplexNoiseFilter:pixiFilters.SimplexNoiseFilter,TiltShiftFilter:pixiFilters.TiltShiftFilter,TwistFilter:pixiFilters.TwistFilter,ZoomBlurFilter:pixiFilters.ZoomBlurFilter,animate:Si};exports.RegisteredFilters=g;exports.filterDecorator=$t;exports.filters=Pi;
|
package/dist/filters.d.cts
CHANGED
|
@@ -51,9 +51,10 @@ declare namespace RegisteredFilters {
|
|
|
51
51
|
* Get a filter instance by the id, reconstructed from previously saved `args`.
|
|
52
52
|
* @param filterId The id of the filter.
|
|
53
53
|
* @param args The arguments to pass to the filter's constructor, as produced by a previous `toMemory` call.
|
|
54
|
+
* @param padding The filter's saved `padding`, if any (see {@link FilterMemory.padding}).
|
|
54
55
|
* @returns The filter instance, or `undefined` if the filter isn't registered or construction failed.
|
|
55
56
|
*/
|
|
56
|
-
function getInstance(filterId: string, args: any): Filter | undefined;
|
|
57
|
+
function getInstance(filterId: string, args: any, padding?: number): Filter | undefined;
|
|
57
58
|
/**
|
|
58
59
|
* Reads a live filter instance's current parameters into a serializable {@link FilterMemory}, using
|
|
59
60
|
* the `toMemory` function it was registered with.
|
|
@@ -64,6 +65,7 @@ declare namespace RegisteredFilters {
|
|
|
64
65
|
function toMemory(filterId: string, filter: Filter): {
|
|
65
66
|
filterId: string;
|
|
66
67
|
args: any;
|
|
68
|
+
padding?: number;
|
|
67
69
|
} | undefined;
|
|
68
70
|
/**
|
|
69
71
|
* Get a list of all filter classes registered.
|
|
@@ -104,6 +106,12 @@ interface FilterMemory {
|
|
|
104
106
|
* `toMemory` function.
|
|
105
107
|
*/
|
|
106
108
|
args: any;
|
|
109
|
+
/**
|
|
110
|
+
* The filter's `padding` (extra pixels its area grows by on every side), when set. It's a property of
|
|
111
|
+
* every `Filter`, not part of a specific filter's constructor `args`, so it's saved on its own -
|
|
112
|
+
* without it a restored distortion/blur would be clipped to the element's bounds again.
|
|
113
|
+
*/
|
|
114
|
+
padding?: number;
|
|
107
115
|
}
|
|
108
116
|
|
|
109
117
|
/**
|
|
@@ -123,9 +131,15 @@ interface FilterMemory {
|
|
|
123
131
|
* `undefined`, ignored otherwise.
|
|
124
132
|
* @param cleanup Called once, right before completion handling, to detach/destroy the filter or tear
|
|
125
133
|
* down whatever `apply` was driving.
|
|
134
|
+
* @param valueRef Plain, serializable description of what `apply`/`cleanup` drive (`{ alias, config }` of a
|
|
135
|
+
* mask-based transition), saved with the ticker so it can be rebuilt after a save restore or a step back -
|
|
136
|
+
* without it an `apply`-only ticker cannot be reconstructed.
|
|
126
137
|
* @returns The id of the ticker, or `undefined` if the ticker was not added.
|
|
127
138
|
*/
|
|
128
|
-
declare function animate(components: string | string[], filter: Filter | undefined, keyframes: Record<string, any>, options?: AnimationOptions, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void
|
|
139
|
+
declare function animate(components: string | string[], filter: Filter | undefined, keyframes: Record<string, any>, options?: AnimationOptions, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void, valueRef?: {
|
|
140
|
+
alias: string;
|
|
141
|
+
config: unknown;
|
|
142
|
+
}): string | undefined;
|
|
129
143
|
/**
|
|
130
144
|
* Every filter class Pixi'VN registers for save/restore out of the box (see
|
|
131
145
|
* `register-builtin-filters.ts`), grouped in one place so a project can use them without importing
|
|
@@ -179,4 +193,5 @@ declare const filters: {
|
|
|
179
193
|
readonly animate: typeof animate;
|
|
180
194
|
};
|
|
181
195
|
|
|
182
|
-
export {
|
|
196
|
+
export { RegisteredFilters, filterDecorator, filters };
|
|
197
|
+
export type { FilterMemory };
|
package/dist/filters.d.ts
CHANGED
|
@@ -51,9 +51,10 @@ declare namespace RegisteredFilters {
|
|
|
51
51
|
* Get a filter instance by the id, reconstructed from previously saved `args`.
|
|
52
52
|
* @param filterId The id of the filter.
|
|
53
53
|
* @param args The arguments to pass to the filter's constructor, as produced by a previous `toMemory` call.
|
|
54
|
+
* @param padding The filter's saved `padding`, if any (see {@link FilterMemory.padding}).
|
|
54
55
|
* @returns The filter instance, or `undefined` if the filter isn't registered or construction failed.
|
|
55
56
|
*/
|
|
56
|
-
function getInstance(filterId: string, args: any): Filter | undefined;
|
|
57
|
+
function getInstance(filterId: string, args: any, padding?: number): Filter | undefined;
|
|
57
58
|
/**
|
|
58
59
|
* Reads a live filter instance's current parameters into a serializable {@link FilterMemory}, using
|
|
59
60
|
* the `toMemory` function it was registered with.
|
|
@@ -64,6 +65,7 @@ declare namespace RegisteredFilters {
|
|
|
64
65
|
function toMemory(filterId: string, filter: Filter): {
|
|
65
66
|
filterId: string;
|
|
66
67
|
args: any;
|
|
68
|
+
padding?: number;
|
|
67
69
|
} | undefined;
|
|
68
70
|
/**
|
|
69
71
|
* Get a list of all filter classes registered.
|
|
@@ -104,6 +106,12 @@ interface FilterMemory {
|
|
|
104
106
|
* `toMemory` function.
|
|
105
107
|
*/
|
|
106
108
|
args: any;
|
|
109
|
+
/**
|
|
110
|
+
* The filter's `padding` (extra pixels its area grows by on every side), when set. It's a property of
|
|
111
|
+
* every `Filter`, not part of a specific filter's constructor `args`, so it's saved on its own -
|
|
112
|
+
* without it a restored distortion/blur would be clipped to the element's bounds again.
|
|
113
|
+
*/
|
|
114
|
+
padding?: number;
|
|
107
115
|
}
|
|
108
116
|
|
|
109
117
|
/**
|
|
@@ -123,9 +131,15 @@ interface FilterMemory {
|
|
|
123
131
|
* `undefined`, ignored otherwise.
|
|
124
132
|
* @param cleanup Called once, right before completion handling, to detach/destroy the filter or tear
|
|
125
133
|
* down whatever `apply` was driving.
|
|
134
|
+
* @param valueRef Plain, serializable description of what `apply`/`cleanup` drive (`{ alias, config }` of a
|
|
135
|
+
* mask-based transition), saved with the ticker so it can be rebuilt after a save restore or a step back -
|
|
136
|
+
* without it an `apply`-only ticker cannot be reconstructed.
|
|
126
137
|
* @returns The id of the ticker, or `undefined` if the ticker was not added.
|
|
127
138
|
*/
|
|
128
|
-
declare function animate(components: string | string[], filter: Filter | undefined, keyframes: Record<string, any>, options?: AnimationOptions, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void
|
|
139
|
+
declare function animate(components: string | string[], filter: Filter | undefined, keyframes: Record<string, any>, options?: AnimationOptions, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void, valueRef?: {
|
|
140
|
+
alias: string;
|
|
141
|
+
config: unknown;
|
|
142
|
+
}): string | undefined;
|
|
129
143
|
/**
|
|
130
144
|
* Every filter class Pixi'VN registers for save/restore out of the box (see
|
|
131
145
|
* `register-builtin-filters.ts`), grouped in one place so a project can use them without importing
|
|
@@ -179,4 +193,5 @@ declare const filters: {
|
|
|
179
193
|
readonly animate: typeof animate;
|
|
180
194
|
};
|
|
181
195
|
|
|
182
|
-
export {
|
|
196
|
+
export { RegisteredFilters, filterDecorator, filters };
|
|
197
|
+
export type { FilterMemory };
|
package/dist/filters.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d as d$1,e}from'./chunk-
|
|
1
|
+
import {d as d$1,e}from'./chunk-B46NFIFC.mjs';import {GameUnifier}from'@drincs/pixi-vn/core';import {BlurFilter,AlphaFilter,NoiseFilter}from'@drincs/pixi-vn/pixi.js';import {PixelateFilter,AdjustmentFilter,AdvancedBloomFilter,AsciiFilter,BackdropBlurFilter,BevelFilter,BloomFilter,BulgePinchFilter,ColorGradientFilter,ColorOverlayFilter,ColorReplaceFilter,ConvolutionFilter,CrossHatchFilter,CRTFilter,DotFilter,DropShadowFilter,EmbossFilter,GlitchFilter,GlowFilter,GodrayFilter,GrayscaleFilter,HslAdjustmentFilter,KawaseBlurFilter,MotionBlurFilter,MultiColorReplaceFilter,OldFilmFilter,OutlineFilter,RadialBlurFilter,ReflectionFilter,RGBSplitFilter,ShockwaveFilter,SimplexNoiseFilter,TiltShiftFilter,TwistFilter,ZoomBlurFilter}from'pixi-filters';var d=new d$1({cacheSize:5}),v=new d$1({cacheSize:5});function S(e){return i=>{u.add(i,e);}}var u;(M=>{function e$1(o,a){let{toMemory:l}=a,n=a.name??o.name;d.get(n)&&e.info(`Filter "${n}" already exists, it will be overwritten`),o.prototype.pixivnFilterId=n,d.set(n,o),v.set(n,l);}M.add=e$1;function i(o){let a=d.get(o);if(!a){e.error(`Filter "${o}" not found, did you forget to register it with the filterDecorator?`);return}return a}M.get=i;function g(o,a,l){let n=i(o);if(n)try{let m=new n(structuredClone(a));return typeof l=="number"&&(m.padding=l),m}catch(m){e.error(`Error while getting Filter instance "${o}"`,m);return}}M.getInstance=g;function F(o,a){let l=v.get(o);if(!l){e.error(`Filter "${o}" not found, did you forget to register it with the filterDecorator?`);return}try{let n={filterId:o,args:l(a)};return typeof a.padding=="number"&&a.padding!==0&&(n.padding=a.padding),n}catch(n){e.error(`Error while converting Filter "${o}" to memory`,n);return}}M.toMemory=F;function p(){return Array.from(d.values())}M.values=p;function h(o){return d.has(o)}M.has=h;function y(){return Array.from(d.keys())}M.keys=y;})(u||={});var t=u;function r(e,i){return {x:e,y:i}}t.add(BlurFilter,{name:"BlurFilter",toMemory:e=>({strengthX:e.strengthX,strengthY:e.strengthY,quality:e.quality,repeatEdgePixels:e.repeatEdgePixels})});t.add(AlphaFilter,{name:"AlphaFilter",toMemory:e=>({alpha:e.alpha})});t.add(NoiseFilter,{name:"NoiseFilter",toMemory:e=>({noise:e.noise,seed:e.seed})});t.add(PixelateFilter,{name:"PixelateFilter",toMemory:e=>[e.sizeX,e.sizeY]});t.add(AdjustmentFilter,{name:"AdjustmentFilter",toMemory:e=>({gamma:e.gamma,contrast:e.contrast,saturation:e.saturation,brightness:e.brightness,red:e.red,green:e.green,blue:e.blue,alpha:e.alpha})});t.add(AdvancedBloomFilter,{name:"AdvancedBloomFilter",toMemory:e=>({threshold:e.threshold,bloomScale:e.bloomScale,brightness:e.brightness,blur:e.blur,kernels:e.kernels,quality:e.quality,pixelSize:r(e.pixelSizeX,e.pixelSizeY)})});t.add(AsciiFilter,{name:"AsciiFilter",toMemory:e=>({size:e.size,color:e.color,replaceColor:e.replaceColor})});t.add(BackdropBlurFilter,{name:"BackdropBlurFilter",toMemory:e=>({strength:e.strength,quality:e.quality})});t.add(BevelFilter,{name:"BevelFilter",toMemory:e=>({rotation:e.rotation,thickness:e.thickness,lightColor:e.lightColor,lightAlpha:e.lightAlpha,shadowColor:e.shadowColor,shadowAlpha:e.shadowAlpha})});t.add(BloomFilter,{name:"BloomFilter",toMemory:e=>({strength:r(e.strengthX,e.strengthY)})});t.add(BulgePinchFilter,{name:"BulgePinchFilter",toMemory:e=>({center:r(e.centerX,e.centerY),radius:e.radius,strength:e.strength})});t.add(ColorGradientFilter,{name:"ColorGradientFilter",toMemory:e=>({type:e.type,stops:e.stops,angle:e.angle,alpha:e.alpha,maxColors:e.maxColors,replace:e.replace})});t.add(ColorOverlayFilter,{name:"ColorOverlayFilter",toMemory:e=>({color:e.color,alpha:e.alpha})});t.add(ColorReplaceFilter,{name:"ColorReplaceFilter",toMemory:e=>({originalColor:e.originalColor,targetColor:e.targetColor,tolerance:e.tolerance})});t.add(ConvolutionFilter,{name:"ConvolutionFilter",toMemory:e=>({matrix:e.matrix,width:e.width,height:e.height})});t.add(CrossHatchFilter,{name:"CrossHatchFilter",toMemory:()=>({})});t.add(CRTFilter,{name:"CRTFilter",toMemory:e=>({curvature:e.curvature,lineWidth:e.lineWidth,lineContrast:e.lineContrast,verticalLine:e.verticalLine,noise:e.noise,noiseSize:e.noiseSize,vignetting:e.vignetting,vignettingAlpha:e.vignettingAlpha,vignettingBlur:e.vignettingBlur,seed:e.seed,time:e.time})});t.add(DotFilter,{name:"DotFilter",toMemory:e=>({scale:e.scale,angle:e.angle,grayscale:e.grayscale})});t.add(DropShadowFilter,{name:"DropShadowFilter",toMemory:e=>({offset:r(e.offsetX,e.offsetY),color:e.color,alpha:e.alpha,shadowOnly:e.shadowOnly,blur:e.blur,quality:e.quality,kernels:e.kernels,pixelSize:r(e.pixelSizeX,e.pixelSizeY)})});t.add(EmbossFilter,{name:"EmbossFilter",toMemory:e=>e.strength});t.add(GlitchFilter,{name:"GlitchFilter",toMemory:e=>({slices:e.slices,offset:e.offset,direction:e.direction,fillMode:e.fillMode,seed:e.seed,average:e.average,minSize:e.minSize,sampleSize:e.sampleSize,red:e.red,green:e.green,blue:e.blue})});t.add(GlowFilter,{name:"GlowFilter",toMemory:e=>({distance:e.distance,outerStrength:e.outerStrength,innerStrength:e.innerStrength,color:e.color,alpha:e.alpha,quality:e.quality,knockout:e.knockout})});t.add(GodrayFilter,{name:"GodrayFilter",toMemory:e=>({angle:e.angle,parallel:e.parallel,center:r(e.centerX,e.centerY),gain:e.gain,lacunarity:e.lacunarity,time:e.time,alpha:e.alpha})});t.add(GrayscaleFilter,{name:"GrayscaleFilter",toMemory:()=>({})});t.add(HslAdjustmentFilter,{name:"HslAdjustmentFilter",toMemory:e=>({hue:e.hue,saturation:e.saturation,lightness:e.lightness,colorize:e.colorize,alpha:e.alpha})});t.add(KawaseBlurFilter,{name:"KawaseBlurFilter",toMemory:e=>({strength:e.strength,quality:e.quality,pixelSize:r(e.pixelSizeX,e.pixelSizeY)})});t.add(MotionBlurFilter,{name:"MotionBlurFilter",toMemory:e=>({velocity:r(e.velocityX,e.velocityY),kernelSize:e.kernelSize,offset:e.offset})});t.add(MultiColorReplaceFilter,{name:"MultiColorReplaceFilter",toMemory:e=>({replacements:e.replacements,tolerance:e.tolerance})});t.add(OldFilmFilter,{name:"OldFilmFilter",toMemory:e=>({sepia:e.sepia,noise:e.noise,noiseSize:e.noiseSize,scratch:e.scratch,scratchDensity:e.scratchDensity,scratchWidth:e.scratchWidth,vignetting:e.vignetting,vignettingAlpha:e.vignettingAlpha,vignettingBlur:e.vignettingBlur,seed:e.seed})});t.add(OutlineFilter,{name:"OutlineFilter",toMemory:e=>({thickness:e.thickness,color:e.color,alpha:e.alpha,quality:e.quality,knockout:e.knockout})});t.add(RadialBlurFilter,{name:"RadialBlurFilter",toMemory:e=>({angle:e.angle,center:r(e.centerX,e.centerY),kernelSize:e.kernelSize,radius:e.radius})});t.add(ReflectionFilter,{name:"ReflectionFilter",toMemory:e=>({mirror:e.mirror,boundary:e.boundary,amplitude:e.amplitude,waveLength:e.waveLength,alpha:e.alpha,time:e.time})});t.add(RGBSplitFilter,{name:"RGBSplitFilter",toMemory:e=>({red:r(e.redX,e.redY),green:r(e.greenX,e.greenY),blue:r(e.blueX,e.blueY)})});t.add(ShockwaveFilter,{name:"ShockwaveFilter",toMemory:e=>({center:r(e.centerX,e.centerY),speed:e.speed,amplitude:e.amplitude,wavelength:e.wavelength,brightness:e.brightness,radius:e.radius,time:e.time})});t.add(SimplexNoiseFilter,{name:"SimplexNoiseFilter",toMemory:e=>({strength:e.strength,noiseScale:e.noiseScale,offsetX:e.offsetX,offsetY:e.offsetY,offsetZ:e.offsetZ,step:e.step})});t.add(TiltShiftFilter,{name:"TiltShiftFilter",toMemory:e=>({blur:e.blur,gradientBlur:e.gradientBlur,start:r(e.startX,e.startY),end:r(e.endX,e.endY)})});t.add(TwistFilter,{name:"TwistFilter",toMemory:e=>({radius:e.radius,angle:e.angle,offset:r(e.offsetX,e.offsetY)})});t.add(ZoomBlurFilter,{name:"ZoomBlurFilter",toMemory:e=>({strength:e.strength,center:r(e.centerX,e.centerY),innerRadius:e.innerRadius,radius:e.radius})});function $e(e,i,g,F,p,h,y,M){return GameUnifier.animateFilter(e,i,g,F,p,h,y,M)}var tt={AlphaFilter:AlphaFilter,BlurFilter:BlurFilter,NoiseFilter:NoiseFilter,AdjustmentFilter:AdjustmentFilter,AdvancedBloomFilter:AdvancedBloomFilter,AsciiFilter:AsciiFilter,BackdropBlurFilter:BackdropBlurFilter,BevelFilter:BevelFilter,BloomFilter:BloomFilter,BulgePinchFilter:BulgePinchFilter,ColorGradientFilter:ColorGradientFilter,ColorOverlayFilter:ColorOverlayFilter,ColorReplaceFilter:ColorReplaceFilter,ConvolutionFilter:ConvolutionFilter,CRTFilter:CRTFilter,CrossHatchFilter:CrossHatchFilter,DotFilter:DotFilter,DropShadowFilter:DropShadowFilter,EmbossFilter:EmbossFilter,GlitchFilter:GlitchFilter,GlowFilter:GlowFilter,GodrayFilter:GodrayFilter,GrayscaleFilter:GrayscaleFilter,HslAdjustmentFilter:HslAdjustmentFilter,KawaseBlurFilter:KawaseBlurFilter,MotionBlurFilter:MotionBlurFilter,MultiColorReplaceFilter:MultiColorReplaceFilter,OldFilmFilter:OldFilmFilter,OutlineFilter:OutlineFilter,PixelateFilter:PixelateFilter,RadialBlurFilter:RadialBlurFilter,ReflectionFilter:ReflectionFilter,RGBSplitFilter:RGBSplitFilter,ShockwaveFilter:ShockwaveFilter,SimplexNoiseFilter:SimplexNoiseFilter,TiltShiftFilter:TiltShiftFilter,TwistFilter:TwistFilter,ZoomBlurFilter:ZoomBlurFilter,animate:$e};export{t as RegisteredFilters,S as filterDecorator,tt as filters};
|